@spark-web/text 2.0.0-rc.1 → 2.0.0-rc.11
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 +130 -0
- package/dist/declarations/src/context.d.ts +2 -2
- package/dist/declarations/src/default-text-props.d.ts +1 -1
- package/dist/declarations/src/text.d.ts +1 -1
- package/dist/declarations/src/use-text.d.ts +1 -1
- package/dist/spark-web-text.cjs.dev.js +7 -7
- package/dist/spark-web-text.cjs.prod.js +7 -7
- package/dist/spark-web-text.esm.js +7 -7
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,135 @@
|
|
|
1
1
|
# @spark-web/text
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.11
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- test
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies []:
|
|
12
|
+
- @spark-web/theme@4.0.0-rc.11
|
|
13
|
+
- @spark-web/utils@2.0.0-rc.11
|
|
14
|
+
- @spark-web/box@2.0.0-rc.11
|
|
15
|
+
|
|
16
|
+
## 2.0.0-rc.10
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- test
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies []:
|
|
25
|
+
- @spark-web/theme@4.0.0-rc.10
|
|
26
|
+
- @spark-web/utils@2.0.0-rc.10
|
|
27
|
+
- @spark-web/box@2.0.0-rc.10
|
|
28
|
+
|
|
29
|
+
## 2.0.0-rc.9
|
|
30
|
+
|
|
31
|
+
### Major Changes
|
|
32
|
+
|
|
33
|
+
- test
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies []:
|
|
38
|
+
- @spark-web/theme@4.0.0-rc.9
|
|
39
|
+
- @spark-web/utils@2.0.0-rc.9
|
|
40
|
+
- @spark-web/box@2.0.0-rc.9
|
|
41
|
+
|
|
42
|
+
## 2.0.0-rc.8
|
|
43
|
+
|
|
44
|
+
### Major Changes
|
|
45
|
+
|
|
46
|
+
- test
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies []:
|
|
51
|
+
- @spark-web/theme@4.0.0-rc.8
|
|
52
|
+
- @spark-web/utils@2.0.0-rc.8
|
|
53
|
+
- @spark-web/box@2.0.0-rc.8
|
|
54
|
+
|
|
55
|
+
## 2.0.0-rc.7
|
|
56
|
+
|
|
57
|
+
### Major Changes
|
|
58
|
+
|
|
59
|
+
- test
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Updated dependencies []:
|
|
64
|
+
- @spark-web/theme@4.0.0-rc.7
|
|
65
|
+
- @spark-web/utils@2.0.0-rc.7
|
|
66
|
+
- @spark-web/box@2.0.0-rc.7
|
|
67
|
+
|
|
68
|
+
## 2.0.0-rc.6
|
|
69
|
+
|
|
70
|
+
### Major Changes
|
|
71
|
+
|
|
72
|
+
- test
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Updated dependencies []:
|
|
77
|
+
- @spark-web/theme@4.0.0-rc.6
|
|
78
|
+
- @spark-web/utils@2.0.0-rc.6
|
|
79
|
+
- @spark-web/box@2.0.0-rc.6
|
|
80
|
+
|
|
81
|
+
## 2.0.0-rc.5
|
|
82
|
+
|
|
83
|
+
### Major Changes
|
|
84
|
+
|
|
85
|
+
- test
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies []:
|
|
90
|
+
- @spark-web/theme@4.0.0-rc.5
|
|
91
|
+
- @spark-web/utils@2.0.0-rc.5
|
|
92
|
+
- @spark-web/box@2.0.0-rc.5
|
|
93
|
+
|
|
94
|
+
## 2.0.0-rc.4
|
|
95
|
+
|
|
96
|
+
### Major Changes
|
|
97
|
+
|
|
98
|
+
- bug
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- Updated dependencies []:
|
|
103
|
+
- @spark-web/theme@4.0.0-rc.4
|
|
104
|
+
- @spark-web/utils@2.0.0-rc.4
|
|
105
|
+
- @spark-web/box@2.0.0-rc.4
|
|
106
|
+
|
|
107
|
+
## 2.0.0-rc.3
|
|
108
|
+
|
|
109
|
+
### Major Changes
|
|
110
|
+
|
|
111
|
+
- upgrade package
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Updated dependencies []:
|
|
116
|
+
- @spark-web/theme@4.0.0-rc.3
|
|
117
|
+
- @spark-web/utils@2.0.0-rc.3
|
|
118
|
+
- @spark-web/box@2.0.0-rc.3
|
|
119
|
+
|
|
120
|
+
## 2.0.0-rc.2
|
|
121
|
+
|
|
122
|
+
### Major Changes
|
|
123
|
+
|
|
124
|
+
- add parser
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- Updated dependencies []:
|
|
129
|
+
- @spark-web/theme@4.0.0-rc.2
|
|
130
|
+
- @spark-web/utils@2.0.0-rc.2
|
|
131
|
+
- @spark-web/box@2.0.0-rc.2
|
|
132
|
+
|
|
3
133
|
## 2.0.0-rc.1
|
|
4
134
|
|
|
5
135
|
### Major Changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const TextContext: import("react").Context<{
|
|
3
3
|
size: "small" | "xsmall" | "standard" | "large";
|
|
4
|
-
tone: "
|
|
4
|
+
tone: "disabled" | "link" | "muted" | "fieldAccent" | "accent" | "neutral" | "primary" | "secondary" | "caution" | "critical" | "info" | "positive" | "placeholder" | "primaryHover" | "primaryActive" | "secondaryHover" | "secondaryActive";
|
|
5
5
|
weight: "regular" | "semibold";
|
|
6
6
|
} | undefined>;
|
|
7
7
|
export declare function useTextContext(): {
|
|
8
8
|
size: "small" | "xsmall" | "standard" | "large";
|
|
9
|
-
tone: "
|
|
9
|
+
tone: "disabled" | "link" | "muted" | "fieldAccent" | "accent" | "neutral" | "primary" | "secondary" | "caution" | "critical" | "info" | "positive" | "placeholder" | "primaryHover" | "primaryActive" | "secondaryHover" | "secondaryActive";
|
|
10
10
|
weight: "regular" | "semibold";
|
|
11
11
|
} | undefined;
|
|
@@ -10,7 +10,7 @@ export declare function DefaultTextPropsProvider({ children, size, tone, weight,
|
|
|
10
10
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare const useDefaultTextProps: ({ size: sizeProp, tone: toneProp, weight: weightProp, }: DefaultTextProps) => {
|
|
12
12
|
size: "small" | "xsmall" | "standard" | "large";
|
|
13
|
-
tone: "
|
|
13
|
+
tone: "disabled" | "link" | "muted" | "fieldAccent" | "accent" | "neutral" | "primary" | "secondary" | "caution" | "critical" | "info" | "positive" | "placeholder" | "primaryHover" | "primaryActive" | "secondaryHover" | "secondaryActive";
|
|
14
14
|
weight: "regular" | "semibold";
|
|
15
15
|
};
|
|
16
16
|
export {};
|
|
@@ -30,6 +30,6 @@ export declare type TextProps = Partial<UseTextProps> & {
|
|
|
30
30
|
} & (InlineProps | BlockProps);
|
|
31
31
|
export declare const Text: <Comp extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "div">(props: {
|
|
32
32
|
as?: Comp | undefined;
|
|
33
|
-
ref?: import("react").Ref<Comp extends "symbol" | "
|
|
33
|
+
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;
|
|
34
34
|
} & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & TextProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
35
35
|
export {};
|
|
@@ -10,7 +10,7 @@ export declare type UseTextProps = {
|
|
|
10
10
|
/** The weight of the text. */
|
|
11
11
|
weight: keyof BrighteTheme['typography']['fontWeight'];
|
|
12
12
|
};
|
|
13
|
-
export declare function useText({ baseline, size, tone, weight }: UseTextProps):
|
|
13
|
+
export declare function useText({ baseline, size, tone, weight }: UseTextProps): (import("@emotion/serialize").CSSObject | undefined)[];
|
|
14
14
|
export declare function createTextStyles({ fontSize, lineHeight, trims }: BrighteTextDefinition, { includeTrims }?: {
|
|
15
15
|
includeTrims?: boolean | undefined;
|
|
16
16
|
}): {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var react = require('react');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
7
7
|
var react$1 = require('@emotion/react');
|
|
8
8
|
var theme = require('@spark-web/theme');
|
|
9
9
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
@@ -33,7 +33,7 @@ function DefaultTextPropsProvider(_ref) {
|
|
|
33
33
|
weight: weight
|
|
34
34
|
};
|
|
35
35
|
}, [size, tone, weight]);
|
|
36
|
-
return
|
|
36
|
+
return jsxRuntime.jsx(DefaultTextPropsContext.Provider, {
|
|
37
37
|
value: defaultTextProps,
|
|
38
38
|
children: children
|
|
39
39
|
});
|
|
@@ -60,7 +60,7 @@ var Strong = function Strong(_ref) {
|
|
|
60
60
|
var styles = {
|
|
61
61
|
fontWeight: theme$1.typography.fontWeight.semibold
|
|
62
62
|
};
|
|
63
|
-
return
|
|
63
|
+
return jsxRuntime.jsx("strong", {
|
|
64
64
|
css: react$1.css(styles),
|
|
65
65
|
children: children
|
|
66
66
|
});
|
|
@@ -207,7 +207,7 @@ var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
207
207
|
|
|
208
208
|
// early exit for inline variant
|
|
209
209
|
if (inline) {
|
|
210
|
-
return
|
|
210
|
+
return jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, {
|
|
211
211
|
as: as !== null && as !== void 0 ? as : 'span',
|
|
212
212
|
data: data,
|
|
213
213
|
ref: forwardedRef,
|
|
@@ -218,7 +218,7 @@ var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
// prepare block variant
|
|
221
|
-
var content = overflowStrategy ?
|
|
221
|
+
var content = overflowStrategy ? jsxRuntime.jsx("span", {
|
|
222
222
|
css: react$1.css(overflowStyles),
|
|
223
223
|
children: children
|
|
224
224
|
}) : children;
|
|
@@ -229,9 +229,9 @@ var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
229
229
|
weight: weight
|
|
230
230
|
};
|
|
231
231
|
}, [size, tone, weight]);
|
|
232
|
-
return
|
|
232
|
+
return jsxRuntime.jsx(TextContext.Provider, {
|
|
233
233
|
value: textContextValue,
|
|
234
|
-
children:
|
|
234
|
+
children: jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, {
|
|
235
235
|
as: as,
|
|
236
236
|
data: data,
|
|
237
237
|
ref: forwardedRef,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var react = require('react');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
7
7
|
var react$1 = require('@emotion/react');
|
|
8
8
|
var theme = require('@spark-web/theme');
|
|
9
9
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
@@ -33,7 +33,7 @@ function DefaultTextPropsProvider(_ref) {
|
|
|
33
33
|
weight: weight
|
|
34
34
|
};
|
|
35
35
|
}, [size, tone, weight]);
|
|
36
|
-
return
|
|
36
|
+
return jsxRuntime.jsx(DefaultTextPropsContext.Provider, {
|
|
37
37
|
value: defaultTextProps,
|
|
38
38
|
children: children
|
|
39
39
|
});
|
|
@@ -60,7 +60,7 @@ var Strong = function Strong(_ref) {
|
|
|
60
60
|
var styles = {
|
|
61
61
|
fontWeight: theme$1.typography.fontWeight.semibold
|
|
62
62
|
};
|
|
63
|
-
return
|
|
63
|
+
return jsxRuntime.jsx("strong", {
|
|
64
64
|
css: react$1.css(styles),
|
|
65
65
|
children: children
|
|
66
66
|
});
|
|
@@ -207,7 +207,7 @@ var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
207
207
|
|
|
208
208
|
// early exit for inline variant
|
|
209
209
|
if (inline) {
|
|
210
|
-
return
|
|
210
|
+
return jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, {
|
|
211
211
|
as: as !== null && as !== void 0 ? as : 'span',
|
|
212
212
|
data: data,
|
|
213
213
|
ref: forwardedRef,
|
|
@@ -218,7 +218,7 @@ var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
// prepare block variant
|
|
221
|
-
var content = overflowStrategy ?
|
|
221
|
+
var content = overflowStrategy ? jsxRuntime.jsx("span", {
|
|
222
222
|
css: react$1.css(overflowStyles),
|
|
223
223
|
children: children
|
|
224
224
|
}) : children;
|
|
@@ -229,9 +229,9 @@ var Text = ts.forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
229
229
|
weight: weight
|
|
230
230
|
};
|
|
231
231
|
}, [size, tone, weight]);
|
|
232
|
-
return
|
|
232
|
+
return jsxRuntime.jsx(TextContext.Provider, {
|
|
233
233
|
value: textContextValue,
|
|
234
|
-
children:
|
|
234
|
+
children: jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread({}, consumerProps), {}, {
|
|
235
235
|
as: as,
|
|
236
236
|
data: data,
|
|
237
237
|
ref: forwardedRef,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext, useMemo } from 'react';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useTheme } from '@spark-web/theme';
|
|
5
5
|
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
|
|
@@ -29,7 +29,7 @@ function DefaultTextPropsProvider(_ref) {
|
|
|
29
29
|
weight: weight
|
|
30
30
|
};
|
|
31
31
|
}, [size, tone, weight]);
|
|
32
|
-
return
|
|
32
|
+
return jsx(DefaultTextPropsContext.Provider, {
|
|
33
33
|
value: defaultTextProps,
|
|
34
34
|
children: children
|
|
35
35
|
});
|
|
@@ -56,7 +56,7 @@ var Strong = function Strong(_ref) {
|
|
|
56
56
|
var styles = {
|
|
57
57
|
fontWeight: theme.typography.fontWeight.semibold
|
|
58
58
|
};
|
|
59
|
-
return
|
|
59
|
+
return jsx("strong", {
|
|
60
60
|
css: css(styles),
|
|
61
61
|
children: children
|
|
62
62
|
});
|
|
@@ -203,7 +203,7 @@ var Text = forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
203
203
|
|
|
204
204
|
// early exit for inline variant
|
|
205
205
|
if (inline) {
|
|
206
|
-
return
|
|
206
|
+
return jsx(Box, _objectSpread(_objectSpread({}, consumerProps), {}, {
|
|
207
207
|
as: as !== null && as !== void 0 ? as : 'span',
|
|
208
208
|
data: data,
|
|
209
209
|
ref: forwardedRef,
|
|
@@ -214,7 +214,7 @@ var Text = forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
// prepare block variant
|
|
217
|
-
var content = overflowStrategy ?
|
|
217
|
+
var content = overflowStrategy ? jsx("span", {
|
|
218
218
|
css: css(overflowStyles),
|
|
219
219
|
children: children
|
|
220
220
|
}) : children;
|
|
@@ -225,9 +225,9 @@ var Text = forwardRefWithAs(function (_ref, forwardedRef) {
|
|
|
225
225
|
weight: weight
|
|
226
226
|
};
|
|
227
227
|
}, [size, tone, weight]);
|
|
228
|
-
return
|
|
228
|
+
return jsx(TextContext.Provider, {
|
|
229
229
|
value: textContextValue,
|
|
230
|
-
children:
|
|
230
|
+
children: jsx(Box, _objectSpread(_objectSpread({}, consumerProps), {}, {
|
|
231
231
|
as: as,
|
|
232
232
|
data: data,
|
|
233
233
|
ref: forwardedRef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-web/text",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.11",
|
|
4
4
|
"homepage": "https://github.com/brighte-labs/spark-web#readme",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.25.0",
|
|
19
|
-
"@emotion/react": "^11.
|
|
20
|
-
"@spark-web/box": "^2.0.0-rc.
|
|
21
|
-
"@spark-web/theme": "^4.0.0-rc.
|
|
22
|
-
"@spark-web/utils": "^2.0.0-rc.
|
|
19
|
+
"@emotion/react": "^11.14.0",
|
|
20
|
+
"@spark-web/box": "^2.0.0-rc.11",
|
|
21
|
+
"@spark-web/theme": "^4.0.0-rc.11",
|
|
22
|
+
"@spark-web/utils": "^2.0.0-rc.11"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/react": "^18.2.0",
|