Datepicker
Installation
yarn add @chewy/kib-datepicker-styles
Import
@use '~@chewy/kib-datepicker-styles/src/styles' as kib-datepicker;
Mixins
input-readonly
@mixin input-readonly() { ... }
@mixin input-readonly() { input[readonly] { background-color: transparent; } }
Description
Override input used to render the datepicker and remove readonly styling if rendered on mobile.
Parameters
None.
input-field-icon
@mixin input-field-icon() { ... }
@mixin input-field-icon() { pointer-events: initial; }
Description
Override input icon wrapper to allow clicks
Parameters
None.
TODO's
Find a different way of doing this.
input-adornment-new
@mixin input-adornment-new() { ... }
@mixin input-adornment-new() { margin: 0; }
Description
MUI adornment added to input
Parameters
None.
button-new
@mixin button-new() { ... }
@mixin button-new() { margin: 0; }
Description
Default button styles
Parameters
None.
input-adornment
@mixin input-adornment() { ... }
@mixin input-adornment() { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); margin-left: calc(#{spacing.get('s1')} * -1); }
Description
MUI adornment added to input deprecrate when field new is supported
Parameters
None.
Requires
- [function]
get
button
@mixin button() { ... }
@mixin button() { @include kib-button-new.generate-styles('utility', 'secondary', 'medium', true); }
Description
Default button styles deprecate when field new is supported
Parameters
None.
button-action-expanded
@mixin button-action-expanded() { ... }
@mixin button-action-expanded() { --kib-button-background: #{settings.$picker-open-action-icon-bg-color}; }
Description
KibField action button expanded styles
Parameters
None.
Requires
- [variable]
picker-open-action-icon-bg-color
button-action-disabled
@mixin button-action-disabled() { ... }
@mixin button-action-disabled() { pointer-events: none; }
Description
KibField action button disabled styles
Parameters
None.
input-adornment-icon
@mixin input-adornment-icon() { ... }
@mixin input-adornment-icon() { color: settings.$adornment-icon-color; @media (forced-colors: active) { color: inherit; } }
input-adornment-icon-expanded
@mixin input-adornment-icon-expanded() { ... }
@mixin input-adornment-icon-expanded() { --kib-button-text-color: #{settings.$picker-open-action-icon-focus-color}; color: var(--kib-button-text-color); }
Description
MUI adornment icon expanded
Parameters
None.
Requires
- [variable]
picker-open-action-icon-focus-color
input-adornment-icon-disabled
@mixin input-adornment-icon-disabled() { ... }
@mixin input-adornment-icon-disabled() { opacity: settings.$adornment-icon-disabled-opacity; @media (forced-colors: active) { opacity: 1; } }
Description
MUI adornment icon when disabled
Parameters
None.
Requires
- [variable]
adornment-icon-disabled-opacity
input-hidden-text
@mixin input-hidden-text() { ... }
@mixin input-hidden-text() { @include kib-core.visually-hidden; }
Description
Hidden a11y text on input label
Parameters
None.
icon
@mixin icon() { ... }
@mixin icon() { width: settings.$icon-size; height: settings.$icon-size; color: settings.$icon-color; @media (forced-colors: active) { color: inherit; } }
Description
Icons in calendar component
Parameters
None.
Requires
- [variable]
icon-size
- [variable]
icon-color
icon-disabled
@mixin icon-disabled() { ... }
@mixin icon-disabled() { opacity: settings.$icon-disabled-opacity; }
button-focus
@mixin button-focus() { ... }
@mixin button-focus() { background-color: settings.$button-focus-bg-color; }
Description
Focus styles for any MUI button inside component
Parameters
None.
Requires
- [variable]
button-focus-bg-color
button-action-focus
@mixin button-action-focus() { ... }
@mixin button-action-focus() { background-color: settings.$button-focus-bg-color; }
Description
Focus styles for any MUI button inside of component with action enabled
Parameters
None.
Requires
- [variable]
button-focus-bg-color
wrapper
@mixin wrapper() { ... }
@mixin wrapper() { @include elevation.elevation('high'); border-radius: settings.$wrapper-radius; @media (forced-colors: active) { border: unit.rem(2px) solid !important; } }
Description
Wrapper around calendar (MuiPaper)
Parameters
None.
Requires
- [function]
rem
- [variable]
wrapper-radius
picker-calendar-container
@mixin picker-calendar-container() { ... }
@mixin picker-calendar-container() { box-shadow: 0 -1px 0 0 color.get('ui-bg', '04'); }
picker-controls-bar
@mixin picker-controls-bar() { ... }
@mixin picker-controls-bar() { margin-top: spacing.get('s3'); margin-bottom: spacing.get('s3'); }
picker-month-name
@mixin picker-month-name() { ... }
@mixin picker-month-name() { @include typography.style-as('paragraph-2'); color: settings.$picker-month-name-color; }
Description
Styles for month names at the top of calendar
Parameters
None.
Requires
- [variable]
picker-month-name-color
picker-selected-month-year
@mixin picker-selected-month-year() { ... }
@mixin picker-selected-month-year() { @include typography.style-as('section-2'); }
Description
Current month/year text
Parameters
None.
picker-choice
@mixin picker-choice() { ... }
@mixin picker-choice() { @include typography.style-as('paragraph-1'); }
Description
Base styles for all picker choices (day, month or year)
Parameters
None.
picker-choice-default
@mixin picker-choice-default() { ... }
@mixin picker-choice-default() { color: settings.$picker-choice-text-color; }
Description
Styles for default state of all picker choices
Parameters
None.
Requires
- [variable]
picker-choice-text-color
picker-choice-hover
@mixin picker-choice-hover() { ... }
@mixin picker-choice-hover() { background-color: settings.$picker-choice-hover-bg-color; }
picker-choice-focus
@mixin picker-choice-focus() { ... }
@mixin picker-choice-focus() { box-shadow: inset 0 0 0 settings.$picker-choice-focus-outline-width settings.$picker-choice-focus-outline-color; &:not(:hover) { background-color: transparent; } }
Description
Focused choice
Parameters
None.
Requires
- [variable]
picker-choice-focus-outline-width
- [variable]
picker-choice-focus-outline-color
picker-choice-selected
@mixin picker-choice-selected() { ... }
@mixin picker-choice-selected() { background-color: settings.$picker-choice-selected-bg-color; @media (forced-colors: active) { background-color: Highlight !important; color: HighlightText !important; border-color: HighlightText !important; forced-color-adjust: none; &:focus { box-shadow: none; } } }
picker-choice-disabled
@mixin picker-choice-disabled() { ... }
@mixin picker-choice-disabled() { background-image: linear-gradient( 45deg, transparent 49%, settings.$picker-choice-disabled-line-color 50%, transparent 51% ); cursor: not-allowed; color: settings.$picker-choice-disabled-color; pointer-events: none; }
Description
Disabled choice
Parameters
None.
Requires
- [variable]
picker-choice-disabled-line-color
- [variable]
picker-choice-disabled-color
picker-choice-today
@mixin picker-choice-today() { ... }
@mixin picker-choice-today() { position: relative; border: 0; &::before { position: absolute; top: settings.$picker-choice-today-dot-size; left: 50%; display: block; margin-left: math.div(settings.$picker-choice-today-dot-size, -2); width: settings.$picker-choice-today-dot-size; height: settings.$picker-choice-today-dot-size; background-color: settings.$picker-choice-today-dot-color; border-radius: settings.$picker-choice-today-dot-size; content: ''; } }
Description
Today choice
Parameters
None.
Requires
- [variable]
picker-choice-today-dot-size
- [variable]
picker-choice-today-dot-color
picker-toolbar
@mixin picker-toolbar() { ... }
@mixin picker-toolbar() { position: relative; background-color: color.get('ui-bg', '04'); }
picker-toolbar-title
@mixin picker-toolbar-title() { ... }
@mixin picker-toolbar-title() { @include typography.style-as('caption'); display: block; color: color.get('text', 'secondary'); text-transform: initial; }
picker-toolbar-selected-date
@mixin picker-toolbar-selected-date() { ... }
@mixin picker-toolbar-selected-date() { @include typography.style-as('section-1'); margin-top: spacing.get('s2'); }
picker-toolbar-switch-button
@mixin picker-toolbar-switch-button() { ... }
@mixin picker-toolbar-switch-button() { @include kib-button-new.generate-styles('action', 'tertiary', 'medium', true); position: absolute; top: 50%; right: kib-core.dimensions-get('default'); transform: translateY(-25%); color: settings.$icon-color; }
picker-dialog-content
@mixin picker-dialog-content() { ... }
@mixin picker-dialog-content() { padding-bottom: spacing.get('s4'); }
picker-dialog-content-input
@mixin picker-dialog-content-input() { ... }
@mixin picker-dialog-content-input() { margin-bottom: spacing.get('s8'); }
picker-dialog-action-button
@mixin picker-dialog-action-button() { ... }
@mixin picker-dialog-action-button() { @include kib-button-new.generate-styles('action', 'tertiary', 'small'); text-transform: capitalize; &:last-child { @include kib-button-new.root; } }
Description
Mobile dialog action button
Parameters
None.
Css
// deprecate when fields new is suppored @mixin button-action
// deprecate when fields new is suppored @mixin button-action { ... }
// deprecate when fields new is suppored @mixin button-action { box-shadow: none; padding: spacing.get('s3', 's3'); border-radius: 0 unit.rem(8px) unit.rem(8px) 0; opacity: inherit; > svg { width: inherit; height: inherit; } &::after { border: none; } }
Description
KibField action button styles
Variables
icon-size
$icon-size: kib-core.dimensions-get('large') !default;
Description
Size for icons inside calendar widget
Type
Number
icon-color
$icon-color: color.get('link', 'active', 'primary') !default;
Description
Color for icons inside calendar widget
Type
Color
Used by
- [mixin]
icon
- [mixin]
picker-toolbar-switch-button
- [mixin]
field-icon
icon-disabled-opacity
$icon-disabled-opacity: kib-button-new.$disabled-opacity !default;
adornment-icon-color
$adornment-icon-color: color.get('text', 'primary') !default;
Description
Color for adornment icon placed on text input
Type
Color
Used by
- [mixin]
input-adornment-icon
adornment-icon-disabled-opacity
$adornment-icon-disabled-opacity: $icon-disabled-opacity !default;
Description
Disabled opacity for adornment icon placed on text input
Type
Number
Used by
- [mixin]
input-adornment-icon-disabled
button-focus-bg-color
$button-focus-bg-color: color.get('action', 'utility', 'alternate', '03') !default;
Description
Focus background color for all MUI buttons in the component
Type
Color
Used by
- [mixin]
button-focus
- [mixin]
button-action-focus
wrapper-radius
$wrapper-radius: border.get('br02') !default;
picker-month-name-color
$picker-month-name-color: color.get('text', 'primary') !default;
Description
Color for month names at the top row of calendar
Type
Color
Used by
- [mixin]
picker-month-name
picker-choice-text-color
$picker-choice-text-color: color.get('link', 'active', 'primary') !default;
picker-choice-hover-bg-color
$picker-choice-hover-bg-color: color.get('action', 'cta', 'alternate', '03') !default;
picker-choice-focus-outline-width
$picker-choice-focus-outline-width: unit.rem(2px) !default;
picker-choice-focus-outline-color
$picker-choice-focus-outline-color: color.get('action', 'cta', 'primary', 'primary') !default;
picker-choice-selected-bg-color
$picker-choice-selected-bg-color: color.get('action', 'cta', 'alternate', '02') !default;
picker-choice-disabled-color
$picker-choice-disabled-color: color.get('link', 'active', 'secondary') !default;
picker-choice-disabled-line-color
$picker-choice-disabled-line-color: color.get('ui-bg', '05') !default;
picker-choice-today-dot-color
$picker-choice-today-dot-color: color.get('link', 'active', 'primary') !default;
Description
Color for dot on choice representing current day
Type
Color
Used by
- [mixin]
picker-choice-today
picker-choice-today-dot-size
$picker-choice-today-dot-size: kib-core.dimensions-get('tiny') !default;
Description
Size of dot on choice representing current day
Type
Number
Used by
- [mixin]
picker-choice-today
picker-toolbar-border-color
$picker-toolbar-border-color: color.get('ui-bg', '04') !default;
Description
Border color below toolbar on mobile dialog
Type
Color
picker-toolbar-border-width
$picker-toolbar-border-width: unit.rem(1px) !default;
Description
Border width below toolbar on mobile dialog
Type
Color
picker-open-action-icon-focus-color
$picker-open-action-icon-focus-color: color.get('field', '04') !default;
Description
Color for action icon when picker is open or focus
Type
Color
Used by
- [mixin]
input-adornment-icon-expanded
picker-open-action-icon-bg-color
$picker-open-action-icon-bg-color: color.get('field', '03') !default;
Description
Color for icon background when picker is open
Type
Color
Used by
- [mixin]
button-action-expanded