@solexllc/usx-react 0.9.0 → 0.10.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 +6 -5
- package/dist/index.cjs +123 -97
- package/dist/index.js +124 -98
- package/package.json +4 -4
- package/src/components/accordion/Accordion.tsx +4 -1
- package/src/components/accordion/accordion.django.html +1 -1
- package/src/components/accordion/config.json +1 -0
- package/src/components/banner/Banner.tsx +3 -1
- package/src/components/banner/banner.django.html +1 -1
- package/src/components/banner/config.json +1 -0
- package/src/components/carousel/carousel.django-snapshot.html +0 -40
- package/src/components/carousel/carousel.react-snapshot.html +0 -38
- package/src/components/character-count/CharacterCount.tsx +3 -0
- package/src/components/character-count/character-count.django-snapshot.html +43 -0
- package/src/components/character-count/character-count.django.html +2 -2
- package/src/components/character-count/character-count.react-snapshot.html +37 -0
- package/src/components/character-count/config.json +9 -0
- package/src/components/checkbox/Checkbox.tsx +16 -17
- package/src/components/checkbox/checkbox.django-snapshot.html +18 -0
- package/src/components/checkbox/checkbox.django.html +6 -4
- package/src/components/checkbox/checkbox.react-snapshot.html +14 -0
- package/src/components/checkbox/config.json +4 -4
- package/src/components/checkbox-group/checkbox-group.django-snapshot.html +54 -0
- package/src/components/checkbox-group/checkbox-group.react-snapshot.html +45 -0
- package/src/components/combobox/Combobox.tsx +6 -1
- package/src/components/combobox/combobox.django-snapshot.html +141 -0
- package/src/components/combobox/combobox.django.html +2 -2
- package/src/components/combobox/combobox.react-snapshot.html +76 -0
- package/src/components/combobox/config.json +9 -0
- package/src/components/data-table/DataTable.tsx +4 -1
- package/src/components/data-table/config.json +4 -0
- package/src/components/data-table/data-table.django.html +1 -1
- package/src/components/date-picker/DatePicker.tsx +6 -1
- package/src/components/date-picker/config.json +9 -0
- package/src/components/date-picker/date-picker.django-snapshot.html +23 -0
- package/src/components/date-picker/date-picker.django.html +4 -4
- package/src/components/date-picker/date-picker.react-snapshot.html +19 -0
- package/src/components/date-range-picker/DateRangePicker.tsx +11 -2
- package/src/components/date-range-picker/config.json +14 -0
- package/src/components/date-range-picker/date-range-picker.django-snapshot.html +47 -0
- package/src/components/date-range-picker/date-range-picker.django.html +5 -5
- package/src/components/date-range-picker/date-range-picker.react-snapshot.html +38 -0
- package/src/components/drawer/Drawer.tsx +3 -1
- package/src/components/drawer/config.json +4 -0
- package/src/components/drawer/drawer.django.html +1 -1
- package/src/components/file-input/FileInput.tsx +7 -2
- package/src/components/file-input/_contents.django.html +2 -1
- package/src/components/file-input/config.json +4 -0
- package/src/components/header/Header.tsx +15 -9
- package/src/components/header/config.json +1 -0
- package/src/components/header/header.django-snapshot.html +24 -0
- package/src/components/header/header.django.html +8 -4
- package/src/components/header/header.html +20 -0
- package/src/components/header/header.react-snapshot.html +20 -0
- package/src/components/in-page-nav/InPageNav.tsx +3 -0
- package/src/components/in-page-nav/config.json +1 -0
- package/src/components/in-page-nav/in-page-nav.django.html +1 -1
- package/src/components/input/Input.tsx +3 -0
- package/src/components/input/config.json +10 -0
- package/src/components/input/input.django-snapshot.html +24 -0
- package/src/components/input/input.django.html +4 -4
- package/src/components/input/input.react-snapshot.html +22 -0
- package/src/components/language-selector/LanguageSelector.tsx +10 -5
- package/src/components/language-selector/config.json +1 -0
- package/src/components/language-selector/language-selector.django.html +2 -2
- package/src/components/layout/Layout.tsx +3 -1
- package/src/components/layout/config.json +4 -0
- package/src/components/layout/layout.django.html +1 -1
- package/src/components/memorable-date/MemorableDate.tsx +18 -3
- package/src/components/memorable-date/config.json +15 -0
- package/src/components/memorable-date/memorable-date.django-snapshot.html +82 -0
- package/src/components/memorable-date/memorable-date.django.html +14 -14
- package/src/components/memorable-date/memorable-date.react-snapshot.html +70 -0
- package/src/components/modal/Modal.tsx +3 -0
- package/src/components/modal/config.json +1 -0
- package/src/components/modal/modal.django.html +1 -1
- package/src/components/popover/Popover.tsx +3 -0
- package/src/components/popover/config.json +4 -0
- package/src/components/popover/popover.django-snapshot.html +30 -0
- package/src/components/popover/popover.django.html +1 -0
- package/src/components/radio-buttons/RadioButtons.tsx +5 -1
- package/src/components/radio-buttons/radio-buttons.django-snapshot.html +65 -0
- package/src/components/radio-buttons/radio-buttons.django.html +1 -1
- package/src/components/radio-buttons/radio-buttons.react-snapshot.html +53 -0
- package/src/components/range-slider/RangeSlider.tsx +4 -2
- package/src/components/range-slider/config.json +1 -0
- package/src/components/range-slider/range-slider.django-snapshot.html +17 -0
- package/src/components/range-slider/range-slider.django.html +4 -4
- package/src/components/range-slider/range-slider.react-snapshot.html +16 -0
- package/src/components/search/Search.tsx +6 -1
- package/src/components/search/config.json +5 -0
- package/src/components/search/search.django-snapshot.html +683 -563
- package/src/components/search/search.django.html +1 -1
- package/src/components/search/search.react-snapshot.html +25 -0
- package/src/components/select/Select.tsx +3 -1
- package/src/components/select/config.json +5 -0
- package/src/components/select/select.django-snapshot.html +15 -0
- package/src/components/select/select.django.html +2 -2
- package/src/components/select/select.react-snapshot.html +11 -0
- package/src/components/switch/Switch.tsx +13 -70
- package/src/components/switch/config.json +60 -23
- package/src/components/switch/switch.django-snapshot.html +507 -56
- package/src/components/switch/switch.django.html +23 -26
- package/src/components/switch/switch.html +425 -33
- package/src/components/switch/switch.react-snapshot.html +447 -58
- package/src/components/table/Table.tsx +3 -1
- package/src/components/table/config.json +1 -0
- package/src/components/table/table.django.html +1 -1
- package/src/components/text-area/TextArea.tsx +3 -1
- package/src/components/text-area/config.json +5 -0
- package/src/components/text-area/text-area.django-snapshot.html +18 -0
- package/src/components/text-area/text-area.django.html +4 -4
- package/src/components/text-area/text-area.react-snapshot.html +16 -0
- package/src/components/theme-picker/ThemePicker.tsx +3 -1
- package/src/components/theme-picker/config.json +14 -1
- package/src/components/theme-picker/theme-picker.django-snapshot.html +64 -0
- package/src/components/theme-picker/theme-picker.django.html +2 -2
- package/src/components/theme-picker/theme-picker.react-snapshot.html +52 -0
- package/src/components/time-picker/TimePicker.tsx +6 -1
- package/src/components/time-picker/config.json +9 -0
- package/src/components/time-picker/time-picker.django-snapshot.html +26 -0
- package/src/components/time-picker/time-picker.django.html +4 -4
- package/src/components/time-picker/time-picker.react-snapshot.html +22 -0
|
@@ -106,3 +106,19 @@
|
|
|
106
106
|
disabled=""
|
|
107
107
|
></textarea>
|
|
108
108
|
</div>
|
|
109
|
+
|
|
110
|
+
<h3 class="site-preview-heading">Value</h3>
|
|
111
|
+
<div class="usa-form-group usx-form-group">
|
|
112
|
+
<label class="usa-label usx-label" for="react-text-area-value">Current value</label
|
|
113
|
+
><textarea id="react-text-area-value" class="usa-textarea usx-textarea" placeholder="">
|
|
114
|
+
Current text</textarea
|
|
115
|
+
>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<h3 class="site-preview-heading">Default Value</h3>
|
|
119
|
+
<div class="usa-form-group usx-form-group">
|
|
120
|
+
<label class="usa-label usx-label" for="react-text-area-default-value">Initial value</label
|
|
121
|
+
><textarea id="react-text-area-default-value" class="usa-textarea usx-textarea" placeholder="">
|
|
122
|
+
Editable initial text</textarea
|
|
123
|
+
>
|
|
124
|
+
</div>
|
|
@@ -18,6 +18,7 @@ export interface ThemePickerProps {
|
|
|
18
18
|
defaultValue?: string;
|
|
19
19
|
onChange?: (value: string) => void;
|
|
20
20
|
className?: string;
|
|
21
|
+
extraAttributes?: Record<string, unknown>;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export default function ThemePicker({
|
|
@@ -29,13 +30,14 @@ export default function ThemePicker({
|
|
|
29
30
|
defaultValue,
|
|
30
31
|
onChange,
|
|
31
32
|
className = '',
|
|
33
|
+
extraAttributes,
|
|
32
34
|
}: ThemePickerProps) {
|
|
33
35
|
const selectId = id || 'theme-picker';
|
|
34
36
|
const selection =
|
|
35
37
|
value !== undefined ? { value } : { defaultValue: defaultValue ?? themes[0]?.value };
|
|
36
38
|
|
|
37
39
|
return (
|
|
38
|
-
<div className={ClassNames('usx-theme-picker', className)}>
|
|
40
|
+
<div className={ClassNames('usx-theme-picker', className)} {...extraAttributes}>
|
|
39
41
|
<button
|
|
40
42
|
type="button"
|
|
41
43
|
className="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
@@ -78,14 +78,27 @@
|
|
|
78
78
|
"type": "string",
|
|
79
79
|
"description": "Initial selected value for uncontrolled usage"
|
|
80
80
|
},
|
|
81
|
+
"value": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"default": null,
|
|
84
|
+
"description": "Current theme selection. Takes precedence over defaultValue."
|
|
85
|
+
},
|
|
81
86
|
"onChange": {
|
|
82
87
|
"type": "function",
|
|
83
88
|
"description": "React callback for a selected theme. Django consumers can listen for the select's native change event; applying the theme remains the application's responsibility.",
|
|
84
|
-
"renderers": {
|
|
89
|
+
"renderers": {
|
|
90
|
+
"django": {
|
|
91
|
+
"supported": false
|
|
92
|
+
}
|
|
93
|
+
}
|
|
85
94
|
},
|
|
86
95
|
"className": {
|
|
87
96
|
"type": "string",
|
|
88
97
|
"description": "Additional CSS classes"
|
|
98
|
+
},
|
|
99
|
+
"extraAttributes": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"description": "Additional HTML attributes on the theme picker root."
|
|
89
102
|
}
|
|
90
103
|
}
|
|
91
104
|
}
|
|
@@ -107,3 +107,67 @@
|
|
|
107
107
|
</button>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
|
+
|
|
111
|
+
<h3 class="site-preview-heading">With Value</h3>
|
|
112
|
+
<div class="usx-theme-picker">
|
|
113
|
+
<button
|
|
114
|
+
type="button"
|
|
115
|
+
class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
116
|
+
aria-label="Theme"
|
|
117
|
+
aria-expanded="false"
|
|
118
|
+
aria-controls="django-theme-picker-value-panel"
|
|
119
|
+
>
|
|
120
|
+
<svg
|
|
121
|
+
class="usa-icon usx-theme-picker__icon"
|
|
122
|
+
aria-hidden="true"
|
|
123
|
+
focusable="false"
|
|
124
|
+
viewBox="0 0 24 24"
|
|
125
|
+
>
|
|
126
|
+
<path
|
|
127
|
+
fill="currentColor"
|
|
128
|
+
d="M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"
|
|
129
|
+
/>
|
|
130
|
+
</svg>
|
|
131
|
+
</button>
|
|
132
|
+
<div id="django-theme-picker-value-panel" class="usx-theme-picker__panel">
|
|
133
|
+
<label class="usa-label usx-label usa-sr-only" for="django-theme-picker-value"> Theme </label>
|
|
134
|
+
|
|
135
|
+
<select class="usa-select usx-select" id="django-theme-picker-value">
|
|
136
|
+
<option value="Default">Default</option>
|
|
137
|
+
|
|
138
|
+
<option value="Forest" selected>Forest</option>
|
|
139
|
+
|
|
140
|
+
<option value="Sunset">Sunset</option>
|
|
141
|
+
|
|
142
|
+
<option value="Ocean">Ocean</option>
|
|
143
|
+
|
|
144
|
+
<option value="Aurora">Aurora</option>
|
|
145
|
+
|
|
146
|
+
<option value="Borealis">Borealis</option>
|
|
147
|
+
|
|
148
|
+
<option value="Midnight">Midnight</option>
|
|
149
|
+
|
|
150
|
+
<option value="Carbon">Carbon</option>
|
|
151
|
+
|
|
152
|
+
<option value="VADS">VADS</option>
|
|
153
|
+
|
|
154
|
+
<option value="GOV.UK">GOV.UK</option>
|
|
155
|
+
|
|
156
|
+
<option value="NASA">NASA</option>
|
|
157
|
+
</select>
|
|
158
|
+
<button
|
|
159
|
+
type="button"
|
|
160
|
+
class="usa-button usx-button usa-button--primary usx-theme-picker__toggle"
|
|
161
|
+
aria-label="Confirm theme"
|
|
162
|
+
>
|
|
163
|
+
<svg
|
|
164
|
+
class="usa-icon usx-icon usx-theme-picker__icon"
|
|
165
|
+
aria-hidden="true"
|
|
166
|
+
focusable="false"
|
|
167
|
+
role="img"
|
|
168
|
+
>
|
|
169
|
+
<use href="img/sprite.svg#close"></use>
|
|
170
|
+
</svg>
|
|
171
|
+
</button>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% load usx_components %}
|
|
2
2
|
{% firstof id "theme-picker" as field_id %}
|
|
3
|
-
<div class="usx-theme-picker{% if className %} {{ className }}{% endif %}">
|
|
3
|
+
<div class="usx-theme-picker{% if className %} {{ className }}{% endif %}"{% if extraAttributes %}{% for attr, value in extraAttributes.items %} {{ attr }}="{% if value is True %}true{% elif value is False %}false{% else %}{{ value }}{% endif %}"{% endfor %}{% endif %}>
|
|
4
4
|
<button
|
|
5
5
|
type="button"
|
|
6
6
|
class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
{% if name %}name="{{ name }}"{% endif %}
|
|
19
19
|
>
|
|
20
20
|
{% for theme in themes %}
|
|
21
|
-
<option value="{{ theme.value }}" {% if theme.value == defaultValue %}selected{% endif %}>{{ theme.label }}</option>
|
|
21
|
+
<option value="{{ theme.value }}" {% if value is not None and theme.value == value or value is None and theme.value == defaultValue %}selected{% endif %}>{{ theme.label }}</option>
|
|
22
22
|
{% endfor %}
|
|
23
23
|
</select>
|
|
24
24
|
<button
|
|
@@ -92,3 +92,55 @@
|
|
|
92
92
|
</button>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
|
+
|
|
96
|
+
<h3 class="site-preview-heading">With Value</h3>
|
|
97
|
+
<div class="usx-theme-picker">
|
|
98
|
+
<button
|
|
99
|
+
type="button"
|
|
100
|
+
class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
101
|
+
aria-label="Theme"
|
|
102
|
+
aria-expanded="false"
|
|
103
|
+
aria-controls="react-theme-picker-value-panel"
|
|
104
|
+
>
|
|
105
|
+
<svg
|
|
106
|
+
class="usa-icon usx-theme-picker__icon"
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
focusable="false"
|
|
109
|
+
viewBox="0 0 24 24"
|
|
110
|
+
>
|
|
111
|
+
<path
|
|
112
|
+
fill="currentColor"
|
|
113
|
+
d="M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"
|
|
114
|
+
></path>
|
|
115
|
+
</svg>
|
|
116
|
+
</button>
|
|
117
|
+
<div id="react-theme-picker-value-panel" class="usx-theme-picker__panel">
|
|
118
|
+
<label class="usa-label usx-label usa-sr-only" for="react-theme-picker-value">Theme</label
|
|
119
|
+
><select id="react-theme-picker-value" class="usa-select usx-select">
|
|
120
|
+
<option value="Default">Default</option>
|
|
121
|
+
<option value="Forest" selected="">Forest</option>
|
|
122
|
+
<option value="Sunset">Sunset</option>
|
|
123
|
+
<option value="Ocean">Ocean</option>
|
|
124
|
+
<option value="Aurora">Aurora</option>
|
|
125
|
+
<option value="Borealis">Borealis</option>
|
|
126
|
+
<option value="Midnight">Midnight</option>
|
|
127
|
+
<option value="Carbon">Carbon</option>
|
|
128
|
+
<option value="VADS">VADS</option>
|
|
129
|
+
<option value="GOV.UK">GOV.UK</option>
|
|
130
|
+
<option value="NASA">NASA</option></select
|
|
131
|
+
><button
|
|
132
|
+
type="button"
|
|
133
|
+
class="usa-button usx-button usa-button--primary usx-theme-picker__toggle"
|
|
134
|
+
aria-label="Confirm theme"
|
|
135
|
+
>
|
|
136
|
+
<svg
|
|
137
|
+
class="usa-icon usx-icon usx-theme-picker__icon"
|
|
138
|
+
aria-hidden="true"
|
|
139
|
+
focusable="false"
|
|
140
|
+
role="img"
|
|
141
|
+
>
|
|
142
|
+
<use href="/img/sprite.svg#close"></use>
|
|
143
|
+
</svg>
|
|
144
|
+
</button>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
@@ -7,11 +7,13 @@ import ErrorMessage from '../error-message/ErrorMessage';
|
|
|
7
7
|
import FormGroup from '../form-group/FormGroup';
|
|
8
8
|
|
|
9
9
|
export interface TimePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'step'> {
|
|
10
|
+
extraAttributes?: Record<string, unknown>;
|
|
10
11
|
label?: React.ReactNode;
|
|
11
12
|
hint?: React.ReactNode;
|
|
12
13
|
error?: React.ReactNode;
|
|
13
14
|
ariaDisabled?: boolean;
|
|
14
15
|
defaultValue?: string | null;
|
|
16
|
+
value?: string;
|
|
15
17
|
minTime?: string | null;
|
|
16
18
|
maxTime?: string | null;
|
|
17
19
|
step?: string | number | null;
|
|
@@ -28,11 +30,13 @@ export default function TimePicker({
|
|
|
28
30
|
ariaDisabled = false,
|
|
29
31
|
required = false,
|
|
30
32
|
defaultValue = null,
|
|
33
|
+
value,
|
|
31
34
|
minTime = null,
|
|
32
35
|
maxTime = null,
|
|
33
36
|
step = null,
|
|
34
37
|
formGroup = true,
|
|
35
38
|
className = '',
|
|
39
|
+
extraAttributes,
|
|
36
40
|
...props
|
|
37
41
|
}: TimePickerProps) {
|
|
38
42
|
const labelId = `${id}-label`;
|
|
@@ -63,6 +67,7 @@ export default function TimePicker({
|
|
|
63
67
|
{hint && <Hint id={hintId}>{hint}</Hint>}
|
|
64
68
|
{error && <ErrorMessage id={errorId}>{error}</ErrorMessage>}
|
|
65
69
|
<div
|
|
70
|
+
{...extraAttributes}
|
|
66
71
|
className={containerClasses}
|
|
67
72
|
{...(minTime ? { 'data-min-time': minTime } : {})}
|
|
68
73
|
{...(maxTime ? { 'data-max-time': maxTime } : {})}
|
|
@@ -74,7 +79,7 @@ export default function TimePicker({
|
|
|
74
79
|
name={name || id}
|
|
75
80
|
type="text"
|
|
76
81
|
aria-describedby={describedBy}
|
|
77
|
-
|
|
82
|
+
{...(value !== undefined ? { value } : { defaultValue: defaultValue || undefined })}
|
|
78
83
|
disabled={disabled}
|
|
79
84
|
aria-disabled={!disabled && ariaDisabled ? 'true' : undefined}
|
|
80
85
|
required={required}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"hint": "Select a time from the dropdown or type to jump to the first matching time."
|
|
10
10
|
},
|
|
11
11
|
"props": {
|
|
12
|
+
"extraAttributes": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"description": "Additional attributes on the USWDS enhancement target."
|
|
15
|
+
},
|
|
12
16
|
"id": {
|
|
13
17
|
"type": "string",
|
|
14
18
|
"default": "appointment-time",
|
|
@@ -50,6 +54,11 @@
|
|
|
50
54
|
"type": "string",
|
|
51
55
|
"description": "Initial value shown in the time picker (e.g. \"1:00pm\"). Sets the value attribute on the input."
|
|
52
56
|
},
|
|
57
|
+
"value": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"default": null,
|
|
60
|
+
"description": "Current time field value. Takes precedence over defaultValue."
|
|
61
|
+
},
|
|
53
62
|
"minTime": {
|
|
54
63
|
"type": "string",
|
|
55
64
|
"description": "Earliest time option in hh:mm 24-hour format. Sets data-min-time on the wrapper. USWDS default: 00:00."
|
|
@@ -188,3 +188,29 @@
|
|
|
188
188
|
/>
|
|
189
189
|
</div>
|
|
190
190
|
</div>
|
|
191
|
+
|
|
192
|
+
<h3 class="site-preview-heading">With Value</h3>
|
|
193
|
+
<div class="usa-form-group usx-form-group">
|
|
194
|
+
<label
|
|
195
|
+
id="django-appointment-time-value-label"
|
|
196
|
+
class="usa-label usx-label"
|
|
197
|
+
for="django-appointment-time-value"
|
|
198
|
+
>
|
|
199
|
+
Current time
|
|
200
|
+
</label>
|
|
201
|
+
|
|
202
|
+
<span class="usa-hint usx-hint" id="django-appointment-time-value-hint"
|
|
203
|
+
>Select a time from the dropdown or type to jump to the first matching time.</span
|
|
204
|
+
>
|
|
205
|
+
|
|
206
|
+
<div class="usa-time-picker usx-time-picker">
|
|
207
|
+
<input
|
|
208
|
+
class="usa-input usx-input"
|
|
209
|
+
id="django-appointment-time-value"
|
|
210
|
+
name="appointment-time-value"
|
|
211
|
+
type="text"
|
|
212
|
+
aria-describedby="django-appointment-time-value-label django-appointment-time-value-hint"
|
|
213
|
+
value="2:30pm"
|
|
214
|
+
/>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{% endif %}
|
|
17
17
|
|
|
18
18
|
<div
|
|
19
|
-
class="usa-time-picker usx-time-picker{% if error %} usx-combo-box--error{% endif %}{% if className %} {{ className }}{% endif %}"
|
|
19
|
+
class="usa-time-picker usx-time-picker{% if error %} usx-combo-box--error{% endif %}{% if className %} {{ className }}{% endif %}" {% if extraAttributes %}{% for attr, value in extraAttributes.items %} {{ attr }}="{% if value is True %}true{% elif value is False %}false{% else %}{{ value }}{% endif %}"{% endfor %}{% endif %}
|
|
20
20
|
{% if minTime %} data-min-time="{{ minTime }}"{% endif %}
|
|
21
21
|
{% if maxTime %} data-max-time="{{ maxTime }}"{% endif %}
|
|
22
22
|
{% if step %} data-step="{{ step }}"{% endif %}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
name="{{ name|default:id }}"
|
|
28
28
|
type="text"
|
|
29
29
|
{% if label or hint or error %} aria-describedby="{% if label %}{{ id }}-label{% endif %}{% if label and hint %} {% endif %}{% if hint %}{{ id }}-hint{% endif %}{% if hint and error %} {% endif %}{% if not hint and label and error %} {% endif %}{% if error %}{{ id }}-error{% endif %}"{% endif %}
|
|
30
|
-
{% if defaultValue %} value="{{ defaultValue }}"{% endif %}
|
|
30
|
+
{% if value is not None %} value="{{ value }}"{% elif defaultValue %} value="{{ defaultValue }}"{% endif %}
|
|
31
31
|
{% if disabled %} disabled{% elif ariaDisabled %} aria-disabled="true"{% endif %}
|
|
32
32
|
{% if required %} required{% endif %}
|
|
33
33
|
/>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
{% endif %}
|
|
48
48
|
|
|
49
49
|
<div
|
|
50
|
-
class="usa-time-picker usx-time-picker{% if className %} {{ className }}{% endif %}"
|
|
50
|
+
class="usa-time-picker usx-time-picker{% if className %} {{ className }}{% endif %}" {% if extraAttributes %}{% for attr, value in extraAttributes.items %} {{ attr }}="{% if value is True %}true{% elif value is False %}false{% else %}{{ value }}{% endif %}"{% endfor %}{% endif %}
|
|
51
51
|
{% if minTime %} data-min-time="{{ minTime }}"{% endif %}
|
|
52
52
|
{% if maxTime %} data-max-time="{{ maxTime }}"{% endif %}
|
|
53
53
|
{% if step %} data-step="{{ step }}"{% endif %}
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
name="{{ name|default:id }}"
|
|
59
59
|
type="text"
|
|
60
60
|
{% if label or hint or error %} aria-describedby="{% if label %}{{ id }}-label{% endif %}{% if label and hint %} {% endif %}{% if hint %}{{ id }}-hint{% endif %}{% if hint and error %} {% endif %}{% if not hint and label and error %} {% endif %}{% if error %}{{ id }}-error{% endif %}"{% endif %}
|
|
61
|
-
{% if defaultValue %} value="{{ defaultValue }}"{% endif %}
|
|
61
|
+
{% if value is not None %} value="{{ value }}"{% elif defaultValue %} value="{{ defaultValue }}"{% endif %}
|
|
62
62
|
{% if disabled %} disabled{% elif ariaDisabled %} aria-disabled="true"{% endif %}
|
|
63
63
|
{% if required %} required{% endif %}
|
|
64
64
|
/>
|
|
@@ -155,3 +155,25 @@
|
|
|
155
155
|
/>
|
|
156
156
|
</div>
|
|
157
157
|
</div>
|
|
158
|
+
|
|
159
|
+
<h3 class="site-preview-heading">With Value</h3>
|
|
160
|
+
<div class="usa-form-group usx-form-group">
|
|
161
|
+
<label
|
|
162
|
+
id="react-appointment-time-value-label"
|
|
163
|
+
class="usa-label usx-label"
|
|
164
|
+
for="react-appointment-time-value"
|
|
165
|
+
>Current time</label
|
|
166
|
+
><span class="usa-hint usx-hint" id="react-appointment-time-value-hint"
|
|
167
|
+
>Select a time from the dropdown or type to jump to the first matching time.</span
|
|
168
|
+
>
|
|
169
|
+
<div class="usa-time-picker usx-time-picker">
|
|
170
|
+
<input
|
|
171
|
+
class="usa-input usx-input"
|
|
172
|
+
id="react-appointment-time-value"
|
|
173
|
+
name="appointment-time-value"
|
|
174
|
+
type="text"
|
|
175
|
+
aria-describedby="react-appointment-time-value-label react-appointment-time-value-hint"
|
|
176
|
+
value="2:30pm"
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|