@geotab/zenith 3.9.0-beta.0 → 3.9.0-beta.2

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.
Files changed (34) hide show
  1. package/README.md +0 -7
  2. package/dist/card/card.d.ts +1 -1
  3. package/dist/card/card.js +1 -1
  4. package/dist/{title → card/components}/title.d.ts +1 -1
  5. package/dist/card/components/title.js +26 -0
  6. package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
  7. package/dist/commonStyles/typography/typography.less +233 -0
  8. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
  9. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
  10. package/dist/index.css +618 -32
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.js +22 -20
  13. package/dist/table/children/useTableChildren.d.ts +1 -1
  14. package/dist/table/children/useTableChildren.js +3 -3
  15. package/dist/table/selectable/useSelectableRows.d.ts +0 -8
  16. package/dist/table/selectable/useSelectableRows.js +7 -14
  17. package/dist/table/table.js +7 -1
  18. package/esm/card/card.d.ts +1 -1
  19. package/esm/card/card.js +1 -1
  20. package/esm/{title → card/components}/title.d.ts +1 -1
  21. package/esm/card/components/title.js +22 -0
  22. package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
  23. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
  24. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
  25. package/esm/index.d.ts +2 -1
  26. package/esm/index.js +2 -1
  27. package/esm/table/children/useTableChildren.d.ts +1 -1
  28. package/esm/table/children/useTableChildren.js +3 -3
  29. package/esm/table/selectable/useSelectableRows.d.ts +0 -8
  30. package/esm/table/selectable/useSelectableRows.js +7 -14
  31. package/esm/table/table.js +7 -1
  32. package/package.json +1 -1
  33. package/dist/title/title.js +0 -27
  34. package/esm/title/title.js +0 -23
package/README.md CHANGED
@@ -45,13 +45,6 @@ Now components are ready for usage.
45
45
 
46
46
  Zenith library provides components defined in Zenith Design System. It includes very basic blocks like colors, icons, font presets, atom components like buttons, checkboxes etc and high order components - header, table, filters bar etc. List of existing components can be found in [Storybook](https://developers.geotab.com/zenith-storybook/index.html).
47
47
 
48
- ## Documentation
49
-
50
- - [Development Guide](docs/DEVELOPMENT.md) - Creating components, adding icons, testing, code style
51
- - [Build Process](docs/BUILD.md) - How the build system works
52
- - [Release Process](docs/RELEASE.md) - How to publish new versions of Zenith
53
- - [Translations](docs/TRANSLATIONS.md) - How translations work and how to manage them
54
-
55
48
  ## Change log
56
49
 
57
50
  ### 3.8.0
@@ -1,7 +1,7 @@
1
1
  import React, { FC, FunctionComponent, ReactNode } from "react";
2
2
  import { IAbsoluteSize, TContainerSize } from "../cardContainer/cardContainer";
3
3
  import { TCardStatus } from "./components/status";
4
- import { TIconType } from "../title/title";
4
+ import { TIconType } from "./components/title";
5
5
  import { IActions } from "./components/actions";
6
6
  import { IContent } from "./components/content";
7
7
  import "./card.less";
package/dist/card/card.js CHANGED
@@ -71,7 +71,7 @@ const cardContainer_1 = require("../cardContainer/cardContainer");
71
71
  const deviceType_1 = require("../commonHelpers/hooks/deviceType");
72
72
  const useDeviceType_1 = require("../commonHelpers/hooks/useDeviceType");
73
73
  const status_1 = require("./components/status");
74
- const title_1 = require("../title/title");
74
+ const title_1 = require("./components/title");
75
75
  const actions_1 = require("./components/actions");
76
76
  const content_1 = require("./components/content");
77
77
  const useCardSize_1 = require("./hooks/useCardSize");
@@ -1,6 +1,6 @@
1
1
  import { FunctionComponent } from "react";
2
2
  import "./title.less";
3
- import { IIcon } from "../icons/icon";
3
+ import { IIcon } from "../../icons/icon";
4
4
  export type TIconType = "info" | "warning" | "error" | "success" | "default";
5
5
  interface ITitle {
6
6
  isMobile: boolean;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Title = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const classNames_1 = require("../../commonHelpers/classNames/classNames");
7
+ const useDriveClassName_1 = require("../../utils/theme/useDriveClassName");
8
+ const useDrive_1 = require("../../utils/theme/useDrive");
9
+ const iconChevronRightSmall_1 = require("../../icons/iconChevronRightSmall");
10
+ const Title = ({ isMobile, link, target, title, id, icon, iconType, className = "", onClick }) => {
11
+ const driveClassNames = (0, useDriveClassName_1.useDriveClassName)("zen-card-title");
12
+ const isDrive = (0, useDrive_1.useDrive)();
13
+ const iconClassName = iconType ? `zen-card-title__icon--${iconType}` : "";
14
+ const iconSize = (0, react_1.useMemo)(() => (isDrive ? "huge" : "large"), [isDrive]);
15
+ const iconElement = (0, react_1.useMemo)(() => (icon ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-card-title__icon", iconClassName]), children: (0, react_1.createElement)(icon, { size: iconSize }) }) : null), [icon, iconSize, iconClassName]);
16
+ const chevron = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)("span", { className: "zen-card-title__link-chevron", children: (0, jsx_runtime_1.jsx)(iconChevronRightSmall_1.IconChevronRightSmall, { size: iconSize, className: "zen-card-title__chevron-icon" }) })), [iconSize]);
17
+ const titleClasses = (0, classNames_1.classNames)(["zen-card-title", driveClassNames || "", onClick ? "zen-card-title__clickable" : ""]);
18
+ if (onClick) {
19
+ 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] })] }));
20
+ }
21
+ if (link) {
22
+ return ((0, jsx_runtime_1.jsxs)("a", { id: id, className: titleClasses, href: link, target: target, children: [iconElement, (0, jsx_runtime_1.jsxs)("span", { title: title, className: (0, classNames_1.classNames)(["zen-card-title__link-text"]), children: [title, chevron] })] }));
23
+ }
24
+ return ((0, jsx_runtime_1.jsxs)("div", { className: titleClasses, children: [iconElement, (0, jsx_runtime_1.jsx)("span", { title: title, id: id, className: (0, classNames_1.classNames)(["zen-card-title__text", isMobile && !isDrive ? "zen-card-title__text--mobile" : "", className]), children: title })] }));
25
+ };
26
+ exports.Title = Title;
@@ -1,3 +1,3 @@
1
1
  import { TCardStatus } from "../components/status";
