@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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{% load usx_components %}
|
|
2
|
+
{% fragment as itemContent %}
|
|
3
|
+
{% if avatars|length > 1 %}
|
|
4
|
+
{% avatar_group avatarProps=avatars overlap=True className='usx-chat__directory-avatars' %}{% endavatar_group %}
|
|
5
|
+
{% elif avatars %}
|
|
6
|
+
{% avatar props=avatars.0 %}{% endavatar %}
|
|
7
|
+
{% endif %}
|
|
8
|
+
<span class="usx-chat__directory-copy">
|
|
9
|
+
<span class="usx-chat__directory-title">{{ title }}</span>
|
|
10
|
+
{% if subtitle %}<span class="usx-chat__directory-subtitle"{% if selectable %} id="{{ id }}-description"{% endif %}>{{ subtitle }}</span>{% endif %}
|
|
11
|
+
{% if preview %}<span class="usx-chat__directory-preview">{{ preview }}</span>{% endif %}
|
|
12
|
+
</span>
|
|
13
|
+
{% if timeLabel or unreadCount %}
|
|
14
|
+
<span class="usx-chat__directory-meta">
|
|
15
|
+
{% if timeLabel %}<small>{{ timeLabel }}</small>{% endif %}
|
|
16
|
+
{% if unreadCount %}
|
|
17
|
+
<span aria-hidden="true">{% tag value=unreadCount color='info' className='usx-rounded-md' %}{% endtag %}</span>
|
|
18
|
+
<span class="usa-sr-only">{{ unreadCount }} unread messages</span>
|
|
19
|
+
{% endif %}
|
|
20
|
+
</span>
|
|
21
|
+
{% endif %}
|
|
22
|
+
{% endfragment %}
|
|
23
|
+
<li{% if actions %} class="usx-chat__directory-row"{% endif %}>
|
|
24
|
+
{% if selectable %}
|
|
25
|
+
<div class="usa-checkbox usx-checkbox usx-chat__directory-item usx-chat__recipient">
|
|
26
|
+
<input id="{{ id }}" class="usa-checkbox__input" type="checkbox" name="recipientIds" value="{{ participantId|default_if_none:'' }}"{% if formId != None %} form="{{ formId }}"{% endif %}{% if selected %} checked{% endif %}{% if disabled %} disabled{% endif %} aria-label="{{ title }}"{% if subtitle %} aria-describedby="{{ id }}-description"{% endif %} data-usx-chat-recipient="" />
|
|
27
|
+
<label class="usa-checkbox__label usx-chat__recipient-label" for="{{ id }}">{{ itemContent }}</label>
|
|
28
|
+
</div>
|
|
29
|
+
{% else %}
|
|
30
|
+
{% if href %}{% dict as rowAttrs %}{% elif participantId != None %}{% dict data_usx_chat_contact=participantId as rowAttrs %}{% elif conversationId != None %}{% dict data_usx_chat_conversation=conversationId as rowAttrs %}{% else %}{% dict as rowAttrs %}{% endif %}
|
|
31
|
+
{% clickable href=href className='usx-chat__directory-item' extraAttributes=rowAttrs %}{{ itemContent }}{% endclickable %}
|
|
32
|
+
{% endif %}
|
|
33
|
+
{% if actions %}
|
|
34
|
+
{% icon name='more_vert' as actionsIcon %}{% endicon %}
|
|
35
|
+
{% dict children=actionsIcon ariaLabel='Actions for '|add:title className='usa-button usx-button usa-button--unstyled' as actionsSummary %}
|
|
36
|
+
{% popover id=id|add:'-actions' side='bottom' align='end' panelShape='square' className='usx-chat__directory-actions' summaryProps=actionsSummary menuItems=menuItems %}{% endpopover %}
|
|
37
|
+
{% endif %}
|
|
38
|
+
</li>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<li>
|
|
2
|
+
<button type="button" class="usx-clickable usx-chat__directory-item" data-usx-chat-conversation="books">
|
|
3
|
+
<span class="usx-chat__directory-copy">
|
|
4
|
+
<span class="usx-chat__directory-title">Jordan Lee</span>
|
|
5
|
+
<span class="usx-chat__directory-subtitle">Three design books</span>
|
|
6
|
+
<span class="usx-chat__directory-preview">I can bundle all three.</span>
|
|
7
|
+
</span>
|
|
8
|
+
</button>
|
|
9
|
+
</li>
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Default</h3>
|
|
2
|
+
<div>
|
|
3
|
+
<section id="react-example-directory-item-default" class="usx-chat" style="max-width: 20rem">
|
|
4
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
5
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
6
|
+
<div class="usx-chat__directory">
|
|
7
|
+
<ul class="usx-chat__directory-list">
|
|
8
|
+
<li class="usx-chat__directory-row">
|
|
9
|
+
<button
|
|
10
|
+
type="button"
|
|
11
|
+
class="usx-clickable usx-chat__directory-item"
|
|
12
|
+
data-usx-chat-conversation="books"
|
|
13
|
+
>
|
|
14
|
+
<span class="usx-avatar usx-chat__avatar" aria-label="Jordan Lee"
|
|
15
|
+
><span class="usx-avatar__content usx-circle">JL</span></span
|
|
16
|
+
><span class="usx-chat__directory-copy"
|
|
17
|
+
><span class="usx-chat__directory-title">Jordan Lee</span
|
|
18
|
+
><span class="usx-chat__directory-subtitle">Three design books</span
|
|
19
|
+
><span class="usx-chat__directory-preview">I can bundle all three.</span></span
|
|
20
|
+
><span class="usx-chat__directory-meta"
|
|
21
|
+
><small>Yesterday</small
|
|
22
|
+
><span aria-hidden="true"
|
|
23
|
+
><span class="usa-tag usx-tag bg-info usx-rounded-md"> 2</span></span
|
|
24
|
+
><span class="usa-sr-only">2 unread messages</span></span
|
|
25
|
+
>
|
|
26
|
+
</button>
|
|
27
|
+
<details
|
|
28
|
+
class="usx-popover usx-chat__directory-actions"
|
|
29
|
+
data-side="bottom"
|
|
30
|
+
data-align="end"
|
|
31
|
+
>
|
|
32
|
+
<summary
|
|
33
|
+
class="usa-button usx-button usa-button--unstyled"
|
|
34
|
+
aria-label="Actions for Jordan Lee"
|
|
35
|
+
>
|
|
36
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
37
|
+
<use href="/img/sprite.svg#more_vert"></use>
|
|
38
|
+
</svg>
|
|
39
|
+
</summary>
|
|
40
|
+
<div
|
|
41
|
+
id="react-directory-item-actions"
|
|
42
|
+
class="usx-popover__panel usx-popover__panel--square"
|
|
43
|
+
>
|
|
44
|
+
<ul class="usx-popover__menu">
|
|
45
|
+
<li>
|
|
46
|
+
<button
|
|
47
|
+
data-usx-chat-directory-action="delete-history"
|
|
48
|
+
data-usx-chat-conversation-id="books"
|
|
49
|
+
type="button"
|
|
50
|
+
class="usx-popover__menu-item"
|
|
51
|
+
>
|
|
52
|
+
Delete chat history
|
|
53
|
+
</button>
|
|
54
|
+
</li>
|
|
55
|
+
</ul>
|
|
56
|
+
</div>
|
|
57
|
+
</details>
|
|
58
|
+
</li>
|
|
59
|
+
</ul>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<h3 class="site-preview-heading">Contact</h3>
|
|
66
|
+
<div>
|
|
67
|
+
<section id="react-example-directory-item-contact" class="usx-chat" style="max-width: 20rem">
|
|
68
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
69
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
70
|
+
<div class="usx-chat__directory">
|
|
71
|
+
<ul class="usx-chat__directory-list">
|
|
72
|
+
<li>
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
class="usx-clickable usx-chat__directory-item"
|
|
76
|
+
data-usx-chat-contact="avery"
|
|
77
|
+
>
|
|
78
|
+
<span class="usx-avatar usx-chat__avatar" aria-label="Avery Patel"
|
|
79
|
+
><span class="usx-avatar__content usx-circle">AP</span></span
|
|
80
|
+
><span class="usx-chat__directory-copy"
|
|
81
|
+
><span class="usx-chat__directory-title">Avery Patel</span
|
|
82
|
+
><span class="usx-chat__directory-subtitle">Application support</span></span
|
|
83
|
+
>
|
|
84
|
+
</button>
|
|
85
|
+
</li>
|
|
86
|
+
</ul>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</section>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<h3 class="site-preview-heading">Linked Contact</h3>
|
|
93
|
+
<div>
|
|
94
|
+
<section
|
|
95
|
+
id="react-example-directory-item-linkedcontact"
|
|
96
|
+
class="usx-chat"
|
|
97
|
+
style="max-width: 20rem"
|
|
98
|
+
>
|
|
99
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
100
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
101
|
+
<div class="usx-chat__directory">
|
|
102
|
+
<ul class="usx-chat__directory-list">
|
|
103
|
+
<li>
|
|
104
|
+
<a class="usx-clickable usx-chat__directory-item" href="#morgan"
|
|
105
|
+
><span class="usx-chat__directory-copy"
|
|
106
|
+
><span class="usx-chat__directory-title">Morgan Chen</span
|
|
107
|
+
><span class="usx-chat__directory-subtitle">Eligibility specialist</span></span
|
|
108
|
+
></a
|
|
109
|
+
>
|
|
110
|
+
</li>
|
|
111
|
+
</ul>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</section>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<h3 class="site-preview-heading">Recipient</h3>
|
|
118
|
+
<div>
|
|
119
|
+
<section id="react-example-directory-item-recipient" class="usx-chat" style="max-width: 20rem">
|
|
120
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
121
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
122
|
+
<div class="usx-chat__directory">
|
|
123
|
+
<ul class="usx-chat__directory-list">
|
|
124
|
+
<li>
|
|
125
|
+
<div class="usa-checkbox usx-checkbox usx-chat__directory-item usx-chat__recipient">
|
|
126
|
+
<input
|
|
127
|
+
id="react-recipient-avery"
|
|
128
|
+
class="usa-checkbox__input"
|
|
129
|
+
type="checkbox"
|
|
130
|
+
name="recipientIds"
|
|
131
|
+
form="react-example-directory-item-recipient-composer"
|
|
132
|
+
aria-label="Avery Patel"
|
|
133
|
+
aria-describedby="react-recipient-avery-description"
|
|
134
|
+
data-usx-chat-recipient=""
|
|
135
|
+
checked=""
|
|
136
|
+
value="avery"
|
|
137
|
+
/><label
|
|
138
|
+
class="usa-checkbox__label usx-chat__recipient-label"
|
|
139
|
+
for="react-recipient-avery"
|
|
140
|
+
><span class="usx-avatar usx-chat__avatar" aria-label="Avery Patel"
|
|
141
|
+
><span class="usx-avatar__content usx-circle">AP</span></span
|
|
142
|
+
><span class="usx-chat__directory-copy"
|
|
143
|
+
><span class="usx-chat__directory-title">Avery Patel</span
|
|
144
|
+
><span class="usx-chat__directory-subtitle" id="react-recipient-avery-description"
|
|
145
|
+
>Application support</span
|
|
146
|
+
></span
|
|
147
|
+
></label
|
|
148
|
+
>
|
|
149
|
+
</div>
|
|
150
|
+
</li>
|
|
151
|
+
</ul>
|
|
152
|
+
<form
|
|
153
|
+
id="react-example-directory-item-recipient-composer"
|
|
154
|
+
data-usx-chat-require-recipients="true"
|
|
155
|
+
class="usx-chat-composer usx-chat__composer"
|
|
156
|
+
method="post"
|
|
157
|
+
>
|
|
158
|
+
<label
|
|
159
|
+
class="usa-label usx-label usa-sr-only"
|
|
160
|
+
for="react-example-directory-item-recipient-message"
|
|
161
|
+
>Message</label
|
|
162
|
+
><textarea
|
|
163
|
+
id="react-example-directory-item-recipient-message"
|
|
164
|
+
class="usa-textarea usx-textarea"
|
|
165
|
+
placeholder="Write a message"
|
|
166
|
+
name="message"
|
|
167
|
+
rows="2"
|
|
168
|
+
></textarea>
|
|
169
|
+
<div class="usx-chat__composer-actions">
|
|
170
|
+
<div class="usx-chat__attach"></div>
|
|
171
|
+
<button
|
|
172
|
+
type="submit"
|
|
173
|
+
class="usa-button usx-button usa-button--primary usx-chat__send"
|
|
174
|
+
disabled=""
|
|
175
|
+
aria-disabled="true"
|
|
176
|
+
>
|
|
177
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
178
|
+
<use href="/img/sprite.svg#send"></use></svg
|
|
179
|
+
>Send
|
|
180
|
+
</button>
|
|
181
|
+
</div>
|
|
182
|
+
</form>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</section>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<h3 class="site-preview-heading">Group</h3>
|
|
189
|
+
<div>
|
|
190
|
+
<section id="react-example-directory-item-group" class="usx-chat" style="max-width: 20rem">
|
|
191
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
192
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
193
|
+
<div class="usx-chat__directory">
|
|
194
|
+
<ul class="usx-chat__directory-list">
|
|
195
|
+
<li>
|
|
196
|
+
<button
|
|
197
|
+
type="button"
|
|
198
|
+
class="usx-clickable usx-chat__directory-item"
|
|
199
|
+
data-usx-chat-conversation="review"
|
|
200
|
+
>
|
|
201
|
+
<div class="usx-avatar-group usx-avatar-group--overlap usx-chat__directory-avatars">
|
|
202
|
+
<span class="usx-avatar usx-chat__avatar" aria-label="Avery Patel"
|
|
203
|
+
><span class="usx-avatar__content usx-circle">AP</span></span
|
|
204
|
+
><span class="usx-avatar usx-chat__avatar" aria-label="Morgan Chen"
|
|
205
|
+
><span class="usx-avatar__content usx-circle">MC</span></span
|
|
206
|
+
>
|
|
207
|
+
</div>
|
|
208
|
+
<span class="usx-chat__directory-copy"
|
|
209
|
+
><span class="usx-chat__directory-title">Review team</span
|
|
210
|
+
><span class="usx-chat__directory-preview">Morgan: Ready for review.</span></span
|
|
211
|
+
>
|
|
212
|
+
</button>
|
|
213
|
+
</li>
|
|
214
|
+
</ul>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</section>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<h3 class="site-preview-heading">Long Text</h3>
|
|
221
|
+
<div>
|
|
222
|
+
<section id="react-example-directory-item-longtext" class="usx-chat" style="max-width: 20rem">
|
|
223
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
224
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
225
|
+
<div class="usx-chat__directory">
|
|
226
|
+
<ul class="usx-chat__directory-list">
|
|
227
|
+
<li>
|
|
228
|
+
<button
|
|
229
|
+
type="button"
|
|
230
|
+
class="usx-clickable usx-chat__directory-item"
|
|
231
|
+
data-usx-chat-conversation="accessibility"
|
|
232
|
+
>
|
|
233
|
+
<span class="usx-chat__directory-copy"
|
|
234
|
+
><span class="usx-chat__directory-title"
|
|
235
|
+
>Neighborhood accessibility improvement working group</span
|
|
236
|
+
><span class="usx-chat__directory-subtitle"
|
|
237
|
+
>The application for accessible entrances at the community center</span
|
|
238
|
+
><span class="usx-chat__directory-preview"
|
|
239
|
+
>We have finished reviewing the plans and are ready to discuss the next steps
|
|
240
|
+
together.</span
|
|
241
|
+
></span
|
|
242
|
+
>
|
|
243
|
+
</button>
|
|
244
|
+
</li>
|
|
245
|
+
</ul>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</section>
|
|
249
|
+
</div>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chat-directory-item",
|
|
3
|
+
"template": "chat-directory-item/chat-directory-item.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"default": {
|
|
6
|
+
"id": "directory-item",
|
|
7
|
+
"title": "Jordan Lee",
|
|
8
|
+
"subtitle": "Three design books",
|
|
9
|
+
"preview": "I can bundle all three.",
|
|
10
|
+
"conversationId": "books"
|
|
11
|
+
},
|
|
12
|
+
"props": {
|
|
13
|
+
"id": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Unique row ID, used for the recipient checkbox and action menu."
|
|
16
|
+
},
|
|
17
|
+
"title": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Visible conversation or contact name."
|
|
20
|
+
},
|
|
21
|
+
"subtitle": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Supporting context or contact description. Wraps rather than truncating."
|
|
24
|
+
},
|
|
25
|
+
"preview": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Optional last-message preview. Truncated visually to one line."
|
|
28
|
+
},
|
|
29
|
+
"timeLabel": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Last activity label."
|
|
32
|
+
},
|
|
33
|
+
"href": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Navigation URL. Omit for an enhancement-driven button."
|
|
36
|
+
},
|
|
37
|
+
"conversationId": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Conversation ID for navigation and action events."
|
|
40
|
+
},
|
|
41
|
+
"participantId": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Contact ID for navigation, recipient selection, and action events."
|
|
44
|
+
},
|
|
45
|
+
"formId": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "Form associated with the recipient checkbox."
|
|
48
|
+
},
|
|
49
|
+
"avatarProps": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"default": [],
|
|
52
|
+
"description": "Avatars to display; multiple entries use AvatarGroup. Omit href on avatars inside the row control.",
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"component": "avatar",
|
|
56
|
+
"description": "One avatar."
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"unreadCount": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"default": 0,
|
|
62
|
+
"description": "Unread message count."
|
|
63
|
+
},
|
|
64
|
+
"actions": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"description": "Optional host-defined directory actions. Omit or pass [] to hide the menu. Actions dispatch usx:chat-directory-action; the host controls availability and effects.",
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"description": "One message action.",
|
|
70
|
+
"properties": {
|
|
71
|
+
"id": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Action identifier."
|
|
74
|
+
},
|
|
75
|
+
"label": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Visible action label."
|
|
78
|
+
},
|
|
79
|
+
"disabled": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"description": "Disable this action."
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"default": []
|
|
86
|
+
},
|
|
87
|
+
"selectable": {
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"default": false,
|
|
90
|
+
"description": "Render a recipient checkbox instead of a Clickable. Supply participantId for its value."
|
|
91
|
+
},
|
|
92
|
+
"selected": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"default": false,
|
|
95
|
+
"description": "Initial checkbox selection."
|
|
96
|
+
},
|
|
97
|
+
"disabled": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": false,
|
|
100
|
+
"description": "Disable recipient selection."
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../button/Button';
|
|
3
|
+
export interface ChatHistoryProps {
|
|
4
|
+
hasMore?: boolean;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export default function ChatHistory({ hasMore = false, loading = false, error }: ChatHistoryProps) {
|
|
9
|
+
return (
|
|
10
|
+
<li className="usx-chat__older-history">
|
|
11
|
+
{hasMore ? (
|
|
12
|
+
<Button
|
|
13
|
+
variant="unstyled"
|
|
14
|
+
className="usx-chat__load-older"
|
|
15
|
+
disabled={loading}
|
|
16
|
+
extraAttributes={{ 'data-usx-chat-load-older': '' }}
|
|
17
|
+
>
|
|
18
|
+
{loading ? 'Loading earlier messages…' : error ? 'Try again' : 'Load earlier messages'}
|
|
19
|
+
</Button>
|
|
20
|
+
) : (
|
|
21
|
+
<span className="usx-chat__history-start">Beginning of conversation</span>
|
|
22
|
+
)}
|
|
23
|
+
{error && !loading && (
|
|
24
|
+
<span className="usx-chat__history-error" role="alert">
|
|
25
|
+
{error}
|
|
26
|
+
</span>
|
|
27
|
+
)}
|
|
28
|
+
</li>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Default</h3>
|
|
2
|
+
<div>
|
|
3
|
+
<section id="django-example-history-default" class="usx-chat" style="max-width: 28rem">
|
|
4
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
5
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
6
|
+
<ol class="usx-chat__messages" aria-busy="false" data-usx-chat-older-cursor="6">
|
|
7
|
+
<li class="usx-chat__older-history">
|
|
8
|
+
<button
|
|
9
|
+
type="button"
|
|
10
|
+
class="usa-button usx-button usa-button--unstyled usx-chat__load-older"
|
|
11
|
+
data-usx-chat-load-older=""
|
|
12
|
+
>
|
|
13
|
+
Load earlier messages
|
|
14
|
+
</button>
|
|
15
|
+
</li>
|
|
16
|
+
<li>
|
|
17
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
18
|
+
</li>
|
|
19
|
+
<li>
|
|
20
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
21
|
+
</li>
|
|
22
|
+
<li>
|
|
23
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
24
|
+
</li>
|
|
25
|
+
</ol>
|
|
26
|
+
</div>
|
|
27
|
+
</section>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<h3 class="site-preview-heading">Loading</h3>
|
|
31
|
+
<div>
|
|
32
|
+
<section id="django-example-history-loading" class="usx-chat" style="max-width: 28rem">
|
|
33
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
34
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
35
|
+
<ol class="usx-chat__messages" aria-busy="true" data-usx-chat-older-cursor="6">
|
|
36
|
+
<li class="usx-chat__older-history">
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
class="usa-button usx-button usa-button--unstyled usx-chat__load-older"
|
|
40
|
+
disabled
|
|
41
|
+
aria-disabled="true"
|
|
42
|
+
data-usx-chat-load-older=""
|
|
43
|
+
>
|
|
44
|
+
Loading earlier messages…
|
|
45
|
+
</button>
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
49
|
+
</li>
|
|
50
|
+
<li>
|
|
51
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
55
|
+
</li>
|
|
56
|
+
</ol>
|
|
57
|
+
</div>
|
|
58
|
+
</section>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<h3 class="site-preview-heading">Error</h3>
|
|
62
|
+
<div>
|
|
63
|
+
<section id="django-example-history-error" class="usx-chat" style="max-width: 28rem">
|
|
64
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
65
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
66
|
+
<ol class="usx-chat__messages" aria-busy="false" data-usx-chat-older-cursor="6">
|
|
67
|
+
<li class="usx-chat__older-history">
|
|
68
|
+
<button
|
|
69
|
+
type="button"
|
|
70
|
+
class="usa-button usx-button usa-button--unstyled usx-chat__load-older"
|
|
71
|
+
data-usx-chat-load-older=""
|
|
72
|
+
>
|
|
73
|
+
Try again
|
|
74
|
+
</button>
|
|
75
|
+
|
|
76
|
+
<span class="usx-chat__history-error" role="alert">Try loading again.</span>
|
|
77
|
+
</li>
|
|
78
|
+
<li>
|
|
79
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
80
|
+
</li>
|
|
81
|
+
<li>
|
|
82
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
83
|
+
</li>
|
|
84
|
+
<li>
|
|
85
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
86
|
+
</li>
|
|
87
|
+
</ol>
|
|
88
|
+
</div>
|
|
89
|
+
</section>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<h3 class="site-preview-heading">Beginning</h3>
|
|
93
|
+
<div>
|
|
94
|
+
<section id="django-example-history-beginning" class="usx-chat" style="max-width: 28rem">
|
|
95
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
96
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
97
|
+
<ol class="usx-chat__messages" aria-busy="false" data-usx-chat-older-cursor="6">
|
|
98
|
+
<li class="usx-chat__older-history">
|
|
99
|
+
<span class="usx-chat__history-start">Beginning of conversation</span>
|
|
100
|
+
</li>
|
|
101
|
+
<li>
|
|
102
|
+
<div class="usx-chat__bubble"><p>Earlier update 7.</p></div>
|
|
103
|
+
</li>
|
|
104
|
+
<li>
|
|
105
|
+
<div class="usx-chat__bubble"><p>Earlier update 8.</p></div>
|
|
106
|
+
</li>
|
|
107
|
+
<li>
|
|
108
|
+
<div class="usx-chat__bubble"><p>Earlier update 9.</p></div>
|
|
109
|
+
</li>
|
|
110
|
+
</ol>
|
|
111
|
+
</div>
|
|
112
|
+
</section>
|
|
113
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% load usx_components %}
|
|
2
|
+
<li class="usx-chat__older-history">
|
|
3
|
+
{% if hasMore %}
|
|
4
|
+
{% dict data_usx_chat_load_older='' as olderAttributes %}
|
|
5
|
+
{% button variant='unstyled' className='usx-chat__load-older' disabled=loading extraAttributes=olderAttributes %}
|
|
6
|
+
{% if loading %}
|
|
7
|
+
Loading earlier messages…
|
|
8
|
+
{% elif error %}
|
|
9
|
+
Try again
|
|
10
|
+
{% else %}
|
|
11
|
+
Load earlier messages
|
|
12
|
+
{% endif %}
|
|
13
|
+
{% endbutton %}
|
|
14
|
+
{% else %}
|
|
15
|
+
<span class="usx-chat__history-start">Beginning of conversation</span>
|
|
16
|
+
{% endif %}
|
|
17
|
+
{% if error and not loading %}
|
|
18
|
+
<span class="usx-chat__history-error" role="alert">{{ error }}</span>
|
|
19
|
+
{% endif %}
|
|
20
|
+
</li>
|