@motionmetrics/mmpro-storybook-components-schema 2.0.30 → 2.0.32

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 (59) hide show
  1. package/lib/storybook/components/Icon/Icon.d.ts +4 -4
  2. package/lib/storybook/components/Icon/Icon.types.d.ts +1 -1
  3. package/lib/storybook/components/Icon/index.d.ts +2 -2
  4. package/lib/storybook/components/Schema/BaseSchema/index.d.ts +10 -10
  5. package/lib/storybook/components/Schema/BaseSchema/types.d.ts +2 -2
  6. package/lib/storybook/components/Schema/Schema.props.d.ts +5 -0
  7. package/lib/storybook/components/Schema/Schema.stories.d.ts +8 -0
  8. package/lib/storybook/components/Schema/SchemaTable.d.ts +5 -0
  9. package/lib/storybook/components/Schema/ShrinkableSchema/index.stories.d.ts +12 -0
  10. package/lib/storybook/components/Schema/ShrinkableSchema/types.d.ts +1 -1
  11. package/lib/storybook/components/Schema/ToothWearSchema/index.d.ts +1 -1
  12. package/lib/storybook/components/Schema/ToothWearSchema/index.stories.d.ts +7 -0
  13. package/lib/storybook/components/Schema/assets/colors.d.ts +1 -1
  14. package/lib/storybook/components/Schema/assets/index.d.ts +1 -1
  15. package/lib/storybook/components/Schema/assets/utils.d.ts +1 -1
  16. package/lib/storybook/components/Schema/constants.d.ts +2 -2
  17. package/lib/storybook/components/Schema/index.d.ts +8 -8
  18. package/lib/storybook/components/Schema/utils.d.ts +3 -3
  19. package/lib/storybook/components/Tooltip/InteractiveTooltip/index.stories.d.ts +34 -0
  20. package/lib/storybook/components/Tooltip/RichTooltip/index.stories.d.ts +12 -0
  21. package/lib/storybook/components/Tooltip/index.d.ts +3 -3
  22. package/lib/storybook/components/Tooltip/index.stories.d.ts +8 -0
  23. package/lib/storybook/components/Tooltip/types.d.ts +1 -1
  24. package/lib/storybook/contexts/UserContext.d.ts +1 -1
  25. package/lib/storybook/hooks/useSize.d.ts +1 -1
  26. package/lib/storybook/hooks/useSizeRef.d.ts +1 -1
  27. package/lib/storybook/hooks/useUserTimezone.d.ts +1 -1
  28. package/lib/storybook/hooks/useUserUnits.d.ts +2 -2
  29. package/lib/storybook/schema-entry.d.ts +2 -0
  30. package/lib/storybook/tokensV2/Border/index.stories.d.ts +1 -1
  31. package/lib/storybook/tokensV2/Border/types.d.ts +1 -1
  32. package/lib/storybook/tokensV2/Color/backwardMapping.d.ts +1 -1
  33. package/lib/storybook/tokensV2/Color/index.stories.d.ts +13 -0
  34. package/lib/storybook/tokensV2/Color/types.d.ts +1 -1
  35. package/lib/storybook/tokensV2/ResponsiveGrid/index.d.ts +8 -0
  36. package/lib/storybook/tokensV2/ResponsiveGrid/index.stories.d.ts +19 -0
  37. package/lib/storybook/tokensV2/ResponsiveGrid/semantic.d.ts +18 -0
  38. package/lib/storybook/tokensV2/Shadow/index.stories.d.ts +13 -0
  39. package/lib/storybook/tokensV2/Shadow/semantic.d.ts +8 -0
  40. package/lib/storybook/tokensV2/Typography/index.d.ts +1 -1
  41. package/lib/storybook/tokensV2/Typography/index.stories.d.ts +13 -0
  42. package/lib/storybook/tokensV2/index.js +2 -2
  43. package/lib/storybook/tokensV2/utils.d.ts +1 -0
  44. package/lib/storybook/utils/LinkWrapperV2.d.ts +2 -2
  45. package/lib/storybook/utils/colorVariant.d.ts +1 -1
  46. package/lib/storybook/utils/emptyDataStructures.d.ts +2 -0
  47. package/lib/storybook/utils/formatDateWithAt.d.ts +9 -0
  48. package/lib/storybook/utils/i18Translation.d.ts +1 -0
  49. package/lib/storybook/utils/stories.d.ts +7 -0
  50. package/lib/storybook/utils/time.d.ts +10 -0
  51. package/lib/storybook/utils/toothWearOut.d.ts +1 -1
  52. package/lib/storybook/utils/units/length.d.ts +1 -1
  53. package/lib/storybook/utils/utils.d.ts +1 -1
  54. package/lib/storybook/utils/utils.types.d.ts +1 -1
  55. package/lib/storybook/utils/zustand.d.ts +23 -0
  56. package/package.json +6 -18
  57. package/lib/storybook/components/Icon/index.js +0 -2
  58. package/lib/storybook/components/Schema/index.js +0 -2
  59. package/lib/storybook/schema-entry.js +0 -3