2
- import { TIconType } from "../../title/title";
2
+ import { TIconType } from "../components/title";
3
3
  export declare const getIconTypeFromStatus: (status: TCardStatus) => TIconType | undefined;
@@ -1,3 +1,11 @@
1
+ @import (reference) "../common.less";
2
+
3
+ :root {
4
+ --main-font: Roboto, "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
5
+ --main-font-data: "Roboto Mono", "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
6
+ --data-font-drive: "Roboto Mono", "Segoe UI", Segoe, "Helvetica Neue", Helvetica, sans-serif;
7
+ }
8
+
1
9
  //**********//
2
10
  // MyGeotab //
3
11
  //**********//
@@ -565,3 +573,228 @@
565
573
  .zenith-drive-font(@driver-font-family, @data-04-drive-mobile-size, @data-04-drive-mobile-line-height);
566
574
  }
567
575
  }
576
+
577
+ // ─── Backward-compatible aliases removed in MYG-120793 ────────────────────────
578
+ // These class definitions were removed as part of the typography refactor.
579
+ // Re-added here so existing MyGeotab consumers continue to compile without changes.
580
+
581
+ // Legacy .font() mixin
582
+ .font(
583
+ @font: Roboto,
584
+ @size,
585
+ @line-height: 16px,
586
+ @letter-spacing: 0,
587
+ @weight: 400,
588
+ @style: normal,
589
+ @text-transform: none,
590
+ ) {
591
+ font-family: @font;
592
+ font-size: @size;
593
+ font-style: @style;
594
+ font-weight: @weight;
595
+ letter-spacing: @letter-spacing;
596
+ line-height: @line-height;
597
+ text-transform: @text-transform;
598
+ }
599
+
600
+ // Heading — desktop/mobile aliases
601
+ .heading-03-desktop {
602
+ .zenith-font(@main-font-family, 20, 28, 0, 300);
603
+ }
604
+
605
+ .heading-01-mobile,
606
+ .heading-xl-300-mobile {
607
+ .zenith-font(@main-font-family, 20, 36, 0, 300);
608
+ }
609
+
610
+ .heading-03-mobile,
611
+ .heading-m-300-mobile {
612
+ .zenith-font(@main-font-family, 18, 28, 0, 300);
613
+ }
614
+
615
+ // Label — drive tablet/mobile
616
+ .label-01-tablet-drive,
617
+ .tablet-label-400-drive {
618
+ .zenith-font(@main-font-family, 16, 18);
619
+ }
620
+
621
+ .label-01-mobile-drive,
622
+ .mobile-label-400-drive {
623
+ .zenith-font(@main-font-family, 14, 18);
624
+ }
625
+
626
+ // Body-01 — drive tablet/mobile
627
+ .body-01-tablet-drive,
628
+ .tablet-body-l-400-drive {
629
+ .zenith-font(@main-font-family, 20, 30, 0);
630
+ }
631
+
632
+ .body-01-mobile-drive,
633
+ .mobile-body-l-400-drive {
634
+ .zenith-font(@main-font-family, 18, 28, 0);
635
+ }
636
+
637
+ // Body-02-short — drive tablet/mobile
638
+ .body-02-short-tablet-drive,
639
+ .tablet-body-m-400-short-drive {
640
+ .zenith-font(@main-font-family, 18, 22, 0);
641
+ }
642
+
643
+ .body-02-short-mobile-drive,
644
+ .mobile-body-m-400-short-drive {
645
+ .zenith-font(@main-font-family, 16, 20, 0);
646
+ }
647
+
648
+ // Body-02-tall — drive tablet/mobile
649
+ .body-02-tall-tablet-drive,
650
+ .tablet-body-m-400-tall-drive {
651
+ .zenith-font(@main-font-family, 18, 28, 0);
652
+ }
653
+
654
+ .body-02-tall-mobile-drive,
655
+ .mobile-body-m-400-tall-drive {
656
+ .zenith-font(@main-font-family, 16, 26, 0);
657
+ }
658
+
659
+ // Body-03 — drive tablet/mobile
660
+ .body-03-tablet-drive,
661
+ .tablet-body-s-700-drive {
662
+ .zenith-font(@main-font-family, 16, 22, @weight: 700);
663
+ }
664
+
665
+ .body-03-mobile-drive,
666
+ .mobile-body-s-700-drive {
667
+ .zenith-font(@main-font-family, 14, 18, @weight: 700);
668
+ }
669
+
670
+ // Body-04 — drive tablet/mobile
671
+ .body-04-tablet-drive,
672
+ .tablet-body-s-400-drive {
673
+ .zenith-font(@main-font-family, 16, 22);
674
+ }
675
+
676
+ .body-04-mobile-drive,
677
+ .mobile-body-s-400-drive {
678
+ .zenith-font(@main-font-family, 14, 20);
679
+ }
680
+
681
+ // Body-05 — drive tablet/mobile
682
+ .body-05-tablet-drive,
683
+ .tablet-body-s-400-italic-drive {
684
+ .zenith-font(@main-font-family, 16, 20, @style: italic);
685
+ }
686
+
687
+ .body-05-mobile-drive,
688
+ .mobile-body-s-400-italic-drive {
689
+ .zenith-font(@main-font-family, 14, 18, @style: italic);
690
+ }
691
+
692
+ // Heading — drive tablet/mobile
693
+ .heading-01-tablet-drive,
694
+ .tablet-heading-xl-300-drive {
695
+ .zenith-font(@main-font-family, 26, 34, 0, 300);
696
+ }
697
+
698
+ .heading-01-mobile-drive,
699
+ .mobile-heading-xl-300-drive {
700
+ .zenith-font(@main-font-family, 24, 32, 0, 300);
701
+ }
702
+
703
+ .heading-02-tablet-drive,
704
+ .tablet-heading-l-400-drive {
705
+ .zenith-font(@main-font-family, 24, 30, 0);
706
+ }
707
+
708
+ .heading-02-mobile-drive,
709
+ .mobile-heading-l-400-drive {
710
+ .zenith-font(@main-font-family, 22, 28, 0);
711
+ }
712
+
713
+ .heading-03-tablet-drive,
714
+ .tablet-heading-m-300-drive {
715
+ .zenith-font(@main-font-family, 20, 26, 0, 300);
716
+ }
717
+
718
+ .heading-03-mobile-drive,
719
+ .mobile-heading-m-300-drive {
720
+ .zenith-font(@main-font-family, 18, 24, 0, 300);
721
+ }
722
+
723
+ .heading-04-tablet-drive,
724
+ .tablet-heading-m-500-drive {
725
+ .zenith-font(@main-font-family, 20, 28, 0, 500);
726
+ }
727
+
728
+ .heading-04-mobile-drive,
729
+ .mobile-heading-m-500-drive {
730
+ .zenith-font(@main-font-family, 18, 26, 0, 500);
731
+ }
732
+
733
+ .heading-05-tablet-drive,
734
+ .tablet-heading-s-500-drive {
735
+ .zenith-font(@main-font-family, 18, 22, 0.16, 500);
736
+ }
737
+
738
+ .heading-05-mobile-drive,
739
+ .mobile-heading-s-500-drive {
740
+ .zenith-font(@main-font-family, 16, 20, 0.16, 500);
741
+ }
742
+
743
+ .heading-06-tablet-drive {
744
+ .zenith-font(@main-font-family, 14, 22, 0, 500, normal, uppercase);
745
+ }
746
+
747
+ .heading-06-mobile-drive {
748
+ .zenith-font(@main-font-family, 12, 20, 0, 500, normal, uppercase);
749
+ }
750
+
751
+ .heading-07-tablet-drive,
752
+ .tablet-heading-s-300-drive {
753
+ .zenith-font(@main-font-family, 18, 20, 0.16, 300);
754
+ }
755
+
756
+ .heading-07-mobile-drive,
757
+ .mobile-heading-s-300-drive {
758
+ .zenith-font(@main-font-family, 16, 18, 0.16, 300);
759
+ }
760
+
761
+ // Data — drive tablet/mobile
762
+ .data-01-tablet-drive,
763
+ .tablet-data-xl-drive {
764
+ .zenith-font(@driver-font-family, 34, 42, 0);
765
+ }
766
+
767
+ .data-01-mobile-drive,
768
+ .mobile-data-xl-drive {
769
+ .zenith-font(@driver-font-family, 32, 40, 0);
770
+ }
771
+
772
+ .data-02-tablet-drive,
773
+ .tablet-data-l-drive {
774
+ .zenith-font(@driver-font-family, 22, 26, 0);
775
+ }
776
+
777
+ .data-02-mobile-drive,
778
+ .mobile-data-l-drive {
779
+ .zenith-font(@driver-font-family, 20, 24, 0);
780
+ }
781
+
782
+ .data-03-tablet-drive,
783
+ .tablet-data-m-drive {
784
+ .zenith-font(@driver-font-family, 20, 22, 0);
785
+ }
786
+
787
+ .data-03-mobile-drive,
788
+ .mobile-data-m-drive {
789
+ .zenith-font(@driver-font-family, 16, 21, 0);
790
+ }
791
+
792
+ .data-04-tablet-drive,
793
+ .tablet-data-s-drive {
794
+ .zenith-font(@driver-font-family, 18, 26, 0);
795
+ }
796
+
797
+ .data-04-mobile-drive,
798
+ .mobile-data-s-drive {
799
+ .zenith-font(@driver-font-family, 16, 24, 0);
800
+ }
@@ -7,21 +7,19 @@ import { DeviceType } from "../../../../commonHelpers/hooks/deviceType";
7
7
  type TBulkAction = IBulkActionLink | IBulkActionButton;
