-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add gcds-date-input component (#607)
* first commit of gcds-date-input: lang + format * Add value and internals logic * Events + build * new isValidDate function + basic styling changes * Form internals + day value format * Basic property validation * Basic styling * Start of validators * Date input validators * Storybook stories * CSS: token plan * Add logError function * Add dat-input tokens * Validation: make sure inputs reflect error * Add gcds-date-input to delFocusElements in react-ssr package * Change label attribute to legend * Cleanup code * Add part to select and input unit tests * Unit tests: isValidDate function * Rewrite isValidDate and requiredDatinput functions to be less relient on the DOM and passed parameters * Remove use of Date from isValidDate * Unit tests: Date Input validator * Refactor select options rendering * Date input spec tests * Add E2E tests for gcds-date-input * Fix typo * Update tokens package version * Fix required text look in fieldset legend * Add missing fieldset updates * PR feedback: change part to select in gcds-select * PR feedback: Add hint text to example + change data attribute name * Add missing function call * Fix spec tests * PR feedback: Update storybook + remove autocomplete * Refactor isValidDate to allow forcing of format
- Loading branch information
1 parent
ca5108f
commit ce0b4cc
Showing
35 changed files
with
2,914 additions
and
27 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/web/src/components/gcds-date-input/gcds-date-input.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@layer reset, default, hint, error; | ||
|
||
@layer reset { | ||
:host { | ||
display: block; | ||
} | ||
} | ||
|
||
@layer default { | ||
:host { | ||
.gcds-date-input__fieldset { | ||
--gcds-fieldset-font-desktop: var(--gcds-date-input-fieldset-font-desktop); | ||
--gcds-fieldset-font-mobile: var(--gcds-date-input-fieldset-font-mobile); | ||
--gcds-fieldset-legend-margin: var(--gcds-date-input-fieldset-margin); | ||
} | ||
|
||
.gcds-date-input__month, | ||
.gcds-date-input__year, | ||
.gcds-date-input__day { | ||
display: inline-block; | ||
margin-inline-end: var(--gcds-date-input-margin); | ||
|
||
--gcds-label-font-desktop: var(--gcds-date-input-label-font-desktop); | ||
--gcds-label-font-mobile: var(--gcds-date-input-label-font-mobile ); | ||
} | ||
} | ||
} | ||
|
||
@layer hint { | ||
:host { | ||
.gcds-date-input--hint { | ||
--gcds-fieldset-legend-margin: var(--gcds-date-input-fieldset-hint-margin); | ||
} | ||
} | ||
} | ||
|
||
@layer error { | ||
:host { | ||
.gcds-date-input--error { | ||
--gcds-fieldset-legend-margin: var(--gcds-date-input-fieldset-error-margin ); | ||
} | ||
|
||
gcds-input.gcds-date-input--error::part(input), | ||
gcds-select.gcds-date-input--error::part(select) { | ||
border-color: var(--gcds-date-input-danger-border); | ||
} | ||
} | ||
} |
Oops, something went wrong.