@solexllc/usx-react 0.6.1 → 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.
Files changed (84) hide show
  1. package/dist/index.cjs +231 -98
  2. package/dist/index.js +231 -98
  3. package/package.json +5 -5
  4. package/src/components/accordion/accordion.html +596 -291
  5. package/src/components/alert/alert.html +112 -148
  6. package/src/components/attribution/attribution.html +50 -21
  7. package/src/components/avatar/avatar.html +86 -51
  8. package/src/components/breadcrumb/breadcrumb.html +45 -66
  9. package/src/components/button/button.html +363 -226
  10. package/src/components/callout/Callout.tsx +1 -2
  11. package/src/components/callout/callout.django.html +2 -2
  12. package/src/components/callout/callout.html +0 -5
  13. package/src/components/callout/config.json +1 -5
  14. package/src/components/card/Card.tsx +6 -3
  15. package/src/components/card/card.django.html +2 -2
  16. package/src/components/card/card.html +1032 -35
  17. package/src/components/card/config.json +6 -2
  18. package/src/components/card-group/card-group.html +388 -95
  19. package/src/components/carousel/Carousel.tsx +42 -71
  20. package/src/components/carousel/carousel.django.html +22 -46
  21. package/src/components/carousel/carousel.html +715 -32
  22. package/src/components/carousel/config.json +25 -12
  23. package/src/components/character-count/character-count.html +231 -26
  24. package/src/components/checkbox/checkbox.html +313 -241
  25. package/src/components/checkbox-group/checkbox-group.html +346 -26
  26. package/src/components/clickable/clickable.html +168 -83
  27. package/src/components/code/Code.tsx +4 -3
  28. package/src/components/code/code.django.html +1 -1
  29. package/src/components/code/config.json +4 -0
  30. package/src/components/collection/collection.html +203 -379
  31. package/src/components/combobox/combobox.html +21 -9
  32. package/src/components/container/container.html +2616 -80
  33. package/src/components/copy-to-clipboard/copy-to-clipboard.html +48 -20
  34. package/src/components/details/Details.tsx +69 -0
  35. package/src/components/details/config.json +73 -0
  36. package/src/components/details/details.django.html +7 -0
  37. package/src/components/details/details.html +186 -0
  38. package/src/components/error-message/error-message.html +15 -2
  39. package/src/components/error-page/ErrorPage.tsx +169 -0
  40. package/src/components/error-page/config.json +152 -0
  41. package/src/components/error-page/error-page.django.html +80 -0
  42. package/src/components/error-page/error-page.html +437 -0
  43. package/src/components/eyebrow/eyebrow.html +8 -4
  44. package/src/components/fieldset/fieldset.html +33 -7
  45. package/src/components/file-input/file-input.html +310 -31
  46. package/src/components/file-list/file-list.html +191 -7
  47. package/src/components/footer/footer.html +611 -232
  48. package/src/components/header/header.html +2553 -611
  49. package/src/components/hero/hero.html +300 -38
  50. package/src/components/hint/hint.html +7 -2
  51. package/src/components/identifier/identifier.html +483 -255
  52. package/src/components/image/Image.tsx +2 -2
  53. package/src/components/image/image.django.html +4 -10
  54. package/src/components/image/image.html +144 -29
  55. package/src/components/indicator/indicator.html +25 -23
  56. package/src/components/label/label.html +15 -16
  57. package/src/components/language-selector/language-selector.html +74 -25
  58. package/src/components/layout/layout.html +991 -21
  59. package/src/components/legend/legend.html +10 -9
  60. package/src/components/list/list.html +45 -25
  61. package/src/components/page/Page.tsx +15 -2
  62. package/src/components/page/config.json +13 -1
  63. package/src/components/page/page.django.html +2 -2
  64. package/src/components/page/page.html +29 -8
  65. package/src/components/pagination/pagination.html +907 -305
  66. package/src/components/prose/prose.html +244 -85
  67. package/src/components/quote/Quote.tsx +1 -1
  68. package/src/components/quote/config.json +1 -2
  69. package/src/components/quote/quote.html +2 -7
  70. package/src/components/radio-buttons/radio-buttons.html +623 -127
  71. package/src/components/required/required.html +3 -4
  72. package/src/components/search/search.html +336 -54
  73. package/src/components/section/section.html +73 -11
  74. package/src/components/select/select.html +112 -58
  75. package/src/components/skipnav/skipnav.html +40 -1
  76. package/src/components/spinner/spinner.html +143 -23
  77. package/src/components/step-indicator/step-indicator.html +26 -68
  78. package/src/components/swap/swap.html +99 -154
  79. package/src/components/table/table.html +2168 -988
  80. package/src/components/tag/tag.html +73 -17
  81. package/src/components/task-list/task-list.html +252 -15
  82. package/src/components/theme-picker/theme-picker.html +26 -8
  83. package/src/components/toggle/toggle.html +64 -5
  84. package/src/index.js +2 -0