8
8
  export interface IBulkActionsProps extends IZenComponentProps {
9
9
  selected: number;
10
- /**
11
- * When `true`, displays "All selected" instead of a count, and enables action buttons
12
- * even when `selected` is 0 (i.e., cross-page "select all" is active).
13
- */
14
10
  allSelected?: boolean;
15
11
  onClearSelection: () => void;
12
+ onSelectAll?: () => void;
16
13
  gridType?: DeviceType;
17
14
  children?: ReactElement<TBulkAction> | null | (ReactElement<TBulkAction> | null)[];
15
+ turnOffSelectAll?: boolean;
18
16
  }
19
17
  export interface IBulkActions extends IBulkActionsProps {
20
18
  ActionLink: (props: IBulkActionLink) => ReactNode;
21
19
  ActionButton: (props: IBulkActionButton) => ReactNode;
22
20
  }
23
21
  export declare const BulkActions: {
24
- ({ selected, allSelected, className, onClearSelection, gridType, children }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
22
+ ({ selected, allSelected, className, onClearSelection, onSelectAll, gridType, children, turnOffSelectAll }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
25
23
  ActionLink: ({ title, icon, link, disabled, type, ref }: IBulkActionLink) => import("react/jsx-runtime").JSX.Element;
26
24
  ActionButton: ({ title, icon, clickHandler, onClick, disabled, type, ref }: IBulkActionButton) => import("react/jsx-runtime").JSX.Element;
27
25
  translations: string[];
@@ -89,6 +89,33 @@ injectString("zh-Hans", "Clear selection", "\u6E05\u9664\u9009\u62E9");
89
89
  injectString("zh-TW", "Clear selection", "\u6E05\u9664\u9078\u53D6\u9805\u76EE");
90
90
  injectString("ro-RO", "Clear selection", "\u0218terge\u021Bi selec\u021Bia");
91
91
  injectString("ar-SA", "Clear selection", "\u0645\u0633\u062D \u0627\u0644\u062A\u062D\u062F\u064A\u062F");
92
+ injectString("cs", "Select all", "Vybrat v\u0161e");
93
+ injectString("da-DK", "Select all", "V\xE6lg alle");
94
+ injectString("de", "Select all", "Alle ausw\xE4hlen");
95
+ injectString("en", "Select all", "Select all");
96
+ injectString("es", "Select all", "Seleccionar todo");
97
+ injectString("fi-FI", "Select all", "Valitse kaikki");
98
+ injectString("fr", "Select all", "S\xE9lectionner tout");
99
+ injectString("fr-FR", "Select all", "S\xE9lectionner tout");
100
+ injectString("hu-HU", "Select all", "V\xE1laszd ki az \xF6sszeset.");
101
+ injectString("id", "Select all", "Pilih semua");
102
+ injectString("it", "Select all", "Selezionare tutto");
103
+ injectString("ja", "Select all", "\u3059\u3079\u3066\u9078\u629E");
104
+ injectString("ko-KR", "Select all", "\uBAA8\uB450 \uC120\uD0DD");
105
+ injectString("ms", "Select all", "Pilih semua");
106
+ injectString("nb-NO", "Select all", "Velg alle");
107
+ injectString("nl", "Select all", "Alles selecteren");
108
+ injectString("pl", "Select all", "Wybierz wszystko");
109
+ injectString("pt-BR", "Select all", "Selecionar tudo");
110
+ injectString("pt-PT", "Select all", "Selecionar tudo");
111
+ injectString("sk-SK", "Select all", "Vyber v\u0161etko.");
112
+ injectString("sv", "Select all", "V\xE4lj alla");
113
+ injectString("th", "Select all", "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14");
114
+ injectString("tr", "Select all", "T\xFCm\xFCn\xFC se\xE7");
115
+ injectString("zh-Hans", "Select all", "\u5168\u9009");
116
+ injectString("zh-TW", "Select all", "\u5168\u9078");
117
+ injectString("ro-RO", "Select all", "Selecta\u021Bi tot");
118
+ injectString("ar-SA", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
92
119
  injectString("cs", "More", "V\xEDce");
93
120
  injectString("da-DK", "More", "Mere");
94
121
  injectString("de", "More", "Mehr");
@@ -128,13 +155,16 @@ const useNonFittingElements_1 = require("../../../../header/hooks/useNonFittingE
128
155
  const useResizeObserver_1 = require("../../../../commonHelpers/hooks/useResizeObserver");
129
156
  const menu_1 = require("../../../../menu/menu");
130
157
  const iconDotVertical_1 = require("../../../../icons/iconDotVertical");
158
+ const button_1 = require("../../../../button/button");
131
159
  const BulkActions = ({
132
160
  selected,
133
161
  allSelected,
134
162
  className,
135
163
  onClearSelection,
164
+ onSelectAll,
136
165
  gridType = deviceType_1.DeviceType.Desktop,
137
- children
166
+ children,
167
+ turnOffSelectAll
138
168
  }) => {
139
169
  var _a;
140
170
  const {
@@ -178,7 +208,13 @@ const BulkActions = ({
178
208
  }), (0, jsx_runtime_1.jsx)("span", {
179
209
  className: "zen-bulk-actions__number-of-selected ellipsis",
180
210
  children: text
181
- }), (0, jsx_runtime_1.jsxs)("div", {
211
+ }), onSelectAll && !turnOffSelectAll ? (0, jsx_runtime_1.jsx)(button_1.Button, {
212
+ type: "tertiary",
213
+ className: "zen-bulk-actions__select-all",
214
+ disabled: allSelected,
215
+ onClick: onSelectAll,
216
+ children: translate("Select all")
217
+ }) : null, (0, jsx_runtime_1.jsxs)("div", {
182
218
  className: "zen-bulk-actions__action-button-holder",
183
219
  ref: buttonHolder,
184
220
  children: [react_1.Children.map(visibleElements, element => (0, react_1.cloneElement)(element, {