@@ -1,5 +1,5 @@
1
- import { Icon } from "./renderers/Icon.d.ts";
1
+ import { Icon } from "./renderers/Icon";
2
2
  export { Icon };
3
- export declare const ProductIcon: ({ iconType, name, className, size, handleClick, style, }: import("./Icon.types.d.ts").IconPropsType) => import("react/jsx-runtime").JSX.Element;
4
- export declare const ModuleIcon: ({ iconType, name, className, size, handleClick, style, }: import("./Icon.types.d.ts").IconPropsType) => import("react/jsx-runtime").JSX.Element;
5
- export declare const ModuleOutlinedIcon: ({ iconType, name, className, size, handleClick, style, }: import("./Icon.types.d.ts").IconPropsType) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const ProductIcon: ({ iconType, name, className, size, handleClick, style, }: import("./Icon.types").IconPropsType) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const ModuleIcon: ({ iconType, name, className, size, handleClick, style, }: import("./Icon.types").IconPropsType) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ModuleOutlinedIcon: ({ iconType, name, className, size, handleClick, style, }: import("./Icon.types").IconPropsType) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { iconSizeValues } from "../../Common.types.d.ts";
1
+ import type { iconSizeValues } from ":storybook/Common.types";
2
2
  import type { CSSProperties, MouseEventHandler } from "react";
3
3
  export declare const iconArr: readonly ["Reverse", "DoubleArrowLeft", "DoubleArrowRight", "CollapseRight", "CollapseLeft", "EditOutlined", "Time", "Reload", "Equal", "MixedChart", "DashedLine", "Line", "Date", "FilledDot", "OutlinedDot", "FilledBox", "OutlinedBox", "NotificationOff", "Alert", "Trend", "EditBox", "Image", "Next", "Previous", "FullScreen", "Keyboard", "SiteDashboard", "Delete", "Clear", "StateOffline", "StateWarning", "StateOk", "StateAlarm", "AlertMessage", "Info", "Help", "Region", "Redo", "Edit", "Create", "TagFilled", "TagOutlined", "CloseFullScreen", "UndoAction", "FitToScreen", "Download", "Calendar", "FlagFilled", "FlagOutlined", "Location", "StarFilled", "StarOutlined", "ZoomOut", "ZoomIn", "Explosion", "Play", "Pause", "Cancel", "Remove", "CheckboxIndeterminate", "Checkbox", "CheckboxChecked", "Add", "NotificationFilled", "Back", "ArrowRight", "NavigateNext", "NavigateBefore", "HorizontalBarChart", "OpenInNew", "BrokenTooth", "Camera3D", "LikeFilled", "LikeOutlined", "TruckMetrics", "ChartView", "SelectAll", "Select", "Disabled", "MaterialHeight", "Belt", "Surveillance", "Exclamation", "CheckCircleOutlined", "FileExcel", "SortAlphaAsc", "Settings", "Question", "Clock", "Picture", "Table", "Envelope", "RegionIgnore", "Bell", "Filter", "SearchPlus", "ShareAlt", "Floppy", "Tooth", "DashboardCircle", "DownloadAlt", "CaretDown", "CaretUp", "Trash", "LogOut", "Ban", "Map", "BarChart", "Pencil", "FolderOpen", "Merge", "BuildingFilled", "CheckCircleFilled", "ToothWear", "CancelRounded", "ArrowCircleRight", "ToothReplace", "ArrowDoubleHead", "Hashtag", "User", "BuildingOutlined", "Clone", "FileText", "MovePoint", "MinusCircle", "AngleUp", "PlayCircle", "Dashboard", "Cube", "Comment", "CheckSquareRounded", "MousePointer", "Refresh", "Plus", "RoundedSquare", "Repeat", "PlusCircle", "ArrowCircleLeft", "SortAlphaDesc", "ExclamationTriangle", "AngleDown", "Phone", "Close", "SearchMinus", "ArrowCircleUp", "Search", "Lock", "Split", "HandPaper", "Unlock", "Undo", "ObjectGroup", "Segmentation", "AngleRight", "ToothWearCircle", "Times", "Crop", "RegionRock", "Check", "Administration", "API", "Home", "GalleryView", "CardView", "KeyboardHide", "GPS", "GPSOff", "Layers", "PanTool", "Menu", "AddImage", "ArrowLeft", "ArrowSelector", "CameraID", "ChevronLeft", "ChevronRight", "ChevronRightSmall", "Copy", "Email", "ImageCrashed", "InfoFilled", "Language", "Login", "MyLocationFilled", "Paste", "Save", "Translation", "AlarmPrevious", "AlarmNext", "ArrowDiagonalDown", "ArrowDiagonalUp", "ArrowDown", "CameraPrimary", "ArrowUp", "Audio", "AudioMute", "CameraFirst", "CameraSecond", "CameraVideo", "ChevronDownSmall", "ChevronLeftSmall", "ChevronUpSmall", "Collapse", "Expand", "FrameForward", "FrameBackward", "FullScreenExit", "LayersOff", "ListView", "MoreHorizontal", "MoreVertical", "MyLocationOutlined", "NotificationOutlined", "ReportCSV", "ReportPDF", "Link"];