@@ -1,115 +1,200 @@
1
1
  <h3 class="site-preview-heading">Single Clickable</h3>
2
- <a class="usx-clickable display-flex flex-column padding-2 border" href="https://google.com">
3
- Everything taking up space in this box is clickable, but only the text below
4
- appears as a link.<br />
5
- <span class="usx-clickable__link">I look clickable</span>
6
- </a>
2
+ <a class="usx-clickable display-flex flex-column padding-2 border" href="https://google.com"
3
+ >Everything taking up space in this box is clickable, but only the text below appears as a
4
+ link.<br /><span class="usx-clickable__link">I look clickable</span></a
5
+ >
7
6
 
8
7
  <h3 class="site-preview-heading margin-top-5">Multiple Clickables</h3>
9
- <div class="grid-row grid-gap-6 bg-base-lighter padding-2">
8
+ <div class="grid-row grid-gap-6 bg-surface-2 padding-2">
10
9
  <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
11
- <a class="usx-clickable display-flex padding-1 flex-column flex-align-center" href="https://google.com">
12
- <div class="font-heading-2xl text-secondary" style="text-align: center;">
13
- #1
14
- </div>
15
- <span class="usx-clickable__link">Choose this door</span>
16
- </a>
10
+ <a
11
+ class="usx-clickable display-flex padding-1 flex-column flex-align-center"
12
+ href="https://google.com"
13
+ ><div class="font-heading-2xl text-secondary text-center">#1</div>
14
+ <span class="usx-clickable__link">Choose this door</span></a
15
+ >
17
16
  </div>
18
17
  <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
19
- <a class="usx-clickable display-flex padding-1 flex-column flex-align-center" href="https://google.com">
20
- <div class="font-heading-2xl text-secondary" style="text-align: center;">
21
- #2
22
- </div>
23
- <span class="usx-clickable__link">Choose this door</span>
24
- </a>
18
+ <a
19
+ class="usx-clickable display-flex padding-1 flex-column flex-align-center"
20
+ href="https://google.com"
21
+ ><div class="font-heading-2xl text-secondary text-center">#2</div>
22
+ <span class="usx-clickable__link">Choose this door</span></a
23
+ >
25
24
  </div>
26
25
  <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
27
- <a class="usx-clickable display-flex padding-1 flex-column flex-align-center" href="https://google.com">
28
- <div class="font-heading-2xl text-secondary" style="text-align: center;">
29
- #3
30
- </div>
31
- <span class="usx-clickable__link">Choose this door</span>
32
- </a>
26
+ <a
27
+ class="usx-clickable display-flex padding-1 flex-column flex-align-center"
28
+ href="https://google.com"
29
+ ><div class="font-heading-2xl text-secondary text-center">#3</div>
30
+ <span class="usx-clickable__link">Choose this door</span></a
31
+ >
33
32
  </div>
34
33
  </div>
35
34
 
36
35
  <h3 class="site-preview-heading margin-top-5">With Color Change</h3>
37
- <div class="grid-row grid-gap-6 bg-base-lighter padding-2">
36
+ <div class="grid-row grid-gap-6 bg-surface-2 padding-2">
38
37
  <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
39
- <a class="usx-clickable display-flex flex-align-center" href="https://google.com">
40
- <svg class="usa-icon usa-icon--size-3 usx-clickable__color-on-hover" aria-hidden="true" focusable="false" role="img">
41
- <use href="./img/sprite.svg#tornado"></use>
42
- </svg>
43
- <span class="margin-left-1 usx-clickable__link">Auntie Em!</span>
44
- </a>
38
+ <a class="usx-clickable display-flex flex-align-center" href="https://google.com"
39
+ ><span class="usx-clickable__color-on-hover"
40
+ ><svg
41
+ class="usa-icon usa-icon--size-3"
42
+ aria-hidden="true"
43
+ aria-label="tornado icon"
44
+ focusable="false"
45
+ role="img"
46
+ >
47
+ <use href="/img/sprite.svg#tornado"></use></svg></span
48
+ ><span class="usx-clickable__link margin-left-1">Auntie Em!</span></a
49
+ >
45
50
  </div>
