@gustavo-valsechi/client 1.4.31 → 1.4.33
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/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -2
- package/dist/components/index.mjs +1 -1
- package/dist/components/types/block/index.js +12 -2
- package/dist/components/types/block/index.mjs +1 -1
- package/dist/components/types/form/index.js +1 -1
- package/dist/components/types/form/index.mjs +1 -1
- package/dist/components/types/form/types/select/index.js +20 -2
- package/dist/components/types/form/types/select/index.mjs +21 -3
- package/dist/components/types/form/types/select/options/index.d.ts +1 -0
- package/dist/components/types/form/types/select/options/index.js +29 -0
- package/dist/components/types/form/types/select/options/index.mjs +9 -0
- package/dist/components/types/form/types/select/options/styles.d.ts +1 -0
- package/dist/{contexts/icon → components/types/form/types/select/options}/styles.js +6 -1
- package/dist/components/types/form/types/select/options/styles.mjs +12 -0
- package/dist/components/types/form/types/select/styles.js +6 -12
- package/dist/components/types/form/types/select/styles.mjs +6 -12
- package/dist/components/types/index.d.ts +1 -0
- package/dist/components/types/index.js +3 -1
- package/dist/components/types/index.mjs +1 -0
- package/dist/components/types/table/modal/index.js +3 -3
- package/dist/components/types/table/modal/index.mjs +1 -1
- package/dist/components/types/tooltip/index.d.ts +2 -0
- package/dist/components/types/tooltip/index.js +33 -0
- package/dist/components/types/tooltip/index.mjs +9 -0
- package/dist/components/types/tooltip/styles.js +130 -0
- package/dist/components/types/tooltip/styles.mjs +96 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/index.js +19 -1
- package/dist/contexts/index.mjs +13 -0
- package/dist/contexts/modal/index.js +0 -1
- package/dist/contexts/modal/index.mjs +0 -1
- package/dist/contexts/target/index.d.ts +4 -0
- package/dist/contexts/target/index.js +100 -0
- package/dist/contexts/target/index.mjs +65 -0
- package/dist/contexts/tooltip/index.d.ts +2 -4
- package/dist/contexts/tooltip/index.js +12 -10
- package/dist/contexts/tooltip/index.mjs +11 -9
- package/dist/interfaces/components/form/select/index.d.ts +3 -0
- package/dist/interfaces/components/index.d.ts +1 -0
- package/dist/interfaces/components/index.js +3 -1
- package/dist/interfaces/components/index.mjs +1 -0
- package/dist/interfaces/components/tooltip/index.d.ts +4 -0
- package/dist/interfaces/components/tooltip/index.js +16 -0
- package/dist/interfaces/components/tooltip/index.mjs +0 -0
- package/dist/interfaces/contexts/index.d.ts +4 -0
- package/dist/interfaces/contexts/index.js +3 -1
- package/dist/interfaces/contexts/index.mjs +1 -0
- package/dist/interfaces/contexts/modal/index.d.ts +1 -2
- package/dist/interfaces/contexts/target/index.d.ts +3 -0
- package/dist/interfaces/contexts/target/index.js +16 -0
- package/dist/interfaces/contexts/target/index.mjs +0 -0
- package/dist/interfaces/contexts/tooltip/index.d.ts +15 -1
- package/package.json +2 -2
- package/dist/contexts/icon/styles.mjs +0 -7
- /package/dist/{contexts/icon → components/types/tooltip}/styles.d.ts +0 -0
- /package/dist/contexts/{tooltip → target}/styles.d.ts +0 -0
- /package/dist/contexts/{tooltip → target}/styles.js +0 -0
- /package/dist/contexts/{tooltip → target}/styles.mjs +0 -0
package/dist/components/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
31
|
var components_exports = {};
|
|
32
32
|
__export(components_exports, {
|
|
33
|
-
|
|
33
|
+
default: () => Component
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(components_exports);
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -57,6 +57,5 @@ function Component(props) {
|
|
|
57
57
|
}
|
|
58
58
|
// Annotate the CommonJS export names for ESM import in node:
|
|
59
59
|
0 && (module.exports = {
|
|
60
|
-
Component,
|
|
61
60
|
...require("./types")
|
|
62
61
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
var block_exports = {};
|
|
21
31
|
__export(block_exports, {
|
|
@@ -24,7 +34,7 @@ __export(block_exports, {
|
|
|
24
34
|
module.exports = __toCommonJS(block_exports);
|
|
25
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
36
|
var import_styles = require("./styles");
|
|
27
|
-
var import__ = require("../..");
|
|
37
|
+
var import__ = __toESM(require("../.."));
|
|
28
38
|
function Block(props) {
|
|
29
39
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { children: [
|
|
30
40
|
(!!props.icon || !!props.label) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
|
|
@@ -32,7 +42,7 @@ function Block(props) {
|
|
|
32
42
|
!!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: props.label })
|
|
33
43
|
] }),
|
|
34
44
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Content, { children: [
|
|
35
|
-
!!props.component && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.
|
|
45
|
+
!!props.component && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, { content: props.component }),
|
|
36
46
|
props.children
|
|
37
47
|
] })
|
|
38
48
|
] });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Container, Content } from "./styles";
|
|
4
|
-
import
|
|
4
|
+
import Component from "../..";
|
|
5
5
|
function Block(props) {
|
|
6
6
|
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
7
7
|
(!!props.icon || !!props.label) && /* @__PURE__ */ jsxs("header", { children: [
|
|
@@ -37,13 +37,21 @@ var import_react = require("react");
|
|
|
37
37
|
var import_styles = require("./styles");
|
|
38
38
|
var import_label = require("../label");
|
|
39
39
|
var import_error = require("../error");
|
|
40
|
+
var import_contexts = require("../../../../../contexts");
|
|
40
41
|
var import_lodash = __toESM(require("lodash"));
|
|
42
|
+
var import_options = __toESM(require("./options"));
|
|
41
43
|
function InputSelect(props) {
|
|
44
|
+
const inputRef = (0, import_react.useRef)({});
|
|
45
|
+
const target = (0, import_contexts.useTarget)();
|
|
42
46
|
const [focus, setFocus] = (0, import_react.useState)(false);
|
|
43
47
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
target.add({ ref: inputRef, component: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_options.default, {}) });
|
|
50
|
+
return () => target.remove(inputRef);
|
|
51
|
+
}, []);
|
|
44
52
|
const onChange = (event) => {
|
|
45
53
|
const value = event.target.value || "";
|
|
46
|
-
|
|
54
|
+
event.target.value = props.mask ? props.mask(value) : value;
|
|
47
55
|
if (props.onChange) props.onChange(value);
|
|
48
56
|
};
|
|
49
57
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, children: [
|
|
@@ -51,7 +59,17 @@ function InputSelect(props) {
|
|
|
51
59
|
props.label,
|
|
52
60
|
props.required ? "*" : ""
|
|
53
61
|
] }),
|
|
54
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "iz-input-content", children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: inputRef, className: "iz-input-content", children: [
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
"input",
|
|
65
|
+
{
|
|
66
|
+
...import_lodash.default.omit(props, ["className", "register", "mask"]),
|
|
67
|
+
type: "text",
|
|
68
|
+
maxLength: props.maxLength || 255,
|
|
69
|
+
...register,
|
|
70
|
+
onChange
|
|
71
|
+
}
|
|
72
|
+
),
|
|
55
73
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
74
|
"select",
|
|
57
75
|
{
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
3
|
+
import { useState, useRef, useEffect } from "react";
|
|
4
4
|
import { Container } from "./styles";
|
|
5
5
|
import { InputLabel } from "../label";
|
|
6
6
|
import { InputError } from "../error";
|
|
7
|
+
import { useTarget } from "../../../../../contexts";
|
|
7
8
|
import _ from "lodash";
|
|
9
|
+
import InputSelectOption from "./options";
|
|
8
10
|
function InputSelect(props) {
|
|
11
|
+
const inputRef = useRef({});
|
|
12
|
+
const target = useTarget();
|
|
9
13
|
const [focus, setFocus] = useState(false);
|
|
10
14
|
const register = (props.register || ((name) => ({})))(props.name || "");
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
target.add({ ref: inputRef, component: /* @__PURE__ */ jsx(InputSelectOption, {}) });
|
|
17
|
+
return () => target.remove(inputRef);
|
|
18
|
+
}, []);
|
|
11
19
|
const onChange = (event) => {
|
|
12
20
|
const value = event.target.value || "";
|
|
13
|
-
|
|
21
|
+
event.target.value = props.mask ? props.mask(value) : value;
|
|
14
22
|
if (props.onChange) props.onChange(value);
|
|
15
23
|
};
|
|
16
24
|
return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, children: [
|
|
@@ -18,7 +26,17 @@ function InputSelect(props) {
|
|
|
18
26
|
props.label,
|
|
19
27
|
props.required ? "*" : ""
|
|
20
28
|
] }),
|
|
21
|
-
/* @__PURE__ */ jsxs("div", { className: "iz-input-content", children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { ref: inputRef, className: "iz-input-content", children: [
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
"input",
|
|
32
|
+
{
|
|
33
|
+
..._.omit(props, ["className", "register", "mask"]),
|
|
34
|
+
type: "text",
|
|
35
|
+
maxLength: props.maxLength || 255,
|
|
36
|
+
...register,
|
|
37
|
+
onChange
|
|
38
|
+
}
|
|
39
|
+
),
|
|
22
40
|
/* @__PURE__ */ jsx(
|
|
23
41
|
"select",
|
|
24
42
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function InputSelectOption(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var options_exports = {};
|
|
21
|
+
__export(options_exports, {
|
|
22
|
+
default: () => InputSelectOption
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(options_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_styles = require("./styles");
|
|
27
|
+
function InputSelectOption(props) {
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, {});
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Container: any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -33,7 +34,11 @@ __export(styles_exports, {
|
|
|
33
34
|
module.exports = __toCommonJS(styles_exports);
|
|
34
35
|
var import_styled_components = __toESM(require("styled-components"));
|
|
35
36
|
const Container = import_styled_components.default.div`
|
|
36
|
-
|
|
37
|
+
width: 20rem;
|
|
38
|
+
height: 10rem;
|
|
39
|
+
background-color: ${({ theme }) => theme.primary};
|
|
40
|
+
border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
|
|
41
|
+
border-radius: 5px;
|
|
37
42
|
`;
|
|
38
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
44
|
0 && (module.exports = {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const Container = styled.div`
|
|
4
|
+
width: 20rem;
|
|
5
|
+
height: 10rem;
|
|
6
|
+
background-color: ${({ theme }) => theme.primary};
|
|
7
|
+
border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
|
|
8
|
+
border-radius: 5px;
|
|
9
|
+
`;
|
|
10
|
+
export {
|
|
11
|
+
Container
|
|
12
|
+
};
|
|
@@ -43,16 +43,14 @@ const Container = import_styled_components.default.div`
|
|
|
43
43
|
border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
|
|
44
44
|
border-radius: 5px;
|
|
45
45
|
overflow: hidden;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
padding-right: ${({ password }) => password ? ".6rem" : "0rem"};
|
|
47
|
+
background-color: ${({ theme }) => theme.primary};
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
input {
|
|
50
50
|
border: 0;
|
|
51
|
-
padding: .5rem
|
|
51
|
+
padding: .5rem 1rem;
|
|
52
52
|
width: 100%;
|
|
53
53
|
font-size: .8rem;
|
|
54
|
-
appearance: none;
|
|
55
|
-
cursor: pointer;
|
|
56
54
|
background-color: ${({ theme }) => theme.primary};
|
|
57
55
|
color: ${({ theme }) => theme.t6};
|
|
58
56
|
|
|
@@ -68,12 +66,8 @@ const Container = import_styled_components.default.div`
|
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
i {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
right: .8rem;
|
|
74
|
-
transform: translateY(-50%);
|
|
75
|
-
font-size: .8rem;
|
|
76
|
-
color: ${({ theme }) => theme.t6};
|
|
69
|
+
color: ${({ theme }) => theme.t3};
|
|
70
|
+
cursor: pointer;
|
|
77
71
|
}
|
|
78
72
|
}
|
|
79
73
|
`;
|
|
@@ -10,16 +10,14 @@ const Container = styled.div`
|
|
|
10
10
|
border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
|
|
11
11
|
border-radius: 5px;
|
|
12
12
|
overflow: hidden;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
padding-right: ${({ password }) => password ? ".6rem" : "0rem"};
|
|
14
|
+
background-color: ${({ theme }) => theme.primary};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
input {
|
|
17
17
|
border: 0;
|
|
18
|
-
padding: .5rem
|
|
18
|
+
padding: .5rem 1rem;
|
|
19
19
|
width: 100%;
|
|
20
20
|
font-size: .8rem;
|
|
21
|
-
appearance: none;
|
|
22
|
-
cursor: pointer;
|
|
23
21
|
background-color: ${({ theme }) => theme.primary};
|
|
24
22
|
color: ${({ theme }) => theme.t6};
|
|
25
23
|
|
|
@@ -35,12 +33,8 @@ const Container = styled.div`
|
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
i {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
right: .8rem;
|
|
41
|
-
transform: translateY(-50%);
|
|
42
|
-
font-size: .8rem;
|
|
43
|
-
color: ${({ theme }) => theme.t6};
|
|
36
|
+
color: ${({ theme }) => theme.t3};
|
|
37
|
+
cursor: pointer;
|
|
44
38
|
}
|
|
45
39
|
}
|
|
46
40
|
`;
|
|
@@ -26,6 +26,7 @@ __reExport(types_exports, require("./avatar"), module.exports);
|
|
|
26
26
|
__reExport(types_exports, require("./lottie"), module.exports);
|
|
27
27
|
__reExport(types_exports, require("./credit-card"), module.exports);
|
|
28
28
|
__reExport(types_exports, require("./block"), module.exports);
|
|
29
|
+
__reExport(types_exports, require("./tooltip"), module.exports);
|
|
29
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
31
|
0 && (module.exports = {
|
|
31
32
|
...require("./table"),
|
|
@@ -38,5 +39,6 @@ __reExport(types_exports, require("./block"), module.exports);
|
|
|
38
39
|
...require("./avatar"),
|
|
39
40
|
...require("./lottie"),
|
|
40
41
|
...require("./credit-card"),
|
|
41
|
-
...require("./block")
|
|
42
|
+
...require("./block"),
|
|
43
|
+
...require("./tooltip")
|
|
42
44
|
});
|
|
@@ -35,8 +35,8 @@ module.exports = __toCommonJS(modal_exports);
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_styles = require("./styles");
|
|
37
37
|
var import_styles2 = require("../styles");
|
|
38
|
-
var import__ = require("../../..");
|
|
39
38
|
var import_contexts = require("../../../../contexts");
|
|
39
|
+
var import__ = __toESM(require("../../.."));
|
|
40
40
|
var import_lodash = __toESM(require("lodash"));
|
|
41
41
|
var import_actions = __toESM(require("./actions"));
|
|
42
42
|
function Modal(props) {
|
|
@@ -47,7 +47,7 @@ function Modal(props) {
|
|
|
47
47
|
modal.toggle("table");
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
-
import__.
|
|
50
|
+
import__.default,
|
|
51
51
|
{
|
|
52
52
|
content: [{
|
|
53
53
|
type: "Modal",
|
|
@@ -64,7 +64,7 @@ function Modal(props) {
|
|
|
64
64
|
] }, key)
|
|
65
65
|
) }) }),
|
|
66
66
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-table-modal-actions", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
-
import__.
|
|
67
|
+
import__.default,
|
|
68
68
|
{
|
|
69
69
|
content: import_lodash.default.concat(import_lodash.default.map(actions, (data) => ({
|
|
70
70
|
type: "Button",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Content } from "./styles";
|
|
4
4
|
import { Container } from "../styles";
|
|
5
|
-
import { Component } from "../../..";
|
|
6
5
|
import { useModal } from "../../../../contexts";
|
|
6
|
+
import Component from "../../..";
|
|
7
7
|
import _ from "lodash";
|
|
8
8
|
import actionConfig from "./actions";
|
|
9
9
|
function Modal(props) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var tooltip_exports = {};
|
|
21
|
+
__export(tooltip_exports, {
|
|
22
|
+
Tooltip: () => Tooltip
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(tooltip_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_styles = require("./styles");
|
|
27
|
+
function Tooltip(props) {
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { ...props, children: props.children });
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
Tooltip
|
|
33
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var styles_exports = {};
|
|
30
|
+
__export(styles_exports, {
|
|
31
|
+
Container: () => Container
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(styles_exports);
|
|
34
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
35
|
+
const setPosition = ({ position = "top", theme }, isBorder) => {
|
|
36
|
+
const coord = isBorder ? "9" : "8";
|
|
37
|
+
const color = isBorder ? theme.t05 : theme.tooltip;
|
|
38
|
+
const defaultPosition = `
|
|
39
|
+
transform: translateX(-50%);
|
|
40
|
+
bottom: -${coord}px;
|
|
41
|
+
left: 50%;
|
|
42
|
+
border-left: 8px solid transparent;
|
|
43
|
+
border-right: 8px solid transparent;
|
|
44
|
+
border-top: 8px solid ${color};
|
|
45
|
+
`;
|
|
46
|
+
switch (position) {
|
|
47
|
+
case "bottom":
|
|
48
|
+
return `
|
|
49
|
+
transform: translateX(-50%);
|
|
50
|
+
top: -${coord}px;
|
|
51
|
+
left: 50%;
|
|
52
|
+
border-left: 8px solid transparent;
|
|
53
|
+
border-right: 8px solid transparent;
|
|
54
|
+
border-bottom: 8px solid ${color};
|
|
55
|
+
`;
|
|
56
|
+
case "left":
|
|
57
|
+
return `
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
right: -${coord}px;
|
|
60
|
+
top: 50%;
|
|
61
|
+
border-top: 8px solid transparent;
|
|
62
|
+
border-bottom: 8px solid transparent;
|
|
63
|
+
border-left: 8px solid ${color};
|
|
64
|
+
`;
|
|
65
|
+
case "right":
|
|
66
|
+
return `
|
|
67
|
+
transform: translateY(-50%);
|
|
68
|
+
left: -${coord}px;
|
|
69
|
+
top: 50%;
|
|
70
|
+
border-top: 8px solid transparent;
|
|
71
|
+
border-bottom: 8px solid transparent;
|
|
72
|
+
border-right: 8px solid ${color};
|
|
73
|
+
`;
|
|
74
|
+
case "top":
|
|
75
|
+
return defaultPosition;
|
|
76
|
+
default:
|
|
77
|
+
return defaultPosition;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const Container = import_styled_components.default.div`
|
|
81
|
+
position: fixed;
|
|
82
|
+
background: ${({ theme }) => theme.tooltip};
|
|
83
|
+
color: ${({ theme }) => theme.t6};
|
|
84
|
+
font-size: .8rem;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
text-align: center;
|
|
87
|
+
padding: .3rem .8rem;
|
|
88
|
+
border-radius: 5px;
|
|
89
|
+
z-index: 10;
|
|
90
|
+
border: 1px solid ${({ theme }) => theme.t05};
|
|
91
|
+
transform: ${({ position = "top" }) => {
|
|
92
|
+
const defaultPosition = "translateX(-50%)";
|
|
93
|
+
switch (position) {
|
|
94
|
+
case "left":
|
|
95
|
+
return "translateX(0)";
|
|
96
|
+
case "right":
|
|
97
|
+
return "translateX(-100%)";
|
|
98
|
+
case "bottom":
|
|
99
|
+
return defaultPosition;
|
|
100
|
+
case "top":
|
|
101
|
+
return defaultPosition;
|
|
102
|
+
default:
|
|
103
|
+
return defaultPosition;
|
|
104
|
+
}
|
|
105
|
+
}};
|
|
106
|
+
|
|
107
|
+
@media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&::before {
|
|
112
|
+
content: "";
|
|
113
|
+
position: absolute;
|
|
114
|
+
width: 0;
|
|
115
|
+
height: 0;
|
|
116
|
+
${(props) => setPosition(props, true)}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&::after {
|
|
120
|
+
content: "";
|
|
121
|
+
position: absolute;
|
|
122
|
+
width: 0;
|
|
123
|
+
height: 0;
|
|
124
|
+
${(props) => setPosition(props)}
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
128
|
+
0 && (module.exports = {
|
|
129
|
+
Container
|
|
130
|
+
});
|