@geotab/zenith 3.10.0 → 3.11.0-beta.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/README.md +29 -0
- package/dist/calendar/calendar.js +7 -4
- package/dist/card/components/title.js +4 -1
- package/dist/card/components/titleLink.js +5 -2
- package/dist/chart/barChart/getDefaultOptions.d.ts +2 -1
- package/dist/chart/barChart/getDefaultOptions.js +5 -2
- package/dist/chart/barChart.js +6 -4
- package/dist/chart/lineChart/getDefaultOptions.d.ts +2 -1
- package/dist/chart/lineChart/getDefaultOptions.js +5 -2
- package/dist/chart/lineChart.js +4 -2
- package/dist/checkboxListWithAction/checkboxListWithAction.js +4 -1
- package/dist/commonHelpers/arrowNavigation/components/arrowButton/arrowButton.js +4 -1
- package/dist/commonStyles/pillStyles/pillContent.less +13 -14
- package/dist/commonStyles/pillStyles/pillStyles.less +4 -5
- package/dist/commonStyles/pillStyles/pillTextContent.less +2 -2
- package/dist/commonStyles/typography/typography.less +579 -19
- package/dist/controlledPopup/controlledPopup.d.ts +1 -0
- package/dist/controlledPopup/controlledPopup.js +3 -1
- package/dist/dataGrid/cell/cell.d.ts +2 -1
- package/dist/dataGrid/cell/cell.js +2 -2
- package/dist/dataGrid/dataGrid.js +7 -4
- package/dist/dataGrid/listColumn.d.ts +2 -0
- package/dist/dataGrid/row/row.d.ts +2 -1
- package/dist/dataGrid/row/row.js +13 -9
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +2 -1
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +4 -0
- package/dist/dateRangeInner/dateRangeInner.js +5 -2
- package/dist/dateRangeRaw/dateRangeRaw.js +5 -2
- package/dist/dateRangeRaw/utils/parseLabel.js +1 -1
- package/dist/dropdownRaw/dropdownRaw.js +12 -6
- package/dist/fileUpload/components/dropZoneContent.js +100 -100
- package/dist/fileUpload/fileUpload.js +100 -100
- package/dist/filters/components/filtersSearchList.js +4 -1
- package/dist/filtersBar/filtersContainer/filtersContainer.js +62 -61
- package/dist/formStepperButtons/formStepperButtons.js +4 -1
- package/dist/groupsFilterRaw/groupsFilterAdjustmentState.js +4 -1
- package/dist/groupsFilterRaw/groupsFilterInitialState.js +4 -1
- package/dist/header/headerBack.js +4 -1
- package/dist/icons/iconAlignLeft.js +1 -3
- package/dist/icons/iconAlignmentLeft.js +1 -3
- package/dist/icons/iconAlignmentRight.js +1 -3
- package/dist/icons/iconArrowBottomLeft.js +1 -3
- package/dist/icons/iconArrowBottomRight.js +1 -3
- package/dist/icons/iconArrowLeftPath.js +1 -3
- package/dist/icons/iconArrowRight.js +1 -3
- package/dist/icons/iconArrowRightCircle.js +1 -3
- package/dist/icons/iconArrowRightPath.js +1 -3
- package/dist/icons/iconArrowTopLeft.js +1 -3
- package/dist/icons/iconArrowTopRight.js +1 -3
- package/dist/icons/iconChevronDoubleRight.js +1 -3
- package/dist/icons/iconChevronRight.js +1 -3
- package/dist/icons/iconChevronRightSmall.js +1 -3
- package/dist/icons/iconCornerDownLeft.js +1 -3
- package/dist/icons/iconCornerDownRight.js +1 -3
- package/dist/icons/iconCornerLeftDown.js +1 -3
- package/dist/icons/iconCornerLeftUp.js +1 -3
- package/dist/icons/iconCornerRightDown.js +1 -3
- package/dist/icons/iconCornerRightUp.js +1 -3
- package/dist/icons/iconCornerUpLeft.js +1 -3
- package/dist/icons/iconCornerUpRight.js +1 -3
- package/dist/index.css +3254 -2922
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/lineChartMini/lineChartMini.js +15 -3
- package/dist/list/itemData/itemDataInternal.js +4 -1
- package/dist/list/listItem/listItem.js +4 -1
- package/dist/menu/components/controlledMenuList/controlledMenuList.d.ts +27 -0
- package/dist/menu/components/controlledMenuList/controlledMenuList.js +126 -0
- package/dist/menu/components/createControlledMenuList.d.ts +37 -0
- package/dist/menu/components/createControlledMenuList.js +55 -0
- package/dist/menu/components/createMenuItem.d.ts +67 -0
- package/dist/menu/components/createMenuItem.js +97 -0
- package/dist/menu/components/menuButton.js +12 -3
- package/dist/menu/components/menuItem.d.ts +1 -2
- package/dist/menu/components/menuItem.js +20 -74
- package/dist/menu/contexts/usePathContext.d.ts +2 -0
- package/dist/menu/contexts/usePathContext.js +9 -0
- package/dist/menu/controlledMenu.js +8 -175
- package/dist/menu/utils/buildMenuContent.d.ts +2 -0
- package/dist/menu/utils/buildMenuContent.js +38 -0
- package/dist/menu/utils/findContent.d.ts +2 -2
- package/dist/menu/utils/findContent.js +4 -3
- package/dist/menu/utils/getItemLabel.d.ts +2 -0
- package/dist/menu/utils/getItemLabel.js +8 -0
- package/dist/menu/utils/getSafeRel.d.ts +1 -0
- package/dist/menu/utils/getSafeRel.js +14 -0
- package/dist/menu/utils/isMenuItem.d.ts +2 -0
- package/dist/menu/utils/isMenuItem.js +13 -0
- package/dist/menu/utils/isSafeHref.d.ts +1 -0
- package/dist/menu/utils/isSafeHref.js +10 -0
- package/dist/menu/utils/normalizeSeparators.d.ts +2 -0
- package/dist/menu/utils/normalizeSeparators.js +23 -0
- package/dist/menu/utils/resolveKeys.d.ts +12 -0
- package/dist/menu/utils/resolveKeys.js +22 -0
- package/dist/menu/utils/useLastValidSheet.d.ts +7 -0
- package/dist/menu/utils/useLastValidSheet.js +30 -0
- package/dist/menu/utils/useMenuItemCore.d.ts +31 -0
- package/dist/menu/utils/useMenuItemCore.js +54 -0
- package/dist/menu/utils/useMenuItemKeyboardNav.d.ts +2 -0
- package/dist/menu/utils/useMenuItemKeyboardNav.js +15 -0
- package/dist/menu/utils/useMenuListKeyboardNav.d.ts +12 -0
- package/dist/menu/utils/useMenuListKeyboardNav.js +77 -0
- package/dist/menu/utils/useMenuPath.d.ts +6 -0
- package/dist/menu/utils/useMenuPath.js +35 -0
- package/dist/nav/navItem/navItem.js +10 -5
- package/dist/nav/navSection/navSection.js +7 -5
- package/dist/pagination/paginationArrow.js +10 -3
- package/dist/radioGroupRaw/radioGroupRaw.js +2 -1
- package/dist/rangeRaw/rangeRaw.js +0 -1
- package/dist/selectList/selectList.helpers.d.ts +1 -1
- package/dist/selectList/selectList.helpers.js +29 -4
- package/dist/selectList/selectList.js +3 -1
- package/dist/selectList/selectList.reducer.js +1 -2
- package/dist/selectList/selectListItem.js +4 -1
- package/dist/sortControl/sortControl.js +59 -4
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/flexible/columnsList.js +4 -2
- package/dist/table/selectable/useSelectableRows.d.ts +8 -0
- package/dist/table/selectable/useSelectableRows.js +14 -6
- package/dist/table/table.js +1 -7
- package/dist/tabs/tabs.js +60 -58
- package/dist/tabs/tabsTestHelper.js +2 -2
- package/dist/timePickerRaw/timePickerRaw.js +1 -1
- package/dist/toggleButtonRaw/toggleButtonRaw.js +5 -2
- package/dist/utils/localization/translations/ar.json +3 -1
- package/dist/utils/localization/translations/cs.json +9 -5
- package/dist/utils/localization/translations/da-DK.json +9 -5
- package/dist/utils/localization/translations/de.json +9 -5
- package/dist/utils/localization/translations/en.json +5 -1
- package/dist/utils/localization/translations/es.json +9 -5
- package/dist/utils/localization/translations/fi-FI.json +9 -5
- package/dist/utils/localization/translations/fr-FR.json +9 -5
- package/dist/utils/localization/translations/fr.json +9 -5
- package/dist/utils/localization/translations/hu-HU.json +9 -5
- package/dist/utils/localization/translations/id.json +9 -5
- package/dist/utils/localization/translations/it.json +9 -5
- package/dist/utils/localization/translations/ja.json +9 -5
- package/dist/utils/localization/translations/ko-KR.json +9 -5
- package/dist/utils/localization/translations/ms.json +9 -5
- package/dist/utils/localization/translations/nb-NO.json +9 -5
- package/dist/utils/localization/translations/nl.json +9 -5
- package/dist/utils/localization/translations/pl.json +9 -5
- package/dist/utils/localization/translations/pt-BR.json +9 -5
- package/dist/utils/localization/translations/pt-PT.json +9 -5
- package/dist/utils/localization/translations/ro-RO.json +9 -5
- package/dist/utils/localization/translations/sk-SK.json +9 -5
- package/dist/utils/localization/translations/sv.json +9 -5
- package/dist/utils/localization/translations/th.json +9 -5
- package/dist/utils/localization/translations/tr.json +9 -5
- package/dist/utils/localization/translations/zh-Hans.json +9 -5
- package/dist/utils/localization/translations/zh-TW.json +9 -5
- package/dist/utils/localization/useDirectionalIcon.d.ts +3 -0
- package/dist/utils/localization/useDirectionalIcon.js +9 -0
- package/dist/utils/positioningUtils/alignments.d.ts +2 -2
- package/dist/utils/positioningUtils/alignments.js +2 -2
- package/dist/utils/positioningUtils/calculatePosition.js +4 -6
- package/esm/calendar/calendar.js +7 -4
- package/esm/card/components/title.js +4 -1
- package/esm/card/components/titleLink.js +5 -2
- package/esm/chart/barChart/getDefaultOptions.d.ts +2 -1
- package/esm/chart/barChart/getDefaultOptions.js +5 -2
- package/esm/chart/barChart.js +6 -4
- package/esm/chart/lineChart/getDefaultOptions.d.ts +2 -1
- package/esm/chart/lineChart/getDefaultOptions.js +5 -2
- package/esm/chart/lineChart.js +4 -2
- package/esm/checkboxListWithAction/checkboxListWithAction.js +4 -1
- package/esm/commonHelpers/arrowNavigation/components/arrowButton/arrowButton.js +4 -1
- package/esm/controlledPopup/controlledPopup.d.ts +1 -0
- package/esm/controlledPopup/controlledPopup.js +3 -1
- package/esm/dataGrid/cell/cell.d.ts +2 -1
- package/esm/dataGrid/cell/cell.js +2 -2
- package/esm/dataGrid/dataGrid.js +7 -4
- package/esm/dataGrid/listColumn.d.ts +2 -0
- package/esm/dataGrid/row/row.d.ts +2 -1
- package/esm/dataGrid/row/row.js +13 -9
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.js +2 -1
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +4 -0
- package/esm/dateRangeInner/dateRangeInner.js +5 -2
- package/esm/dateRangeRaw/dateRangeRaw.js +5 -2
- package/esm/dateRangeRaw/utils/parseLabel.js +1 -1
- package/esm/dropdownRaw/dropdownRaw.js +12 -6
- package/esm/fileUpload/components/dropZoneContent.js +100 -100
- package/esm/fileUpload/fileUpload.js +100 -100
- package/esm/filters/components/filtersSearchList.js +4 -1
- package/esm/filtersBar/filtersContainer/filtersContainer.js +62 -61
- package/esm/formStepperButtons/formStepperButtons.js +4 -1
- package/esm/groupsFilterRaw/groupsFilterAdjustmentState.js +4 -1
- package/esm/groupsFilterRaw/groupsFilterInitialState.js +4 -1
- package/esm/header/headerBack.js +4 -1
- package/esm/icons/iconAlignLeft.js +1 -3
- package/esm/icons/iconAlignmentLeft.js +1 -3
- package/esm/icons/iconAlignmentRight.js +1 -3
- package/esm/icons/iconArrowBottomLeft.js +1 -3
- package/esm/icons/iconArrowBottomRight.js +1 -3
- package/esm/icons/iconArrowLeftPath.js +1 -3
- package/esm/icons/iconArrowRight.js +1 -3
- package/esm/icons/iconArrowRightCircle.js +1 -3
- package/esm/icons/iconArrowRightPath.js +1 -3
- package/esm/icons/iconArrowTopLeft.js +1 -3
- package/esm/icons/iconArrowTopRight.js +1 -3
- package/esm/icons/iconChevronDoubleRight.js +1 -3
- package/esm/icons/iconChevronRight.js +1 -3
- package/esm/icons/iconChevronRightSmall.js +1 -3
- package/esm/icons/iconCornerDownLeft.js +1 -3
- package/esm/icons/iconCornerDownRight.js +1 -3
- package/esm/icons/iconCornerLeftDown.js +1 -3
- package/esm/icons/iconCornerLeftUp.js +1 -3
- package/esm/icons/iconCornerRightDown.js +1 -3
- package/esm/icons/iconCornerRightUp.js +1 -3
- package/esm/icons/iconCornerUpLeft.js +1 -3
- package/esm/icons/iconCornerUpRight.js +1 -3
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/lineChartMini/lineChartMini.js +15 -3
- package/esm/list/itemData/itemDataInternal.js +4 -1
- package/esm/list/listItem/listItem.js +4 -1
- package/esm/menu/components/controlledMenuList/controlledMenuList.d.ts +27 -0
- package/esm/menu/components/controlledMenuList/controlledMenuList.js +123 -0
- package/esm/menu/components/createControlledMenuList.d.ts +37 -0
- package/esm/menu/components/createControlledMenuList.js +51 -0
- package/esm/menu/components/createMenuItem.d.ts +67 -0
- package/esm/menu/components/createMenuItem.js +93 -0
- package/esm/menu/components/menuButton.js +12 -3
- package/esm/menu/components/menuItem.d.ts +1 -2
- package/esm/menu/components/menuItem.js +20 -74
- package/esm/menu/contexts/usePathContext.d.ts +2 -0
- package/esm/menu/contexts/usePathContext.js +5 -0
- package/esm/menu/controlledMenu.js +10 -177
- package/esm/menu/utils/buildMenuContent.d.ts +2 -0
- package/esm/menu/utils/buildMenuContent.js +34 -0
- package/esm/menu/utils/findContent.d.ts +2 -2
- package/esm/menu/utils/findContent.js +4 -3
- package/esm/menu/utils/getItemLabel.d.ts +2 -0
- package/esm/menu/utils/getItemLabel.js +4 -0
- package/esm/menu/utils/getSafeRel.d.ts +1 -0
- package/esm/menu/utils/getSafeRel.js +10 -0
- package/esm/menu/utils/isMenuItem.d.ts +2 -0
- package/esm/menu/utils/isMenuItem.js +9 -0
- package/esm/menu/utils/isSafeHref.d.ts +1 -0
- package/esm/menu/utils/isSafeHref.js +6 -0
- package/esm/menu/utils/normalizeSeparators.d.ts +2 -0
- package/esm/menu/utils/normalizeSeparators.js +19 -0
- package/esm/menu/utils/resolveKeys.d.ts +12 -0
- package/esm/menu/utils/resolveKeys.js +18 -0
- package/esm/menu/utils/useLastValidSheet.d.ts +7 -0
- package/esm/menu/utils/useLastValidSheet.js +26 -0
- package/esm/menu/utils/useMenuItemCore.d.ts +31 -0
- package/esm/menu/utils/useMenuItemCore.js +50 -0
- package/esm/menu/utils/useMenuItemKeyboardNav.d.ts +2 -0
- package/esm/menu/utils/useMenuItemKeyboardNav.js +11 -0
- package/esm/menu/utils/useMenuListKeyboardNav.d.ts +12 -0
- package/esm/menu/utils/useMenuListKeyboardNav.js +73 -0
- package/esm/menu/utils/useMenuPath.d.ts +6 -0
- package/esm/menu/utils/useMenuPath.js +31 -0
- package/esm/nav/navItem/navItem.js +10 -5
- package/esm/nav/navSection/navSection.js +7 -5
- package/esm/pagination/paginationArrow.js +10 -3
- package/esm/radioGroupRaw/radioGroupRaw.js +2 -1
- package/esm/rangeRaw/rangeRaw.js +0 -1
- package/esm/selectList/selectList.helpers.d.ts +1 -1
- package/esm/selectList/selectList.helpers.js +29 -4
- package/esm/selectList/selectList.js +3 -1
- package/esm/selectList/selectList.reducer.js +1 -2
- package/esm/selectList/selectListItem.js +4 -1
- package/esm/sortControl/sortControl.js +59 -4
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/flexible/columnsList.js +4 -2
- package/esm/table/selectable/useSelectableRows.d.ts +8 -0
- package/esm/table/selectable/useSelectableRows.js +14 -6
- package/esm/table/table.js +1 -7
- package/esm/tabs/tabs.js +60 -58
- package/esm/tabs/tabsTestHelper.js +2 -2
- package/esm/testHelpers/mockAbsoluteAlignment.d.ts +1 -0
- package/esm/testHelpers/mockAbsoluteAlignment.js +10 -0
- package/esm/timePickerRaw/timePickerRaw.js +1 -1
- package/esm/toggleButtonRaw/toggleButtonRaw.js +5 -2
- package/esm/utils/localization/translations/ar.json +3 -1
- package/esm/utils/localization/translations/cs.json +9 -5
- package/esm/utils/localization/translations/da-DK.json +9 -5
- package/esm/utils/localization/translations/de.json +9 -5
- package/esm/utils/localization/translations/en.json +5 -1
- package/esm/utils/localization/translations/es.json +9 -5
- package/esm/utils/localization/translations/fi-FI.json +9 -5
- package/esm/utils/localization/translations/fr-FR.json +9 -5
- package/esm/utils/localization/translations/fr.json +9 -5
- package/esm/utils/localization/translations/hu-HU.json +9 -5
- package/esm/utils/localization/translations/id.json +9 -5
- package/esm/utils/localization/translations/it.json +9 -5
- package/esm/utils/localization/translations/ja.json +9 -5
- package/esm/utils/localization/translations/ko-KR.json +9 -5
- package/esm/utils/localization/translations/ms.json +9 -5
- package/esm/utils/localization/translations/nb-NO.json +9 -5
- package/esm/utils/localization/translations/nl.json +9 -5
- package/esm/utils/localization/translations/pl.json +9 -5
- package/esm/utils/localization/translations/pt-BR.json +9 -5
- package/esm/utils/localization/translations/pt-PT.json +9 -5
- package/esm/utils/localization/translations/ro-RO.json +9 -5
- package/esm/utils/localization/translations/sk-SK.json +9 -5
- package/esm/utils/localization/translations/sv.json +9 -5
- package/esm/utils/localization/translations/th.json +9 -5
- package/esm/utils/localization/translations/tr.json +9 -5
- package/esm/utils/localization/translations/zh-Hans.json +9 -5
- package/esm/utils/localization/translations/zh-TW.json +9 -5
- package/esm/utils/localization/useDirectionalIcon.d.ts +3 -0
- package/esm/utils/localization/useDirectionalIcon.js +5 -0
- package/esm/utils/positioningUtils/alignments.d.ts +2 -2
- package/esm/utils/positioningUtils/alignments.js +2 -2
- package/esm/utils/positioningUtils/calculatePosition.js +4 -6
- package/package.json +123 -122
package/README.md
CHANGED
|
@@ -47,6 +47,35 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
47
47
|
|
|
48
48
|
## Change log
|
|
49
49
|
|
|
50
|
+
### 3.11.0
|
|
51
|
+
|
|
52
|
+
- Convert charts, summary, and analytics components to rem units
|
|
53
|
+
- Convert pills, chips, and badges to rem units
|
|
54
|
+
- Convert date, time, and calendar inputs to rem units
|
|
55
|
+
- Convert form structure and stepper components to rem units
|
|
56
|
+
- Convert modal, overlays, and popups to rem units
|
|
57
|
+
- Convert navigation and menus to rem units
|
|
58
|
+
- Convert filters, search, and column selector to rem units
|
|
59
|
+
- Fix prop in nested row
|
|
60
|
+
- Update typography CSS class names to avoid overlap with legacy classes
|
|
61
|
+
- Fix dialog content scroll issue
|
|
62
|
+
- Fix missing FileUploader drop zone translations in 25 locales
|
|
63
|
+
- Fix mobile view table content showing double line
|
|
64
|
+
- Fix calendar range showing incorrect edge
|
|
65
|
+
- Fix `Toggle` ScreenReader not announcing label on hover
|
|
66
|
+
- Fix `SideNav` nested `NavItem` keyboard navigation inside `NavSection`
|
|
67
|
+
- Fix `TimePicker` showing incorrect time
|
|
68
|
+
- Fix date range separator from hyphen to en dash
|
|
69
|
+
- Fix table column truncation with minWidth/maxWidth support
|
|
70
|
+
- Fix `SortControl` accessibility — remove redundant aria-label, add visually hidden sort direction text
|
|
71
|
+
- Fix RTL popup alignment across components
|
|
72
|
+
- Fix `RadioGroup` radio button misalignment for long option text
|
|
73
|
+
- Fix `Dropdown` loading state persisting when static dataItems and isLoading change simultaneously
|
|
74
|
+
- Restore `Select All` behavior for tables and cross-page selections
|
|
75
|
+
- Fix `Nav` content gap
|
|
76
|
+
- Fix keyboard accessibility in `SelectList` flexible columns popup — skip disabled items
|
|
77
|
+
- Fix RTL directional icons to use counterpart icons instead of CSS flip
|
|
78
|
+
|
|
50
79
|
### 3.10.0
|
|
51
80
|
|
|
52
81
|
- Add `wrap` and `vertical` props to `ListItem`
|
|
@@ -823,6 +823,7 @@ const dateUtils_1 = require("./dateUtils");
|
|
|
823
823
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
824
824
|
const iconChevronRightSmall_1 = require("../icons/iconChevronRightSmall");
|
|
825
825
|
const iconChevronLeftSmall_1 = require("../icons/iconChevronLeftSmall");
|
|
826
|
+
const useDirectionalIcon_1 = require("../utils/localization/useDirectionalIcon");
|
|
826
827
|
const parallelSelection_1 = require("../parallelSelection/parallelSelection");
|
|
827
828
|
const calendarUtils_1 = require("./calendarUtils");
|
|
828
829
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
@@ -853,6 +854,8 @@ const Calendar = ({
|
|
|
853
854
|
const {
|
|
854
855
|
translate
|
|
855
856
|
} = (0, useLanguage_1.useLanguage)();
|
|
857
|
+
const PrevMonthIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconChevronLeftSmall_1.IconChevronLeftSmall, iconChevronRightSmall_1.IconChevronRightSmall);
|
|
858
|
+
const NextMonthIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconChevronRightSmall_1.IconChevronRightSmall, iconChevronLeftSmall_1.IconChevronLeftSmall);
|
|
856
859
|
const fromDate = (0, react_1.useMemo)(() => value.from ? (0, dateUtils_1.toDayStart)(value.from) : undefined, [value.from]);
|
|
857
860
|
const toDate = (0, react_1.useMemo)(() => value.to ? (0, dateUtils_1.toDayStart)(value.to) : undefined, [value.to]);
|
|
858
861
|
const driveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-calendar");
|
|
@@ -1106,7 +1109,7 @@ const Calendar = ({
|
|
|
1106
1109
|
children: [isMobileView ? null : (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
|
|
1107
1110
|
className: "zen-calendar__btn",
|
|
1108
1111
|
type: "tertiary-black",
|
|
1109
|
-
icon:
|
|
1112
|
+
icon: PrevMonthIcon,
|
|
1110
1113
|
title: translate("Previous month"),
|
|
1111
1114
|
onClick: () => changeView((0, dateUtils_1.addMonth)(viewDate, -1)),
|
|
1112
1115
|
iconPosition: textIconButton_2.ButtonIconPosition.Start
|
|
@@ -1140,14 +1143,14 @@ const Calendar = ({
|
|
|
1140
1143
|
children: [(0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
|
|
1141
1144
|
className: "zen-calendar__btn",
|
|
1142
1145
|
type: "tertiary-black",
|
|
1143
|
-
icon:
|
|
1146
|
+
icon: PrevMonthIcon,
|
|
1144
1147
|
title: translate("Previous month"),
|
|
1145
1148
|
onClick: () => changeView((0, dateUtils_1.addMonth)(viewDate, -1)),
|
|
1146
1149
|
iconPosition: textIconButton_2.ButtonIconPosition.Start
|
|
1147
1150
|
}), (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
|
|
1148
1151
|
className: "zen-calendar__btn",
|
|
1149
1152
|
type: "tertiary-black",
|
|
1150
|
-
icon:
|
|
1153
|
+
icon: NextMonthIcon,
|
|
1151
1154
|
title: translate("Next month"),
|
|
1152
1155
|
onClick: () => changeView((0, dateUtils_1.addMonth)(viewDate, 1)),
|
|
1153
1156
|
iconPosition: textIconButton_2.ButtonIconPosition.Start
|
|
@@ -1155,7 +1158,7 @@ const Calendar = ({
|
|
|
1155
1158
|
}) : null, isMobileView ? null : (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
|
|
1156
1159
|
className: "zen-calendar__btn",
|
|
1157
1160
|
type: "tertiary-black",
|
|
1158
|
-
icon:
|
|
1161
|
+
icon: NextMonthIcon,
|
|
1159
1162
|
title: translate("Next month"),
|
|
1160
1163
|
onClick: () => changeView((0, dateUtils_1.addMonth)(viewDate, 1)),
|
|
1161
1164
|
iconPosition: textIconButton_2.ButtonIconPosition.Start
|
|
@@ -7,6 +7,8 @@ const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
|
7
7
|
const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
|
|
8
8
|
const useDrive_1 = require("../../utils/theme/useDrive");
|
|
9
9
|
const iconChevronRightSmall_1 = require("../../icons/iconChevronRightSmall");
|
|
10
|
+
const iconChevronLeftSmall_1 = require("../../icons/iconChevronLeftSmall");
|
|
11
|
+
const useDirectionalIcon_1 = require("../../utils/localization/useDirectionalIcon");
|
|
10
12
|
const VALID_HEADING_TAGS = new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
|
11
13
|
const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick, titleAs }) => {
|
|
12
14
|
const driveClassNames = (0, useDriveClassName_1.useDriveClassName)("zen-card-title");
|
|
@@ -14,7 +16,8 @@ const Title = ({ isMobile, link, target, title, id, icon, iconType, className =
|
|
|
14
16
|
const iconClassName = iconType ? `zen-card-title__icon--${iconType}` : "";
|
|
15
17
|
const iconSize = (0, react_1.useMemo)(() => (isDrive ? "huge" : "large"), [isDrive]);
|
|
16
18
|
const iconElement = (0, react_1.useMemo)(() => (icon ? (0, jsx_runtime_1.jsx)("span", { className: (0, classNames_1.classNames)(["zen-card-title__icon", iconClassName]), children: (0, react_1.createElement)(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
|
|
17
|
-
const
|
|
19
|
+
const ChevronIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconChevronRightSmall_1.IconChevronRightSmall, iconChevronLeftSmall_1.IconChevronLeftSmall);
|
|
20
|
+
const chevron = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)("span", { className: "zen-card-title__link-chevron", children: (0, jsx_runtime_1.jsx)(ChevronIcon, { size: iconSize, className: "zen-card-title__chevron-icon" }) })), [ChevronIcon, iconSize]);
|
|
18
21
|
const titleClasses = (0, classNames_1.classNames)(["zen-card-title", driveClassNames || "", onClick ? "zen-card-title__clickable" : ""]);
|
|
19
22
|
if (onClick) {
|
|
20
23
|
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: titleClasses, onClick: onClick, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: [title, chevron] })] }));
|
|
@@ -5,6 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
6
6
|
const textIconButton_1 = require("../../textIconButton/textIconButton");
|
|
7
7
|
const iconArrowRight_1 = require("../../icons/iconArrowRight");
|
|
8
|
+
const iconArrowLeft_1 = require("../../icons/iconArrowLeft");
|
|
9
|
+
const useDirectionalIcon_1 = require("../../utils/localization/useDirectionalIcon");
|
|
8
10
|
const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
|
|
9
11
|
const useMobile_1 = require("../../commonHelpers/hooks/useMobile");
|
|
10
12
|
const useDrive_1 = require("../../utils/theme/useDrive");
|
|
@@ -14,9 +16,10 @@ const TitleLink = ({ titleIconClasses, ariaLabel, children, link, id, className
|
|
|
14
16
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
15
17
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
16
18
|
const titleAriaLabel = ariaLabel || "";
|
|
19
|
+
const ArrowIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconArrowRight_1.IconArrowRight, iconArrowLeft_1.IconArrowLeft);
|
|
17
20
|
if (!isMobile) {
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: (0, classNames_1.classNames)(["zen-link", "zen-title-link", className]), href: link, "aria-label": titleAriaLabel, children: [(0, jsx_runtime_1.jsx)("span", { className: (0, classNames_1.classNames)(["zen-title-link__text", titleLinkTextDriveClasses || ""]), children: children }), (0, jsx_runtime_1.jsx)(
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: (0, classNames_1.classNames)(["zen-link", "zen-title-link", className]), href: link, "aria-label": titleAriaLabel, children: [(0, jsx_runtime_1.jsx)("span", { className: (0, classNames_1.classNames)(["zen-title-link__text", titleLinkTextDriveClasses || ""]), children: children }), (0, jsx_runtime_1.jsx)(ArrowIcon, { size: isDrive ? "huge" : "large", className: (0, classNames_1.classNames)(["zen-title-link__icon", titleIconClasses || ""]) })] }));
|
|
19
22
|
}
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, { type: "tertiary", iconClasses: titleIconClasses, id: id, "aria-label": titleAriaLabel, link: link, iconPosition: textIconButton_1.ButtonIconPosition.End, icon:
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, { type: "tertiary", iconClasses: titleIconClasses, id: id, "aria-label": titleAriaLabel, link: link, iconPosition: textIconButton_1.ButtonIconPosition.End, icon: ArrowIcon, iconSize: isDrive ? "huge" : "large", className: (0, classNames_1.classNames)(["zen-title-link", "zen-title-link__icon", titleLinkClasses || "", className || ""]), children: children && (0, jsx_runtime_1.jsx)("span", { className: (0, classNames_1.classNames)(["zen-title-link__text", titleLinkTextDriveClasses || ""]), children: children }) }));
|
|
21
24
|
};
|
|
22
25
|
exports.TitleLink = TitleLink;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IYAxisMeta } from "../interfaces";
|
|
2
|
-
export declare const getDefaultOptions: (yAxis: IYAxisMeta[], isTimedData: boolean, isDark: boolean, translate: (s: string) => string) => {
|
|
2
|
+
export declare const getDefaultOptions: (yAxis: IYAxisMeta[], isTimedData: boolean, isDark: boolean, translate: (s: string) => string, isRtl?: boolean) => {
|
|
3
3
|
responsive: boolean;
|
|
4
4
|
maintainAspectRatio: boolean;
|
|
5
5
|
scales: {
|
|
@@ -10,6 +10,7 @@ export declare const getDefaultOptions: (yAxis: IYAxisMeta[], isTimedData: boole
|
|
|
10
10
|
grid: {
|
|
11
11
|
display: boolean;
|
|
12
12
|
};
|
|
13
|
+
reverse: boolean;
|
|
13
14
|
type: string;
|
|
14
15
|
ticks: {
|
|
15
16
|
source: string;
|
|
@@ -10,8 +10,10 @@ const defaultGridBorderStyle = {
|
|
|
10
10
|
display: false,
|
|
11
11
|
dash: [2, 2]
|
|
12
12
|
};
|
|
13
|
-
const getDefaultOptions = (yAxis, isTimedData, isDark, translate) => {
|
|
13
|
+
const getDefaultOptions = (yAxis, isTimedData, isDark, translate, isRtl = false) => {
|
|
14
14
|
const textColor = isDark ? "#C0CCD8" : "#4E677E";
|
|
15
|
+
const primaryYPosition = isRtl ? "right" : "left";
|
|
16
|
+
const secondaryYPosition = isRtl ? "left" : "right";
|
|
15
17
|
const scales = {
|
|
16
18
|
x: {
|
|
17
19
|
title: {
|
|
@@ -20,6 +22,7 @@ const getDefaultOptions = (yAxis, isTimedData, isDark, translate) => {
|
|
|
20
22
|
grid: {
|
|
21
23
|
display: false
|
|
22
24
|
},
|
|
25
|
+
reverse: isRtl,
|
|
23
26
|
type: isTimedData ? "time" : "category",
|
|
24
27
|
ticks: isTimedData
|
|
25
28
|
? {
|
|
@@ -57,7 +60,7 @@ const getDefaultOptions = (yAxis, isTimedData, isDark, translate) => {
|
|
|
57
60
|
border: defaultGridBorderStyle,
|
|
58
61
|
min: yAxis[i].min,
|
|
59
62
|
max: yAxis[i].max,
|
|
60
|
-
position: i === 0 ?
|
|
63
|
+
position: i === 0 ? primaryYPosition : secondaryYPosition
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
66
|
return {
|
package/dist/chart/barChart.js
CHANGED
|
@@ -25,6 +25,7 @@ const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
|
25
25
|
const legendPlugin_1 = require("./plugins/legend/legendPlugin");
|
|
26
26
|
const chartAxis_1 = require("./chartAxis/chartAxis");
|
|
27
27
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
28
|
+
const useIsRTL_1 = require("../utils/localization/useIsRTL");
|
|
28
29
|
const isDateRange_1 = require("./utils/isDateRange");
|
|
29
30
|
const getYAxisMeta_1 = require("./utils/getYAxisMeta");
|
|
30
31
|
const getDefaultOptions_1 = require("./barChart/getDefaultOptions");
|
|
@@ -44,6 +45,7 @@ const BarChart = (_a) => {
|
|
|
44
45
|
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
45
46
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
46
47
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
48
|
+
const isRtl = (0, useIsRTL_1.useIsRTL)();
|
|
47
49
|
const fontSize = (0, react_1.useMemo)(() => (isDrive ? (isMobile ? 14 : 16) : 12), [isDrive, isMobile]);
|
|
48
50
|
const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
|
|
49
51
|
(0, react_1.useEffect)(() => {
|
|
@@ -59,15 +61,15 @@ const BarChart = (_a) => {
|
|
|
59
61
|
const isTimedData = (0, react_1.useMemo)(() => (0, isDateRange_1.isDateRange)(data, false), [data]);
|
|
60
62
|
const isStacked = (0, react_1.useMemo)(() => { var _a, _b; return ((_b = (_a = options.scales) === null || _a === void 0 ? void 0 : _a.y) === null || _b === void 0 ? void 0 : _b.stacked) === true; }, [options]);
|
|
61
63
|
const yAxisMeta = (0, react_1.useMemo)(() => (0, getYAxisMeta_1.getYAxisMeta)(data, isStacked), [data, isStacked]);
|
|
62
|
-
const defOptions = (0, react_1.useMemo)(() => (0, getDefaultOptions_1.getDefaultOptions)(yAxisMeta, isTimedData, dark, translate), [yAxisMeta, isTimedData, dark, translate]);
|
|
64
|
+
const defOptions = (0, react_1.useMemo)(() => (0, getDefaultOptions_1.getDefaultOptions)(yAxisMeta, isTimedData, dark, translate, isRtl), [yAxisMeta, isTimedData, dark, translate, isRtl]);
|
|
63
65
|
const chartOptions = (0, utils_1.deepMerge)(defOptions, options);
|
|
64
66
|
const { isHidden, toggleHidden } = (0, useHidden_1.useHidden)();
|
|
65
67
|
const chartData = (0, react_1.useMemo)(() => {
|
|
66
68
|
const chData = (0, convertDates_1.convertDates)(data, toLocalDateTime);
|
|
67
69
|
chData.datasets = chData.datasets.map((ds, i) => (0, getDefaultDatasetStyle_1.getDefaultDatasetStyle)(ds, i));
|
|
68
|
-
chData.datasets = chData.datasets.map((ds, i) => (Object.assign(Object.assign({}, ds), { hidden: isHidden(i) })));
|
|
70
|
+
chData.datasets = chData.datasets.map((ds, i) => (Object.assign(Object.assign({}, ds), { hidden: isHidden(i), order: isRtl ? chData.datasets.length - 1 - i : i })));
|
|
69
71
|
return chData;
|
|
70
|
-
}, [data, isHidden, toLocalDateTime]);
|
|
72
|
+
}, [data, isHidden, toLocalDateTime, isRtl]);
|
|
71
73
|
const chartTooltip = (0, react_1.useMemo)(() => (0, tooltipPlugin_1.TooltipPlugin)(tooltipId, tooltip, "top", isHidden, dark), [tooltipId, tooltip, isHidden, dark]);
|
|
72
74
|
const chartLegend = (0, react_1.useMemo)(() => (0, legendPlugin_1.legendPlugin)(legendId, legend, isDrive, isHidden, toggleHidden), [isDrive, isHidden, legend, legendId, toggleHidden]);
|
|
73
75
|
const chartPlugins = (0, react_1.useMemo)(() => [...(plugins || []), chartTooltip, chartLegend], [chartLegend, chartTooltip, plugins]);
|
|
@@ -75,6 +77,6 @@ const BarChart = (_a) => {
|
|
|
75
77
|
const intSummary = (0, useSummary_1.useSummary)(summary, chartData);
|
|
76
78
|
const isMainHidden = (0, react_1.useMemo)(() => isHidden(0), [isHidden]);
|
|
77
79
|
const toggleMainData = (0, react_1.useCallback)(() => toggleHidden(0), [toggleHidden]);
|
|
78
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-chart", className || ""]), children: [insight ? (0, jsx_runtime_1.jsx)(chartInsight_1.ChartInsight, Object.assign({}, insight)) : null, summary ? (0, jsx_runtime_1.jsx)(summary_1.Summary, Object.assign({ onToggle: toggleMainData, isEnabled: isMainHidden }, intSummary)) : null, (isDrive ? undefined : xLabels) || yLabels.length > 0 ? ((0, jsx_runtime_1.jsx)(chartAxis_1.ChartAxis, { xLabel: isDrive ? undefined : xLabels, yLabels: yLabels, yAxisPosition: "right" })) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__chart", children: (0, jsx_runtime_1.jsx)(typedCharts_1.Bar, Object.assign({ options: chartOptions, data: chartData, plugins: chartPlugins }, rest, { "aria-hidden": true })) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__legend", id: legendId }), isDrive && xLabels ? (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__x-axis", children: xLabels }) : null, (0, jsx_runtime_1.jsx)(accessibleChart_1.AccessibleChart, { type: "bar", data: chartData, options: chartOptions })] }));
|
|
80
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-chart", className || ""]), children: [insight ? (0, jsx_runtime_1.jsx)(chartInsight_1.ChartInsight, Object.assign({}, insight)) : null, summary ? (0, jsx_runtime_1.jsx)(summary_1.Summary, Object.assign({ onToggle: toggleMainData, isEnabled: isMainHidden }, intSummary)) : null, (isDrive ? undefined : xLabels) || yLabels.length > 0 ? ((0, jsx_runtime_1.jsx)(chartAxis_1.ChartAxis, { xLabel: isDrive ? undefined : xLabels, yLabels: yLabels, yAxisPosition: isRtl ? "left" : "right" })) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__chart", children: (0, jsx_runtime_1.jsx)(typedCharts_1.Bar, Object.assign({ options: chartOptions, data: chartData, plugins: chartPlugins }, rest, { "aria-hidden": true })) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__legend", id: legendId }), isDrive && xLabels ? (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__x-axis", children: xLabels }) : null, (0, jsx_runtime_1.jsx)(accessibleChart_1.AccessibleChart, { type: "bar", data: chartData, options: chartOptions })] }));
|
|
79
81
|
};
|
|
80
82
|
exports.BarChart = BarChart;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IXAxisMeta, IYAxisMeta } from "../interfaces";
|
|
2
|
-
export declare const getDefaultOptions: (yAxis: IYAxisMeta[], xAxis: IXAxisMeta, isTimedData: boolean, ticks: number, isDark: boolean, translate: (s: string) => string) => {
|
|
2
|
+
export declare const getDefaultOptions: (yAxis: IYAxisMeta[], xAxis: IXAxisMeta, isTimedData: boolean, ticks: number, isDark: boolean, translate: (s: string) => string, isRtl?: boolean) => {
|
|
3
3
|
responsive: boolean;
|
|
4
4
|
maintainAspectRatio: boolean;
|
|
5
5
|
scales: {
|
|
@@ -10,6 +10,7 @@ export declare const getDefaultOptions: (yAxis: IYAxisMeta[], xAxis: IXAxisMeta,
|
|
|
10
10
|
grid: {
|
|
11
11
|
display: boolean;
|
|
12
12
|
};
|
|
13
|
+
reverse: boolean;
|
|
13
14
|
type: string;
|
|
14
15
|
time: {
|
|
15
16
|
unit: string;
|
|
@@ -47,9 +47,11 @@ const getFormatFromDateRange = (minDate, maxDate, ticks) => {
|
|
|
47
47
|
}
|
|
48
48
|
return { unit: "millisecond", format: "HH:mm:ss.l" };
|
|
49
49
|
};
|
|
50
|
-
const getDefaultOptions = (yAxis, xAxis, isTimedData, ticks, isDark, translate) => {
|
|
50
|
+
const getDefaultOptions = (yAxis, xAxis, isTimedData, ticks, isDark, translate, isRtl = false) => {
|
|
51
51
|
const time = getFormatFromDateRange(xAxis.minDate, xAxis.maxDate, ticks);
|
|
52
52
|
const textColor = isDark ? "#C0CCD8" : "#4E677E";
|
|
53
|
+
const primaryYPosition = isRtl ? "right" : "left";
|
|
54
|
+
const secondaryYPosition = isRtl ? "left" : "right";
|
|
53
55
|
const scales = {
|
|
54
56
|
x: {
|
|
55
57
|
title: {
|
|
@@ -58,6 +60,7 @@ const getDefaultOptions = (yAxis, xAxis, isTimedData, ticks, isDark, translate)
|
|
|
58
60
|
grid: {
|
|
59
61
|
display: false
|
|
60
62
|
},
|
|
63
|
+
reverse: isRtl,
|
|
61
64
|
type: isTimedData ? "time" : "linear",
|
|
62
65
|
time: isTimedData
|
|
63
66
|
? {
|
|
@@ -104,7 +107,7 @@ const getDefaultOptions = (yAxis, xAxis, isTimedData, ticks, isDark, translate)
|
|
|
104
107
|
border: defaultGridBorderStyle,
|
|
105
108
|
min: yAxis[i].min,
|
|
106
109
|
max: yAxis[i].max,
|
|
107
|
-
position: i === 0 ?
|
|
110
|
+
position: i === 0 ? primaryYPosition : secondaryYPosition
|
|
108
111
|
};
|
|
109
112
|
}
|
|
110
113
|
return {
|
package/dist/chart/lineChart.js
CHANGED
|
@@ -34,6 +34,7 @@ const getDefaultOptions_1 = require("./lineChart/getDefaultOptions");
|
|
|
34
34
|
const useHidden_1 = require("./utils/useHidden");
|
|
35
35
|
const linePlugin_1 = require("./plugins/linePlugin/linePlugin");
|
|
36
36
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
37
|
+
const useIsRTL_1 = require("../utils/localization/useIsRTL");
|
|
37
38
|
const useChartTicks_1 = require("./lineChart/useChartTicks");
|
|
38
39
|
const chartInsight_1 = require("./chartInsight/chartInsight");
|
|
39
40
|
const getXAxisMeta_1 = require("./utils/getXAxisMeta");
|
|
@@ -46,6 +47,7 @@ const LineChart = (_a) => {
|
|
|
46
47
|
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
47
48
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
48
49
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
50
|
+
const isRtl = (0, useIsRTL_1.useIsRTL)();
|
|
49
51
|
const fontSize = (0, react_1.useMemo)(() => (isDrive ? (isMobile ? 14 : 16) : 12), [isDrive, isMobile]);
|
|
50
52
|
const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
|
|
51
53
|
(0, react_1.useEffect)(() => {
|
|
@@ -76,7 +78,7 @@ const LineChart = (_a) => {
|
|
|
76
78
|
const yAxisMeta = (0, react_1.useMemo)(() => (0, getYAxisMeta_1.getYAxisMeta)(chartData), [chartData]);
|
|
77
79
|
const xAxisMeta = (0, react_1.useMemo)(() => (0, getXAxisMeta_1.getXAxisMeta)(chartData, isTimedData), [chartData, isTimedData]);
|
|
78
80
|
const { chartRef, ticks } = (0, useChartTicks_1.useChartTicks)();
|
|
79
|
-
const defOptions = (0, react_1.useMemo)(() => (0, getDefaultOptions_1.getDefaultOptions)(yAxisMeta, xAxisMeta, isTimedData, ticks, dark, translate), [yAxisMeta, xAxisMeta, isTimedData, ticks, dark, translate]);
|
|
81
|
+
const defOptions = (0, react_1.useMemo)(() => (0, getDefaultOptions_1.getDefaultOptions)(yAxisMeta, xAxisMeta, isTimedData, ticks, dark, translate, isRtl), [yAxisMeta, xAxisMeta, isTimedData, ticks, dark, translate, isRtl]);
|
|
80
82
|
const chartOptions = (0, utils_1.deepMerge)(defOptions, options);
|
|
81
83
|
const chartTooltip = (0, react_1.useMemo)(() => (0, linePlugin_1.LinePlugin)(tooltipId, tooltip, dark), [tooltip, tooltipId, dark]);
|
|
82
84
|
const chartLegend = (0, react_1.useMemo)(() => (0, legendPlugin_1.legendPlugin)(legendId, legend, isDrive, isHidden, toggleHidden), [isDrive, legend, legendId, isHidden, toggleHidden]);
|
|
@@ -85,6 +87,6 @@ const LineChart = (_a) => {
|
|
|
85
87
|
const intSummary = (0, useSummary_1.useSummary)(summary, chartData);
|
|
86
88
|
const isMainHidden = (0, react_1.useMemo)(() => isHidden(0), [isHidden]);
|
|
87
89
|
const toggleMainDataset = (0, react_1.useCallback)(() => toggleHidden(0), [toggleHidden]);
|
|
88
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-chart", className || ""]), ref: chartRef, children: [insight ? (0, jsx_runtime_1.jsx)(chartInsight_1.ChartInsight, Object.assign({}, insight)) : null, summary !== false ? (0, jsx_runtime_1.jsx)(summary_1.Summary, Object.assign({}, intSummary, { onToggle: toggleMainDataset, isEnabled: isMainHidden })) : null, (isDrive ? undefined : xLabels) || yLabels.length > 0 ? (0, jsx_runtime_1.jsx)(chartAxis_1.ChartAxis, { xLabel: isDrive ? undefined : xLabels, yLabels: yLabels }) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__chart", children: (0, jsx_runtime_1.jsx)(typedCharts_1.Line, Object.assign({ width: 100, height: 100, options: chartOptions, data: chartData, plugins: chartPlugins, "aria-hidden": true }, rest)) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__legend", id: legendId }), isDrive && xLabels ? (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__x-axis", children: xLabels }) : null, (0, jsx_runtime_1.jsx)(accessibleChart_1.AccessibleChart, { type: "line", data: chartData, options: chartOptions })] }));
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-chart", className || ""]), ref: chartRef, children: [insight ? (0, jsx_runtime_1.jsx)(chartInsight_1.ChartInsight, Object.assign({}, insight)) : null, summary !== false ? (0, jsx_runtime_1.jsx)(summary_1.Summary, Object.assign({}, intSummary, { onToggle: toggleMainDataset, isEnabled: isMainHidden })) : null, (isDrive ? undefined : xLabels) || yLabels.length > 0 ? ((0, jsx_runtime_1.jsx)(chartAxis_1.ChartAxis, { xLabel: isDrive ? undefined : xLabels, yLabels: yLabels, yAxisPosition: isRtl ? "left" : "right" })) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__chart", children: (0, jsx_runtime_1.jsx)(typedCharts_1.Line, Object.assign({ width: 100, height: 100, options: chartOptions, data: chartData, plugins: chartPlugins, "aria-hidden": true }, rest)) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__legend", id: legendId }), isDrive && xLabels ? (0, jsx_runtime_1.jsx)("div", { className: "zen-chart__x-axis", children: xLabels }) : null, (0, jsx_runtime_1.jsx)(accessibleChart_1.AccessibleChart, { type: "line", data: chartData, options: chartOptions })] }));
|
|
89
91
|
};
|
|
90
92
|
exports.LineChart = LineChart;
|
|
@@ -120,6 +120,8 @@ injectString("ar-SA", "Has additional actions. Use right arrow to access button,
|
|
|
120
120
|
const checkbox_1 = require("../checkbox/checkbox");
|
|
121
121
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
122
122
|
const iconChevronRight_1 = require("../icons/iconChevronRight");
|
|
123
|
+
const iconChevronLeft_1 = require("../icons/iconChevronLeft");
|
|
124
|
+
const useDirectionalIcon_1 = require("../utils/localization/useDirectionalIcon");
|
|
123
125
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
124
126
|
const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
125
127
|
const CheckboxListWithAction = ({
|
|
@@ -135,6 +137,7 @@ const CheckboxListWithAction = ({
|
|
|
135
137
|
translate
|
|
136
138
|
} = (0, useLanguage_1.useLanguage)();
|
|
137
139
|
const driveComponentClass = (0, useDriveClassName_1.useDriveClassName)("zen-checkbox-list-with-action");
|
|
140
|
+
const ChevronIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconChevronRight_1.IconChevronRight, iconChevronLeft_1.IconChevronLeft);
|
|
138
141
|
const listId = (0, react_1.useId)();
|
|
139
142
|
const checkboxId = `${listId}_check_list-item_`;
|
|
140
143
|
const navigationInstructionsId = `${listId}_navigation_instructions`;
|
|
@@ -369,7 +372,7 @@ const CheckboxListWithAction = ({
|
|
|
369
372
|
})), (0, jsx_runtime_1.jsxs)("div", Object.assign({
|
|
370
373
|
className: "zen-checkbox-list-with-action__label-info"
|
|
371
374
|
}, otherArgs, {
|
|
372
|
-
children: [getLabelColorInfo(option.color, option.isWithAction, option.partialChecked, otherArgs), option.isWithAction && (0, jsx_runtime_1.jsx)(
|
|
375
|
+
children: [getLabelColorInfo(option.color, option.isWithAction, option.partialChecked, otherArgs), option.isWithAction && (0, jsx_runtime_1.jsx)(ChevronIcon, {
|
|
373
376
|
size: "large"
|
|
374
377
|
})]
|
|
375
378
|
}))]
|
|
@@ -7,10 +7,13 @@ const button_1 = require("../../../../button/button");
|
|
|
7
7
|
const iconChevronLeft_1 = require("../../../../icons/iconChevronLeft");
|
|
8
8
|
const iconChevronRight_1 = require("../../../../icons/iconChevronRight");
|
|
9
9
|
const useDrive_1 = require("../../../../utils/theme/useDrive");
|
|
10
|
+
const useDirectionalIcon_1 = require("../../../../utils/localization/useDirectionalIcon");
|
|
10
11
|
const svgIconSize_1 = require("../../../../svgIcon/svgIconSize");
|
|
11
12
|
const ArrowNavButton = ({ value, isHidden, disabled, className, arrowButtonHandler, onMouseDown, onMouseUp }) => {
|
|
12
13
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
13
14
|
const iconSize = isDrive ? (0, svgIconSize_1.driveIconSize)("large") : "large";
|
|
14
|
-
|
|
15
|
+
const LeftIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconChevronLeft_1.IconChevronLeft, iconChevronRight_1.IconChevronRight);
|
|
16
|
+
const RightIcon = (0, useDirectionalIcon_1.useDirectionalIcon)(iconChevronRight_1.IconChevronRight, iconChevronLeft_1.IconChevronLeft);
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(button_1.Button, { type: "tertiary-black", className: (0, classNames_1.classNames)(["zen-arrow-nav-button", isHidden ? "zen-arrow-nav-button--invisible" : "", className !== null && className !== void 0 ? className : ""]), "aria-label": value, disabled: disabled, onClick: arrowButtonHandler, "data-action": value, onMouseDown: onMouseDown, onMouseUp: onMouseUp, children: value === "left" ? ((0, jsx_runtime_1.jsx)(LeftIcon, { size: iconSize, className: "zen-arrow-nav-button__icon" })) : ((0, jsx_runtime_1.jsx)(RightIcon, { size: iconSize, className: "zen-arrow-nav-button__icon" })) }));
|
|
15
18
|
};
|
|
16
19
|
exports.ArrowNavButton = ArrowNavButton;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@import "../common.less";
|
|
2
|
-
@import "../typography/typography.less";
|
|
3
2
|
|
|
4
|
-
@pill-min-width-default:
|
|
3
|
+
@pill-min-width-default: (30 / @rem);
|
|
5
4
|
@pill-max-width-default: 200px;
|
|
6
5
|
|
|
7
6
|
// TODO: update to .zen-pill-content after old pill component removed remove
|
|
@@ -10,16 +9,16 @@
|
|
|
10
9
|
@pill-height--drive: 34px;
|
|
11
10
|
@pill-height--mobile: 34px;
|
|
12
11
|
|
|
13
|
-
.body-
|
|
12
|
+
.zen-body-s-400();
|
|
14
13
|
display: flex;
|
|
15
14
|
align-items: center;
|
|
16
15
|
justify-content: space-between;
|
|
17
|
-
border-radius:
|
|
16
|
+
border-radius: (30 / @rem);
|
|
18
17
|
height: @pill-height;
|
|
19
18
|
display: grid;
|
|
20
19
|
grid-auto-flow: column;
|
|
21
20
|
|
|
22
|
-
gap:
|
|
21
|
+
gap: (8 / @rem);
|
|
23
22
|
|
|
24
23
|
&--icon-left {
|
|
25
24
|
grid-template-columns: 12px 1fr;
|
|
@@ -38,18 +37,18 @@
|
|
|
38
37
|
|
|
39
38
|
&.zen-pill-new-content--empty {
|
|
40
39
|
grid-template-columns: 12px 18px;
|
|
41
|
-
gap:
|
|
40
|
+
gap: (8 / @rem);
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
&--hidden {
|
|
46
|
-
gap:
|
|
45
|
+
gap: (4 / @rem);
|
|
47
46
|
}
|
|
48
47
|
&.zen-pill-new-content--drive,
|
|
49
48
|
&.zen-pill-new-content--drive-tablet {
|
|
50
49
|
height: @pill-height--drive;
|
|
51
50
|
.zen-pill-non-actionable__icon {
|
|
52
|
-
min-width:
|
|
51
|
+
min-width: (16 / @rem);
|
|
53
52
|
max-width: 16px;
|
|
54
53
|
height: 16px;
|
|
55
54
|
}
|
|
@@ -67,15 +66,15 @@
|
|
|
67
66
|
|
|
68
67
|
&.zen-pill-new-content--empty {
|
|
69
68
|
grid-template-columns: 16px 22px;
|
|
70
|
-
gap:
|
|
69
|
+
gap: (8 / @rem);
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
&.zen-pill-new-content--mobile {
|
|
75
74
|
height: @pill-height--mobile;
|
|
76
|
-
.body-m-400-short();
|
|
75
|
+
.zen-body-m-400-short();
|
|
77
76
|
.zen-pill-non-actionable__icon {
|
|
78
|
-
min-width:
|
|
77
|
+
min-width: (16 / @rem);
|
|
79
78
|
max-width: 16px;
|
|
80
79
|
height: 16px;
|
|
81
80
|
}
|
|
@@ -93,14 +92,14 @@
|
|
|
93
92
|
|
|
94
93
|
&.zen-pill-new-content--empty {
|
|
95
94
|
grid-template-columns: 16px 22px;
|
|
96
|
-
gap:
|
|
95
|
+
gap: (8 / @rem);
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
&.zen-pill-new-content--drive {
|
|
101
|
-
.body-04-
|
|
100
|
+
.zen-body-04-drive();
|
|
102
101
|
}
|
|
103
102
|
&.zen-pill-new-content--drive-tablet {
|
|
104
|
-
.body-04-
|
|
103
|
+
.zen-body-04-drive();
|
|
105
104
|
}
|
|
106
105
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
@import "../
|
|
2
|
-
@import "../colors/colors.less";
|
|
1
|
+
@import "../common.less";
|
|
3
2
|
|
|
4
3
|
.zen-pill-content {
|
|
5
|
-
.body-
|
|
4
|
+
.zen-body-s-400();
|
|
6
5
|
display: flex;
|
|
7
6
|
color: var(--text-primary);
|
|
8
7
|
align-items: center;
|
|
9
8
|
justify-content: space-between;
|
|
10
|
-
padding:
|
|
11
|
-
border-radius:
|
|
9
|
+
padding: (4 / @rem) (12 / @rem) (4 / @rem) (12 / @rem);
|
|
10
|
+
border-radius: (30 / @rem);
|
|
12
11
|
background: var(--backgrounds-content-1);
|
|
13
12
|
}
|