46
- <div class="grid-col-12 display-flex flex-justify-center margin-top-2 tablet:margin-top-0 tablet:grid-col-4">
47
- <a class="usx-clickable display-flex flex-align-center" href="https://google.com">
48
- <svg class="usa-icon usa-icon--size-3 usx-clickable__color-on-hover" aria-hidden="true" focusable="false" role="img">
49
- <use href="./img/sprite.svg#my_location"></use>
50
- </svg>
51
- <span class="margin-left-1 usx-clickable__link">We're not in Kansas anymore</span>
52
- </a>
51
+ <div
52
+ class="grid-col-12 display-flex flex-justify-center margin-top-2 tablet:margin-top-0 tablet:grid-col-4"
53
+ >
54
+ <a class="usx-clickable display-flex flex-align-center" href="https://google.com"
55
+ ><span class="usx-clickable__color-on-hover"
56
+ ><svg
57
+ class="usa-icon usa-icon--size-3"
58
+ aria-hidden="true"
59
+ aria-label="my_location icon"
60
+ focusable="false"
61
+ role="img"
62
+ >
63
+ <use href="/img/sprite.svg#my_location"></use></svg></span
64
+ ><span class="usx-clickable__link margin-left-1">We're not in Kansas anymore</span></a
65
+ >
53
66
  </div>
54
- <div class="grid-col-12 display-flex flex-justify-center margin-top-2 tablet:margin-top-0 tablet:grid-col-4">
55
- <a class="usx-clickable display-flex flex-align-center" href="https://google.com">
56
- <svg class="usa-icon usa-icon--size-3 usx-clickable__color-on-hover" aria-hidden="true" focusable="false" role="img">
57
- <use href="./img/sprite.svg#pets"></use>
58
- </svg>
59
- <span class="margin-left-1 usx-clickable__link">Oh, Todo!</span>
60
- </a>
67
+ <div
68
+ class="grid-col-12 display-flex flex-justify-center margin-top-2 tablet:margin-top-0 tablet:grid-col-4"
69
+ >
70
+ <a class="usx-clickable display-flex flex-align-center" href="https://google.com"
71
+ ><span class="usx-clickable__color-on-hover"
72
+ ><svg
73
+ class="usa-icon usa-icon--size-3"
74
+ aria-hidden="true"
75
+ aria-label="pets icon"
76
+ focusable="false"
77
+ role="img"
78
+ >
79
+ <use href="/img/sprite.svg#pets"></use></svg></span
80
+ ><span class="usx-clickable__link margin-left-1">Oh, Toto!</span></a
81
+ >
61
82
  </div>
62
83
  </div>
63
84
 
64
-
65
- <h3 class="site-preview-heading margin-top-5">Read John's Story</h3>
66
- <a class="usx-clickable display-flex flex-align-center margin-1 usx-width-fit" href="https://google.com">
67
- <span class="usx-circle bg-black text-white usx-clickable__bg-color-on-hover display-flex flex-align-center flex-justify-center width-4 height-4">
68
- <svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
69
- <use href="./img/sprite.svg#arrow_forward"></use>
70
- </svg>
71
- </span>
72
- <span class="margin-left-1 usx-clickable__link">Read John's Story</span>
73
- </a>
85
+ <h3 class="site-preview-heading margin-top-5">Read John's Story CTA</h3>
86
+ <a
87
+ class="usx-clickable display-flex flex-row flex-align-center margin-1 usx-width-fit"
88
+ href="https://google.com"
89
+ ><span
90
+ class="usx-clickable__bg-color-on-hover usx-circle bg-black text-white display-flex flex-align-center flex-justify-center width-4 height-4"
91
+ ><svg
92
+ class="usa-icon usa-icon--size-3"
93
+ aria-hidden="true"
94
+ aria-label="arrow_forward icon"
95
+ focusable="false"
96
+ role="img"
97
+ >
98
+ <use href="/img/sprite.svg#arrow_forward"></use></svg></span
99
+ ><span class="usx-clickable__link margin-left-1">Read John's Story</span></a
100
+ >
74
101
 
75
102
  <h3 class="site-preview-heading margin-top-5">Clickable Quote</h3>
76
- <a class="usx-clickable display-block maxw-tablet" href="https://google.com">
77
- <div class="usx-quote usx-quote--vertical">
78
- <div class="usx-callout usx-callout--vertical border-primary">
103
+ <a class="usx-clickable display-block maxw-tablet" href="https://google.com"
104
+ ><div class="usx-quote usx-quote--vertical">
105
+ <div class="usx-callout usx-callout--vertical border-info usx-callout--big">
79
106
  <figure class="usx-quote__body">
