@aurodesignsystem-dev/auro-formkit 0.0.0-pr1456.1 → 0.0.0-pr1457.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 (281) hide show
  1. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  2. package/components/bibtemplate/dist/index.js +10 -10
  3. package/components/bibtemplate/dist/registered.js +10 -10
  4. package/components/checkbox/README.md +26 -56
  5. package/components/checkbox/demo/accessibility.html +48 -0
  6. package/components/checkbox/demo/accessibility.md +44 -0
  7. package/components/checkbox/demo/api.html +17 -26
  8. package/components/checkbox/demo/api.md +0 -396
  9. package/components/checkbox/demo/api.min.js +2 -2106
  10. package/components/checkbox/demo/customize.html +51 -0
  11. package/components/checkbox/demo/customize.md +361 -0
  12. package/components/checkbox/demo/demo-support.js +60 -0
  13. package/components/checkbox/demo/demo-support.min.js +55732 -0
  14. package/components/checkbox/demo/design.html +51 -0
  15. package/components/checkbox/demo/design.md +149 -0
  16. package/components/checkbox/demo/getting-started.html +51 -0
  17. package/components/checkbox/demo/getting-started.md +261 -0
  18. package/components/checkbox/demo/index.html +17 -21
  19. package/components/checkbox/demo/index.md +158 -45
  20. package/components/checkbox/demo/index.min.js +2 -3
  21. package/components/checkbox/demo/install.md +82 -0
  22. package/components/checkbox/demo/keyboard-behavior.html +48 -0
  23. package/components/checkbox/demo/readme.html +10 -18
  24. package/components/checkbox/demo/readme.md +26 -56
  25. package/components/checkbox/demo/styles.min.css +1 -0
  26. package/components/checkbox/demo/styles.scss +1 -0
  27. package/components/checkbox/demo/voiceover.html +48 -0
  28. package/components/checkbox/demo/voiceover.md +37 -0
  29. package/components/checkbox/dist/auro-checkbox-group.d.ts +6 -6
  30. package/components/checkbox/dist/auro-checkbox.d.ts +8 -9
  31. package/components/checkbox/dist/index.js +2 -3
  32. package/components/checkbox/dist/registered.js +2 -3
  33. package/components/combobox/README.md +41 -66
  34. package/components/combobox/demo/accessibility.html +50 -0
  35. package/components/combobox/demo/accessibility.md +77 -0
  36. package/components/combobox/demo/api.html +8 -20
  37. package/components/combobox/demo/api.md +54 -2334
  38. package/components/combobox/demo/api.min.js +3 -17971
  39. package/components/combobox/demo/customize.html +52 -0
  40. package/components/combobox/demo/customize.js +24 -0
  41. package/components/combobox/demo/customize.md +1249 -0
  42. package/components/combobox/demo/customize.min.js +177 -0
  43. package/components/combobox/demo/demo-support.js +60 -0
  44. package/components/combobox/demo/demo-support.min.js +55732 -0
  45. package/components/combobox/demo/design.html +53 -0
  46. package/components/combobox/demo/design.md +283 -0
  47. package/components/combobox/demo/getting-started.html +52 -0
  48. package/components/combobox/demo/getting-started.js +21 -0
  49. package/components/combobox/demo/getting-started.md +397 -0
  50. package/components/combobox/demo/getting-started.min.js +12 -0
  51. package/components/combobox/demo/index.html +16 -22
  52. package/components/combobox/demo/index.js +3 -2
  53. package/components/combobox/demo/index.md +298 -188
  54. package/components/combobox/demo/index.min.js +13 -17956
  55. package/components/combobox/demo/install.md +77 -0
  56. package/components/combobox/demo/{keyboardBehavior.html → keyboard-behavior.html} +5 -11
  57. package/components/combobox/demo/keyboard-behavior.md +276 -0
  58. package/components/combobox/demo/readme.html +5 -11
  59. package/components/combobox/demo/readme.md +41 -66
  60. package/components/combobox/demo/registered.min.js +18095 -0
  61. package/components/combobox/demo/styles.css +974 -0
  62. package/components/combobox/demo/styles.min.css +1 -0
  63. package/components/combobox/demo/styles.scss +1 -0
  64. package/components/combobox/demo/swap-value.min.js +16 -0
  65. package/components/combobox/demo/voiceover.html +59 -0
  66. package/components/combobox/demo/voiceover.md +118 -0
  67. package/components/combobox/dist/auro-combobox.d.ts +35 -35
  68. package/components/combobox/dist/index.js +183 -46
  69. package/components/combobox/dist/registered.js +183 -46
  70. package/components/counter/README.md +37 -55
  71. package/components/counter/demo/api.md +745 -813
  72. package/components/counter/demo/api.min.js +182 -44
  73. package/components/counter/demo/index.md +28 -32
  74. package/components/counter/demo/index.min.js +182 -44
  75. package/components/counter/demo/keyboard-behavior.md +127 -0
  76. package/components/counter/demo/readme.md +37 -55
  77. package/components/counter/dist/auro-counter-group.d.ts +2 -2
  78. package/components/counter/dist/auro-counter.d.ts +10 -10
  79. package/components/counter/dist/index.js +181 -43
  80. package/components/counter/dist/registered.js +181 -43
  81. package/components/datepicker/README.md +23 -51
  82. package/components/datepicker/demo/accessibility.html +50 -0
  83. package/components/datepicker/demo/accessibility.md +64 -0
  84. package/components/datepicker/demo/api.md +0 -1774
  85. package/components/datepicker/demo/api.min.js +2 -24475
  86. package/components/datepicker/demo/auro-datepicker.min.js +24613 -0
  87. package/components/datepicker/demo/customize.html +52 -0
  88. package/components/datepicker/demo/customize.md +723 -0
  89. package/components/datepicker/demo/demo-support.js +60 -0
  90. package/components/datepicker/demo/demo-support.min.js +55732 -0
  91. package/components/datepicker/demo/design.html +54 -0
  92. package/components/datepicker/demo/design.md +158 -0
  93. package/components/datepicker/demo/getting-started.html +52 -0
  94. package/components/datepicker/demo/getting-started.md +237 -0
  95. package/components/datepicker/demo/index.html +14 -35
  96. package/components/datepicker/demo/index.md +201 -152
  97. package/components/datepicker/demo/index.min.js +1 -24474
  98. package/components/datepicker/demo/keyboard-behavior.html +12 -33
  99. package/components/datepicker/demo/readme.md +23 -51
  100. package/components/datepicker/demo/styles.min.css +1 -0
  101. package/components/datepicker/demo/styles.scss +1 -0
  102. package/components/datepicker/demo/voiceover.html +59 -0
  103. package/components/datepicker/demo/voiceover.md +98 -0
  104. package/components/datepicker/dist/index.js +194 -57
  105. package/components/datepicker/dist/registered.js +194 -57
  106. package/components/datepicker/dist/{auro-calendar-cell.d.ts → src/auro-calendar-cell.d.ts} +2 -2
  107. package/components/datepicker/dist/{auro-datepicker.d.ts → src/auro-datepicker.d.ts} +13 -13
  108. package/components/datepicker/dist/src/iconVersion.d.ts +2 -0
  109. package/components/datepicker/dist/{utilities.d.ts → src/utilities.d.ts} +4 -4
  110. package/components/datepicker/dist/{utilitiesCalendar.d.ts → src/utilitiesCalendar.d.ts} +3 -3
  111. package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/range-datepicker-calendar.d.ts +2 -2
  112. package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/range-datepicker.d.ts +1 -1
  113. package/components/dropdown/README.md +35 -53
  114. package/components/dropdown/demo/api.md +717 -773
  115. package/components/dropdown/demo/api.min.js +161 -23
  116. package/components/dropdown/demo/index.md +120 -130
  117. package/components/dropdown/demo/index.min.js +161 -23
  118. package/components/dropdown/demo/{keyboardBehavior.md → keyboard-behavior.md} +52 -57
  119. package/components/dropdown/demo/readme.md +35 -53
  120. package/components/dropdown/dist/auro-dropdown.d.ts +22 -22
  121. package/components/dropdown/dist/auro-dropdownBib.d.ts +3 -3
  122. package/components/dropdown/dist/dropdownBibKeyboardStrategy.d.ts +1 -1
  123. package/components/dropdown/dist/iconVersion.d.ts +1 -1
  124. package/components/dropdown/dist/index.js +160 -22
  125. package/components/dropdown/dist/registered.js +160 -22
  126. package/components/form/README.md +14 -34
  127. package/components/form/demo/api.md +156 -162
  128. package/components/form/demo/api.min.js +756 -208
  129. package/components/form/demo/index.md +27 -33
  130. package/components/form/demo/index.min.js +756 -208
  131. package/components/form/demo/keyboard-behavior.md +38 -0
  132. package/components/form/demo/readme.md +14 -34
  133. package/components/input/README.md +28 -53
  134. package/components/input/demo/accessibility.html +37 -0
  135. package/components/input/demo/accessibility.md +69 -0
  136. package/components/input/demo/api.html +17 -23
  137. package/components/input/demo/api.js +4 -23
  138. package/components/input/demo/api.md +67 -1359
  139. package/components/input/demo/api.min.js +1 -7453
  140. package/components/input/demo/auro-input.min.js +7362 -0
  141. package/components/input/demo/customize.html +53 -0
  142. package/components/input/demo/customize.js +25 -0
  143. package/components/input/demo/customize.md +1372 -0
  144. package/components/input/demo/customize.min.js +71 -0
  145. package/components/input/demo/demo-support.js +60 -0
  146. package/components/input/demo/demo-support.min.js +55732 -0
  147. package/components/input/demo/design.html +38 -0
  148. package/components/input/demo/design.md +224 -0
  149. package/components/input/demo/getting-started.html +52 -0
  150. package/components/input/demo/getting-started.js +8 -0
  151. package/components/input/demo/getting-started.md +312 -0
  152. package/components/input/demo/getting-started.min.js +9 -0
  153. package/components/input/demo/index.html +16 -23
  154. package/components/input/demo/index.js +0 -11
  155. package/components/input/demo/index.md +180 -154
  156. package/components/input/demo/index.min.js +1 -7373
  157. package/components/input/demo/keyboard-behavior.html +37 -0
  158. package/components/input/demo/readme.md +28 -53
  159. package/components/input/demo/styles.css +974 -0
  160. package/components/input/demo/styles.min.css +1 -0
  161. package/components/input/demo/styles.scss +1 -0
  162. package/components/input/demo/voiceover.html +37 -0
  163. package/components/input/demo/voiceover.md +70 -0
  164. package/components/input/dist/auro-input.d.ts +1 -1
  165. package/components/input/dist/base-input.d.ts +29 -30
  166. package/components/input/dist/iconVersion.d.ts +1 -1
  167. package/components/input/dist/index.js +10 -11
  168. package/components/input/dist/registered.js +10 -11
  169. package/components/menu/README.md +24 -42
  170. package/components/menu/demo/api.md +785 -829
  171. package/components/menu/demo/api.min.js +7 -7
  172. package/components/menu/demo/index.md +33 -35
  173. package/components/menu/demo/index.min.js +7 -7
  174. package/components/menu/demo/keyboard-behavior.md +18 -0
  175. package/components/menu/demo/readme.md +24 -42
  176. package/components/menu/dist/auro-menu-utils.d.ts +1 -1
  177. package/components/menu/dist/auro-menu.context.d.ts +3 -3
  178. package/components/menu/dist/auro-menu.d.ts +4 -4
  179. package/components/menu/dist/auro-menuoption.d.ts +6 -6
  180. package/components/menu/dist/index.js +6 -6
  181. package/components/menu/dist/registered.js +6 -6
  182. package/components/radio/README.md +22 -49
  183. package/components/radio/demo/accessibility.html +51 -0
  184. package/components/radio/demo/accessibility.md +44 -0
  185. package/components/radio/demo/api.html +13 -20
  186. package/components/radio/demo/api.md +44 -621
  187. package/components/radio/demo/api.min.js +1 -1
  188. package/components/radio/demo/customize.html +53 -0
  189. package/components/radio/demo/customize.md +368 -0
  190. package/components/radio/demo/demo-support.js +60 -0
  191. package/components/radio/demo/design.html +52 -0
  192. package/components/radio/demo/design.md +143 -0
  193. package/components/radio/demo/getting-started.html +54 -0
  194. package/components/radio/demo/getting-started.md +296 -0
  195. package/components/radio/demo/index.html +16 -19
  196. package/components/radio/demo/index.md +124 -63
  197. package/components/radio/demo/index.min.js +1 -1
  198. package/components/radio/demo/keyboard-behavior.html +51 -0
  199. package/components/radio/demo/keyboard-behavior.md +72 -0
  200. package/components/radio/demo/layout.md +30 -0
  201. package/components/radio/demo/readme.html +11 -17
  202. package/components/radio/demo/readme.md +22 -49
  203. package/components/radio/demo/styles.css +974 -0
  204. package/components/radio/demo/voiceover.html +51 -0
  205. package/components/radio/demo/voiceover.md +43 -0
  206. package/components/radio/dist/auro-radio-group.d.ts +9 -9
  207. package/components/radio/dist/auro-radio.d.ts +8 -8
  208. package/components/radio/dist/index.js +1 -1
  209. package/components/radio/dist/registered.js +1 -1
  210. package/components/select/README.md +50 -68
  211. package/components/select/demo/accessibility.html +50 -0
  212. package/components/select/demo/accessibility.md +76 -0
  213. package/components/select/demo/api.html +5 -17
  214. package/components/select/demo/api.md +52 -2422
  215. package/components/select/demo/customize.html +52 -0
  216. package/components/select/demo/customize.js +11 -0
  217. package/components/select/demo/customize.md +1049 -0
  218. package/components/select/demo/customize.min.js +12 -0
  219. package/components/select/demo/demo-support.js +60 -0
  220. package/components/select/demo/demo-support.min.js +55732 -0
  221. package/components/select/demo/design.html +51 -0
  222. package/components/select/demo/design.md +391 -0
  223. package/components/select/demo/getting-started.html +52 -0
  224. package/components/select/demo/getting-started.js +26 -0
  225. package/components/select/demo/getting-started.md +412 -0
  226. package/components/select/demo/getting-started.min.js +56 -0
  227. package/components/select/demo/index.html +18 -35
  228. package/components/select/demo/index.js +5 -3
  229. package/components/select/demo/index.md +165 -345
  230. package/components/select/demo/index.min.js +6 -10484
  231. package/components/select/demo/install.md +95 -0
  232. package/components/select/demo/keyboard-behavior.html +8 -39
  233. package/components/select/demo/keyboard-behavior.md +249 -0
  234. package/components/select/demo/keyboardBehavior.html +5 -38
  235. package/components/select/demo/layout.html +51 -0
  236. package/components/select/demo/readme.html +5 -13
  237. package/components/select/demo/readme.md +50 -68
  238. package/components/select/demo/{api.min.js → registered.min.js} +179 -151
  239. package/components/select/demo/styles.min.css +1 -0
  240. package/components/select/demo/styles.scss +1 -0
  241. package/components/select/demo/voiceover.html +48 -0
  242. package/components/select/demo/voiceover.md +183 -0
  243. package/components/select/dist/auro-select.d.ts +11 -11
  244. package/components/select/dist/index.js +171 -33
  245. package/components/select/dist/registered.js +171 -33
  246. package/custom-elements.json +1491 -1494
  247. package/package.json +37 -30
  248. package/components/checkbox/demo/keyboardBehavior.md +0 -0
  249. package/components/combobox/demo/keyboardBehavior.md +0 -281
  250. package/components/counter/demo/keyboardBehavior.md +0 -127
  251. package/components/datepicker/demo/keyboardBehavior.md +0 -19
  252. package/components/datepicker/dist/iconVersion.d.ts +0 -2
  253. package/components/form/demo/keyboardBehavior.md +0 -0
  254. package/components/input/demo/keyboardBehavior.md +0 -0
  255. package/components/menu/demo/keyboardBehavior.md +0 -0
  256. package/components/radio/demo/keyboardBehavior.md +0 -0
  257. package/components/select/demo/api.js +0 -39
  258. package/components/select/demo/keyboardBehavior.md +0 -245
  259. /package/components/datepicker/dist/{auro-calendar-month.d.ts → src/auro-calendar-month.d.ts} +0 -0
  260. /package/components/datepicker/dist/{auro-calendar.d.ts → src/auro-calendar.d.ts} +0 -0
  261. /package/components/datepicker/dist/{buttonVersion.d.ts → src/buttonVersion.d.ts} +0 -0
  262. /package/components/datepicker/dist/{datepickerKeyboardStrategy.d.ts → src/datepickerKeyboardStrategy.d.ts} +0 -0
  263. /package/components/datepicker/dist/{index.d.ts → src/index.d.ts} +0 -0
  264. /package/components/datepicker/dist/{popoverVersion.d.ts → src/popoverVersion.d.ts} +0 -0
  265. /package/components/datepicker/dist/{styles → src/styles}/classic/color-css.d.ts +0 -0
  266. /package/components/datepicker/dist/{styles → src/styles}/classic/style-css.d.ts +0 -0
  267. /package/components/datepicker/dist/{styles → src/styles}/color-calendar-css.d.ts +0 -0
  268. /package/components/datepicker/dist/{styles → src/styles}/color-cell-css.d.ts +0 -0
  269. /package/components/datepicker/dist/{styles → src/styles}/color-css.d.ts +0 -0
  270. /package/components/datepicker/dist/{styles → src/styles}/color-month-css.d.ts +0 -0
  271. /package/components/datepicker/dist/{styles → src/styles}/shapeSize-css.d.ts +0 -0
  272. /package/components/datepicker/dist/{styles → src/styles}/snowflake/color-css.d.ts +0 -0
  273. /package/components/datepicker/dist/{styles → src/styles}/snowflake/style-css.d.ts +0 -0
  274. /package/components/datepicker/dist/{styles → src/styles}/style-auro-calendar-cell-css.d.ts +0 -0
  275. /package/components/datepicker/dist/{styles → src/styles}/style-auro-calendar-css.d.ts +0 -0
  276. /package/components/datepicker/dist/{styles → src/styles}/style-auro-calendar-month-css.d.ts +0 -0
  277. /package/components/datepicker/dist/{styles → src/styles}/style-css.d.ts +0 -0
  278. /package/components/datepicker/dist/{styles → src/styles}/tokens-css.d.ts +0 -0
  279. /package/components/datepicker/dist/{utilitiesCalendarRender.d.ts → src/utilitiesCalendarRender.d.ts} +0 -0
  280. /package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/day.d.ts +0 -0
  281. /package/components/datepicker/dist/{vendor → src/vendor}/wc-range-datepicker/range-datepicker-cell.d.ts +0 -0
