@nurimedia/react-ui 0.1.0 → 0.1.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/dist/AlertDialog/index.cjs +4 -180
- package/dist/AlertDialog/index.cjs.map +1 -1
- package/dist/AlertDialog/index.js +5 -144
- package/dist/AlertDialog/index.js.map +1 -1
- package/dist/Button/index.cjs +4 -131
- package/dist/Button/index.cjs.map +1 -1
- package/dist/Button/index.js +5 -105
- package/dist/Button/index.js.map +1 -1
- package/dist/Checkbox/index.cjs +4 -78
- package/dist/Checkbox/index.cjs.map +1 -1
- package/dist/Checkbox/index.js +5 -42
- package/dist/Checkbox/index.js.map +1 -1
- package/dist/Input/index.cjs +4 -98
- package/dist/Input/index.cjs.map +1 -1
- package/dist/Input/index.js +5 -72
- package/dist/Input/index.js.map +1 -1
- package/dist/Modal/index.cjs +4 -115
- package/dist/Modal/index.cjs.map +1 -1
- package/dist/Modal/index.js +5 -79
- package/dist/Modal/index.js.map +1 -1
- package/dist/Radio/index.cjs +6 -81
- package/dist/Radio/index.cjs.map +1 -1
- package/dist/Radio/index.js +6 -43
- package/dist/Radio/index.js.map +1 -1
- package/dist/Select/index.cjs +4 -111
- package/dist/Select/index.cjs.map +1 -1
- package/dist/Select/index.js +5 -75
- package/dist/Select/index.js.map +1 -1
- package/dist/Switch/index.cjs +4 -66
- package/dist/Switch/index.cjs.map +1 -1
- package/dist/Switch/index.js +5 -30
- package/dist/Switch/index.js.map +1 -1
- package/dist/Textarea/index.cjs +4 -122
- package/dist/Textarea/index.cjs.map +1 -1
- package/dist/Textarea/index.js +5 -96
- package/dist/Textarea/index.js.map +1 -1
- package/dist/Toast/index.cjs +4 -177
- package/dist/Toast/index.cjs.map +1 -1
- package/dist/Toast/index.js +6 -141
- package/dist/Toast/index.js.map +1 -1
- package/dist/Tooltip/index.cjs +6 -100
- package/dist/Tooltip/index.cjs.map +1 -1
- package/dist/Tooltip/index.js +6 -62
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/chunk-2LFW4MM6.cjs +47 -0
- package/dist/chunk-2LFW4MM6.cjs.map +1 -0
- package/dist/chunk-2WKLA5RC.cjs +82 -0
- package/dist/chunk-2WKLA5RC.cjs.map +1 -0
- package/dist/chunk-2YGYLCCA.js +66 -0
- package/dist/chunk-2YGYLCCA.js.map +1 -0
- package/dist/chunk-323VGYMK.cjs +147 -0
- package/dist/chunk-323VGYMK.cjs.map +1 -0
- package/dist/chunk-3H47QMKS.js +47 -0
- package/dist/chunk-3H47QMKS.js.map +1 -0
- package/dist/chunk-3QSLHLC2.cjs +45 -0
- package/dist/chunk-3QSLHLC2.cjs.map +1 -0
- package/dist/chunk-4N5JIGIU.js +82 -0
- package/dist/chunk-4N5JIGIU.js.map +1 -0
- package/dist/chunk-DTGPVOJK.js +99 -0
- package/dist/chunk-DTGPVOJK.js.map +1 -0
- package/dist/chunk-DTQE42F7.js +33 -0
- package/dist/chunk-DTQE42F7.js.map +1 -0
- package/dist/chunk-DYO4PIBB.js +75 -0
- package/dist/chunk-DYO4PIBB.js.map +1 -0
- package/dist/chunk-GBMYANHH.js +149 -0
- package/dist/chunk-GBMYANHH.js.map +1 -0
- package/dist/chunk-I7KJ7WTN.cjs +149 -0
- package/dist/chunk-I7KJ7WTN.cjs.map +1 -0
- package/dist/chunk-JM4HDCLU.cjs +110 -0
- package/dist/chunk-JM4HDCLU.cjs.map +1 -0
- package/dist/chunk-JXJ6G634.cjs +75 -0
- package/dist/chunk-JXJ6G634.cjs.map +1 -0
- package/dist/chunk-LAPTEQ5N.js +45 -0
- package/dist/chunk-LAPTEQ5N.js.map +1 -0
- package/dist/chunk-LRATCHCB.cjs +66 -0
- package/dist/chunk-LRATCHCB.cjs.map +1 -0
- package/dist/chunk-OM4QMC4F.js +110 -0
- package/dist/chunk-OM4QMC4F.js.map +1 -0
- package/dist/chunk-PAXRFQUJ.cjs +33 -0
- package/dist/chunk-PAXRFQUJ.cjs.map +1 -0
- package/dist/chunk-PC3B67B4.cjs +78 -0
- package/dist/chunk-PC3B67B4.cjs.map +1 -0
- package/dist/chunk-PS6QXS5Z.js +11 -0
- package/dist/chunk-PS6QXS5Z.js.map +1 -0
- package/dist/chunk-Q26BJSLP.cjs +99 -0
- package/dist/chunk-Q26BJSLP.cjs.map +1 -0
- package/dist/chunk-R4E4BIPC.cjs +11 -0
- package/dist/chunk-R4E4BIPC.cjs.map +1 -0
- package/dist/chunk-R757N7RU.js +78 -0
- package/dist/chunk-R757N7RU.js.map +1 -0
- package/dist/chunk-RC773ZEY.js +147 -0
- package/dist/chunk-RC773ZEY.js.map +1 -0
- package/dist/index.cjs +54 -899
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -833
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/Button/index.js
CHANGED
|
@@ -1,108 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// src/Button/Spinner.tsx
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
var Spinner = () => /* @__PURE__ */ jsx("span", { className: "nuri-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("svg", { className: "nuri-button__spinner", viewBox: "0 0 16 16", width: "16", height: "16", fill: "none", children: [
|
|
9
|
-
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeOpacity: "0.25", strokeWidth: "2" }),
|
|
10
|
-
/* @__PURE__ */ jsx("path", { d: "M14 8a6 6 0 0 0-6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
11
|
-
] }) });
|
|
12
|
-
|
|
13
|
-
// src/utils/cx.ts
|
|
14
|
-
function cx(...classes) {
|
|
15
|
-
return classes.filter(Boolean).join(" ");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/Button/Button.tsx
|
|
19
|
-
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
20
|
-
var Button = forwardRef(function Button2({
|
|
21
|
-
variant = "primary",
|
|
22
|
-
size = "md",
|
|
23
|
-
iconLeft,
|
|
24
|
-
iconRight,
|
|
25
|
-
iconOnly = false,
|
|
26
|
-
block = false,
|
|
27
|
-
loading = false,
|
|
28
|
-
disabled = false,
|
|
29
|
-
asChild = false,
|
|
30
|
-
type = "button",
|
|
31
|
-
className,
|
|
32
|
-
children,
|
|
33
|
-
onClick,
|
|
34
|
-
...rest
|
|
35
|
-
}, ref) {
|
|
36
|
-
const isBlocked = disabled || loading;
|
|
37
|
-
if (process.env.NODE_ENV !== "production" && iconOnly && !rest["aria-label"] && !rest["aria-labelledby"]) {
|
|
38
|
-
console.warn(
|
|
39
|
-
"[nuri/Button] `iconOnly` \uBC84\uD2BC\uC740 `aria-label`(\uB610\uB294 `aria-labelledby`)\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
const hasLeftSlot = !iconOnly && (loading || iconLeft != null);
|
|
43
|
-
const hasRightSlot = !iconOnly && !loading && iconRight != null;
|
|
44
|
-
const classes = cx(
|
|
45
|
-
"nuri-button",
|
|
46
|
-
`nuri-button--${variant}`,
|
|
47
|
-
`nuri-button--${size}`,
|
|
48
|
-
block && "nuri-button--block",
|
|
49
|
-
iconOnly && "nuri-button--icon-only",
|
|
50
|
-
isBlocked && "nuri-button--disabled",
|
|
51
|
-
loading && "nuri-button--loading",
|
|
52
|
-
hasLeftSlot && "nuri-button--has-left",
|
|
53
|
-
hasRightSlot && "nuri-button--has-right",
|
|
54
|
-
className
|
|
55
|
-
);
|
|
56
|
-
const handleClick = (e) => {
|
|
57
|
-
if (isBlocked) {
|
|
58
|
-
e.preventDefault();
|
|
59
|
-
e.stopPropagation();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
onClick?.(e);
|
|
63
|
-
};
|
|
64
|
-
const renderContent = (content) => {
|
|
65
|
-
if (iconOnly) {
|
|
66
|
-
return /* @__PURE__ */ jsx2("span", { className: "nuri-button__icon", "aria-hidden": "true", children: loading ? /* @__PURE__ */ jsx2(Spinner, {}) : content });
|
|
67
|
-
}
|
|
68
|
-
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
69
|
-
loading ? /* @__PURE__ */ jsx2(Spinner, {}) : iconLeft != null && /* @__PURE__ */ jsx2("span", { className: "nuri-button__icon nuri-button__icon--left", "aria-hidden": "true", children: iconLeft }),
|
|
70
|
-
content,
|
|
71
|
-
hasRightSlot && /* @__PURE__ */ jsx2("span", { className: "nuri-button__icon nuri-button__icon--right", "aria-hidden": "true", children: iconRight })
|
|
72
|
-
] });
|
|
73
|
-
};
|
|
74
|
-
if (asChild) {
|
|
75
|
-
const child = Children.only(children);
|
|
76
|
-
if (!isValidElement(child)) return null;
|
|
77
|
-
const childElement = child;
|
|
78
|
-
return /* @__PURE__ */ jsx2(
|
|
79
|
-
Slot,
|
|
80
|
-
{
|
|
81
|
-
ref,
|
|
82
|
-
className: classes,
|
|
83
|
-
"aria-disabled": isBlocked || void 0,
|
|
84
|
-
"aria-busy": loading || void 0,
|
|
85
|
-
onClick: handleClick,
|
|
86
|
-
...rest,
|
|
87
|
-
children: cloneElement(childElement, void 0, renderContent(childElement.props.children))
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
return /* @__PURE__ */ jsx2(
|
|
92
|
-
"button",
|
|
93
|
-
{
|
|
94
|
-
ref,
|
|
95
|
-
type,
|
|
96
|
-
className: classes,
|
|
97
|
-
disabled,
|
|
98
|
-
"aria-disabled": loading || void 0,
|
|
99
|
-
"aria-busy": loading || void 0,
|
|
100
|
-
onClick: handleClick,
|
|
101
|
-
...rest,
|
|
102
|
-
children: renderContent(children)
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
});
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "../chunk-OM4QMC4F.js";
|
|
5
|
+
import "../chunk-PS6QXS5Z.js";
|
|
106
6
|
export {
|
|
107
7
|
Button
|
|
108
8
|
};
|
package/dist/Button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/Checkbox/index.cjs
CHANGED
|
@@ -1,83 +1,9 @@
|
|
|
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);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});'use client';
|
|
29
2
|
|
|
30
|
-
// src/Checkbox/index.ts
|
|
31
|
-
var Checkbox_exports = {};
|
|
32
|
-
__export(Checkbox_exports, {
|
|
33
|
-
Checkbox: () => Checkbox
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(Checkbox_exports);
|
|
36
3
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var RadixCheckbox = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
40
|
-
var import_react = require("react");
|
|
4
|
+
var _chunk3QSLHLC2cjs = require('../chunk-3QSLHLC2.cjs');
|
|
5
|
+
require('../chunk-R4E4BIPC.cjs');
|
|
41
6
|
|
|
42
|
-
// src/utils/cx.ts
|
|
43
|
-
function cx(...classes) {
|
|
44
|
-
return classes.filter(Boolean).join(" ");
|
|
45
|
-
}
|
|
46
7
|
|
|
47
|
-
|
|
48
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
-
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
-
"path",
|
|
51
|
-
{
|
|
52
|
-
d: "M2.5 6.2l2.4 2.4 4.6-5",
|
|
53
|
-
stroke: "currentColor",
|
|
54
|
-
strokeWidth: "1.6",
|
|
55
|
-
strokeLinecap: "round",
|
|
56
|
-
strokeLinejoin: "round"
|
|
57
|
-
}
|
|
58
|
-
) });
|
|
59
|
-
var IndeterminateIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.8 6h6.4", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) });
|
|
60
|
-
var Checkbox = (0, import_react.forwardRef)(function Checkbox2({ label, size = "md", disabled = false, id: idProp, className, checked, ...rest }, ref) {
|
|
61
|
-
const reactId = (0, import_react.useId)();
|
|
62
|
-
const id = idProp ?? `nuri-checkbox-${reactId}`;
|
|
63
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("nuri-checkbox", `nuri-checkbox--${size}`, className), children: [
|
|
64
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
-
RadixCheckbox.Root,
|
|
66
|
-
{
|
|
67
|
-
ref,
|
|
68
|
-
id,
|
|
69
|
-
className: "nuri-checkbox__control",
|
|
70
|
-
disabled,
|
|
71
|
-
checked,
|
|
72
|
-
...rest,
|
|
73
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadixCheckbox.Indicator, { className: "nuri-checkbox__indicator", children: checked === "indeterminate" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IndeterminateIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckIcon, {}) })
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: id, className: "nuri-checkbox__label", children: label })
|
|
77
|
-
] });
|
|
78
|
-
});
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
Checkbox
|
|
82
|
-
});
|
|
8
|
+
exports.Checkbox = _chunk3QSLHLC2cjs.Checkbox;
|
|
83
9
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/Users/summerhoony/Desktop/projects/nuri-ui/dist/Checkbox/index.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACF,8CAAC","file":"/Users/summerhoony/Desktop/projects/nuri-ui/dist/Checkbox/index.cjs"}
|
package/dist/Checkbox/index.js
CHANGED
|
@@ -1,45 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// src/utils/cx.ts
|
|
7
|
-
function cx(...classes) {
|
|
8
|
-
return classes.filter(Boolean).join(" ");
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// src/Checkbox/Checkbox.tsx
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
var CheckIcon = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
14
|
-
"path",
|
|
15
|
-
{
|
|
16
|
-
d: "M2.5 6.2l2.4 2.4 4.6-5",
|
|
17
|
-
stroke: "currentColor",
|
|
18
|
-
strokeWidth: "1.6",
|
|
19
|
-
strokeLinecap: "round",
|
|
20
|
-
strokeLinejoin: "round"
|
|
21
|
-
}
|
|
22
|
-
) });
|
|
23
|
-
var IndeterminateIcon = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M2.8 6h6.4", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) });
|
|
24
|
-
var Checkbox = forwardRef(function Checkbox2({ label, size = "md", disabled = false, id: idProp, className, checked, ...rest }, ref) {
|
|
25
|
-
const reactId = useId();
|
|
26
|
-
const id = idProp ?? `nuri-checkbox-${reactId}`;
|
|
27
|
-
return /* @__PURE__ */ jsxs("div", { className: cx("nuri-checkbox", `nuri-checkbox--${size}`, className), children: [
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
-
RadixCheckbox.Root,
|
|
30
|
-
{
|
|
31
|
-
ref,
|
|
32
|
-
id,
|
|
33
|
-
className: "nuri-checkbox__control",
|
|
34
|
-
disabled,
|
|
35
|
-
checked,
|
|
36
|
-
...rest,
|
|
37
|
-
children: /* @__PURE__ */ jsx(RadixCheckbox.Indicator, { className: "nuri-checkbox__indicator", children: checked === "indeterminate" ? /* @__PURE__ */ jsx(IndeterminateIcon, {}) : /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
label != null && /* @__PURE__ */ jsx("label", { htmlFor: id, className: "nuri-checkbox__label", children: label })
|
|
41
|
-
] });
|
|
42
|
-
});
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Checkbox
|
|
4
|
+
} from "../chunk-LAPTEQ5N.js";
|
|
5
|
+
import "../chunk-PS6QXS5Z.js";
|
|
43
6
|
export {
|
|
44
7
|
Checkbox
|
|
45
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/Input/index.cjs
CHANGED
|
@@ -1,103 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});'use client';
|
|
19
2
|
|
|
20
|
-
// src/Input/index.ts
|
|
21
|
-
var Input_exports = {};
|
|
22
|
-
__export(Input_exports, {
|
|
23
|
-
Input: () => Input
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Input_exports);
|
|
26
3
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var import_react = require("react");
|
|
4
|
+
var _chunkJXJ6G634cjs = require('../chunk-JXJ6G634.cjs');
|
|
5
|
+
require('../chunk-R4E4BIPC.cjs');
|
|
30
6
|
|
|
31
|
-
// src/utils/cx.ts
|
|
32
|
-
function cx(...classes) {
|
|
33
|
-
return classes.filter(Boolean).join(" ");
|
|
34
|
-
}
|
|
35
7
|
|
|
36
|
-
|
|
37
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
-
var Input = (0, import_react.forwardRef)(function Input2({
|
|
39
|
-
size = "md",
|
|
40
|
-
label,
|
|
41
|
-
hideLabel = false,
|
|
42
|
-
description,
|
|
43
|
-
invalid = false,
|
|
44
|
-
errorMessage,
|
|
45
|
-
iconLeft,
|
|
46
|
-
iconRight,
|
|
47
|
-
block = false,
|
|
48
|
-
disabled = false,
|
|
49
|
-
className,
|
|
50
|
-
id: idProp,
|
|
51
|
-
"aria-describedby": ariaDescribedby,
|
|
52
|
-
...rest
|
|
53
|
-
}, ref) {
|
|
54
|
-
const reactId = (0, import_react.useId)();
|
|
55
|
-
const id = idProp ?? `nuri-input-${reactId}`;
|
|
56
|
-
const messageId = `${id}-message`;
|
|
57
|
-
const message = invalid && errorMessage != null ? errorMessage : description;
|
|
58
|
-
const hasMessage = message != null;
|
|
59
|
-
const describedBy = cx(hasMessage ? messageId : void 0, ariaDescribedby) || void 0;
|
|
60
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("nuri-input", block && "nuri-input--block", className), children: [
|
|
61
|
-
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: id, className: cx("nuri-input__label", hideLabel && "nuri-sr-only"), children: label }),
|
|
62
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: cx(
|
|
66
|
-
"nuri-input__field",
|
|
67
|
-
`nuri-input__field--${size}`,
|
|
68
|
-
invalid && "nuri-input__field--invalid",
|
|
69
|
-
disabled && "nuri-input__field--disabled"
|
|
70
|
-
),
|
|
71
|
-
children: [
|
|
72
|
-
iconLeft != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "nuri-input__icon", "aria-hidden": "true", children: iconLeft }),
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
-
"input",
|
|
75
|
-
{
|
|
76
|
-
ref,
|
|
77
|
-
id,
|
|
78
|
-
className: "nuri-input__control",
|
|
79
|
-
disabled,
|
|
80
|
-
"aria-invalid": invalid || void 0,
|
|
81
|
-
"aria-describedby": describedBy,
|
|
82
|
-
...rest
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
iconRight != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "nuri-input__icon", "aria-hidden": "true", children: iconRight })
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
hasMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
-
"p",
|
|
91
|
-
{
|
|
92
|
-
id: messageId,
|
|
93
|
-
className: cx("nuri-input__message", invalid && "nuri-input__message--error"),
|
|
94
|
-
children: message
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
] });
|
|
98
|
-
});
|
|
99
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
-
0 && (module.exports = {
|
|
101
|
-
Input
|
|
102
|
-
});
|
|
8
|
+
exports.Input = _chunkJXJ6G634cjs.Input;
|
|
103
9
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Input/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/Users/summerhoony/Desktop/projects/nuri-ui/dist/Input/index.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACF,wCAAC","file":"/Users/summerhoony/Desktop/projects/nuri-ui/dist/Input/index.cjs"}
|
package/dist/Input/index.js
CHANGED
|
@@ -1,75 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function cx(...classes) {
|
|
7
|
-
return classes.filter(Boolean).join(" ");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// src/Input/Input.tsx
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
var Input = forwardRef(function Input2({
|
|
13
|
-
size = "md",
|
|
14
|
-
label,
|
|
15
|
-
hideLabel = false,
|
|
16
|
-
description,
|
|
17
|
-
invalid = false,
|
|
18
|
-
errorMessage,
|
|
19
|
-
iconLeft,
|
|
20
|
-
iconRight,
|
|
21
|
-
block = false,
|
|
22
|
-
disabled = false,
|
|
23
|
-
className,
|
|
24
|
-
id: idProp,
|
|
25
|
-
"aria-describedby": ariaDescribedby,
|
|
26
|
-
...rest
|
|
27
|
-
}, ref) {
|
|
28
|
-
const reactId = useId();
|
|
29
|
-
const id = idProp ?? `nuri-input-${reactId}`;
|
|
30
|
-
const messageId = `${id}-message`;
|
|
31
|
-
const message = invalid && errorMessage != null ? errorMessage : description;
|
|
32
|
-
const hasMessage = message != null;
|
|
33
|
-
const describedBy = cx(hasMessage ? messageId : void 0, ariaDescribedby) || void 0;
|
|
34
|
-
return /* @__PURE__ */ jsxs("div", { className: cx("nuri-input", block && "nuri-input--block", className), children: [
|
|
35
|
-
label != null && /* @__PURE__ */ jsx("label", { htmlFor: id, className: cx("nuri-input__label", hideLabel && "nuri-sr-only"), children: label }),
|
|
36
|
-
/* @__PURE__ */ jsxs(
|
|
37
|
-
"div",
|
|
38
|
-
{
|
|
39
|
-
className: cx(
|
|
40
|
-
"nuri-input__field",
|
|
41
|
-
`nuri-input__field--${size}`,
|
|
42
|
-
invalid && "nuri-input__field--invalid",
|
|
43
|
-
disabled && "nuri-input__field--disabled"
|
|
44
|
-
),
|
|
45
|
-
children: [
|
|
46
|
-
iconLeft != null && /* @__PURE__ */ jsx("span", { className: "nuri-input__icon", "aria-hidden": "true", children: iconLeft }),
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
48
|
-
"input",
|
|
49
|
-
{
|
|
50
|
-
ref,
|
|
51
|
-
id,
|
|
52
|
-
className: "nuri-input__control",
|
|
53
|
-
disabled,
|
|
54
|
-
"aria-invalid": invalid || void 0,
|
|
55
|
-
"aria-describedby": describedBy,
|
|
56
|
-
...rest
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
iconRight != null && /* @__PURE__ */ jsx("span", { className: "nuri-input__icon", "aria-hidden": "true", children: iconRight })
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
hasMessage && /* @__PURE__ */ jsx(
|
|
64
|
-
"p",
|
|
65
|
-
{
|
|
66
|
-
id: messageId,
|
|
67
|
-
className: cx("nuri-input__message", invalid && "nuri-input__message--error"),
|
|
68
|
-
children: message
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] });
|
|
72
|
-
});
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Input
|
|
4
|
+
} from "../chunk-DYO4PIBB.js";
|
|
5
|
+
import "../chunk-PS6QXS5Z.js";
|
|
73
6
|
export {
|
|
74
7
|
Input
|
|
75
8
|
};
|
package/dist/Input/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|