@ttoss/ui 0.6.0 → 0.8.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/esm/index.js +97 -1
- package/dist/index.js +97 -1
- package/package.json +4 -4
- package/src/components/Box/Box.tsx +3 -1
- package/src/components/Button/Button.tsx +3 -1
- package/src/components/Flex/Flex.tsx +3 -1
- package/src/components/Image/Image.tsx +3 -1
- package/src/components/Input/Input.tsx +3 -1
- package/src/components/Label/Label.tsx +3 -1
- package/src/components/Text/Text.tsx +3 -1
- package/src/index.ts +3 -1
package/dist/esm/index.js
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
// tsup.inject.js
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// src/theme/ThemeProvider.tsx
|
|
5
|
+
import { ThemeProvider as ThemeUiProvider } from "@theme-ui/core";
|
|
6
|
+
|
|
7
|
+
// src/theme/theme.ts
|
|
8
|
+
var theme = {
|
|
9
|
+
colors: {
|
|
10
|
+
text: "#000",
|
|
11
|
+
background: "#fff",
|
|
12
|
+
primary: "#07c",
|
|
13
|
+
secondary: "#639",
|
|
14
|
+
gray: "#555"
|
|
15
|
+
},
|
|
16
|
+
buttons: {
|
|
17
|
+
primary: {
|
|
18
|
+
color: "background",
|
|
19
|
+
bg: "primary"
|
|
20
|
+
},
|
|
21
|
+
secondary: {
|
|
22
|
+
color: "background",
|
|
23
|
+
bg: "secondary"
|
|
24
|
+
},
|
|
25
|
+
gray: {
|
|
26
|
+
color: "background",
|
|
27
|
+
bg: "gray"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// src/theme/ThemeProvider.tsx
|
|
33
|
+
var ThemeProvider = ({ children }) => {
|
|
34
|
+
return /* @__PURE__ */ React.createElement(ThemeUiProvider, {
|
|
35
|
+
theme
|
|
36
|
+
}, children);
|
|
37
|
+
};
|
|
38
|
+
var ThemeProvider_default = ThemeProvider;
|
|
39
|
+
|
|
40
|
+
// src/components/Box/Box.tsx
|
|
41
|
+
import { Box } from "@theme-ui/components";
|
|
42
|
+
|
|
43
|
+
// src/components/Button/Button.tsx
|
|
44
|
+
import { Button } from "@theme-ui/components";
|
|
45
|
+
|
|
46
|
+
// src/components/Flex/Flex.tsx
|
|
47
|
+
import { Flex } from "@theme-ui/components";
|
|
48
|
+
|
|
49
|
+
// src/components/FormField/FormField.tsx
|
|
50
|
+
import {
|
|
51
|
+
createElement
|
|
52
|
+
} from "react";
|
|
53
|
+
|
|
54
|
+
// src/components/Label/Label.tsx
|
|
55
|
+
import { Label } from "@theme-ui/components";
|
|
56
|
+
|
|
57
|
+
// src/components/Text/Text.tsx
|
|
58
|
+
import { Text } from "@theme-ui/components";
|
|
59
|
+
|
|
60
|
+
// src/components/FormField/FormField.tsx
|
|
61
|
+
var FormField = ({ children, label, error }) => {
|
|
62
|
+
const errorAsArray = (() => {
|
|
63
|
+
if (Array.isArray(error)) {
|
|
64
|
+
return error;
|
|
65
|
+
}
|
|
66
|
+
if (typeof error === "string") {
|
|
67
|
+
return [error];
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
})();
|
|
71
|
+
return /* @__PURE__ */ createElement(Box, null, /* @__PURE__ */ createElement(Label, {
|
|
72
|
+
sx: { display: "flex", flexDirection: "column" }
|
|
73
|
+
}, label && /* @__PURE__ */ createElement(Text, {
|
|
74
|
+
as: "span"
|
|
75
|
+
}, label), children), errorAsArray.map((err) => /* @__PURE__ */ createElement(Text, {
|
|
76
|
+
key: err,
|
|
77
|
+
as: "span",
|
|
78
|
+
variant: "error"
|
|
79
|
+
}, err)));
|
|
80
|
+
};
|
|
81
|
+
var FormField_default = FormField;
|
|
82
|
+
|
|
83
|
+
// src/components/Image/Image.tsx
|
|
84
|
+
import { Image } from "@theme-ui/components";
|
|
85
|
+
|
|
86
|
+
// src/components/Input/Input.tsx
|
|
87
|
+
import { Input } from "@theme-ui/components";
|
|
88
|
+
export {
|
|
89
|
+
Box,
|
|
90
|
+
Button,
|
|
91
|
+
Flex,
|
|
92
|
+
FormField_default as FormField,
|
|
93
|
+
Image,
|
|
94
|
+
Input,
|
|
95
|
+
Text,
|
|
96
|
+
ThemeProvider_default as ThemeProvider
|
|
97
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }// tsup.inject.js
|
|
2
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
3
|
+
|
|
4
|
+
// src/theme/ThemeProvider.tsx
|
|
5
|
+
var _core = require('@theme-ui/core');
|
|
6
|
+
|
|
7
|
+
// src/theme/theme.ts
|
|
8
|
+
var theme = {
|
|
9
|
+
colors: {
|
|
10
|
+
text: "#000",
|
|
11
|
+
background: "#fff",
|
|
12
|
+
primary: "#07c",
|
|
13
|
+
secondary: "#639",
|
|
14
|
+
gray: "#555"
|
|
15
|
+
},
|
|
16
|
+
buttons: {
|
|
17
|
+
primary: {
|
|
18
|
+
color: "background",
|
|
19
|
+
bg: "primary"
|
|
20
|
+
},
|
|
21
|
+
secondary: {
|
|
22
|
+
color: "background",
|
|
23
|
+
bg: "secondary"
|
|
24
|
+
},
|
|
25
|
+
gray: {
|
|
26
|
+
color: "background",
|
|
27
|
+
bg: "gray"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// src/theme/ThemeProvider.tsx
|
|
33
|
+
var ThemeProvider = ({ children }) => {
|
|
34
|
+
return /* @__PURE__ */ React.createElement(_core.ThemeProvider, {
|
|
35
|
+
theme
|
|
36
|
+
}, children);
|
|
37
|
+
};
|
|
38
|
+
var ThemeProvider_default = ThemeProvider;
|
|
39
|
+
|
|
40
|
+
// src/components/Box/Box.tsx
|
|
41
|
+
var _components = require('@theme-ui/components');
|
|
42
|
+
|
|
43
|
+
// src/components/Button/Button.tsx
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// src/components/Flex/Flex.tsx
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// src/components/FormField/FormField.tsx
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
// src/components/Label/Label.tsx
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// src/components/Text/Text.tsx
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// src/components/FormField/FormField.tsx
|
|
61
|
+
var FormField = ({ children, label, error }) => {
|
|
62
|
+
const errorAsArray = (() => {
|
|
63
|
+
if (Array.isArray(error)) {
|
|
64
|
+
return error;
|
|
65
|
+
}
|
|
66
|
+
if (typeof error === "string") {
|
|
67
|
+
return [error];
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
})();
|
|
71
|
+
return /* @__PURE__ */ _react.createElement.call(void 0, _components.Box, null, /* @__PURE__ */ _react.createElement.call(void 0, _components.Label, {
|
|
72
|
+
sx: { display: "flex", flexDirection: "column" }
|
|
73
|
+
}, label && /* @__PURE__ */ _react.createElement.call(void 0, _components.Text, {
|
|
74
|
+
as: "span"
|
|
75
|
+
}, label), children), errorAsArray.map((err) => /* @__PURE__ */ _react.createElement.call(void 0, _components.Text, {
|
|
76
|
+
key: err,
|
|
77
|
+
as: "span",
|
|
78
|
+
variant: "error"
|
|
79
|
+
}, err)));
|
|
80
|
+
};
|
|
81
|
+
var FormField_default = FormField;
|
|
82
|
+
|
|
83
|
+
// src/components/Image/Image.tsx
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
// src/components/Input/Input.tsx
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
exports.Box = _components.Box; exports.Button = _components.Button; exports.Flex = _components.Flex; exports.FormField = FormField_default; exports.Image = _components.Image; exports.Input = _components.Input; exports.Text = _components.Text; exports.ThemeProvider = ThemeProvider_default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.3",
|
|
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.3",
|
|
43
|
+
"@ttoss/test-utils": "^0.8.3"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "4a0b5b1f51c9241b0b8d4a35b88a84d856d46d44"
|
|
46
46
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,9 @@ export {
|
|
|
3
3
|
ThemeProviderProps,
|
|
4
4
|
} from './theme/ThemeProvider';
|
|
5
5
|
|
|
6
|
-
export { default as Box
|
|
6
|
+
export { default as Box } from './components/Box/Box';
|
|
7
|
+
export type { BoxProps } from './components/Box/Box';
|
|
8
|
+
|
|
7
9
|
export { default as Button, ButtonProps } from './components/Button/Button';
|
|
8
10
|
export { default as Flex, FlexProps } from './components/Flex/Flex';
|
|
9
11
|
export {
|