@@ -105,1778 +105,4 @@ The `auro-datepicker` component provides users with a way to select a date or da
105
105
  | [helpTextSpan](#helpTextSpan) | Use for customizing the style of the datepicker help text span. |
106
106
  | [input](#input) | Use for customizing the style of the datepicker inputs. |
107
107
  | [trigger](#trigger) | Use for customizing the style of the datepicker trigger. |
108
- <!-- AURO-GENERATED-CONTENT:END -->
109
-
110
- ## Basic
111
-
112
- <div class="exampleWrapper">
113
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
114
- <!-- The below content is automatically added from ./../apiExamples/basic.html -->
115
- <auro-datepicker>
116
- <span slot="ariaLabel.bib.close">Close Calendar</span>
117
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
118
- <span slot="fromLabel">Choose a date</span>
119
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
120
- </auro-datepicker>
121
- <!-- AURO-GENERATED-CONTENT:END -->
122
- </div>
123
- <auro-accordion alignRight>
124
- <span slot="trigger">See code</span>
125
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
126
- <!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
127
-
128
- ```html
129
- <auro-datepicker>
130
- <span slot="ariaLabel.bib.close">Close Calendar</span>
131
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
132
- <span slot="fromLabel">Choose a date</span>
133
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
134
- </auro-datepicker>
135
- ```
136
- <!-- AURO-GENERATED-CONTENT:END -->
137
- </auro-accordion>
138
-
139
- ## Range
140
-
141
- The datepicker can also be used to select a range between two dates by adding the `range` attribute.
142
-
143
- <div class="exampleWrapper">
144
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/range.html) -->
145
- <!-- The below content is automatically added from ./../apiExamples/range.html -->
146
- <auro-datepicker range>
147
- <span slot="ariaLabel.bib.close">Close Calendar</span>
148
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
149
- <span slot="fromLabel">Departure</span>
150
- <span slot="toLabel">Return</span>
151
- <span slot="bib.fullscreen.fromLabel">Departure</span>
152
- <span slot="bib.fullscreen.toLabel">Return</span>
153
- </auro-datepicker>
154
- <!-- AURO-GENERATED-CONTENT:END -->
155
- </div>
156
- <auro-accordion alignRight>
157
- <span slot="trigger">See code</span>
158
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/range.html) -->
159
- <!-- The below code snippet is automatically added from ./../apiExamples/range.html -->
160
-
161
- ```html
162
- <auro-datepicker range>
163
- <span slot="ariaLabel.bib.close">Close Calendar</span>
164
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
165
- <span slot="fromLabel">Departure</span>
166
- <span slot="toLabel">Return</span>
167
- <span slot="bib.fullscreen.fromLabel">Departure</span>
168
- <span slot="bib.fullscreen.toLabel">Return</span>
169
- </auro-datepicker>
170
- ```
171
- <!-- AURO-GENERATED-CONTENT:END -->
172
- </auro-accordion>
173
-
174
- ## Property & Attribute Examples
175
-
176
- ### Appearance on Dark Backgrounds
177
-
178
- Use `appearance="inverse"` to display the datepicker on dark backgrounds.
179
-
180
- <div class="exampleWrapper--ondark">
181
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse.html) -->
182
- <!-- The below content is automatically added from ./../apiExamples/appearance-inverse.html -->
183
- <auro-datepicker appearance="inverse">
184
- <span slot="ariaLabel.bib.close">Close Calendar</span>
185
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
186
- <span slot="fromLabel">Choose a date</span>
187
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
188
- </auro-datepicker>
189
- <!-- AURO-GENERATED-CONTENT:END -->
190
- </div>
191
- <auro-accordion alignRight>
192
- <span slot="trigger">See code</span>
193
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse.html) -->
194
- <!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse.html -->
195
-
196
- ```html
197
- <auro-datepicker appearance="inverse">
198
- <span slot="ariaLabel.bib.close">Close Calendar</span>
199
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
200
- <span slot="fromLabel">Choose a date</span>
201
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
202
- </auro-datepicker>
203
- ```
204
- <!-- AURO-GENERATED-CONTENT:END -->
205
- </auro-accordion>
206
- <div class="exampleWrapper--ondark">
207
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-range.html) -->
208
- <!-- The below content is automatically added from ./../apiExamples/appearance-inverse-range.html -->
209
- <auro-datepicker appearance="inverse" range>
210
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
211
- <span slot="fromLabel">Departure</span>
212
- <span slot="toLabel">Return</span>
213
- <span slot="bib.fullscreen.fromLabel">Departure</span>
214
- <span slot="bib.fullscreen.toLabel">Return</span>
215
- </auro-datepicker>
216
- <!-- AURO-GENERATED-CONTENT:END -->
217
- </div>
218
- <auro-accordion alignRight>
219
- <span slot="trigger">See code</span>
220
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-range.html) -->
221
- <!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-range.html -->
222
-
223
- ```html
224
- <auro-datepicker appearance="inverse" range>
225
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
226
- <span slot="fromLabel">Departure</span>
227
- <span slot="toLabel">Return</span>
228
- <span slot="bib.fullscreen.fromLabel">Departure</span>
229
- <span slot="bib.fullscreen.toLabel">Return</span>
230
- </auro-datepicker>
231
- ```
232
- <!-- AURO-GENERATED-CONTENT:END -->
233
- </auro-accordion>
234
-
235
- ### Customized Bib Position
236
-
237
- The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement`, and `shift` attributes.
238
-
239
- - `placement` specifies the preferred position where the bib should appear relative to the trigger.
240
- - `offset` sets the distance between the trigger and the bib.
241
- - When `autoPlacement` is enabled, smart positioning logic is applied to determine the best placement for the bib. If all sides have sufficient space, the bib will appear in the position specified by `placement`.
242
- - Unless `noFlip` is enabled, if there isn't enough space for the preferred `placement`, the bib will automatically flip to an alternative position.
243
- - `shift` when enabled, adjusts the bib position when it would overflow the viewport boundaries, ensuring it remains visible.
244
-
245
- <div class="exampleWrapper">
246
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/floater-config.html) -->
247
- <!-- The below content is automatically added from ./../apiExamples/floater-config.html -->
248
- <div style="width: 400px">
249
- <auro-datepicker offset="20" placement="bottom-start" noFlip>
250
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
251
- <span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
252
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
253
- </auro-datepicker>
254
- <br/>
255
- <auro-datepicker offset="20" placement="bottom-start">
256
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
257
- <span slot="fromLabel">bottom-start with 20px offset and flip</span>
258
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
259
- </auro-datepicker>
260
- <br/>
261
- <auro-datepicker offset="20" placement="right" autoPlacement noFlip>
262
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
263
- <span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
264
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
265
- </auro-datepicker>
266
- </div>
267
- <div style="width: 600px; padding-top: 1em;">
268
- <p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
269
- <auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
270
- <span slot="ariaLabel.bib.close">Close Calendar</span>
271
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
272
- <span slot="fromLabel">Departure</span>
273
- <span slot="toLabel">Return</span>
274
- <span slot="bib.fullscreen.fromLabel">Departure</span>
275
- <span slot="bib.fullscreen.toLabel">Return</span>
276
- </auro-datepicker>
277
- </div>
278
- <!-- AURO-GENERATED-CONTENT:END -->
279
- </div>
280
- <auro-accordion alignRight>
281
- <span slot="trigger">See code</span>
282
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/floater-config.html) -->
283
- <!-- The below code snippet is automatically added from ./../apiExamples/floater-config.html -->
284
-
285
- ```html
286
- <div style="width: 400px">
287
- <auro-datepicker offset="20" placement="bottom-start" noFlip>
288
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
289
- <span slot="fromLabel">bottom-start with 20px offset and noFlip</span>
290
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
291
- </auro-datepicker>
292
- <br/>
293
- <auro-datepicker offset="20" placement="bottom-start">
294
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
295
- <span slot="fromLabel">bottom-start with 20px offset and flip</span>
296
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
297
- </auro-datepicker>
298
- <br/>
299
- <auro-datepicker offset="20" placement="right" autoPlacement noFlip>
300
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
301
- <span slot="fromLabel">right with 20px offset, noFlip and autoPlacement</span>
302
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
303
- </auro-datepicker>
304
- </div>
305
- <div style="width: 600px; padding-top: 1em;">
306
- <p>Range bottom-start with 20px offset, noFlip and shift enabled</p>
307
- <auro-datepicker range offset="20" placement="bottom-start" shift noFlip minDate="07/08/2025">
308
- <span slot="ariaLabel.bib.close">Close Calendar</span>
309
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
310
- <span slot="fromLabel">Departure</span>
311
- <span slot="toLabel">Return</span>
312
- <span slot="bib.fullscreen.fromLabel">Departure</span>
313
- <span slot="bib.fullscreen.toLabel">Return</span>
314
- </auro-datepicker>
315
- </div>
316
- ```
317
- <!-- AURO-GENERATED-CONTENT:END -->
318
- </auro-accordion>
319
-
320
- ### Start & End Date
321
-
322
- The `calendarStartDate` and `calendarEndDate` properties may be used to explicitly control which calendar months _may_ be rendered in the calendar.
323
-
324
- In <strong>desktop</strong>, the calendar month navigation will be restricted by these dates. In <strong>mobile</strong>, the following logic is used:
325
-
326
- - if both `calendarStartDate` and `calendarEndDate` are defined: all months between, including these dates, will be rendered.
327
- - If only `calendarStartDate` is defined: 12 months will be rendered starting with this value.
328
- - if only `calendarEndDate` is defined: The current date month through the value of this attribute will be rendered.
329
-
330
- Note: This does not restrict setting a value outside of those date constraints. These properties _only_ define which months can be rendered in the calendar. A user may still type any date into the input field. If actual value selection restrictions are needed, see the `minDate` and `maxDate` properties which may be used standalone, or in conjunction with `calendarStartDate` and `calendarEndDate`.
331
-
332
- <div class="exampleWrapper">
333
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendar-start-and-end-date.html) -->
334
- <!-- The below content is automatically added from ./../apiExamples/calendar-start-and-end-date.html -->
335
- <auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
336
- <span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
337
- <span slot="fromLabel">Choose a date</span>
338
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
339
- </auro-datepicker>
340
- <!-- AURO-GENERATED-CONTENT:END -->
341
- </div>
342
- <auro-accordion alignRight>
343
- <span slot="trigger">See code</span>
344
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendar-start-and-end-date.html) -->
345
- <!-- The below code snippet is automatically added from ./../apiExamples/calendar-start-and-end-date.html -->
346
-
347
- ```html
348
- <auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="06/01/2022">
349
- <span slot="bib.fullscreen.headline">calendarStartDate & calendarEndDate Example</span>
350
- <span slot="fromLabel">Choose a date</span>
351
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
352
- </auro-datepicker>
353
- ```
354
- <!-- AURO-GENERATED-CONTENT:END -->
355
- </auro-accordion>
356
-
357
- ### Focus Date
358
-
359
- The `calendarFocusDate` controls which calendar month is first presented to the user when they open the dropdown bib.
360
-
361
- In <strong>desktop</strong> layout, the first month actually rendered will be the `calendarFocusDate` if defined. Once the user manually navigates the calendar to a different month, the calendar view will remain where the user left off when they close and reopen the bib. If the `calendarFocusDate` attribute is changed, this will re-render the calendar starting at the new date. If `calendarFocusDate` is undefined, the first rendered month will be the current date or the first renderable date defined by `calendarStartDate`.
362
-
363
- In <strong>mobile</strong> layout, upon first opening the bib, the vertical list of months will scroll (with no animation) to the month defined by the `calendarFocusDate`. If the user scrolls the list to a different position, the scroll position will remain where the user left off when they close and reopen the bib. If the `calendarFocusDate` is changed, the list will scroll to the new dates month. If `calendarFocusDate` is undefined, the list will start at the top most scroll position.
364
-
365
- <div class="exampleWrapper">
366
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/calendar-focus-date.html) -->
367
- <!-- The below content is automatically added from ./../apiExamples/calendar-focus-date.html -->
368
- <auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
369
- <span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
370
- <span slot="fromLabel">Choose a date</span>
371
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
372
- </auro-datepicker>
373
- <!-- AURO-GENERATED-CONTENT:END -->
374
- </div>
375
- <auro-accordion alignRight>
376
- <span slot="trigger">See code</span>
377
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/calendar-focus-date.html) -->
378
- <!-- The below code snippet is automatically added from ./../apiExamples/calendar-focus-date.html -->
379
-
380
- ```html
381
- <auro-datepicker calendarStartDate="01/01/2022" calendarEndDate="12/01/2023" calendarFocusDate="11/01/2022">
382
- <span slot="bib.fullscreen.headline">calendarFocusDate Example</span>
383
- <span slot="fromLabel">Choose a date</span>
384
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
385
- </auro-datepicker>
386
- ```
387
- <!-- AURO-GENERATED-CONTENT:END -->
388
- </auro-accordion>
389
-
390
- ### Central Date
391
-
392
- The `centralDate` attribute can be used to force the calendar to navigate to a specific month. WARNING: Do not set the `centralDate` attribute on blur.
393
-
394
- <div class="exampleWrapper">
395
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/central-date.html) -->
396
- <!-- The below content is automatically added from ./../apiExamples/central-date.html -->
397
- <auro-datepicker centralDate="06/16/1980">
398
- <span slot="bib.fullscreen.headline">centralDate Example</span>
399
- <span slot="fromLabel">Choose a date</span>
400
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
401
- </auro-datepicker>
402
- <!-- AURO-GENERATED-CONTENT:END -->
403
- </div>
404
- <auro-accordion alignRight>
405
- <span slot="trigger">See code</span>
406
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/central-date.html) -->
407
- <!-- The below code snippet is automatically added from ./../apiExamples/central-date.html -->
408
-
409
- ```html
410
- <auro-datepicker centralDate="06/16/1980">
411
- <span slot="bib.fullscreen.headline">centralDate Example</span>
412
- <span slot="fromLabel">Choose a date</span>
413
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
414
- </auro-datepicker>
415
- ```
416
- <!-- AURO-GENERATED-CONTENT:END -->
417
- </auro-accordion>
418
-
419
- #### Disabled
420
-
421
- Set the `disabled` attribute to disable all interaction with the datepicker.
422
-
423
- <div class="exampleWrapper">
424
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
425
- <!-- The below content is automatically added from ./../apiExamples/disabled.html -->
426
- <auro-datepicker disabled>
427
- <span slot="fromLabel">Choose a date</span>
428
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
429
- </auro-datepicker>
430
- <!-- AURO-GENERATED-CONTENT:END -->
431
- </div>
432
- <auro-accordion alignRight>
433
- <span slot="trigger">See code</span>
434
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
435
- <!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
436
-
437
- ```html
438
- <auro-datepicker disabled>
439
- <span slot="fromLabel">Choose a date</span>
440
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
441
- </auro-datepicker>
442
- ```
443
- <!-- AURO-GENERATED-CONTENT:END -->
444
- </auro-accordion>
445
-
446
- #### Error
447
-
448
- Use the `error` attribute to apply a persistent custom error that supersedes the HTML5 validation logic.
449
-
450
- A custom error message can be set using the `error` attribute, or it can be used in conjuction with the `setCustomValidityCustomError` attribute.
451
-
452
- <div class="exampleWrapper">
453
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/error.html) -->
454
- <!-- The below content is automatically added from ./../apiExamples/error.html -->
455
- <auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
456
- <auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
457
- <br />
458
- <auro-datepicker error="Custom error message" id="errorExample">
459
- <span slot="bib.fullscreen.headline">Error Example</span>
460
- <span slot="fromLabel">Choose a date</span>
461
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
462
- </auro-datepicker>
463
- <!-- AURO-GENERATED-CONTENT:END -->
464
- </div>
465
- <auro-accordion alignRight>
466
- <span slot="trigger">See code</span>
467
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/error.html) -->
468
- <!-- The below code snippet is automatically added from ./../apiExamples/error.html -->
469
-
470
- ```html
471
- <auro-button id="undefinedValueExampleBtnAddError">Set Error</auro-button>
472
- <auro-button id="undefinedValueExampleBtnRemoveError">Remove Error</auro-button>
473
- <br />
474
- <auro-datepicker error="Custom error message" id="errorExample">
475
- <span slot="bib.fullscreen.headline">Error Example</span>
476
- <span slot="fromLabel">Choose a date</span>
477
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
478
- </auro-datepicker>
479
- ```
480
- <!-- AURO-GENERATED-CONTENT:END -->
481
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/error.js) -->
482
- <!-- The below code snippet is automatically added from ./../apiExamples/error.js -->
483
-
484
- ```js
485
- export function errorExample() {
486
- const errorExample = document.querySelector('#errorExample');
487
-
488
- document.querySelector('#undefinedValueExampleBtnAddError').addEventListener('click', () => {
489
- errorExample.error = 'Custom New Error';
490
- })
491
-
492
- document.querySelector('#undefinedValueExampleBtnRemoveError').addEventListener('click', () => {
493
- errorExample.removeAttribute('error');
494
- })
495
- }
496
- ```
497
- <!-- AURO-GENERATED-CONTENT:END -->
498
- </auro-accordion>
499
-
500
- ### Format
501
-
502
- The `format` attribute is used to define the date format used by the datepicker. The default value is `mm/dd/yyyy`.
503
-
504
- <div class="exampleWrapper">
505
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/format.html) -->
506
- <!-- The below content is automatically added from ./../apiExamples/format.html -->
507
- <auro-datepicker format="yyyy/mm/dd">
508
- <span slot="bib.fullscreen.headline">Format Headline</span>
509
- <span slot="fromLabel">Choose a date</span>
510
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
511
- </auro-datepicker>
512
- <!-- AURO-GENERATED-CONTENT:END -->
513
- </div>
514
- <auro-accordion alignRight>
515
- <span slot="trigger">See code</span>
516
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/format.html) -->
517
- <!-- The below code snippet is automatically added from ./../apiExamples/format.html -->
518
-
519
- ```html
520
- <auro-datepicker format="yyyy/mm/dd">
521
- <span slot="bib.fullscreen.headline">Format Headline</span>
522
- <span slot="fromLabel">Choose a date</span>
523
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
524
- </auro-datepicker>
525
- ```
526
- <!-- AURO-GENERATED-CONTENT:END -->
527
- </auro-accordion>
528
-
529
- ### Fullscreen Bib
530
-
531
- You can make the dropdown open in fullscreen at a specific breakpoint by setting `fullscreenBreakpoint`.
532
-
533
- The default value of `fullscreenBreakpoint` is `sm`.
534
-
535
- Breakpoint token can be found [here](https://auro.alaskaair.com/getting-started/developers/design-tokens).
536
-
537
- To support fullcreen bib, setting `bib.fullscreen.headline` is **STRONGLY RECOMMENDED**.
538
-
539
- <div class="exampleWrapper">
540
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/fullscreen-breakpoint.html) -->
541
- <!-- The below content is automatically added from ./../apiExamples/fullscreen-breakpoint.html -->
542
- <auro-datepicker fullscreenBreakpoint="lg">
543
- <span slot="ariaLabel.bib.close">Close Calendar</span>
544
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
545
- <span slot="fromLabel">Choose a date</span>
546
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
547
- </auro-datepicker>
548
- <!-- AURO-GENERATED-CONTENT:END -->
549
- </div>
550
- <auro-accordion alignRight>
551
- <span slot="trigger">See code</span>
552
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/fullscreen-breakpoint.html) -->
553
- <!-- The below code snippet is automatically added from ./../apiExamples/fullscreen-breakpoint.html -->
554
-
555
- ```html
556
- <auro-datepicker fullscreenBreakpoint="lg">
557
- <span slot="ariaLabel.bib.close">Close Calendar</span>
558
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
559
- <span slot="fromLabel">Choose a date</span>
560
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
561
- </auro-datepicker>
562
- ```
563
- <!-- AURO-GENERATED-CONTENT:END -->
564
- </auro-accordion>
565
-
566
- ### Input Mode
567
-
568
- You can manually set the input mode for the input with the `inputmode` attribute.
569
-
570
- <div class="exampleWrapper">
571
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
572
- <!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
573
- <auro-datepicker inputmode="numeric">
574
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
575
- <span slot="fromLabel">Choose a date</span>
576
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
577
- </auro-datepicker>
578
- <!-- AURO-GENERATED-CONTENT:END -->
579
- </div>
580
- <auro-accordion alignRight>
581
- <span slot="trigger">See code</span>
582
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
583
- <!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
584
-
585
- ```html
586
- <auro-datepicker inputmode="numeric">
587
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
588
- <span slot="fromLabel">Choose a date</span>
589
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
590
- </auro-datepicker>
591
- ```
592
- <!-- AURO-GENERATED-CONTENT:END -->
593
- </auro-accordion>
594
-
595
- ### Max Date
596
-
597
- To give a higher limit you can bind a date to the `maxDate` attribute. It is recommended to use the `setCustomValidityRangeOverflow` attribute to define an error message to display when validation fails the maximum date restriction.
598
-
599
- <div class="exampleWrapper">
600
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/max-date.html) -->
601
- <!-- The below content is automatically added from ./../apiExamples/max-date.html -->
602
- <auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
603
- <span slot="bib.fullscreen.headline">maxDate Example</span>
604
- <span slot="fromLabel">Choose a date</span>
605
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
606
- </auro-datepicker>
607
- <!-- AURO-GENERATED-CONTENT:END -->
608
- </div>
609
- <auro-accordion alignRight>
610
- <span slot="trigger">See code</span>
611
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/max-date.html) -->
612
- <!-- The below code snippet is automatically added from ./../apiExamples/max-date.html -->
613
-
614
- ```html
615
- <auro-datepicker maxDate="03/25/2023" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
616
- <span slot="bib.fullscreen.headline">maxDate Example</span>
617
- <span slot="fromLabel">Choose a date</span>
618
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
619
- </auro-datepicker>
620
- ```
621
- <!-- AURO-GENERATED-CONTENT:END -->
622
- </auro-accordion>
623
-
624
- #### Update Max Date
625
-
626
- Setting the `maxDate` attribute to a date earlier than the auro-datepicker `value` will result in the following changes to the component state:
627
-
628
- * `value` will to reset to `undefined`.
629
- * If the currently viewed calendar month is later than the new `maxDate`, the calendar view will move to the new `maxDate` month.
630
-
631
- This example demonstrates that behavior.
632
-
633
- <div class="exampleWrapper">
634
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/update-max-date.html) -->
635
- <!-- The below content is automatically added from ./../apiExamples/update-max-date.html -->
636
- <auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
637
- <auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
638
- <br />
639
- <auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
640
- <span slot="bib.fullscreen.headline">maxDate Example</span>
641
- <span slot="fromLabel">Choose a date</span>
642
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
643
- </auro-datepicker>
644
- <!-- AURO-GENERATED-CONTENT:END -->
645
- </div>
646
- <auro-accordion alignRight>
647
- <span slot="trigger">See code</span>
648
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-max-date.html) -->
649
- <!-- The below code snippet is automatically added from ./../apiExamples/update-max-date.html -->
650
-
651
- ```html
652
- <auro-button id="maxDateChange">Change maxDate to Today's Date</auro-button>
653
- <auro-button id="resetMaxDate">Reset Datepicker to Initial Example</auro-button>
654
- <br />
655
- <auro-datepicker id="maxDateExample" setCustomValidityRangeOverflow="Selected date is later than maximum date.">
656
- <span slot="bib.fullscreen.headline">maxDate Example</span>
657
- <span slot="fromLabel">Choose a date</span>
658
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
659
- </auro-datepicker>
660
- ```
661
- <!-- AURO-GENERATED-CONTENT:END -->
662
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-max-date.js) -->
663
- <!-- The below code snippet is automatically added from ./../apiExamples/update-max-date.js -->
664
-
665
- ```js
666
- function formatDateString(date) {
667
- /* eslint-disable prefer-template, no-magic-numbers */
668
- const dd = String("0" + date.getDate()).slice(-2);
669
- const mm = String("0" + (date.getMonth() + 1)).slice(-2);
670
- /* eslint-enable prefer-template, no-magic-numbers */
671
- const yyyy = date.getFullYear();
672
-
673
- return `${mm}/${dd}/${yyyy}`;
674
- }
675
-
676
- export function updateMaxDateExample() {
677
- const maxDateExample = document.getElementById('maxDateExample');
678
- const changeMaxDateButton = document.getElementById('maxDateChange');
679
- const resetButton = document.getElementById('resetMaxDate');
680
-
681
- const today = formatDateString(new Date());
682
-
683
- let nextWeek = new Date();
684
- let addOneWeek = nextWeek.getDate() + 7;
685
-
686
- nextWeek.setDate(addOneWeek);
687
- nextWeek = formatDateString(nextWeek);
688
-
689
- maxDateExample.setAttribute('value', nextWeek);
690
- maxDateExample.setAttribute('maxDate', nextWeek);
691
-
692
- changeMaxDateButton.addEventListener('click', () => {
693
- maxDateExample.setAttribute('maxDate', today);
694
- });
695
-
696
- resetButton.addEventListener('click', () => {
697
- maxDateExample.setAttribute('value', nextWeek);
698
- maxDateExample.setAttribute('maxDate', nextWeek);
699
- });
700
- }
701
- ```
702
- <!-- AURO-GENERATED-CONTENT:END -->
703
- </auro-accordion>
704
-
705
- ### Min Date
706
-
707
- To give a lower limit you can bind a date to the `minDate` attribute. It is recommended to use the `setCustomValidityRangeUnderflow` attribute to define an error message to display when validation fails the minimum date restriction.
708
-
709
- <div class="exampleWrapper">
710
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/min-date.html) -->
711
- <!-- The below content is automatically added from ./../apiExamples/min-date.html -->
712
- <auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
713
- <span slot="bib.fullscreen.headline">minDate Example</span>
714
- <span slot="fromLabel">Choose a date</span>
715
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
716
- </auro-datepicker>
717
- <!-- AURO-GENERATED-CONTENT:END -->
718
- </div>
719
- <auro-accordion alignRight>
720
- <span slot="trigger">See code</span>
721
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/min-date.html) -->
722
- <!-- The below code snippet is automatically added from ./../apiExamples/min-date.html -->
723
-
724
- ```html
725
- <auro-datepicker minDate="03/25/2028" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
726
- <span slot="bib.fullscreen.headline">minDate Example</span>
727
- <span slot="fromLabel">Choose a date</span>
728
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
729
- </auro-datepicker>
730
- ```
731
- <!-- AURO-GENERATED-CONTENT:END -->
732
- </auro-accordion>
733
-
734
- #### Update Min Date
735
-
736
- Setting the `minDate` attribute to a date later than the auro-datepicker `value` will result in the following changes to the component state:
737
-
738
- * `value` will to reset to `undefined`.
739
- * If the currently viewed calendar month is earlier than the new `minDate`, the calendar view will move to the new `minDate` month.
740
-
741
- This example demonstrates that behavior.
742
-
743
- <div class="exampleWrapper">
744
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/update-min-date.html) -->
745
- <!-- The below content is automatically added from ./../apiExamples/update-min-date.html -->
746
- <auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
747
- <auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
748
- <br />
749
- <auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
750
- <span slot="bib.fullscreen.headline">minDate Example</span>
751
- <span slot="fromLabel">Choose a date</span>
752
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
753
- </auro-datepicker>
754
- <!-- AURO-GENERATED-CONTENT:END -->
755
- </div>
756
- <auro-accordion alignRight>
757
- <span slot="trigger">See code</span>
758
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-min-date.html) -->
759
- <!-- The below code snippet is automatically added from ./../apiExamples/update-min-date.html -->
760
-
761
- ```html
762
- <auro-button id="minDateChange">Change minDate to a week from Today</auro-button>
763
- <auro-button id="resetMinDate">Reset Datepicker to Initial Example</auro-button>
764
- <br />
765
- <auro-datepicker id="minDateExample" setCustomValidityRangeUnderflow="Selected date is earlier than the minimum date.">
766
- <span slot="bib.fullscreen.headline">minDate Example</span>
767
- <span slot="fromLabel">Choose a date</span>
768
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
769
- </auro-datepicker>
770
- ```
771
- <!-- AURO-GENERATED-CONTENT:END -->
772
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/update-min-date.js) -->
773
- <!-- The below code snippet is automatically added from ./../apiExamples/update-min-date.js -->
774
-
775
- ```js
776
- function formatDateString(date) {
777
- /* eslint-disable prefer-template, no-magic-numbers */
778
- const dd = String("0" + date.getDate()).slice(-2);
779
- const mm = String("0" + (date.getMonth() + 1)).slice(-2);
780
- /* eslint-enable prefer-template, no-magic-numbers */
781
- const yyyy = date.getFullYear();
782
-
783
- return `${mm}/${dd}/${yyyy}`;
784
- }
785
-
786
- export function updateMinDateExample() {
787
- const minDateExample = document.getElementById('minDateExample');
788
- const changeMinDateButton = document.getElementById('minDateChange');
789
- const resetButton = document.getElementById('resetMinDate');
790
-
791
- const today = formatDateString(new Date());
792
-
793
- let nextWeek = new Date();
794
- let addOneWeek = nextWeek.getDate() + 7;
795
-
796
- nextWeek.setDate(addOneWeek);
797
- nextWeek = formatDateString(nextWeek);
798
-
799
- minDateExample.setAttribute('value', today);
800
- minDateExample.setAttribute('minDate', today);
801
-
802
- changeMinDateButton.addEventListener('click', () => {
803
- minDateExample.setAttribute('minDate', nextWeek);
804
- });
805
-
806
- resetButton.addEventListener('click', () => {
807
- minDateExample.setAttribute('value', today);
808
- minDateExample.setAttribute('minDate', today);
809
- });
810
-
811
- }
812
- ```
813
- <!-- AURO-GENERATED-CONTENT:END -->
814
- </auro-accordion>
815
-
816
- ### Month Names Localization
817
-
818
- The datepicker supports localized month names through the `monthNames` property.
819
-
820
- This example demonstrates how to set the `monthNames` property to Korean month names, with a Korean date format.
821
-
822
- <div class="exampleWrapper">
823
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/localization.html) -->
824
- <!-- The below content is automatically added from ./../apiExamples/localization.html -->
825
- <auro-datepicker format="yyyy/mm/dd" id="localizationExample">
826
- <span slot="bib.fullscreen.headline">Localization Headline</span>
827
- <span slot="fromLabel">Choose a date</span>
828
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
829
- </auro-datepicker>
830
- <!-- AURO-GENERATED-CONTENT:END -->
831
- </div>
832
- <auro-accordion alignRight>
833
- <span slot="trigger">See code</span>
834
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.html) -->
835
- <!-- The below code snippet is automatically added from ./../apiExamples/localization.html -->
836
-
837
- ```html
838
- <auro-datepicker format="yyyy/mm/dd" id="localizationExample">
839
- <span slot="bib.fullscreen.headline">Localization Headline</span>
840
- <span slot="fromLabel">Choose a date</span>
841
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
842
- </auro-datepicker>
843
- ```
844
- <!-- AURO-GENERATED-CONTENT:END -->
845
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/localization.js) -->
846
- <!-- The below code snippet is automatically added from ./../apiExamples/localization.js -->
847
-
848
- ```js
849
- export function localizationExample() {
850
- const localizedDatepicker = document.querySelector("#localizationExample");
851
-
852
- localizedDatepicker.monthNames = ['일월', '이월', '삼월', '사월', '오월', '유월', '칠월', '팔월', '구월', '시월', '십일월', '십이월'];
853
- }
854
- ```
855
- <!-- AURO-GENERATED-CONTENT:END -->
856
- </auro-accordion>
857
-
858
- ### No Validate
859
-
860
- Set `noValidate` to force the datepicker not to validate when navigating away from the component.
861
-
862
- <div class="exampleWrapper">
863
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/no-validate.html) -->
864
- <!-- The below content is automatically added from ./../apiExamples/no-validate.html -->
865
- <auro-datepicker required noValidate>
866
- <span slot="bib.fullscreen.headline">noValidate Example</span>
867
- <span slot="fromLabel">Choose a date</span>
868
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
869
- </auro-datepicker>
870
- <!-- AURO-GENERATED-CONTENT:END -->
871
- </div>
872
- <auro-accordion alignRight>
873
- <span slot="trigger">See code</span>
874
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/no-validate.html) -->
875
- <!-- The below code snippet is automatically added from ./../apiExamples/no-validate.html -->
876
-
877
- ```html
878
- <auro-datepicker required noValidate>
879
- <span slot="bib.fullscreen.headline">noValidate Example</span>
880
- <span slot="fromLabel">Choose a date</span>
881
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
882
- </auro-datepicker>
883
- ```
884
- <!-- AURO-GENERATED-CONTENT:END -->
885
- </auro-accordion>
886
-
887
- ### Reference Dates
888
-
889
- You can choose to outline dates for the user to reference by passing a string containing an array of values to the component to tell it which dates are your reference dates.
890
-
891
- Example:
892
- ```html
893
- <auro-datepicker referenceDates='["10/05/2025", "10/15/2025", "10/20/2025", "10/22/2025"]'></auro-datepicker>
894
- ```
895
-
896
- <div class="exampleWrapper">
897
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reference-dates.html) -->
898
- <!-- The below content is automatically added from ./../apiExamples/reference-dates.html -->
899
- <auro-datepicker referenceDates='["10/05/2025", "10/15/2025", "10/20/2025", "10/22/2025"]' minDate="10/12/2025">
900
- <span slot="ariaLabel.bib.close">Close Calendar</span>
901
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
902
- <span slot="fromLabel">Choose a date</span>
903
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
904
- </auro-datepicker>
905
- <!-- AURO-GENERATED-CONTENT:END -->
906
- </div>
907
- <auro-accordion alignRight>
908
- <span slot="trigger">See code</span>
909
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reference-dates.html) -->
910
- <!-- The below code snippet is automatically added from ./../apiExamples/reference-dates.html -->
911
-
912
- ```html
913
- <auro-datepicker referenceDates='["10/05/2025", "10/15/2025", "10/20/2025", "10/22/2025"]' minDate="10/12/2025">
914
- <span slot="ariaLabel.bib.close">Close Calendar</span>
915
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
916
- <span slot="fromLabel">Choose a date</span>
917
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
918
- </auro-datepicker>
919
- ```
920
- <!-- AURO-GENERATED-CONTENT:END -->
921
- </auro-accordion>
922
-
923
- ### Required
924
-
925
- Populates the `required` attribute on the input. Used for client-side validation.
926
-
927
- When the validity check fails the validityState, equals `valueMissing`. The error message for the `valueMissing` validityState can be set to a custom string using the `setCustomValidityValueMissing`. There is no default error message defined.
928
-
929
- <div class="exampleWrapper">
930
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/required.html) -->
931
- <!-- The below content is automatically added from ./../apiExamples/required.html -->
932
- <auro-datepicker required setCustomValidityValueMissing="Custom value missing message.">
933
- <span slot="bib.fullscreen.headline">Required Example</span>
934
- <span slot="fromLabel">Choose a date</span>
935
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
936
- </auro-datepicker>
937
- <br />
938
- <auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
939
- <span slot="bib.fullscreen.headline">Required Example</span>
940
- <span slot="fromLabel">Departure</span>
941
- <span slot="toLabel">Return</span>
942
- <span slot="bib.fullscreen.fromLabel">Departure</span>
943
- <span slot="bib.fullscreen.toLabel">Return</span>
944
- </auro-datepicker>
945
- <!-- AURO-GENERATED-CONTENT:END -->
946
- </div>
947
- <auro-accordion alignRight>
948
- <span slot="trigger">See code</span>
949
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/required.html) -->
950
- <!-- The below code snippet is automatically added from ./../apiExamples/required.html -->
951
-
952
- ```html
953
- <auro-datepicker required setCustomValidityValueMissing="Custom value missing message.">
954
- <span slot="bib.fullscreen.headline">Required Example</span>
955
- <span slot="fromLabel">Choose a date</span>
956
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
957
- </auro-datepicker>
958
- <br />
959
- <auro-datepicker required range setCustomValidityValueMissing="Custom value missing message.">
960
- <span slot="bib.fullscreen.headline">Required Example</span>
961
- <span slot="fromLabel">Departure</span>
962
- <span slot="toLabel">Return</span>
963
- <span slot="bib.fullscreen.fromLabel">Departure</span>
964
- <span slot="bib.fullscreen.toLabel">Return</span>
965
- </auro-datepicker>
966
- ```
967
- <!-- AURO-GENERATED-CONTENT:END -->
968
- </auro-accordion>
969
-
970
- ### Stacked
971
-
972
- Set the `stacked` attribute to make range datepicker stacked style.
973
-
974
- <div class="exampleWrapper">
975
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/stacked.html) -->
976
- <!-- The below content is automatically added from ./../apiExamples/stacked.html -->
977
- <auro-datepicker range stacked>
978
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
979
- <span slot="fromLabel">Choose a date</span>
980
- <span slot="bib.fullscreen.fromLabel">Departure</span>
981
- <span slot="bib.fullscreen.toLabel">Return</span>
982
- </auro-datepicker>
983
- <!-- AURO-GENERATED-CONTENT:END -->
984
- </div>
985
- <auro-accordion alignRight>
986
- <span slot="trigger">See code</span>
987
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/stacked.html) -->
988
- <!-- The below code snippet is automatically added from ./../apiExamples/stacked.html -->
989
-
990
- ```html
991
- <auro-datepicker range stacked>
992
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
993
- <span slot="fromLabel">Choose a date</span>
994
- <span slot="bib.fullscreen.fromLabel">Departure</span>
995
- <span slot="bib.fullscreen.toLabel">Return</span>
996
- </auro-datepicker>
997
- ```
998
- <!-- AURO-GENERATED-CONTENT:END -->
999
- </auro-accordion>
1000
-
1001
- ### Validity
1002
-
1003
- Specifies the `validityState` the element is in. Upon first interaction, or presetting the `error` attribute, the component will validate on `focusout`. After validation, `validityState` can be queried from the component by using the following JavaScript.
1004
-
1005
- <div class="exampleWrapper">
1006
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/validity.html) -->
1007
- <!-- The below content is automatically added from ./../apiExamples/validity.html -->
1008
- <auro-button id="validityExampleBtn">Get validity</auro-button>
1009
- <br />
1010
- <auro-datepicker required id="validityExample">
1011
- <span slot="bib.fullscreen.headline">validity Example</span>
1012
- <span slot="fromLabel">Choose a date</span>
1013
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1014
- </auro-datepicker>
1015
- <!-- AURO-GENERATED-CONTENT:END -->
1016
- </div>
1017
- <auro-accordion alignRight>
1018
- <span slot="trigger">See code</span>
1019
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/validity.html) -->
1020
- <!-- The below code snippet is automatically added from ./../apiExamples/validity.html -->
1021
-
1022
- ```html
1023
- <auro-button id="validityExampleBtn">Get validity</auro-button>
1024
- <br />
1025
- <auro-datepicker required id="validityExample">
1026
- <span slot="bib.fullscreen.headline">validity Example</span>
1027
- <span slot="fromLabel">Choose a date</span>
1028
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1029
- </auro-datepicker>
1030
- ```
1031
- <!-- AURO-GENERATED-CONTENT:END -->
1032
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/validity.js) -->
1033
- <!-- The below code snippet is automatically added from ./../apiExamples/validity.js -->
1034
-
1035
- ```js
1036
- export function validityExample() {
1037
- const validityExampleExample = document.querySelector('#validityExample');
1038
- const validityExampleExampleBtn = document.querySelector('#validityExampleBtn');
1039
-
1040
- validityExampleExampleBtn.addEventListener('click', () => {
1041
- console.warn('Validity set to:', validityExampleExample.validity);
1042
- alert(`Validity set to: ${validityExampleExample.validity}`);
1043
- })
1044
- }
1045
- ```
1046
- <!-- AURO-GENERATED-CONTENT:END -->
1047
- </auro-accordion>
1048
-
1049
- ### Value
1050
-
1051
- The `value` attribute represents the value selected for the datepicker. Can be used to pre-set the value of the datepicker. When the `range` attribute is used, `value` is for the first input.
1052
-
1053
- <div class="exampleWrapper">
1054
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/value.html) -->
1055
- <!-- The below content is automatically added from ./../apiExamples/value.html -->
1056
- <auro-datepicker id="valueExample" value="02/02/2022">
1057
- <span slot="bib.fullscreen.headline">value Example</span>
1058
- <span slot="fromLabel">Choose a date</span>
1059
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1060
- </auro-datepicker>
1061
- <!-- AURO-GENERATED-CONTENT:END -->
1062
- </div>
1063
- <auro-accordion alignRight>
1064
- <span slot="trigger">See code</span>
1065
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/value.html) -->
1066
- <!-- The below code snippet is automatically added from ./../apiExamples/value.html -->
1067
-
1068
- ```html
1069
- <auro-datepicker id="valueExample" value="02/02/2022">
1070
- <span slot="bib.fullscreen.headline">value Example</span>
1071
- <span slot="fromLabel">Choose a date</span>
1072
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1073
- </auro-datepicker>
1074
- ```
1075
- <!-- AURO-GENERATED-CONTENT:END -->
1076
- </auro-accordion>
1077
-
1078
- ### Value of Second Input in Range Mode
1079
-
1080
- The `valueEnd` attribute represents the value of the second input (end date), selected for the datepicker. Can be used to pre-set the value of the datepicker. Only applicable for a datepicker with the `range` attribute.
1081
-
1082
- <div class="exampleWrapper">
1083
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/value-end.html) -->
1084
- <!-- The below content is automatically added from ./../apiExamples/value-end.html -->
1085
- <auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
1086
- <span slot="bib.fullscreen.headline">valueEnd Example</span>
1087
- <span slot="fromLabel">Departure</span>
1088
- <span slot="toLabel">Return</span>
1089
- <span slot="bib.fullscreen.fromLabel">Departure</span>
1090
- <span slot="bib.fullscreen.toLabel">Return</span>
1091
- </auro-datepicker>
1092
- <!-- AURO-GENERATED-CONTENT:END -->
1093
- </div>
1094
- <auro-accordion alignRight>
1095
- <span slot="trigger">See code</span>
1096
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/value-end.html) -->
1097
- <!-- The below code snippet is automatically added from ./../apiExamples/value-end.html -->
1098
-
1099
- ```html
1100
- <auro-datepicker id="valueEndExample" range valueEnd="03/03/2023">
1101
- <span slot="bib.fullscreen.headline">valueEnd Example</span>
1102
- <span slot="fromLabel">Departure</span>
1103
- <span slot="toLabel">Return</span>
1104
- <span slot="bib.fullscreen.fromLabel">Departure</span>
1105
- <span slot="bib.fullscreen.toLabel">Return</span>
1106
- </auro-datepicker>
1107
- ```
1108
- <!-- AURO-GENERATED-CONTENT:END -->
1109
- </auro-accordion>
1110
-
1111
- ## Method Examples
1112
-
1113
- ### Focus
1114
-
1115
- The `focus()` method will apply focus state to the datepicker's input field.
1116
-
1117
- <div class="exampleWrapper">
1118
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/focus.html) -->
1119
- <!-- The below content is automatically added from ./../apiExamples/focus.html -->
1120
- <auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
1121
- <auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
1122
- <br />
1123
- <auro-datepicker id="focusExampleElem" range>
1124
- <span slot="bib.fullscreen.headline">Focus Example</span>
1125
- <span slot="fromLabel">Departure</span>
1126
- <span slot="toLabel">Return</span>
1127
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1128
- <span slot="bib.fullscreen.toLabel">Choose a date</span>
1129
- </auro-datepicker>
1130
- <!-- AURO-GENERATED-CONTENT:END -->
1131
- </div>
1132
- <auro-accordion alignRight>
1133
- <span slot="trigger">See code</span>
1134
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.html) -->
1135
- <!-- The below code snippet is automatically added from ./../apiExamples/focus.html -->
1136
-
1137
- ```html
1138
- <auro-button id="focusExampleBtn">Apply focus to datepicker</auro-button>
1139
- <auro-button id="focusExampleBtnTwo">Apply focus to the second input in datepicker</auro-button>
1140
- <br />
1141
- <auro-datepicker id="focusExampleElem" range>
1142
- <span slot="bib.fullscreen.headline">Focus Example</span>
1143
- <span slot="fromLabel">Departure</span>
1144
- <span slot="toLabel">Return</span>
1145
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1146
- <span slot="bib.fullscreen.toLabel">Choose a date</span>
1147
- </auro-datepicker>
1148
- ```
1149
- <!-- AURO-GENERATED-CONTENT:END -->
1150
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/focus.js) -->
1151
- <!-- The below code snippet is automatically added from ./../apiExamples/focus.js -->
1152
-
1153
- ```js
1154
- export function focusExample() {
1155
- const focusExampleElem = document.querySelector('#focusExampleElem');
1156
- const focusExampleBtn = document.querySelector('#focusExampleBtn');
1157
- const focusExampleBtnTwo = document.querySelector('#focusExampleBtnTwo');
1158
-
1159
- focusExampleBtn.addEventListener('click', () => {
1160
- focusExampleElem.focus();
1161
- });
1162
-
1163
- focusExampleBtnTwo.addEventListener('click', () => {
1164
- focusExampleElem.focus('endDate');
1165
- });
1166
- }
1167
- ```
1168
- <!-- AURO-GENERATED-CONTENT:END -->
1169
- </auro-accordion>
1170
-
1171
- ### Reset State
1172
-
1173
- Use the `reset()` method to reset the `<auro-datepicker>`'s `value`, `valueEnd` and `validity` state. Doing so will preserve all other attributes and properties.
1174
-
1175
- <div class="exampleWrapper">
1176
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/reset-state.html) -->
1177
- <!-- The below content is automatically added from ./../apiExamples/reset-state.html -->
1178
- <auro-button id="resetStateBtn">Reset</auro-button>
1179
- <br />
1180
- <auro-datepicker id="resetStateExample" range minDate="06/30/2025" calendarStartDate="06/30/2025" calendarFocusDate="06/30/2025" value="02/14/2025" valueEnd="04/05/2025" setCustomValidityRangeUnderflow="The date you entered is too early.">
1181
- <span slot="bib.fullscreen.headline">Reset Example</span>
1182
- <span slot="fromLabel">Departure</span>
1183
- <span slot="toLabel">Return</span>
1184
- <span slot="bib.fullscreen.fromLabel">Departure</span>
1185
- <span slot="bib.fullscreen.toLabel">Return</span>
1186
- </auro-datepicker>
1187
- <!-- AURO-GENERATED-CONTENT:END -->
1188
- </div>
1189
- <auro-accordion alignRight>
1190
- <span slot="trigger">See code</span>
1191
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.html) -->
1192
- <!-- The below code snippet is automatically added from ./../apiExamples/reset-state.html -->
1193
-
1194
- ```html
1195
- <auro-button id="resetStateBtn">Reset</auro-button>
1196
- <br />
1197
- <auro-datepicker id="resetStateExample" range minDate="06/30/2025" calendarStartDate="06/30/2025" calendarFocusDate="06/30/2025" value="02/14/2025" valueEnd="04/05/2025" setCustomValidityRangeUnderflow="The date you entered is too early.">
1198
- <span slot="bib.fullscreen.headline">Reset Example</span>
1199
- <span slot="fromLabel">Departure</span>
1200
- <span slot="toLabel">Return</span>
1201
- <span slot="bib.fullscreen.fromLabel">Departure</span>
1202
- <span slot="bib.fullscreen.toLabel">Return</span>
1203
- </auro-datepicker>
1204
- ```
1205
- <!-- AURO-GENERATED-CONTENT:END -->
1206
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/reset-state.js) -->
1207
- <!-- The below code snippet is automatically added from ./../apiExamples/reset-state.js -->
1208
-
1209
- ```js
1210
- export function resetStateExample() {
1211
- const elem = document.querySelector('#resetStateExample');
1212
-
1213
- document.querySelector('#resetStateBtn').addEventListener('click', () => {
1214
- elem.reset();
1215
- });
1216
- }
1217
- ```
1218
- <!-- AURO-GENERATED-CONTENT:END -->
1219
- </auro-accordion>
1220
-
1221
- ## Event Examples
1222
-
1223
- ### Watch for Value Changes
1224
-
1225
- The following example listens for the `auroDatePicker-valueSet` event. Once triggered, `element.value` may be queried for the new value **and** in successful scenarios, an alert will appear. Open the JavaScript console in the browser's developer tools to see the `console.warn` message that appears after the `auroDatePicker-valueSet` event has been triggered.
1226
-
1227
- <div class="exampleWrapper">
1228
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/alert-value.html) -->
1229
- <!-- The below content is automatically added from ./../apiExamples/alert-value.html -->
1230
- <auro-datepicker id="datePickerValueAlert">
1231
- <span slot="bib.fullscreen.headline">Alert Value Example</span>
1232
- <span slot="fromLabel">Choose a date</span>
1233
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1234
- </auro-datepicker>
1235
- <!-- AURO-GENERATED-CONTENT:END -->
1236
- </div>
1237
- <auro-accordion alignRight>
1238
- <span slot="trigger">See code</span>
1239
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alert-value.html) -->
1240
- <!-- The below code snippet is automatically added from ./../apiExamples/alert-value.html -->
1241
-
1242
- ```html
1243
- <auro-datepicker id="datePickerValueAlert">
1244
- <span slot="bib.fullscreen.headline">Alert Value Example</span>
1245
- <span slot="fromLabel">Choose a date</span>
1246
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1247
- </auro-datepicker>
1248
- ```
1249
- <!-- AURO-GENERATED-CONTENT:END -->
1250
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/alert-value.js) -->
1251
- <!-- The below code snippet is automatically added from ./../apiExamples/alert-value.js -->
1252
-
1253
- ```js
1254
- export function alertValueExample() {
1255
- const valueAlertExample = document.querySelector('#datePickerValueAlert');
1256
-
1257
- valueAlertExample.addEventListener('auroDatePicker-valueSet', () => {
1258
- console.warn('Select value changed to:', valueAlertExample.value);
1259
- alert(`Select value changed to: ${valueAlertExample.value}`);
1260
- })
1261
- }
1262
- ```
1263
- <!-- AURO-GENERATED-CONTENT:END -->
1264
- </auro-accordion>
1265
-
1266
- ## Slot Examples
1267
-
1268
- ### Aria Label for Clear Button
1269
-
1270
- Use the `ariaLabel.input.clear` slot to set the `aria-label` for the clear button in the trigger input.
1271
-
1272
- <div class="exampleWrapper">
1273
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/aria-label-input-clear.html) -->
1274
- <!-- The below content is automatically added from ./../apiExamples/aria-label-input-clear.html -->
1275
- <auro-datepicker>
1276
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1277
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1278
- <span slot="fromLabel">Choose a date</span>
1279
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1280
- <span slot="ariaLabel.input.clear">Custom Clear Input Button</span>
1281
- </auro-datepicker>
1282
- <!-- AURO-GENERATED-CONTENT:END -->
1283
- </div>
1284
- <div class="exampleWrapper--ondark">
1285
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/snowflake/aria-label-input-clear.html) -->
1286
- <!-- The below content is automatically added from ./../apiExamples/snowflake/aria-label-input-clear.html -->
1287
- <auro-datepicker layout="snowflake" shape="snowflake" ondark placeholder="MM/DD/YYYY">
1288
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1289
- <span slot="label">Date</span>
1290
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1291
- <span slot="fromLabel">Choose a date</span>
1292
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1293
- <span slot="ariaLabel.input.clear">Snowflake Clear Input Button</span>
1294
- </auro-datepicker>
1295
- <!-- AURO-GENERATED-CONTENT:END -->
1296
- </div>
1297
- <auro-accordion alignRight>
1298
- <span slot="trigger">See code</span>
1299
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/aria-label-input-clear.html) -->
1300
- <!-- The below code snippet is automatically added from ./../apiExamples/aria-label-input-clear.html -->
1301
-
1302
- ```html
1303
- <auro-datepicker>
1304
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1305
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1306
- <span slot="fromLabel">Choose a date</span>
1307
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1308
- <span slot="ariaLabel.input.clear">Custom Clear Input Button</span>
1309
- </auro-datepicker>
1310
- ```
1311
- <!-- AURO-GENERATED-CONTENT:END -->
1312
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/snowflake/aria-label-input-clear.html) -->
1313
- <!-- The below code snippet is automatically added from ./../apiExamples/snowflake/aria-label-input-clear.html -->
1314
-
1315
- ```html
1316
- <auro-datepicker layout="snowflake" shape="snowflake" ondark placeholder="MM/DD/YYYY">
1317
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1318
- <span slot="label">Date</span>
1319
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1320
- <span slot="fromLabel">Choose a date</span>
1321
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1322
- <span slot="ariaLabel.input.clear">Snowflake Clear Input Button</span>
1323
- </auro-datepicker>
1324
- ```
1325
- <!-- AURO-GENERATED-CONTENT:END -->
1326
- </auro-accordion>
1327
-
1328
- ### Fullscreen Bib Date Labels and Headline
1329
-
1330
- Use the `bib.fullscreen.fromLabel`, `bib.fullscreen.toLabel`, and `bib.fullscreen.headline` slots to set the the labels at the top of the bib and headline when viewed in the mobile layout.
1331
-
1332
- To view this demo, set your window to a mobile screen size.
1333
-
1334
- **Note**: The previously supported `bib.fullscreen.dateLabel` slot is deprecated and will continue to work for backwards compatibility, but it is recommended to use the new `bib.fullscreen.fromLabel` and `bib.fullscreen.toLabel` slots to apply a label for each input when in mobile layout.
1335
-
1336
- <div class="exampleWrapper">
1337
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
1338
- <!-- The below content is automatically added from ./../apiExamples/basic.html -->
1339
- <auro-datepicker>
1340
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1341
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1342
- <span slot="fromLabel">Choose a date</span>
1343
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1344
- </auro-datepicker>
1345
- <!-- AURO-GENERATED-CONTENT:END -->
1346
- </div>
1347
- <auro-accordion alignRight>
1348
- <span slot="trigger">See code</span>
1349
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
1350
- <!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
1351
-
1352
- ```html
1353
- <auro-datepicker>
1354
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1355
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1356
- <span slot="fromLabel">Choose a date</span>
1357
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1358
- </auro-datepicker>
1359
- ```
1360
- <!-- AURO-GENERATED-CONTENT:END -->
1361
- </auro-accordion>
1362
-
1363
- ### From Label
1364
-
1365
- The `fromLabel` slot sets the label used for the input. When the `range` attribute is used this is the first of two inputs.
1366
-
1367
- <div class="exampleWrapper">
1368
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
1369
- <!-- The below content is automatically added from ./../apiExamples/basic.html -->
1370
- <auro-datepicker>
1371
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1372
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1373
- <span slot="fromLabel">Choose a date</span>
1374
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1375
- </auro-datepicker>
1376
- <!-- AURO-GENERATED-CONTENT:END -->
1377
- </div>
1378
- <auro-accordion alignRight>
1379
- <span slot="trigger">See code</span>
1380
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
1381
- <!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
1382
-
1383
- ```html
1384
- <auro-datepicker>
1385
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1386
- <span slot="bib.fullscreen.headline">Datepicker Headline</span>
1387
- <span slot="fromLabel">Choose a date</span>
1388
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1389
- </auro-datepicker>
1390
- ```
1391
- <!-- AURO-GENERATED-CONTENT:END -->
1392
- </auro-accordion>
1393
-
1394
- ### To Label
1395
-
1396
- The `toLabel` slot sets the label for the second input. Only for use with the `range` attribute.
1397
-
1398
- <div class="exampleWrapper">
1399
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/range.html) -->
1400
- <!-- The below content is automatically added from ./../apiExamples/range.html -->
1401
- <auro-datepicker range>
1402
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1403
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
1404
- <span slot="fromLabel">Departure</span>
1405
- <span slot="toLabel">Return</span>
1406
- <span slot="bib.fullscreen.fromLabel">Departure</span>
1407
- <span slot="bib.fullscreen.toLabel">Return</span>
1408
- </auro-datepicker>
1409
- <!-- AURO-GENERATED-CONTENT:END -->
1410
- </div>
1411
- <auro-accordion alignRight>
1412
- <span slot="trigger">See code</span>
1413
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/range.html) -->
1414
- <!-- The below code snippet is automatically added from ./../apiExamples/range.html -->
1415
-
1416
- ```html
1417
- <auro-datepicker range>
1418
- <span slot="ariaLabel.bib.close">Close Calendar</span>
1419
- <span slot="bib.fullscreen.headline">Datepicker Range Headline</span>
1420
- <span slot="fromLabel">Departure</span>
1421
- <span slot="toLabel">Return</span>
1422
- <span slot="bib.fullscreen.fromLabel">Departure</span>
1423
- <span slot="bib.fullscreen.toLabel">Return</span>
1424
- </auro-datepicker>
1425
- ```
1426
- <!-- AURO-GENERATED-CONTENT:END -->
1427
- </auro-accordion>
1428
-
1429
- ### Help Text
1430
-
1431
- Sets the help text displayed below the trigger. The `helpText` slot can be used to provide additional context for the combobox. When using the `error` attribute, the `helpText` slot can be used to describe the error.
1432
-
1433
- <div class="exampleWrapper">
1434
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/help-text.html) -->
1435
- <!-- The below content is automatically added from ./../apiExamples/help-text.html -->
1436
- <auro-datepicker>
1437
- <span slot="bib.fullscreen.headline">helpText Example</span>
1438
- <span slot="fromLabel">Choose a date</span>
1439
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1440
- <span slot="helpText">Choose a date must be today or earlier.</span>
1441
- </auro-datepicker>
1442
- <!-- AURO-GENERATED-CONTENT:END -->
1443
- </div>
1444
- <auro-accordion alignRight>
1445
- <span slot="trigger">See code</span>
1446
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/help-text.html) -->
1447
- <!-- The below code snippet is automatically added from ./../apiExamples/help-text.html -->
1448
-
1449
- ```html
1450
- <auro-datepicker>
1451
- <span slot="bib.fullscreen.headline">helpText Example</span>
1452
- <span slot="fromLabel">Choose a date</span>
1453
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1454
- <span slot="helpText">Choose a date must be today or earlier.</span>
1455
- </auro-datepicker>
1456
- ```
1457
- <!-- AURO-GENERATED-CONTENT:END -->
1458
- </auro-accordion>
1459
-
1460
- ### Date Slot
1461
-
1462
- Custom content can be added to any day in the calendar using a `slot` named following the pattern `date_{MM}_{DD}_{YYYY}` (e.g. `date_01_08_2024`).
1463
-
1464
- Adding the `highlight` attribute to the slot will change the slot content's color to `var(--ds-color-text-success-default)`.
1465
-
1466
- Slot content support is limited to text only and a maximum of five (5) characters.
1467
-
1468
- Slot content can be styled using [inline styles](https://www.codecademy.com/article/html-inline-styles) or [CSS Parts](https://css-tricks.com/styling-in-the-shadow-dom-with-css-shadow-parts/) (`part="dateSlot"`).
1469
-
1470
- <div class="exampleWrapper">
1471
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/date-slot.html) -->
1472
- <!-- The below content is automatically added from ./../apiExamples/date-slot.html -->
1473
- <auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
1474
- <span slot="bib.fullscreen.headline">dateSlot Example</span>
1475
- <span slot="fromLabel">Choose a date</span>
1476
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1477
- <span slot="date_12_03_2023">Sold</span>
1478
- <span highlight slot="date_12_04_2023">$89</span>
1479
- <span slot="date_12_05_2023">$100</span>
1480
- <span slot="date_12_06_2023">$2345</span>
1481
- <span highlight slot="date_12_07_2023">$149</span>
1482
- <span highlight slot="date_12_08_2023">$382</span>
1483
- <span slot="date_12_09_2023">$560</span>
1484
- </auro-datepicker>
1485
- <!-- AURO-GENERATED-CONTENT:END -->
1486
- </div>
1487
- <auro-accordion alignRight>
1488
- <span slot="trigger">See code</span>
1489
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/date-slot.html) -->
1490
- <!-- The below code snippet is automatically added from ./../apiExamples/date-slot.html -->
1491
-
1492
- ```html
1493
- <auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
1494
- <span slot="bib.fullscreen.headline">dateSlot Example</span>
1495
- <span slot="fromLabel">Choose a date</span>
1496
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1497
- <span slot="date_12_03_2023">Sold</span>
1498
- <span highlight slot="date_12_04_2023">$89</span>
1499
- <span slot="date_12_05_2023">$100</span>
1500
- <span slot="date_12_06_2023">$2345</span>
1501
- <span highlight slot="date_12_07_2023">$149</span>
1502
- <span highlight slot="date_12_08_2023">$382</span>
1503
- <span slot="date_12_09_2023">$560</span>
1504
- </auro-datepicker>
1505
- ```
1506
- <!-- AURO-GENERATED-CONTENT:END -->
1507
- </auro-accordion>
1508
-
1509
- ### Popover Slot
1510
-
1511
- Custom content can be added to any day's `auro-popover` in the calendar using a `slot` named following the pattern `popover_{MM}_{DD}_{YYYY}` (e.g. `popover_01_08_2024`).
1512
-
1513
- The popover slot is intended for use with calendar dates that are `disabled` (e.g. before minimum date or after maximum date).
1514
-
1515
- <div class="exampleWrapper">
1516
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popover-slot.html) -->
1517
- <!-- The below content is automatically added from ./../apiExamples/popover-slot.html -->
1518
- <auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
1519
- <span slot="bib.fullscreen.headline">Popover Slot Example</span>
1520
- <span slot="fromLabel">Choose a date</span>
1521
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1522
- <span slot="popover_12_03_2023">Tickets for this day are sold out</span>
1523
- <span slot="popover_12_04_2023">Tickets for this day are $89</span>
1524
- <span slot="popover_12_05_2023">Tickets for this day are $100</span>
1525
- <span slot="popover_12_06_2023">Tickets for this day are $2345</span>
1526
- <span slot="popover_12_07_2023">Tickets for this day are $149</span>
1527
- <span slot="popover_12_08_2023">Tickets for this day are $382</span>
1528
- <span slot="popover_12_09_2023">Tickets for this day are $560</span>
1529
- </auro-datepicker>
1530
- <!-- AURO-GENERATED-CONTENT:END -->
1531
- </div>
1532
- <auro-accordion alignRight>
1533
- <span slot="trigger">See code</span>
1534
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/popover-slot.html) -->
1535
- <!-- The below code snippet is automatically added from ./../apiExamples/popover-slot.html -->
1536
-
1537
- ```html
1538
- <auro-datepicker centralDate="12/03/2023" minDate="12/04/2023" maxDate="12/09/2023">
1539
- <span slot="bib.fullscreen.headline">Popover Slot Example</span>
1540
- <span slot="fromLabel">Choose a date</span>
1541
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1542
- <span slot="popover_12_03_2023">Tickets for this day are sold out</span>
1543
- <span slot="popover_12_04_2023">Tickets for this day are $89</span>
1544
- <span slot="popover_12_05_2023">Tickets for this day are $100</span>
1545
- <span slot="popover_12_06_2023">Tickets for this day are $2345</span>
1546
- <span slot="popover_12_07_2023">Tickets for this day are $149</span>
1547
- <span slot="popover_12_08_2023">Tickets for this day are $382</span>
1548
- <span slot="popover_12_09_2023">Tickets for this day are $560</span>
1549
- </auro-datepicker>
1550
- ```
1551
- <!-- AURO-GENERATED-CONTENT:END -->
1552
- </auro-accordion>
1553
-
1554
- ## Common Usage Patterns & Functional Examples
1555
-
1556
- ### Dynamic Slot Content
1557
-
1558
- This example demonstrates data driven slot content for days in the calendar. In this example, the slot content is inserted into each `auro-calendar-cell` after the bib of the `auro-datepicker` is opened, simulating an API call on a dynamic data source.
1559
-
1560
- <div class="exampleWrapper">
1561
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dynamic-slot.html) -->
1562
- <!-- The below content is automatically added from ./../apiExamples/dynamic-slot.html -->
1563
- <auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
1564
- <span slot="bib.fullscreen.headline">dynamic slot Example</span>
1565
- <span slot="fromLabel">Departure</span>
1566
- <span slot="toLabel">Return</span>
1567
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1568
- </auro-datepicker>
1569
- <!-- AURO-GENERATED-CONTENT:END -->
1570
- </div>
1571
- <auro-accordion alignRight>
1572
- <span slot="trigger">See code</span>
1573
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamic-slot.html) -->
1574
- <!-- The below code snippet is automatically added from ./../apiExamples/dynamic-slot.html -->
1575
-
1576
- ```html
1577
- <auro-datepicker id="slotContentExample" centralDate="12/13/2023" minDate="12/13/2023" maxDate="01/18/2024" range>
1578
- <span slot="bib.fullscreen.headline">dynamic slot Example</span>
1579
- <span slot="fromLabel">Departure</span>
1580
- <span slot="toLabel">Return</span>
1581
- <span slot="bib.fullscreen.fromLabel">Choose a date</span>
1582
- </auro-datepicker>
1583
- ```
1584
- <!-- AURO-GENERATED-CONTENT:END -->
1585
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dynamic-slot.js) -->
1586
- <!-- The below code snippet is automatically added from ./../apiExamples/dynamic-slot.js -->
1587
-
1588
- ```js
1589
- export function populateSlotContentExample() {
1590
- const populateSlotContentExample = document.querySelector('#slotContentExample');
1591
-
1592
- // Insert slot content when the datepicker has been opened
1593
- populateSlotContentExample.addEventListener('auroDatePicker-toggled', (event) => {
1594
- if (event.detail.expanded) {
1595
- // Array of object(s) containing key, value pairs defining what slot content to render
1596
- const data = [
1597
- {slot: 'date', month: 12, day: 1, year: 2023, content: 'Sold'},
1598
- {slot: 'date', month: 12, day: 2, year: 2023, content: 'Sold'},
1599
- {slot: 'date', month: 12, day: 3, year: 2023, content: 'Sold'},
1600
- {slot: 'date', month: 12, day: 4, year: 2023, content: 'Sold'},
1601
- {slot: 'date', month: 12, day: 5, year: 2023, content: 'Sold'},
1602
- {slot: 'date', month: 12, day: 6, year: 2023, content: 'Sold'},
1603
- {slot: 'date', month: 12, day: 7, year: 2023, content: 'Sold'},
1604
- {slot: 'date', month: 12, day: 8, year: 2023, content: 'Sold'},
1605
- {slot: 'date', month: 12, day: 9, year: 2023, content: 'Sold'},
1606
- {slot: 'date', month: 12, day: 10, year: 2023, content: 'Sold'},
1607
- {slot: 'date', month: 12, day: 11, year: 2023, content: 'Sold'},
1608
- {slot: 'date', month: 12, day: 12, year: 2023, content: 'Sold'},
1609
- {slot: 'date', month: 12, day: 13, year: 2023, content: '$560'},
1610
- {slot: 'date', month: 12, day: 14, year: 2023, content: '$89', highlight: true},
1611
- {slot: 'date', month: 12, day: 15, year: 2023, content: '$100'},
1612
- {slot: 'date', month: 12, day: 16, year: 2023, content: '$2345'},
1613
- {slot: 'date', month: 12, day: 17, year: 2023, content: '$2345'},
1614
- {slot: 'date', month: 12, day: 18, year: 2023, content: '$2345'},
1615
- {slot: 'date', month: 12, day: 19, year: 2023, content: '$2345'},
1616
- {slot: 'date', month: 12, day: 20, year: 2023, content: '$2345'},
1617
- {slot: 'date', month: 12, day: 21, year: 2023, content: '$2345'},
1618
- {slot: 'date', month: 12, day: 22, year: 2023, content: '$2345'},
1619
- {slot: 'date', month: 12, day: 23, year: 2023, content: '$2345'},
1620
- {slot: 'date', month: 12, day: 24, year: 2023, content: '$2345'},
1621
- {slot: 'date', month: 12, day: 25, year: 2023, content: '$2345'},
1622
- {slot: 'date', month: 12, day: 26, year: 2023, content: '$2345'},
1623
- {slot: 'date', month: 12, day: 27, year: 2023, content: '$2345'},
1624
- {slot: 'date', month: 12, day: 28, year: 2023, content: '$2345'},
1625
- {slot: 'date', month: 12, day: 29, year: 2023, content: '$2345'},
1626
- {slot: 'date', month: 12, day: 30, year: 2023, content: '$2345'},
1627
- {slot: 'date', month: 12, day: 31, year: 2023, content: '$2345'},
1628
- {slot: 'date', month: 1, day: 14, year: 2024, content: '$83', highlight: true},
1629
- {slot: 'date', month: 1, day: 15, year: 2024, content: '$203'},
1630
- {slot: 'date', month: 1, day: 16, year: 2024, content: '$4444'},
1631
- {slot: 'date', month: 1, day: 17, year: 2024, content: '$83', highlight: true},
1632
- {slot: 'date', month: 1, day: 18, year: 2024, content: '$96', highlight: true},
1633
- {slot: 'date', month: 1, day: 19, year: 2024, content: 'Sold'},
1634
- {slot: 'date', month: 1, day: 20, year: 2024, content: 'Sold'},
1635
- {slot: 'popover', month: 12, day: 1, year: 2023, content: 'Tickets for this date are sold out'},
1636
- {slot: 'popover', month: 12, day: 2, year: 2023, content: 'Tickets for this date are sold out'},
1637
- {slot: 'popover', month: 12, day: 3, year: 2023, content: 'Tickets for this date are sold out'},
1638
- {slot: 'popover', month: 12, day: 4, year: 2023, content: 'Tickets for this date are sold out'},
1639
- {slot: 'popover', month: 12, day: 5, year: 2023, content: 'Tickets for this date are sold out'},
1640
- {slot: 'popover', month: 12, day: 6, year: 2023, content: 'Tickets for this date are sold out'},
1641
- {slot: 'popover', month: 12, day: 7, year: 2023, content: 'Tickets for this date are sold out'},
1642
- {slot: 'popover', month: 12, day: 8, year: 2023, content: 'Tickets for this date are sold out'},
1643
- {slot: 'popover', month: 12, day: 9, year: 2023, content: 'Tickets for this date are sold out'},
1644
- {slot: 'popover', month: 12, day: 10, year: 2023, content: 'Tickets for this date are sold out'},
1645
- {slot: 'popover', month: 12, day: 11, year: 2023, content: 'Tickets for this date are sold out'},
1646
- {slot: 'popover', month: 12, day: 12, year: 2023, content: 'Tickets for this date are sold out'},
1647
- {slot: 'popover', month: 12, day: 13, year: 2023, content: 'Tickets for this date are $560'},
1648
- {slot: 'popover', month: 12, day: 14, year: 2023, content: 'Tickets for this date are $89'},
1649
- {slot: 'popover', month: 12, day: 15, year: 2023, content: 'Tickets for this date are $100'},
1650
- {slot: 'popover', month: 12, day: 16, year: 2023, content: 'Tickets for this date are $2345'},
1651
- {slot: 'popover', month: 12, day: 17, year: 2023, content: 'Tickets for this date are $2345'},
1652
- {slot: 'popover', month: 12, day: 18, year: 2023, content: 'Tickets for this date are $2345'},
1653
- {slot: 'popover', month: 12, day: 19, year: 2023, content: 'Tickets for this date are $2345'},
1654
- {slot: 'popover', month: 12, day: 20, year: 2023, content: 'Tickets for this date are $2345'},
1655
- {slot: 'popover', month: 12, day: 21, year: 2023, content: 'Tickets for this date are $2345'},
1656
- {slot: 'popover', month: 12, day: 22, year: 2023, content: 'Tickets for this date are $2345'},
1657
- {slot: 'popover', month: 12, day: 23, year: 2023, content: 'Tickets for this date are $2345'},
1658
- {slot: 'popover', month: 12, day: 24, year: 2023, content: 'Tickets for this date are $2345'},
1659
- {slot: 'popover', month: 12, day: 25, year: 2023, content: 'Tickets for this date are $2345'},
1660
- {slot: 'popover', month: 12, day: 26, year: 2023, content: 'Tickets for this date are $2345'},
1661
- {slot: 'popover', month: 12, day: 27, year: 2023, content: 'Tickets for this date are $2345'},
1662
- {slot: 'popover', month: 12, day: 28, year: 2023, content: 'Tickets for this date are $2345'},
1663
- {slot: 'popover', month: 12, day: 29, year: 2023, content: 'Tickets for this date are $2345'},
1664
- {slot: 'popover', month: 12, day: 30, year: 2023, content: 'Tickets for this date are $2345'},
1665
- {slot: 'popover', month: 12, day: 31, year: 2023, content: 'Tickets for this date are $2345'},
1666
- {slot: 'popover', month: 1, day: 14, year: 2024, content: 'Tickets for this date are $83'},
1667
- {slot: 'popover', month: 1, day: 15, year: 2024, content: 'Tickets for this date are $203'},
1668
- {slot: 'popover', month: 1, day: 16, year: 2024, content: 'Tickets for this date are $4444'},
1669
- {slot: 'popover', month: 1, day: 17, year: 2024, content: 'Tickets for this date are $83'},
1670
- {slot: 'popover', month: 1, day: 18, year: 2024, content: 'Tickets for this date are $96'},
1671
- {slot: 'popover', month: 1, day: 19, year: 2024, content: 'Tickets for this date are sold out'},
1672
- {slot: 'popover', month: 1, day: 20, year: 2024, content: 'Tickets for this date are sold out'}
1673
- ];
1674
-
1675
- // For each item in the array, parse the keys into an HTML element and insert it into the DOM
1676
- data.forEach((item) => {
1677
- // Create the new element for the slot content
1678
- const slotElement = document.createElement('span');
1679
-
1680
- if (item.month.toString().length === 1) {
1681
- item.month = `0` + item.month;
1682
- }
1683
-
1684
- if (item.day.toString().length === 1) {
1685
- item.day = `0` + item.day;
1686
- }
1687
-
1688
- // Create the slot name from the item's keys
1689
- const slotName = `${item.slot}_${item.month}_${item.day}_${item.year}`;
1690
-
1691
- // Set the slot name and content
1692
- slotElement.setAttribute('slot', slotName);
1693
- slotElement.textContent = item.content;
1694
-
1695
- // Set the 'highlight' attribute on date slot content
1696
- if (item.slot === 'date' && item.highlight) {
1697
- slotElement.setAttribute('highlight', item.highlight);
1698
- }
1699
-
1700
- // Append the new element to the DOM
1701
- populateSlotContentExample.appendChild(slotElement);
1702
- });
1703
- }
1704
-
1705
- populateSlotContentExample.pushSlotContent();
1706
- });
1707
- }
1708
- ```
1709
- <!-- AURO-GENERATED-CONTENT:END -->
1710
- </auro-accordion>
1711
-
1712
- ### Datepicker in Dialog
1713
-
1714
- The following example demonstrates the use of `<auro-datepicker>` within an `<auro-dialog>` component.
1715
-
1716
- <div class="exampleWrapper">
1717
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/in-dialog.html) -->
1718
- <!-- The below content is automatically added from ./../apiExamples/in-dialog.html -->
1719
- <div>
1720
- <auro-button id="datepicker-dialog-opener">Datepicker in Dialog</auro-button>
1721
- <auro-dialog id="datepicker-dialog">
1722
- <span slot="bib.fullscreen.headline">inDialog Example</span>
1723
- <span slot="header">Datepicker in Dialog</span>
1724
- <div slot="content">
1725
- <auro-datepicker />
1726
- </div>
1727
- </auro-dialog>
1728
- </div>
1729
- <!-- AURO-GENERATED-CONTENT:END -->
1730
- </div>
1731
- <auro-accordion alignRight>
1732
- <span slot="trigger">See code</span>
1733
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-dialog.html) -->
1734
- <!-- The below code snippet is automatically added from ./../apiExamples/in-dialog.html -->
1735
-
1736
- ```html
1737
- <div>
1738
- <auro-button id="datepicker-dialog-opener">Datepicker in Dialog</auro-button>
1739
- <auro-dialog id="datepicker-dialog">
1740
- <span slot="bib.fullscreen.headline">inDialog Example</span>
1741
- <span slot="header">Datepicker in Dialog</span>
1742
- <div slot="content">
1743
- <auro-datepicker />
1744
- </div>
1745
- </auro-dialog>
1746
- </div>
1747
- ```
1748
- <!-- AURO-GENERATED-CONTENT:END -->
1749
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-dialog.js) -->
1750
- <!-- The below code snippet is automatically added from ./../apiExamples/in-dialog.js -->
1751
-
1752
- ```js
1753
- export function inDialogExample() {
1754
- document.querySelector("#datepicker-dialog-opener").addEventListener("click", () => {
1755
- const dialog = document.querySelector("#datepicker-dialog");
1756
- dialog.open = true;
1757
- });
1758
- };
1759
- ```
1760
- <!-- AURO-GENERATED-CONTENT:END -->
1761
- </auro-accordion>
1762
-
1763
- ### Datepicker in Drawer
1764
-
1765
- The following example demonstrates the use of `<auro-datepicker>` within an `<auro-drawer>` component.
1766
-
1767
- <div class="exampleWrapper">
1768
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/in-drawer.html) -->
1769
- <!-- The below content is automatically added from ./../apiExamples/in-drawer.html -->
1770
- <div>
1771
- <auro-button id="datepicker-drawer-opener">Datepicker in Drawer</auro-button>
1772
- <auro-drawer id="datepicker-drawer">
1773
- <span slot="header">Datepicker in Drawer</span>
1774
- <div slot="content">
1775
- <auro-datepicker>
1776
- <span slot="bib.fullscreen.headline">inDrawer Example</span>
1777
- </auro-datepicker>
1778
- </div>
1779
- </auro-drawer>
1780
- </div>
1781
- <!-- AURO-GENERATED-CONTENT:END -->
1782
- </div>
1783
- <auro-accordion alignRight>
1784
- <span slot="trigger">See code</span>
1785
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-drawer.html) -->
1786
- <!-- The below code snippet is automatically added from ./../apiExamples/in-drawer.html -->
1787
-
1788
- ```html
1789
- <div>
1790
- <auro-button id="datepicker-drawer-opener">Datepicker in Drawer</auro-button>
1791
- <auro-drawer id="datepicker-drawer">
1792
- <span slot="header">Datepicker in Drawer</span>
1793
- <div slot="content">
1794
- <auro-datepicker>
1795
- <span slot="bib.fullscreen.headline">inDrawer Example</span>
1796
- </auro-datepicker>
1797
- </div>
1798
- </auro-drawer>
1799
- </div>
1800
- ```
1801
- <!-- AURO-GENERATED-CONTENT:END -->
1802
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/in-drawer.js) -->
1803
- <!-- The below code snippet is automatically added from ./../apiExamples/in-drawer.js -->
1804
-
1805
- ```js
1806
- export function inDrawerExample() {
1807
- document.querySelector("#datepicker-drawer-opener").addEventListener("click", () => {
1808
- const drawer = document.querySelector("#datepicker-drawer");
1809
- if (drawer.hasAttribute('open')) {
1810
- drawer.removeAttribute('open');
1811
- } else {
1812
- drawer.setAttribute('open', true);
1813
- }
1814
- });
1815
- };
1816
- ```
1817
- <!-- AURO-GENERATED-CONTENT:END -->
1818
- </auro-accordion>
1819
-
1820
- ## Restyle Component with CSS Variables
1821
-
1822
- The component may be restyled by changing the values of the following token(s).
1823
-
1824
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
1825
- <!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
1826
-
1827
- ```scss
1828
- /* stylelint-disable color-function-notation */
1829
-
1830
- @use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
1831
-
1832
- :host(:not([ondark])),
1833
- :host(:not([appearance="inverse"])) {
1834
- // datepicker
1835
- --ds-auro-datepicker-range-input-divider-color: var(--ds-basic-color-border-bold, #{v.$ds-basic-color-border-bold});
1836
- --ds-auro-datepicker-error-icon-color: var(--ds-basic-color-status-error, #{v.$ds-basic-color-status-error});
1837
- --ds-auro-datepicker-label-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
1838
- --ds-auro-datepicker-outline-color: transparent;
1839
-
1840
- // calendar
1841
- --ds-auro-calendar-mobile-header-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
1842
- --ds-auro-calendar-mobile-header-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
1843
- --ds-auro-calendar-mobile-header-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
1844
- --ds-auro-calendar-nav-btn-border-color: transparent;
1845
- --ds-auro-calendar-nav-btn-chevron-color: var(--ds-basic-color-brand-primary, #{v.$ds-basic-color-brand-primary});
1846
- --ds-auro-calendar-nav-btn-container-color: transparent;
1847
- --ds-auro-calendar-month-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
1848
- --ds-auro-calendar-month-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
1849
- --ds-auro-calendar-month-header-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1850
- --ds-auro-calendar-cell-border-color: transparent;
1851
- --ds-auro-calendar-cell-container-color: transparent;
1852
- --ds-auro-calendar-cell-in-range-color: var(--ds-advanced-color-shared-background-muted, #{v.$ds-advanced-color-shared-background-muted});
1853
- --ds-auro-calendar-cell-price-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1854
- --ds-auro-calendar-cell-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1855
- }
1856
-
1857
- :host([ondark]),
1858
- :host([appearance="inverse"]) {
1859
- // datepicker
1860
- --ds-auro-datepicker-range-input-divider-color: var(--ds-basic-color-texticon-inverse-muted, #{v.$ds-basic-color-texticon-inverse-muted});
1861
- --ds-auro-datepicker-error-icon-color: var(--ds-advanced-color-state-error-inverse, #{v.$ds-advanced-color-state-error-inverse});
1862
- --ds-auro-datepicker-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #{v.$ds-basic-color-texticon-inverse-muted});
1863
- --ds-auro-datepicker-outline-color: transparent;
1864
-
1865
- // calendar
1866
- --ds-auro-calendar-mobile-header-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
1867
- --ds-auro-calendar-mobile-header-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
1868
- --ds-auro-calendar-mobile-header-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
1869
- --ds-auro-calendar-nav-btn-border-color: transparent;
1870
- --ds-auro-calendar-nav-btn-chevron-color: var(--ds-basic-color-brand-primary, #{v.$ds-basic-color-brand-primary});
1871
- --ds-auro-calendar-nav-btn-container-color: transparent;
1872
- --ds-auro-calendar-month-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
1873
- --ds-auro-calendar-month-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
1874
- --ds-auro-calendar-month-header-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1875
- --ds-auro-calendar-cell-border-color: transparent;
1876
- --ds-auro-calendar-cell-container-color: transparent;
1877
- --ds-auro-calendar-cell-in-range-color: var(--ds-advanced-color-shared-background-muted, #{v.$ds-advanced-color-shared-background-muted});
1878
- --ds-auro-calendar-cell-price-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1879
- --ds-auro-calendar-cell-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
1880
- }
1881
- ```
1882
108
  <!-- AURO-GENERATED-CONTENT:END -->