@mappedin/viewer 0.30.6 → 0.30.7-ec2bc30.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.
@@ -1,4 +1,5 @@
1
1
  import { TTheme } from '../../lib/types/theme';
2
+ import { ComponentProps, PropsWithChildren } from 'react';
2
3
  type TFontProps = {
3
4
  theme?: TTheme;
4
5
  strokeWidth?: number;
@@ -9,9 +10,23 @@ type TFontProps = {
9
10
  export declare const fontStyle: import("styled-components").RuleSet<TFontProps>;
10
11
  export declare const textwrapStyle: import("styled-components").RuleSet<object>;
11
12
  export declare const Text: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, TFontProps>>;
13
+ /**
14
+ * Style a substring within a string a different color.
15
+ */
12
16
  export declare const PartialHighlight: React.FC<TFontProps & {
13
17
  substr?: string | string[];
14
18
  str: string;
15
19
  style?: React.CSSProperties;
16
20
  }>;
21
+ type TDynamicallySizedTextProps = {
22
+ textProps?: Omit<ComponentProps<typeof Text>, 'children'>;
23
+ width: number | string;
24
+ maxFontSize?: number;
25
+ minFontSize?: number;
26
+ debug?: boolean;
27
+ };
28
+ /**
29
+ * Dynamically size text to fit within a container.
30
+ */
31
+ export declare const DynamicallySizedText: React.FC<PropsWithChildren<TDynamicallySizedTextProps>>;
17
32
  export {};
@@ -1,2 +1,4 @@
1
1
  import { Story } from '@ladle/react';
2
+ export declare const Default: Story;
2
3
  export declare const Bold: Story;
4
+ export declare const DynamicSizing: Story;
@@ -0,0 +1,2 @@
1
+ declare const useDebouncedValue: <T>(value: T, delay: number) => T;
2
+ export default useDebouncedValue;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Return the previous value of a state variable.
3
+ */
4
+ declare const usePrevious: <T>(value: T) => T | null;
5
+ export default usePrevious;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Respond to the size of an element using a ResizeObserver.
3
+ */
4
+ declare const useResponsiveSize: () => {
5
+ elementRef: (ref: unknown) => void;
6
+ width: number;
7
+ height: number;
8
+ };
9
+ export default useResponsiveSize;
@@ -1,6 +1,13 @@
1
1
  type TUseSizeOptions = {
2
2
  dependencies?: any[];
3
3
  };
4
+ /**
5
+ * Read the size of a statically sized element. Optionally specify an array of dependencies
6
+ * to re-read the size when they change.
7
+ *
8
+ * To respond to continous size changes without a well defined set of dependencies, use
9
+ * {@link useResponsiveSize} instead.
10
+ */
4
11
  declare const useSize: ({ dependencies }?: TUseSizeOptions) => {
5
12
  elementRef: (ref: unknown) => void;
6
13
  width: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.30.6",
3
+ "version": "0.30.7-ec2bc30.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",