blixify-ui-web 0.1.6
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 +1 -0
- package/lib/components/action/button/index.d.ts +16 -0
- package/lib/components/action/button/index.d.ts.map +1 -0
- package/lib/components/action/button/index.js +90 -0
- package/lib/components/action/button/index.js.map +1 -0
- package/lib/components/action/buttonGroup/index.d.ts +17 -0
- package/lib/components/action/buttonGroup/index.d.ts.map +1 -0
- package/lib/components/action/buttonGroup/index.js +74 -0
- package/lib/components/action/buttonGroup/index.js.map +1 -0
- package/lib/components/action/iconButton/index.d.ts +14 -0
- package/lib/components/action/iconButton/index.d.ts.map +1 -0
- package/lib/components/action/iconButton/index.js +71 -0
- package/lib/components/action/iconButton/index.js.map +1 -0
- package/lib/components/action/textButton/index.d.ts +13 -0
- package/lib/components/action/textButton/index.d.ts.map +1 -0
- package/lib/components/action/textButton/index.js +62 -0
- package/lib/components/action/textButton/index.js.map +1 -0
- package/lib/components/action/toggle/index.d.ts +17 -0
- package/lib/components/action/toggle/index.d.ts.map +1 -0
- package/lib/components/action/toggle/index.js +91 -0
- package/lib/components/action/toggle/index.js.map +1 -0
- package/lib/components/data/readQuery/index.d.ts +46 -0
- package/lib/components/data/readQuery/index.d.ts.map +1 -0
- package/lib/components/data/readQuery/index.js +210 -0
- package/lib/components/data/readQuery/index.js.map +1 -0
- package/lib/components/data/readQueryHoc/index.d.ts +24 -0
- package/lib/components/data/readQueryHoc/index.d.ts.map +1 -0
- package/lib/components/data/readQueryHoc/index.js +255 -0
- package/lib/components/data/readQueryHoc/index.js.map +1 -0
- package/lib/components/data/writeQuery/index.d.ts +14 -0
- package/lib/components/data/writeQuery/index.d.ts.map +1 -0
- package/lib/components/data/writeQuery/index.js +120 -0
- package/lib/components/data/writeQuery/index.js.map +1 -0
- package/lib/components/display/detailList/index.d.ts +17 -0
- package/lib/components/display/detailList/index.d.ts.map +1 -0
- package/lib/components/display/detailList/index.js +68 -0
- package/lib/components/display/detailList/index.js.map +1 -0
- package/lib/components/display/feeds/index.d.ts +19 -0
- package/lib/components/display/feeds/index.d.ts.map +1 -0
- package/lib/components/display/feeds/index.js +79 -0
- package/lib/components/display/feeds/index.js.map +1 -0
- package/lib/components/display/grid/index.d.ts +33 -0
- package/lib/components/display/grid/index.d.ts.map +1 -0
- package/lib/components/display/grid/index.js +180 -0
- package/lib/components/display/grid/index.js.map +1 -0
- package/lib/components/display/list/index.d.ts +30 -0
- package/lib/components/display/list/index.d.ts.map +1 -0
- package/lib/components/display/list/index.js +160 -0
- package/lib/components/display/list/index.js.map +1 -0
- package/lib/components/display/loading/index.d.ts +6 -0
- package/lib/components/display/loading/index.d.ts.map +1 -0
- package/lib/components/display/loading/index.js +55 -0
- package/lib/components/display/loading/index.js.map +1 -0
- package/lib/components/display/modal/index.d.ts +16 -0
- package/lib/components/display/modal/index.d.ts.map +1 -0
- package/lib/components/display/modal/index.js +67 -0
- package/lib/components/display/modal/index.js.map +1 -0
- package/lib/components/display/notification/index.d.ts +20 -0
- package/lib/components/display/notification/index.d.ts.map +1 -0
- package/lib/components/display/notification/index.js +69 -0
- package/lib/components/display/notification/index.js.map +1 -0
- package/lib/components/display/table/index.d.ts +32 -0
- package/lib/components/display/table/index.d.ts.map +1 -0
- package/lib/components/display/table/index.js +202 -0
- package/lib/components/display/table/index.js.map +1 -0
- package/lib/components/index.d.ts +30 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +62 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/input/address/index.d.ts +41 -0
- package/lib/components/input/address/index.d.ts.map +1 -0
- package/lib/components/input/address/index.js +162 -0
- package/lib/components/input/address/index.js.map +1 -0
- package/lib/components/input/datePicker/index.d.ts +26 -0
- package/lib/components/input/datePicker/index.d.ts.map +1 -0
- package/lib/components/input/datePicker/index.js +132 -0
- package/lib/components/input/datePicker/index.js.map +1 -0
- package/lib/components/input/form/index.d.ts +14 -0
- package/lib/components/input/form/index.d.ts.map +1 -0
- package/lib/components/input/form/index.js +77 -0
- package/lib/components/input/form/index.js.map +1 -0
- package/lib/components/input/select/index.d.ts +40 -0
- package/lib/components/input/select/index.d.ts.map +1 -0
- package/lib/components/input/select/index.js +269 -0
- package/lib/components/input/select/index.js.map +1 -0
- package/lib/components/input/textArea/index.d.ts +23 -0
- package/lib/components/input/textArea/index.d.ts.map +1 -0
- package/lib/components/input/textArea/index.js +95 -0
- package/lib/components/input/textArea/index.js.map +1 -0
- package/lib/components/input/textInput/index.d.ts +25 -0
- package/lib/components/input/textInput/index.d.ts.map +1 -0
- package/lib/components/input/textInput/index.js +121 -0
- package/lib/components/input/textInput/index.js.map +1 -0
- package/lib/components/input/uploadInput/index.d.ts +23 -0
- package/lib/components/input/uploadInput/index.d.ts.map +1 -0
- package/lib/components/input/uploadInput/index.js +103 -0
- package/lib/components/input/uploadInput/index.js.map +1 -0
- package/lib/components/navigation/bars/index.d.ts +17 -0
- package/lib/components/navigation/bars/index.d.ts.map +1 -0
- package/lib/components/navigation/bars/index.js +73 -0
- package/lib/components/navigation/bars/index.js.map +1 -0
- package/lib/components/navigation/header/index.d.ts +35 -0
- package/lib/components/navigation/header/index.d.ts.map +1 -0
- package/lib/components/navigation/header/index.js +167 -0
- package/lib/components/navigation/header/index.js.map +1 -0
- package/lib/components/navigation/tabs/index.d.ts +16 -0
- package/lib/components/navigation/tabs/index.d.ts.map +1 -0
- package/lib/components/navigation/tabs/index.js +70 -0
- package/lib/components/navigation/tabs/index.js.map +1 -0
- package/lib/components/structure/column/index.d.ts +13 -0
- package/lib/components/structure/column/index.d.ts.map +1 -0
- package/lib/components/structure/column/index.js +89 -0
- package/lib/components/structure/column/index.js.map +1 -0
- package/lib/components/structure/container/index.d.ts +11 -0
- package/lib/components/structure/container/index.d.ts.map +1 -0
- package/lib/components/structure/container/index.js +57 -0
- package/lib/components/structure/container/index.js.map +1 -0
- package/lib/components/structure/text/index.d.ts +16 -0
- package/lib/components/structure/text/index.d.ts.map +1 -0
- package/lib/components/structure/text/index.js +153 -0
- package/lib/components/structure/text/index.js.map +1 -0
- package/lib/index.css +105 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.TextArea = void 0;
|
|
42
|
+
var react_1 = __importStar(require("react"));
|
|
43
|
+
require("../../../index.css");
|
|
44
|
+
var TextArea = /** @class */ (function (_super) {
|
|
45
|
+
__extends(TextArea, _super);
|
|
46
|
+
function TextArea() {
|
|
47
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
48
|
+
_this.state = {
|
|
49
|
+
error: "",
|
|
50
|
+
};
|
|
51
|
+
_this.handleOnChange = function (e) {
|
|
52
|
+
if (_this.props.onChange) {
|
|
53
|
+
_this.props.onChange(e.target.value);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
_this.handleSubmit = function () {
|
|
57
|
+
var testCond = false;
|
|
58
|
+
var error = "Please input a text";
|
|
59
|
+
if (!_this.props.optional) {
|
|
60
|
+
// INFO : Regrex Validation
|
|
61
|
+
/* eslint-disable */
|
|
62
|
+
var textFilter = /^[A-Za-z]+$/;
|
|
63
|
+
testCond = textFilter.test(_this.props.value);
|
|
64
|
+
/* eslint-enable */
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
testCond = true;
|
|
68
|
+
}
|
|
69
|
+
if (!testCond) {
|
|
70
|
+
_this.setState({ error: error });
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
_this.setState({ error: "" });
|
|
74
|
+
}
|
|
75
|
+
return testCond;
|
|
76
|
+
};
|
|
77
|
+
return _this;
|
|
78
|
+
}
|
|
79
|
+
TextArea.prototype.render = function () {
|
|
80
|
+
var defaultClassName = "block w-full border border-gray-300 rounded-md mt-1 px-5 py-3 text-base text-gray-900 placeholder-gray-300 focus:border-primary-500 focus:outline-none";
|
|
81
|
+
if (this.state.error) {
|
|
82
|
+
defaultClassName += " mb-0.5 border-red-300";
|
|
83
|
+
}
|
|
84
|
+
if (this.props.className) {
|
|
85
|
+
defaultClassName += " ".concat(this.props.className);
|
|
86
|
+
}
|
|
87
|
+
return (react_1.default.createElement("div", null,
|
|
88
|
+
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" }, this.props.label),
|
|
89
|
+
react_1.default.createElement("textarea", { id: this.props.id, rows: this.props.rows, className: defaultClassName, value: this.props.value, disabled: this.props.disabled, placeholder: this.props.placeholder, onChange: this.handleOnChange }),
|
|
90
|
+
this.state.error && (react_1.default.createElement("span", { className: "text-red-500 text-sm" }, this.state.error))));
|
|
91
|
+
};
|
|
92
|
+
return TextArea;
|
|
93
|
+
}(react_1.Component));
|
|
94
|
+
exports.TextArea = TextArea;
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/input/textArea/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,8BAA4B;AAc5B;IAA8B,4BAAgB;IAA9C;QAAA,qEA8DC;QA7DC,WAAK,GAAG;YACN,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,oBAAc,GAAG,UAAC,CAAM;YACtB,IAAI,KAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACvB,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACrC;QACH,CAAC,CAAC;QAEF,kBAAY,GAAG;YACb,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,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CAAC,cAAc,GAC7B;YACD,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CACnB,wCAAM,SAAS,EAAC,sBAAsB,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAQ,CACjE,CACG,CACP,CAAC;IACJ,CAAC;IACH,eAAC;AAAD,CAAC,AA9DD,CAA8B,iBAAS,GA8DtC;AA9DY,4BAAQ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
import "../../../index.css";
|
|
3
|
+
interface Props {
|
|
4
|
+
value: any;
|
|
5
|
+
label: string;
|
|
6
|
+
type: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
pattern?: RegExp;
|
|
10
|
+
optional?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
containerClassName?: string;
|
|
13
|
+
inputClassName?: string;
|
|
14
|
+
onChange?: (e: any) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare class TextInput extends Component<Props> {
|
|
17
|
+
state: {
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
20
|
+
handleOnChange: (e: any) => void;
|
|
21
|
+
handleSubmit: () => boolean;
|
|
22
|
+
render(): JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/textInput/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAE5B,UAAU,KAAK;IACb,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,qBAAa,SAAU,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC7C,KAAK;;MAEH;IAEF,cAAc,MAAO,GAAG,UAItB;IAEF,YAAY,gBA8CV;IAEF,MAAM;CA8BP"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.TextInput = void 0;
|
|
42
|
+
var react_1 = __importStar(require("react"));
|
|
43
|
+
require("../../../index.css");
|
|
44
|
+
var TextInput = /** @class */ (function (_super) {
|
|
45
|
+
__extends(TextInput, _super);
|
|
46
|
+
function TextInput() {
|
|
47
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
48
|
+
_this.state = {
|
|
49
|
+
error: "",
|
|
50
|
+
};
|
|
51
|
+
_this.handleOnChange = function (e) {
|
|
52
|
+
if (_this.props.onChange) {
|
|
53
|
+
_this.props.onChange(e.target.value);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
_this.handleSubmit = function () {
|
|
57
|
+
var testCond = false;
|
|
58
|
+
var error = "";
|
|
59
|
+
if (!_this.props.optional) {
|
|
60
|
+
// INFO : Regrex Validation
|
|
61
|
+
/* eslint-disable */
|
|
62
|
+
switch (_this.props.type) {
|
|
63
|
+
case "email":
|
|
64
|
+
var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
|
65
|
+
testCond = emailFilter.test(_this.props.value);
|
|
66
|
+
error = "Please input the correct email format";
|
|
67
|
+
break;
|
|
68
|
+
case "text":
|
|
69
|
+
var textFilter = /^[A-Za-z]+$/;
|
|
70
|
+
testCond = textFilter.test(_this.props.value);
|
|
71
|
+
error = "Please input a text";
|
|
72
|
+
break;
|
|
73
|
+
case "number":
|
|
74
|
+
var numberFilter = /^([0-9])+$/;
|
|
75
|
+
testCond = numberFilter.test(_this.props.value);
|
|
76
|
+
error = "Please input a number";
|
|
77
|
+
break;
|
|
78
|
+
case "mobile":
|
|
79
|
+
var phoneFilter = /^(\+60)-*[0-9]{8,10}$/;
|
|
80
|
+
testCond = phoneFilter.test(_this.props.value);
|
|
81
|
+
error = "Please input the correct format (eg +60123456789)";
|
|
82
|
+
break;
|
|
83
|
+
default:
|
|
84
|
+
error = "Please input the correct format";
|
|
85
|
+
if (_this.props.pattern) {
|
|
86
|
+
testCond = _this.props.pattern.test(_this.props.value);
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
/* eslint-enable */
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
testCond = true;
|
|
94
|
+
}
|
|
95
|
+
if (!testCond) {
|
|
96
|
+
_this.setState({ error: error });
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
_this.setState({ error: "" });
|
|
100
|
+
}
|
|
101
|
+
return testCond;
|
|
102
|
+
};
|
|
103
|
+
return _this;
|
|
104
|
+
}
|
|
105
|
+
TextInput.prototype.render = function () {
|
|
106
|
+
var defaultClassName = "block w-full border border-gray-300 rounded-md mt-1 px-5 py-3 text-base text-gray-900 placeholder-gray-300 focus:border-primary-500 focus:outline-none";
|
|
107
|
+
if (this.state.error) {
|
|
108
|
+
defaultClassName += " mb-0.5 border-red-300";
|
|
109
|
+
}
|
|
110
|
+
if (this.props.inputClassName) {
|
|
111
|
+
defaultClassName += " ".concat(this.props.inputClassName);
|
|
112
|
+
}
|
|
113
|
+
return (react_1.default.createElement("div", { className: this.props.containerClassName },
|
|
114
|
+
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" }, this.props.label),
|
|
115
|
+
react_1.default.createElement("input", { id: this.props.id, disabled: this.props.disabled, className: defaultClassName, value: this.props.value, placeholder: this.props.placeholder, onChange: this.handleOnChange, type: this.props.type }),
|
|
116
|
+
this.state.error && (react_1.default.createElement("span", { className: "text-red-500 text-sm" }, this.state.error))));
|
|
117
|
+
};
|
|
118
|
+
return TextInput;
|
|
119
|
+
}(react_1.Component));
|
|
120
|
+
exports.TextInput = TextInput;
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/input/textInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,8BAA4B;AAgB5B;IAA+B,6BAAgB;IAA/C;QAAA,qEAyFC;QAxFC,WAAK,GAAG;YACN,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,oBAAc,GAAG,UAAC,CAAM;YACtB,IAAI,KAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACvB,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACrC;QACH,CAAC,CAAC;QAEF,kBAAY,GAAG;YACb,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,IAAI,KAAK,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACxB,2BAA2B;gBAC3B,oBAAoB;gBACpB,QAAQ,KAAI,CAAC,KAAK,CAAC,IAAI,EAAE;oBACvB,KAAK,OAAO;wBACV,IAAM,WAAW,GACf,iEAAiE,CAAC;wBACpE,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;wBAC9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AAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACpB,gBAAgB,IAAI,wBAAwB,CAAC;SAC9C;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;YAC7B,gBAAgB,IAAI,WAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAE,CAAC;SACrD;QAED,OAAO,CACL,uCAAK,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB;YAC3C,yCAAO,SAAS,EAAC,yCAAyC,IACvD,IAAI,CAAC,KAAK,CAAC,KAAK,CACX;YACR,yCACE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAC7B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GACrB;YACD,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CACnB,wCAAM,SAAS,EAAC,sBAAsB,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAQ,CACjE,CACG,CACP,CAAC;IACJ,CAAC;IACH,gBAAC;AAAD,CAAC,AAzFD,CAA+B,iBAAS,GAyFvC;AAzFY,8BAAS"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
import "../../../index.css";
|
|
3
|
+
interface Props {
|
|
4
|
+
label: string;
|
|
5
|
+
accept?: string;
|
|
6
|
+
hidePreview?: boolean;
|
|
7
|
+
file?: File | "";
|
|
8
|
+
fileDescription?: string;
|
|
9
|
+
optional?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
onChange?: (e: any) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare class UploadInput extends Component<Props> {
|
|
14
|
+
state: {
|
|
15
|
+
error: string;
|
|
16
|
+
};
|
|
17
|
+
handleSubmit: () => boolean;
|
|
18
|
+
handleOnChange: (e: any) => void;
|
|
19
|
+
renderFileDescription: () => string;
|
|
20
|
+
render(): JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/uploadInput/index.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAE5B,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,qBAAa,WAAY,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC/C,KAAK;;MAEH;IAEF,YAAY,gBAgBV;IAEF,cAAc,MAAO,GAAG,UAItB;IAEF,qBAAqB,eAMnB;IAEF,MAAM;CA+CP"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.UploadInput = void 0;
|
|
42
|
+
var outline_1 = require("@heroicons/react/24/outline");
|
|
43
|
+
var react_1 = __importStar(require("react"));
|
|
44
|
+
require("../../../index.css");
|
|
45
|
+
var UploadInput = /** @class */ (function (_super) {
|
|
46
|
+
__extends(UploadInput, _super);
|
|
47
|
+
function UploadInput() {
|
|
48
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
49
|
+
_this.state = {
|
|
50
|
+
error: "",
|
|
51
|
+
};
|
|
52
|
+
_this.handleSubmit = function () {
|
|
53
|
+
var error = "";
|
|
54
|
+
if (!_this.props.optional) {
|
|
55
|
+
if (_this.props.file) {
|
|
56
|
+
var fileSize = _this.props.file.size / 1024 / 1024;
|
|
57
|
+
if (fileSize > 10) {
|
|
58
|
+
error = "File size cannot exceed 10MB";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
error = "Please upload a file";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_this.setState({ error: error });
|
|
66
|
+
return error ? false : true;
|
|
67
|
+
};
|
|
68
|
+
_this.handleOnChange = function (e) {
|
|
69
|
+
if (_this.props.onChange) {
|
|
70
|
+
_this.props.onChange(e);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
_this.renderFileDescription = function () {
|
|
74
|
+
if (_this.props.fileDescription) {
|
|
75
|
+
return _this.props.fileDescription;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return "PNG, JPG, JPEG up to 10MB";
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return _this;
|
|
82
|
+
}
|
|
83
|
+
UploadInput.prototype.render = function () {
|
|
84
|
+
var defaultBorderColor = "border-gray-300";
|
|
85
|
+
var errorBorderColor = "border-red-300";
|
|
86
|
+
return (react_1.default.createElement("div", { className: this.props.className },
|
|
87
|
+
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" }, this.props.label),
|
|
88
|
+
react_1.default.createElement("div", { className: "".concat(this.state.error ? errorBorderColor : defaultBorderColor, " mt-1 border-2 max-w-lg flex justify-center px-6 pt-5 pb-6 border-dashed rounded-md") },
|
|
89
|
+
react_1.default.createElement("div", { className: "space-y-1 text-center" },
|
|
90
|
+
this.props.file && !this.props.hidePreview ? (react_1.default.createElement("img", { alt: "", src: URL.createObjectURL(this.props.file), className: "mx-auto h-32 w-auto max-w-40 object-cover" })) : (react_1.default.createElement(outline_1.FolderPlusIcon, { className: "mx-auto h-12 w-12 text-gray-300" })),
|
|
91
|
+
react_1.default.createElement("div", { className: "flex text-sm text-gray-600 justify-center" },
|
|
92
|
+
react_1.default.createElement("label", { className: "relative cursor-pointer bg-white rounded-md font-medium text-primary-600 hover:text-primary-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500" },
|
|
93
|
+
react_1.default.createElement("span", null, "Upload file"),
|
|
94
|
+
react_1.default.createElement("input", { id: "file-upload", name: "file-upload", type: "file", className: "sr-only", accept: this.props.accept, onChange: this.handleOnChange }))),
|
|
95
|
+
react_1.default.createElement("p", { className: "text-xs text-gray-500" }, this.props.file
|
|
96
|
+
? "".concat(this.props.file.name)
|
|
97
|
+
: this.renderFileDescription()))),
|
|
98
|
+
react_1.default.createElement("span", { className: "text-red-500 text-sm" }, this.state.error)));
|
|
99
|
+
};
|
|
100
|
+
return UploadInput;
|
|
101
|
+
}(react_1.Component));
|
|
102
|
+
exports.UploadInput = UploadInput;
|
|
103
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/input/uploadInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6D;AAC7D,6CAAyC;AACzC,8BAA4B;AAa5B;IAAiC,+BAAgB;IAAjD;QAAA,qEAoFC;QAnFC,WAAK,GAAG;YACN,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,kBAAY,GAAG;YACb,IAAI,KAAK,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACxB,IAAI,KAAI,CAA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IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAC5C,uCACE,GAAG,EAAC,EAAE,EACN,GAAG,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EACzC,SAAS,EAAC,2CAA2C,GACrD,CACH,CAAC,CAAC,CAAC,CACF,8BAAC,wBAAc,IAAC,SAAS,EAAC,iCAAiC,GAAG,CAC/D;oBACD,uCAAK,SAAS,EAAC,2CAA2C;wBACxD,yCAAO,SAAS,EAAC,wMAAwM;4BACvN,0DAAwB;4BACxB,yCACE,EAAE,EAAC,aAAa,EAChB,IAAI,EAAC,aAAa,EAClB,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,SAAS,EACnB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,QAAQ,EAAE,IAAI,CAAC,cAAc,GAC7B,CACI,CACJ;oBACN,qCAAG,SAAS,EAAC,uBAAuB,IACjC,IAAI,CAAC,KAAK,CAAC,IAAI;wBACd,CAAC,CAAC,UAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAE;wBAC3B,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAC9B,CACA,CACF;YACN,wCAAM,SAAS,EAAC,sBAAsB,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAQ,CAC5D,CACP,CAAC;IACJ,CAAC;IACH,kBAAC;AAAD,CAAC,AApFD,CAAiC,iBAAS,GAoFzC;AApFY,kCAAW"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
import "../../../index.css";
|
|
3
|
+
interface Props {
|
|
4
|
+
bars: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
href: string;
|
|
8
|
+
icon: any;
|
|
9
|
+
}[];
|
|
10
|
+
selectedId: string;
|
|
11
|
+
onClick?: (id: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare class Bars extends Component<Props> {
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/bars/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAM5B,UAAU,KAAK;IACb,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,qBAAa,IAAK,SAAQ,SAAS,CAAC,KAAK,CAAC;IACxC,MAAM;CAgCP"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.Bars = void 0;
|
|
42
|
+
var react_1 = __importStar(require("react"));
|
|
43
|
+
require("../../../index.css");
|
|
44
|
+
function classNames() {
|
|
45
|
+
var classes = [];
|
|
46
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
47
|
+
classes[_i] = arguments[_i];
|
|
48
|
+
}
|
|
49
|
+
return classes.filter(Boolean).join(" ");
|
|
50
|
+
}
|
|
51
|
+
var Bars = /** @class */ (function (_super) {
|
|
52
|
+
__extends(Bars, _super);
|
|
53
|
+
function Bars() {
|
|
54
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
55
|
+
}
|
|
56
|
+
Bars.prototype.render = function () {
|
|
57
|
+
var _this = this;
|
|
58
|
+
var selectedId = this.props.selectedId;
|
|
59
|
+
return (react_1.default.createElement("nav", { className: "space-y-1", "aria-label": "Sidebar" }, this.props.bars.map(function (item) {
|
|
60
|
+
var _a;
|
|
61
|
+
return (react_1.default.createElement("a", { key: item.name, href: item.href, className: classNames(item.id === selectedId
|
|
62
|
+
? "bg-gray-100 text-gray-900"
|
|
63
|
+
: "text-gray-600 hover:bg-gray-50 hover:text-gray-900", "group flex items-center px-3 py-2 text-sm font-medium rounded-md"), "aria-current": item.id === selectedId ? "page" : undefined, onClick: (_a = _this.props.onClick) === null || _a === void 0 ? void 0 : _a.bind(_this, item.id) },
|
|
64
|
+
react_1.default.createElement(item.icon, { className: classNames(item.id === selectedId
|
|
65
|
+
? "text-gray-500"
|
|
66
|
+
: "text-gray-400 group-hover:text-gray-500", "flex-shrink-0 -ml-1 mr-3 h-6 w-6"), "aria-hidden": "true" }),
|
|
67
|
+
react_1.default.createElement("span", { className: "truncate" }, item.name)));
|
|
68
|
+
})));
|
|
69
|
+
};
|
|
70
|
+
return Bars;
|
|
71
|
+
}(react_1.Component));
|
|
72
|
+
exports.Bars = Bars;
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/navigation/bars/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,8BAA4B;AAE5B,SAAS,UAAU;IAAC,iBAAU;SAAV,UAAU,EAAV,qBAAU,EAAV,IAAU;QAAV,4BAAU;;IAC5B,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAQD;IAA0B,wBAAgB;IAA1C;;IAiCA,CAAC;IAhCC,qBAAM,GAAN;QAAA,iBA+BC;QA9BC,IAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;QACzC,OAAO,CACL,uCAAK,SAAS,EAAC,WAAW,gBAAY,SAAS,IAC5C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAC,IAAI;;YAAK,OAAA,CAC7B,qCACE,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,UAAU,CACnB,IAAI,CAAC,EAAE,KAAK,UAAU;oBACpB,CAAC,CAAC,2BAA2B;oBAC7B,CAAC,CAAC,oDAAoD,EACxD,kEAAkE,CACnE,kBACa,IAAI,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACzD,OAAO,EAAE,MAAA,KAAI,CAAC,KAAK,CAAC,OAAO,0CAAE,IAAI,CAAC,KAAI,EAAE,IAAI,CAAC,EAAE,CAAC;gBAEhD,8BAAC,IAAI,CAAC,IAAI,IACR,SAAS,EAAE,UAAU,CACnB,IAAI,CAAC,EAAE,KAAK,UAAU;wBACpB,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,yCAAyC,EAC7C,kCAAkC,CACnC,iBACW,MAAM,GAClB;gBACF,wCAAM,SAAS,EAAC,UAAU,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC3C,CACL,CAAA;SAAA,CAAC,CACE,CACP,CAAC;IACJ,CAAC;IACH,WAAC;AAAD,CAAC,AAjCD,CAA0B,iBAAS,GAiClC;AAjCY,oBAAI"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
import "../../../index.css";
|
|
3
|
+
export interface Navigation {
|
|
4
|
+
name: string;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UserNavigation {
|
|
8
|
+
name: string;
|
|
9
|
+
href: string;
|
|
10
|
+
action?: string;
|
|
11
|
+
}
|
|
12
|
+
interface Props {
|
|
13
|
+
defaultNav: string;
|
|
14
|
+
page: string;
|
|
15
|
+
logo: string;
|
|
16
|
+
navigation: Navigation[];
|
|
17
|
+
userNavigation?: UserNavigation[];
|
|
18
|
+
user?: {
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
image: string;
|
|
22
|
+
};
|
|
23
|
+
lib: {
|
|
24
|
+
Disclosure: any;
|
|
25
|
+
Menu: any;
|
|
26
|
+
Transition: any;
|
|
27
|
+
};
|
|
28
|
+
signOut?: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare class Header extends Component<Props> {
|
|
31
|
+
handleSignOut: () => Promise<void>;
|
|
32
|
+
render(): JSX.Element;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/header/index.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,oBAAoB,CAAC;AAE5B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,UAAU,KAAK;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;IAClC,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,GAAG,EAAE;QACH,UAAU,EAAE,GAAG,CAAC;QAChB,IAAI,EAAE,GAAG,CAAC;QACV,UAAU,EAAE,GAAG,CAAC;KACjB,CAAC;IAEF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,qBAAa,MAAO,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC1C,aAAa,sBAIX;IAEF,MAAM;CAiMP"}
|