80
- <blockquote class="usx-quote__content font-serif-lg">❝We found this wand shop that had the best wands, and we were like, "We have to go here!" So we went there.❞</blockquote>
107
+ <blockquote class="usx-quote__content font-serif-lg">
108
+ ❝We found this wand shop that had the best wands, and we were like, "We have to go here!"
109
+ So we went there.❞
110
+ </blockquote>
81
111
  <figcaption class="usx-quote__attribution">
82
112
  <div class="usx-attribution">
83
- <span class="usx-attribution__content">
84
- <span class="usx-attribution__primary">John Doe</span>
85
- <span class="usx-attribution__secondary">Under Secretary for the Department of Magic and Mystical Affairs</span>
86
- </span>
113
+ <span class="usx-attribution__content"
114
+ ><span class="usx-attribution__primary">John Doe</span
115
+ ><span class="usx-attribution__secondary"
116
+ >Under Secretary for the Department of Magic and Mystical Affairs</span
117
+ ></span
118
+ >
87
119
  </div>
88
120
  </figcaption>
89
121
  </figure>
90
122
  </div>
91
123
  </div>
92
- <span class="display-flex flex-align-center margin-top-2">
93
- <span class="usx-circle bg-black text-white usx-clickable__bg-color-on-hover display-flex flex-align-center flex-justify-center width-4 height-4">
94
- <svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img"><use href="./img/sprite.svg#arrow_forward"></use></svg>
95
- </span>
96
- <span class="margin-left-1 usx-clickable__link">Read John's Story</span>
97
- </span>
98
- </a>
124
+ <div class="display-flex flex-align-center margin-top-2">
125
+ <span
126
+ class="usx-clickable__bg-color-on-hover usx-circle bg-black text-white display-flex flex-align-center flex-justify-center width-4 height-4"
127
+ ><svg
128
+ class="usa-icon usa-icon--size-3"
129
+ aria-hidden="true"
130
+ aria-label="arrow_forward icon"
131
+ focusable="false"
132
+ role="img"
133
+ >
134
+ <use href="/img/sprite.svg#arrow_forward"></use></svg></span
135
+ ><span class="usx-clickable__link margin-left-1">Read John's Story</span>
136
+ </div></a
137
+ >
138
+
139
+ <h3 class="site-preview-heading margin-top-5">Clickable Quote v2 (Manual Markup)</h3>
140
+ <a class="usx-clickable display-block maxw-tablet" href="https://google.com"
141
+ ><div class="usx-callout usx-callout--vertical border-info usx-callout--big usx-quote">
142
+ <figure class="usx-quote__body">
143
+ <blockquote class="usx-quote__content font-serif-lg">
144
+ ❝We found this wand shop that had the best wands, and we were like, "We have to go here!" So
145
+ we went there.❞
146
+ </blockquote>
147
+ <figcaption class="usx-quote__attribution">
148
+ <div class="usx-attribution">
149
+ <span class="usx-attribution__content"
150
+ ><span class="usx-attribution__primary">John Doe</span
151
+ ><span class="usx-attribution__secondary"
152
+ >Under Secretary for the Department of Magic and Mystical Affairs</span
153
+ ></span
154
+ >
155
+ </div>
156
+ </figcaption>
157
+ <div class="display-flex flex-align-center margin-top-2">
158
+ <span
159
+ class="usx-clickable__bg-color-on-hover usx-circle bg-black text-white display-flex flex-align-center flex-justify-center width-4 height-4"
160
+ ><svg
161
+ class="usa-icon usa-icon--size-3"
162
+ aria-hidden="true"
163
+ aria-label="arrow_forward icon"
164
+ focusable="false"
165
+ role="img"
166
+ >
167
+ <use href="/img/sprite.svg#arrow_forward"></use></svg></span
168
+ ><span class="usx-clickable__link margin-left-1">Read John's Story</span>
169
+ </div>
170
+ </figure>
171
+ </div></a
172
+ >
99
173
 
100
- <h2 class="site-preview-heading margin-top-5">Basic Class demonstrations</h2>
174
+ <h3 class="site-preview-heading margin-top-5">All Classes on One Element</h3>
175
+ <a class="usx-clickable text-primary-lightest" href="https://google.com"
176
+ ><span class="usx-clickable__link usx-clickable__color-on-hover usx-clickable__bg-color-on-hover"
177
+ >Background and text changes color.</span
178
+ ></a
179
+ >
101
180
 
