@solexllc/usx-react 0.6.0 → 0.7.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/dist/index.cjs +231 -98
- package/dist/index.js +231 -98
- package/package.json +5 -5
- package/src/components/accordion/accordion.html +596 -291
- package/src/components/alert/alert.html +112 -148
- package/src/components/attribution/attribution.html +50 -21
- package/src/components/avatar/avatar.html +86 -51
- package/src/components/breadcrumb/breadcrumb.html +45 -66
- package/src/components/button/button.html +363 -226
- package/src/components/callout/Callout.tsx +1 -2
- package/src/components/callout/callout.django.html +2 -2
- package/src/components/callout/callout.html +0 -5
- package/src/components/callout/config.json +1 -5
- package/src/components/card/Card.tsx +6 -3
- package/src/components/card/card.django.html +2 -2
- package/src/components/card/card.html +1032 -35
- package/src/components/card/config.json +6 -2
- package/src/components/card-group/card-group.html +388 -95
- package/src/components/carousel/Carousel.tsx +42 -71
- package/src/components/carousel/carousel.django.html +22 -46
- package/src/components/carousel/carousel.html +715 -32
- package/src/components/carousel/config.json +25 -12
- package/src/components/character-count/character-count.html +231 -26
- package/src/components/checkbox/checkbox.html +313 -241
- package/src/components/checkbox-group/checkbox-group.html +346 -26
- package/src/components/clickable/clickable.html +168 -83
- package/src/components/code/Code.tsx +4 -3
- package/src/components/code/code.django.html +1 -1
- package/src/components/code/config.json +4 -0
- package/src/components/collection/collection.html +203 -379
- package/src/components/combobox/combobox.html +21 -9
- package/src/components/container/container.html +2616 -80
- package/src/components/copy-to-clipboard/copy-to-clipboard.html +48 -20
- package/src/components/details/Details.tsx +69 -0
- package/src/components/details/config.json +73 -0
- package/src/components/details/details.django.html +7 -0
- package/src/components/details/details.html +186 -0
- package/src/components/error-message/error-message.html +15 -2
- package/src/components/error-page/ErrorPage.tsx +169 -0
- package/src/components/error-page/config.json +152 -0
- package/src/components/error-page/error-page.django.html +80 -0
- package/src/components/error-page/error-page.html +437 -0
- package/src/components/eyebrow/eyebrow.html +8 -4
- package/src/components/fieldset/fieldset.html +33 -7
- package/src/components/file-input/file-input.html +310 -31
- package/src/components/file-list/file-list.html +191 -7
- package/src/components/footer/footer.html +611 -232
- package/src/components/header/header.html +2553 -611
- package/src/components/hero/hero.html +300 -38
- package/src/components/hint/hint.html +7 -2
- package/src/components/identifier/identifier.html +483 -255
- package/src/components/image/Image.tsx +2 -2
- package/src/components/image/image.django.html +4 -10
- package/src/components/image/image.html +144 -29
- package/src/components/indicator/indicator.html +25 -23
- package/src/components/label/label.html +15 -16
- package/src/components/language-selector/language-selector.html +74 -25
- package/src/components/layout/layout.html +991 -21
- package/src/components/legend/legend.html +10 -9
- package/src/components/list/list.html +45 -25
- package/src/components/page/Page.tsx +15 -2
- package/src/components/page/config.json +13 -1
- package/src/components/page/page.django.html +2 -2
- package/src/components/page/page.html +29 -8
- package/src/components/pagination/pagination.html +907 -305
- package/src/components/prose/prose.html +244 -85
- package/src/components/quote/Quote.tsx +1 -1
- package/src/components/quote/config.json +1 -2
- package/src/components/quote/quote.html +2 -7
- package/src/components/radio-buttons/radio-buttons.html +623 -127
- package/src/components/required/required.html +3 -4
- package/src/components/search/search.html +336 -54
- package/src/components/section/section.html +73 -11
- package/src/components/select/select.html +112 -58
- package/src/components/skipnav/skipnav.html +40 -1
- package/src/components/spinner/spinner.html +143 -23
- package/src/components/step-indicator/step-indicator.html +26 -68
- package/src/components/swap/swap.html +99 -154
- package/src/components/table/table.html +2168 -988
- package/src/components/tag/tag.html +73 -17
- package/src/components/task-list/task-list.html +252 -15
- package/src/components/theme-picker/theme-picker.html +26 -8
- package/src/components/toggle/toggle.html +64 -5
- package/src/index.js +2 -0
|
@@ -12,8 +12,7 @@ export interface CalloutProps extends Omit<React.HTMLAttributes<HTMLElement>, 'c
|
|
|
12
12
|
content?: React.ReactNode;
|
|
13
13
|
backgroundColor?: string;
|
|
14
14
|
textColor?: string;
|
|
15
|
-
element?: 'div' | 'section' | 'aside' | '
|
|
16
|
-
cite?: string;
|
|
15
|
+
element?: 'div' | 'section' | 'aside' | 'p';
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export default function Callout({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{% with tag=element|default:'div' %}
|
|
2
|
-
<{% if tag == 'section' or tag == 'aside' or tag == '
|
|
2
|
+
<{% if tag == 'section' or tag == 'aside' or tag == 'p' %}{{ tag }}{% else %}div{% endif %} class="usx-callout{% if orientation == 'vertical' %} usx-callout--vertical{% endif %}{% if strokeColor %} border-{{ strokeColor }}{% endif %}{% if indent %} usx-callout--indent-{{ indent }}{% endif %}{% if dedent %} usx-callout--dedent{% endif %}{% if big or orientation|default:'horizontal' == 'horizontal' %}{% if big is not False %} usx-callout--big{% endif %}{% endif %}{% if backgroundColor %} bg-{{ backgroundColor }}{% endif %}{% if textColor %} text-{{ textColor }}{% endif %}{% if className %} {{ className }}{% endif %}">
|
|
3
3
|
{% if children != None %}{{ children|safe }}{% elif content != None %}{{ content|safe }}{% endif %}
|
|
4
|
-
</{% if tag == 'section' or tag == 'aside' or tag == '
|
|
4
|
+
</{% if tag == 'section' or tag == 'aside' or tag == 'p' %}{{ tag }}{% else %}div{% endif %}>
|
|
5
5
|
{% endwith %}
|
|
@@ -59,11 +59,6 @@
|
|
|
59
59
|
<aside class="usx-callout usx-callout--big">Supplementary information in an aside.</aside>
|
|
60
60
|
</section>
|
|
61
61
|
|
|
62
|
-
<section class="margin-bottom-4">
|
|
63
|
-
<h2>Blockquote</h2>
|
|
64
|
-
<blockquote class="usx-callout usx-callout--big" cite="https://example.com/report">A sourced quotation using the blockquote root.</blockquote>
|
|
65
|
-
</section>
|
|
66
|
-
|
|
67
62
|
<section class="margin-bottom-4">
|
|
68
63
|
<h2>Children Override</h2>
|
|
69
64
|
<div class="usx-callout usx-callout--big"><p><strong>Children win.</strong> Rich content can include <a class="usa-link usx-link usa-link--external" href="#details">links</a> and emphasis.</p></div>
|
|
@@ -20,6 +20,7 @@ export interface CardProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
20
20
|
showCarouselDots?: boolean;
|
|
21
21
|
children?: React.ReactNode;
|
|
22
22
|
className?: string;
|
|
23
|
+
containerClassName?: string;
|
|
23
24
|
tag?: React.ElementType;
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -37,6 +38,7 @@ export default function Card({
|
|
|
37
38
|
showCarouselDots = true,
|
|
38
39
|
children,
|
|
39
40
|
className = '',
|
|
41
|
+
containerClassName = '',
|
|
40
42
|
tag: RootTag = 'div',
|
|
41
43
|
...props
|
|
42
44
|
}: CardProps) {
|
|
@@ -59,14 +61,15 @@ export default function Card({
|
|
|
59
61
|
}
|
|
60
62
|
);
|
|
61
63
|
|
|
62
|
-
const hasStructuredContent = title || description || tagProps || buttonProps || imageProps;
|
|
64
|
+
const hasStructuredContent = title || description || tagProps?.length || buttonProps?.length || imageProps?.length;
|
|
63
65
|
const shouldRenderStructured = hasStructuredContent && !children;
|
|
64
66
|
|
|
65
67
|
const hasImages = imageProps && imageProps.length > 0;
|
|
66
68
|
const useCarousel = imageProps && imageProps.length > 1;
|
|
67
69
|
const media = useCarousel ? (
|
|
68
70
|
<Carousel
|
|
69
|
-
|
|
71
|
+
ariaLabel={`${title || props.id || 'Card'} images`}
|
|
72
|
+
role="group"
|
|
70
73
|
showDots={showCarouselDots}
|
|
71
74
|
className="usx-card__carousel"
|
|
72
75
|
slides={imageProps?.map((img, index) => ({
|
|
@@ -79,7 +82,7 @@ export default function Card({
|
|
|
79
82
|
|
|
80
83
|
return (
|
|
81
84
|
<RootTag className={cardClasses} {...props}>
|
|
82
|
-
<div className=
|
|
85
|
+
<div className={ClassNames('usa-card__container', containerClassName)}>
|
|
83
86
|
{shouldRenderStructured ? (
|
|
84
87
|
<>
|
|
85
88
|
{title && (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% load components %}
|
|
2
2
|
<{% if tag %}{{ tag }}{% else %}div{% endif %}{% if id %} id="{{ id }}"{% endif %} class="usa-card usx-card{% if headerFirst %} usa-card--header-first{% endif %}{% if flag %} usa-card--flag{% endif %}{% if mediaRight %} usa-card--media-right{% endif %}{% if className %} {{ className }}{% endif %}">
|
|
3
|
-
<div class="usa-card__container">
|
|
3
|
+
<div class="usa-card__container{% if containerClassName %} {{ containerClassName }}{% endif %}">
|
|
4
4
|
{% if children %}
|
|
5
5
|
{{ children }}
|
|
6
6
|
{% elif title or description or tagProps or buttonProps or imageProps %}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{% endif %}
|
|
12
12
|
{% if imageProps and imageProps|length > 1 %}
|
|
13
13
|
<div class="usa-card__media{% if mediaInset %} usa-card__media--inset{% endif %}{% if mediaExdent %} usa-card__media--exdent{% endif %}">
|
|
14
|
-
{% carousel slides=imageProps
|
|
14
|
+
{% carousel slides=imageProps ariaLabel=title|default:'Card'|add:' images' role='group' showDots=showCarouselDots|default_bool:True className='usx-card__carousel' %}{% endcarousel %}
|
|
15
15
|
</div>
|
|
16
16
|
{% elif imageProps and imageProps.0 %}
|
|
17
17
|
<div class="usa-card__media{% if mediaInset %} usa-card__media--inset{% endif %}{% if mediaExdent %} usa-card__media--exdent{% endif %}">
|