@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
|
@@ -59,7 +59,15 @@
|
|
|
59
59
|
<pre data-prefix="4"><code></section></code></pre>
|
|
60
60
|
</div>
|
|
61
61
|
<span class="usx-tooltip"
|
|
62
|
-
><button
|
|
62
|
+
><button
|
|
63
|
+
type="button"
|
|
64
|
+
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
65
|
+
aria-label="Copy to clipboard"
|
|
66
|
+
data-usx-copy='<section aria-label="Account & settings">
|
|
67
|
+
<h2>Contact information</h2>
|
|
68
|
+
<p>Use &lt;Page&gt; to define the page.</p>
|
|
69
|
+
</section>'
|
|
70
|
+
>
|
|
63
71
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
64
72
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
65
73
|
><svg
|
|
@@ -81,7 +89,7 @@
|
|
|
81
89
|
<div class="usx-mockup-code">
|
|
82
90
|
<div class="usx-mockup-code__content">
|
|
83
91
|
<pre data-prefix="1"><code><Layout></code></pre>
|
|
84
|
-
<pre data-prefix="2"><code> <Page title="Account"
|
|
92
|
+
<pre data-prefix="2"><code> <Page title="Account"></code></pre>
|
|
85
93
|
<pre
|
|
86
94
|
data-prefix="3"
|
|
87
95
|
><code> <Section title="Contact information"></code></pre>
|
|
@@ -91,7 +99,18 @@
|
|
|
91
99
|
<pre data-prefix="7"><code></Layout></code></pre>
|
|
92
100
|
</div>
|
|
93
101
|
<span class="usx-tooltip"
|
|
94
|
-
><button
|
|
102
|
+
><button
|
|
103
|
+
type="button"
|
|
104
|
+
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
105
|
+
aria-label="Copy to clipboard"
|
|
106
|
+
data-usx-copy='<Layout>
|
|
107
|
+
<Page title="Account">
|
|
108
|
+
<Section title="Contact information">
|
|
109
|
+
<ContactDetails user={currentUser} />
|
|
110
|
+
</Section>
|
|
111
|
+
</Page>
|
|
112
|
+
</Layout>'
|
|
113
|
+
>
|
|
95
114
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
96
115
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
97
116
|
><svg
|
|
@@ -113,9 +132,7 @@
|
|
|
113
132
|
<div class="usx-mockup-code">
|
|
114
133
|
<div class="usx-mockup-code__content">
|
|
115
134
|
<pre data-prefix="1"><code><Layout></code></pre>
|
|
116
|
-
<pre
|
|
117
|
-
data-prefix="2"
|
|
118
|
-
><code> <Page title="<strong>Account</strong>" tabIndex={-1}></code></pre>
|
|
135
|
+
<pre data-prefix="2"><code> <Page title="<strong>Account</strong>"></code></pre>
|
|
119
136
|
<pre data-prefix="3"><code> <Section title="Contact information"></code></pre>
|
|
120
137
|
<pre data-prefix="4"><code> <ContactDetails user={currentUser} /></code></pre>
|
|
121
138
|
<pre data-prefix="5"><code> </Section></code></pre>
|
|
@@ -123,7 +140,18 @@
|
|
|
123
140
|
<pre data-prefix="7"><code></Layout></code></pre>
|
|
124
141
|
</div>
|
|
125
142
|
<span class="usx-tooltip"
|
|
126
|
-
><button
|
|
143
|
+
><button
|
|
144
|
+
type="button"
|
|
145
|
+
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
146
|
+
aria-label="Copy to clipboard"
|
|
147
|
+
data-usx-copy='<Layout>
|
|
148
|
+
<Page title="Account">
|
|
149
|
+
<Section title="Contact information">
|
|
150
|
+
<ContactDetails user={currentUser} />
|
|
151
|
+
</Section>
|
|
152
|
+
</Page>
|
|
153
|
+
</Layout>'
|
|
154
|
+
>
|
|
127
155
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
128
156
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
129
157
|
><svg
|
|
@@ -165,7 +193,14 @@
|
|
|
165
193
|
<pre data-prefix=">" class="text-success"><code>Done!</code></pre>
|
|
166
194
|
</div>
|
|
167
195
|
<span class="usx-tooltip"
|
|
168
|
-
><button
|
|
196
|
+
><button
|
|
197
|
+
type="button"
|
|
198
|
+
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
199
|
+
aria-label="Copy to clipboard"
|
|
200
|
+
data-usx-copy="npm install @solexllc/usx
|
|
201
|
+
installing...
|
|
202
|
+
Done!"
|
|
203
|
+
>
|
|
169
204
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
170
205
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
171
206
|
><svg
|
|
@@ -5,12 +5,6 @@ import Icon from '../icon/Icon';
|
|
|
5
5
|
import Tooltip from '../tooltip/Tooltip';
|
|
6
6
|
import type { TooltipProps } from '../tooltip/Tooltip';
|
|
7
7
|
|
|
8
|
-
function copyTextToClipboard(text: string) {
|
|
9
|
-
if (window.navigator.clipboard) {
|
|
10
|
-
return window.navigator.clipboard.writeText(text);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
8
|
export interface CopyToClipboardProps {
|
|
15
9
|
copyText?: string;
|
|
16
10
|
label?: string | null;
|
|
@@ -30,7 +24,8 @@ export default function CopyToClipboard({
|
|
|
30
24
|
<Button
|
|
31
25
|
ghost={true}
|
|
32
26
|
className={ClassNames('usx-copy', className)}
|
|
33
|
-
|
|
27
|
+
extraAttributes={{ 'data-usx-copy': copyText }}
|
|
28
|
+
aria-label={label ? undefined : 'Copy to clipboard'}
|
|
34
29
|
type="button"
|
|
35
30
|
>
|
|
36
31
|
<Icon name="content_copy" className="usx-copy__copy" staticBaseUrl={staticBaseUrl} />
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<button
|
|
4
4
|
type="button"
|
|
5
5
|
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
6
|
-
|
|
6
|
+
data-usx-copy="Example text to copy"
|
|
7
|
+
aria-label="Copy to clipboard"
|
|
7
8
|
>
|
|
8
9
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
9
10
|
<use href="img/sprite.svg#content_copy"></use>
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
<button
|
|
25
26
|
type="button"
|
|
26
27
|
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
27
|
-
|
|
28
|
+
data-usx-copy="Example text to copy"
|
|
28
29
|
>
|
|
29
30
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
30
31
|
<use href="img/sprite.svg#content_copy"></use>
|
|
@@ -42,7 +43,8 @@
|
|
|
42
43
|
<button
|
|
43
44
|
type="button"
|
|
44
45
|
class="usa-button usx-button usx-button--ghost usa-button--inverse usx-copy"
|
|
45
|
-
|
|
46
|
+
data-usx-copy="Example text to copy"
|
|
47
|
+
aria-label="Copy to clipboard"
|
|
46
48
|
>
|
|
47
49
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
48
50
|
<use href="img/sprite.svg#content_copy"></use>
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
<button
|
|
71
73
|
type="button"
|
|
72
74
|
class="usa-button usx-button usx-button--ghost usa-button--inverse usx-copy"
|
|
73
|
-
|
|
75
|
+
data-usx-copy="Example text to copy"
|
|
74
76
|
>
|
|
75
77
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
76
78
|
<use href="img/sprite.svg#content_copy"></use>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{# Django template for CopyToClipboard #}
|
|
2
2
|
{% load usx_components %}
|
|
3
|
-
{% with buttonClass=className|default:''|add:' usx-copy'
|
|
4
|
-
{% dict
|
|
3
|
+
{% with buttonClass=className|default:''|add:' usx-copy' %}
|
|
4
|
+
{% if label %}{% dict data_usx_copy=copyText|default:'' as copyAttributes %}
|
|
5
|
+
{% else %}{% dict data_usx_copy=copyText|default:'' aria_label='Copy to clipboard' as copyAttributes %}{% endif %}
|
|
5
6
|
{% button ghost=True className=buttonClass extraAttributes=copyAttributes as copyButton %}
|
|
6
7
|
{% icon name='content_copy' className="usx-copy__copy" staticBaseUrl=staticBaseUrl %}{% endicon %}
|
|
7
8
|
{% icon name='check' className="usx-copy__check" staticBaseUrl=staticBaseUrl %}{% endicon %}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<h3 class="site-preview-heading">Default</h3>
|
|
2
2
|
<span class="usx-tooltip"
|
|
3
|
-
><button
|
|
3
|
+
><button
|
|
4
|
+
type="button"
|
|
5
|
+
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
6
|
+
aria-label="Copy to clipboard"
|
|
7
|
+
data-usx-copy="Example text to copy"
|
|
8
|
+
>
|
|
4
9
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
5
10
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
6
11
|
><svg class="usa-icon usx-icon usx-copy__check" aria-hidden="true" focusable="false" role="img">
|
|
@@ -13,7 +18,11 @@
|
|
|
13
18
|
>
|
|
14
19
|
|
|
15
20
|
<h3 class="site-preview-heading">With Text</h3>
|
|
16
|
-
<button
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
class="usa-button usx-button usx-button--ghost usx-copy"
|
|
24
|
+
data-usx-copy="Example text to copy"
|
|
25
|
+
>
|
|
17
26
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
18
27
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
19
28
|
><svg class="usa-icon usx-icon usx-copy__check" aria-hidden="true" focusable="false" role="img">
|
|
@@ -27,6 +36,8 @@
|
|
|
27
36
|
><button
|
|
28
37
|
type="button"
|
|
29
38
|
class="usa-button usx-button usx-button--ghost usx-copy usa-button--inverse"
|
|
39
|
+
aria-label="Copy to clipboard"
|
|
40
|
+
data-usx-copy="Example text to copy"
|
|
30
41
|
>
|
|
31
42
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
32
43
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
@@ -50,6 +61,7 @@
|
|
|
50
61
|
<button
|
|
51
62
|
type="button"
|
|
52
63
|
class="usa-button usx-button usx-button--ghost usx-copy usa-button--inverse"
|
|
64
|
+
data-usx-copy="Example text to copy"
|
|
53
65
|
>
|
|
54
66
|
<svg class="usa-icon usx-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
|
|
55
67
|
<use href="/img/sprite.svg#content_copy"></use></svg
|
|
@@ -19,6 +19,7 @@ export interface FileListProps {
|
|
|
19
19
|
hint?: React.ReactNode;
|
|
20
20
|
onRemove?: ((entry: FileListEntry) => void) | null;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
+
slim?: boolean;
|
|
22
23
|
className?: string;
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -47,13 +48,13 @@ function getEntryDisplay(entry: FileListEntry) {
|
|
|
47
48
|
// A standalone list of files with a per-row Delete action — used by
|
|
48
49
|
// FileInput's managed-multiple mode (see FileInput.tsx), but reusable
|
|
49
50
|
// anywhere a parent already owns the file array.
|
|
50
|
-
export default function FileList({ files, hint = 'Selected files', onRemove = null, disabled = false, className = '' }: FileListProps) {
|
|
51
|
+
export default function FileList({ files, hint = 'Selected files', onRemove = null, disabled = false, slim = false, className = '' }: FileListProps) {
|
|
51
52
|
if (!files || files.length === 0) return null;
|
|
52
53
|
|
|
53
54
|
const lastEntry = getEntryDisplay(files[files.length - 1]);
|
|
54
55
|
|
|
55
56
|
return (
|
|
56
|
-
<div className={ClassNames('usx-file-input__list', 'margin-top-1', className)}>
|
|
57
|
+
<div className={ClassNames('usx-file-input__list', 'margin-top-1', slim && 'usx-file-list--slim', className)}>
|
|
57
58
|
<span className="usa-sr-only" aria-live="polite">
|
|
58
59
|
{`You have selected the file: ${lastEntry.name}.`}
|
|
59
60
|
</span>
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
"default": false,
|
|
36
36
|
"description": "Hides every row's Delete button."
|
|
37
37
|
},
|
|
38
|
+
"slim": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": false,
|
|
41
|
+
"description": "Uses compact row padding, text, and Delete button sizing, with file type and size inline after the name. The list width and element structure stay the same."
|
|
42
|
+
},
|
|
38
43
|
"className": {
|
|
39
44
|
"type": "string",
|
|
40
45
|
"description": "Additional classes for the outer wrapper."
|
|
@@ -55,6 +55,69 @@
|
|
|
55
55
|
</ul>
|
|
56
56
|
</div>
|
|
57
57
|
|
|
58
|
+
<h3 class="site-preview-heading">Slim</h3>
|
|
59
|
+
<div class="usx-file-input__list margin-top-1 usx-file-list--slim">
|
|
60
|
+
<span class="usa-sr-only" aria-live="polite">You have selected the file: notes.txt.</span>
|
|
61
|
+
|
|
62
|
+
<span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
|
|
63
|
+
|
|
64
|
+
<ul class="usx-file-input__file-list">
|
|
65
|
+
<li class="usx-file-input__file-item">
|
|
66
|
+
<div class="usx-file-input__file-info">
|
|
67
|
+
<a
|
|
68
|
+
class="usa-link usx-link usa-link--external usx-file-input__file-name"
|
|
69
|
+
rel="noreferrer noopener"
|
|
70
|
+
target="_blank"
|
|
71
|
+
href="https://example.com/files/project-plan.pdf"
|
|
72
|
+
>project-plan-and-supporting-information-for-review.pdf</a
|
|
73
|
+
>
|
|
74
|
+
|
|
75
|
+
<span class="usx-file-input__file-size">PDF, 240 KB</span>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<button
|
|
79
|
+
type="button"
|
|
80
|
+
class="usa-button usx-button usa-button--secondary usx-button--ghost usx-file-input__delete-button"
|
|
81
|
+
tooltip="Delete this file"
|
|
82
|
+
>
|
|
83
|
+
<svg
|
|
84
|
+
class="usa-icon usx-icon usa-icon--size-3 usx-file-input__delete-icon"
|
|
85
|
+
aria-hidden="true"
|
|
86
|
+
focusable="false"
|
|
87
|
+
role="img"
|
|
88
|
+
>
|
|
89
|
+
<use href="img/sprite.svg#delete"></use>
|
|
90
|
+
</svg>
|
|
91
|
+
<span class="usx-file-input__delete-label">Delete</span>
|
|
92
|
+
</button>
|
|
93
|
+
</li>
|
|
94
|
+
|
|
95
|
+
<li class="usx-file-input__file-item">
|
|
96
|
+
<div class="usx-file-input__file-info">
|
|
97
|
+
<span class="usx-file-input__file-name">notes.txt</span>
|
|
98
|
+
|
|
99
|
+
<span class="usx-file-input__file-size">TXT, 7 KB</span>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<button
|
|
103
|
+
type="button"
|
|
104
|
+
class="usa-button usx-button usa-button--secondary usx-button--ghost usx-file-input__delete-button"
|
|
105
|
+
tooltip="Delete this file"
|
|
106
|
+
>
|
|
107
|
+
<svg
|
|
108
|
+
class="usa-icon usx-icon usa-icon--size-3 usx-file-input__delete-icon"
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
focusable="false"
|
|
111
|
+
role="img"
|
|
112
|
+
>
|
|
113
|
+
<use href="img/sprite.svg#delete"></use>
|
|
114
|
+
</svg>
|
|
115
|
+
<span class="usx-file-input__delete-label">Delete</span>
|
|
116
|
+
</button>
|
|
117
|
+
</li>
|
|
118
|
+
</ul>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
58
121
|
<h3 class="site-preview-heading">With Download Link</h3>
|
|
59
122
|
<div class="usx-file-input__list margin-top-1">
|
|
60
123
|
<span class="usa-sr-only" aria-live="polite">You have selected the file: w2-2023.pdf.</span>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
{% load usx_components %}
|
|
3
3
|
|
|
4
4
|
{% if files %}
|
|
5
|
-
<div class="usx-file-input__list margin-top-1{% if className %} {{ className }}{% endif %}">
|
|
5
|
+
<div class="usx-file-input__list margin-top-1{% if slim %} usx-file-list--slim{% endif %}{% if className %} {{ className }}{% endif %}">
|
|
6
6
|
{% with lastFile=files|last %}<span class="usa-sr-only" aria-live="polite">You have selected the file: {{ lastFile.name }}.</span>{% endwith %}
|
|
7
7
|
{% if hint %}
|
|
8
8
|
<span class="usa-hint usx-hint usx-file-input__list-heading">{{ hint }}</span>
|
|
@@ -46,6 +46,59 @@
|
|
|
46
46
|
</ul>
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
|
+
<h3 class="site-preview-heading">Slim</h3>
|
|
50
|
+
<div class="usx-file-input__list margin-top-1 usx-file-list--slim">
|
|
51
|
+
<span class="usa-sr-only" aria-live="polite">You have selected the file: notes.txt.</span
|
|
52
|
+
><span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
|
|
53
|
+
<ul class="usx-file-input__file-list">
|
|
54
|
+
<li class="usx-file-input__file-item">
|
|
55
|
+
<div class="usx-file-input__file-info">
|
|
56
|
+
<a
|
|
57
|
+
href="https://example.com/files/project-plan.pdf"
|
|
58
|
+
class="usa-link usx-link usa-link--external usx-file-input__file-name"
|
|
59
|
+
target="_blank"
|
|
60
|
+
rel="noreferrer noopener"
|
|
61
|
+
>project-plan-and-supporting-information-for-review.pdf</a
|
|
62
|
+
><span class="usx-file-input__file-size">PDF, 240 KB</span>
|
|
63
|
+
</div>
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
class="usa-button usx-button usa-button--secondary usx-button--ghost usx-file-input__delete-button"
|
|
67
|
+
tooltip="Delete this file"
|
|
68
|
+
>
|
|
69
|
+
<svg
|
|
70
|
+
class="usa-icon usx-icon usa-icon--size-3 usx-file-input__delete-icon"
|
|
71
|
+
aria-hidden="true"
|
|
72
|
+
focusable="false"
|
|
73
|
+
role="img"
|
|
74
|
+
>
|
|
75
|
+
<use href="/img/sprite.svg#delete"></use></svg
|
|
76
|
+
><span class="usx-file-input__delete-label">Delete</span>
|
|
77
|
+
</button>
|
|
78
|
+
</li>
|
|
79
|
+
<li class="usx-file-input__file-item">
|
|
80
|
+
<div class="usx-file-input__file-info">
|
|
81
|
+
<span class="usx-file-input__file-name">notes.txt</span
|
|
82
|
+
><span class="usx-file-input__file-size">TXT, 7 KB</span>
|
|
83
|
+
</div>
|
|
84
|
+
<button
|
|
85
|
+
type="button"
|
|
86
|
+
class="usa-button usx-button usa-button--secondary usx-button--ghost usx-file-input__delete-button"
|
|
87
|
+
tooltip="Delete this file"
|
|
88
|
+
>
|
|
89
|
+
<svg
|
|
90
|
+
class="usa-icon usx-icon usa-icon--size-3 usx-file-input__delete-icon"
|
|
91
|
+
aria-hidden="true"
|
|
92
|
+
focusable="false"
|
|
93
|
+
role="img"
|
|
94
|
+
>
|
|
95
|
+
<use href="/img/sprite.svg#delete"></use></svg
|
|
96
|
+
><span class="usx-file-input__delete-label">Delete</span>
|
|
97
|
+
</button>
|
|
98
|
+
</li>
|
|
99
|
+
</ul>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
49
102
|
<h3 class="site-preview-heading">With Download Link</h3>
|
|
50
103
|
<div class="usx-file-input__list margin-top-1">
|
|
51
104
|
<span class="usa-sr-only" aria-live="polite">You have selected the file: w2-2023.pdf.</span
|
|
@@ -139,7 +139,6 @@
|
|
|
139
139
|
type="email"
|
|
140
140
|
autocomplete="email"
|
|
141
141
|
placeholder="Type here"
|
|
142
|
-
value=""
|
|
143
142
|
/>
|
|
144
143
|
</div>
|
|
145
144
|
|
|
@@ -554,7 +553,6 @@
|
|
|
554
553
|
type="email"
|
|
555
554
|
autocomplete="email"
|
|
556
555
|
placeholder="Type here"
|
|
557
|
-
value=""
|
|
558
556
|
/>
|
|
559
557
|
</div>
|
|
560
558
|
|
|
@@ -838,7 +836,6 @@
|
|
|
838
836
|
type="email"
|
|
839
837
|
autocomplete="email"
|
|
840
838
|
placeholder="Type here"
|
|
841
|
-
value=""
|
|
842
839
|
/>
|
|
843
840
|
</div>
|
|
844
841
|
|