@spark-web/text 5.2.3 → 5.3.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/CHANGELOG.md +16 -0
- package/dist/declarations/src/context.d.ts +6 -7
- package/dist/declarations/src/default-text-props.d.ts +4 -4
- package/dist/declarations/src/strong.d.ts +1 -1
- package/dist/declarations/src/text.d.ts +5 -6
- package/dist/declarations/src/use-foreground-tone.d.ts +1 -1
- package/dist/declarations/src/use-overflow-strategy.d.ts +1 -1
- package/dist/declarations/src/use-text.d.ts +1 -1
- package/dist/spark-web-text.cjs.d.ts +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @spark-web/text
|
|
2
2
|
|
|
3
|
+
## 5.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#667](https://github.com/brighte-labs/spark-web/pull/667)
|
|
8
|
+
[`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)
|
|
9
|
+
Thanks [@Leo704099](https://github.com/Leo704099)! - Support react 17 to 19
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
[[`80d9c15`](https://github.com/brighte-labs/spark-web/commit/80d9c156a40bbcd2b1a91a2d0403b3c8e9b47b4e)]:
|
|
15
|
+
- @spark-web/theme@5.13.0
|
|
16
|
+
- @spark-web/utils@5.1.0
|
|
17
|
+
- @spark-web/box@6.0.0
|
|
18
|
+
|
|
3
19
|
## 5.2.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const TextContext: import("react").Context<{
|
|
3
|
-
size: import("@spark-web/theme/src/themes/_types/typography").TypographySizing
|
|
4
|
-
tone: string | number
|
|
5
|
-
weight: "bold" | "medium" | "light" | "thin" | "black" | "extralight" | "regular" | "semibold" | "extrabold" | undefined;
|
|
2
|
+
size: NonNullable<import("@spark-web/theme/src/themes/_types/typography").TypographySizing>;
|
|
3
|
+
tone: NonNullable<string | number>;
|
|
4
|
+
weight: NonNullable<"bold" | "medium" | "light" | "thin" | "black" | "extralight" | "regular" | "semibold" | "extrabold" | undefined> | undefined;
|
|
6
5
|
} | undefined>;
|
|
7
6
|
export declare function useTextContext(): {
|
|
8
|
-
size: import("@spark-web/theme/src/themes/_types/typography").TypographySizing
|
|
9
|
-
tone: string | number
|
|
10
|
-
weight: "bold" | "medium" | "light" | "thin" | "black" | "extralight" | "regular" | "semibold" | "extrabold" | undefined;
|
|
7
|
+
size: NonNullable<import("@spark-web/theme/src/themes/_types/typography").TypographySizing>;
|
|
8
|
+
tone: NonNullable<string | number>;
|
|
9
|
+
weight: NonNullable<"bold" | "medium" | "light" | "thin" | "black" | "extralight" | "regular" | "semibold" | "extrabold" | undefined> | undefined;
|
|
11
10
|
} | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { UseTextProps } from "./use-text.js";
|
|
3
|
-
|
|
3
|
+
type DefaultTextProps = {
|
|
4
4
|
size?: NonNullable<UseTextProps['size']>;
|
|
5
5
|
tone?: NonNullable<UseTextProps['tone']>;
|
|
6
6
|
weight?: NonNullable<UseTextProps['weight']>;
|
|
@@ -9,8 +9,8 @@ export declare function DefaultTextPropsProvider({ children, size, tone, weight,
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare const useDefaultTextProps: ({ size: sizeProp, tone: toneProp, weight: weightProp, }: DefaultTextProps) => {
|
|
12
|
-
size: import("@spark-web/theme/src/themes/_types/typography").TypographySizing
|
|
13
|
-
tone: string | number
|
|
14
|
-
weight: "bold" | "medium" | "light" | "thin" | "black" | "extralight" | "regular" | "semibold" | "extrabold" | undefined;
|
|
12
|
+
size: NonNullable<import("@spark-web/theme/src/themes/_types/typography").TypographySizing>;
|
|
13
|
+
tone: NonNullable<string | number>;
|
|
14
|
+
weight: NonNullable<"bold" | "medium" | "light" | "thin" | "black" | "extralight" | "regular" | "semibold" | "extrabold" | undefined> | undefined;
|
|
15
15
|
};
|
|
16
16
|
export {};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
/** @jsxImportSource @emotion/react */
|
|
2
1
|
import type { CSSObject } from '@emotion/react';
|
|
3
2
|
import type { BoxProps } from '@spark-web/box';
|
|
4
3
|
import type { DataAttributeMap } from '@spark-web/utils/internal';
|
|
5
4
|
import type { CSSProperties, ReactNode } from 'react';
|
|
6
5
|
import type { TextOverflowStrategy } from "./use-overflow-strategy.js";
|
|
7
6
|
import type { UseTextProps } from "./use-text.js";
|
|
8
|
-
|
|
7
|
+
type InlineProps = {
|
|
9
8
|
align?: never;
|
|
10
9
|
/** Display as an inline element. */
|
|
11
10
|
inline?: boolean;
|
|
12
11
|
overflowStrategy?: never;
|
|
13
12
|
};
|
|
14
|
-
|
|
13
|
+
type BlockProps = {
|
|
15
14
|
/** The horizontal alignment. */
|
|
16
15
|
align?: 'left' | 'center' | 'right';
|
|
17
16
|
inline?: never;
|
|
18
17
|
/** Manage how text behaves with regard to overflow. */
|
|
19
18
|
overflowStrategy?: TextOverflowStrategy;
|
|
20
19
|
};
|
|
21
|
-
export
|
|
20
|
+
export type TextProps = Partial<UseTextProps> & {
|
|
22
21
|
/** The text content. */
|
|
23
22
|
children?: ReactNode;
|
|
24
23
|
/** Customizes the component element. */
|
|
@@ -35,8 +34,8 @@ export declare type TextProps = Partial<UseTextProps> & {
|
|
|
35
34
|
* such that the total number of lines does not exceed this number. */
|
|
36
35
|
numberOfLines?: number;
|
|
37
36
|
} & (InlineProps | BlockProps);
|
|
38
|
-
export declare const Text: <Comp extends import("react").ElementType
|
|
37
|
+
export declare const Text: <Comp extends import("react").ElementType = "div">(props: {
|
|
39
38
|
as?: Comp | undefined;
|
|
40
39
|
ref?: import("react").Ref<Comp extends "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
|
|
41
|
-
} & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & TextProps) => import("react").ReactElement
|
|
40
|
+
} & (Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & TextProps)) => import("react").ReactElement;
|
|
42
41
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SparkTheme } from '@spark-web/theme';
|
|
2
|
-
export
|
|
2
|
+
export type ForegroundTone = keyof Omit<SparkTheme['color']['foreground'], 'neutralInverted' | 'mutedInverted'>;
|
|
3
3
|
export declare function useForegroundTone(tone: ForegroundTone): string;
|
|
@@ -15,7 +15,7 @@ declare const strategyMap: {
|
|
|
15
15
|
readonly wordWrap: "break-word";
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type TextOverflowStrategy = keyof typeof strategyMap;
|
|
19
19
|
export declare function useOverflowStrategy(strategy?: TextOverflowStrategy): {
|
|
20
20
|
readonly whiteSpace: "nowrap";
|
|
21
21
|
} | {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SparkTextDefinition, SparkTheme } from '@spark-web/theme';
|
|
2
2
|
import type { ForegroundTone } from "./use-foreground-tone.js";
|
|
3
|
-
export
|
|
3
|
+
export type UseTextProps = {
|
|
4
4
|
/** Apply leading-trim styles. */
|
|
5
5
|
baseline?: boolean;
|
|
6
6
|
/** The size of the text. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./declarations/src/index";
|
|
1
|
+
export * from "./declarations/src/index.js";
|
|
2
2
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Bhcmstd2ViLXRleHQuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-web/text",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"homepage": "https://github.com/brighte-labs/spark-web#readme",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.25.0",
|
|
19
19
|
"@emotion/react": "^11.14.0",
|
|
20
|
-
"@spark-web/box": "^
|
|
21
|
-
"@spark-web/theme": "^5.
|
|
22
|
-
"@spark-web/utils": "^5.
|
|
20
|
+
"@spark-web/box": "^6.0.0",
|
|
21
|
+
"@spark-web/theme": "^5.13.0",
|
|
22
|
+
"@spark-web/utils": "^5.1.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/react": "^
|
|
26
|
-
"react": "^
|
|
25
|
+
"@types/react": "^19.1.0",
|
|
26
|
+
"react": "^19.1.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "
|
|
29
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=14"
|