@nurihaus/web-design-system 1.1.2 → 1.1.4

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import "./avatar-style.css";
4
+ import { BaseBadge } from "../badge/base-badge";
5
+ var Avatar = function (props) {
6
+ var size = props.size, src = props.src, alt = props.alt, badgeOption = props.badgeOption;
7
+ var _a = useState(false), isImageDownload = _a[0], setIsImageDownload = _a[1];
8
+ return (_jsxs("div", { className: "avatar ".concat(size), children: [_jsx("img", { src: src, alt: alt !== null && alt !== void 0 ? alt : "avatar", className: "avatar ".concat(size, " ").concat(!isImageDownload ? "hidden" : ""), onLoad: function () { return setIsImageDownload(true); } }), !isImageDownload && (_jsx("div", { className: "avatar avatar-skeleton ".concat(size), children: _jsx("div", { className: "avatar skeleton-animation" }) })), _jsx(BaseBadge, { asChild: true, style: {
9
+ position: "absolute",
10
+ right: "0",
11
+ bottom: "0",
12
+ }, children: badgeOption })] }));
13
+ };
14
+ export default Avatar;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Composer from "../core/composer";
3
+ export var BaseBadge = function (props) {
4
+ var _a = props.asChild, asChild = _a === void 0 ? false : _a, borderColor = props.borderColor, _b = props.textColor, textColor = _b === void 0 ? "black" : _b, backgroundColor = props.backgroundColor, _c = props.size, size = _c === void 0 ? "l" : _c, style = props.style, children = props.children, className = props.className;
5
+ var Comp = asChild ? Composer : "div";
6
+ var composedClassName = "nuri-theme base-badge ".concat(size, " border-").concat(borderColor, " text-").concat(textColor, " background-").concat(backgroundColor, " ").concat(className);
7
+ return (_jsx(Comp, { style: style, className: composedClassName, children: children }));
8
+ };
@@ -0,0 +1,18 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { BaseBadge } from "./base-badge";
14
+ var IconTextBadge = function (props) {
15
+ var icon = props.icon, text = props.text;
16
+ return (_jsxs(BaseBadge, __assign({}, props, { children: [icon, _jsx("span", { children: text })] })));
17
+ };
18
+ export default IconTextBadge;
@@ -0,0 +1,19 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import "./badge-style.css";
14
+ import { BaseBadge } from "./base-badge";
15
+ var IconTextOptionBadge = function (props) {
16
+ var icon = props.icon, text = props.text, option = props.option;
17
+ return (_jsxs(BaseBadge, __assign({}, props, { className: "icon-text-option", children: [_jsxs("span", { children: [icon, _jsx("span", { children: text })] }), option] })));
18
+ };
19
+ export default IconTextOptionBadge;
@@ -0,0 +1,18 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { BaseBadge } from "./base-badge";
14
+ var OptionBadge = function (props) {
15
+ var option = props.option;
16
+ return _jsx(BaseBadge, __assign({}, props, { children: option }));
17
+ };
18
+ export default OptionBadge;
@@ -0,0 +1,34 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { forwardRef } from "react";
25
+ import Composer from "../core/composer";
26
+ import "./button-style.css";
27
+ import "../../styles/token/color.css";
28
+ import "../../styles/token/font.css";
29
+ var BaseButton = forwardRef(function (_a, ref) {
30
+ var children = _a.children, _b = _a.asChild, asChild = _b === void 0 ? false : _b, className = _a.className, props = __rest(_a, ["children", "asChild", "className"]);
31
+ var Comp = asChild ? Composer : "button";
32
+ return (_jsx(Comp, __assign({ ref: ref, className: "base-button ".concat(className), onClick: function () { return console.log("base"); } }, props, { children: children })));
33
+ });
34
+ export default BaseButton;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import CTAButton from "./cta-button";
2
+ var meta = {
3
+ title: "Components/Button",
4
+ component: CTAButton,
5
+ };
6
+ export default meta;
7
+ export var Default = {
8
+ args: {
9
+ text: "Default Button",
10
+ variant: "primary",
11
+ size: "m",
12
+ },
13
+ };
14
+ export var Primary = {
15
+ args: {
16
+ text: "CTA Button",
17
+ variant: "primary",
18
+ size: "m",
19
+ },
20
+ };
@@ -0,0 +1,19 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import BaseButton from "./base-button";
14
+ import Loading from "../loading/loading";
15
+ var CTAButton = function (props) {
16
+ var text = props.text, _a = props.variant, variant = _a === void 0 ? "primary" : _a, _b = props.size, size = _b === void 0 ? "m" : _b, _c = props.disabled, disabled = _c === void 0 ? false : _c, icon = props.icon, _d = props.loading, loading = _d === void 0 ? false : _d;
17
+ return (_jsx(BaseButton, __assign({}, props, { className: "nuri-theme cta-button ".concat(disabled ? "disabled" : variant, " ").concat(size), children: loading ? (_jsx(Loading, {})) : (_jsxs(_Fragment, { children: [icon, text] })) })));
18
+ };
19
+ export default CTAButton;
@@ -0,0 +1,107 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { Children, cloneElement, forwardRef, isValidElement, } from "react";
24
+ function composeRefs() {
25
+ var refs = [];
26
+ for (var _i = 0; _i < arguments.length; _i++) {
27
+ refs[_i] = arguments[_i];
28
+ }
29
+ return function (node) {
30
+ refs.forEach(function (ref) {
31
+ if (ref) {
32
+ if (typeof ref === "function") {
33
+ ref(node);
34
+ }
35
+ else {
36
+ ref.current = node;
37
+ }
38
+ }
39
+ });
40
+ };
41
+ }
42
+ var Composer = forwardRef(function (_a, ref) {
43
+ var children = _a.children, composerProps = __rest(_a, ["children"]);
44
+ var childArray = Children.toArray(children);
45
+ if (childArray.length > 1) {
46
+ throw new Error("Composer can only have one child");
47
+ }
48
+ var isValidChild = isValidElement(childArray[0]);
49
+ if (!isValidChild) {
50
+ throw new Error("child should be React node!");
51
+ }
52
+ var child = childArray[0];
53
+ var childRef = getElementRef(child);
54
+ var mergedProps = mergeProps(composerProps, child.props);
55
+ return cloneElement(child, __assign(__assign({}, mergedProps), { ref: ref ? composeRefs(ref, childRef) : childRef }));
56
+ });
57
+ Composer.displayName = "Composer";
58
+ function mergeProps(composerProps, childProps) {
59
+ var overrideProps = __assign({}, childProps);
60
+ var _loop_1 = function (propName) {
61
+ var composerPropValue = composerProps[propName];
62
+ var childPropValue = childProps[propName];
63
+ var isHandler = /^on[A-Z]/.test(propName);
64
+ if (isHandler) {
65
+ if (composerPropValue && childPropValue) {
66
+ overrideProps[propName] = function () {
67
+ var args = [];
68
+ for (var _i = 0; _i < arguments.length; _i++) {
69
+ args[_i] = arguments[_i];
70
+ }
71
+ childPropValue.apply(void 0, args);
72
+ composerPropValue.apply(void 0, args);
73
+ };
74
+ }
75
+ else if (composerPropValue) {
76
+ overrideProps[propName] = composerPropValue;
77
+ }
78
+ }
79
+ else if (propName === "style") {
80
+ overrideProps[propName] = __assign(__assign({}, composerPropValue), childPropValue);
81
+ }
82
+ else if (propName === "className") {
83
+ overrideProps[propName] = [composerPropValue, childPropValue]
84
+ .filter(Boolean)
85
+ .join(" ");
86
+ }
87
+ };
88
+ for (var propName in composerProps) {
89
+ _loop_1(propName);
90
+ }
91
+ return __assign(__assign({}, composerProps), overrideProps);
92
+ }
93
+ function getElementRef(element) {
94
+ var _a, _b;
95
+ var getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) === null || _a === void 0 ? void 0 : _a.get;
96
+ var mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
97
+ if (mayWarn) {
98
+ return element.ref;
99
+ }
100
+ getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) === null || _b === void 0 ? void 0 : _b.get;
101
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
102
+ if (mayWarn) {
103
+ return element.props.ref;
104
+ }
105
+ return (element.props.ref || element.ref);
106
+ }
107
+ export default Composer;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "./loading-style.css";
3
+ var Loading = function () {
4
+ return (_jsx("div", { className: "component-loading-container", children: _jsxs("div", { className: "loading-indicator-ring", children: [_jsx("div", { className: "loading-indicator-single-ring" }), _jsx("div", { className: "loading-indicator-single-ring" }), _jsx("div", { className: "loading-indicator-single-ring" }), _jsx("div", { className: "loading-indicator-single-ring" })] }) }));
5
+ };
6
+ export default Loading;
@@ -0,0 +1,47 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import "./table-style.css";
25
+ var TableRoot = function (props) {
26
+ return _jsx("table", { className: "base-table table-root", children: props.children });
27
+ };
28
+ var TableHeader = function (props) {
29
+ var _a = props.justify, justify = _a === void 0 ? "center" : _a;
30
+ return (_jsx("thead", { className: "base-table table-header ".concat(justify), children: props.children }));
31
+ };
32
+ var TableRow = function (props) {
33
+ return _jsx("tr", { className: "base-table table-row", children: props.children });
34
+ };
35
+ var TableBody = function (props) {
36
+ return _jsx("tbody", { className: "base-table table-body", children: props.children });
37
+ };
38
+ var TableCell = function (props) {
39
+ var className = props.className, rest = __rest(props, ["className"]);
40
+ var classNames = ["base-table", "table-cell", className].join(" ");
41
+ return (_jsx("td", __assign({ className: classNames }, rest, { children: props.children })));
42
+ };
43
+ TableRoot.Header = TableHeader;
44
+ TableRoot.Body = TableBody;
45
+ TableRoot.Row = TableRow;
46
+ TableRoot.Cell = TableCell;
47
+ export default TableRoot;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useLayoutEffect, useRef } from "react";
3
+ import TableRoot from "./base-table";
4
+ var DataTable = function (props) {
5
+ var rows = props.rows, columns = props.columns;
6
+ var displayRows = useRef(rows.map(function (row) { return ({ row: row, hide: false }); }));
7
+ useLayoutEffect(function () {
8
+ displayRows.current = rows.map(function (row) {
9
+ var _a, _b;
10
+ return ({
11
+ row: row,
12
+ hide: (_b = (_a = displayRows.current.find(function (item) { return item.row.id === row.id; })) === null || _a === void 0 ? void 0 : _a.hide) !== null && _b !== void 0 ? _b : false,
13
+ });
14
+ });
15
+ }, [rows]);
16
+ return (_jsxs(TableRoot, { children: [_jsx(TableRoot.Header, { children: _jsx(TableRoot.Row, { children: displayRows.current.map(function (item) {
17
+ return (_jsx(TableRoot.Cell, { className: item.hide ? "hide" : "", children: item.row.value }, item.row.id));
18
+ }) }) }), _jsx(TableRoot.Body, { children: columns.map(function (column) {
19
+ return (_jsx(TableRoot.Row, { children: displayRows.current.map(function (item) { return (_jsx(TableRoot.Cell, { className: item.hide ? "hide" : "", children: column[item.row.id] }, item.row.id)); }) }));
20
+ }) })] }));
21
+ };
22
+ export default DataTable;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import DataTable from "./data-table";
3
+ var meta = {
4
+ title: "Components/Table",
5
+ component: DataTable,
6
+ };
7
+ export default meta;
8
+ var rows = [
9
+ { id: "row1", value: "row1" },
10
+ { id: "row2", value: "row2" },
11
+ { id: "row3", value: "row3" },
12
+ { id: "row4", value: "row4" },
13
+ { id: "row5", value: "row5" },
14
+ { id: "row6", value: "row6" },
15
+ { id: "row7", value: "row7" },
16
+ { id: "row8", value: "row8" },
17
+ { id: "row9", value: "row9" },
18
+ { id: "row10", value: "row10" },
19
+ { id: "row11", value: "row11" },
20
+ { id: "row12", value: "row12" },
21
+ { id: "row13", value: "row13" },
22
+ { id: "row14", value: "row14" },
23
+ { id: "row15", value: "row15" },
24
+ { id: "row16", value: "row16" },
25
+ ];
26
+ export var Default = {
27
+ args: {
28
+ rows: [
29
+ { id: "row1", value: "row1" },
30
+ { id: "row2", value: "row2" },
31
+ { id: "row3", value: "row3" },
32
+ { id: "row4", value: "row4" },
33
+ { id: "row5", value: "row5" },
34
+ { id: "row6", value: "row6" },
35
+ { id: "row7", value: "row7" },
36
+ { id: "row8", value: "row8" },
37
+ { id: "row9", value: "row9" },
38
+ { id: "row10", value: "row10" },
39
+ { id: "row11", value: "row11" },
40
+ { id: "row12", value: "row12" },
41
+ { id: "row13", value: "row13" },
42
+ { id: "row14", value: "row14" },
43
+ { id: "row15", value: "row15" },
44
+ { id: "row16", value: "row16" },
45
+ ],
46
+ columns: [
47
+ {
48
+ row1: (_jsx("div", { children: _jsx("img", { src: "https://picsum.photos/200/300", alt: "Sample", style: { width: 100 } }) })),
49
+ row2: _jsx("div", { children: "12222222222222222222222" }),
50
+ row3: _jsx("div", { children: "1" }),
51
+ row4: _jsx("div", { children: "1" }),
52
+ row5: _jsx("div", { children: "1" }),
53
+ row6: _jsx("div", { children: "1" }),
54
+ row7: _jsx("div", { children: "1" }),
55
+ row8: _jsx("div", { children: "1" }),
56
+ row9: _jsx("div", { children: "1" }),
57
+ row10: _jsx("div", { children: "1" }),
58
+ row11: _jsx("div", { children: "1" }),
59
+ row12: _jsx("div", { children: "1" }),
60
+ row13: _jsx("div", { children: "1" }),
61
+ row14: _jsx("div", { children: "1" }),
62
+ row15: _jsx("div", { children: "1" }),
63
+ row16: _jsx("div", { children: "1" }),
64
+ },
65
+ ],
66
+ },
67
+ };
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useState, } from "react";
3
+ import "./text-field-style.css";
4
+ import "../../styles/token/font.css";
5
+ var TextLabel = function (props) {
6
+ var text = props.text, className = props.className;
7
+ return _jsx("div", { className: className, children: text });
8
+ };
9
+ var InputField = function (props) {
10
+ var className = props.className, placeholder = props.placeholder, name = props.name;
11
+ var _a = useContext(TextFieldContext), isError = _a.isError, convertErrorState = _a.convertErrorState;
12
+ return _jsx("input", { className: className, placeholder: placeholder, name: name });
13
+ };
14
+ var HelperText = function (props) {
15
+ var text = props.text, className = props.className, _a = props.isError, isError = _a === void 0 ? false : _a;
16
+ var errorClassName = isError ? "error" : "";
17
+ return _jsx("div", { className: "".concat(className, " ").concat(errorClassName), children: text });
18
+ };
19
+ var TextFieldContext = createContext({
20
+ isError: false,
21
+ convertErrorState: function () { },
22
+ });
23
+ var TextFieldRoot = function (_a) {
24
+ var children = _a.children, validations = _a.validations, width = _a.width;
25
+ var _b = useState(false), isError = _b[0], setIsError = _b[1];
26
+ var convertErrorState = function (value) {
27
+ setIsError(value);
28
+ };
29
+ return (_jsx("span", { className: "text-field-root", style: { display: "block", width: "".concat(width, "px") }, children: _jsx(TextFieldContext.Provider, { value: { isError: isError, convertErrorState: convertErrorState }, children: children }) }));
30
+ };
31
+ TextFieldRoot.TextLabel = TextLabel;
32
+ TextFieldRoot.InputField = InputField;
33
+ TextFieldRoot.HelperText = HelperText;
34
+ export default TextFieldRoot;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import TextFieldRoot from "./base-text-field";
3
+ import "./text-field-style.css";
4
+ import "../../styles/token/font.css";
5
+ var TextFieldWithError = function (_a) {
6
+ var _b = _a.width, width = _b === void 0 ? 343 : _b, _c = _a.placeholder, placeholder = _c === void 0 ? "" : _c, _d = _a.name, name = _d === void 0 ? "" : _d, helperText = _a.helperText, labelText = _a.labelText;
7
+ return (_jsxs(TextFieldRoot, { width: width, children: [labelText && (_jsx(TextFieldRoot.TextLabel, { text: labelText, className: "nuri-theme text-field label" })), _jsx("div", { className: "nuri-theme text-field input-wrapper", children: _jsx(TextFieldRoot.InputField, { className: "nuri-theme text-field input", placeholder: placeholder, name: name }) }), helperText && (_jsx(TextFieldRoot.HelperText, { text: helperText, className: "nuri-theme text-field helper-text", isError: true }))] }));
8
+ };
9
+ export default TextFieldWithError;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import TextFieldRoot from "./base-text-field";
3
+ import "./text-field-style.css";
4
+ import "../../styles/token/font.css";
5
+ var TextField = function (_a) {
6
+ var _b = _a.width, width = _b === void 0 ? 343 : _b, _c = _a.placeholder, placeholder = _c === void 0 ? "" : _c, _d = _a.name, name = _d === void 0 ? "" : _d, helperText = _a.helperText, labelText = _a.labelText;
7
+ return (_jsxs(TextFieldRoot, { validations: [], width: width, children: [labelText && (_jsx(TextFieldRoot.TextLabel, { text: labelText, className: "nuri-theme text-field label" })), _jsx("div", { className: "nuri-theme text-field input-wrapper", children: _jsx(TextFieldRoot.InputField, { className: "nuri-theme text-field input", placeholder: placeholder, name: name }) }), helperText && (_jsx(TextFieldRoot.HelperText, { text: helperText, className: "nuri-theme text-field helper-text" }))] }));
8
+ };
9
+ export default TextField;
@@ -0,0 +1,13 @@
1
+ import TextFieldWithError from "./text-field-with-error";
2
+ var meta = {
3
+ title: "Components/TextField",
4
+ component: TextFieldWithError,
5
+ };
6
+ export default meta;
7
+ export var Default = {
8
+ args: {
9
+ labelText: "Title",
10
+ placeholder: "Enter your title",
11
+ helperText: "This is a helper text",
12
+ },
13
+ };