@stackshift-ui/text 7.0.0-beta.1 → 7.0.0-beta.3
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/dist/chunk-C72DM3VV.mjs +55 -0
- package/package.json +4 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// src/text.tsx
|
|
2
|
+
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var displayName = "Text";
|
|
6
|
+
var Text = ({
|
|
7
|
+
type = "p",
|
|
8
|
+
style,
|
|
9
|
+
muted = false,
|
|
10
|
+
weight = "normal",
|
|
11
|
+
fontSize = "base",
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
as = "p",
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
19
|
+
const fontSizeMap = {
|
|
20
|
+
xs: "text-xs",
|
|
21
|
+
sm: "text-sm",
|
|
22
|
+
base: "text-base",
|
|
23
|
+
lg: "text-lg",
|
|
24
|
+
xl: "text-xl",
|
|
25
|
+
"2xl": "text-2xl",
|
|
26
|
+
"3xl": "text-3xl",
|
|
27
|
+
"4xl": "text-4xl",
|
|
28
|
+
"5xl": "text-5xl",
|
|
29
|
+
"6xl": "text-6xl"
|
|
30
|
+
};
|
|
31
|
+
const fontWeightMap = {
|
|
32
|
+
thin: "font-thin",
|
|
33
|
+
extralight: "font-extralight",
|
|
34
|
+
light: "font-light",
|
|
35
|
+
normal: "font-normal",
|
|
36
|
+
semibold: "font-semibold",
|
|
37
|
+
bold: "font-bold",
|
|
38
|
+
medium: "font-medium",
|
|
39
|
+
extrabold: "font-extrabold",
|
|
40
|
+
black: "font-black"
|
|
41
|
+
};
|
|
42
|
+
const size = fontSizeMap[fontSize] || "text-base";
|
|
43
|
+
const fontWeight = fontWeightMap[weight] || "font-normal";
|
|
44
|
+
const commonClass = `${size} ${fontWeight} ${muted && "text-gray-500"}`;
|
|
45
|
+
const variants = {
|
|
46
|
+
p: commonClass
|
|
47
|
+
};
|
|
48
|
+
const variantClass = (_a = variants[type]) != null ? _a : variants.p;
|
|
49
|
+
return /* @__PURE__ */ jsx(Component, { as, className: cn(variantClass, className), style, ...props, children });
|
|
50
|
+
};
|
|
51
|
+
Text.displayName = displayName;
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
Text
|
|
55
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/text",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "7.0.0-beta.
|
|
4
|
+
"version": "7.0.0-beta.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"classnames": "^2.5.1",
|
|
37
|
-
"@stackshift-ui/
|
|
38
|
-
"@stackshift-ui/
|
|
37
|
+
"@stackshift-ui/system": "6.1.0-beta.3",
|
|
38
|
+
"@stackshift-ui/scripts": "6.1.0-beta.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@types/react": "16.8 - 19",
|
|
42
42
|
"next": "10 - 14",
|
|
43
43
|
"react": "16.8 - 19",
|
|
44
44
|
"react-dom": "16.8 - 19",
|
|
45
|
-
"@stackshift-ui/system": ">=6.1.0-beta.
|
|
45
|
+
"@stackshift-ui/system": ">=6.1.0-beta.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"next": {
|