baseui 12.1.3 → 13.0.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.
- package/a11y/a11y.js +6 -2
- package/a11y/types.d.ts +1 -1
- package/accordion/accordion.js +1 -0
- package/accordion/index.d.ts +1 -1
- package/accordion/locale.d.ts +1 -1
- package/accordion/panel.js +2 -1
- package/accordion/stateless-accordion.js +3 -1
- package/accordion/types.d.ts +18 -18
- package/app-nav-bar/app-nav-bar.js +9 -3
- package/app-nav-bar/index.d.ts +4 -4
- package/app-nav-bar/mobile-menu.js +4 -2
- package/app-nav-bar/styled-components.js +2 -35
- package/app-nav-bar/styled-components.js.flow +6 -36
- package/app-nav-bar/types.d.ts +6 -6
- package/app-nav-bar/user-menu.js +3 -2
- package/app-nav-bar/utils.d.ts +1 -1
- package/aspect-ratio-box/aspect-ratio-box-body.js +11 -7
- package/aspect-ratio-box/aspect-ratio-box.js +1 -0
- package/aspect-ratio-box/types.d.ts +1 -1
- package/avatar/avatar.js +3 -1
- package/avatar/styled-components.js +3 -1
- package/avatar/types.d.ts +6 -6
- package/badge/index.d.ts +8 -8
- package/badge/styled-components.js +8 -5
- package/badge/styled-components.js.flow +9 -4
- package/badge/types.d.ts +9 -9
- package/badge/utils.d.ts +1 -1
- package/banner/banner.js +26 -10
- package/banner/banner.js.flow +9 -4
- package/banner/index.d.ts +3 -3
- package/banner/styled-components.js +1 -1
- package/banner/types.d.ts +12 -11
- package/block/styled-components.js +21 -4
- package/block/types.d.ts +21 -21
- package/bottom-navigation/bottom-navigation.d.ts +4 -0
- package/bottom-navigation/bottom-navigation.js +170 -0
- package/bottom-navigation/index.d.ts +4 -0
- package/bottom-navigation/index.js +55 -0
- package/bottom-navigation/index.js.flow +72 -0
- package/bottom-navigation/nav-item.d.ts +3 -0
- package/bottom-navigation/nav-item.js +20 -0
- package/bottom-navigation/package.json +4 -0
- package/bottom-navigation/panel.d.ts +3 -0
- package/bottom-navigation/panel.js +53 -0
- package/bottom-navigation/selector.d.ts +3 -0
- package/bottom-navigation/selector.js +71 -0
- package/bottom-navigation/styled-components.d.ts +9 -0
- package/bottom-navigation/styled-components.js +105 -0
- package/bottom-navigation/types.d.ts +45 -0
- package/bottom-navigation/types.js +5 -0
- package/breadcrumbs/breadcrumbs.js +6 -2
- package/breadcrumbs/locale.d.ts +1 -1
- package/breadcrumbs/types.d.ts +2 -2
- package/button/button-internals.js +13 -0
- package/button/button.d.ts +2 -2
- package/button/button.js +3 -8
- package/button/index.d.ts +1 -1
- package/button/styled-components.js +11 -6
- package/button/types.d.ts +4 -4
- package/button-dock/button-dock.d.ts +4 -0
- package/button-dock/button-dock.js +63 -0
- package/button-dock/index.d.ts +3 -0
- package/button-dock/index.js +46 -0
- package/button-dock/index.js.flow +37 -0
- package/button-dock/package.json +4 -0
- package/button-dock/styled-components.d.ts +5 -0
- package/button-dock/styled-components.js +63 -0
- package/button-dock/types.d.ts +14 -0
- package/button-dock/types.js +5 -0
- package/button-docked/button-docked.d.ts +4 -0
- package/button-docked/button-docked.js +63 -0
- package/button-docked/index.d.ts +3 -0
- package/button-docked/index.js +46 -0
- package/button-docked/index.js.flow +37 -0
- package/button-docked/package.json +4 -0
- package/button-docked/styled-components.d.ts +5 -0
- package/button-docked/styled-components.js +62 -0
- package/button-docked/types.d.ts +14 -0
- package/button-docked/types.js +5 -0
- package/button-group/button-group.js +5 -0
- package/button-group/locale.d.ts +1 -1
- package/button-group/stateful-container.d.ts +1 -1
- package/button-group/stateful-container.js +3 -0
- package/button-group/types.d.ts +11 -11
- package/button-timed/button-timed.d.ts +4 -0
- package/button-timed/button-timed.js +125 -0
- package/button-timed/index.d.ts +5 -0
- package/button-timed/index.js +78 -0
- package/button-timed/index.js.flow +57 -0
- package/button-timed/package.json +4 -0
- package/button-timed/styled-components.d.ts +5 -0
- package/button-timed/styled-components.js +59 -0
- package/button-timed/types.d.ts +12 -0
- package/button-timed/types.js +5 -0
- package/button-timed/utils.d.ts +1 -0
- package/button-timed/utils.js +30 -0
- package/card/card.js +4 -2
- package/card/card.js.flow +1 -1
- package/card/types.d.ts +4 -4
- package/card/types.js.flow +1 -1
- package/checkbox/checkbox.d.ts +2 -0
- package/checkbox/checkbox.js +36 -16
- package/checkbox/checkbox.js.flow +1 -4
- package/checkbox/styled-components.js +11 -5
- package/checkbox/types.d.ts +15 -17
- package/checkbox/types.js.flow +2 -2
- package/combobox/combobox.js +20 -20
- package/combobox/combobox.js.flow +8 -3
- package/combobox/index.d.ts +1 -1
- package/combobox/styled-components.js +3 -1
- package/combobox/types.d.ts +5 -3
- package/combobox/types.js.flow +2 -0
- package/data-table/column-anchor.d.ts +5 -5
- package/data-table/column-anchor.js +3 -1
- package/data-table/column-boolean.d.ts +3 -3
- package/data-table/column-boolean.js +4 -2
- package/data-table/column-categorical.d.ts +4 -4
- package/data-table/column-categorical.js +8 -3
- package/data-table/column-custom.d.ts +1 -1
- package/data-table/column-datetime.d.ts +4 -4
- package/data-table/column-datetime.js +22 -6
- package/data-table/column-numerical.d.ts +4 -4
- package/data-table/column-numerical.js +12 -6
- package/data-table/column-row-index.d.ts +3 -3
- package/data-table/column-row-index.js +2 -1
- package/data-table/column-string.d.ts +3 -3
- package/data-table/column-string.js +3 -1
- package/data-table/column.js +2 -0
- package/data-table/data-table.js +41 -22
- package/data-table/data-table.js.flow +2 -2
- package/data-table/filter-menu.d.ts +1 -1
- package/data-table/filter-menu.js +18 -6
- package/data-table/filter-shell.d.ts +2 -2
- package/data-table/header-cell.d.ts +1 -1
- package/data-table/header-cell.js +2 -0
- package/data-table/index.d.ts +5 -5
- package/data-table/locale.d.ts +5 -1
- package/data-table/locale.js +3 -1
- package/data-table/locale.js.flow +4 -1
- package/data-table/measure-column-widths.d.ts +1 -1
- package/data-table/measure-column-widths.js +23 -22
- package/data-table/measure-column-widths.js.flow +1 -2
- package/data-table/stateful-container.js +52 -37
- package/data-table/stateful-data-table.js +18 -10
- package/data-table/text-search.js +1 -0
- package/data-table/types.d.ts +17 -14
- package/data-table/types.js.flow +2 -0
- package/datepicker/calendar-header.js +63 -20
- package/datepicker/calendar-header.js.flow +9 -7
- package/datepicker/calendar.d.ts +1 -0
- package/datepicker/calendar.js +94 -20
- package/datepicker/calendar.js.flow +56 -1
- package/datepicker/datepicker.d.ts +2 -1
- package/datepicker/datepicker.js +34 -12
- package/datepicker/day.js +10 -3
- package/datepicker/index.d.ts +1 -1
- package/datepicker/index.js.flow +1 -0
- package/datepicker/locale.d.ts +1 -1
- package/datepicker/locale.js +1 -1
- package/datepicker/month.js +14 -1
- package/datepicker/stateful-calendar.d.ts +1 -1
- package/datepicker/stateful-container.d.ts +2 -2
- package/datepicker/stateful-container.js +3 -2
- package/datepicker/stateful-datepicker.d.ts +1 -1
- package/datepicker/styled-components.d.ts +6 -2
- package/datepicker/styled-components.js +84 -49
- package/datepicker/types.d.ts +35 -22
- package/datepicker/types.js.flow +13 -0
- package/datepicker/utils/calendar-header-helpers.d.ts +2 -2
- package/datepicker/utils/date-helpers.js +3 -2
- package/datepicker/utils/day-state.js +6 -2
- package/datepicker/utils/index.d.ts +1 -1
- package/datepicker/utils/types.d.ts +7 -7
- package/datepicker/week.js +7 -3
- package/divider/types.d.ts +1 -1
- package/dnd-list/index.d.ts +1 -1
- package/dnd-list/list.js +2 -0
- package/dnd-list/stateful-list-container.js +4 -2
- package/dnd-list/styled-components.js +4 -2
- package/dnd-list/types.d.ts +8 -8
- package/drawer/drawer.d.ts +3 -3
- package/drawer/locale.d.ts +1 -1
- package/drawer/styled-components.js +14 -11
- package/drawer/types.d.ts +11 -11
- package/es/a11y/a11y.js +6 -2
- package/es/accordion/accordion.js +1 -0
- package/es/accordion/panel.js +2 -1
- package/es/accordion/stateless-accordion.js +3 -1
- package/es/app-nav-bar/app-nav-bar.js +8 -4
- package/es/app-nav-bar/mobile-menu.js +6 -3
- package/es/app-nav-bar/styled-components.js +5 -35
- package/es/app-nav-bar/user-menu.js +3 -2
- package/es/aspect-ratio-box/aspect-ratio-box-body.js +4 -1
- package/es/aspect-ratio-box/aspect-ratio-box.js +1 -0
- package/es/avatar/avatar.js +3 -1
- package/es/avatar/styled-components.js +3 -1
- package/es/badge/styled-components.js +8 -6
- package/es/banner/banner.js +26 -10
- package/es/banner/styled-components.js +1 -1
- package/es/block/styled-components.js +21 -4
- package/es/bottom-navigation/bottom-navigation.js +109 -0
- package/es/bottom-navigation/index.js +10 -0
- package/es/bottom-navigation/nav-item.js +12 -0
- package/es/bottom-navigation/panel.js +25 -0
- package/es/bottom-navigation/selector.js +34 -0
- package/es/bottom-navigation/styled-components.js +89 -0
- package/es/bottom-navigation/types.js +1 -0
- package/es/breadcrumbs/breadcrumbs.js +6 -2
- package/es/button/button-internals.js +13 -0
- package/es/button/button.js +7 -13
- package/es/button/styled-components.js +17 -6
- package/es/button-dock/button-dock.js +29 -0
- package/es/button-dock/index.js +9 -0
- package/es/button-dock/styled-components.js +49 -0
- package/es/button-dock/types.js +1 -0
- package/es/button-docked/button-docked.js +29 -0
- package/es/button-docked/index.js +9 -0
- package/es/button-docked/styled-components.js +48 -0
- package/es/button-docked/types.js +1 -0
- package/es/button-group/button-group.js +5 -0
- package/es/button-group/stateful-container.js +3 -0
- package/es/button-timed/button-timed.js +83 -0
- package/es/button-timed/index.js +11 -0
- package/es/button-timed/styled-components.js +49 -0
- package/es/button-timed/types.js +1 -0
- package/es/button-timed/utils.js +21 -0
- package/es/card/card.js +3 -2
- package/es/checkbox/checkbox.js +37 -16
- package/es/checkbox/styled-components.js +11 -5
- package/es/combobox/combobox.js +19 -20
- package/es/combobox/styled-components.js +3 -1
- package/es/data-table/column-anchor.js +3 -1
- package/es/data-table/column-boolean.js +4 -2
- package/es/data-table/column-categorical.js +7 -3
- package/es/data-table/column-datetime.js +22 -6
- package/es/data-table/column-numerical.js +14 -7
- package/es/data-table/column-row-index.js +2 -1
- package/es/data-table/column-string.js +3 -1
- package/es/data-table/column.js +2 -0
- package/es/data-table/data-table.js +38 -19
- package/es/data-table/filter-menu.js +16 -6
- package/es/data-table/header-cell.js +2 -0
- package/es/data-table/locale.js +3 -1
- package/es/data-table/measure-column-widths.js +23 -22
- package/es/data-table/stateful-container.js +42 -22
- package/es/data-table/stateful-data-table.js +16 -8
- package/es/data-table/text-search.js +1 -0
- package/es/datepicker/calendar-header.js +63 -20
- package/es/datepicker/calendar.js +68 -12
- package/es/datepicker/datepicker.js +32 -12
- package/es/datepicker/day.js +10 -3
- package/es/datepicker/locale.js +1 -1
- package/es/datepicker/month.js +14 -1
- package/es/datepicker/stateful-container.js +3 -2
- package/es/datepicker/styled-components.js +85 -54
- package/es/datepicker/utils/date-helpers.js +3 -2
- package/es/datepicker/utils/day-state.js +6 -2
- package/es/datepicker/week.js +7 -3
- package/es/dnd-list/list.js +2 -0
- package/es/dnd-list/stateful-list-container.js +5 -2
- package/es/dnd-list/styled-components.js +4 -2
- package/es/drawer/styled-components.js +14 -11
- package/es/file-uploader/file-uploader.js +92 -82
- package/es/file-uploader/styled-components.js +5 -3
- package/es/flex-grid/flex-grid-item.js +7 -2
- package/es/flex-grid/flex-grid.js +2 -1
- package/es/form-control/form-control.js +10 -2
- package/es/helper/stateful-helper.js +1 -0
- package/es/helper/styled-components.js +9 -5
- package/es/helpers/overrides.js +1 -0
- package/es/helpers/react-helpers.js +1 -1
- package/es/helpers/responsive-helpers.js +25 -1
- package/es/icon/alert.js +1 -0
- package/es/icon/arrow-down.js +1 -0
- package/es/icon/arrow-left.js +1 -0
- package/es/icon/arrow-right.js +1 -0
- package/es/icon/arrow-up.js +1 -0
- package/es/icon/blank.js +1 -0
- package/es/icon/calendar.js +44 -0
- package/es/icon/check-indeterminate.js +1 -0
- package/es/icon/check.js +1 -0
- package/es/icon/chevron-down.js +1 -0
- package/es/icon/chevron-left.js +1 -0
- package/es/icon/chevron-right.js +1 -0
- package/es/icon/chevron-up.js +1 -0
- package/es/icon/delete-alt.js +1 -0
- package/es/icon/delete.js +1 -0
- package/es/icon/filter.js +1 -0
- package/es/icon/grab.js +1 -0
- package/es/icon/hide.js +1 -0
- package/es/icon/icon-exports.js +1 -0
- package/es/icon/icon.js +1 -0
- package/es/icon/menu.js +1 -0
- package/es/icon/omit-dollar-prefixed-keys.js +1 -0
- package/es/icon/overflow.js +1 -0
- package/es/icon/plus.js +1 -0
- package/es/icon/search.js +1 -0
- package/es/icon/show.js +1 -0
- package/es/icon/spinner.js +1 -0
- package/es/icon/styled-components.js +4 -0
- package/es/icon/triangle-down.js +1 -0
- package/es/icon/triangle-left.js +1 -0
- package/es/icon/triangle-right.js +1 -0
- package/es/icon/triangle-up.js +1 -0
- package/es/icon/upload.js +1 -0
- package/es/input/base-input.js +34 -11
- package/es/input/input.js +13 -4
- package/es/input/masked-input.js +2 -1
- package/es/input/stateful-container.js +4 -1
- package/es/input/styled-components.js +31 -7
- package/es/input/utils.js +2 -0
- package/es/layer/layer.js +5 -1
- package/es/layer/tether.js +4 -1
- package/es/layout-grid/grid.js +1 -0
- package/es/layout-grid/index.js +2 -1
- package/es/layout-grid/styled-components.js +6 -3
- package/es/link/index.js +1 -0
- package/es/list/list-heading.js +21 -22
- package/es/list/list-item.js +5 -1
- package/es/list/styled-components.js +16 -3
- package/es/locale/es_AR.js +3 -1
- package/es/locale/index.js +10 -4
- package/es/locale/tr_TR.js +3 -1
- package/es/map-marker/calculate-offsets.js +20 -0
- package/es/map-marker/constants.js +116 -1
- package/es/map-marker/fixed-marker.js +2 -0
- package/es/map-marker/floating-marker.js +3 -1
- package/es/map-marker/floating-route-marker.js +72 -0
- package/es/map-marker/index.js +3 -1
- package/es/map-marker/location-puck.js +10 -5
- package/es/map-marker/pin-head.js +19 -10
- package/es/map-marker/styled-components.js +81 -6
- package/es/menu/menu.js +12 -4
- package/es/menu/nested-menus.js +9 -1
- package/es/menu/option-list.js +7 -4
- package/es/menu/option-profile.js +3 -3
- package/es/menu/stateful-container.js +8 -3
- package/es/menu/styled-components.js +5 -3
- package/es/message-card/message-card.js +26 -25
- package/es/message-card/styled-components.js +6 -1
- package/es/mobile-header/constants.js +9 -0
- package/es/mobile-header/index.js +9 -0
- package/es/mobile-header/mobile-header.js +110 -0
- package/es/mobile-header/styled-components.js +69 -0
- package/es/mobile-header/types.js +1 -0
- package/es/modal/modal-button.js +1 -0
- package/es/modal/modal.js +25 -19
- package/es/modal/styled-components.js +9 -2
- package/es/page-control/constants.js +17 -0
- package/es/page-control/index.js +9 -0
- package/es/page-control/page-control.js +114 -0
- package/es/page-control/styled-components.js +99 -0
- package/es/page-control/types.js +1 -0
- package/es/pagination/pagination.js +62 -56
- package/es/payment-card/payment-card.js +6 -2
- package/es/phone-input/base-country-picker.js +5 -2
- package/es/phone-input/country-picker.js +7 -0
- package/es/phone-input/country-select.js +1 -0
- package/es/phone-input/default-props.js +4 -0
- package/es/phone-input/flag.js +2 -1
- package/es/phone-input/phone-input-lite.js +2 -0
- package/es/phone-input/phone-input-next.js +2 -0
- package/es/phone-input/stateful-phone-input-container.js +1 -0
- package/es/pin-code/default-props.js +4 -0
- package/es/pin-code/pin-code.js +4 -2
- package/es/popover/popover.js +23 -6
- package/es/popover/stateful-popover.js +1 -0
- package/es/popover/utils.js +4 -1
- package/es/progress-bar/progressbar-rounded.js +27 -28
- package/es/progress-bar/progressbar.js +9 -3
- package/es/progress-bar/styled-components.js +4 -0
- package/es/progress-steps/progress-steps.js +1 -0
- package/es/radio/radio.js +5 -2
- package/es/radio/radiogroup.js +1 -0
- package/es/radio/styled-components.js +11 -5
- package/es/rating/emoticon-rating.js +16 -7
- package/es/rating/star-rating.js +16 -7
- package/es/rating/styled-components.js +2 -0
- package/es/select/default-props.js +10 -0
- package/es/select/dropdown.js +3 -1
- package/es/select/multi-value.js +1 -0
- package/es/select/select-component.js +60 -21
- package/es/select/stateful-select-container.js +1 -0
- package/es/select/styled-components.js +18 -7
- package/es/select/utils/default-filter-options.js +3 -1
- package/es/select/utils/index.js +3 -1
- package/es/sheet/action-button.js +44 -0
- package/es/sheet/index.js +9 -0
- package/es/sheet/sheet.js +100 -0
- package/es/sheet/styled-components.js +197 -0
- package/es/sheet/types.js +1 -0
- package/es/side-navigation/index.js +2 -1
- package/es/side-navigation/nav-item.js +2 -1
- package/es/side-navigation/nav.js +10 -3
- package/es/side-navigation/side-navigation-next.js +271 -0
- package/es/side-navigation/styled-components.js +4 -2
- package/es/skeleton/skeleton.js +2 -0
- package/es/skeleton/styled-components.js +1 -0
- package/es/slider/slider.js +2 -1
- package/es/snackbar/snackbar-context.js +29 -11
- package/es/snackbar/snackbar-element.js +4 -1
- package/es/snackbar/styled-components.js +1 -1
- package/es/spinner/styled-components.js +2 -0
- package/es/stepper/index.js +8 -0
- package/es/stepper/stepper.js +89 -0
- package/es/stepper/styled-components.js +19 -0
- package/es/stepper/types.js +1 -0
- package/es/styles/__mocks__/styled.js +6 -2
- package/es/styles/as-primary-export-hoc.js +2 -0
- package/es/styles/styled.js +2 -1
- package/es/system-banner/index.js +8 -0
- package/es/system-banner/styled-components.js +71 -0
- package/es/system-banner/system-banner.js +81 -0
- package/es/system-banner/types.js +1 -0
- package/es/table/styled-components.js +1 -0
- package/es/table/table.js +2 -0
- package/es/table-semantic/styled-components.js +8 -8
- package/es/table-semantic/table-builder.js +25 -22
- package/es/table-semantic/table.js +2 -0
- package/es/tabs/stateful-tabs.js +2 -2
- package/es/tabs-motion/stateful-tabs.js +1 -0
- package/es/tabs-motion/tab.js +1 -0
- package/es/tabs-motion/tabs.js +29 -6
- package/es/tag/styled-components.js +72 -2
- package/es/tag/tag.js +2 -0
- package/es/textarea/stateful-textarea.js +5 -1
- package/es/textarea/textarea.js +4 -2
- package/es/themes/dark-theme/color-component-tokens.js +2 -2
- package/es/themes/dark-theme/color-semantic-tokens.js +12 -4
- package/es/themes/light-theme/color-semantic-tokens.js +12 -4
- package/es/timepicker/timepicker.js +10 -4
- package/es/timezonepicker/timezone-picker.js +3 -1
- package/es/toast/toast.js +13 -5
- package/es/toast/toaster.js +24 -3
- package/es/tree-view/tree-label-interactable.js +4 -2
- package/es/tree-view/tree-view.js +5 -2
- package/es/tree-view/utils.js +43 -15
- package/es/utils/deep-merge.js +5 -0
- package/es/utils/focusVisible.js +17 -7
- package/esm/a11y/a11y.js +6 -2
- package/esm/accordion/accordion.js +1 -0
- package/esm/accordion/panel.js +2 -1
- package/esm/accordion/stateless-accordion.js +3 -1
- package/esm/app-nav-bar/app-nav-bar.js +9 -4
- package/esm/app-nav-bar/mobile-menu.js +4 -2
- package/esm/app-nav-bar/styled-components.js +3 -36
- package/esm/app-nav-bar/user-menu.js +3 -2
- package/esm/aspect-ratio-box/aspect-ratio-box-body.js +11 -7
- package/esm/aspect-ratio-box/aspect-ratio-box.js +1 -0
- package/esm/avatar/avatar.js +3 -1
- package/esm/avatar/styled-components.js +3 -1
- package/esm/badge/styled-components.js +8 -6
- package/esm/banner/banner.js +26 -10
- package/esm/banner/styled-components.js +1 -1
- package/esm/block/styled-components.js +21 -4
- package/esm/bottom-navigation/bottom-navigation.js +154 -0
- package/esm/bottom-navigation/index.js +10 -0
- package/esm/bottom-navigation/nav-item.js +12 -0
- package/esm/bottom-navigation/panel.js +42 -0
- package/esm/bottom-navigation/selector.js +58 -0
- package/esm/bottom-navigation/styled-components.js +96 -0
- package/esm/bottom-navigation/types.js +1 -0
- package/esm/breadcrumbs/breadcrumbs.js +6 -2
- package/esm/button/button-internals.js +13 -0
- package/esm/button/button.js +3 -8
- package/esm/button/styled-components.js +11 -6
- package/esm/button-dock/button-dock.js +53 -0
- package/esm/button-dock/index.js +9 -0
- package/esm/button-dock/styled-components.js +52 -0
- package/esm/button-dock/types.js +1 -0
- package/esm/button-docked/button-docked.js +53 -0
- package/esm/button-docked/index.js +9 -0
- package/esm/button-docked/styled-components.js +51 -0
- package/esm/button-docked/types.js +1 -0
- package/esm/button-group/button-group.js +5 -0
- package/esm/button-group/stateful-container.js +3 -0
- package/esm/button-timed/button-timed.js +113 -0
- package/esm/button-timed/index.js +11 -0
- package/esm/button-timed/styled-components.js +53 -0
- package/esm/button-timed/types.js +1 -0
- package/esm/button-timed/utils.js +21 -0
- package/esm/card/card.js +3 -2
- package/esm/checkbox/checkbox.js +36 -16
- package/esm/checkbox/styled-components.js +11 -5
- package/esm/combobox/combobox.js +20 -20
- package/esm/combobox/styled-components.js +3 -1
- package/esm/data-table/column-anchor.js +3 -1
- package/esm/data-table/column-boolean.js +4 -2
- package/esm/data-table/column-categorical.js +7 -3
- package/esm/data-table/column-datetime.js +22 -6
- package/esm/data-table/column-numerical.js +14 -7
- package/esm/data-table/column-row-index.js +2 -1
- package/esm/data-table/column-string.js +3 -1
- package/esm/data-table/column.js +2 -0
- package/esm/data-table/data-table.js +43 -23
- package/esm/data-table/filter-menu.js +16 -6
- package/esm/data-table/header-cell.js +2 -0
- package/esm/data-table/locale.js +3 -1
- package/esm/data-table/measure-column-widths.js +23 -22
- package/esm/data-table/stateful-container.js +52 -37
- package/esm/data-table/stateful-data-table.js +18 -10
- package/esm/data-table/text-search.js +1 -0
- package/esm/datepicker/calendar-header.js +63 -20
- package/esm/datepicker/calendar.js +92 -20
- package/esm/datepicker/datepicker.js +34 -12
- package/esm/datepicker/day.js +10 -3
- package/esm/datepicker/locale.js +1 -1
- package/esm/datepicker/month.js +14 -1
- package/esm/datepicker/stateful-container.js +3 -2
- package/esm/datepicker/styled-components.js +84 -49
- package/esm/datepicker/utils/date-helpers.js +3 -2
- package/esm/datepicker/utils/day-state.js +6 -2
- package/esm/datepicker/week.js +7 -3
- package/esm/dnd-list/list.js +2 -0
- package/esm/dnd-list/stateful-list-container.js +4 -2
- package/esm/dnd-list/styled-components.js +4 -2
- package/esm/drawer/styled-components.js +14 -11
- package/esm/file-uploader/file-uploader.js +97 -87
- package/esm/file-uploader/styled-components.js +5 -3
- package/esm/flex-grid/flex-grid-item.js +7 -2
- package/esm/flex-grid/flex-grid.js +2 -1
- package/esm/form-control/form-control.js +5 -2
- package/esm/helper/stateful-helper.js +1 -0
- package/esm/helper/styled-components.js +9 -5
- package/esm/helpers/overrides.js +1 -0
- package/esm/helpers/react-helpers.js +1 -1
- package/esm/helpers/responsive-helpers.js +54 -1
- package/esm/icon/alert.js +1 -0
- package/esm/icon/arrow-down.js +1 -0
- package/esm/icon/arrow-left.js +1 -0
- package/esm/icon/arrow-right.js +1 -0
- package/esm/icon/arrow-up.js +1 -0
- package/esm/icon/blank.js +1 -0
- package/esm/icon/calendar.js +66 -0
- package/esm/icon/check-indeterminate.js +1 -0
- package/esm/icon/check.js +1 -0
- package/esm/icon/chevron-down.js +1 -0
- package/esm/icon/chevron-left.js +1 -0
- package/esm/icon/chevron-right.js +1 -0
- package/esm/icon/chevron-up.js +1 -0
- package/esm/icon/delete-alt.js +1 -0
- package/esm/icon/delete.js +1 -0
- package/esm/icon/filter.js +1 -0
- package/esm/icon/grab.js +1 -0
- package/esm/icon/hide.js +1 -0
- package/esm/icon/icon-exports.js +1 -0
- package/esm/icon/icon.js +1 -0
- package/esm/icon/menu.js +1 -0
- package/esm/icon/omit-dollar-prefixed-keys.js +1 -0
- package/esm/icon/overflow.js +1 -0
- package/esm/icon/plus.js +1 -0
- package/esm/icon/search.js +1 -0
- package/esm/icon/show.js +1 -0
- package/esm/icon/spinner.js +1 -0
- package/esm/icon/styled-components.js +4 -0
- package/esm/icon/triangle-down.js +1 -0
- package/esm/icon/triangle-left.js +1 -0
- package/esm/icon/triangle-right.js +1 -0
- package/esm/icon/triangle-up.js +1 -0
- package/esm/icon/upload.js +1 -0
- package/esm/input/base-input.js +31 -15
- package/esm/input/input.js +10 -4
- package/esm/input/masked-input.js +2 -1
- package/esm/input/stateful-container.js +4 -1
- package/esm/input/styled-components.js +32 -8
- package/esm/input/utils.js +2 -0
- package/esm/layer/layer.js +6 -2
- package/esm/layer/tether.js +4 -1
- package/esm/layout-grid/grid.js +1 -0
- package/esm/layout-grid/index.js +2 -1
- package/esm/layout-grid/styled-components.js +6 -3
- package/esm/link/index.js +1 -0
- package/esm/list/list-heading.js +21 -22
- package/esm/list/list-item.js +5 -1
- package/esm/list/styled-components.js +17 -4
- package/esm/locale/es_AR.js +3 -1
- package/esm/locale/index.js +10 -4
- package/esm/locale/tr_TR.js +3 -1
- package/esm/map-marker/calculate-offsets.js +32 -0
- package/esm/map-marker/constants.js +84 -3
- package/esm/map-marker/floating-marker.js +3 -1
- package/esm/map-marker/floating-route-marker.js +118 -0
- package/esm/map-marker/index.js +3 -1
- package/esm/map-marker/location-puck.js +9 -5
- package/esm/map-marker/pin-head.js +46 -24
- package/esm/map-marker/styled-components.js +84 -15
- package/esm/menu/menu.js +12 -4
- package/esm/menu/nested-menus.js +9 -1
- package/esm/menu/option-list.js +8 -4
- package/esm/menu/option-profile.js +3 -3
- package/esm/menu/stateful-container.js +8 -3
- package/esm/menu/styled-components.js +5 -3
- package/esm/message-card/message-card.js +31 -30
- package/esm/message-card/styled-components.js +6 -1
- package/esm/mobile-header/constants.js +9 -0
- package/esm/mobile-header/index.js +9 -0
- package/esm/mobile-header/mobile-header.js +157 -0
- package/esm/mobile-header/styled-components.js +80 -0
- package/esm/mobile-header/types.js +1 -0
- package/esm/modal/modal-button.js +1 -0
- package/esm/modal/modal.js +25 -19
- package/esm/modal/styled-components.js +9 -2
- package/esm/page-control/constants.js +17 -0
- package/esm/page-control/index.js +9 -0
- package/esm/page-control/page-control.js +139 -0
- package/esm/page-control/styled-components.js +95 -0
- package/esm/page-control/types.js +1 -0
- package/esm/pagination/pagination.js +65 -59
- package/esm/payment-card/payment-card.js +6 -2
- package/esm/phone-input/base-country-picker.js +5 -2
- package/esm/phone-input/country-picker.js +4 -0
- package/esm/phone-input/country-select.js +1 -0
- package/esm/phone-input/default-props.js +4 -0
- package/esm/phone-input/flag.js +2 -1
- package/esm/phone-input/phone-input-lite.js +2 -0
- package/esm/phone-input/phone-input-next.js +2 -0
- package/esm/phone-input/stateful-phone-input-container.js +1 -0
- package/esm/pin-code/default-props.js +4 -0
- package/esm/pin-code/pin-code.js +4 -2
- package/esm/popover/popover.js +23 -6
- package/esm/popover/stateful-popover.js +1 -0
- package/esm/popover/utils.js +3 -1
- package/esm/progress-bar/progressbar-rounded.js +27 -28
- package/esm/progress-bar/progressbar.js +9 -3
- package/esm/progress-bar/styled-components.js +2 -0
- package/esm/progress-steps/progress-steps.js +1 -0
- package/esm/radio/radio.js +5 -2
- package/esm/radio/radiogroup.js +1 -0
- package/esm/radio/styled-components.js +11 -5
- package/esm/rating/emoticon-rating.js +16 -7
- package/esm/rating/star-rating.js +16 -7
- package/esm/rating/styled-components.js +2 -0
- package/esm/select/default-props.js +10 -0
- package/esm/select/dropdown.js +3 -1
- package/esm/select/multi-value.js +1 -0
- package/esm/select/select-component.js +59 -22
- package/esm/select/stateful-select-container.js +1 -0
- package/esm/select/styled-components.js +18 -7
- package/esm/select/utils/default-filter-options.js +3 -1
- package/esm/select/utils/index.js +3 -1
- package/esm/sheet/action-button.js +54 -0
- package/esm/sheet/index.js +9 -0
- package/esm/sheet/sheet.js +166 -0
- package/esm/sheet/styled-components.js +201 -0
- package/esm/sheet/types.js +1 -0
- package/esm/side-navigation/index.js +2 -1
- package/esm/side-navigation/nav-item.js +2 -1
- package/esm/side-navigation/nav.js +11 -4
- package/esm/side-navigation/side-navigation-next.js +359 -0
- package/esm/side-navigation/styled-components.js +4 -2
- package/esm/skeleton/skeleton.js +2 -0
- package/esm/skeleton/styled-components.js +1 -0
- package/esm/slider/slider.js +3 -1
- package/esm/snackbar/snackbar-context.js +27 -11
- package/esm/snackbar/snackbar-element.js +4 -1
- package/esm/snackbar/styled-components.js +1 -1
- package/esm/spinner/styled-components.js +2 -0
- package/esm/stepper/index.js +8 -0
- package/esm/stepper/stepper.js +145 -0
- package/esm/stepper/styled-components.js +20 -0
- package/esm/stepper/types.js +1 -0
- package/esm/styles/__mocks__/styled.js +9 -4
- package/esm/styles/as-primary-export-hoc.js +2 -0
- package/esm/styles/styled.js +2 -1
- package/esm/system-banner/index.js +8 -0
- package/esm/system-banner/styled-components.js +82 -0
- package/esm/system-banner/system-banner.js +93 -0
- package/esm/system-banner/types.js +1 -0
- package/esm/table/styled-components.js +1 -0
- package/esm/table/table.js +2 -0
- package/esm/table-semantic/styled-components.js +8 -8
- package/esm/table-semantic/table-builder.js +25 -22
- package/esm/table-semantic/table.js +2 -0
- package/esm/tabs/stateful-tabs.js +2 -2
- package/esm/tabs-motion/stateful-tabs.js +1 -0
- package/esm/tabs-motion/tab.js +1 -0
- package/esm/tabs-motion/tabs.js +26 -18
- package/esm/tag/styled-components.js +41 -2
- package/esm/tag/tag.js +2 -0
- package/esm/textarea/stateful-textarea.js +7 -3
- package/esm/textarea/textarea.js +4 -2
- package/esm/themes/dark-theme/color-component-tokens.js +2 -2
- package/esm/themes/dark-theme/color-semantic-tokens.js +12 -4
- package/esm/themes/light-theme/color-semantic-tokens.js +12 -4
- package/esm/timepicker/timepicker.js +11 -4
- package/esm/timezonepicker/timezone-picker.js +3 -1
- package/esm/toast/toast.js +10 -5
- package/esm/toast/toaster.js +21 -3
- package/esm/tree-view/tree-label-interactable.js +4 -2
- package/esm/tree-view/tree-view.js +5 -2
- package/esm/tree-view/utils.js +43 -15
- package/esm/utils/deep-merge.js +5 -0
- package/esm/utils/focusVisible.js +17 -7
- package/file-uploader/file-uploader.js +97 -87
- package/file-uploader/locale.d.ts +1 -1
- package/file-uploader/styled-components.js +5 -3
- package/file-uploader/styled-components.js.flow +1 -1
- package/file-uploader/types.d.ts +7 -30
- package/flex-grid/flex-grid-item.js +7 -2
- package/flex-grid/flex-grid.js +2 -1
- package/flex-grid/types.d.ts +2 -2
- package/form-control/form-control.js +5 -2
- package/form-control/types.d.ts +4 -4
- package/header-navigation/types.d.ts +4 -3
- package/header-navigation/types.js.flow +2 -0
- package/heading/types.d.ts +2 -2
- package/helper/index.d.ts +1 -1
- package/helper/stateful-helper.js +1 -0
- package/helper/styled-components.js +9 -5
- package/helper/types.d.ts +1 -1
- package/helpers/overrides.d.ts +7 -7
- package/helpers/overrides.js +1 -0
- package/helpers/react-helpers.d.ts +1 -1
- package/helpers/react-helpers.js +1 -1
- package/helpers/responsive-helpers.d.ts +5 -1
- package/helpers/responsive-helpers.js +62 -3
- package/helpers/responsive-helpers.js.flow +27 -1
- package/helpers/types.d.ts +9 -2
- package/helpers/types.js.flow +11 -0
- package/icon/alert.js +1 -0
- package/icon/arrow-down.js +1 -0
- package/icon/arrow-left.js +1 -0
- package/icon/arrow-right.js +1 -0
- package/icon/arrow-up.js +1 -0
- package/icon/blank.js +1 -0
- package/icon/calendar.d.ts +9 -0
- package/icon/calendar.js +78 -0
- package/icon/calendar.js.flow +47 -0
- package/icon/check-indeterminate.js +1 -0
- package/icon/check.js +1 -0
- package/icon/chevron-down.js +1 -0
- package/icon/chevron-left.js +1 -0
- package/icon/chevron-right.js +1 -0
- package/icon/chevron-up.js +1 -0
- package/icon/delete-alt.js +1 -0
- package/icon/delete.js +1 -0
- package/icon/filter.js +1 -0
- package/icon/grab.js +1 -0
- package/icon/hide.js +1 -0
- package/icon/icon-exports.d.ts +1 -0
- package/icon/icon-exports.js +8 -0
- package/icon/icon-exports.js.flow +1 -0
- package/icon/icon.js +1 -0
- package/icon/index.d.ts +1 -1
- package/icon/menu.js +1 -0
- package/icon/omit-dollar-prefixed-keys.js +1 -0
- package/icon/overflow.js +1 -0
- package/icon/plus.js +1 -0
- package/icon/search.js +1 -0
- package/icon/show.js +1 -0
- package/icon/spinner.js +1 -0
- package/icon/styled-components.js +4 -0
- package/icon/triangle-down.js +1 -0
- package/icon/triangle-left.js +1 -0
- package/icon/triangle-right.js +1 -0
- package/icon/triangle-up.js +1 -0
- package/icon/types.d.ts +5 -5
- package/icon/upload.js +1 -0
- package/index.d.ts +3 -3
- package/input/base-input.js +31 -15
- package/input/input.js +10 -4
- package/input/stateful-container.js +4 -1
- package/input/styled-components.js +32 -8
- package/input/types.d.ts +17 -17
- package/input/utils.js +2 -0
- package/layer/layer.js +6 -2
- package/layer/layers-manager.d.ts +8 -8
- package/layer/tether.d.ts +1 -1
- package/layer/tether.js +4 -1
- package/layer/tether.js.flow +1 -1
- package/layer/types.d.ts +22 -22
- package/layout-grid/grid.js +1 -0
- package/layout-grid/index.d.ts +1 -1
- package/layout-grid/index.js +2 -1
- package/layout-grid/index.js.flow +1 -0
- package/layout-grid/styled-components.js +6 -3
- package/layout-grid/types.d.ts +14 -14
- package/layout-grid/types.js.flow +7 -5
- package/link/index.d.ts +1 -1
- package/link/index.js +1 -0
- package/list/index.d.ts +11 -11
- package/list/list-heading.js +21 -22
- package/list/list-item.js +5 -1
- package/list/list-item.js.flow +5 -0
- package/list/styled-components.js +17 -4
- package/list/styled-components.js.flow +30 -14
- package/list/types.d.ts +15 -13
- package/list/types.js.flow +2 -0
- package/locale/es_AR.js +3 -1
- package/locale/index.d.ts +17 -14
- package/locale/index.js +9 -3
- package/locale/tr_TR.js +3 -1
- package/locale/types.d.ts +1 -1
- package/map-marker/calculate-offsets.d.ts +2 -0
- package/map-marker/calculate-offsets.js +36 -0
- package/map-marker/calculate-offsets.js.flow +47 -0
- package/map-marker/constants.d.ts +102 -0
- package/map-marker/constants.js +90 -4
- package/map-marker/constants.js.flow +67 -0
- package/map-marker/fixed-marker.js.flow +3 -127
- package/map-marker/floating-marker.d.ts +1 -1
- package/map-marker/floating-marker.js +3 -0
- package/map-marker/floating-marker.js.flow +1 -91
- package/map-marker/floating-route-marker.d.ts +4 -0
- package/map-marker/floating-route-marker.js +132 -0
- package/map-marker/floating-route-marker.js.flow +18 -0
- package/map-marker/index.d.ts +30 -24
- package/map-marker/index.js +26 -1
- package/map-marker/index.js.flow +4 -0
- package/map-marker/location-puck.js +9 -4
- package/map-marker/pin-head.d.ts +1 -1
- package/map-marker/pin-head.js +45 -23
- package/map-marker/pin-head.js.flow +1 -155
- package/map-marker/styled-components.d.ts +23 -2
- package/map-marker/styled-components.js +90 -16
- package/map-marker/styled-components.js.flow +45 -2
- package/map-marker/types.d.ts +62 -31
- package/map-marker/types.js.flow +37 -2
- package/menu/index.d.ts +8 -8
- package/menu/locale.d.ts +1 -1
- package/menu/maybe-child-menu.d.ts +3 -2
- package/menu/menu.js +12 -4
- package/menu/nested-menus.d.ts +2 -2
- package/menu/nested-menus.js +9 -1
- package/menu/option-list.js +8 -4
- package/menu/option-profile.js +3 -3
- package/menu/stateful-container.js +8 -3
- package/menu/styled-components.d.ts +1 -1
- package/menu/styled-components.js +5 -3
- package/menu/types.d.ts +31 -31
- package/message-card/message-card.js +30 -29
- package/message-card/styled-components.js +6 -1
- package/message-card/types.d.ts +1 -1
- package/mobile-header/constants.d.ts +4 -0
- package/mobile-header/constants.js +17 -0
- package/mobile-header/index.d.ts +4 -0
- package/mobile-header/index.js +60 -0
- package/mobile-header/index.js.flow +54 -0
- package/mobile-header/mobile-header.d.ts +4 -0
- package/mobile-header/mobile-header.js +173 -0
- package/mobile-header/package.json +4 -0
- package/mobile-header/styled-components.d.ts +12 -0
- package/mobile-header/styled-components.js +88 -0
- package/mobile-header/types.d.ts +26 -0
- package/mobile-header/types.js +5 -0
- package/modal/focus-once.d.ts +1 -1
- package/modal/locale.d.ts +1 -1
- package/modal/modal-button.d.ts +3 -3
- package/modal/modal-button.js +1 -0
- package/modal/modal.d.ts +4 -4
- package/modal/modal.js +24 -18
- package/modal/modal.js.flow +24 -18
- package/modal/styled-components.d.ts +1 -0
- package/modal/styled-components.js +11 -3
- package/modal/styled-components.js.flow +4 -0
- package/modal/types.d.ts +15 -10
- package/modal/types.js.flow +5 -0
- package/overrides.js.flow +16 -0
- package/package.json +11 -10
- package/page-control/constants.d.ts +12 -0
- package/page-control/constants.js +26 -0
- package/page-control/index.d.ts +4 -0
- package/page-control/index.js +55 -0
- package/page-control/index.js.flow +53 -0
- package/page-control/package.json +4 -0
- package/page-control/page-control.d.ts +4 -0
- package/page-control/page-control.js +151 -0
- package/page-control/styled-components.d.ts +11 -0
- package/page-control/styled-components.js +101 -0
- package/page-control/types.d.ts +19 -0
- package/page-control/types.js +5 -0
- package/pagination/index.d.ts +2 -2
- package/pagination/locale.d.ts +1 -1
- package/pagination/pagination.d.ts +1 -1
- package/pagination/pagination.js +62 -57
- package/pagination/types.d.ts +9 -9
- package/payment-card/payment-card.js +6 -2
- package/payment-card/types.d.ts +3 -3
- package/phone-input/base-country-picker.js +5 -2
- package/phone-input/country-picker.js +4 -0
- package/phone-input/country-select.js +1 -0
- package/phone-input/default-props.js +4 -0
- package/phone-input/flag.d.ts +2 -2
- package/phone-input/flag.js +2 -1
- package/phone-input/phone-input-lite.js +2 -0
- package/phone-input/phone-input-next.js +2 -0
- package/phone-input/stateful-phone-input-container.js +1 -0
- package/phone-input/styled-components.d.ts +2 -2
- package/phone-input/types.d.ts +15 -15
- package/pin-code/default-props.js +4 -0
- package/pin-code/index.d.ts +1 -1
- package/pin-code/pin-code.js +4 -2
- package/pin-code/types.d.ts +9 -9
- package/popover/popover.js +23 -6
- package/popover/popover.js.flow +3 -3
- package/popover/stateful-container.d.ts +1 -1
- package/popover/stateful-popover.js +1 -0
- package/popover/types.d.ts +27 -27
- package/popover/types.js.flow +5 -4
- package/popover/utils.js +3 -1
- package/progress-bar/progressbar-rounded.js +27 -28
- package/progress-bar/progressbar.js +9 -3
- package/progress-bar/styled-components.js +2 -0
- package/progress-bar/types.d.ts +6 -6
- package/progress-steps/progress-steps.js +1 -0
- package/progress-steps/types.d.ts +8 -8
- package/progress-steps/types.js.flow +1 -1
- package/radio/radio.js +5 -2
- package/radio/radiogroup.js +1 -0
- package/radio/styled-components.js +11 -5
- package/radio/types.d.ts +15 -15
- package/rating/emoticon-rating.js +16 -7
- package/rating/star-rating.js +16 -7
- package/rating/styled-components.js +2 -0
- package/rating/types.d.ts +6 -6
- package/select/default-props.js +10 -0
- package/select/dropdown.d.ts +2 -2
- package/select/dropdown.js +3 -1
- package/select/index.d.ts +2 -2
- package/select/locale.d.ts +1 -1
- package/select/multi-value.js +1 -0
- package/select/select-component.d.ts +2 -2
- package/select/select-component.js +59 -22
- package/select/stateful-select-container.js +1 -0
- package/select/styled-components.js +18 -6
- package/select/types.d.ts +22 -22
- package/select/utils/default-filter-options.d.ts +1 -1
- package/select/utils/default-filter-options.js +3 -1
- package/select/utils/index.js +3 -1
- package/sheet/action-button.d.ts +6 -0
- package/sheet/action-button.js +63 -0
- package/sheet/index.d.ts +3 -0
- package/sheet/index.js +46 -0
- package/sheet/index.js.flow +76 -0
- package/sheet/package.json +4 -0
- package/sheet/sheet.d.ts +4 -0
- package/sheet/sheet.js +182 -0
- package/sheet/styled-components.d.ts +27 -0
- package/sheet/styled-components.js +216 -0
- package/sheet/types.d.ts +37 -0
- package/sheet/types.js +5 -0
- package/side-navigation/index.d.ts +1 -0
- package/side-navigation/index.js +14 -0
- package/side-navigation/nav-item.d.ts +1 -1
- package/side-navigation/nav-item.js +2 -1
- package/side-navigation/nav.js +11 -4
- package/side-navigation/side-navigation-next.d.ts +66 -0
- package/side-navigation/side-navigation-next.js +381 -0
- package/side-navigation/styled-components.js +4 -2
- package/side-navigation/types.d.ts +12 -12
- package/skeleton/index.d.ts +1 -1
- package/skeleton/skeleton.js +2 -0
- package/skeleton/skeleton.js.flow +1 -1
- package/skeleton/styled-components.d.ts +1 -0
- package/skeleton/styled-components.js +1 -0
- package/skeleton/types.d.ts +3 -3
- package/skeleton/types.js.flow +1 -1
- package/slider/index.d.ts +1 -1
- package/slider/slider.js +3 -1
- package/slider/types.d.ts +9 -9
- package/snackbar/index.d.ts +5 -5
- package/snackbar/snackbar-context.d.ts +1 -1
- package/snackbar/snackbar-context.js +28 -11
- package/snackbar/snackbar-element.js +4 -1
- package/snackbar/styled-components.js +1 -1
- package/snackbar/types.d.ts +5 -5
- package/spinner/styled-components.js +2 -0
- package/spinner/types.d.ts +2 -2
- package/stepper/index.d.ts +3 -0
- package/stepper/index.js +46 -0
- package/stepper/index.js.flow +36 -0
- package/stepper/package.json +4 -0
- package/stepper/stepper.d.ts +4 -0
- package/stepper/stepper.js +162 -0
- package/stepper/styled-components.d.ts +1 -0
- package/stepper/styled-components.js +29 -0
- package/stepper/types.d.ts +17 -0
- package/stepper/types.js +5 -0
- package/styles/__mocks__/styled.js +9 -4
- package/styles/as-primary-export-hoc.js +2 -0
- package/styles/styled.d.ts +6 -6
- package/styles/styled.js +2 -0
- package/styles/theme-provider.d.ts +2 -2
- package/styles/types.d.ts +4 -3
- package/styles/types.js.flow +1 -0
- package/system-banner/index.d.ts +2 -0
- package/system-banner/index.js +30 -0
- package/system-banner/index.js.flow +51 -0
- package/system-banner/package.json +4 -0
- package/system-banner/styled-components.d.ts +16 -0
- package/system-banner/styled-components.js +90 -0
- package/system-banner/system-banner.d.ts +3 -0
- package/system-banner/system-banner.js +104 -0
- package/system-banner/types.d.ts +17 -0
- package/system-banner/types.js +5 -0
- package/table/styled-components.d.ts +2 -2
- package/table/styled-components.js +1 -0
- package/table/table.js +2 -0
- package/table/types.d.ts +6 -6
- package/table-semantic/styled-components.d.ts +5 -5
- package/table-semantic/styled-components.js +8 -8
- package/table-semantic/styled-components.js.flow +4 -5
- package/table-semantic/table-builder.js +24 -21
- package/table-semantic/table-builder.js.flow +21 -23
- package/table-semantic/table.js +2 -0
- package/table-semantic/types.d.ts +8 -8
- package/tabs/index.d.ts +1 -1
- package/tabs/stateful-tabs.d.ts +2 -2
- package/tabs/stateful-tabs.js +2 -2
- package/tabs/types.d.ts +14 -14
- package/tabs-motion/index.d.ts +3 -3
- package/tabs-motion/stateful-tabs.js +1 -0
- package/tabs-motion/tab.js +1 -0
- package/tabs-motion/tabs.js +26 -18
- package/tabs-motion/tabs.js.flow +3 -2
- package/tabs-motion/types.d.ts +13 -13
- package/tabs-motion/types.js.flow +1 -1
- package/tag/styled-components.js +41 -2
- package/tag/tag.js +2 -0
- package/tag/types.d.ts +6 -6
- package/textarea/stateful-textarea.js +7 -3
- package/textarea/textarea.js +4 -2
- package/textarea/types.d.ts +10 -10
- package/theme.js.flow +44 -0
- package/themes/dark-theme/color-component-tokens.js +2 -2
- package/themes/dark-theme/color-component-tokens.js.flow +2 -2
- package/themes/dark-theme/color-semantic-tokens.js +12 -4
- package/themes/dark-theme/color-semantic-tokens.js.flow +7 -4
- package/themes/index.d.ts +2 -2
- package/themes/light-theme/color-semantic-tokens.js +12 -4
- package/themes/light-theme/color-semantic-tokens.js.flow +7 -4
- package/themes/types.d.ts +32 -29
- package/themes/types.js.flow +7 -4
- package/timepicker/index.js.flow +1 -0
- package/timepicker/timepicker.js +11 -4
- package/timepicker/types.d.ts +4 -4
- package/timezonepicker/index.d.ts +1 -1
- package/timezonepicker/timezone-picker.js +3 -1
- package/timezonepicker/types.d.ts +4 -4
- package/toast/index.d.ts +1 -1
- package/toast/locale.d.ts +1 -1
- package/toast/toast.d.ts +3 -3
- package/toast/toast.js +10 -5
- package/toast/toaster.js +21 -3
- package/toast/types.d.ts +15 -15
- package/tokens/index.d.ts +1 -1
- package/tokens/types.d.ts +1 -1
- package/tooltip/types.d.ts +6 -6
- package/tree-view/index.d.ts +1 -1
- package/tree-view/stateful-container.d.ts +1 -1
- package/tree-view/tree-label-interactable.d.ts +3 -3
- package/tree-view/tree-label-interactable.js +4 -2
- package/tree-view/tree-label-interactable.js.flow +2 -0
- package/tree-view/tree-view.js +5 -2
- package/tree-view/types.d.ts +9 -9
- package/tree-view/utils.js +43 -15
- package/utils/deep-merge.js +5 -0
- package/utils/focusVisible.js +17 -7
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Copyright (c) Uber Technologies, Inc.
|
|
5
|
+
This source code is licensed under the MIT license found in the
|
|
6
|
+
LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { getOverrides } from '../helpers/overrides';
|
|
10
|
+
import { Button, KIND, SHAPE } from '../button';
|
|
11
|
+
import { StyledRoot, StyledNavContainer, StyledTitle, StyledActionButtonsContainer } from './styled-components';
|
|
12
|
+
import { TYPE } from './constants';
|
|
13
|
+
import { useStyletron } from '../styles/index';
|
|
14
|
+
|
|
15
|
+
const renderButtonContent = content => {
|
|
16
|
+
if (typeof content === 'string') {
|
|
17
|
+
return content;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const Icon = content;
|
|
21
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
22
|
+
size: 32
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const DefaultHeaderButton = ({
|
|
27
|
+
children,
|
|
28
|
+
type,
|
|
29
|
+
...restProps
|
|
30
|
+
}) => {
|
|
31
|
+
const [, theme] = useStyletron();
|
|
32
|
+
const isFloating = type === TYPE.floating;
|
|
33
|
+
const hasTextContent = typeof children === 'string';
|
|
34
|
+
const shouldHaveTrailingMargin = isFloating || !hasTextContent;
|
|
35
|
+
const trailingMargin = theme.direction === 'rtl' ? {
|
|
36
|
+
marginLeft: theme.sizing.scale300
|
|
37
|
+
} : {
|
|
38
|
+
marginRight: theme.sizing.scale300
|
|
39
|
+
};
|
|
40
|
+
const style = { ...(!hasTextContent ? {
|
|
41
|
+
height: '48px',
|
|
42
|
+
width: '48px',
|
|
43
|
+
paddingTop: 0,
|
|
44
|
+
paddingBottom: 0,
|
|
45
|
+
paddingLeft: 0,
|
|
46
|
+
paddingRight: 0
|
|
47
|
+
} : {}),
|
|
48
|
+
...(shouldHaveTrailingMargin ? trailingMargin : {}),
|
|
49
|
+
...(isFloating ? {
|
|
50
|
+
backgroundColor: theme.colors.backgroundPrimary
|
|
51
|
+
} : {})
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
54
|
+
kind: KIND.tertiary,
|
|
55
|
+
shape: SHAPE.pill,
|
|
56
|
+
overrides: {
|
|
57
|
+
BaseButton: {
|
|
58
|
+
style
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, restProps), children);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export function MobileHeader({
|
|
65
|
+
overrides = {},
|
|
66
|
+
title,
|
|
67
|
+
navButton,
|
|
68
|
+
actionButtons = [],
|
|
69
|
+
type = TYPE.fixed,
|
|
70
|
+
expanded = false
|
|
71
|
+
}) {
|
|
72
|
+
const [Root, rootProps] = getOverrides(overrides.Root, StyledRoot);
|
|
73
|
+
const [Title, titleProps] = getOverrides(overrides.Title, StyledTitle);
|
|
74
|
+
const [NavContainer, navContainerProps] = getOverrides(overrides.NavContainer, StyledNavContainer);
|
|
75
|
+
const [HeaderButton, iconButtonProps] = getOverrides(overrides.HeaderButton, DefaultHeaderButton);
|
|
76
|
+
const [ActionButtonsContainer, actionButtonsContainerProps] = getOverrides(overrides.ActionButtonsContainer, StyledActionButtonsContainer);
|
|
77
|
+
|
|
78
|
+
if (actionButtons.length > 2 && process.env.NODE_ENV !== "production") {
|
|
79
|
+
console.warn(`MobileHeader can only render two additional buttons. Received ${actionButtons.length}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return /*#__PURE__*/React.createElement(Root, _extends({}, rootProps, {
|
|
83
|
+
$type: type,
|
|
84
|
+
$expanded: expanded
|
|
85
|
+
}), /*#__PURE__*/React.createElement(NavContainer, _extends({
|
|
86
|
+
$type: type,
|
|
87
|
+
$hasTextContent: navButton && !Boolean(navButton.renderIcon)
|
|
88
|
+
}, navContainerProps), navButton && /*#__PURE__*/React.createElement(HeaderButton, _extends({
|
|
89
|
+
onClick: navButton.onClick,
|
|
90
|
+
type: type,
|
|
91
|
+
"aria-label": navButton.label
|
|
92
|
+
}, iconButtonProps), renderButtonContent(navButton.renderIcon || navButton.label))), type === TYPE.fixed && /*#__PURE__*/React.createElement(Title, _extends({
|
|
93
|
+
$type: type,
|
|
94
|
+
$expanded: expanded
|
|
95
|
+
}, titleProps), title), actionButtons.length > 0 && /*#__PURE__*/React.createElement(ActionButtonsContainer, actionButtonsContainerProps, actionButtons.map((button, idx) => {
|
|
96
|
+
const {
|
|
97
|
+
renderIcon,
|
|
98
|
+
onClick,
|
|
99
|
+
label
|
|
100
|
+
} = button;
|
|
101
|
+
return /*#__PURE__*/React.createElement(HeaderButton, _extends({
|
|
102
|
+
onClick: onClick,
|
|
103
|
+
"aria-label": label,
|
|
104
|
+
type: type
|
|
105
|
+
}, iconButtonProps, {
|
|
106
|
+
key: idx
|
|
107
|
+
}), renderButtonContent(renderIcon || label));
|
|
108
|
+
})));
|
|
109
|
+
}
|
|
110
|
+
export default MobileHeader;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) Uber Technologies, Inc.
|
|
3
|
+
This source code is licensed under the MIT license found in the
|
|
4
|
+
LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
import { styled } from '../styles';
|
|
7
|
+
import { TYPE } from './constants';
|
|
8
|
+
export const StyledRoot = styled('div', ({
|
|
9
|
+
$theme,
|
|
10
|
+
$type
|
|
11
|
+
}) => ({
|
|
12
|
+
width: '100%',
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gridTemplateColumns: 'auto 1fr auto',
|
|
15
|
+
gridTemplateRows: '48px',
|
|
16
|
+
...($type === TYPE.floating ? {
|
|
17
|
+
backgroundColor: 'transparent',
|
|
18
|
+
pointerEvents: 'none'
|
|
19
|
+
} : {
|
|
20
|
+
backgroundColor: $theme.colors.backgroundPrimary
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
23
|
+
StyledRoot.displayName = "StyledRoot";
|
|
24
|
+
StyledRoot.displayName = 'StyledRoot';
|
|
25
|
+
export const StyledNavContainer = styled('div', ({
|
|
26
|
+
$hasTextContent,
|
|
27
|
+
$type,
|
|
28
|
+
$theme
|
|
29
|
+
}) => {
|
|
30
|
+
const floatingPadding = $theme.direction === 'rtl' ? {
|
|
31
|
+
paddingRight: $theme.sizing.scale300
|
|
32
|
+
} : {
|
|
33
|
+
paddingLeft: $theme.sizing.scale300
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
pointerEvents: 'auto',
|
|
37
|
+
minWidth: '48px',
|
|
38
|
+
...($hasTextContent && $type === TYPE.fixed ? {} : floatingPadding)
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
StyledNavContainer.displayName = "StyledNavContainer";
|
|
42
|
+
StyledNavContainer.displayName = 'StyledNavContainer';
|
|
43
|
+
export const StyledActionButtonsContainer = styled('div', ({}) => ({
|
|
44
|
+
display: 'flex',
|
|
45
|
+
justifyContent: 'flex-end',
|
|
46
|
+
gridColumn: '3 / 4',
|
|
47
|
+
pointerEvents: 'auto'
|
|
48
|
+
}));
|
|
49
|
+
StyledActionButtonsContainer.displayName = "StyledActionButtonsContainer";
|
|
50
|
+
StyledActionButtonsContainer.displayName = 'StyledActionButtonsContainer';
|
|
51
|
+
export const StyledTitle = styled('div', ({
|
|
52
|
+
$theme,
|
|
53
|
+
$expanded = false
|
|
54
|
+
}) => ({
|
|
55
|
+
alignSelf: 'center',
|
|
56
|
+
justifyContent: 'flex-start',
|
|
57
|
+
...($expanded ? $theme.typography.DisplayXSmall : $theme.typography.LabelLarge),
|
|
58
|
+
...($expanded ? {
|
|
59
|
+
gridColumn: '1 / 4',
|
|
60
|
+
gridRow: 2,
|
|
61
|
+
paddingLeft: $theme.sizing.scale600
|
|
62
|
+
} : {}),
|
|
63
|
+
// truncate long titles
|
|
64
|
+
textOverflow: 'ellipsis',
|
|
65
|
+
whiteSpace: 'nowrap',
|
|
66
|
+
overflow: 'hidden'
|
|
67
|
+
}));
|
|
68
|
+
StyledTitle.displayName = "StyledTitle";
|
|
69
|
+
StyledTitle.displayName = 'StyledTitle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/modal/modal-button.js
CHANGED
package/es/modal/modal.js
CHANGED
|
@@ -16,7 +16,7 @@ import { LocaleContext } from '../locale';
|
|
|
16
16
|
import { getOverrides } from '../helpers/overrides';
|
|
17
17
|
import { Layer } from '../layer';
|
|
18
18
|
import { SIZE, ROLE, CLOSE_SOURCE } from './constants';
|
|
19
|
-
import { Root as StyledRoot, Dialog as StyledDialog, DialogContainer as StyledDialogContainer, Close as StyledClose } from './styled-components';
|
|
19
|
+
import { Root as StyledRoot, Dialog as StyledDialog, DialogContainer as StyledDialogContainer, Close as StyledClose, Hidden } from './styled-components';
|
|
20
20
|
import { CloseIcon } from './close-icon';
|
|
21
21
|
import { isFocusVisible, forkFocus, forkBlur } from '../utils/focusVisible';
|
|
22
22
|
|
|
@@ -197,10 +197,13 @@ class Modal extends React.Component {
|
|
|
197
197
|
closeable
|
|
198
198
|
} = this.props;
|
|
199
199
|
return {
|
|
200
|
+
// @ts-ignore
|
|
200
201
|
$animate: animate,
|
|
201
202
|
$isVisible: this.state.isVisible,
|
|
202
203
|
$isOpen: !!isOpen,
|
|
204
|
+
// @ts-ignore
|
|
203
205
|
$size: size,
|
|
206
|
+
// @ts-ignore
|
|
204
207
|
$role: role,
|
|
205
208
|
$closeable: !!closeable,
|
|
206
209
|
$isFocusVisible: this.state.isFocusVisible
|
|
@@ -228,7 +231,7 @@ class Modal extends React.Component {
|
|
|
228
231
|
return typeof children === 'function' ? children() : children;
|
|
229
232
|
}
|
|
230
233
|
|
|
231
|
-
renderModal() {
|
|
234
|
+
renderModal(renderedContent) {
|
|
232
235
|
const {
|
|
233
236
|
overrides = {},
|
|
234
237
|
closeable,
|
|
@@ -248,7 +251,6 @@ class Modal extends React.Component {
|
|
|
248
251
|
const [Dialog, dialogProps] = getOverrides(DialogOverride, StyledDialog);
|
|
249
252
|
const [Close, closeProps] = getOverrides(CloseOverride, StyledClose);
|
|
250
253
|
const sharedProps = this.getSharedProps();
|
|
251
|
-
const children = this.getChildren();
|
|
252
254
|
return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, locale => /*#__PURE__*/React.createElement(FocusLock, {
|
|
253
255
|
disabled: !focusLock // Allow focus to escape when UI is within an iframe
|
|
254
256
|
,
|
|
@@ -256,7 +258,8 @@ class Modal extends React.Component {
|
|
|
256
258
|
returnFocus: returnFocus,
|
|
257
259
|
autoFocus: autoFocus
|
|
258
260
|
}, /*#__PURE__*/React.createElement(Root, _extends({
|
|
259
|
-
"data-baseweb": "modal"
|
|
261
|
+
"data-baseweb": "modal" // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
262
|
+
,
|
|
260
263
|
ref: this.rootRef
|
|
261
264
|
}, sharedProps, rootProps), /*#__PURE__*/React.createElement(DialogContainer // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
262
265
|
, _extends({
|
|
@@ -266,7 +269,7 @@ class Modal extends React.Component {
|
|
|
266
269
|
"aria-modal": true,
|
|
267
270
|
"aria-label": "dialog",
|
|
268
271
|
role: role
|
|
269
|
-
}, sharedProps, dialogProps),
|
|
272
|
+
}, sharedProps, dialogProps), renderedContent, closeable ? /*#__PURE__*/React.createElement(Close, _extends({
|
|
270
273
|
"aria-label": locale.modal.close,
|
|
271
274
|
onClick: this.onCloseClick
|
|
272
275
|
}, sharedProps, closeProps, {
|
|
@@ -276,21 +279,23 @@ class Modal extends React.Component {
|
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
render() {
|
|
279
|
-
// Only render modal on the browser (portals aren't supported server-side)
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
282
|
+
// Only render an open and non-renderAll modal on the browser (portals aren't supported server-side)
|
|
283
|
+
const mountedAndOpen = this.state.mounted && (this.props.isOpen || this.state.isVisible);
|
|
284
|
+
const renderedContent = mountedAndOpen || this.props.renderAll ? this.getChildren() : null;
|
|
285
|
+
|
|
286
|
+
if (renderedContent) {
|
|
287
|
+
if (mountedAndOpen) {
|
|
288
|
+
return /*#__PURE__*/React.createElement(Layer, {
|
|
289
|
+
onEscape: this.onEscape,
|
|
290
|
+
onDocumentClick: this.onDocumentClick,
|
|
291
|
+
mountNode: this.props.mountNode
|
|
292
|
+
}, this.renderModal(renderedContent));
|
|
293
|
+
} else {
|
|
294
|
+
return /*#__PURE__*/React.createElement(Hidden, null, renderedContent);
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
286
297
|
return null;
|
|
287
298
|
}
|
|
288
|
-
|
|
289
|
-
return /*#__PURE__*/React.createElement(Layer, {
|
|
290
|
-
onEscape: this.onEscape,
|
|
291
|
-
onDocumentClick: this.onDocumentClick,
|
|
292
|
-
mountNode: this.props.mountNode
|
|
293
|
-
}, this.renderModal());
|
|
294
299
|
}
|
|
295
300
|
|
|
296
301
|
}
|
|
@@ -305,7 +310,8 @@ _defineProperty(Modal, "defaultProps", {
|
|
|
305
310
|
isOpen: false,
|
|
306
311
|
overrides: {},
|
|
307
312
|
role: ROLE.dialog,
|
|
308
|
-
size: SIZE.default
|
|
313
|
+
size: SIZE.default,
|
|
314
|
+
renderAll: false
|
|
309
315
|
});
|
|
310
316
|
|
|
311
317
|
export default Modal;
|
|
@@ -10,12 +10,14 @@ import { SIZE, SIZE_WIDTHS } from './constants';
|
|
|
10
10
|
function getSizeStyles($size) {
|
|
11
11
|
const styles = {
|
|
12
12
|
maxWidth: '100%',
|
|
13
|
+
// @ts-ignore
|
|
13
14
|
width: null
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
if (typeof $size === 'number') {
|
|
17
|
-
styles.width = `${$size}px`;
|
|
18
|
+
styles.width = `${$size}px`; // @ts-ignore
|
|
18
19
|
} else if (SIZE[$size]) {
|
|
20
|
+
// @ts-ignore
|
|
19
21
|
styles.width = SIZE_WIDTHS[$size];
|
|
20
22
|
} else if (typeof $size === 'string') {
|
|
21
23
|
styles.width = $size;
|
|
@@ -200,4 +202,9 @@ export const ModalFooter = styled('div', ({
|
|
|
200
202
|
textAlign: $theme.direction === 'rtl' ? 'left' : 'right'
|
|
201
203
|
}));
|
|
202
204
|
ModalFooter.displayName = "ModalFooter";
|
|
203
|
-
ModalFooter.displayName = 'ModalFooter';
|
|
205
|
+
ModalFooter.displayName = 'ModalFooter';
|
|
206
|
+
export const Hidden = styled('div', {
|
|
207
|
+
display: 'none'
|
|
208
|
+
});
|
|
209
|
+
Hidden.displayName = "Hidden";
|
|
210
|
+
Hidden.displayName = 'Hidden';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) Uber Technologies, Inc.
|
|
3
|
+
This source code is licensed under the MIT license found in the
|
|
4
|
+
LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
export const SIZE = Object.freeze({
|
|
7
|
+
large: 'large',
|
|
8
|
+
medium: 'medium',
|
|
9
|
+
small: 'small'
|
|
10
|
+
});
|
|
11
|
+
export const KIND = Object.freeze({
|
|
12
|
+
default: 'default',
|
|
13
|
+
backgroundProtection: 'backgroundProtection',
|
|
14
|
+
inverse: 'inverse',
|
|
15
|
+
alwaysLight: 'alwaysLight',
|
|
16
|
+
alwaysDark: 'alwaysDark'
|
|
17
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) Uber Technologies, Inc.
|
|
3
|
+
This source code is licensed under the MIT license found in the
|
|
4
|
+
LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
export { default as PageControl } from './page-control';
|
|
7
|
+
export * from './styled-components';
|
|
8
|
+
export { KIND } from './constants';
|
|
9
|
+
export * from './types';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Copyright (c) Uber Technologies, Inc.
|
|
5
|
+
|
|
6
|
+
This source code is licensed under the MIT license found in the
|
|
7
|
+
LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { getOverrides } from '../helpers/overrides';
|
|
11
|
+
import { StyledRoot, StyledDot } from './styled-components';
|
|
12
|
+
import { SIZE, KIND } from './constants';
|
|
13
|
+
const MAX_DOTS = 5;
|
|
14
|
+
|
|
15
|
+
const PageControl = ({
|
|
16
|
+
currentPage,
|
|
17
|
+
numPages,
|
|
18
|
+
onPageChange,
|
|
19
|
+
kind = KIND.default,
|
|
20
|
+
disabled = false,
|
|
21
|
+
'aria-label': ariaLabel,
|
|
22
|
+
overrides = {}
|
|
23
|
+
}) => {
|
|
24
|
+
const [Root, RootProps] = getOverrides(overrides.Root, StyledRoot);
|
|
25
|
+
const [Dot, DotProps] = getOverrides(overrides.Dot, StyledDot);
|
|
26
|
+
const isOverflow = numPages > MAX_DOTS;
|
|
27
|
+
|
|
28
|
+
function isActive(page) {
|
|
29
|
+
return page === currentPage;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function isVisible(page) {
|
|
33
|
+
if (!isOverflow) return true; // if current page is one of first three pages, first five page dots are visible
|
|
34
|
+
|
|
35
|
+
if (currentPage <= 3) {
|
|
36
|
+
return page <= 5;
|
|
37
|
+
} // if current page is one of last three pages, last five page dots are visible
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
if (numPages - currentPage < 3) {
|
|
41
|
+
return page > numPages - 5;
|
|
42
|
+
} // otherwise, page must be within 2 of the current page for dot to be visible
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
return page >= currentPage - 2 && page <= currentPage + 2;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getSize(page) {
|
|
49
|
+
if (!isOverflow) return SIZE.large;
|
|
50
|
+
|
|
51
|
+
if (currentPage <= 3) {
|
|
52
|
+
if (page <= 3) {
|
|
53
|
+
return SIZE.large;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (page === 4) {
|
|
57
|
+
return SIZE.medium;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return SIZE.small;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (numPages - currentPage < 3) {
|
|
64
|
+
if (page > numPages - 3) {
|
|
65
|
+
return SIZE.large;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (page === numPages - 3) {
|
|
69
|
+
return SIZE.medium;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return SIZE.small;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (page >= currentPage - 1 && page <= currentPage + 1) {
|
|
76
|
+
return SIZE.large;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (page === currentPage - 2 || page === currentPage + 2) {
|
|
80
|
+
return SIZE.medium;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return SIZE.small;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const name = React.useId();
|
|
87
|
+
return /*#__PURE__*/React.createElement(Root, _extends({
|
|
88
|
+
$kind: kind,
|
|
89
|
+
role: "radiogroup",
|
|
90
|
+
"aria-label": ariaLabel || 'page control'
|
|
91
|
+
}, RootProps), Array.from({
|
|
92
|
+
length: numPages
|
|
93
|
+
}, (_, i) => {
|
|
94
|
+
const page = i + 1;
|
|
95
|
+
return /*#__PURE__*/React.createElement(Dot, _extends({
|
|
96
|
+
$active: isActive(page),
|
|
97
|
+
$kind: kind,
|
|
98
|
+
$disabled: disabled,
|
|
99
|
+
$isVisible: isVisible(page),
|
|
100
|
+
$size: getSize(page),
|
|
101
|
+
checked: isActive(page),
|
|
102
|
+
key: page,
|
|
103
|
+
"aria-label": `page ${page}`,
|
|
104
|
+
name: name,
|
|
105
|
+
onChange: () => onPageChange({
|
|
106
|
+
nextPage: page
|
|
107
|
+
}),
|
|
108
|
+
tabIndex: isActive(page) ? 0 : -1,
|
|
109
|
+
type: "radio"
|
|
110
|
+
}, DotProps));
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default PageControl;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) Uber Technologies, Inc.
|
|
3
|
+
This source code is licensed under the MIT license found in the
|
|
4
|
+
LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
import { styled, hexToRgb } from '../styles';
|
|
7
|
+
import { SIZE, KIND } from './constants';
|
|
8
|
+
export const StyledRoot = styled('div', ({
|
|
9
|
+
$kind,
|
|
10
|
+
$theme
|
|
11
|
+
}) => ({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
gap: $theme.sizing.scale300,
|
|
15
|
+
width: 'fit-content',
|
|
16
|
+
paddingTop: $theme.sizing.scale100,
|
|
17
|
+
paddingRight: $theme.sizing.scale500,
|
|
18
|
+
paddingBottom: $theme.sizing.scale100,
|
|
19
|
+
paddingLeft: $theme.sizing.scale500,
|
|
20
|
+
borderRadius: $theme.borders.radius500,
|
|
21
|
+
backgroundColor: $kind === KIND.backgroundProtection ? $theme.colors.backgroundPrimary : 'transparent'
|
|
22
|
+
}));
|
|
23
|
+
StyledRoot.displayName = "StyledRoot";
|
|
24
|
+
StyledRoot.displayName = 'StyledRoot';
|
|
25
|
+
export const StyledDot = styled('input', ({
|
|
26
|
+
$active,
|
|
27
|
+
$kind,
|
|
28
|
+
$size,
|
|
29
|
+
$disabled,
|
|
30
|
+
$isVisible,
|
|
31
|
+
$theme
|
|
32
|
+
}) => {
|
|
33
|
+
const sizes = {
|
|
34
|
+
[SIZE.large]: {
|
|
35
|
+
height: $theme.sizing.scale300,
|
|
36
|
+
width: $theme.sizing.scale300
|
|
37
|
+
},
|
|
38
|
+
[SIZE.medium]: {
|
|
39
|
+
height: $theme.sizing.scale200,
|
|
40
|
+
width: $theme.sizing.scale200,
|
|
41
|
+
marginTop: '1px',
|
|
42
|
+
marginRight: '1px',
|
|
43
|
+
marginBottom: '1px',
|
|
44
|
+
marginLeft: '1px'
|
|
45
|
+
},
|
|
46
|
+
[SIZE.small]: {
|
|
47
|
+
height: $theme.sizing.scale100,
|
|
48
|
+
width: $theme.sizing.scale100,
|
|
49
|
+
marginTop: $theme.sizing.scale0,
|
|
50
|
+
marginRight: $theme.sizing.scale0,
|
|
51
|
+
marginBottom: $theme.sizing.scale0,
|
|
52
|
+
marginLeft: $theme.sizing.scale0
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const colors = {
|
|
56
|
+
[KIND.default]: {
|
|
57
|
+
active: $theme.colors.contentPrimary,
|
|
58
|
+
inactive: $theme.colors.backgroundTertiary
|
|
59
|
+
},
|
|
60
|
+
[KIND.backgroundProtection]: {
|
|
61
|
+
active: $theme.colors.contentPrimary,
|
|
62
|
+
inactive: $theme.colors.backgroundTertiary
|
|
63
|
+
},
|
|
64
|
+
[KIND.inverse]: {
|
|
65
|
+
active: $theme.colors.contentInversePrimary,
|
|
66
|
+
inactive: $theme.colors.backgroundInversePrimary
|
|
67
|
+
},
|
|
68
|
+
[KIND.alwaysLight]: {
|
|
69
|
+
active: $theme.colors.contentOnColorInverse,
|
|
70
|
+
inactive: hexToRgb($theme.colors.backgroundAlwaysDark, '0.12')
|
|
71
|
+
},
|
|
72
|
+
[KIND.alwaysDark]: {
|
|
73
|
+
active: $theme.colors.contentOnColor,
|
|
74
|
+
inactive: hexToRgb($theme.colors.backgroundAlwaysLight, '0.24')
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
// reset default input styles
|
|
79
|
+
appearance: 'none',
|
|
80
|
+
margin: 0,
|
|
81
|
+
// base web styles
|
|
82
|
+
...sizes[$size],
|
|
83
|
+
borderRadius: '50%',
|
|
84
|
+
backgroundColor: $disabled ? $theme.colors.contentStateDisabled : $active ? colors[$kind].active : colors[$kind].inactive,
|
|
85
|
+
...(!$isVisible ? {
|
|
86
|
+
// https://www.nomensa.com/blog/how-improve-web-accessibility-hiding-elements
|
|
87
|
+
border: 0,
|
|
88
|
+
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
89
|
+
height: '1px',
|
|
90
|
+
margin: '-1px',
|
|
91
|
+
overflow: 'hidden',
|
|
92
|
+
padding: 0,
|
|
93
|
+
position: 'absolute',
|
|
94
|
+
width: '1px'
|
|
95
|
+
} : {})
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
StyledDot.displayName = "StyledDot";
|
|
99
|
+
StyledDot.displayName = 'StyledDot';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|