@solexllc/usx-react 0.11.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/Popover-Bg4-2-cU.cjs +987 -0
- package/dist/Popover-CqHczzNE.js +988 -0
- package/dist/chat.cjs +1396 -0
- package/dist/chat.js +1396 -0
- package/dist/index.cjs +4412 -5247
- package/dist/index.js +140 -972
- package/package.json +9 -5
- package/src/chat.js +15 -0
- package/src/components/accordion/Accordion.tsx +9 -57
- package/src/components/accordion/accordion.django.html +10 -20
- package/src/components/accordion/config.json +8 -2
- package/src/components/accordion-item/AccordionItem.tsx +54 -0
- package/src/components/accordion-item/accordion-item.django.html +19 -0
- package/src/components/accordion-item/accordion-item.html +8 -0
- package/src/components/accordion-item/config.json +55 -0
- package/src/components/alert/alert.django-snapshot.html +4 -4
- package/src/components/avatar/Avatar.tsx +54 -16
- package/src/components/avatar/avatar.django-snapshot.html +118 -2
- 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 +110 -3
- package/src/components/avatar/config.json +17 -17
- package/src/components/avatar-group/AvatarGroup.tsx +17 -15
- package/src/components/avatar-group/avatar-group.django-snapshot.html +196 -174
- package/src/components/avatar-group/avatar-group.django.html +1 -1
- package/src/components/avatar-group/avatar-group.react-snapshot.html +216 -165
- package/src/components/avatar-group/config.json +14 -8
- 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/banner/banner.django-snapshot.html +2 -2
- package/src/components/button/Button.tsx +15 -3
- package/src/components/button/button.django-snapshot.html +82 -0
- package/src/components/button/button.django.html +5 -2
- package/src/components/button/button.react-snapshot.html +80 -0
- package/src/components/button/config.json +17 -3
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/config.json +7 -16
- package/src/components/card/card.django-snapshot.html +43 -0
- package/src/components/card/card.react-snapshot.html +36 -0
- 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 +23579 -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 +213 -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 +135 -0
- package/src/components/chat-window/chat-window.django-snapshot.html +450 -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/checkbox/checkbox.django-snapshot.html +2 -2
- 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 +25 -18
- package/src/components/code/code.react-snapshot.html +41 -4
- 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/data-table/data-table.django-snapshot.html +4 -5
- package/src/components/data-table/data-table.react-snapshot.html +4 -4
- package/src/components/drawer/drawer.django-snapshot.html +53 -30
- package/src/components/error-page/error-page.django-snapshot.html +20 -7
- package/src/components/fieldset/fieldset.django-snapshot.html +1 -6
- 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/form-group/form-group.django-snapshot.html +0 -2
- package/src/components/header/header.django-snapshot.html +3 -163
- package/src/components/header/header.django.html +2 -2
- package/src/components/header/header.html +1 -1
- package/src/components/header/header.react-snapshot.html +3 -3
- package/src/components/hero/hero.django-snapshot.html +0 -20
- package/src/components/hero/hero.django.html +3 -3
- package/src/components/identifier/config.json +4 -2
- package/src/components/identifier/identifier.django-snapshot.html +13 -16
- package/src/components/identifier/identifier.react-snapshot.html +13 -15
- package/src/components/image/image.django-snapshot.html +6 -6
- 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/layout/layout.django-snapshot.html +2 -0
- 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/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/modal/Modal.tsx +4 -3
- package/src/components/modal/config.json +3 -2
- package/src/components/modal/modal.django-snapshot.html +70 -14
- package/src/components/modal/modal.django.html +7 -9
- package/src/components/modal/modal.html +4 -4
- package/src/components/modal/modal.react-snapshot.html +64 -4
- package/src/components/page/Page.tsx +10 -7
- package/src/components/page/page.django-snapshot.html +5 -8
- package/src/components/page/page.django.html +2 -2
- package/src/components/page/page.html +1 -2
- package/src/components/page/page.react-snapshot.html +5 -8
- package/src/components/pagination/navigation/PaginationNavigation.tsx +2 -0
- package/src/components/pagination/navigation/pagination-navigation.django.html +2 -0
- package/src/components/pagination/pagination.django-snapshot.html +62 -0
- package/src/components/pagination/pagination.django.html +3 -1
- package/src/components/pagination/pagination.html +46 -0
- package/src/components/pagination/pagination.react-snapshot.html +48 -0
- package/src/components/pagination/summary/PaginationSummary.tsx +1 -1
- package/src/components/pagination/summary/pagination-summary.django.html +1 -1
- package/src/components/popover/Popover.tsx +61 -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 +265 -7
- package/src/components/popover/popover.django.html +3 -2
- package/src/components/popover/popover.react-snapshot.html +154 -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/section/Section.tsx +3 -1
- package/src/components/select/select.django-snapshot.html +7 -7
- package/src/components/select/select.react-snapshot.html +7 -7
- package/src/components/site-alert/site-alert.django-snapshot.html +8 -8
- 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/swap/Swap.tsx +35 -3
- package/src/components/swap/config.json +28 -1
- package/src/components/swap/swap.django-snapshot.html +29 -7
- package/src/components/swap/swap.django.html +15 -1
- package/src/components/swap/swap.react-snapshot.html +34 -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 +48 -42
- package/src/components/theme-picker/config.json +27 -29
- package/src/components/theme-picker/theme-picker-select.django.html +1 -1
- package/src/components/theme-picker/theme-picker.django-snapshot.html +283 -78
- package/src/components/theme-picker/theme-picker.django.html +24 -11
- package/src/components/theme-picker/theme-picker.html +155 -54
- package/src/components/theme-picker/theme-picker.react-snapshot.html +265 -67
- package/src/index.js +1 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
{% load usx_components %}
|
|
3
3
|
{# Props: currentPage, totalPages, pages, unbounded, arrowsOnly, #}
|
|
4
4
|
{# prevLabel, nextLabel, hideLinkText, ariaLabel, pageUrlPrefix #}
|
|
5
|
+
{% if unbounded or totalPages > 1 %}
|
|
5
6
|
<nav aria-label="{{ ariaLabel }}" class="usa-pagination usx-pagination__nav{% if arrowsOnly %} usx-pagination__arrows-only{% endif %}" data-usx-pagination-current-page="{{ currentPage }}" data-usx-pagination-page-size="{{ pageSize|default:10 }}" data-usx-pagination-total-items="{{ totalItems|default_if_none:'' }}">
|
|
6
7
|
<ul class="usa-pagination__list">
|
|
7
8
|
|
|
@@ -55,3 +56,4 @@
|
|
|
55
56
|
|
|
56
57
|
</ul>
|
|
57
58
|
</nav>
|
|
59
|
+
{% endif %}
|
|
@@ -1079,6 +1079,68 @@
|
|
|
1079
1079
|
</div>
|
|
1080
1080
|
</div>
|
|
1081
1081
|
|
|
1082
|
+
<h3 class="site-preview-heading">Single Page</h3>
|
|
1083
|
+
<div class="usx-pagination">
|
|
1084
|
+
<div class="usx-pagination__container">
|
|
1085
|
+
<div class="usx-pagination__container-summary">
|
|
1086
|
+
<p class="usa-label usx-label usx-pagination__summary" aria-live="polite" aria-atomic="true">
|
|
1087
|
+
Showing <strong>1–8</strong> of <strong>8</strong> items
|
|
1088
|
+
</p>
|
|
1089
|
+
</div>
|
|
1090
|
+
|
|
1091
|
+
<div class="usx-pagination__container-end">
|
|
1092
|
+
<div class="usx-pagination__step-options">
|
|
1093
|
+
<label class="usa-label usx-label" for="django-pagination-single-page-step-options">
|
|
1094
|
+
Items per page
|
|
1095
|
+
</label>
|
|
1096
|
+
|
|
1097
|
+
<select class="usa-select usx-select" id="django-pagination-single-page-step-options">
|
|
1098
|
+
<option value="">Select an option</option>
|
|
1099
|
+
|
|
1100
|
+
<option value="10" selected>10</option>
|
|
1101
|
+
|
|
1102
|
+
<option value="25">25</option>
|
|
1103
|
+
|
|
1104
|
+
<option value="50">50</option>
|
|
1105
|
+
|
|
1106
|
+
<option value="100">100</option>
|
|
1107
|
+
</select>
|
|
1108
|
+
</div>
|
|
1109
|
+
</div>
|
|
1110
|
+
</div>
|
|
1111
|
+
</div>
|
|
1112
|
+
|
|
1113
|
+
<h3 class="site-preview-heading">No Results</h3>
|
|
1114
|
+
<div class="usx-pagination">
|
|
1115
|
+
<div class="usx-pagination__container">
|
|
1116
|
+
<div class="usx-pagination__container-summary">
|
|
1117
|
+
<p class="usa-label usx-label usx-pagination__summary" aria-live="polite" aria-atomic="true">
|
|
1118
|
+
Showing <strong>0–0</strong> of <strong>0</strong> items
|
|
1119
|
+
</p>
|
|
1120
|
+
</div>
|
|
1121
|
+
|
|
1122
|
+
<div class="usx-pagination__container-end">
|
|
1123
|
+
<div class="usx-pagination__step-options">
|
|
1124
|
+
<label class="usa-label usx-label" for="django-pagination-no-results-step-options">
|
|
1125
|
+
Items per page
|
|
1126
|
+
</label>
|
|
1127
|
+
|
|
1128
|
+
<select class="usa-select usx-select" id="django-pagination-no-results-step-options">
|
|
1129
|
+
<option value="">Select an option</option>
|
|
1130
|
+
|
|
1131
|
+
<option value="10" selected>10</option>
|
|
1132
|
+
|
|
1133
|
+
<option value="25">25</option>
|
|
1134
|
+
|
|
1135
|
+
<option value="50">50</option>
|
|
1136
|
+
|
|
1137
|
+
<option value="100">100</option>
|
|
1138
|
+
</select>
|
|
1139
|
+
</div>
|
|
1140
|
+
</div>
|
|
1141
|
+
</div>
|
|
1142
|
+
</div>
|
|
1143
|
+
|
|
1082
1144
|
<h3 class="site-preview-heading">First Page</h3>
|
|
1083
1145
|
<div class="usx-pagination">
|
|
1084
1146
|
<div class="usx-pagination__container">
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<div class="usx-pagination__container">
|
|
34
34
|
|
|
35
35
|
{# ── Summary (left slot) ───────────────────────────────── #}
|
|
36
|
-
{% if totalItems %}
|
|
36
|
+
{% if totalItems is not None %}
|
|
37
37
|
{% if showSummary != False and showSummary != "false" %}
|
|
38
38
|
<div class="usx-pagination__container-summary">
|
|
39
39
|
{% pagination_summary firstItem=firstItem lastItem=lastItem currentPage=resolvedPage pageSize=resolvedPageSize totalItems=totalItems itemLabel=itemLabel|default:"items" %}{% endpagination_summary %}
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
{% endif %}
|
|
43
43
|
|
|
44
44
|
{# ── Nav + step options (right slot) ─────────────────── #}
|
|
45
|
+
{% if showStepOptions != False or unbounded or totalPages > 1 %}
|
|
45
46
|
<div class="usx-pagination__container-end">
|
|
46
47
|
|
|
47
48
|
{% if showStepOptions != False %}
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
{% pagination_navigation currentPage=resolvedPage totalPages=totalPages pages=pages unbounded=unbounded arrowsOnly=arrowsOnly prevLabel=prevLabel|default:"Previous" nextLabel=nextLabel|default:"Next" hideLinkText=hideLinkText|default_if_none:True ariaLabel=ariaLabel|default:"Pagination" pageUrlPrefix=pageUrlPrefix pageSize=resolvedPageSize totalItems=totalItems %}{% endpagination_navigation %}
|
|
52
53
|
|
|
53
54
|
</div>
|
|
55
|
+
{% endif %}
|
|
54
56
|
|
|
55
57
|
</div>
|
|
56
58
|
</div>
|
|
@@ -486,6 +486,52 @@
|
|
|
486
486
|
</div>
|
|
487
487
|
</div>
|
|
488
488
|
|
|
489
|
+
<h3 class="site-preview-heading">Single Page</h3>
|
|
490
|
+
<div class="usx-pagination">
|
|
491
|
+
<div class="usx-pagination__container">
|
|
492
|
+
<div class="usx-pagination__container-summary">
|
|
493
|
+
<p class="usa-label usx-label usx-pagination__summary" aria-live="polite" aria-atomic="true">
|
|
494
|
+
Showing <strong>1–8</strong> of <strong>8</strong> items
|
|
495
|
+
</p>
|
|
496
|
+
</div>
|
|
497
|
+
<div class="usx-pagination__container-end">
|
|
498
|
+
<div class="usx-pagination__step-options">
|
|
499
|
+
<label class="usa-label usx-label" for="html-pagination-single-page-step-options">Items per page</label>
|
|
500
|
+
<select id="html-pagination-single-page-step-options" class="usa-select usx-select">
|
|
501
|
+
<option value="">Select an option</option>
|
|
502
|
+
<option value="10" selected>10</option>
|
|
503
|
+
<option value="25">25</option>
|
|
504
|
+
<option value="50">50</option>
|
|
505
|
+
<option value="100">100</option>
|
|
506
|
+
</select>
|
|
507
|
+
</div>
|
|
508
|
+
</div>
|
|
509
|
+
</div>
|
|
510
|
+
</div>
|
|
511
|
+
|
|
512
|
+
<h3 class="site-preview-heading">No Results</h3>
|
|
513
|
+
<div class="usx-pagination">
|
|
514
|
+
<div class="usx-pagination__container">
|
|
515
|
+
<div class="usx-pagination__container-summary">
|
|
516
|
+
<p class="usa-label usx-label usx-pagination__summary" aria-live="polite" aria-atomic="true">
|
|
517
|
+
Showing <strong>0–0</strong> of <strong>0</strong> items
|
|
518
|
+
</p>
|
|
519
|
+
</div>
|
|
520
|
+
<div class="usx-pagination__container-end">
|
|
521
|
+
<div class="usx-pagination__step-options">
|
|
522
|
+
<label class="usa-label usx-label" for="html-pagination-no-results-step-options">Items per page</label>
|
|
523
|
+
<select id="html-pagination-no-results-step-options" class="usa-select usx-select">
|
|
524
|
+
<option value="">Select an option</option>
|
|
525
|
+
<option value="10" selected>10</option>
|
|
526
|
+
<option value="25">25</option>
|
|
527
|
+
<option value="50">50</option>
|
|
528
|
+
<option value="100">100</option>
|
|
529
|
+
</select>
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
</div>
|
|
534
|
+
|
|
489
535
|
<h3 class="site-preview-heading">First Page</h3>
|
|
490
536
|
<div class="usx-pagination">
|
|
491
537
|
<div class="usx-pagination__container">
|
|
@@ -917,6 +917,54 @@
|
|
|
917
917
|
</div>
|
|
918
918
|
</div>
|
|
919
919
|
|
|
920
|
+
<h3 class="site-preview-heading">Single Page</h3>
|
|
921
|
+
<div class="usx-pagination">
|
|
922
|
+
<div class="usx-pagination__container">
|
|
923
|
+
<div class="usx-pagination__container-summary">
|
|
924
|
+
<p class="usa-label usx-label usx-pagination__summary" aria-live="polite" aria-atomic="true">
|
|
925
|
+
Showing <strong>1–8</strong> of <strong>8</strong> items
|
|
926
|
+
</p>
|
|
927
|
+
</div>
|
|
928
|
+
<div class="usx-pagination__container-end">
|
|
929
|
+
<div class="usx-pagination__step-options">
|
|
930
|
+
<label class="usa-label usx-label" for="react-pagination-single-page-step-options"
|
|
931
|
+
>Items per page</label
|
|
932
|
+
><select id="react-pagination-single-page-step-options" class="usa-select usx-select">
|
|
933
|
+
<option value="">Select an option</option>
|
|
934
|
+
<option value="10" selected="">10</option>
|
|
935
|
+
<option value="25">25</option>
|
|
936
|
+
<option value="50">50</option>
|
|
937
|
+
<option value="100">100</option>
|
|
938
|
+
</select>
|
|
939
|
+
</div>
|
|
940
|
+
</div>
|
|
941
|
+
</div>
|
|
942
|
+
</div>
|
|
943
|
+
|
|
944
|
+
<h3 class="site-preview-heading">No Results</h3>
|
|
945
|
+
<div class="usx-pagination">
|
|
946
|
+
<div class="usx-pagination__container">
|
|
947
|
+
<div class="usx-pagination__container-summary">
|
|
948
|
+
<p class="usa-label usx-label usx-pagination__summary" aria-live="polite" aria-atomic="true">
|
|
949
|
+
Showing <strong>0–0</strong> of <strong>0</strong> items
|
|
950
|
+
</p>
|
|
951
|
+
</div>
|
|
952
|
+
<div class="usx-pagination__container-end">
|
|
953
|
+
<div class="usx-pagination__step-options">
|
|
954
|
+
<label class="usa-label usx-label" for="react-pagination-no-results-step-options"
|
|
955
|
+
>Items per page</label
|
|
956
|
+
><select id="react-pagination-no-results-step-options" class="usa-select usx-select">
|
|
957
|
+
<option value="">Select an option</option>
|
|
958
|
+
<option value="10" selected="">10</option>
|
|
959
|
+
<option value="25">25</option>
|
|
960
|
+
<option value="50">50</option>
|
|
961
|
+
<option value="100">100</option>
|
|
962
|
+
</select>
|
|
963
|
+
</div>
|
|
964
|
+
</div>
|
|
965
|
+
</div>
|
|
966
|
+
</div>
|
|
967
|
+
|
|
920
968
|
<h3 class="site-preview-heading">First Page</h3>
|
|
921
969
|
<div class="usx-pagination">
|
|
922
970
|
<div class="usx-pagination__container">
|
|
@@ -16,7 +16,7 @@ export default function PaginationSummary({
|
|
|
16
16
|
itemLabel = 'items',
|
|
17
17
|
className = '',
|
|
18
18
|
}: PaginationSummaryProps) {
|
|
19
|
-
const firstItem = (currentPage - 1) * pageSize + 1;
|
|
19
|
+
const firstItem = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
20
20
|
const lastItem = Math.min(currentPage * pageSize, totalItems);
|
|
21
21
|
const classes = ClassNames(
|
|
22
22
|
'usa-label',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{% widthratio previousPages 1 resolvedPageSize as computedOffset %}
|
|
6
6
|
{% widthratio resolvedPage 1 resolvedPageSize as computedLast %}
|
|
7
7
|
<p class="usa-label usx-label usx-pagination__summary" aria-live="polite" aria-atomic="true">
|
|
8
|
-
Showing <strong>{% if firstItem %}{{ firstItem }}{% else %}{{ computedOffset|add:"1" }}{% endif %}–{% if lastItem %}{{ lastItem }}{% elif totalItems and computedLast > totalItems %}{{ totalItems }}{% else %}{{ computedLast }}{% endif %}</strong>
|
|
8
|
+
Showing <strong>{% if totalItems == 0 %}0–0{% else %}{% if firstItem %}{{ firstItem }}{% else %}{{ computedOffset|add:"1" }}{% endif %}–{% if lastItem %}{{ lastItem }}{% elif totalItems and computedLast|add:"0" > totalItems %}{{ totalItems }}{% else %}{{ computedLast }}{% endif %}{% endif %}</strong>
|
|
9
9
|
of <strong>{{ totalItems }}</strong> {{ itemLabel }}
|
|
10
10
|
</p>
|
|
11
11
|
{% endwith %}
|
|
@@ -22,16 +22,27 @@ export interface PopoverProps extends Omit<
|
|
|
22
22
|
panelShape?: PopoverPanelShape;
|
|
23
23
|
/** Open on the initial render. Native details owns subsequent disclosure state. */
|
|
24
24
|
defaultOpen?: boolean;
|
|
25
|
+
/** Keep the panel open when focus or pointer moves outside it. Escape and close controls still close it. */
|
|
26
|
+
dismissOnOutside?: boolean;
|
|
25
27
|
/** Optional native details group. Use a different name at each nesting level. */
|
|
26
28
|
name?: string;
|
|
27
29
|
/** Arbitrary semantic content. Use native links, buttons, lists, or form controls. */
|
|
28
30
|
children?: React.ReactNode;
|
|
29
|
-
/** Renders a PopoverMenu of links and nested flyouts
|
|
31
|
+
/** Renders a PopoverMenu of links, actions, and nested flyouts before any children. */
|
|
30
32
|
menuItems?: PopoverMenuItem[];
|
|
31
33
|
showClose?: boolean;
|
|
32
34
|
closeLabel?: string;
|
|
35
|
+
/** Controls before the panel heading, such as a back button. */
|
|
36
|
+
headerLeftActions?: React.ReactNode;
|
|
37
|
+
/** Controls after the panel heading, before the close icon. */
|
|
38
|
+
headerRightActions?: React.ReactNode;
|
|
39
|
+
showCloseIcon?: boolean;
|
|
40
|
+
closeIconLabel?: string;
|
|
41
|
+
headerClassName?: string;
|
|
33
42
|
/** Optional visible heading for the panel. */
|
|
34
43
|
panelHeading?: string;
|
|
44
|
+
/** Optional ID for a heading that labels panel content and can receive programmatic focus. */
|
|
45
|
+
panelHeadingId?: string;
|
|
35
46
|
/** Heading element for panelHeading, chosen to fit the surrounding page outline. */
|
|
36
47
|
headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
37
48
|
|
|
@@ -55,10 +66,17 @@ export default function Popover({
|
|
|
55
66
|
align = 'start',
|
|
56
67
|
panelShape = 'rounded',
|
|
57
68
|
defaultOpen = false,
|
|
69
|
+
dismissOnOutside = true,
|
|
58
70
|
menuItems,
|
|
59
71
|
showClose = false,
|
|
60
72
|
closeLabel = 'Close',
|
|
73
|
+
headerLeftActions,
|
|
74
|
+
headerRightActions,
|
|
75
|
+
showCloseIcon = false,
|
|
76
|
+
closeIconLabel = 'Close',
|
|
77
|
+
headerClassName,
|
|
61
78
|
panelHeading,
|
|
79
|
+
panelHeadingId,
|
|
62
80
|
headingAs = 'h2',
|
|
63
81
|
scrollable = false,
|
|
64
82
|
className,
|
|
@@ -69,7 +87,6 @@ export default function Popover({
|
|
|
69
87
|
children,
|
|
70
88
|
...props
|
|
71
89
|
}: PopoverProps) {
|
|
72
|
-
const [initiallyOpen] = React.useState(defaultOpen);
|
|
73
90
|
const composedSummaryProps = { ...summaryProps, label: summaryProps?.label ?? 'Open panel' };
|
|
74
91
|
const Heading = headingAs;
|
|
75
92
|
|
|
@@ -77,21 +94,56 @@ export default function Popover({
|
|
|
77
94
|
<details
|
|
78
95
|
{...props}
|
|
79
96
|
className={ClassNames('usx-popover', className)}
|
|
80
|
-
open={
|
|
97
|
+
open={defaultOpen || undefined}
|
|
81
98
|
data-side={side}
|
|
82
99
|
data-align={align}
|
|
100
|
+
data-usx-popover-dismiss-on-outside={dismissOnOutside ? undefined : 'false'}
|
|
83
101
|
{...extraAttributes}
|
|
84
102
|
>
|
|
85
103
|
<Summary unstyled {...composedSummaryProps} />
|
|
86
104
|
<div
|
|
87
105
|
id={id}
|
|
88
|
-
className={ClassNames(
|
|
89
|
-
'usx-popover__panel
|
|
90
|
-
|
|
106
|
+
className={ClassNames(
|
|
107
|
+
'usx-popover__panel',
|
|
108
|
+
{
|
|
109
|
+
'usx-popover__panel--square': panelShape === 'square',
|
|
110
|
+
},
|
|
111
|
+
panelClassName
|
|
112
|
+
)}
|
|
91
113
|
>
|
|
92
|
-
{panelHeading &&
|
|
93
|
-
|
|
94
|
-
|
|
114
|
+
{(headerLeftActions || panelHeading || headerRightActions || showCloseIcon) && (
|
|
115
|
+
<header className={ClassNames('usx-popover__header', headerClassName)}>
|
|
116
|
+
{headerLeftActions && (
|
|
117
|
+
<div className="usx-popover__header-left-actions">{headerLeftActions}</div>
|
|
118
|
+
)}
|
|
119
|
+
<div className="usx-popover__header-content">
|
|
120
|
+
{panelHeading && (
|
|
121
|
+
<Heading id={panelHeadingId} className="usx-popover__panel-heading" tabIndex={-1}>
|
|
122
|
+
{panelHeading}
|
|
123
|
+
</Heading>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
126
|
+
{(headerRightActions || showCloseIcon) && (
|
|
127
|
+
<div className="usx-popover__header-right-actions">
|
|
128
|
+
{headerRightActions}
|
|
129
|
+
{showCloseIcon && (
|
|
130
|
+
<Button
|
|
131
|
+
variant="unstyled"
|
|
132
|
+
tighten
|
|
133
|
+
className="usx-popover__header-action usx-popover__header-close"
|
|
134
|
+
aria-label={closeIconLabel}
|
|
135
|
+
iconProps={[{ name: 'close' }]}
|
|
136
|
+
extraAttributes={{ 'data-usx-popover-close': id }}
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
)}
|
|
141
|
+
</header>
|
|
142
|
+
)}
|
|
143
|
+
{menuItems && menuItems.length > 0 && (
|
|
144
|
+
<PopoverMenu items={menuItems} prefix={id} panelShape={panelShape} />
|
|
145
|
+
)}
|
|
146
|
+
{Boolean(children) && (
|
|
95
147
|
<div
|
|
96
148
|
className={ClassNames(
|
|
97
149
|
'usx-popover__panel-content',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ClassNames from 'classnames';
|
|
3
3
|
import Link from '../link/Link';
|
|
4
|
+
import Icon, { type IconProps } from '../icon/Icon';
|
|
4
5
|
import type { SummaryProps } from '../summary/Summary';
|
|
5
6
|
import Popover, { type PopoverPanelShape } from './Popover';
|
|
6
7
|
|
|
@@ -9,10 +10,15 @@ interface PopoverMenuItemBase {
|
|
|
9
10
|
id?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export interface
|
|
13
|
-
type
|
|
14
|
-
href: string;
|
|
13
|
+
export interface PopoverMenuRowItem extends PopoverMenuItemBase {
|
|
14
|
+
type?: 'button';
|
|
15
15
|
text: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Optional icon before the label of an action row. */
|
|
20
|
+
icon?: IconProps;
|
|
21
|
+
extraAttributes?: Record<string, unknown>;
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export interface PopoverMenuDetailsItem extends PopoverMenuItemBase {
|
|
@@ -22,15 +28,10 @@ export interface PopoverMenuDetailsItem extends PopoverMenuItemBase {
|
|
|
22
28
|
items: PopoverMenuItem[];
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
export
|
|
26
|
-
type: 'text';
|
|
27
|
-
text: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type PopoverMenuItem = PopoverMenuLinkItem | PopoverMenuDetailsItem | PopoverMenuTextItem;
|
|
31
|
+
export type PopoverMenuItem = PopoverMenuDetailsItem | PopoverMenuRowItem;
|
|
31
32
|
|
|
32
33
|
export interface PopoverMenuProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'children'> {
|
|
33
|
-
/** Links, nested menus, or plain text. */
|
|
34
|
+
/** Links, actions, nested menus, or plain text. */
|
|
34
35
|
items: PopoverMenuItem[];
|
|
35
36
|
/** Prefix for generated panel IDs and the native details group name. Generated if omitted. */
|
|
36
37
|
prefix?: string;
|
|
@@ -40,7 +41,13 @@ export interface PopoverMenuProps extends Omit<React.HTMLAttributes<HTMLUListEle
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/** A stacked list of rows; `details` items open nested PopoverMenus beside their row. */
|
|
43
|
-
export default function PopoverMenu({
|
|
44
|
+
export default function PopoverMenu({
|
|
45
|
+
items,
|
|
46
|
+
prefix,
|
|
47
|
+
panelShape,
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}: PopoverMenuProps) {
|
|
44
51
|
const generatedPrefix = React.useId();
|
|
45
52
|
const base = prefix ?? generatedPrefix;
|
|
46
53
|
|
|
@@ -51,7 +58,7 @@ export default function PopoverMenu({ items, prefix, panelShape, className, ...p
|
|
|
51
58
|
|
|
52
59
|
return (
|
|
53
60
|
<li key={id}>
|
|
54
|
-
{item.type === 'details'
|
|
61
|
+
{item.type === 'details' ? (
|
|
55
62
|
<Popover
|
|
56
63
|
id={id}
|
|
57
64
|
summaryProps={{
|
|
@@ -63,15 +70,26 @@ export default function PopoverMenu({ items, prefix, panelShape, className, ...p
|
|
|
63
70
|
panelShape={panelShape}
|
|
64
71
|
menuItems={item.items}
|
|
65
72
|
/>
|
|
66
|
-
)
|
|
67
|
-
|
|
73
|
+
) : item.type === 'button' || item.onClick ? (
|
|
74
|
+
<button
|
|
75
|
+
{...item.extraAttributes}
|
|
76
|
+
type="button"
|
|
77
|
+
className="usx-popover__menu-item"
|
|
78
|
+
onClick={item.onClick}
|
|
79
|
+
disabled={item.disabled}
|
|
80
|
+
>
|
|
81
|
+
{item.icon && <Icon {...item.icon} />}
|
|
82
|
+
{item.text}
|
|
83
|
+
</button>
|
|
84
|
+
) : item.href ? (
|
|
68
85
|
<Link
|
|
69
86
|
href={item.href}
|
|
70
87
|
text={item.text}
|
|
71
88
|
className="usx-no-visited usx-popover__menu-item"
|
|
72
89
|
/>
|
|
90
|
+
) : (
|
|
91
|
+
<span className="usx-popover__menu-item">{item.text}</span>
|
|
73
92
|
)}
|
|
74
|
-
{item.type === 'text' && <span className="usx-popover__menu-item">{item.text}</span>}
|
|
75
93
|
</li>
|
|
76
94
|
);
|
|
77
95
|
})}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "popover",
|
|
3
3
|
"template": "popover/popover.django.html",
|
|
4
|
-
"version":
|
|
5
|
-
"required": [
|
|
4
|
+
"version": 7,
|
|
5
|
+
"required": [
|
|
6
|
+
"id"
|
|
7
|
+
],
|
|
6
8
|
"default": {
|
|
7
9
|
"id": "popover-default",
|
|
8
10
|
"summaryProps": {
|
|
@@ -27,15 +29,18 @@
|
|
|
27
29
|
},
|
|
28
30
|
"menuItems": {
|
|
29
31
|
"type": "array",
|
|
30
|
-
"description": "
|
|
32
|
+
"description": "Menu rows use onClick for a native button, href for a link, or neither for text. Button rows may include icon. Nested rows use type: \"details\" with summaryProps and items.",
|
|
31
33
|
"items": {
|
|
32
34
|
"type": "object",
|
|
33
|
-
"description": "A link,
|
|
35
|
+
"description": "A button, link, text, or nested details row.",
|
|
34
36
|
"properties": {
|
|
35
37
|
"type": {
|
|
36
38
|
"type": "select",
|
|
37
|
-
"options": [
|
|
38
|
-
|
|
39
|
+
"options": [
|
|
40
|
+
"details",
|
|
41
|
+
"button"
|
|
42
|
+
],
|
|
43
|
+
"description": "Use button for a native action row with delegated behavior, or details for a nested row."
|
|
39
44
|
},
|
|
40
45
|
"id": {
|
|
41
46
|
"type": "string",
|
|
@@ -43,40 +48,71 @@
|
|
|
43
48
|
},
|
|
44
49
|
"text": {
|
|
45
50
|
"type": "string",
|
|
46
|
-
"description": "Link or plain text."
|
|
51
|
+
"description": "Link, action, or plain text."
|
|
47
52
|
},
|
|
48
53
|
"href": {
|
|
49
54
|
"type": "string",
|
|
50
|
-
"description": "Link destination.
|
|
55
|
+
"description": "Link destination. Used when onClick is absent."
|
|
51
56
|
},
|
|
52
57
|
"summaryProps": {
|
|
53
58
|
"type": "object",
|
|
54
59
|
"component": "summary",
|
|
55
|
-
"omit": [
|
|
60
|
+
"omit": [
|
|
61
|
+
"unstyled"
|
|
62
|
+
],
|
|
56
63
|
"description": "Props passed to the details row summary. Only for type \"details\"."
|
|
57
64
|
},
|
|
58
65
|
"items": {
|
|
59
66
|
"type": "array",
|
|
60
67
|
"description": "Nested menu rows with the same shape. Only for type \"details\"."
|
|
68
|
+
},
|
|
69
|
+
"onClick": {
|
|
70
|
+
"type": "function",
|
|
71
|
+
"description": "Click handler for a native button row. Takes precedence over href. Django accepts an inline JavaScript string; use a truthy marker when behavior is delegated through data attributes."
|
|
72
|
+
},
|
|
73
|
+
"disabled": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"description": "Disable a button row."
|
|
76
|
+
},
|
|
77
|
+
"extraAttributes": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"description": "Additional attributes for a button row, including data attributes."
|
|
80
|
+
},
|
|
81
|
+
"icon": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"component": "icon",
|
|
84
|
+
"description": "Optional Icon props rendered before a button row label. Only for rows with onClick."
|
|
61
85
|
}
|
|
62
86
|
}
|
|
63
87
|
}
|
|
64
88
|
},
|
|
65
89
|
"side": {
|
|
66
90
|
"type": "select",
|
|
67
|
-
"options": [
|
|
91
|
+
"options": [
|
|
92
|
+
"top",
|
|
93
|
+
"right",
|
|
94
|
+
"bottom",
|
|
95
|
+
"left"
|
|
96
|
+
],
|
|
68
97
|
"default": "bottom",
|
|
69
98
|
"description": "Physical side of the trigger where CSS places the floating panel. Choose a side and alignment with enough space for the panel."
|
|
70
99
|
},
|
|
71
100
|
"align": {
|
|
72
101
|
"type": "select",
|
|
73
|
-
"options": [
|
|
102
|
+
"options": [
|
|
103
|
+
"start",
|
|
104
|
+
"center",
|
|
105
|
+
"end"
|
|
106
|
+
],
|
|
74
107
|
"default": "start",
|
|
75
108
|
"description": "Alignment along the chosen side. Start and end follow text direction for top and bottom."
|
|
76
109
|
},
|
|
77
110
|
"panelShape": {
|
|
78
111
|
"type": "select",
|
|
79
|
-
"options": [
|
|
112
|
+
"options": [
|
|
113
|
+
"rounded",
|
|
114
|
+
"square"
|
|
115
|
+
],
|
|
80
116
|
"default": "rounded",
|
|
81
117
|
"description": "Rounded keeps the original border radius and extra vertical padding; square removes the radius and uses equal outer padding on all sides. Nested menuItems flyouts inherit the shape."
|
|
82
118
|
},
|
|
@@ -85,6 +121,11 @@
|
|
|
85
121
|
"default": false,
|
|
86
122
|
"description": "Open initially. Native details owns subsequent disclosure state."
|
|
87
123
|
},
|
|
124
|
+
"dismissOnOutside": {
|
|
125
|
+
"type": "boolean",
|
|
126
|
+
"default": true,
|
|
127
|
+
"description": "When false, keep the disclosure open as users interact with the rest of the page. Escape and close controls still close it."
|
|
128
|
+
},
|
|
88
129
|
"name": {
|
|
89
130
|
"type": "string",
|
|
90
131
|
"description": "Optional native details group: opening one closes another with the same name. Use unique group names for unrelated groups and each nesting level."
|
|
@@ -92,20 +133,53 @@
|
|
|
92
133
|
"showClose": {
|
|
93
134
|
"type": "boolean",
|
|
94
135
|
"default": false,
|
|
95
|
-
"description": "Add a visible close button after panel content. The shared enhancement enables it
|
|
136
|
+
"description": "Add a visible close button after panel content. The shared enhancement enables it and Escape with focus return. Outside dismissal is controlled by dismissOnOutside. The summary toggles natively without JavaScript."
|
|
96
137
|
},
|
|
97
138
|
"closeLabel": {
|
|
98
139
|
"type": "string",
|
|
99
140
|
"default": "Close",
|
|
100
141
|
"description": "Visible text for the optional close button."
|
|
101
142
|
},
|
|
143
|
+
"headerLeftActions": {
|
|
144
|
+
"type": "slot",
|
|
145
|
+
"description": "Optional controls before the panel heading, such as a back button."
|
|
146
|
+
},
|
|
147
|
+
"headerRightActions": {
|
|
148
|
+
"type": "slot",
|
|
149
|
+
"description": "Optional controls on the right side of the panel header, before the close icon. Can contain another Popover for an action menu."
|
|
150
|
+
},
|
|
151
|
+
"showCloseIcon": {
|
|
152
|
+
"type": "boolean",
|
|
153
|
+
"default": false,
|
|
154
|
+
"description": "Show a close icon in the panel header. React handles closing directly; HTML and Django require the Popover enhancement for dismissal and focus return."
|
|
155
|
+
},
|
|
156
|
+
"closeIconLabel": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"default": "Close",
|
|
159
|
+
"description": "Accessible name for the header close icon."
|
|
160
|
+
},
|
|
161
|
+
"headerClassName": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"description": "Additional class names for the panel header."
|
|
164
|
+
},
|
|
102
165
|
"panelHeading": {
|
|
103
166
|
"type": "string",
|
|
104
167
|
"description": "Optional visible heading for the panel."
|
|
105
168
|
},
|
|
169
|
+
"panelHeadingId": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "Optional heading ID for labeling panel content and restoring focus after a view change. Makes the heading programmatically focusable."
|
|
172
|
+
},
|
|
106
173
|
"headingAs": {
|
|
107
174
|
"type": "select",
|
|
108
|
-
"options": [
|
|
175
|
+
"options": [
|
|
176
|
+
"h1",
|
|
177
|
+
"h2",
|
|
178
|
+
"h3",
|
|
179
|
+
"h4",
|
|
180
|
+
"h5",
|
|
181
|
+
"h6"
|
|
182
|
+
],
|
|
109
183
|
"default": "h2",
|
|
110
184
|
"description": "Heading element used for panelHeading. Choose the level that fits the surrounding page outline."
|
|
111
185
|
},
|
|
@@ -21,9 +21,20 @@
|
|
|
21
21
|
{% include "popover/popover-menu.django.html" with items=item.items prefix=id panelShape=panelShape only %}
|
|
22
22
|
</div>
|
|
23
23
|
</details>
|
|
24
|
-
{% elif item.type == '
|
|
24
|
+
{% elif item.type == 'button' or item.onClick %}
|
|
25
|
+
<button
|
|
26
|
+
type="button"
|
|
27
|
+
class="usx-popover__menu-item"
|
|
28
|
+
{% if item.disabled %}disabled{% endif %}
|
|
29
|
+
{% if item.onClick and item.onClick is not True %}onclick="{{ item.onClick }}"{% endif %}
|
|
30
|
+
{% for attr, value in item.extraAttributes.items %}{{ attr }}="{% if value is True %}true{% elif value is False %}false{% else %}{{ value }}{% endif %}"{% endfor %}
|
|
31
|
+
>
|
|
32
|
+
{% if item.icon %}{% icon props=item.icon %}{% endicon %}{% endif %}
|
|
33
|
+
{{ item.text|force_escape }}
|
|
34
|
+
</button>
|
|
35
|
+
{% elif item.href %}
|
|
25
36
|
{% link href=item.href text=item.text className="usx-no-visited usx-popover__menu-item" %}{{ item.text|force_escape }}{% endlink %}
|
|
26
|
-
{%
|
|
37
|
+
{% else %}
|
|
27
38
|
<span class="usx-popover__menu-item">{{ item.text|force_escape }}</span>
|
|
28
39
|
{% endif %}
|
|
29
40
|
</li>
|