4
4
  export declare const productIconArr: readonly ["ShovelMetrics3D", "ShovelMetrics2D", "BeltMetrics3D", "BeltMetrics2D", "PortaMetrics3D", "PortaMetrics2D", "LoaderMetrics3D", "LoaderMetrics2D", "TruckMetrics3D", "TruckMetrics2D", "CrusherMetrics3D", "MetricsManagerPro3D", "MetricsManagerPro2D"];
@@ -1,2 +1,2 @@
1
- export { Icon, ProductIcon, ModuleIcon, ModuleOutlinedIcon } from "./Icon.d.ts";
2
- export * from "./Icon.types.d.ts";
1
+ export { Icon, ProductIcon, ModuleIcon, ModuleOutlinedIcon } from "./Icon";
2
+ export * from "./Icon.types";
@@ -1,16 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import type { SchemaElementOptionGetter } from "./types";
3
3
  export declare const BaseSchema: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<{
4
- isBackhoe?: boolean | undefined;
5
- isDarkMode?: boolean | undefined;
6
- noBackground?: boolean | undefined;
7
- singleThreshold?: boolean | undefined;
8
- reverseTeeth?: boolean | undefined;
9
- disableTooltip?: boolean | undefined;
10
- showToothNum?: boolean | undefined;
11
- toothSettings?: Pick<import("../../../../models").ToothSetting, "length" | "maxLength" | "minLength">[] | undefined;
12
- toothWearPredictions?: Pick<import("../../../../models").ToothWearPrediction, "projectedWearOutUtcTime">[] | undefined;
13
- toothWearLastUpdated?: number | undefined;
4
+ isBackhoe?: boolean;
5
+ isDarkMode?: boolean;
6
+ noBackground?: boolean;
7
+ singleThreshold?: boolean;
8
+ reverseTeeth?: boolean;
9
+ disableTooltip?: boolean;
10
+ showToothNum?: boolean;
11
+ toothSettings?: Pick<import("../../../../models").ToothSetting, "length" | "maxLength" | "minLength">[];
12
+ toothWearPredictions?: Pick<import("../../../../models").ToothWearPrediction, "projectedWearOutUtcTime">[];
13
+ toothWearLastUpdated?: number;
14
14
  toothCount: number;
15
15
  getToothOption: SchemaElementOptionGetter;
16
16
  getLipShroudOption: SchemaElementOptionGetter;
@@ -1,5 +1,5 @@
1
- import type { EquipmentTypeName, ToothSetting, ToothWearPrediction } from "../../../../models";
2
- import type { CommonStylingProps } from "../../../utils/styles";
1
+ import type { EquipmentTypeName, ToothSetting, ToothWearPrediction } from ":models";
2
+ import type { CommonStylingProps } from ":storybook/utils/styles";
3
3
  import type { SchemaColor } from "../assets/colors";
4
4
  import type { SchemaElementComponent } from "../assets/utils";
5
5
  export type ExtendedSchemaProps<T> = Omit<BaseSchemaPropsType, "toothCount" | "getToothOption" | "getLipShroudOption"> & {
@@ -0,0 +1,5 @@
1
+ import type { SchemaPropsType } from "./Schema.types";
2
+ export declare const cableLipShroudSchemaProps: SchemaPropsType;
3
+ export declare const cableToothSchemaProps: SchemaPropsType;
4
+ export declare const hydraulicLipShroudSchemaProps: SchemaPropsType;
5
+ export declare const hydraulicToothSchemaProps: SchemaPropsType;
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Schema } from "./Schema";
3
+ declare const meta: Meta<typeof Schema>;
4
+ export default meta;
5
+ export declare const CableLipShroudSchema: StoryObj;
6
+ export declare const CableToothSchema: StoryObj;
7
+ export declare const HydraulicLipShroudSchema: StoryObj;
8
+ export declare const HydraulicToothSchema: StoryObj;
@@ -0,0 +1,5 @@
1
+ import type { EquipmentTypeName } from ":models";
2
+ declare const SchemaTable: ({ equipmentType, }: {
3
+ equipmentType: EquipmentTypeName;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default SchemaTable;
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ShrinkableSchema } from ".";
3
+ import type { ShrinkableSchemaProps } from "./types";
4
+ import type { SchemaPropsType } from "../Schema.types";
5
+ import { type OfflineSchemaPropsType } from "../OfflineSchema";
6
+ import { type ToothWearSchemaPropsType } from "../ToothWearSchema";
7
+ declare const Component: typeof ShrinkableSchema;
8
+ declare const meta: Meta<typeof Component>;
9
+ export default meta;
10
+ export declare const HydraulicMissingTooth: StoryObj<Meta<ShrinkableSchemaProps<SchemaPropsType>>>;
11
+ export declare const Offline: StoryObj<Meta<ShrinkableSchemaProps<OfflineSchemaPropsType>>>;
12
+ export declare const ToothWear: StoryObj<Meta<ShrinkableSchemaProps<ToothWearSchemaPropsType>>>;
@@ -1,4 +1,4 @@
1
- import type { CommonStylingProps } from "../../../utils/styles";
1
+ import type { CommonStylingProps } from ":storybook/utils/styles";
2
2
  import type { ForwardRefExoticComponent, RefAttributes } from "react";
3
3
  export type ShrinkableSchemaProps<P> = P & CommonStylingProps & {
4
4
  component: ForwardRefExoticComponent<P & RefAttributes<HTMLDivElement>>;
@@ -6,5 +6,5 @@ export type ToothWearSchemaPropsType = ExtendedSchemaProps<{
6
6
  export declare const ToothWearSchema: import("react").ForwardRefExoticComponent<Omit<import("../BaseSchema/types").BaseSchemaPropsType, "toothCount" | "getToothOption" | "getLipShroudOption"> & {
7
7
  equipmentType: import("../../../../models").EquipmentTypeName;
8
8
  } & {
9
- customWidth?: number | undefined;
9
+ customWidth?: number;
10
10
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ToothWearSchema as Component } from ".";
3
+ type ComponentMeta = Meta<typeof Component>;
4
+ type ComponentStory = StoryObj<ComponentMeta>;
5
+ declare const meta: ComponentMeta;
6
+ export default meta;
7
+ export declare const ToothWearSchema: ComponentStory;
@@ -1,4 +1,4 @@
1
- import { type ColorVariantKey } from "../../../tokensV2";
1
+ import { type ColorVariantKey } from ":storybook/tokensV2";
2
2
  export type SchemaColor = {
3
3
  fill: string;
4
4
  stroke: string;
@@ -1,4 +1,4 @@
1
- import type { ColorVariantKey } from "../../../tokensV2";
1
+ import type { ColorVariantKey } from ":storybook/tokensV2";
2
2
  import { SchemaElementComponent } from "./utils";
3
3
  export declare const toothCableShovel: (colorVariant: ColorVariantKey, options?: {
4
4
  count?: number;
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from "react";
2
- import { type ColorVariantKey } from "../../../tokensV2";
2
+ import { type ColorVariantKey } from ":storybook/tokensV2";
3
3
  type CreateTemplateArgs = {
4
4
  path: string;
5
5
  originalWidth: number;
@@ -1,5 +1,5 @@
1
- import { EquipmentTypeName } from "../../../models";
2
- import type { ColorVariantKey } from "../../tokensV2";
1
+ import { EquipmentTypeName } from ":models";
2
+ import type { ColorVariantKey } from ":storybook/tokensV2";
3
3
  export declare const SCHEMA_DEFAULT_HEIGHT = 60;
4
4
  export declare const getToothComponent: (numberOfTeeth: number, equipmentType: EquipmentTypeName, colorVariant: ColorVariantKey, widthsOverride?: number) => import("./assets/utils").SchemaElementComponent;
5
5
  export declare const getMissingToothComponent: (numberOfTeeth: number, equipmentType: EquipmentTypeName, colorVariant: ColorVariantKey) => import("./assets/utils").SchemaElementComponent;
@@ -1,8 +1,8 @@
1
- export { Schema } from "./Schema.d.ts";
2
- export type { SchemaPropsType } from "./Schema.types.d.ts";
3
- export { ShrinkableSchema } from "./ShrinkableSchema/index.d.ts";
4
- export { OfflineSchema } from "./OfflineSchema/index.d.ts";
5
- export type { OfflineSchemaPropsType } from "./OfflineSchema/index.d.ts";
6
- export type { ExtendedSchemaProps } from "./BaseSchema/types.d.ts";
7
- export { ToothWearSchema } from "./ToothWearSchema/index.d.ts";
8
- export type { ToothWearSchemaPropsType } from "./ToothWearSchema/index.d.ts";
1
+ export { Schema } from "./Schema";
2
+ export type { SchemaPropsType } from "./Schema.types";
3
+ export { ShrinkableSchema } from "./ShrinkableSchema";
4
+ export { OfflineSchema } from "./OfflineSchema";
5
+ export type { OfflineSchemaPropsType } from "./OfflineSchema";
6
+ export type { ExtendedSchemaProps } from "./BaseSchema/types";
7
+ export { ToothWearSchema } from "./ToothWearSchema";
8
+ export type { ToothWearSchemaPropsType } from "./ToothWearSchema";
@@ -1,6 +1,6 @@
1
- import type { UserUnitLength } from "../../../models";
1
+ import type { UserUnitLength } from ":models";
2
2
  import type { ReactNode } from "react";
3
- import type { LengthDecimalPlaces } from "../../utils";
3
+ import type { LengthDecimalPlaces } from ":storybook/utils";
4
4
  import type { SchemaPropsType } from "./Schema.types";
5
5
  export declare const DECIMAL_PLACES: LengthDecimalPlaces;
6
6
  export type GetMessageFn = (args: {
@@ -11,4 +11,4 @@ export declare const getLipShroudMessage: GetMessageFn;
11
11
  export declare const getToothMessage: GetMessageFn;
12
12
  export declare const getToothIntactRatio: (setting?: NonNullable<SchemaPropsType["toothSettings"]>[number]) => number;
13
13
  export declare const getToothCriticalRatio: (setting?: NonNullable<SchemaPropsType["toothSettings"]>[number]) => number;
14
- export declare const renderCriticalLine: (toothSettings: SchemaPropsType["toothSettings"]) => import("react/jsx-runtime").JSX.Element | null;
14
+ export declare const renderCriticalLine: (toothSettings: SchemaPropsType["toothSettings"]) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { InteractiveTooltip as Component, type InteractiveTooltipProps } from ".";
3
+ type ComponentMeta = Meta<typeof Component>;
4
+ type ComponentStory = StoryObj<ComponentMeta>;
5
+ /**
6
+ * The InteractiveTooltip is a customizable tooltip component that displays additional information
7
+ * when hovering over an element. It supports rich content, including images, links, and custom styles.
8
+ *
9
+ * Just like the [RichTooltip](http://iot-staging-mm-react-storybook.s3-website-us-west-2.amazonaws.com/?path=/docs/components-tooltip-richtooltip--docs) component, this component is extended from MUI's [Tooltip](https://mui.com/material-ui/react-tooltip/) component along with its props.
10
+ */
11
+ declare const _default: {
12
+ component: ({ title, subtitle, image, imageLink, linkText, ...props }: InteractiveTooltipProps) => import("react/jsx-runtime").JSX.Element;
13
+ title: string;
14
+ args: {
15
+ children: import("react/jsx-runtime").JSX.Element;
16
+ open: true;
17
+ placement: "bottom-start";
18
+ arrow: true;
19
+ title: string;
20
+ subtitle: import("react/jsx-runtime").JSX.Element;
21
+ image: any;
22
+ imageLink: {
23
+ href: string;
24
+ target: "_blank";
25
+ };
26
+ linkText: string;
27
+ classes: {
28
+ tooltip: string;
29
+ };
30
+ };
31
+ };
32
+ export default _default;
33
+ export declare const Default: ComponentStory;
34
+ export declare const ClickToOpen: ComponentStory;
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { RichTooltip as Component } from ".";
3
+ type ComponentMeta = Meta<typeof Component>;
4
+ type ComponentStory = StoryObj<ComponentMeta>;
5
+ declare const meta: ComponentMeta;
6
+ export default meta;
7
+ export declare const TitleOnly: ComponentStory;
8
+ export declare const SubtitleOnly: ComponentStory;
9
+ export declare const TitleAndSubtitle: ComponentStory;
10
+ export declare const FullInfoWithInlineDetails: ComponentStory;
11
+ export declare const FullInfoWithBlockDetails: ComponentStory;
12
+ export declare const ClickToOpen: ComponentStory;
@@ -1,3 +1,3 @@
1
- export * from "./types.d.ts";
2
- export { Tooltip } from "./Tooltip.d.ts";
3
- export * from "./RichTooltip/index.d.ts";
1
+ export * from "./types";
2
+ export { Tooltip } from "./Tooltip";
3
+ export * from "./RichTooltip";
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Tooltip } from ".";
3
+ type ComponentMeta = Meta<typeof Tooltip>;
4
+ type ComponentStory = StoryObj<ComponentMeta>;
5
+ declare const meta: ComponentMeta;
6
+ export default meta;
7
+ export declare const Default: ComponentStory;
8
+ export declare const Square: ComponentStory;
@@ -1,4 +1,4 @@
1
- import type { useTooltipStyles } from "../../utils/styles";
1
+ import type { useTooltipStyles } from ":storybook/utils/styles";
2
2
  import type { TooltipProps as MuiTooltipProps } from "@mui/material";
3
3
  export interface TooltipProps extends Omit<MuiTooltipProps, "classes"> {
4
4
  offset?: number;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { UserInfo } from "../../models";
2
+ import type { UserInfo } from ":models";
3
3
  type UserInfoContext = Pick<UserInfo, "timeZone" | "units" | "dateFormat" | "timeFormat" | "language">;
4
4
  export declare const DEFAULT_USER: UserInfoContext;
5
5
  export declare const UserInfoContext: import("react").Context<UserInfoContext>;
@@ -2,4 +2,4 @@ import type { MutableRefObject } from "react";
2
2
  export default function useSize(target: MutableRefObject<HTMLElement | null>): {
3
3
  width: number;
4
4
  height: number;
5
- } | undefined;
5
+ };
@@ -9,5 +9,5 @@ export type ElementSize = {
9
9
  width: number;
10
10
  height: number;
11
11
  };
12
- export default function useSizeRef<T extends Element>(args?: UseSizeRefArgs): readonly [RefFn<T>, ElementSize | undefined];
12
+ export default function useSizeRef<T extends Element>(args?: UseSizeRefArgs): readonly [RefFn<T>, ElementSize];
13
13
  export {};
@@ -1,4 +1,4 @@
1
- import type { UserInfo } from "../../models";
1
+ import type { UserInfo } from ":models";
2
2
  type Timezone = UserInfo["timeZone"];
3
3
  export declare const useUserTimezone: (override?: Timezone) => string;
4
4
  export {};
@@ -1,7 +1,7 @@
1
- import type { UserInfo } from "../../models";
1
+ import type { UserInfo } from ":models";
2
2
  type UserUnits = UserInfo["units"];
3
3
  export declare const useUserUnits: (override?: Partial<UserUnits>) => {
4
- length: import("../../models").UserUnitLength;
4
+ length: import(":models").UserUnitLength;
5
5
  area: string;
6
6
  volume: string;
7
7
  mass: string;
@@ -0,0 +1,2 @@
1
+ export { Schema } from "./components/Schema/Schema";
2
+ export type { SchemaPropsType } from "./components/Schema/Schema.types";
@@ -4,7 +4,7 @@ declare const _default: {
4
4
  parameters: {
5
5
  docs: {
6
6
  source: {
7
- code: null;
7
+ code: any;
8
8
  };
9
9
  };
10
10
  };
@@ -1,4 +1,4 @@
1
- import type { borderRadiusStorybook } from "../../tokensV2/Border";
1
+ import type { borderRadiusStorybook } from ":storybook/tokensV2/Border";
2
2
  import type { borderRadiusPrimitives } from "./primitive";
3
3
  export type BorderRadiusPrimitiveTokenType = Record<number | string, number | string>;
4
4
  type BorderRadiusKeys = keyof typeof borderRadiusStorybook;
@@ -1,4 +1,4 @@
1
- import { type Colors, type WithoutPropsSuffix } from "../../components";
1
+ import { type Colors, type WithoutPropsSuffix } from ":storybook/components";
2
2
  import type { ColorVariants } from "./types";
3
3
  type ExtractNewVariants<T extends Record<string, {
4
4
  variants: unknown;
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ parameters: {
5
+ docs: {
6
+ source: {
7
+ code: any;
8
+ };
9
+ };
10
+ };
11
+ };
12
+ export default _default;
13
+ export declare const Docs: StoryObj;
@@ -1,4 +1,4 @@
1
- import type { HEXCode } from "../../Common.types";
1
+ import type { HEXCode } from ":storybook/Common.types";
2
2
  export type ColorVariants = {
3
3
  default: HEXCode;
4
4
  darkTheme: HEXCode;
@@ -0,0 +1,8 @@
1
+ import type { CommonStylingProps } from ":storybook/utils/styles";
2
+ import type { PropsWithChildren } from "react";
3
+ export { breakpoints, margins } from "./semantic";
4
+ export declare const ResponsiveGrid: ({ variant, className, children, ...props }: ResponsiveGridProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const breakpointVariants: readonly ["desktop", "laptop", "tablet", "mobile"];
6
+ type ResponsiveGridProps = PropsWithChildren<{
7
+ variant: (typeof breakpointVariants)[number];
8
+ }> & CommonStylingProps;
@@ -0,0 +1,19 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ /**
3
+ * The `ResponsiveGrid` component is used to create a responsive `div` wrapper around children elements.
4
+ * Its variants are the following along with their respective breakpoints (using css `max-width` property) and margins.
5
+ *
6
+ * However, there are some instances where we would like to use these tokens separately without the wrapper, hence the breakpoint and margin token are also exposed independently.
7
+ */
8
+ declare const _default: {
9
+ title: string;
10
+ parameters: {
11
+ docs: {
12
+ source: {
13
+ code: any;
14
+ };
15
+ };
16
+ };
17
+ };
18
+ export default _default;
19
+ export declare const Docs: StoryObj;
@@ -0,0 +1,18 @@
1
+ export declare enum breakpoints {
2
+ desktop = 1920,
3
+ laptop = 1280,
4
+ tablet = 960,
5
+ mobile = 600
6
+ }
7
+ export declare enum margins {
8
+ desktop = 24,
9
+ laptop = 24,
10
+ tablet = 16,
11
+ mobile = 16
12
+ }
13
+ export declare enum gutters {
14
+ desktop = 24,
15
+ laptop = 24,
16
+ tablet = 16,
17
+ mobile = 16
18
+ }
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ parameters: {
5
+ docs: {
6
+ source: {
7
+ code: any;
8
+ };
9
+ };
10
+ };
11
+ };
12
+ export default _default;
13
+ export declare const Docs: StoryObj;
@@ -0,0 +1,8 @@
1
+ export declare enum shadowSemantic {
2
+ shadow100 = "0px 1px 2px rgba(0, 0, 0, 0.20), 0px 1px 3px rgba(0, 0, 0, 0.15)",
3
+ shadow200 = "0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.20)",
4
+ shadow300 = "0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.20)",
5
+ shadow400 = "0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.20)",
6
+ shadow500 = "0px 6px 10px 4px rgba(0, 0, 0, 0.15), 0px 2px 3px 0px rgba(0, 0, 0, 0.20)",
7
+ shadow600 = "0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px 0px rgba(0, 0, 0, 0.20)"
8
+ }
@@ -1,4 +1,4 @@
1
- import type { CommonStylingProps } from "../../utils/styles";
1
+ import type { CommonStylingProps } from ":storybook/utils/styles";
2
2
  import type { PropsWithChildren } from "react";
3
3
  import type { oldTypographyVariants, typographyVariants } from "./constants";
4
4
  import * as oldTypographyStyles from "./oldStyles";
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ parameters: {
5
+ docs: {
6
+ source: {
7
+ code: any;
8
+ };
9
+ };
10
+ };
11
+ };
12
+ export default _default;
13
+ export declare const Docs: StoryObj;
@@ -1,2 +1,2 @@
1
- // Type-definitions-only re-export for tokens
2
- export {};
1
+ // Type definitions only - no runtime exports
2
+ module.exports = {};
@@ -0,0 +1 @@
1
+ export declare const getDesignKey: (tokenName: string) => string;
@@ -15,6 +15,6 @@ export type LinkWrapperV2Props = Omit<RouterLinkProps, "to"> & {
15
15
  * mechanism instead.
16
16
  */
17
17
  export declare const LinkWrapperV2: import("react").ForwardRefExoticComponent<Omit<RouterLinkProps<unknown>, "to"> & {
18
- external?: boolean | undefined;
19
- to?: import("history").LocationDescriptor<unknown> | ((location: import("history").Location<unknown>) => import("history").LocationDescriptor<unknown>) | undefined;
18
+ external?: boolean;
19
+ to?: RouterLinkProps["to"];
20
20
  } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,3 +1,3 @@
1
1
  import type { PaletteMode } from "@mui/material";
2
- import type { ColorVariants } from "../tokensV2";
2
+ import type { ColorVariants } from ":storybook/tokensV2";
3
3
  export declare const muiPalleteModeToColorVariant: Record<PaletteMode, keyof ColorVariants>;
@@ -0,0 +1,2 @@
1
+ export declare const EMPTY_ARRAY: any[];
2
+ export declare const EMPTY_OBJECT: {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Formats a timestamp with '@' between date and time.
3
+ * Examples:
4
+ * formatDateWithAt(1730710200, "MMM D HH:mm", "America/Vancouver")
5
+ * → "Nov 4 @ 12:30"
6
+ * formatDateWithAt(1730710200, "MM/DD HH:mm", "America/Vancouver")
7
+ * → "11/04 @ 12:30"
8
+ */
9
+ export declare function formatDateWithAt(timestamp: number, dateFormat: string, timezone: string): string;
@@ -0,0 +1 @@
1
+ export declare function getSbTokenTranslation(msg: string): string;
@@ -0,0 +1,7 @@
1
+ import type { StoryContext } from "@storybook/react";
2
+ export declare function isUsingDarkBackground(context: StoryContext<unknown>): boolean;
3
+ export declare function hideStoryArgsFields<TProps>(fields: (keyof TProps)[]): Record<keyof TProps, {
4
+ table: {
5
+ disable: boolean;
6
+ };
7
+ }>;
@@ -0,0 +1,10 @@
1
+ export declare const timeInSeconds: {
2
+ days: (days: number) => number;
3
+ hours: (hours: number) => number;
4
+ mins: (mins: number) => number;
5
+ };
6
+ export declare const timeInMs: {
7
+ days: (v: number) => number;
8
+ hours: (v: number) => number;
9
+ mins: (v: number) => number;
10
+ };
@@ -1,4 +1,4 @@
1
- import type { palette } from "../tokensV2";
1
+ import type { palette } from ":storybook/tokensV2";
2
2
  export declare function getWearOutPredictionTextAndColor(wearoutTime: number): {
3
3
  wearOutIn: string;
4
4
  suffix?: "day" | "days";
@@ -1,4 +1,4 @@
1
- import type { UserUnitLength } from "../../../models";
1
+ import type { UserUnitLength } from ":models";
2
2
  export type LengthDecimalPlaces = Record<UserUnitLength, number>;
3
3
  type ConvertLengthArgs = {
4
4
  from?: UserUnitLength;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { LinkWrapperPropsType, ComponentsMapType } from "./utils.types";
3
- import type { BaseIconPropsType } from "../components/Icon/Icon.types";
3
+ import type { BaseIconPropsType } from ":storybook/components/Icon/Icon.types";
4
4
  export declare const LinkWrapper: ({ isExternalLink, ...props }: LinkWrapperPropsType) => import("react/jsx-runtime").JSX.Element;
5
5
  export declare const createIconComponentsMapping: <T extends string>({ iconTypesCollection, iconsSVGCollection, }: ComponentsMapType<T>) => Record<string, React.FC<BaseIconPropsType>>;
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { LinkProps } from "react-router-dom";
3
- import type { BaseIconPropsType } from "../components/Icon/Icon.types";
3
+ import type { BaseIconPropsType } from ":storybook/components/Icon/Icon.types";
4
4
  export type LinkWrapperPropsType = ({
5
5
  isExternalLink: true;
6
6
  } & React.ComponentProps<"a">) | ({
@@ -0,0 +1,23 @@
1
+ import type { Draft } from "immer";
2
+ export declare const createZustandStore: <T>(initialStateCreator: () => T) => import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<import("zustand").StoreApi<T>, "setState"> & {
3
+ setState(nextStateOrUpdater: T | Partial<T> | ((state: Draft<T>) => void), shouldReplace?: boolean): void;
4
+ }>;
5
+ export declare function createZustandStoreWithActions<T extends object, U extends object>(state: T, actions: (set: {
6
+ (produceFn: (state: Draft<T>) => T | void): void;
7
+ (state: Partial<T>, shouldReplace?: boolean): void;
8
+ }, get: () => T) => U): import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<import("zustand").StoreApi<Omit<T, keyof U> & U>, "setState"> & {
9
+ setState(nextStateOrUpdater: (Omit<T, keyof U> & U) | Partial<Omit<T, keyof U> & U> | ((state: Draft<Omit<T, keyof U> & U>) => void), shouldReplace?: boolean): void;
10
+ }>;
11
+ export declare const createPersistZustandStore: <T>(initialStateCreator: () => T, persistStoreName: string) => import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<Omit<import("zustand").StoreApi<T>, "persist"> & {
12
+ persist: {
13
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<T, unknown>>) => void;
14
+ clearStorage: () => void;
15
+ rehydrate: () => void | Promise<void>;
16
+ hasHydrated: () => boolean;
17
+ onHydrate: (fn: (state: T) => void) => () => void;
18
+ onFinishHydration: (fn: (state: T) => void) => () => void;
19
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<T, unknown>>;
20
+ };
21
+ }, "setState"> & {
22
+ setState(nextStateOrUpdater: T | Partial<T> | ((state: Draft<T>) => void), shouldReplace?: boolean): void;
23
+ }>;
package/package.json CHANGED
@@ -1,34 +1,22 @@
1
1
  {
2
2
  "name": "@motionmetrics/mmpro-storybook-components-schema",
3
- "version": "2.0.30",
4
- "description": "Schema component package from @motionmetrics/mmpro-frontend-common. React 17-19 compatible.",
3
+ "version": "2.0.32",
4
+ "description": "Type definitions package for Schema, Icon, Tooltip components from @motionmetrics/mmpro-frontend-common. For actual component usage, import from the main @motionmetrics/mmpro-frontend-common package.",
5
5
  "main": "./lib/storybook/schema-entry.js",
6
6
  "module": "./lib/storybook/schema-entry.js",
7
7
  "types": "./lib/storybook/schema-entry.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./lib/storybook/schema-entry.d.ts",
11
- "import": "./lib/storybook/schema-entry.js",
12
- "require": "./lib/storybook/schema-entry.js",
13
- "default": "./lib/storybook/schema-entry.js"
10
+ "types": "./lib/storybook/schema-entry.d.ts"
14
11
  },
15
12
  "./schema": {
16
- "types": "./lib/storybook/components/Schema/index.d.ts",
17
- "import": "./lib/storybook/components/Schema/index.js",
18
- "require": "./lib/storybook/components/Schema/index.js",
19
- "default": "./lib/storybook/components/Schema/index.js"
13
+ "types": "./lib/storybook/components/Schema/index.d.ts"
20
14
  },
21
15
  "./icon": {
22
- "types": "./lib/storybook/components/Icon/index.d.ts",
23
- "import": "./lib/storybook/components/Icon/index.js",
24
- "require": "./lib/storybook/components/Icon/index.js",
25
- "default": "./lib/storybook/components/Icon/index.js"
16
+ "types": "./lib/storybook/components/Icon/index.d.ts"
26
17
  },
27
18
  "./tokens": {
28
- "types": "./lib/storybook/tokensV2/index.d.ts",
29
- "import": "./lib/storybook/tokensV2/index.js",
30
- "require": "./lib/storybook/tokensV2/index.js",
31
- "default": "./lib/storybook/tokensV2/index.js"
19
+ "types": "./lib/storybook/tokensV2/index.d.ts"
32
20
  }
33
21
  },
34
22
  "files": [
@@ -1,2 +0,0 @@
1
- // Icon component exports
2
- export * from './index.d.ts';
@@ -1,2 +0,0 @@
1
- // Schema component exports
2
- export * from './index.d.ts';
@@ -1,3 +0,0 @@
1
- // Main entry point - re-exports Schema and Icon components
2
- export * from './components/Schema/index.js';
3
- export * from './components/Icon/index.js';