@ttoss/ui 0.9.1 → 0.9.2
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/package.json +6 -4
- package/src/components/Card/Card.tsx +3 -0
- package/src/index.ts +1 -0
- package/dist/esm/index.js +0 -113
- package/dist/index.d.ts +0 -18
- package/dist/index.js +0 -154
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"dev": "yarn workspace @ttoss/storybook run dev"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@emotion/react": "^11",
|
|
36
|
+
"@emotion/styled": "^11",
|
|
35
37
|
"@theme-ui/components": "^0.13.1",
|
|
36
38
|
"@theme-ui/core": "^0.13.1"
|
|
37
39
|
},
|
|
@@ -39,8 +41,8 @@
|
|
|
39
41
|
"react": ">=16.8.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
|
-
"@ttoss/config": "^0.9.
|
|
43
|
-
"@ttoss/test-utils": "^0.9.
|
|
44
|
+
"@ttoss/config": "^0.9.2",
|
|
45
|
+
"@ttoss/test-utils": "^0.9.2"
|
|
44
46
|
},
|
|
45
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6a904124b42ad72f3ba318ec42b861f803acb218"
|
|
46
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { useTheme } from './theme/useTheme';
|
|
|
7
7
|
|
|
8
8
|
export { default as Box, BoxProps } from './components/Box/Box';
|
|
9
9
|
export { default as Button, ButtonProps } from './components/Button/Button';
|
|
10
|
+
export { default as Card, CardProps } from './components/Card/Card';
|
|
10
11
|
export { default as Flex, FlexProps } from './components/Flex/Flex';
|
|
11
12
|
export {
|
|
12
13
|
default as FormField,
|
package/dist/esm/index.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// tsup.inject.js
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
// src/theme/ThemeProvider.tsx
|
|
5
|
-
import {
|
|
6
|
-
ThemeProvider as ThemeUiProvider,
|
|
7
|
-
merge
|
|
8
|
-
} from "@theme-ui/core";
|
|
9
|
-
import * as React2 from "react";
|
|
10
|
-
|
|
11
|
-
// src/theme/defaultTheme.ts
|
|
12
|
-
var defaultTheme = {
|
|
13
|
-
colors: {
|
|
14
|
-
text: "#000",
|
|
15
|
-
background: "#fff",
|
|
16
|
-
primary: "#07c",
|
|
17
|
-
secondary: "#639",
|
|
18
|
-
gray: "#555"
|
|
19
|
-
},
|
|
20
|
-
buttons: {
|
|
21
|
-
primary: {
|
|
22
|
-
color: "background",
|
|
23
|
-
bg: "primary"
|
|
24
|
-
},
|
|
25
|
-
secondary: {
|
|
26
|
-
color: "background",
|
|
27
|
-
bg: "secondary"
|
|
28
|
-
},
|
|
29
|
-
gray: {
|
|
30
|
-
color: "background",
|
|
31
|
-
bg: "gray"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// src/theme/ThemeProvider.tsx
|
|
37
|
-
var ThemeProvider = ({
|
|
38
|
-
children,
|
|
39
|
-
theme = {}
|
|
40
|
-
}) => {
|
|
41
|
-
const mergedTheme = React2.useMemo(() => {
|
|
42
|
-
if (typeof theme === "function") {
|
|
43
|
-
return theme;
|
|
44
|
-
}
|
|
45
|
-
return merge(defaultTheme, theme);
|
|
46
|
-
}, [theme]);
|
|
47
|
-
return /* @__PURE__ */ React2.createElement(ThemeUiProvider, {
|
|
48
|
-
theme: mergedTheme
|
|
49
|
-
}, children);
|
|
50
|
-
};
|
|
51
|
-
var ThemeProvider_default = ThemeProvider;
|
|
52
|
-
|
|
53
|
-
// src/theme/useTheme.ts
|
|
54
|
-
import { useThemeUI } from "@theme-ui/core";
|
|
55
|
-
var useTheme = useThemeUI;
|
|
56
|
-
|
|
57
|
-
// src/components/Box/Box.tsx
|
|
58
|
-
import { Box } from "@theme-ui/components";
|
|
59
|
-
|
|
60
|
-
// src/components/Button/Button.tsx
|
|
61
|
-
import { Button } from "@theme-ui/components";
|
|
62
|
-
|
|
63
|
-
// src/components/Flex/Flex.tsx
|
|
64
|
-
import { Flex } from "@theme-ui/components";
|
|
65
|
-
|
|
66
|
-
// src/components/FormField/FormField.tsx
|
|
67
|
-
import * as React3 from "react";
|
|
68
|
-
|
|
69
|
-
// src/components/Label/Label.tsx
|
|
70
|
-
import { Label } from "@theme-ui/components";
|
|
71
|
-
|
|
72
|
-
// src/components/Text/Text.tsx
|
|
73
|
-
import { Text } from "@theme-ui/components";
|
|
74
|
-
|
|
75
|
-
// src/components/FormField/FormField.tsx
|
|
76
|
-
var FormField = ({ children, label, error }) => {
|
|
77
|
-
const errorAsArray = (() => {
|
|
78
|
-
if (Array.isArray(error)) {
|
|
79
|
-
return error;
|
|
80
|
-
}
|
|
81
|
-
if (typeof error === "string") {
|
|
82
|
-
return [error];
|
|
83
|
-
}
|
|
84
|
-
return [];
|
|
85
|
-
})();
|
|
86
|
-
return /* @__PURE__ */ React3.createElement(Box, null, /* @__PURE__ */ React3.createElement(Label, {
|
|
87
|
-
sx: { display: "flex", flexDirection: "column" }
|
|
88
|
-
}, label && /* @__PURE__ */ React3.createElement(Text, {
|
|
89
|
-
as: "span"
|
|
90
|
-
}, label), children), errorAsArray.map((err) => /* @__PURE__ */ React3.createElement(Text, {
|
|
91
|
-
key: err,
|
|
92
|
-
as: "span",
|
|
93
|
-
variant: "error"
|
|
94
|
-
}, err)));
|
|
95
|
-
};
|
|
96
|
-
var FormField_default = FormField;
|
|
97
|
-
|
|
98
|
-
// src/components/Image/Image.tsx
|
|
99
|
-
import { Image } from "@theme-ui/components";
|
|
100
|
-
|
|
101
|
-
// src/components/Input/Input.tsx
|
|
102
|
-
import { Input } from "@theme-ui/components";
|
|
103
|
-
export {
|
|
104
|
-
Box,
|
|
105
|
-
Button,
|
|
106
|
-
Flex,
|
|
107
|
-
FormField_default as FormField,
|
|
108
|
-
Image,
|
|
109
|
-
Input,
|
|
110
|
-
Text,
|
|
111
|
-
ThemeProvider_default as ThemeProvider,
|
|
112
|
-
useTheme
|
|
113
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as _theme_ui_core from '@theme-ui/core';
|
|
2
|
-
import { ThemeProviderProps } from '@theme-ui/core';
|
|
3
|
-
export { ThemeProviderProps } from '@theme-ui/core';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
export { Box, BoxProps, Button, ButtonProps, Flex, FlexProps, Image, ImageProps, Input, InputProps, Text, TextProps } from '@theme-ui/components';
|
|
6
|
-
|
|
7
|
-
declare const ThemeProvider: React.FC<Partial<ThemeProviderProps>>;
|
|
8
|
-
|
|
9
|
-
declare const useTheme: () => _theme_ui_core.ThemeUIContextValue;
|
|
10
|
-
|
|
11
|
-
declare type FormFieldProps = {
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
label?: string;
|
|
14
|
-
error?: string[] | string;
|
|
15
|
-
};
|
|
16
|
-
declare const FormField: ({ children, label, error }: FormFieldProps) => JSX.Element;
|
|
17
|
-
|
|
18
|
-
export { FormField, FormFieldProps, ThemeProvider, useTheme };
|
package/dist/index.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
|
|
29
|
-
// src/index.ts
|
|
30
|
-
var src_exports = {};
|
|
31
|
-
__export(src_exports, {
|
|
32
|
-
Box: () => import_components.Box,
|
|
33
|
-
Button: () => import_components2.Button,
|
|
34
|
-
Flex: () => import_components3.Flex,
|
|
35
|
-
FormField: () => FormField_default,
|
|
36
|
-
Image: () => import_components6.Image,
|
|
37
|
-
Input: () => import_components7.Input,
|
|
38
|
-
Text: () => import_components5.Text,
|
|
39
|
-
ThemeProvider: () => ThemeProvider_default,
|
|
40
|
-
useTheme: () => useTheme
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// tsup.inject.js
|
|
44
|
-
var React = __toESM(require("react"));
|
|
45
|
-
|
|
46
|
-
// src/theme/ThemeProvider.tsx
|
|
47
|
-
var import_core = require("@theme-ui/core");
|
|
48
|
-
var React2 = __toESM(require("react"));
|
|
49
|
-
|
|
50
|
-
// src/theme/defaultTheme.ts
|
|
51
|
-
var defaultTheme = {
|
|
52
|
-
colors: {
|
|
53
|
-
text: "#000",
|
|
54
|
-
background: "#fff",
|
|
55
|
-
primary: "#07c",
|
|
56
|
-
secondary: "#639",
|
|
57
|
-
gray: "#555"
|
|
58
|
-
},
|
|
59
|
-
buttons: {
|
|
60
|
-
primary: {
|
|
61
|
-
color: "background",
|
|
62
|
-
bg: "primary"
|
|
63
|
-
},
|
|
64
|
-
secondary: {
|
|
65
|
-
color: "background",
|
|
66
|
-
bg: "secondary"
|
|
67
|
-
},
|
|
68
|
-
gray: {
|
|
69
|
-
color: "background",
|
|
70
|
-
bg: "gray"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// src/theme/ThemeProvider.tsx
|
|
76
|
-
var ThemeProvider = ({
|
|
77
|
-
children,
|
|
78
|
-
theme = {}
|
|
79
|
-
}) => {
|
|
80
|
-
const mergedTheme = React2.useMemo(() => {
|
|
81
|
-
if (typeof theme === "function") {
|
|
82
|
-
return theme;
|
|
83
|
-
}
|
|
84
|
-
return (0, import_core.merge)(defaultTheme, theme);
|
|
85
|
-
}, [theme]);
|
|
86
|
-
return /* @__PURE__ */ React2.createElement(import_core.ThemeProvider, {
|
|
87
|
-
theme: mergedTheme
|
|
88
|
-
}, children);
|
|
89
|
-
};
|
|
90
|
-
var ThemeProvider_default = ThemeProvider;
|
|
91
|
-
|
|
92
|
-
// src/theme/useTheme.ts
|
|
93
|
-
var import_core2 = require("@theme-ui/core");
|
|
94
|
-
var useTheme = import_core2.useThemeUI;
|
|
95
|
-
|
|
96
|
-
// src/components/Box/Box.tsx
|
|
97
|
-
var import_components = require("@theme-ui/components");
|
|
98
|
-
|
|
99
|
-
// src/components/Button/Button.tsx
|
|
100
|
-
var import_components2 = require("@theme-ui/components");
|
|
101
|
-
|
|
102
|
-
// src/components/Flex/Flex.tsx
|
|
103
|
-
var import_components3 = require("@theme-ui/components");
|
|
104
|
-
|
|
105
|
-
// src/components/FormField/FormField.tsx
|
|
106
|
-
var React3 = __toESM(require("react"));
|
|
107
|
-
|
|
108
|
-
// src/components/Label/Label.tsx
|
|
109
|
-
var import_components4 = require("@theme-ui/components");
|
|
110
|
-
|
|
111
|
-
// src/components/Text/Text.tsx
|
|
112
|
-
var import_components5 = require("@theme-ui/components");
|
|
113
|
-
|
|
114
|
-
// src/components/FormField/FormField.tsx
|
|
115
|
-
var FormField = ({ children, label, error }) => {
|
|
116
|
-
const errorAsArray = (() => {
|
|
117
|
-
if (Array.isArray(error)) {
|
|
118
|
-
return error;
|
|
119
|
-
}
|
|
120
|
-
if (typeof error === "string") {
|
|
121
|
-
return [error];
|
|
122
|
-
}
|
|
123
|
-
return [];
|
|
124
|
-
})();
|
|
125
|
-
return /* @__PURE__ */ React3.createElement(import_components.Box, null, /* @__PURE__ */ React3.createElement(import_components4.Label, {
|
|
126
|
-
sx: { display: "flex", flexDirection: "column" }
|
|
127
|
-
}, label && /* @__PURE__ */ React3.createElement(import_components5.Text, {
|
|
128
|
-
as: "span"
|
|
129
|
-
}, label), children), errorAsArray.map((err) => /* @__PURE__ */ React3.createElement(import_components5.Text, {
|
|
130
|
-
key: err,
|
|
131
|
-
as: "span",
|
|
132
|
-
variant: "error"
|
|
133
|
-
}, err)));
|
|
134
|
-
};
|
|
135
|
-
var FormField_default = FormField;
|
|
136
|
-
|
|
137
|
-
// src/components/Image/Image.tsx
|
|
138
|
-
var import_components6 = require("@theme-ui/components");
|
|
139
|
-
|
|
140
|
-
// src/components/Input/Input.tsx
|
|
141
|
-
var import_components7 = require("@theme-ui/components");
|
|
142
|
-
module.exports = __toCommonJS(src_exports);
|
|
143
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
-
0 && (module.exports = {
|
|
145
|
-
Box,
|
|
146
|
-
Button,
|
|
147
|
-
Flex,
|
|
148
|
-
FormField,
|
|
149
|
-
Image,
|
|
150
|
-
Input,
|
|
151
|
-
Text,
|
|
152
|
-
ThemeProvider,
|
|
153
|
-
useTheme
|
|
154
|
-
});
|