{# Calendar + DatePicker, ported from shadcn/ui. There is no react-day-picker here, so the month grid is computed by the `adminCalendar` factory -- always six weeks, so the popover never changes height as you page through months. Three macros: calendar() the month grid alone. Must be called inside an element whose x-data is adminCalendar(), and expects an x-ref="dateInput" in the same scope: the grid never holds the value, it only writes to that input, which stays the single source of truth. date_picker(...) the whole control -- a native with a button that opens the grid in a popover. calendar_script() the shared Alpine factory, included once by admin/base.html. The native input stays underneath because it already posts YYYY-MM-DD with no JS and gets the platform picker on mobile. The popover is an enhancement over it, not a replacement, so a date field works identically with Alpine absent and the server never has to care which one was used. #} {% from "admin/components/icons.html" import icon %} {% macro calendar() %}
{% endmacro %} {% macro date_picker(name, value="", required=false, disabled=false) %}
{{ calendar() }}
{% endmacro %} {% macro calendar_script() %} {% endmacro %}