@solexllc/usx-react 0.5.0 → 0.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.
- package/README.md +99 -0
- package/dist/index.cjs +262 -183
- package/dist/index.js +262 -183
- package/package.json +5 -5
- package/src/components/callout/Callout.tsx +1 -1
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/callout.html +3 -3
- package/src/components/clickable/clickable.html +1 -1
- package/src/components/container/Container.tsx +108 -0
- package/src/components/container/_layout-classes.django.html +12 -0
- package/src/components/container/config.json +288 -0
- package/src/components/container/container.django.html +13 -0
- package/src/components/container/container.html +125 -0
- package/src/components/quote/quote.html +4 -4
- package/src/index.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solexllc/usx-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "React component library for USX.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@solexllc/usx": "0.
|
|
29
|
-
"@solexllc/usx-theme": "0.
|
|
30
|
-
"@solexllc/usx-uswds-fixes": "0.1.
|
|
28
|
+
"@solexllc/usx": "0.8.0",
|
|
29
|
+
"@solexllc/usx-theme": "0.9.0",
|
|
30
|
+
"@solexllc/usx-uswds-fixes": "0.1.13",
|
|
31
31
|
"classnames": "^2.5.1",
|
|
32
32
|
"prop-types": "^15.8.1"
|
|
33
33
|
},
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "vite build",
|
|
47
|
-
"test": "pnpm build && node test/toggle-check.mjs && node test/quote-check.mjs && node test/composition-check.mjs && node test/asset-url-check.mjs"
|
|
47
|
+
"test": "pnpm build && node test/toggle-check.mjs && node test/quote-check.mjs && node test/composition-check.mjs && node test/asset-url-check.mjs && node test/container-check.mjs"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -37,7 +37,7 @@ export default function Callout({
|
|
|
37
37
|
className={ClassNames(
|
|
38
38
|
'usx-callout',
|
|
39
39
|
orientation === 'vertical' && 'usx-callout--vertical',
|
|
40
|
-
strokeColor && `
|
|
40
|
+
strokeColor && `border-${strokeColor}`,
|
|
41
41
|
indent && `usx-callout--indent-${indent}`,
|
|
42
42
|
dedent && 'usx-callout--dedent',
|
|
43
43
|
(big ?? orientation === 'horizontal') && 'usx-callout--big',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{% with tag=element|default:'div' %}
|
|
2
|
-
<{% if tag == 'section' or tag == 'aside' or tag == 'blockquote' %}{{ tag }}{% else %}div{% endif %} class="usx-callout{% if orientation == 'vertical' %} usx-callout--vertical{% endif %}{% if strokeColor %}
|
|
2
|
+
<{% if tag == 'section' or tag == 'aside' or tag == 'blockquote' %}{{ tag }}{% else %}div{% endif %} class="usx-callout{% if orientation == 'vertical' %} usx-callout--vertical{% endif %}{% if strokeColor %} border-{{ strokeColor }}{% endif %}{% if indent %} usx-callout--indent-{{ indent }}{% endif %}{% if dedent %} usx-callout--dedent{% endif %}{% if big or orientation|default:'horizontal' == 'horizontal' %}{% if big is not False %} usx-callout--big{% endif %}{% endif %}{% if backgroundColor %} bg-{{ backgroundColor }}{% endif %}{% if textColor %} text-{{ textColor }}{% endif %}{% if className %} {{ className }}{% endif %}"{% if tag == 'blockquote' and cite %} cite="{{ cite }}"{% endif %}>
|
|
3
3
|
{% if children != None %}{{ children|safe }}{% elif content != None %}{{ content|safe }}{% endif %}
|
|
4
4
|
</{% if tag == 'section' or tag == 'aside' or tag == 'blockquote' %}{{ tag }}{% else %}div{% endif %}>
|
|
5
5
|
{% endwith %}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<section class="margin-bottom-4">
|
|
8
8
|
<h2>Thin Horizontal</h2>
|
|
9
|
-
<div class="usx-callout
|
|
9
|
+
<div class="usx-callout border-info">A horizontal callout with a thinner left border.</div>
|
|
10
10
|
</section>
|
|
11
11
|
|
|
12
12
|
<section class="margin-bottom-4">
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
<section class="margin-bottom-4">
|
|
18
18
|
<h2>Big Vertical</h2>
|
|
19
|
-
<div class="usx-callout usx-callout--vertical
|
|
19
|
+
<div class="usx-callout usx-callout--vertical border-info usx-callout--big">A vertical callout with a thicker top border.</div>
|
|
20
20
|
</section>
|
|
21
21
|
|
|
22
22
|
<section class="margin-bottom-4">
|
|
23
23
|
<h2>Colors</h2>
|
|
24
|
-
<div class="usx-callout
|
|
24
|
+
<div class="usx-callout border-primary usx-callout--big bg-base-lightest text-primary padding-y-2 padding-right-2">Independent border, background, text, and spacing styles.</div>
|
|
25
25
|
</section>
|
|
26
26
|
|
|
27
27
|
<section class="margin-bottom-4">
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<h3 class="site-preview-heading margin-top-5">Clickable Quote</h3>
|
|
76
76
|
<a class="usx-clickable display-block maxw-tablet" href="https://google.com">
|
|
77
77
|
<div class="usx-quote usx-quote--vertical">
|
|
78
|
-
<div class="usx-callout usx-callout--vertical
|
|
78
|
+
<div class="usx-callout usx-callout--vertical border-primary">
|
|
79
79
|
<figure class="usx-quote__body">
|
|
80
80
|
<blockquote class="usx-quote__content font-serif-lg">❝We found this wand shop that had the best wands, and we were like, "We have to go here!" So we went there.❞</blockquote>
|
|
81
81
|
<figcaption class="usx-quote__attribution">
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ClassNames from 'classnames';
|
|
3
|
+
import config from './config.json';
|
|
4
|
+
|
|
5
|
+
type Column = 'auto' | 'fill' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
6
|
+
type Spacing = '0' | '2px' | '05' | '1' | '2' | '3' | '4' | '5' | '6';
|
|
7
|
+
|
|
8
|
+
export interface ContainerLayout {
|
|
9
|
+
display?: 'block' | 'flex' | 'inline' | 'inline-block' | 'inline-flex' | 'none' | 'flow-root';
|
|
10
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
11
|
+
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
12
|
+
justify?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
13
|
+
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
|
|
14
|
+
alignSelf?: 'auto' | 'start' | 'end' | 'center' | 'stretch' | 'baseline';
|
|
15
|
+
flex?: 'auto' | 'fill' | 'none';
|
|
16
|
+
gap?: Spacing;
|
|
17
|
+
column?: Column;
|
|
18
|
+
offset?: 'none' | Exclude<Column, 'auto' | 'fill'>;
|
|
19
|
+
gutters?: 'sm' | 'md' | 'lg' | Spacing;
|
|
20
|
+
float?: 'none' | 'left' | 'right';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ContainerProps extends ContainerLayout {
|
|
24
|
+
element?: 'div' | 'section' | 'article' | 'aside' | 'nav' | 'ul' | 'ol' | 'li';
|
|
25
|
+
gridContainer?: 'default' | 'card' | 'card-lg' | 'mobile' | 'mobile-lg' | 'tablet' | 'tablet-lg' | 'desktop' | 'desktop-lg' | 'widescreen';
|
|
26
|
+
gridRow?: boolean;
|
|
27
|
+
responsive?: Partial<Record<'mobileLg' | 'tablet' | 'desktop', ContainerLayout>>;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
content?: React.ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
id?: string;
|
|
32
|
+
role?: string;
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
ariaLabelledby?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const breakpoints = [['mobileLg', 'mobile-lg'], ['tablet', 'tablet'], ['desktop', 'desktop']] as const;
|
|
38
|
+
const layoutKeys = [
|
|
39
|
+
'display', 'direction', 'wrap', 'justify', 'align', 'alignSelf',
|
|
40
|
+
'flex', 'gap', 'column', 'offset', 'gutters', 'float',
|
|
41
|
+
] as const;
|
|
42
|
+
|
|
43
|
+
function layoutClasses(layout: ContainerLayout, prefix = ''): string[] {
|
|
44
|
+
if (!layout || typeof layout !== 'object' || Array.isArray(layout)) return [];
|
|
45
|
+
|
|
46
|
+
return layoutKeys.flatMap((key) => {
|
|
47
|
+
const value = layout[key];
|
|
48
|
+
// CMS payloads may bypass TypeScript. Only emit supported utility tokens.
|
|
49
|
+
if (typeof value !== 'string' || !config.props[key].options.includes(value)) return [];
|
|
50
|
+
let className: string;
|
|
51
|
+
if (key === 'column') className = `grid-col-${value}`;
|
|
52
|
+
else if (key === 'offset') className = `grid-offset-${value}`;
|
|
53
|
+
else if (key === 'gutters') className = `grid-gap-${value}`;
|
|
54
|
+
else className = `usx-container--${key === 'alignSelf' ? 'align-self' : key}-${value}`;
|
|
55
|
+
return [`${prefix}${className}`];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** An unstyled grouping element with opt-in, mobile-first layout controls. */
|
|
60
|
+
export default function Container({
|
|
61
|
+
element = 'div',
|
|
62
|
+
gridContainer,
|
|
63
|
+
gridRow = false,
|
|
64
|
+
display,
|
|
65
|
+
direction,
|
|
66
|
+
wrap,
|
|
67
|
+
justify,
|
|
68
|
+
align,
|
|
69
|
+
alignSelf,
|
|
70
|
+
flex,
|
|
71
|
+
gap,
|
|
72
|
+
column,
|
|
73
|
+
offset,
|
|
74
|
+
gutters,
|
|
75
|
+
float,
|
|
76
|
+
responsive,
|
|
77
|
+
children,
|
|
78
|
+
content,
|
|
79
|
+
className = '',
|
|
80
|
+
id,
|
|
81
|
+
role,
|
|
82
|
+
ariaLabel,
|
|
83
|
+
ariaLabelledby,
|
|
84
|
+
}: ContainerProps) {
|
|
85
|
+
const Element = config.props.element.options.includes(element) ? element : 'div';
|
|
86
|
+
const classes = ClassNames(
|
|
87
|
+
'usx-container',
|
|
88
|
+
gridContainer && config.props.gridContainer.options.includes(gridContainer)
|
|
89
|
+
? gridContainer === 'default' ? 'grid-container' : `grid-container-${gridContainer}`
|
|
90
|
+
: null,
|
|
91
|
+
{ 'grid-row': gridRow === true },
|
|
92
|
+
layoutClasses({ display, direction, wrap, justify, align, alignSelf, flex, gap, column, offset, gutters, float }),
|
|
93
|
+
breakpoints.map(([key, prefix]) => layoutClasses(responsive?.[key] ?? {}, `${prefix}:`)),
|
|
94
|
+
typeof className === 'string' ? className : undefined,
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Element
|
|
99
|
+
className={classes}
|
|
100
|
+
id={typeof id === 'string' ? id : undefined}
|
|
101
|
+
role={typeof role === 'string' ? role : undefined}
|
|
102
|
+
aria-label={typeof ariaLabel === 'string' ? ariaLabel : undefined}
|
|
103
|
+
aria-labelledby={typeof ariaLabelledby === 'string' ? ariaLabelledby : undefined}
|
|
104
|
+
>
|
|
105
|
+
{children ?? content}
|
|
106
|
+
</Element>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% if layout.display == 'block' or layout.display == 'flex' or layout.display == 'inline' or layout.display == 'inline-block' or layout.display == 'inline-flex' or layout.display == 'none' or layout.display == 'flow-root' %} {{ prefix }}usx-container--display-{{ layout.display }}{% endif %}
|
|
2
|
+
{% if layout.direction == 'row' or layout.direction == 'column' or layout.direction == 'row-reverse' or layout.direction == 'column-reverse' %} {{ prefix }}usx-container--direction-{{ layout.direction }}{% endif %}
|
|
3
|
+
{% if layout.wrap == 'wrap' or layout.wrap == 'nowrap' or layout.wrap == 'wrap-reverse' %} {{ prefix }}usx-container--wrap-{{ layout.wrap }}{% endif %}
|
|
4
|
+
{% if layout.justify == 'start' or layout.justify == 'end' or layout.justify == 'center' or layout.justify == 'space-between' or layout.justify == 'space-around' or layout.justify == 'space-evenly' %} {{ prefix }}usx-container--justify-{{ layout.justify }}{% endif %}
|
|
5
|
+
{% if layout.align == 'start' or layout.align == 'end' or layout.align == 'center' or layout.align == 'stretch' or layout.align == 'baseline' %} {{ prefix }}usx-container--align-{{ layout.align }}{% endif %}
|
|
6
|
+
{% if layout.alignSelf == 'auto' or layout.alignSelf == 'start' or layout.alignSelf == 'end' or layout.alignSelf == 'center' or layout.alignSelf == 'stretch' or layout.alignSelf == 'baseline' %} {{ prefix }}usx-container--align-self-{{ layout.alignSelf }}{% endif %}
|
|
7
|
+
{% if layout.flex == 'auto' or layout.flex == 'fill' or layout.flex == 'none' %} {{ prefix }}usx-container--flex-{{ layout.flex }}{% endif %}
|
|
8
|
+
{% if layout.gap == '0' or layout.gap == '2px' or layout.gap == '05' or layout.gap == '1' or layout.gap == '2' or layout.gap == '3' or layout.gap == '4' or layout.gap == '5' or layout.gap == '6' %} {{ prefix }}usx-container--gap-{{ layout.gap }}{% endif %}
|
|
9
|
+
{% if layout.column == 'auto' or layout.column == 'fill' or layout.column == '1' or layout.column == '2' or layout.column == '3' or layout.column == '4' or layout.column == '5' or layout.column == '6' or layout.column == '7' or layout.column == '8' or layout.column == '9' or layout.column == '10' or layout.column == '11' or layout.column == '12' %} {{ prefix }}grid-col-{{ layout.column }}{% endif %}
|
|
10
|
+
{% if layout.offset == 'none' or layout.offset == '1' or layout.offset == '2' or layout.offset == '3' or layout.offset == '4' or layout.offset == '5' or layout.offset == '6' or layout.offset == '7' or layout.offset == '8' or layout.offset == '9' or layout.offset == '10' or layout.offset == '11' or layout.offset == '12' %} {{ prefix }}grid-offset-{{ layout.offset }}{% endif %}
|
|
11
|
+
{% if layout.gutters == 'sm' or layout.gutters == 'md' or layout.gutters == 'lg' or layout.gutters == '0' or layout.gutters == '2px' or layout.gutters == '05' or layout.gutters == '1' or layout.gutters == '2' or layout.gutters == '3' or layout.gutters == '4' or layout.gutters == '5' or layout.gutters == '6' %} {{ prefix }}grid-gap-{{ layout.gutters }}{% endif %}
|
|
12
|
+
{% if layout.float == 'none' or layout.float == 'left' or layout.float == 'right' %} {{ prefix }}usx-container--float-{{ layout.float }}{% endif %}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "container",
|
|
3
|
+
"template": "container/container.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"element": {
|
|
7
|
+
"type": "select",
|
|
8
|
+
"description": "Root HTML element. Use a heading or accessible label for named sections and navigation; list roots require list-item children.",
|
|
9
|
+
"options": [
|
|
10
|
+
"div",
|
|
11
|
+
"section",
|
|
12
|
+
"article",
|
|
13
|
+
"aside",
|
|
14
|
+
"nav",
|
|
15
|
+
"ul",
|
|
16
|
+
"ol",
|
|
17
|
+
"li"
|
|
18
|
+
],
|
|
19
|
+
"default": "div"
|
|
20
|
+
},
|
|
21
|
+
"gridContainer": {
|
|
22
|
+
"type": "select",
|
|
23
|
+
"description": "Opt-in centered USWDS page-width container with side padding. Default uses the USX themed grid-container; named sizes use USWDS widths. Usually wrap a gridRow inside this container rather than combining them.",
|
|
24
|
+
"options": [
|
|
25
|
+
"default",
|
|
26
|
+
"card",
|
|
27
|
+
"card-lg",
|
|
28
|
+
"mobile",
|
|
29
|
+
"mobile-lg",
|
|
30
|
+
"tablet",
|
|
31
|
+
"tablet-lg",
|
|
32
|
+
"desktop",
|
|
33
|
+
"desktop-lg",
|
|
34
|
+
"widescreen"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"gridRow": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"description": "Use a wrapping USWDS grid row. Nest Containers with column settings as direct children. Omitted leaves the container unstyled.",
|
|
40
|
+
"default": false
|
|
41
|
+
},
|
|
42
|
+
"display": {
|
|
43
|
+
"type": "select",
|
|
44
|
+
"description": "Display mode. Choose flex or inline-flex to enable direction, wrap, alignment, and gap. Flow-root contains floated children; none hides the container and its descendants.",
|
|
45
|
+
"options": [
|
|
46
|
+
"block",
|
|
47
|
+
"flex",
|
|
48
|
+
"inline",
|
|
49
|
+
"inline-block",
|
|
50
|
+
"inline-flex",
|
|
51
|
+
"none",
|
|
52
|
+
"flow-root"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"direction": {
|
|
56
|
+
"type": "select",
|
|
57
|
+
"description": "Direction of flex children. Requires display flex or inline-flex (or gridRow). Reverse directions change visual order only, not reading or keyboard order.",
|
|
58
|
+
"options": [
|
|
59
|
+
"row",
|
|
60
|
+
"column",
|
|
61
|
+
"row-reverse",
|
|
62
|
+
"column-reverse"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"wrap": {
|
|
66
|
+
"type": "select",
|
|
67
|
+
"description": "Whether flex children wrap onto new lines. Set wrap for a flexible toolbar; omitted uses normal CSS behavior.",
|
|
68
|
+
"options": [
|
|
69
|
+
"wrap",
|
|
70
|
+
"nowrap",
|
|
71
|
+
"wrap-reverse"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"justify": {
|
|
75
|
+
"type": "select",
|
|
76
|
+
"description": "Distribute children along the main flex axis.",
|
|
77
|
+
"options": [
|
|
78
|
+
"start",
|
|
79
|
+
"end",
|
|
80
|
+
"center",
|
|
81
|
+
"space-between",
|
|
82
|
+
"space-around",
|
|
83
|
+
"space-evenly"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"align": {
|
|
87
|
+
"type": "select",
|
|
88
|
+
"description": "Align children across the flex axis.",
|
|
89
|
+
"options": [
|
|
90
|
+
"start",
|
|
91
|
+
"end",
|
|
92
|
+
"center",
|
|
93
|
+
"stretch",
|
|
94
|
+
"baseline"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"alignSelf": {
|
|
98
|
+
"type": "select",
|
|
99
|
+
"description": "Override this container’s alignment as a child of a flex parent. Auto restores parent alignment.",
|
|
100
|
+
"options": [
|
|
101
|
+
"auto",
|
|
102
|
+
"start",
|
|
103
|
+
"end",
|
|
104
|
+
"center",
|
|
105
|
+
"stretch",
|
|
106
|
+
"baseline"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"flex": {
|
|
110
|
+
"type": "select",
|
|
111
|
+
"description": "Size this container as a flex child: auto uses its content size, fill shares available space, none keeps its size. Use column instead when this is a USWDS grid column.",
|
|
112
|
+
"options": [
|
|
113
|
+
"auto",
|
|
114
|
+
"fill",
|
|
115
|
+
"none"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"gap": {
|
|
119
|
+
"type": "select",
|
|
120
|
+
"description": "Space between flex children using USWDS spacing tokens (1 = 8px, 05 = 4px). Use gutters instead on gridRow: CSS gap adds to percentage column widths.",
|
|
121
|
+
"options": [
|
|
122
|
+
"0",
|
|
123
|
+
"2px",
|
|
124
|
+
"05",
|
|
125
|
+
"1",
|
|
126
|
+
"2",
|
|
127
|
+
"3",
|
|
128
|
+
"4",
|
|
129
|
+
"5",
|
|
130
|
+
"6"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"column": {
|
|
134
|
+
"type": "select",
|
|
135
|
+
"description": "Width of this container inside a gridRow: 1–12 columns, auto for content width, or fill for equal shares. Set 12 at the base to stack on small screens, then override at larger breakpoints.",
|
|
136
|
+
"options": [
|
|
137
|
+
"auto",
|
|
138
|
+
"fill",
|
|
139
|
+
"1",
|
|
140
|
+
"2",
|
|
141
|
+
"3",
|
|
142
|
+
"4",
|
|
143
|
+
"5",
|
|
144
|
+
"6",
|
|
145
|
+
"7",
|
|
146
|
+
"8",
|
|
147
|
+
"9",
|
|
148
|
+
"10",
|
|
149
|
+
"11",
|
|
150
|
+
"12"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"offset": {
|
|
154
|
+
"type": "select",
|
|
155
|
+
"description": "Offset this grid column by 1–12 columns. Use none to reset an earlier offset.",
|
|
156
|
+
"options": [
|
|
157
|
+
"none",
|
|
158
|
+
"1",
|
|
159
|
+
"2",
|
|
160
|
+
"3",
|
|
161
|
+
"4",
|
|
162
|
+
"5",
|
|
163
|
+
"6",
|
|
164
|
+
"7",
|
|
165
|
+
"8",
|
|
166
|
+
"9",
|
|
167
|
+
"10",
|
|
168
|
+
"11",
|
|
169
|
+
"12"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
"gutters": {
|
|
173
|
+
"type": "select",
|
|
174
|
+
"description": "Horizontal USWDS grid gutters; requires gridRow. Use 2 with a desktop override of 4 for standard responsive spacing; 0 removes gutters. Rows use negative margins, so nest them in a gridContainer or another padded parent.",
|
|
175
|
+
"options": [
|
|
176
|
+
"sm",
|
|
177
|
+
"md",
|
|
178
|
+
"lg",
|
|
179
|
+
"0",
|
|
180
|
+
"2px",
|
|
181
|
+
"05",
|
|
182
|
+
"1",
|
|
183
|
+
"2",
|
|
184
|
+
"3",
|
|
185
|
+
"4",
|
|
186
|
+
"5",
|
|
187
|
+
"6"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"float": {
|
|
191
|
+
"type": "select",
|
|
192
|
+
"description": "Float this container so surrounding content wraps around it. Float has no effect on flex children; use a flow-root parent to contain floats.",
|
|
193
|
+
"options": [
|
|
194
|
+
"none",
|
|
195
|
+
"left",
|
|
196
|
+
"right"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"responsive": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"description": "Mobile-first overrides keyed by mobileLg, tablet, and desktop. Omitted fields keep the smaller-screen setting; use explicit values (none, 0, row, etc.) to reset. Breakpoints match precompiled USWDS and do not follow USX page-layout theme breakpoints.",
|
|
202
|
+
"properties": {
|
|
203
|
+
"mobileLg": {
|
|
204
|
+
"type": "object",
|
|
205
|
+
"description": "Layout overrides at 30em / 480px and wider (pixel equivalent assumes 16px browser default).",
|
|
206
|
+
"component": "container",
|
|
207
|
+
"omit": [
|
|
208
|
+
"element",
|
|
209
|
+
"gridContainer",
|
|
210
|
+
"gridRow",
|
|
211
|
+
"responsive",
|
|
212
|
+
"children",
|
|
213
|
+
"content",
|
|
214
|
+
"className",
|
|
215
|
+
"id",
|
|
216
|
+
"role",
|
|
217
|
+
"ariaLabel",
|
|
218
|
+
"ariaLabelledby"
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
"tablet": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"description": "Layout overrides at 40em / 640px and wider (pixel equivalent assumes 16px browser default).",
|
|
224
|
+
"component": "container",
|
|
225
|
+
"omit": [
|
|
226
|
+
"element",
|
|
227
|
+
"gridContainer",
|
|
228
|
+
"gridRow",
|
|
229
|
+
"responsive",
|
|
230
|
+
"children",
|
|
231
|
+
"content",
|
|
232
|
+
"className",
|
|
233
|
+
"id",
|
|
234
|
+
"role",
|
|
235
|
+
"ariaLabel",
|
|
236
|
+
"ariaLabelledby"
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
"desktop": {
|
|
240
|
+
"type": "object",
|
|
241
|
+
"description": "Layout overrides at 64em / 1024px and wider (pixel equivalent assumes 16px browser default).",
|
|
242
|
+
"component": "container",
|
|
243
|
+
"omit": [
|
|
244
|
+
"element",
|
|
245
|
+
"gridContainer",
|
|
246
|
+
"gridRow",
|
|
247
|
+
"responsive",
|
|
248
|
+
"children",
|
|
249
|
+
"content",
|
|
250
|
+
"className",
|
|
251
|
+
"id",
|
|
252
|
+
"role",
|
|
253
|
+
"ariaLabel",
|
|
254
|
+
"ariaLabelledby"
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"children": {
|
|
260
|
+
"type": "slot",
|
|
261
|
+
"description": "Grouped content rendered directly, with no child wrappers or reordering. Takes precedence over content unless null or undefined."
|
|
262
|
+
},
|
|
263
|
+
"content": {
|
|
264
|
+
"type": "slot",
|
|
265
|
+
"description": "Fallback grouped content when children is null or undefined."
|
|
266
|
+
},
|
|
267
|
+
"className": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"description": "Additional CSS classes for spacing, decoration, or layouts beyond these controls."
|
|
270
|
+
},
|
|
271
|
+
"id": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"description": "HTML identifier for links and accessible references."
|
|
274
|
+
},
|
|
275
|
+
"role": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"description": "Optional ARIA role; prefer an appropriate semantic element."
|
|
278
|
+
},
|
|
279
|
+
"ariaLabel": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "Accessible name when a visible label is not available."
|
|
282
|
+
},
|
|
283
|
+
"ariaLabelledby": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"description": "ID of the visible heading or label that names this container."
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{% load components %}
|
|
2
|
+
{% fragment as containerTag %}{% if element == 'section' or element == 'article' or element == 'aside' or element == 'nav' or element == 'ul' or element == 'ol' or element == 'li' %}{{ element }}{% else %}div{% endif %}{% endfragment %}
|
|
3
|
+
{% dict display=display direction=direction wrap=wrap justify=justify align=align alignSelf=alignSelf flex=flex gap=gap column=column offset=offset gutters=gutters float=float as baseLayout %}
|
|
4
|
+
{% fragment as containerClasses %}
|
|
5
|
+
usx-container
|
|
6
|
+
{% if gridContainer == 'default' %} grid-container{% elif gridContainer == 'card' or gridContainer == 'card-lg' or gridContainer == 'mobile' or gridContainer == 'mobile-lg' or gridContainer == 'tablet' or gridContainer == 'tablet-lg' or gridContainer == 'desktop' or gridContainer == 'desktop-lg' or gridContainer == 'widescreen' %} grid-container-{{ gridContainer }}{% endif %}
|
|
7
|
+
{% if gridRow is True %} grid-row{% endif %}
|
|
8
|
+
{% include 'container/_layout-classes.django.html' with layout=baseLayout prefix='' only %}
|
|
9
|
+
{% include 'container/_layout-classes.django.html' with layout=responsive.mobileLg prefix='mobile-lg:' only %}
|
|
10
|
+
{% include 'container/_layout-classes.django.html' with layout=responsive.tablet prefix='tablet:' only %}
|
|
11
|
+
{% include 'container/_layout-classes.django.html' with layout=responsive.desktop prefix='desktop:' only %}
|
|
12
|
+
{% endfragment %}
|
|
13
|
+
<{{ containerTag }} class="{{ containerClasses.split|join:' ' }}{% if className and className == className|stringformat:'s' %} {{ className }}{% endif %}"{% if id == id|stringformat:'s' %} id="{{ id }}"{% endif %}{% if role == role|stringformat:'s' %} role="{{ role }}"{% endif %}{% if ariaLabel == ariaLabel|stringformat:'s' %} aria-label="{{ ariaLabel }}"{% endif %}{% if ariaLabelledby == ariaLabelledby|stringformat:'s' %} aria-labelledby="{{ ariaLabelledby }}"{% endif %}>{% if children is not None %}{% if children is not True and children is not False %}{{ children|safe }}{% endif %}{% elif content is not None and content is not True and content is not False %}{{ content|safe }}{% endif %}</{{ containerTag }}>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<main class="maxw-desktop margin-x-auto">
|
|
2
|
+
<header class="margin-bottom-4">
|
|
3
|
+
<span class="usa-tag usx-tag">Applications open</span>
|
|
4
|
+
<h1 class="margin-top-2 margin-bottom-1">Community project support</h1>
|
|
5
|
+
<p class="maxw-tablet margin-top-0">Find the guidance and tools you need to prepare an application, submit it, and follow its progress.</p>
|
|
6
|
+
</header>
|
|
7
|
+
|
|
8
|
+
<section class="usx-section" id="before-you-begin">
|
|
9
|
+
<h2 class="usx-section__title">Before you begin</h2>
|
|
10
|
+
<div class="usx-section__content">
|
|
11
|
+
<!-- The base container adds no layout or visual styles. -->
|
|
12
|
+
<div class="usx-container">
|
|
13
|
+
<div class="usa-prose usx-prose">
|
|
14
|
+
<p>Review the program requirements and gather your supporting documents before you start.</p>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</section>
|
|
19
|
+
|
|
20
|
+
<section class="usx-section">
|
|
21
|
+
<h2 class="usx-section__title">Choose your next step</h2>
|
|
22
|
+
<div class="usx-section__content">
|
|
23
|
+
<!-- Stack on small screens; use a wrapping row from tablet upward. -->
|
|
24
|
+
<div class="usx-container usx-container--display-flex usx-container--direction-column usx-container--gap-2 tablet:usx-container--direction-row tablet:usx-container--wrap-wrap tablet:usx-container--align-center tablet:usx-container--gap-3">
|
|
25
|
+
<a class="usa-button usx-button usa-button--primary margin-0" href="#apply">Start an application</a>
|
|
26
|
+
<a class="usa-button usx-button usa-button--outline margin-0" href="#resources">Explore resources</a>
|
|
27
|
+
<a class="usa-link usx-link" href="#before-you-begin">Check requirements</a>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</section>
|
|
31
|
+
|
|
32
|
+
<section class="usx-section" id="application-steps">
|
|
33
|
+
<h2 class="usx-section__title">From idea to decision</h2>
|
|
34
|
+
<div class="usx-section__content">
|
|
35
|
+
<!-- Nest grid-container > grid-row > grid columns. Use grid gutters, not CSS gap. -->
|
|
36
|
+
<div class="usx-container grid-container padding-x-0">
|
|
37
|
+
<div class="usx-container grid-row grid-gap-2 desktop:grid-gap-3">
|
|
38
|
+
<div class="usx-container grid-col-12 tablet:grid-col-6 desktop:grid-col-4 margin-bottom-3" id="prepare">
|
|
39
|
+
<div class="usa-card usx-card height-full margin-0">
|
|
40
|
+
<div class="usa-card__container">
|
|
41
|
+
<div class="usa-card__header"><h4 class="usa-card__heading">Prepare</h4></div>
|
|
42
|
+
<div class="usa-card__body"><p>Gather the information and documents needed for your application.</p></div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="usx-container grid-col-12 tablet:grid-col-6 desktop:grid-col-4 margin-bottom-3" id="apply">
|
|
47
|
+
<div class="usa-card usx-card height-full margin-0">
|
|
48
|
+
<div class="usa-card__container">
|
|
49
|
+
<div class="usa-card__header"><h4 class="usa-card__heading">Apply</h4></div>
|
|
50
|
+
<div class="usa-card__body"><p>Complete and submit your application online.</p></div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<!-- Center the last card on tablet; reset the offset when all three fit on desktop. -->
|
|
55
|
+
<div class="usx-container grid-col-12 tablet:grid-col-6 tablet:grid-offset-3 desktop:grid-col-4 desktop:grid-offset-none margin-bottom-3" id="track">
|
|
56
|
+
<div class="usa-card usx-card height-full margin-0">
|
|
57
|
+
<div class="usa-card__container">
|
|
58
|
+
<div class="usa-card__header"><h4 class="usa-card__heading">Track</h4></div>
|
|
59
|
+
<div class="usa-card__body"><p>Check your application status and see what happens next.</p></div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
<section class="usx-section" id="program-overview">
|
|
69
|
+
<h2 class="usx-section__title">About the program</h2>
|
|
70
|
+
<div class="usx-section__content">
|
|
71
|
+
<!-- Full width on mobile, centered on tablet, side by side on desktop. -->
|
|
72
|
+
<div class="usx-container grid-container padding-x-0">
|
|
73
|
+
<div class="usx-container grid-row grid-gap-3">
|
|
74
|
+
<div class="usx-container grid-col-12 tablet:grid-col-8 tablet:grid-offset-2 desktop:grid-col-8 desktop:grid-offset-none margin-bottom-3">
|
|
75
|
+
<div class="usa-card usx-card height-full margin-0">
|
|
76
|
+
<div class="usa-card__container">
|
|
77
|
+
<div class="usa-card__header"><h4 class="usa-card__heading">Program overview</h4></div>
|
|
78
|
+
<div class="usa-card__body"><p>Funding is available for community-led projects that improve access to local services.</p></div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<!-- Reset the tablet offset explicitly when this becomes a sidebar. -->
|
|
83
|
+
<aside class="usx-container grid-col-12 tablet:grid-col-8 tablet:grid-offset-2 desktop:grid-col-4 desktop:grid-offset-none margin-bottom-3">
|
|
84
|
+
<div class="usa-summary-box usx-summary-box height-full margin-0" role="region" aria-labelledby="container-html-related-resources">
|
|
85
|
+
<div class="usa-summary-box__body">
|
|
86
|
+
<h4 class="usa-summary-box__heading" id="container-html-related-resources">Related resources</h4>
|
|
87
|
+
<div class="usa-summary-box__text"><a class="usa-link usx-link maxw-full" href="#resources">Eligibility and supporting documents</a></div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</aside>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<section class="usx-section" id="resources">
|
|
97
|
+
<h2 class="usx-section__title">Explore resources</h2>
|
|
98
|
+
<div class="usx-section__content">
|
|
99
|
+
<!-- Container can be the semantic list element, with no generated item wrappers. -->
|
|
100
|
+
<ul class="usx-container usx-container--display-flex usx-container--direction-column usx-container--gap-2 tablet:usx-container--direction-row tablet:usx-container--wrap-wrap add-list-reset margin-0">
|
|
101
|
+
<li class="usx-container"><a class="usa-link usx-link" href="#before-you-begin">Before you begin</a></li>
|
|
102
|
+
<li class="usx-container"><a class="usa-link usx-link" href="#application-steps">Application steps</a></li>
|
|
103
|
+
<li class="usx-container"><a class="usa-link usx-link" href="#program-overview">Program details</a></li>
|
|
104
|
+
</ul>
|
|
105
|
+
</div>
|
|
106
|
+
</section>
|
|
107
|
+
|
|
108
|
+
<section class="usx-section" id="application-updates">
|
|
109
|
+
<h2 class="usx-section__title">Application updates</h2>
|
|
110
|
+
<div class="usx-section__content">
|
|
111
|
+
<div class="usx-container">
|
|
112
|
+
<div class="usa-prose usx-prose"><p>Check which documents have been received and what happens next.</p></div>
|
|
113
|
+
<!-- Additional context is visible from tablet width upward. -->
|
|
114
|
+
<div class="usx-container usx-container--display-none tablet:usx-container--display-block">
|
|
115
|
+
<div class="usa-summary-box usx-summary-box margin-top-2" role="region" aria-labelledby="container-html-review-process">
|
|
116
|
+
<div class="usa-summary-box__body">
|
|
117
|
+
<h4 class="usa-summary-box__heading" id="container-html-review-process">How reviews work</h4>
|
|
118
|
+
<div class="usa-summary-box__text">Applications are reviewed in the order received. Keep your confirmation number for future reference.</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</section>
|
|
125
|
+
</main>
|