@solexllc/usx-react 0.10.0 → 0.12.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/README.md +16 -0
- package/dist/Popover-BzDCTuQM.cjs +984 -0
- package/dist/Popover-LToVWsWc.js +985 -0
- package/dist/chat.cjs +1391 -0
- package/dist/chat.js +1391 -0
- package/dist/index.cjs +4426 -5231
- package/dist/index.js +168 -970
- package/package.json +9 -5
- package/src/chat.js +15 -0
- package/src/components/avatar/Avatar.tsx +54 -16
- package/src/components/avatar/avatar.django-snapshot.html +112 -0
- package/src/components/avatar/avatar.django.html +2 -2
- package/src/components/avatar/avatar.html +25 -0
- package/src/components/avatar/avatar.react-snapshot.html +104 -0
- package/src/components/avatar/config.json +13 -15
- package/src/components/avatar-group/AvatarGroup.tsx +17 -15
- package/src/components/avatar-group/avatar-group.django-snapshot.html +22 -0
- package/src/components/avatar-group/avatar-group.django.html +1 -1
- package/src/components/avatar-group/avatar-group.react-snapshot.html +20 -0
- package/src/components/avatar-group/config.json +2 -2
- package/src/components/back-to-top/BackToTop.tsx +21 -57
- package/src/components/back-to-top/back-to-top.django-snapshot.html +101 -202
- package/src/components/back-to-top/back-to-top.django.html +11 -38
- package/src/components/back-to-top/back-to-top.html +22 -106
- package/src/components/back-to-top/back-to-top.react-snapshot.html +94 -148
- package/src/components/back-to-top/config.json +41 -10
- package/src/components/button/Button.tsx +12 -3
- package/src/components/button/button.django-snapshot.html +18 -0
- package/src/components/button/button.django.html +3 -2
- package/src/components/button/button.react-snapshot.html +16 -0
- package/src/components/button/config.json +11 -2
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/config.json +7 -16
- package/src/components/character-count/CharacterCount.tsx +2 -0
- package/src/components/character-count/character-count.react-snapshot.html +7 -0
- package/src/components/chat/Chat.tsx +575 -0
- package/src/components/chat/README.md +174 -0
- package/src/components/chat/avatarProps.ts +32 -0
- package/src/components/chat/chat.django-snapshot.html +23515 -0
- package/src/components/chat/chat.django.html +75 -0
- package/src/components/chat/chat.html +116 -0
- package/src/components/chat/chat.react-snapshot.html +16895 -0
- package/src/components/chat/config.json +1241 -0
- package/src/components/chat-attachment/ChatAttachment.tsx +39 -0
- package/src/components/chat-attachment/chat-attachment.django.html +24 -0
- package/src/components/chat-attachment/chat-attachment.html +10 -0
- package/src/components/chat-attachment/config.json +27 -0
- package/src/components/chat-attachments/ChatAttachments.tsx +17 -0
- package/src/components/chat-attachments/chat-attachments.django-snapshot.html +58 -0
- package/src/components/chat-attachments/chat-attachments.django.html +10 -0
- package/src/components/chat-attachments/chat-attachments.html +14 -0
- package/src/components/chat-attachments/chat-attachments.react-snapshot.html +46 -0
- package/src/components/chat-attachments/config.json +25 -0
- package/src/components/chat-bubble/ChatBubble.tsx +39 -0
- package/src/components/chat-bubble/ChatFormattedText.tsx +138 -0
- package/src/components/chat-bubble/chat-bubble.django-snapshot.html +128 -0
- package/src/components/chat-bubble/chat-bubble.django.html +19 -0
- package/src/components/chat-bubble/chat-bubble.html +1 -0
- package/src/components/chat-bubble/chat-bubble.react-snapshot.html +118 -0
- package/src/components/chat-bubble/config.json +70 -0
- package/src/components/chat-composer/ChatComposer.tsx +210 -0
- package/src/components/chat-composer/README.md +15 -0
- package/src/components/chat-composer/chat-composer.django-snapshot.html +575 -0
- package/src/components/chat-composer/chat-composer.django.html +77 -0
- package/src/components/chat-composer/chat-composer.html +44 -0
- package/src/components/chat-composer/chat-composer.react-snapshot.html +519 -0
- package/src/components/chat-composer/chat-formatting.django.html +59 -0
- package/src/components/chat-composer/config.json +137 -0
- package/src/components/chat-context/ChatContext.tsx +46 -0
- package/src/components/chat-context/chat-context.django-snapshot.html +35 -0
- package/src/components/chat-context/chat-context.django.html +20 -0
- package/src/components/chat-context/chat-context.html +9 -0
- package/src/components/chat-context/chat-context.react-snapshot.html +30 -0
- package/src/components/chat-context/config.json +36 -0
- package/src/components/chat-controls/ChatControls.tsx +67 -0
- package/src/components/chat-controls/chat-controls.django-snapshot.html +114 -0
- package/src/components/chat-controls/chat-controls.django.html +36 -0
- package/src/components/chat-controls/chat-controls.html +11 -0
- package/src/components/chat-controls/chat-controls.react-snapshot.html +107 -0
- package/src/components/chat-controls/config.json +67 -0
- package/src/components/chat-directory/ChatDirectory.tsx +168 -0
- package/src/components/chat-directory/chat-directory.django-snapshot.html +546 -0
- package/src/components/chat-directory/chat-directory.django.html +14 -0
- package/src/components/chat-directory/chat-directory.html +4 -0
- package/src/components/chat-directory/chat-directory.react-snapshot.html +471 -0
- package/src/components/chat-directory/config.json +242 -0
- package/src/components/chat-directory-item/ChatDirectoryItem.tsx +150 -0
- package/src/components/chat-directory-item/chat-directory-item.django-snapshot.html +281 -0
- package/src/components/chat-directory-item/chat-directory-item.django.html +38 -0
- package/src/components/chat-directory-item/chat-directory-item.html +9 -0
- package/src/components/chat-directory-item/chat-directory-item.react-snapshot.html +249 -0
- package/src/components/chat-directory-item/config.json +103 -0
- package/src/components/chat-history/ChatHistory.tsx +30 -0
- package/src/components/chat-history/chat-history.django-snapshot.html +113 -0
- package/src/components/chat-history/chat-history.django.html +20 -0
- package/src/components/chat-history/chat-history.html +9 -0
- package/src/components/chat-history/chat-history.react-snapshot.html +111 -0
- package/src/components/chat-history/config.json +24 -0
- package/src/components/chat-message/ChatMessage.tsx +148 -0
- package/src/components/chat-message/chat-message.django-snapshot.html +758 -0
- package/src/components/chat-message/chat-message.django.html +56 -0
- package/src/components/chat-message/chat-message.html +12 -0
- package/src/components/chat-message/chat-message.react-snapshot.html +627 -0
- package/src/components/chat-message/config.json +278 -0
- package/src/components/chat-message-actions/ChatMessageActions.tsx +133 -0
- package/src/components/chat-message-actions/chat-message-actions.django-snapshot.html +345 -0
- package/src/components/chat-message-actions/chat-message-actions.django.html +29 -0
- package/src/components/chat-message-actions/chat-message-actions.html +53 -0
- package/src/components/chat-message-actions/chat-message-actions.react-snapshot.html +295 -0
- package/src/components/chat-message-actions/config.json +121 -0
- package/src/components/chat-window/ChatWindow.tsx +133 -0
- package/src/components/chat-window/chat-window.django-snapshot.html +448 -0
- package/src/components/chat-window/chat-window.django.html +39 -0
- package/src/components/chat-window/chat-window.html +26 -0
- package/src/components/chat-window/chat-window.react-snapshot.html +286 -0
- package/src/components/chat-window/config.json +123 -0
- package/src/components/clickable/Clickable.tsx +19 -5
- package/src/components/clickable/clickable.django-snapshot.html +11 -2
- package/src/components/clickable/clickable.django.html +2 -0
- package/src/components/clickable/clickable.react-snapshot.html +10 -2
- package/src/components/clickable/config.json +4 -0
- package/src/components/code/code.django-snapshot.html +27 -22
- package/src/components/code/code.html +2 -2
- package/src/components/code/code.react-snapshot.html +43 -8
- package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
- package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
- package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
- package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
- package/src/components/file-list/FileList.tsx +3 -2
- package/src/components/file-list/config.json +5 -0
- package/src/components/file-list/file-list.django-snapshot.html +63 -0
- package/src/components/file-list/file-list.django.html +1 -1
- package/src/components/file-list/file-list.react-snapshot.html +53 -0
- package/src/components/footer/footer.django-snapshot.html +0 -3
- package/src/components/header/header.django-snapshot.html +5 -167
- package/src/components/header/header.django.html +2 -2
- package/src/components/header/header.html +1 -11
- package/src/components/header/header.react-snapshot.html +3 -6
- package/src/components/hero/hero.django-snapshot.html +0 -20
- package/src/components/hero/hero.django.html +3 -3
- package/src/components/icon-list/IconList.tsx +10 -2
- package/src/components/icon-list/config.json +5 -1
- package/src/components/icon-list/icon-list.django-snapshot.html +39 -0
- package/src/components/icon-list/icon-list.django.html +2 -0
- package/src/components/icon-list/icon-list.react-snapshot.html +31 -0
- package/src/components/image/image.django.html +4 -4
- package/src/components/input/Input.tsx +1 -1
- package/src/components/input/config.json +2 -3
- package/src/components/input/input.django-snapshot.html +4 -21
- package/src/components/input/input.django.html +2 -2
- package/src/components/link/Link.tsx +7 -4
- package/src/components/link/config.json +2 -3
- package/src/components/link/link.django-snapshot.html +8 -0
- package/src/components/link/link.django.html +2 -2
- package/src/components/link/link.html +4 -1
- package/src/components/link/link.react-snapshot.html +8 -0
- package/src/components/list/List.tsx +10 -2
- package/src/components/list/config.json +5 -1
- package/src/components/list/list.django-snapshot.html +26 -0
- package/src/components/list/list.django.html +2 -0
- package/src/components/list/list.html +20 -0
- package/src/components/list/list.react-snapshot.html +20 -0
- package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
- package/src/components/memorable-date/memorable-date.django.html +2 -2
- package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
- package/src/components/misc-banner/misc-banner.django.html +4 -2
- package/src/components/page/Page.tsx +16 -0
- package/src/components/page/config.json +18 -1
- package/src/components/page/page.django-snapshot.html +74 -0
- package/src/components/page/page.django.html +8 -0
- package/src/components/page/page.html +60 -0
- package/src/components/page/page.react-snapshot.html +60 -0
- package/src/components/popover/Popover.tsx +60 -9
- package/src/components/popover/PopoverMenu.tsx +33 -15
- package/src/components/popover/config.json +88 -14
- package/src/components/popover/popover-menu.django.html +13 -2
- package/src/components/popover/popover.django-snapshot.html +229 -7
- package/src/components/popover/popover.django.html +3 -2
- package/src/components/popover/popover.react-snapshot.html +127 -4
- package/src/components/process-list/config.json +41 -3
- package/src/components/quote/Quote.tsx +9 -2
- package/src/components/search/Search.tsx +1 -1
- package/src/components/search/config.json +3 -4
- package/src/components/search/search.django-snapshot.html +262 -1684
- package/src/components/search/search.django.html +1 -20
- package/src/components/select/select.django-snapshot.html +7 -7
- package/src/components/select/select.react-snapshot.html +7 -7
- package/src/components/summary/Summary.tsx +4 -2
- package/src/components/summary/config.json +4 -0
- package/src/components/summary/summary.django.html +4 -4
- package/src/components/table/Table.tsx +58 -25
- package/src/components/table/config.json +61 -13
- package/src/components/tag/Tag.tsx +40 -7
- package/src/components/tag/config.json +18 -2
- package/src/components/tag/tag.django-snapshot.html +16 -1
- package/src/components/tag/tag.django.html +12 -6
- package/src/components/tag/tag.html +4 -0
- package/src/components/tag/tag.react-snapshot.html +16 -1
- package/src/components/tag-group/TagGroup.tsx +6 -9
- package/src/components/tag-group/config.json +4 -0
- package/src/components/tag-group/tag-group.django.html +1 -1
- package/src/components/theme-picker/ThemePicker.tsx +95 -52
- package/src/components/theme-picker/config.json +7 -4
- package/src/components/theme-picker/theme-picker-select.django.html +7 -0
- package/src/components/theme-picker/theme-picker.django-snapshot.html +101 -21
- package/src/components/theme-picker/theme-picker.django.html +22 -24
- package/src/components/theme-picker/theme-picker.html +86 -56
- package/src/components/theme-picker/theme-picker.react-snapshot.html +74 -18
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="usa-form-group usx-form-group">
|
|
3
3
|
<label class="usa-label usx-label" for="django-example-input-1"> Text input label </label>
|
|
4
4
|
|
|
5
|
-
<input class="usa-input usx-input" id="django-example-input-1" placeholder="Type here"
|
|
5
|
+
<input class="usa-input usx-input" id="django-example-input-1" placeholder="Type here" />
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
<h3 class="site-preview-heading">With Hint</h3>
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
class="usa-input usx-input"
|
|
18
18
|
id="django-example-input-2"
|
|
19
19
|
placeholder="Type here"
|
|
20
|
-
value=""
|
|
21
20
|
aria-describedby="django-example-input-2-hint"
|
|
22
21
|
/>
|
|
23
22
|
</div>
|
|
@@ -28,13 +27,7 @@
|
|
|
28
27
|
<abbr title="Required" class="usx-required">*</abbr> Required input
|
|
29
28
|
</label>
|
|
30
29
|
|
|
31
|
-
<input
|
|
32
|
-
class="usa-input usx-input"
|
|
33
|
-
id="django-example-input-3"
|
|
34
|
-
placeholder="Type here"
|
|
35
|
-
value=""
|
|
36
|
-
required
|
|
37
|
-
/>
|
|
30
|
+
<input class="usa-input usx-input" id="django-example-input-3" placeholder="Type here" required />
|
|
38
31
|
</div>
|
|
39
32
|
|
|
40
33
|
<h3 class="site-preview-heading">Screen Reader Only Label</h3>
|
|
@@ -43,7 +36,7 @@
|
|
|
43
36
|
Visually hidden label
|
|
44
37
|
</label>
|
|
45
38
|
|
|
46
|
-
<input class="usa-input usx-input" id="django-example-input-4" placeholder="Search…"
|
|
39
|
+
<input class="usa-input usx-input" id="django-example-input-4" placeholder="Search…" />
|
|
47
40
|
</div>
|
|
48
41
|
|
|
49
42
|
<h3 class="site-preview-heading">Error State</h3>
|
|
@@ -60,7 +53,6 @@
|
|
|
60
53
|
class="usa-input usx-input usa-input--error"
|
|
61
54
|
id="django-example-input-5"
|
|
62
55
|
placeholder="Type here"
|
|
63
|
-
value=""
|
|
64
56
|
aria-describedby="django-example-input-5-error"
|
|
65
57
|
aria-invalid="true"
|
|
66
58
|
/>
|
|
@@ -76,7 +68,6 @@
|
|
|
76
68
|
class="usa-input usx-input usa-input--error"
|
|
77
69
|
id="django-example-input-6"
|
|
78
70
|
placeholder="Type here"
|
|
79
|
-
value=""
|
|
80
71
|
aria-invalid="true"
|
|
81
72
|
/>
|
|
82
73
|
</div>
|
|
@@ -89,7 +80,6 @@
|
|
|
89
80
|
class="usa-input usx-input usa-input--success"
|
|
90
81
|
id="django-example-input-7"
|
|
91
82
|
placeholder="Type here"
|
|
92
|
-
value=""
|
|
93
83
|
/>
|
|
94
84
|
</div>
|
|
95
85
|
|
|
@@ -103,7 +93,6 @@
|
|
|
103
93
|
class="usa-input usx-input usa-input--success"
|
|
104
94
|
id="django-example-input-8"
|
|
105
95
|
placeholder="Type here"
|
|
106
|
-
value=""
|
|
107
96
|
/>
|
|
108
97
|
</div>
|
|
109
98
|
|
|
@@ -111,13 +100,7 @@
|
|
|
111
100
|
<div class="usa-form-group usx-form-group">
|
|
112
101
|
<label class="usa-label usx-label" for="django-example-input-9"> Disabled input </label>
|
|
113
102
|
|
|
114
|
-
<input
|
|
115
|
-
class="usa-input usx-input"
|
|
116
|
-
id="django-example-input-9"
|
|
117
|
-
placeholder="Type here"
|
|
118
|
-
value=""
|
|
119
|
-
disabled
|
|
120
|
-
/>
|
|
103
|
+
<input class="usa-input usx-input" id="django-example-input-9" placeholder="Type here" disabled />
|
|
121
104
|
</div>
|
|
122
105
|
|
|
123
106
|
<h3 class="site-preview-heading">Value</h3>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
{% if type %}type="{{ type }}" {% endif %}
|
|
22
22
|
{% if autoComplete %}autocomplete="{{ autoComplete }}" {% endif %}
|
|
23
23
|
placeholder="{% if placeholder is None %}Type here{% else %}{{ placeholder }}{% endif %}"
|
|
24
|
-
|
|
24
|
+
{% if value != None %}value="{{ value }}"{% elif defaultValue != None %}value="{{ defaultValue }}"{% endif %}
|
|
25
25
|
{% if maxlength %}maxlength="{{ maxlength }}" {% endif %}
|
|
26
26
|
{% if hint or describedBy or error and error != "true" and error != True and error != "false" %}aria-describedby="{% if describedBy %}{{ describedBy }} {% endif %}{% if hint %}{{ field_id }}-hint {% endif %}{% if error and error != "true" and error != True and error != "false" %}{{ field_id }}-error {% endif %}"
|
|
27
27
|
{% endif %}
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
{% if type %}type="{{ type }}" {% endif %}
|
|
49
49
|
{% if autoComplete %}autocomplete="{{ autoComplete }}" {% endif %}
|
|
50
50
|
placeholder="{% if placeholder is None %}Type here{% else %}{{ placeholder }}{% endif %}"
|
|
51
|
-
|
|
51
|
+
{% if value != None %}value="{{ value }}"{% elif defaultValue != None %}value="{{ defaultValue }}"{% endif %}
|
|
52
52
|
{% if maxlength %}maxlength="{{ maxlength }}" {% endif %}
|
|
53
53
|
{% if hint or describedBy or error and error != "true" and error != True and error != "false" %}aria-describedby="{% if describedBy %}{{ describedBy }} {% endif %}{% if hint %}{{ field_id }}-hint {% endif %}{% if error and error != "true" and error != True and error != "false" %}{{ field_id }}-error {% endif %}"
|
|
54
54
|
{% endif %}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React, { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
|
|
4
|
-
export interface LinkProps extends
|
|
5
|
-
|
|
4
|
+
export interface LinkProps extends Omit<
|
|
5
|
+
AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
6
|
+
'download' | 'type' | 'onClick'
|
|
7
|
+
> {
|
|
8
|
+
href: string;
|
|
6
9
|
text?: string;
|
|
7
10
|
children?: ReactNode;
|
|
8
11
|
visited?: boolean;
|
|
@@ -14,7 +17,7 @@ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export default function Link({
|
|
17
|
-
href
|
|
20
|
+
href,
|
|
18
21
|
text,
|
|
19
22
|
children,
|
|
20
23
|
visited = false,
|
|
@@ -30,7 +33,7 @@ export default function Link({
|
|
|
30
33
|
visited && 'usx-link--visited',
|
|
31
34
|
external && 'usa-link--external',
|
|
32
35
|
alt && 'usa-link--alt',
|
|
33
|
-
className
|
|
36
|
+
className
|
|
34
37
|
);
|
|
35
38
|
|
|
36
39
|
return (
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
"template": "link/link.django.html",
|
|
4
4
|
"version": 2,
|
|
5
5
|
"required": [
|
|
6
|
-
"href"
|
|
7
|
-
"children"
|
|
6
|
+
"href"
|
|
8
7
|
],
|
|
9
8
|
"default": {
|
|
10
9
|
"href": "https://google.com/",
|
|
@@ -13,7 +12,7 @@
|
|
|
13
12
|
"props": {
|
|
14
13
|
"href": {
|
|
15
14
|
"type": "string",
|
|
16
|
-
"description": "Link destination URL."
|
|
15
|
+
"description": "Link destination URL. Link always renders an anchor."
|
|
17
16
|
},
|
|
18
17
|
"text": {
|
|
19
18
|
"type": "string",
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
<h3 class="site-preview-heading">Default</h3>
|
|
2
2
|
<a href="https://google.com/" class="usa-link usx-link">Google</a>
|
|
3
3
|
|
|
4
|
+
<h3 class="site-preview-heading">Tag used as a link</h3>
|
|
5
|
+
<a
|
|
6
|
+
href="#related-topics"
|
|
7
|
+
class="usa-tag usx-tag usa-link usx-link usx-no-visited usx-tag--interactive usx-tag--outline"
|
|
8
|
+
>
|
|
9
|
+
Browse related topics
|
|
10
|
+
</a>
|
|
11
|
+
|
|
4
12
|
<h3 class="site-preview-heading">Visited</h3>
|
|
5
13
|
<a href="javascript:void(0);" class="usa-link usx-link usx-link--visited">a visited link</a>
|
|
6
14
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
{% load usx_components %}
|
|
3
3
|
|
|
4
4
|
<a
|
|
5
|
-
href="{{ href
|
|
5
|
+
href="{{ href }}"
|
|
6
6
|
class="usa-link usx-link{% if visited %} usx-link--visited{% endif %}{% if external %} usa-link--external{% endif %}{% if alt %} usa-link--alt{% endif %}{% if className %} {{ className }}{% endif %}"
|
|
7
|
-
{% if newTab or external %}target="_blank" rel="noreferrer noopener"{% endif %}
|
|
7
|
+
{% if newTab or external %}target="_blank" rel="noreferrer noopener"{% elif rel %}rel="{{ rel }}"{% endif %}
|
|
8
8
|
>{% if children %}{{ children|safe }}{% else %}{{ text|safe }}{% endif %}</a>
|
|
@@ -44,4 +44,7 @@
|
|
|
44
44
|
>
|
|
45
45
|
is an alternate external text link on a dark background.
|
|
46
46
|
</p>
|
|
47
|
-
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<p><button type="button" class="usa-link usx-link">Show more details</button></p>
|
|
50
|
+
<p><a href="#related-topics" class="usa-link usx-link usx-no-visited usa-tag usx-tag usx-tag--outline usx-tag--interactive">Browse related topics</a></p>
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
<h3 class="site-preview-heading">Default</h3>
|
|
2
2
|
<a href="https://google.com/" class="usa-link usx-link">Google</a>
|
|
3
3
|
|
|
4
|
+
<h3 class="site-preview-heading">Tag used as a link</h3>
|
|
5
|
+
<a
|
|
6
|
+
href="#related-topics"
|
|
7
|
+
class="usa-tag usx-tag usx-tag--outline usa-link usx-link usx-no-visited usx-tag--interactive"
|
|
8
|
+
>
|
|
9
|
+
Browse related topics</a
|
|
10
|
+
>
|
|
11
|
+
|
|
4
12
|
<h3 class="site-preview-heading">Visited</h3>
|
|
5
13
|
<a href="javascript:void(0);" class="usa-link usx-link usx-link--visited">a visited link</a>
|
|
6
14
|
|
|
@@ -60,12 +60,13 @@ function renderItems(items: ListItem[] = [], parentOptions: { ordered?: boolean;
|
|
|
60
60
|
|
|
61
61
|
export interface ListProps extends HTMLAttributes<HTMLUListElement | HTMLOListElement> {
|
|
62
62
|
items?: ListItem[];
|
|
63
|
+
caption?: string;
|
|
63
64
|
ordered?: boolean;
|
|
64
65
|
unstyled?: boolean;
|
|
65
66
|
className?: string;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
export default function List({ items = [], ordered = false, unstyled = false, className = '', ...props }: ListProps) {
|
|
69
|
+
export default function List({ items = [], caption, ordered = false, unstyled = false, className = '', ...props }: ListProps) {
|
|
69
70
|
const classes = ClassNames(
|
|
70
71
|
'usa-list',
|
|
71
72
|
'usx-list',
|
|
@@ -74,9 +75,16 @@ export default function List({ items = [], ordered = false, unstyled = false, cl
|
|
|
74
75
|
);
|
|
75
76
|
const Tag = ordered ? 'ol' : 'ul';
|
|
76
77
|
|
|
77
|
-
|
|
78
|
+
const list = (
|
|
78
79
|
<Tag className={classes} {...props}>
|
|
79
80
|
{renderItems(items, { ordered, unstyled })}
|
|
80
81
|
</Tag>
|
|
81
82
|
);
|
|
83
|
+
|
|
84
|
+
return caption ? (
|
|
85
|
+
<figure className="usx-list-figure">
|
|
86
|
+
<figcaption className="usx-list-figure__caption">{caption}</figcaption>
|
|
87
|
+
{list}
|
|
88
|
+
</figure>
|
|
89
|
+
) : list;
|
|
82
90
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "list",
|
|
3
3
|
"template": "list/list.django.html",
|
|
4
|
-
"version":
|
|
4
|
+
"version": 2,
|
|
5
5
|
"default": {
|
|
6
6
|
"items": [
|
|
7
7
|
"List item",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"type": "object",
|
|
15
15
|
"description": "Array of list items. A string renders a simple item. Objects can include content and children for nested lists of any depth; optional ordered/unstyled/className customize nested lists."
|
|
16
16
|
},
|
|
17
|
+
"caption": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Optional label rendered in a figcaption before the list. Wraps the list in a figure when provided."
|
|
20
|
+
},
|
|
17
21
|
"ordered": {
|
|
18
22
|
"type": "boolean",
|
|
19
23
|
"default": false,
|
|
@@ -25,6 +25,32 @@
|
|
|
25
25
|
<li>List item</li>
|
|
26
26
|
</ul>
|
|
27
27
|
|
|
28
|
+
<h3 class="site-preview-heading">Captioned</h3>
|
|
29
|
+
<figure class="usx-list-figure">
|
|
30
|
+
<figcaption class="usx-list-figure__caption">Fruit</figcaption>
|
|
31
|
+
|
|
32
|
+
<ul class="usa-list usx-list">
|
|
33
|
+
<li>Apple</li>
|
|
34
|
+
|
|
35
|
+
<li>Pear</li>
|
|
36
|
+
|
|
37
|
+
<li>Orange</li>
|
|
38
|
+
</ul>
|
|
39
|
+
</figure>
|
|
40
|
+
|
|
41
|
+
<h3 class="site-preview-heading">Captioned Ordered</h3>
|
|
42
|
+
<figure class="usx-list-figure">
|
|
43
|
+
<figcaption class="usx-list-figure__caption">Application steps</figcaption>
|
|
44
|
+
|
|
45
|
+
<ol class="usa-list usx-list">
|
|
46
|
+
<li>Create an account</li>
|
|
47
|
+
|
|
48
|
+
<li>Complete the form</li>
|
|
49
|
+
|
|
50
|
+
<li>Submit your application</li>
|
|
51
|
+
</ol>
|
|
52
|
+
</figure>
|
|
53
|
+
|
|
28
54
|
<h3 class="site-preview-heading">Nested</h3>
|
|
29
55
|
<ul class="usa-list usx-list">
|
|
30
56
|
<li>Main point</li>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{% load usx_components %}
|
|
2
2
|
|
|
3
|
+
{% if caption %}<figure class="usx-list-figure"><figcaption class="usx-list-figure__caption">{{ caption }}</figcaption>{% endif %}
|
|
3
4
|
{% if ordered %}
|
|
4
5
|
<ol class="usa-list usx-list{% if unstyled %} usa-list--unstyled{% endif %}{% if className %} {{ className }}{% endif %}">
|
|
5
6
|
{% include "list/_list-items.django.html" with items=items ordered=ordered unstyled=unstyled only %}
|
|
@@ -9,3 +10,4 @@
|
|
|
9
10
|
{% include "list/_list-items.django.html" with items=items ordered=ordered unstyled=unstyled only %}
|
|
10
11
|
</ul>
|
|
11
12
|
{% endif %}
|
|
13
|
+
{% if caption %}</figure>{% endif %}
|
|
@@ -19,6 +19,26 @@
|
|
|
19
19
|
<li>List item</li>
|
|
20
20
|
</ul>
|
|
21
21
|
|
|
22
|
+
<h3 class="site-preview-heading">Captioned</h3>
|
|
23
|
+
<figure class="usx-list-figure">
|
|
24
|
+
<figcaption class="usx-list-figure__caption">Fruit</figcaption>
|
|
25
|
+
<ul class="usa-list usx-list">
|
|
26
|
+
<li>Apple</li>
|
|
27
|
+
<li>Pear</li>
|
|
28
|
+
<li>Orange</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</figure>
|
|
31
|
+
|
|
32
|
+
<h3 class="site-preview-heading">Captioned Ordered</h3>
|
|
33
|
+
<figure class="usx-list-figure">
|
|
34
|
+
<figcaption class="usx-list-figure__caption">Application steps</figcaption>
|
|
35
|
+
<ol class="usa-list usx-list">
|
|
36
|
+
<li>Create an account</li>
|
|
37
|
+
<li>Complete the form</li>
|
|
38
|
+
<li>Submit your application</li>
|
|
39
|
+
</ol>
|
|
40
|
+
</figure>
|
|
41
|
+
|
|
22
42
|
<h3 class="site-preview-heading">Nested</h3>
|
|
23
43
|
<ul class="usa-list usx-list">
|
|
24
44
|
<li>Main point</li>
|
|
@@ -19,6 +19,26 @@
|
|
|
19
19
|
<li>List item</li>
|
|
20
20
|
</ul>
|
|
21
21
|
|
|
22
|
+
<h3 class="site-preview-heading">Captioned</h3>
|
|
23
|
+
<figure class="usx-list-figure">
|
|
24
|
+
<figcaption class="usx-list-figure__caption">Fruit</figcaption>
|
|
25
|
+
<ul class="usa-list usx-list">
|
|
26
|
+
<li>Apple</li>
|
|
27
|
+
<li>Pear</li>
|
|
28
|
+
<li>Orange</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</figure>
|
|
31
|
+
|
|
32
|
+
<h3 class="site-preview-heading">Captioned Ordered</h3>
|
|
33
|
+
<figure class="usx-list-figure">
|
|
34
|
+
<figcaption class="usx-list-figure__caption">Application steps</figcaption>
|
|
35
|
+
<ol class="usa-list usx-list">
|
|
36
|
+
<li>Create an account</li>
|
|
37
|
+
<li>Complete the form</li>
|
|
38
|
+
<li>Submit your application</li>
|
|
39
|
+
</ol>
|
|
40
|
+
</figure>
|
|
41
|
+
|
|
22
42
|
<h3 class="site-preview-heading">Nested</h3>
|
|
23
43
|
<ul class="usa-list usx-list">
|
|
24
44
|
<li>Main point</li>
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
class="usa-input usx-input"
|
|
44
44
|
id="django-memorable-date-day"
|
|
45
45
|
name="memorable-date-day"
|
|
46
|
-
value=""
|
|
47
46
|
maxlength="2"
|
|
48
47
|
pattern="[0-9]*"
|
|
49
48
|
placeholder=""
|
|
@@ -63,7 +62,6 @@
|
|
|
63
62
|
class="usa-input usx-input"
|
|
64
63
|
id="django-memorable-date-year"
|
|
65
64
|
name="memorable-date-year"
|
|
66
|
-
value=""
|
|
67
65
|
minlength="4"
|
|
68
66
|
maxlength="4"
|
|
69
67
|
pattern="[0-9]*"
|
|
@@ -128,7 +126,6 @@
|
|
|
128
126
|
class="usa-input usx-input"
|
|
129
127
|
id="django-memorable-date-disabled-day"
|
|
130
128
|
name="memorable-date-disabled-day"
|
|
131
|
-
value=""
|
|
132
129
|
maxlength="2"
|
|
133
130
|
pattern="[0-9]*"
|
|
134
131
|
placeholder=""
|
|
@@ -149,7 +146,6 @@
|
|
|
149
146
|
class="usa-input usx-input"
|
|
150
147
|
id="django-memorable-date-disabled-year"
|
|
151
148
|
name="memorable-date-disabled-year"
|
|
152
|
-
value=""
|
|
153
149
|
minlength="4"
|
|
154
150
|
maxlength="4"
|
|
155
151
|
pattern="[0-9]*"
|
|
@@ -217,7 +213,6 @@
|
|
|
217
213
|
class="usa-input usx-input"
|
|
218
214
|
id="django-memorable-date-aria-disabled-day"
|
|
219
215
|
name="memorable-date-aria-disabled-day"
|
|
220
|
-
value=""
|
|
221
216
|
maxlength="2"
|
|
222
217
|
pattern="[0-9]*"
|
|
223
218
|
placeholder=""
|
|
@@ -240,7 +235,6 @@
|
|
|
240
235
|
class="usa-input usx-input"
|
|
241
236
|
id="django-memorable-date-aria-disabled-year"
|
|
242
237
|
name="memorable-date-aria-disabled-year"
|
|
243
|
-
value=""
|
|
244
238
|
minlength="4"
|
|
245
239
|
maxlength="4"
|
|
246
240
|
pattern="[0-9]*"
|
|
@@ -310,7 +304,6 @@
|
|
|
310
304
|
class="usa-input usx-input"
|
|
311
305
|
id="django-memorable-date-required-day"
|
|
312
306
|
name="memorable-date-required-day"
|
|
313
|
-
value=""
|
|
314
307
|
maxlength="2"
|
|
315
308
|
pattern="[0-9]*"
|
|
316
309
|
placeholder=""
|
|
@@ -333,7 +326,6 @@
|
|
|
333
326
|
class="usa-input usx-input"
|
|
334
327
|
id="django-memorable-date-required-year"
|
|
335
328
|
name="memorable-date-required-year"
|
|
336
|
-
value=""
|
|
337
329
|
minlength="4"
|
|
338
330
|
maxlength="4"
|
|
339
331
|
pattern="[0-9]*"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
class="usa-input usx-input{% if error %} usa-input--error{% endif %}"
|
|
45
45
|
id="{{ day_id }}"
|
|
46
46
|
name="{{ dayName|default:day_id }}"
|
|
47
|
-
|
|
47
|
+
{% if day != None %}value="{{ day }}"{% elif defaultDay != None %}value="{{ defaultDay }}"{% endif %}
|
|
48
48
|
maxlength="2"
|
|
49
49
|
pattern="[0-9]*"
|
|
50
50
|
placeholder=""
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
class="usa-input usx-input{% if error %} usa-input--error{% endif %}"
|
|
66
66
|
id="{{ year_id }}"
|
|
67
67
|
name="{{ yearName|default:year_id }}"
|
|
68
|
-
|
|
68
|
+
{% if year != None %}value="{{ year }}"{% elif defaultYear != None %}value="{{ defaultYear }}"{% endif %}
|
|
69
69
|
minlength="4"
|
|
70
70
|
maxlength="4"
|
|
71
71
|
pattern="[0-9]*"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
focusable="false"
|
|
17
17
|
role="img"
|
|
18
18
|
>
|
|
19
|
-
<use href="
|
|
19
|
+
<use href="img/sprite.svg#arrow_forward"></use>
|
|
20
20
|
</svg>
|
|
21
21
|
Important Link
|
|
22
22
|
</a>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
focusable="false"
|
|
41
41
|
role="img"
|
|
42
42
|
>
|
|
43
|
-
<use href="
|
|
43
|
+
<use href="img/sprite.svg#expand_more"></use>
|
|
44
44
|
</svg>
|
|
45
45
|
</label>
|
|
46
46
|
<div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
focusable="false"
|
|
81
81
|
role="img"
|
|
82
82
|
>
|
|
83
|
-
<use href="
|
|
83
|
+
<use href="img/sprite.svg#arrow_forward"></use>
|
|
84
84
|
</svg>
|
|
85
85
|
Important Link
|
|
86
86
|
</a>
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
focusable="false"
|
|
105
105
|
role="img"
|
|
106
106
|
>
|
|
107
|
-
<use href="
|
|
107
|
+
<use href="img/sprite.svg#expand_more"></use>
|
|
108
108
|
</svg>
|
|
109
109
|
</label>
|
|
110
110
|
<div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
focusable="false"
|
|
145
145
|
role="img"
|
|
146
146
|
>
|
|
147
|
-
<use href="
|
|
147
|
+
<use href="img/sprite.svg#undo"></use>
|
|
148
148
|
</svg>
|
|
149
149
|
Return to Classic Site
|
|
150
150
|
</a>
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
focusable="false"
|
|
169
169
|
role="img"
|
|
170
170
|
>
|
|
171
|
-
<use href="
|
|
171
|
+
<use href="img/sprite.svg#expand_more"></use>
|
|
172
172
|
</svg>
|
|
173
173
|
</label>
|
|
174
174
|
<div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
focusable="false"
|
|
205
205
|
role="img"
|
|
206
206
|
>
|
|
207
|
-
<use href="
|
|
207
|
+
<use href="img/sprite.svg#trending_up"></use>
|
|
208
208
|
</svg>
|
|
209
209
|
Production Site
|
|
210
210
|
</a>
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
focusable="false"
|
|
229
229
|
role="img"
|
|
230
230
|
>
|
|
231
|
-
<use href="
|
|
231
|
+
<use href="img/sprite.svg#expand_more"></use>
|
|
232
232
|
</svg>
|
|
233
233
|
</label>
|
|
234
234
|
<div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
focusable="false"
|
|
259
259
|
role="img"
|
|
260
260
|
>
|
|
261
|
-
<use href="
|
|
261
|
+
<use href="img/sprite.svg#trending_up"></use>
|
|
262
262
|
</svg>
|
|
263
263
|
Production Site
|
|
264
264
|
</a>
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
focusable="false"
|
|
283
283
|
role="img"
|
|
284
284
|
>
|
|
285
|
-
<use href="
|
|
285
|
+
<use href="img/sprite.svg#expand_more"></use>
|
|
286
286
|
</svg>
|
|
287
287
|
</label>
|
|
288
288
|
<div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
focusable="false"
|
|
324
324
|
role="img"
|
|
325
325
|
>
|
|
326
|
-
<use href="
|
|
326
|
+
<use href="img/sprite.svg#arrow_forward"></use>
|
|
327
327
|
</svg>
|
|
328
328
|
Return to the main site
|
|
329
329
|
</a>
|
|
@@ -347,7 +347,7 @@
|
|
|
347
347
|
focusable="false"
|
|
348
348
|
role="img"
|
|
349
349
|
>
|
|
350
|
-
<use href="
|
|
350
|
+
<use href="img/sprite.svg#expand_more"></use>
|
|
351
351
|
</svg>
|
|
352
352
|
</label>
|
|
353
353
|
<div id="django-misc-banner-no-badge-dropdown" class="usx-misc-banner__dropdown-content">
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{# Django template for MiscBanner #}
|
|
2
|
+
{% load usx_components %}
|
|
3
|
+
{% asset_url 'img/sprite.svg' as spriteUrl %}
|
|
2
4
|
<div {% if id %}id="{{ id }}" {% endif %}class="usx-misc-banner bg-{{ color|default:'beta' }}{% if className %} {{ className }}{% endif %}">
|
|
3
5
|
<div class="usx-misc-banner__content grid-container">
|
|
4
6
|
{% if content %}
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
<span class="usx-misc-banner__return-text">
|
|
18
20
|
<a class="usa-link usx-misc-banner__link" href="{{ importantLinkHref }}">
|
|
19
21
|
<svg class="usa-icon usx-icon usx-icon--size-1" aria-hidden="true" focusable="false" role="img">
|
|
20
|
-
<use href="
|
|
22
|
+
<use href="{{ spriteUrl }}#{{ importantLinkIcon|default:'undo' }}"></use>
|
|
21
23
|
</svg>
|
|
22
24
|
{{ importantLinkText }}
|
|
23
25
|
</a>
|
|
@@ -38,7 +40,7 @@
|
|
|
38
40
|
aria-label="Toggle banner links"
|
|
39
41
|
>
|
|
40
42
|
<svg class="usa-icon usx-icon usa-icon--size-4" aria-hidden="true" focusable="false" role="img">
|
|
41
|
-
<use href="
|
|
43
|
+
<use href="{{ spriteUrl }}#expand_more"></use>
|
|
42
44
|
</svg>
|
|
43
45
|
</label>
|
|
44
46
|
<div id="{{ dropdownBase }}-dropdown" class="usx-misc-banner__dropdown-content">
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ClassNames from 'classnames';
|
|
3
|
+
import TagGroup from '../tag-group/TagGroup';
|
|
4
|
+
import type { TagProps } from '../tag/Tag';
|
|
3
5
|
|
|
4
6
|
export interface PageProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title' | 'content'> {
|
|
5
7
|
title?: React.ReactNode;
|
|
6
8
|
titleId?: string;
|
|
7
9
|
eyebrow?: React.ReactNode;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
tagProps?: TagProps[];
|
|
8
13
|
as?: 'main' | 'div' | 'section' | 'article';
|
|
9
14
|
content?: React.ReactNode;
|
|
10
15
|
tabIndex?: number;
|
|
@@ -16,6 +21,9 @@ export default function Page({
|
|
|
16
21
|
title = 'Page title',
|
|
17
22
|
titleId = undefined,
|
|
18
23
|
eyebrow = null,
|
|
24
|
+
subtitle = undefined,
|
|
25
|
+
description = undefined,
|
|
26
|
+
tagProps = undefined,
|
|
19
27
|
as: Element = 'main',
|
|
20
28
|
children = null,
|
|
21
29
|
content = null,
|
|
@@ -24,6 +32,7 @@ export default function Page({
|
|
|
24
32
|
className = '',
|
|
25
33
|
...props
|
|
26
34
|
}: PageProps) {
|
|
35
|
+
const hasSummary = Boolean(subtitle || description || tagProps?.length);
|
|
27
36
|
const classes = ClassNames('usx-page', className);
|
|
28
37
|
const pageContent = children || content;
|
|
29
38
|
|
|
@@ -41,6 +50,13 @@ export default function Page({
|
|
|
41
50
|
{eyebrow ? <span className="usx-eyebrow">{eyebrow}</span> : null}
|
|
42
51
|
{title}
|
|
43
52
|
</h1>
|
|
53
|
+
{hasSummary && (
|
|
54
|
+
<div className="usx-page__summary">
|
|
55
|
+
{subtitle && <p className="usx-page__subtitle">{subtitle}</p>}
|
|
56
|
+
{tagProps?.length ? <TagGroup className="usx-page__tags" tagProps={tagProps} /> : null}
|
|
57
|
+
{description && <p className="usx-page__description">{description}</p>}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
44
60
|
<div className="usx-page__content">{pageContent}</div>
|
|
45
61
|
</Element>
|
|
46
62
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "page",
|
|
3
3
|
"template": "page/page.django.html",
|
|
4
|
-
"version":
|
|
4
|
+
"version": 5,
|
|
5
5
|
"required": [
|
|
6
6
|
"title"
|
|
7
7
|
],
|
|
@@ -39,6 +39,23 @@
|
|
|
39
39
|
"type": "slot",
|
|
40
40
|
"description": "Optional eyebrow text rendered above the page title inside the h1."
|
|
41
41
|
},
|
|
42
|
+
"subtitle": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "Short subtitle displayed beneath the page title."
|
|
45
|
+
},
|
|
46
|
+
"tagProps": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"description": "Props for tags displayed beneath the subtitle.",
|
|
49
|
+
"items": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"component": "tag",
|
|
52
|
+
"description": "Props passed to each tag."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"description": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "Brief page description displayed beneath the tags."
|
|
58
|
+
},
|
|
42
59
|
"content": {
|
|
43
60
|
"type": "slot",
|
|
44
61
|
"description": "Body content rendered below the title. Supports HTML in Django stories. Ignored if children is provided."
|