@cambly/syntax-core 6.0.2 → 6.1.0
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/index.css +49 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +67 -2
- package/dist/index.js +76 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -60,7 +60,7 @@ var require_classnames = __commonJS({
|
|
|
60
60
|
"use strict";
|
|
61
61
|
var hasOwn = {}.hasOwnProperty;
|
|
62
62
|
var nativeCodeString = "[native code]";
|
|
63
|
-
function
|
|
63
|
+
function classNames10() {
|
|
64
64
|
var classes = [];
|
|
65
65
|
for (var i = 0; i < arguments.length; i++) {
|
|
66
66
|
var arg = arguments[i];
|
|
@@ -71,7 +71,7 @@ var require_classnames = __commonJS({
|
|
|
71
71
|
classes.push(arg);
|
|
72
72
|
} else if (Array.isArray(arg)) {
|
|
73
73
|
if (arg.length) {
|
|
74
|
-
var inner =
|
|
74
|
+
var inner = classNames10.apply(null, arg);
|
|
75
75
|
if (inner) {
|
|
76
76
|
classes.push(inner);
|
|
77
77
|
}
|
|
@@ -91,14 +91,14 @@ var require_classnames = __commonJS({
|
|
|
91
91
|
return classes.join(" ");
|
|
92
92
|
}
|
|
93
93
|
if (typeof module !== "undefined" && module.exports) {
|
|
94
|
-
|
|
95
|
-
module.exports =
|
|
94
|
+
classNames10.default = classNames10;
|
|
95
|
+
module.exports = classNames10;
|
|
96
96
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
97
97
|
define("classnames", [], function() {
|
|
98
|
-
return
|
|
98
|
+
return classNames10;
|
|
99
99
|
});
|
|
100
100
|
} else {
|
|
101
|
-
window.classNames =
|
|
101
|
+
window.classNames = classNames10;
|
|
102
102
|
}
|
|
103
103
|
})();
|
|
104
104
|
}
|
|
@@ -1273,6 +1273,76 @@ function SelectList({
|
|
|
1273
1273
|
);
|
|
1274
1274
|
}
|
|
1275
1275
|
SelectList.Option = SelectOption_default;
|
|
1276
|
+
|
|
1277
|
+
// src/TextField/TextField.tsx
|
|
1278
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
1279
|
+
import {
|
|
1280
|
+
useId as useId2
|
|
1281
|
+
} from "react";
|
|
1282
|
+
|
|
1283
|
+
// css-module:./TextField.module.css#css-module
|
|
1284
|
+
var TextField_module_default = { "textfield": "_textfield_cltsv_1", "label": "_label_cltsv_21", "sm": "_sm_cltsv_25", "md": "_md_cltsv_30", "lg": "_lg_cltsv_35", "inputError": "_inputError_cltsv_40" };
|
|
1285
|
+
|
|
1286
|
+
// src/TextField/TextField.tsx
|
|
1287
|
+
import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1288
|
+
function TextField({
|
|
1289
|
+
autoComplete,
|
|
1290
|
+
"data-testid": dataTestId,
|
|
1291
|
+
disabled = false,
|
|
1292
|
+
errorText = "",
|
|
1293
|
+
helperText = "",
|
|
1294
|
+
id,
|
|
1295
|
+
label,
|
|
1296
|
+
onChange,
|
|
1297
|
+
placeholder = "",
|
|
1298
|
+
size = "md",
|
|
1299
|
+
type = "text",
|
|
1300
|
+
value = ""
|
|
1301
|
+
}) {
|
|
1302
|
+
const reactId = useId2();
|
|
1303
|
+
const inputId = id != null ? id : reactId;
|
|
1304
|
+
return /* @__PURE__ */ jsxs6(
|
|
1305
|
+
Box_default,
|
|
1306
|
+
{
|
|
1307
|
+
display: "flex",
|
|
1308
|
+
direction: "column",
|
|
1309
|
+
gap: 2,
|
|
1310
|
+
width: "100%",
|
|
1311
|
+
dangerouslySetInlineStyle: {
|
|
1312
|
+
__style: {
|
|
1313
|
+
opacity: disabled ? 0.5 : 1
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
children: [
|
|
1317
|
+
label && /* @__PURE__ */ jsx19("label", { className: TextField_module_default.label, htmlFor: inputId, children: /* @__PURE__ */ jsx19(Box_default, { paddingX: 1, children: /* @__PURE__ */ jsx19(Typography_default, { size: 100, color: "gray700", children: label }) }) }),
|
|
1318
|
+
/* @__PURE__ */ jsx19(
|
|
1319
|
+
"input",
|
|
1320
|
+
{
|
|
1321
|
+
autoComplete,
|
|
1322
|
+
className: (0, import_classnames11.default)(TextField_module_default.textfield, TextField_module_default[size], {
|
|
1323
|
+
[TextField_module_default.inputError]: errorText
|
|
1324
|
+
}),
|
|
1325
|
+
"data-testid": dataTestId,
|
|
1326
|
+
disabled,
|
|
1327
|
+
id: inputId,
|
|
1328
|
+
type,
|
|
1329
|
+
onChange,
|
|
1330
|
+
placeholder,
|
|
1331
|
+
value
|
|
1332
|
+
}
|
|
1333
|
+
),
|
|
1334
|
+
(helperText || errorText) && /* @__PURE__ */ jsx19(Box_default, { paddingX: 1, children: /* @__PURE__ */ jsx19(
|
|
1335
|
+
Typography_default,
|
|
1336
|
+
{
|
|
1337
|
+
size: 100,
|
|
1338
|
+
color: errorText ? "destructive-primary" : "gray700",
|
|
1339
|
+
children: errorText || helperText
|
|
1340
|
+
}
|
|
1341
|
+
) })
|
|
1342
|
+
]
|
|
1343
|
+
}
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1276
1346
|
export {
|
|
1277
1347
|
Avatar_default as Avatar,
|
|
1278
1348
|
Badge_default as Badge,
|
|
@@ -1288,6 +1358,7 @@ export {
|
|
|
1288
1358
|
Modal,
|
|
1289
1359
|
RadioButton_default as RadioButton,
|
|
1290
1360
|
SelectList,
|
|
1361
|
+
TextField,
|
|
1291
1362
|
Typography_default as Typography
|
|
1292
1363
|
};
|
|
1293
1364
|
/*! Bundled license information:
|