102
- <h3 class="site-preview-heading margin-top-5">All classes on single element</h3>
103
- <a class="usx-clickable text-primary-lightest" href="https://google.com">
104
- <span class="usx-clickable__bg-color-on-hover usx-clickable__color-on-hover usx-clickable__link">Background and text changes color.</span>
105
- </a>
181
+ <h3 class="site-preview-heading margin-top-5">Color Classes Within Link</h3>
182
+ <a class="usx-clickable text-primary-lightest" href="https://google.com"
183
+ ><span class="usx-clickable__link"
184
+ ><span class="usx-clickable__bg-color-on-hover">Background changes color.</span
185
+ ><span class="usx-clickable__color-on-hover"> Text changes color.</span> No change to background
186
+ or color.</span
187
+ ></a
188
+ >
106
189
 
107
- <h3 class="site-preview-heading margin-top-5">Color classes within link class (fully underlined)</h3>
108
- <a class="usx-clickable text-primary-lightest" href="https://google.com">
109
- <span class="usx-clickable__link"><span class="usx-clickable__bg-color-on-hover">Background changes color.</span><span class="usx-clickable__color-on-hover"> Text changes color.</span> No change to background or color.</span>
110
- </a>
190
+ <h3 class="site-preview-heading margin-top-5">Color Classes Outside Link</h3>
191
+ <a class="usx-clickable text-primary-lightest" href="https://google.com"
192
+ ><span class="usx-clickable__bg-color-on-hover">Background changes color.</span
193
+ ><span class="usx-clickable__color-on-hover"> Text changes color. </span
194
+ ><span class="usx-clickable__link">No change to background or color.</span></a
195
+ >
111
196
 
112
- <h3 class="site-preview-heading margin-top-5">Color classes outside link class</h3>
113
- <a class="usx-clickable text-primary-lightest" href="https://google.com">
114
- <span class="usx-clickable__bg-color-on-hover">Background changes color.</span><span class="usx-clickable__color-on-hover"> Text changes color. </span><span class="usx-clickable__link">No change to background or color.</span>
115
- </a>
197
+ <h3 class="site-preview-heading margin-top-5">Button Surface</h3>
198
+ <button type="button" class="usx-clickable usa-button usx-button usx-button--ghost">
199
+ <span class="usx-clickable__link">Action-style clickable (button mode)</span>
200
+ </button>
@@ -14,16 +14,17 @@ export interface CodeProps {
14
14
  copyText?: string | null;
15
15
  staticBaseUrl?: string;
16
16
  className?: string;
17
+ contentClassName?: string;
17
18
  }
18
19
 
19
- export default function Code({ lines = [], allowHtml = false, copyText = null, staticBaseUrl, className = '' }: CodeProps) {
20
+ export default function Code({ lines = [], allowHtml = false, copyText = null, staticBaseUrl, className = '', contentClassName = '' }: CodeProps) {
20
21
  return (
21
22
  <div className={ClassNames('usx-mockup-code', className)}>
22
- <div className="usx-mockup-code__content">
23
+ <div className={ClassNames('usx-mockup-code__content', contentClassName)}>
23
24
  {lines.map((line, i) => (
24
25
  <pre
25
26
  key={i}
26
- {...(line.prefix != null ? { 'data-prefix': line.prefix } : {})}
27
+ data-prefix={line.prefix != null ? line.prefix : undefined}
27
28
  className={line.className || undefined}
28
29
  >
29
30
  {allowHtml ? <code dangerouslySetInnerHTML={{ __html: line.code }} /> : <code>{line.code}</code>}
@@ -1,7 +1,7 @@
1
1
  {# Django template for Code #}
2
2
  {% load components %}
3
3
  <div class="usx-mockup-code{% if className %} {{ className }}{% endif %}">
4
- <div class="usx-mockup-code__content">
4
+ <div class="usx-mockup-code__content{% if contentClassName %} {{ contentClassName }}{% endif %}">
5
5
  {% for line in lines %}
6
6
  <pre
7
7
  {% if line.prefix %} data-prefix="{{ line.prefix }}"{% endif %}{% if line.className %} class="{{ line.className }}"{% endif %}
@@ -44,6 +44,10 @@
44
44
  "className": {
45
45
  "type": "string",
46
46
  "description": "Additional CSS classes to apply to the wrapper div."
47
+ },
48
+ "contentClassName": {
49
+ "type": "string",
50
+ "description": "Additional CSS classes to apply to the content wrapper div inside the component."
47
51
  }
48
52
  }
49
53
  }