@ttoss/ui 0.6.2 → 0.8.5
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/README.md +42 -0
- package/dist/esm/index.js +4 -6
- package/dist/index.js +68 -27
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @ttoss/ui
|
|
2
|
+
|
|
3
|
+
## 📚 About
|
|
4
|
+
|
|
5
|
+
<strong> @ttoss/ui</strong> is a easiest way to use Ui components in your React application.
|
|
6
|
+
|
|
7
|
+
## 🚀 Get Started
|
|
8
|
+
|
|
9
|
+
### Install @ttoss/ui
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
$ yarn add @ttoss/ui
|
|
13
|
+
# or
|
|
14
|
+
$ npm install @ttoss/ui
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 📄 Examples of use
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { Flex, Text, Box, Button } from '@ttoss/ui';
|
|
21
|
+
|
|
22
|
+
const App = () => {
|
|
23
|
+
return (
|
|
24
|
+
<ThemeProvider>
|
|
25
|
+
<Flex sx={{ flexDirection: 'column' }}>
|
|
26
|
+
<Text>Text Value</Text>
|
|
27
|
+
<Box>
|
|
28
|
+
<Text>Text Value</Text>
|
|
29
|
+
|
|
30
|
+
<Button>Button Primary</Button>
|
|
31
|
+
</Box>
|
|
32
|
+
</Flex>
|
|
33
|
+
</ThemeProvider>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default App;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
|
|
42
|
+
```
|
package/dist/esm/index.js
CHANGED
|
@@ -47,9 +47,7 @@ import { Button } from "@theme-ui/components";
|
|
|
47
47
|
import { Flex } from "@theme-ui/components";
|
|
48
48
|
|
|
49
49
|
// src/components/FormField/FormField.tsx
|
|
50
|
-
import
|
|
51
|
-
createElement
|
|
52
|
-
} from "react";
|
|
50
|
+
import * as React2 from "react";
|
|
53
51
|
|
|
54
52
|
// src/components/Label/Label.tsx
|
|
55
53
|
import { Label } from "@theme-ui/components";
|
|
@@ -68,11 +66,11 @@ var FormField = ({ children, label, error }) => {
|
|
|
68
66
|
}
|
|
69
67
|
return [];
|
|
70
68
|
})();
|
|
71
|
-
return /* @__PURE__ */ createElement(Box, null, /* @__PURE__ */ createElement(Label, {
|
|
69
|
+
return /* @__PURE__ */ React2.createElement(Box, null, /* @__PURE__ */ React2.createElement(Label, {
|
|
72
70
|
sx: { display: "flex", flexDirection: "column" }
|
|
73
|
-
}, label && /* @__PURE__ */ createElement(Text, {
|
|
71
|
+
}, label && /* @__PURE__ */ React2.createElement(Text, {
|
|
74
72
|
as: "span"
|
|
75
|
-
}, label), children), errorAsArray.map((err) => /* @__PURE__ */ createElement(Text, {
|
|
73
|
+
}, label), children), errorAsArray.map((err) => /* @__PURE__ */ React2.createElement(Text, {
|
|
76
74
|
key: err,
|
|
77
75
|
as: "span",
|
|
78
76
|
variant: "error"
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
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
|
+
});
|
|
41
|
+
|
|
42
|
+
// tsup.inject.js
|
|
43
|
+
var React = __toESM(require("react"));
|
|
3
44
|
|
|
4
45
|
// src/theme/ThemeProvider.tsx
|
|
5
|
-
var
|
|
46
|
+
var import_core = require("@theme-ui/core");
|
|
6
47
|
|
|
7
48
|
// src/theme/theme.ts
|
|
8
49
|
var theme = {
|
|
@@ -31,31 +72,29 @@ var theme = {
|
|
|
31
72
|
|
|
32
73
|
// src/theme/ThemeProvider.tsx
|
|
33
74
|
var ThemeProvider = ({ children }) => {
|
|
34
|
-
return /* @__PURE__ */ React.createElement(
|
|
75
|
+
return /* @__PURE__ */ React.createElement(import_core.ThemeProvider, {
|
|
35
76
|
theme
|
|
36
77
|
}, children);
|
|
37
78
|
};
|
|
38
79
|
var ThemeProvider_default = ThemeProvider;
|
|
39
80
|
|
|
40
81
|
// src/components/Box/Box.tsx
|
|
41
|
-
var
|
|
82
|
+
var import_components = require("@theme-ui/components");
|
|
42
83
|
|
|
43
84
|
// src/components/Button/Button.tsx
|
|
44
|
-
|
|
85
|
+
var import_components2 = require("@theme-ui/components");
|
|
45
86
|
|
|
46
87
|
// src/components/Flex/Flex.tsx
|
|
47
|
-
|
|
88
|
+
var import_components3 = require("@theme-ui/components");
|
|
48
89
|
|
|
49
90
|
// src/components/FormField/FormField.tsx
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
91
|
+
var React2 = __toESM(require("react"));
|
|
53
92
|
|
|
54
93
|
// src/components/Label/Label.tsx
|
|
55
|
-
|
|
94
|
+
var import_components4 = require("@theme-ui/components");
|
|
56
95
|
|
|
57
96
|
// src/components/Text/Text.tsx
|
|
58
|
-
|
|
97
|
+
var import_components5 = require("@theme-ui/components");
|
|
59
98
|
|
|
60
99
|
// src/components/FormField/FormField.tsx
|
|
61
100
|
var FormField = ({ children, label, error }) => {
|
|
@@ -68,11 +107,11 @@ var FormField = ({ children, label, error }) => {
|
|
|
68
107
|
}
|
|
69
108
|
return [];
|
|
70
109
|
})();
|
|
71
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ React2.createElement(import_components.Box, null, /* @__PURE__ */ React2.createElement(import_components4.Label, {
|
|
72
111
|
sx: { display: "flex", flexDirection: "column" }
|
|
73
|
-
}, label && /* @__PURE__ */
|
|
112
|
+
}, label && /* @__PURE__ */ React2.createElement(import_components5.Text, {
|
|
74
113
|
as: "span"
|
|
75
|
-
}, label), children), errorAsArray.map((err) => /* @__PURE__ */
|
|
114
|
+
}, label), children), errorAsArray.map((err) => /* @__PURE__ */ React2.createElement(import_components5.Text, {
|
|
76
115
|
key: err,
|
|
77
116
|
as: "span",
|
|
78
117
|
variant: "error"
|
|
@@ -81,17 +120,19 @@ var FormField = ({ children, label, error }) => {
|
|
|
81
120
|
var FormField_default = FormField;
|
|
82
121
|
|
|
83
122
|
// src/components/Image/Image.tsx
|
|
84
|
-
|
|
123
|
+
var import_components6 = require("@theme-ui/components");
|
|
85
124
|
|
|
86
125
|
// src/components/Input/Input.tsx
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
126
|
+
var import_components7 = require("@theme-ui/components");
|
|
127
|
+
module.exports = __toCommonJS(src_exports);
|
|
128
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
129
|
+
0 && (module.exports = {
|
|
130
|
+
Box,
|
|
131
|
+
Button,
|
|
132
|
+
Flex,
|
|
133
|
+
FormField,
|
|
134
|
+
Image,
|
|
135
|
+
Input,
|
|
136
|
+
Text,
|
|
137
|
+
ThemeProvider
|
|
138
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"react": ">=16.8.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@ttoss/config": "^0.
|
|
43
|
-
"@ttoss/test-utils": "^0.
|
|
42
|
+
"@ttoss/config": "^0.8.5",
|
|
43
|
+
"@ttoss/test-utils": "^0.8.5"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "41243699cc8ed5eba265e6434ebefbb9d6d91d52"
|
|
46
46
|
}
|