Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(date picker): add date picker component #601

Merged
merged 62 commits into from
Jul 31, 2024
Merged

Commits on Jul 5, 2024

  1. feat(date-picker): add date picker

    gregtyler authored and chrispymm committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    eb16377 View commit details
    Browse the repository at this point in the history
  2. refactor(date picker): updates to submitted datepicker component code

    Chnages to submitted code to use gov.uk styles where possible. Updates component to being fixed
    width by default, allowing users to either provide an alternative width class or remove it to have a
    fluid input.
    chrispymm committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    83cc9e1 View commit details
    Browse the repository at this point in the history
  3. refactor(date picker): update styles to match design system design

    Amends the styles of the submitted datepicker to match the tweaked design for inclusion in the
    Design System. Renames some classes to be slightly more consistent with BEM style. Reformat css file
    to remove nesting to conform to GDS recommended style.
    chrispymm committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    611c50b View commit details
    Browse the repository at this point in the history
  4. refactor(date picker): add calendar button via JS for pregressive enh…

    …ancement
    
    This PR moves the calendar popup toggle from in the template to within the JS, as the button
    shouldn't show up unless JS is available to toggle the popup dialog.  Improvements were made to the
    accessible labelling of the table headers and the individual day buttons to aid screenreader users.
    chrispymm committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    606dd43 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0998c49 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2f8830e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6f9178e View commit details
    Browse the repository at this point in the history
  8. feat(date picker): add support for disabling dates and days

    Allow for disabling of arbitrary dates using the data-disableddays param. Also disable specific days
    of the week using the data-disableddays param. e.g. disable all weekends with
    `data-disableddays="saturday sunday"`
    chrispymm committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    5456d6a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c6b513c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    59d4171 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    28bdb2f View commit details
    Browse the repository at this point in the history
  12. docs(update to component documentation): adding examples to date pick…

    …er component guidance
    robertjmccarthy authored and chrispymm committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    f4cff19 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f486c8b View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2024

  1. Configuration menu
    Copy the full SHA
    7fdecfb View commit details
    Browse the repository at this point in the history
  2. feat(date picker): add leadingzeros config parameter

    Add config option for whether or not the date inserted into the field on selection has leadingzeros
    for days and months
    chrispymm committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    5b52fee View commit details
    Browse the repository at this point in the history
  3. feat(date picker): add config option for week start day

    Allows a weekStartDay option to be passed to the component to configure whether weeks start on a
    monday or sunday
    chrispymm committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    c942b2e View commit details
    Browse the repository at this point in the history
  4. feat(date picker): allow passing date ranges to disabledDates

    In order to make it easier to disabled a block of dates it is now possible to pass date ranges in
    the format "19/7/2024-26/7/24" in the disabledDates parameter
    chrispymm committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    347aced View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    aa4e78c View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. ci(dockerfile): remove asset copy directive from the dockerfile

    Copying the assets directory is no longer needed as the assets are now within the docs directory
    chrispymm committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    10d57c5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    01b498e View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. refactor(date picker): refactor date picker template to be cleaner

    The previous template resulted in nested moj-form-group elements causing issues with error states.
    The template has now been refactored to more fully utilise the govuk-input macro and  use the
    govuk-attributes macro too to impriove and simplify the external api to the component.
    chrispymm committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    3fa2db0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4ad1745 View commit details
    Browse the repository at this point in the history
  3. refactor(date picker): refactor date picker JS

    Extract some js into functions for slightly improved readability
    chrispymm committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    bdebcc0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3ea4f7d View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. Configuration menu
    Copy the full SHA
    caab9d6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2f2def6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    35bb948 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. docs(date picker component): update

    Changes to content
    helennickols committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    087b03a View commit details
    Browse the repository at this point in the history
  2. docs(date picker component): update content

    Refine content ready for release.
    helennickols committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    b8ad0e4 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. feat(date picker): code formatting and updates following accessibilit…

    …y review
    
    * add aria-expanded attribute onto calendar toggle button
    * add "excluded date" assisteive text to excluded dates
    * update excluded dates example to show both individual dates and days
    * reformat code to follow convention of element variables having a $ prefix
    chrispymm committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    73f7071 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    59dad3a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0e3e21f View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. feat(date picker): allow component to be configured via JS as well as…

    … via data-attributes
    
    This change updates the component to allow for component properties such as minDate, maxDate and
    excludedDates/Days to be passed in via the JS config object. This follows the GDS convention where
    component defaults are overridden by the JS config, which is overridden by data attributes. The code
    to do this is largely borrowed from GOV.UK frontend.  Also added in this commit are JSDoc comments
    for all functions with arguments.
    chrispymm committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    4516b63 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    638975e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fde3653 View commit details
    Browse the repository at this point in the history
  4. feat(date picker): update diasbled dates with strikethrough and hover…

    … colors to darker grey
    
    Ensure metting WCAG color contrast rules by amending hover color, and add strikethrough for clarity
    of meaning on excluded dates
    chrispymm committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    656e1c9 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. Configuration menu
    Copy the full SHA
    d4ba814 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a004155 View commit details
    Browse the repository at this point in the history
  3. fix(examples): adds example title to example tabs links to prevent ma…

    …ny redundant links on the page
    
    This was raised in an accessibility review by Ben Proctor-Rogers.  Each of the example links on the
    page has the same label, which is not a good experience for screen reader users. This change adds
    the example title to the link as visually hidden text.
    chrispymm committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    354afc7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8d16275 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    30a7644 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    faad0f3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f0e687f View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. feat(date picker): fixes following code review

    Adjustments in response to code review
    chrispymm committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    5dbf16d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    807e11a View commit details
    Browse the repository at this point in the history
  3. docs(date picker component): update content

    Updated content on accessibility for excluded dates.
    helennickols committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    527ea89 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    02b2e23 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. docs(date picker component): update content

    Content tweaks
    helennickols committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    d0ae231 View commit details
    Browse the repository at this point in the history
  2. docs(date picker component): update content

    Correcting typo
    helennickols committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    68d18f4 View commit details
    Browse the repository at this point in the history
  3. docs(date picker component): update content

    Remove greyed out content which is a comment.
    helennickols committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    6f03b16 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. refactor(date picker): update sass to follow GOV.UK BEM conventions

    Updates the CSS classes to have only one block root per component.  Also updates to follw GOV.UK
    recomended convention of preferring sass variables instead of colour functions where available.
    chrispymm committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    f4557f3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a214d0 View commit details
    Browse the repository at this point in the history
  3. refactor(date picker): remove need for duplicate date regex

    The regex for a date was duplicated in the code.  It wasn't necessary to wrap getting the date in
    the input in a conditional due to the fact that fomattedDateFromString falls back to todays date
    meaning if there is no date in the input or the input contains an invalid date, it will fall back to
    setting the currentDate for the calendar to today, which is what is required.
    chrispymm committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    088cc37 View commit details
    Browse the repository at this point in the history
  4. fix(date picker): move escape key event listener to dialog element

    The 'esc' keydown event listener was attached to the calendarDayButton instance(s) meaning that
    escape would only close the modal if one of the calendar days was focused. Escape should clode the
    dialog wherever you are focused within it.  Moving the listener onto the parent element fixes this
    bug.
    chrispymm committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    b5308fd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f63509b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5346361 View commit details
    Browse the repository at this point in the history
  7. docs(date picker component): update content

    New content about server side validation for text inputs.
    helennickols committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    be4ff59 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    db2cb06 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7c746f5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9c15a4f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    4d96d23 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    ce51f88 View commit details
    Browse the repository at this point in the history