@cambly/syntax-core 19.2.0 → 19.3.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/Avatar/Avatar.d.ts +1 -1
- package/dist/Badge/Badge.cjs +4 -4
- package/dist/Badge/Badge.css +49 -43
- package/dist/Badge/Badge.css.map +1 -1
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +3 -3
- package/dist/Button/Button.cjs +4 -4
- package/dist/Button/Button.css +49 -43
- package/dist/Button/Button.css.map +1 -1
- package/dist/Button/Button.js +3 -3
- package/dist/Checkbox/Checkbox.cjs +4 -4
- package/dist/Checkbox/Checkbox.css +49 -43
- package/dist/Checkbox/Checkbox.css.map +1 -1
- package/dist/Checkbox/Checkbox.js +3 -3
- package/dist/Chip/Chip.cjs +4 -4
- package/dist/Chip/Chip.css +49 -43
- package/dist/Chip/Chip.css.map +1 -1
- package/dist/Chip/Chip.js +3 -3
- package/dist/Heading/Heading.cjs +4 -4
- package/dist/Heading/Heading.css +49 -43
- package/dist/Heading/Heading.css.map +1 -1
- package/dist/Heading/Heading.d.ts +5 -3
- package/dist/Heading/Heading.js +3 -3
- package/dist/LinkButton/LinkButton.cjs +4 -4
- package/dist/LinkButton/LinkButton.css +49 -43
- package/dist/LinkButton/LinkButton.css.map +1 -1
- package/dist/LinkButton/LinkButton.js +3 -3
- package/dist/Modal/Modal.cjs +5 -5
- package/dist/Modal/Modal.css +49 -43
- package/dist/Modal/Modal.css.map +1 -1
- package/dist/Modal/Modal.js +4 -4
- package/dist/RadioButton/RadioButton.cjs +4 -4
- package/dist/RadioButton/RadioButton.css +49 -43
- package/dist/RadioButton/RadioButton.css.map +1 -1
- package/dist/RadioButton/RadioButton.js +3 -3
- package/dist/RichSelect/RichSelectBox.cjs +10 -10
- package/dist/RichSelect/RichSelectBox.css +49 -43
- package/dist/RichSelect/RichSelectBox.css.map +1 -1
- package/dist/RichSelect/RichSelectBox.js +9 -9
- package/dist/RichSelect/RichSelectChip.cjs +5 -5
- package/dist/RichSelect/RichSelectChip.css +49 -43
- package/dist/RichSelect/RichSelectChip.css.map +1 -1
- package/dist/RichSelect/RichSelectChip.js +4 -4
- package/dist/RichSelect/RichSelectList.cjs +12 -12
- package/dist/RichSelect/RichSelectList.css +49 -43
- package/dist/RichSelect/RichSelectList.css.map +1 -1
- package/dist/RichSelect/RichSelectList.js +11 -11
- package/dist/RichSelect/RichSelectRadioButton.cjs +5 -5
- package/dist/RichSelect/RichSelectRadioButton.css +49 -43
- package/dist/RichSelect/RichSelectRadioButton.css.map +1 -1
- package/dist/RichSelect/RichSelectRadioButton.js +4 -4
- package/dist/RichSelect/RichSelectSection.cjs +4 -4
- package/dist/RichSelect/RichSelectSection.css +49 -43
- package/dist/RichSelect/RichSelectSection.css.map +1 -1
- package/dist/RichSelect/RichSelectSection.js +3 -3
- package/dist/SelectList/SelectList.cjs +5 -5
- package/dist/SelectList/SelectList.css +49 -43
- package/dist/SelectList/SelectList.css.map +1 -1
- package/dist/SelectList/SelectList.js +4 -4
- package/dist/TabButton/TabButton.cjs +5 -5
- package/dist/TabButton/TabButton.css +49 -43
- package/dist/TabButton/TabButton.css.map +1 -1
- package/dist/TabButton/TabButton.js +4 -4
- package/dist/TabLink/TabLink.cjs +5 -5
- package/dist/TabLink/TabLink.css +49 -43
- package/dist/TabLink/TabLink.css.map +1 -1
- package/dist/TabLink/TabLink.js +4 -4
- package/dist/Tabs/TabInternal.cjs +4 -4
- package/dist/Tabs/TabInternal.css +49 -43
- package/dist/Tabs/TabInternal.css.map +1 -1
- package/dist/Tabs/TabInternal.js +3 -3
- package/dist/TapArea/TapArea.d.ts +1 -1
- package/dist/TextArea/TextArea.cjs +4 -4
- package/dist/TextArea/TextArea.css +70 -52
- package/dist/TextArea/TextArea.css.map +1 -1
- package/dist/TextArea/TextArea.js +3 -3
- package/dist/TextField/TextField.cjs +4 -4
- package/dist/TextField/TextField.css +70 -52
- package/dist/TextField/TextField.css.map +1 -1
- package/dist/TextField/TextField.d.ts +7 -1
- package/dist/TextField/TextField.js +3 -3
- package/dist/Tooltip/Tooltip.cjs +4 -4
- package/dist/Tooltip/Tooltip.css +49 -43
- package/dist/Tooltip/Tooltip.css.map +1 -1
- package/dist/Tooltip/Tooltip.js +3 -3
- package/dist/Typography/Typography.cjs +3 -3
- package/dist/Typography/Typography.css +49 -43
- package/dist/Typography/Typography.css.map +1 -1
- package/dist/Typography/Typography.d.ts +6 -4
- package/dist/Typography/Typography.js +2 -2
- package/dist/WordConfetti/WordConfetti.cjs +4 -4
- package/dist/WordConfetti/WordConfetti.css +49 -43
- package/dist/WordConfetti/WordConfetti.css.map +1 -1
- package/dist/WordConfetti/WordConfetti.js +3 -3
- package/dist/__chunks/{PBHAJ42K.js → 45DUMC5J.js} +2 -2
- package/dist/__chunks/{4MHKTQMD.js → 4FGMH6ZT.js} +2 -2
- package/dist/__chunks/{OMXDPTE4.cjs → 5I7B5SAF.cjs} +10 -10
- package/dist/__chunks/{AHICHJTL.js → 6KET3XO2.js} +2 -2
- package/dist/__chunks/{BFEZ3PUT.cjs → 7COSMEXW.cjs} +3 -3
- package/dist/__chunks/{ZHU5A7BH.js → 7YH3K65I.js} +5 -5
- package/dist/__chunks/{EHZAOGLQ.cjs → AAZIVDWS.cjs} +3 -3
- package/dist/__chunks/{4AI6GQ5U.cjs → AI52ORKA.cjs} +3 -3
- package/dist/__chunks/{4EVPNC6V.js → BUVOUV7Z.js} +17 -15
- package/dist/__chunks/BUVOUV7Z.js.map +1 -0
- package/dist/__chunks/{F2ZYHRNY.js → CKRK4CN4.js} +2 -2
- package/dist/__chunks/{DWVTJZC6.js → CS32ABQA.js} +2 -2
- package/dist/__chunks/{ULC7XW64.cjs → D4FWWDPJ.cjs} +1 -1
- package/dist/__chunks/{ULC7XW64.cjs.map → D4FWWDPJ.cjs.map} +1 -1
- package/dist/__chunks/{OYIKKE7V.js → DAIZZROA.js} +2 -2
- package/dist/__chunks/{E27BHPP7.js → DDD7XI7R.js} +2 -2
- package/dist/__chunks/{E27BHPP7.js.map → DDD7XI7R.js.map} +1 -1
- package/dist/__chunks/{OLWRIS56.js → DWV2IH7T.js} +2 -2
- package/dist/__chunks/{OBQBJKAY.cjs → E3KSILLW.cjs} +3 -3
- package/dist/__chunks/{4SO4HHVL.js → ED4O4LSA.js} +7 -7
- package/dist/__chunks/{VWM2UOZ3.cjs → FHQ7KPFE.cjs} +3 -3
- package/dist/__chunks/{KR6JQ2DS.js → FM74LR6A.js} +2 -2
- package/dist/__chunks/{HO7QM7X2.js → IFOYULRK.js} +1 -1
- package/dist/__chunks/{HO7QM7X2.js.map → IFOYULRK.js.map} +1 -1
- package/dist/__chunks/{KZIOUAWM.js → J4VE4V7R.js} +3 -3
- package/dist/__chunks/{UXSGTOGU.cjs → JACR34JO.cjs} +3 -3
- package/dist/__chunks/{CWVVOO2G.cjs → JJN6542U.cjs} +8 -8
- package/dist/__chunks/{TWWEORFR.js → MZK5G2SD.js} +3 -3
- package/dist/__chunks/{TWWEORFR.js.map → MZK5G2SD.js.map} +1 -1
- package/dist/__chunks/{YMIQ7WYX.js → P5BVB22B.js} +2 -2
- package/dist/__chunks/{IHGDCH62.cjs → PBHDA7GV.cjs} +3 -3
- package/dist/__chunks/{66VTCVJA.cjs → PBOAPP74.cjs} +3 -3
- package/dist/__chunks/{ML36DCKL.cjs → Q65LBFK3.cjs} +3 -3
- package/dist/__chunks/{CCKTB7L5.cjs → Q7CC3YA4.cjs} +3 -3
- package/dist/__chunks/{CCKTB7L5.cjs.map → Q7CC3YA4.cjs.map} +1 -1
- package/dist/__chunks/{5NI7VPKS.cjs → R3XTMI64.cjs} +17 -15
- package/dist/__chunks/R3XTMI64.cjs.map +1 -0
- package/dist/__chunks/{DAK5IGJK.js → RJQ2LSPP.js} +3 -3
- package/dist/__chunks/RJQ2LSPP.js.map +1 -0
- package/dist/__chunks/{5NQO6SP3.cjs → RVU3UEZI.cjs} +4 -4
- package/dist/__chunks/RVU3UEZI.cjs.map +1 -0
- package/dist/__chunks/{TG2RCNZT.js → RX3JA6WI.js} +2 -2
- package/dist/__chunks/{OVHMMIVE.cjs → S7BCIAUQ.cjs} +3 -3
- package/dist/__chunks/{OQSEZXJ6.cjs → SAPSO6DD.cjs} +3 -3
- package/dist/__chunks/{E3A6VFMB.cjs → SJSSW5MP.cjs} +4 -4
- package/dist/__chunks/{S4JNYLMA.cjs → SW6S6ZCI.cjs} +4 -4
- package/dist/__chunks/{BDCZ5GX7.cjs → TA4EX7DL.cjs} +4 -2
- package/dist/__chunks/TA4EX7DL.cjs.map +1 -0
- package/dist/__chunks/{ZYPHFC2R.js → UNQGP24J.js} +2 -2
- package/dist/__chunks/{KY2TFXG3.js → W6JOWMNG.js} +2 -2
- package/dist/__chunks/{56LMASNQ.js → WCQCYWL5.js} +2 -2
- package/dist/__chunks/{GMIOWJBD.js → WGRDMB2P.js} +2 -2
- package/dist/__chunks/{5SG2TWV3.cjs → WNNJJJGM.cjs} +19 -19
- package/dist/__chunks/{5S7HZU4Z.js → XEHZJBLD.js} +2 -2
- package/dist/__chunks/{URBKDUMU.cjs → XSU6O5C3.cjs} +3 -3
- package/dist/__chunks/{JOTFTEBX.cjs → YNGB4N62.cjs} +3 -3
- package/dist/__chunks/{VU4LGL2W.js → YSI244J6.js} +4 -2
- package/dist/__chunks/YSI244J6.js.map +1 -0
- package/dist/__chunks/{AUO7CEJI.cjs → Z6EWS3QI.cjs} +6 -6
- package/dist/__chunks/Z6EWS3QI.cjs.map +1 -0
- package/dist/colors/textColors.cjs +2 -2
- package/dist/colors/textColors.d.ts +1 -1
- package/dist/colors/textColors.js +1 -1
- package/dist/index.cjs +25 -25
- package/dist/index.css +70 -52
- package/dist/index.css.map +1 -1
- package/dist/index.js +24 -24
- package/package.json +1 -1
- package/dist/__chunks/4EVPNC6V.js.map +0 -1
- package/dist/__chunks/5NI7VPKS.cjs.map +0 -1
- package/dist/__chunks/5NQO6SP3.cjs.map +0 -1
- package/dist/__chunks/AUO7CEJI.cjs.map +0 -1
- package/dist/__chunks/BDCZ5GX7.cjs.map +0 -1
- package/dist/__chunks/DAK5IGJK.js.map +0 -1
- package/dist/__chunks/VU4LGL2W.js.map +0 -1
- /package/dist/__chunks/{PBHAJ42K.js.map → 45DUMC5J.js.map} +0 -0
- /package/dist/__chunks/{4MHKTQMD.js.map → 4FGMH6ZT.js.map} +0 -0
- /package/dist/__chunks/{OMXDPTE4.cjs.map → 5I7B5SAF.cjs.map} +0 -0
- /package/dist/__chunks/{AHICHJTL.js.map → 6KET3XO2.js.map} +0 -0
- /package/dist/__chunks/{BFEZ3PUT.cjs.map → 7COSMEXW.cjs.map} +0 -0
- /package/dist/__chunks/{ZHU5A7BH.js.map → 7YH3K65I.js.map} +0 -0
- /package/dist/__chunks/{EHZAOGLQ.cjs.map → AAZIVDWS.cjs.map} +0 -0
- /package/dist/__chunks/{4AI6GQ5U.cjs.map → AI52ORKA.cjs.map} +0 -0
- /package/dist/__chunks/{F2ZYHRNY.js.map → CKRK4CN4.js.map} +0 -0
- /package/dist/__chunks/{DWVTJZC6.js.map → CS32ABQA.js.map} +0 -0
- /package/dist/__chunks/{OYIKKE7V.js.map → DAIZZROA.js.map} +0 -0
- /package/dist/__chunks/{OLWRIS56.js.map → DWV2IH7T.js.map} +0 -0
- /package/dist/__chunks/{OBQBJKAY.cjs.map → E3KSILLW.cjs.map} +0 -0
- /package/dist/__chunks/{4SO4HHVL.js.map → ED4O4LSA.js.map} +0 -0
- /package/dist/__chunks/{VWM2UOZ3.cjs.map → FHQ7KPFE.cjs.map} +0 -0
- /package/dist/__chunks/{KR6JQ2DS.js.map → FM74LR6A.js.map} +0 -0
- /package/dist/__chunks/{KZIOUAWM.js.map → J4VE4V7R.js.map} +0 -0
- /package/dist/__chunks/{UXSGTOGU.cjs.map → JACR34JO.cjs.map} +0 -0
- /package/dist/__chunks/{CWVVOO2G.cjs.map → JJN6542U.cjs.map} +0 -0
- /package/dist/__chunks/{YMIQ7WYX.js.map → P5BVB22B.js.map} +0 -0
- /package/dist/__chunks/{IHGDCH62.cjs.map → PBHDA7GV.cjs.map} +0 -0
- /package/dist/__chunks/{66VTCVJA.cjs.map → PBOAPP74.cjs.map} +0 -0
- /package/dist/__chunks/{ML36DCKL.cjs.map → Q65LBFK3.cjs.map} +0 -0
- /package/dist/__chunks/{TG2RCNZT.js.map → RX3JA6WI.js.map} +0 -0
- /package/dist/__chunks/{OVHMMIVE.cjs.map → S7BCIAUQ.cjs.map} +0 -0
- /package/dist/__chunks/{OQSEZXJ6.cjs.map → SAPSO6DD.cjs.map} +0 -0
- /package/dist/__chunks/{E3A6VFMB.cjs.map → SJSSW5MP.cjs.map} +0 -0
- /package/dist/__chunks/{S4JNYLMA.cjs.map → SW6S6ZCI.cjs.map} +0 -0
- /package/dist/__chunks/{ZYPHFC2R.js.map → UNQGP24J.js.map} +0 -0
- /package/dist/__chunks/{KY2TFXG3.js.map → W6JOWMNG.js.map} +0 -0
- /package/dist/__chunks/{56LMASNQ.js.map → WCQCYWL5.js.map} +0 -0
- /package/dist/__chunks/{GMIOWJBD.js.map → WGRDMB2P.js.map} +0 -0
- /package/dist/__chunks/{5SG2TWV3.cjs.map → WNNJJJGM.cjs.map} +0 -0
- /package/dist/__chunks/{5S7HZU4Z.js.map → XEHZJBLD.js.map} +0 -0
- /package/dist/__chunks/{URBKDUMU.cjs.map → XSU6O5C3.cjs.map} +0 -0
- /package/dist/__chunks/{JOTFTEBX.cjs.map → YNGB4N62.cjs.map} +0 -0
|
@@ -6,7 +6,7 @@ var _JVGX637Ecjs = require('./JVGX637E.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _D4FWWDPJcjs = require('./D4FWWDPJ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _XLUVINJWcjs = require('./XLUVINJW.cjs');
|
|
@@ -15,7 +15,7 @@ var _XLUVINJWcjs = require('./XLUVINJW.cjs');
|
|
|
15
15
|
var _QODNNCT2cjs = require('./QODNNCT2.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _RVU3UEZIcjs = require('./RVU3UEZI.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _K4AUV2VKcjs = require('./K4AUV2VK.cjs');
|
|
@@ -68,12 +68,12 @@ function SelectList({
|
|
|
68
68
|
};
|
|
69
69
|
const getArrowIconColor = () => {
|
|
70
70
|
if (errorText) {
|
|
71
|
-
return
|
|
71
|
+
return _D4FWWDPJcjs.ColorBaseDestructive700;
|
|
72
72
|
} else {
|
|
73
73
|
if (color === "clear") {
|
|
74
|
-
return
|
|
74
|
+
return _D4FWWDPJcjs.ColorCambioWhite100;
|
|
75
75
|
} else {
|
|
76
|
-
return
|
|
76
|
+
return _D4FWWDPJcjs.ColorBaseGray700;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -84,7 +84,7 @@ function SelectList({
|
|
|
84
84
|
[SelectList_module_default.opacityOverlay]: disabled
|
|
85
85
|
}),
|
|
86
86
|
children: [
|
|
87
|
-
label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: selectId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
87
|
+
label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: selectId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _RVU3UEZIcjs.Typography_default, { size: 100, color: textColor[color], children: label }) }) }),
|
|
88
88
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: SelectList_module_default.selectWrapper, children: [
|
|
89
89
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
90
90
|
"select",
|
|
@@ -132,7 +132,7 @@ function SelectList({
|
|
|
132
132
|
) })
|
|
133
133
|
] }),
|
|
134
134
|
(helperText || errorText) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
135
|
-
|
|
135
|
+
_RVU3UEZIcjs.Typography_default,
|
|
136
136
|
{
|
|
137
137
|
size: 100,
|
|
138
138
|
color: errorText ? "destructive-primary" : textColor[color],
|
|
@@ -148,4 +148,4 @@ SelectList.Option = _JVGX637Ecjs.SelectOption_default;
|
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
exports.SelectList = SelectList;
|
|
151
|
-
//# sourceMappingURL=
|
|
151
|
+
//# sourceMappingURL=JJN6542U.cjs.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./IB6JZQF3.js";
|
|
5
5
|
import {
|
|
6
6
|
Typography_default
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./RJQ2LSPP.js";
|
|
8
8
|
import {
|
|
9
9
|
useIsHydrated
|
|
10
10
|
} from "./JB65NEXK.js";
|
|
@@ -16,7 +16,7 @@ import { useId, forwardRef } from "react";
|
|
|
16
16
|
var TextArea_module_default = { "textarea": "_textarea_1sb0v_1", "resizenone": "_resizenone_1sb0v_6", "resizehorizontal": "_resizehorizontal_1sb0v_10", "resizevertical": "_resizevertical_1sb0v_14", "resizeboth": "_resizeboth_1sb0v_18" };
|
|
17
17
|
|
|
18
18
|
// css-module:../TextField/TextField.module.css#css-module
|
|
19
|
-
var TextField_module_default = { "textfield": "
|
|
19
|
+
var TextField_module_default = { "textfield": "_textfield_f2wi6_1", "transparent": "_transparent_f2wi6_13", "label": "_label_f2wi6_28", "md": "_md_f2wi6_32", "height": "_height_f2wi6_36", "inputError": "_inputError_f2wi6_40", "transparentInputError": "_transparentInputError_f2wi6_49", "transparenInputError": "_transparenInputError_f2wi6_54" };
|
|
20
20
|
|
|
21
21
|
// src/TextArea/TextArea.tsx
|
|
22
22
|
import classNames from "classnames";
|
|
@@ -95,4 +95,4 @@ var TextArea_default = TextArea;
|
|
|
95
95
|
export {
|
|
96
96
|
TextArea_default
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=
|
|
98
|
+
//# sourceMappingURL=MZK5G2SD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TextArea/TextArea.tsx","css-module:./TextArea.module.css#css-module","css-module:../TextField/TextField.module.css#css-module"],"sourcesContent":["import Box from \"../Box/Box\";\nimport Typography from \"../Typography/Typography\";\nimport React, { type ReactElement, useId, forwardRef } from \"react\";\nimport styles from \"./TextArea.module.css\";\nimport textFieldStyles from \"../TextField/TextField.module.css\";\nimport classNames from \"classnames\";\nimport useIsHydrated from \"../useIsHydrated\";\n\ntype TextAreaProps = {\n /**\n * A data-testid to make querying for the TextArea easier.\n */\n \"data-testid\"?: string;\n /**\n * If true, the TextArea will be disabled.\n */\n disabled?: boolean;\n /**\n * Text shown below TextArea if there is an input error.\n */\n errorText?: string;\n /**\n * Informative helper text shown below TextArea\n */\n helperText?: string;\n /**\n * TextField id, if not provided, a unique id will be generated\n */\n id?: string;\n /**\n * TextArea visible label\n */\n label: string;\n /**\n * Maximum number of characters allowed in the TextArea\n */\n maxLength?: number;\n /**\n * Callback fired when the value is changed.\n */\n onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n /**\n * Placeholder text to display when TextArea is empty\n */\n placeholder?: string;\n /**\n * Sets which part resizes when the user drags the resize handle.\n * * `none`: TextArea can not be resized\n * * `horizontal`: TextArea can only be resized horizontally\n * * `vertical`: TextArea can only be resized vertically\n * * `both`: TextArea can be resized horizontally and vertically\n *\n * @defaultvalue `none`\n */\n resize?: \"none\" | \"horizontal\" | \"vertical\" | \"both\";\n /**\n * Number of rows to display\n */\n rows?: number;\n /**\n * Value of the TextArea\n */\n value: string;\n};\n\n/**\n * [TextArea](https://cambly-syntax.vercel.app/?path=/docs/components-textarea--docs) allows users to enter multiple lines of text.\n */\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n {\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText = \"\",\n helperText = \"\",\n id,\n label,\n maxLength = 1024,\n placeholder = \"\",\n rows = 3,\n value = \"\",\n onChange,\n resize = \"none\",\n }: TextAreaProps,\n forwardedRef,\n ): ReactElement {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const reactId = useId();\n const inputId = id ?? reactId;\n\n return (\n <Box\n display=\"flex\"\n direction=\"column\"\n gap={2}\n width=\"100%\"\n dangerouslySetInlineStyle={{\n __style: {\n opacity: disabled ? 0.5 : 1,\n },\n }}\n position=\"relative\"\n >\n {label && (\n <label className={textFieldStyles.label} htmlFor={inputId}>\n <Box paddingX={1}>\n <Typography size={100} color=\"gray700\">\n {label}\n </Typography>\n </Box>\n </label>\n )}\n <Typography size={100}>\n <textarea\n data-testid={dataTestId}\n ref={forwardedRef}\n className={classNames(\n textFieldStyles.textfield,\n styles.textarea,\n styles[`resize${resize}`],\n {\n [textFieldStyles.inputError]: errorText,\n },\n )}\n id={inputId}\n placeholder={placeholder}\n maxLength={maxLength}\n onChange={onChange}\n rows={rows}\n value={value}\n disabled={disabled}\n />\n </Typography>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-darkBackground\" : \"gray700\"}\n >\n {errorText || helperText}\n </Typography>\n </Box>\n )}\n </Box>\n );\n },\n);\n\nexport default TextArea;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TextArea/TextArea.module.css\"; export default {\"textarea\":\"_textarea_1sb0v_1\",\"resizenone\":\"_resizenone_1sb0v_6\",\"resizehorizontal\":\"_resizehorizontal_1sb0v_10\",\"resizevertical\":\"_resizevertical_1sb0v_14\",\"resizeboth\":\"_resizeboth_1sb0v_18\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TextField/TextField.module.css\"; export default {\"textfield\":\"
|
|
1
|
+
{"version":3,"sources":["../../src/TextArea/TextArea.tsx","css-module:./TextArea.module.css#css-module","css-module:../TextField/TextField.module.css#css-module"],"sourcesContent":["import Box from \"../Box/Box\";\nimport Typography from \"../Typography/Typography\";\nimport React, { type ReactElement, useId, forwardRef } from \"react\";\nimport styles from \"./TextArea.module.css\";\nimport textFieldStyles from \"../TextField/TextField.module.css\";\nimport classNames from \"classnames\";\nimport useIsHydrated from \"../useIsHydrated\";\n\ntype TextAreaProps = {\n /**\n * A data-testid to make querying for the TextArea easier.\n */\n \"data-testid\"?: string;\n /**\n * If true, the TextArea will be disabled.\n */\n disabled?: boolean;\n /**\n * Text shown below TextArea if there is an input error.\n */\n errorText?: string;\n /**\n * Informative helper text shown below TextArea\n */\n helperText?: string;\n /**\n * TextField id, if not provided, a unique id will be generated\n */\n id?: string;\n /**\n * TextArea visible label\n */\n label: string;\n /**\n * Maximum number of characters allowed in the TextArea\n */\n maxLength?: number;\n /**\n * Callback fired when the value is changed.\n */\n onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n /**\n * Placeholder text to display when TextArea is empty\n */\n placeholder?: string;\n /**\n * Sets which part resizes when the user drags the resize handle.\n * * `none`: TextArea can not be resized\n * * `horizontal`: TextArea can only be resized horizontally\n * * `vertical`: TextArea can only be resized vertically\n * * `both`: TextArea can be resized horizontally and vertically\n *\n * @defaultvalue `none`\n */\n resize?: \"none\" | \"horizontal\" | \"vertical\" | \"both\";\n /**\n * Number of rows to display\n */\n rows?: number;\n /**\n * Value of the TextArea\n */\n value: string;\n};\n\n/**\n * [TextArea](https://cambly-syntax.vercel.app/?path=/docs/components-textarea--docs) allows users to enter multiple lines of text.\n */\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n {\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText = \"\",\n helperText = \"\",\n id,\n label,\n maxLength = 1024,\n placeholder = \"\",\n rows = 3,\n value = \"\",\n onChange,\n resize = \"none\",\n }: TextAreaProps,\n forwardedRef,\n ): ReactElement {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const reactId = useId();\n const inputId = id ?? reactId;\n\n return (\n <Box\n display=\"flex\"\n direction=\"column\"\n gap={2}\n width=\"100%\"\n dangerouslySetInlineStyle={{\n __style: {\n opacity: disabled ? 0.5 : 1,\n },\n }}\n position=\"relative\"\n >\n {label && (\n <label className={textFieldStyles.label} htmlFor={inputId}>\n <Box paddingX={1}>\n <Typography size={100} color=\"gray700\">\n {label}\n </Typography>\n </Box>\n </label>\n )}\n <Typography size={100}>\n <textarea\n data-testid={dataTestId}\n ref={forwardedRef}\n className={classNames(\n textFieldStyles.textfield,\n styles.textarea,\n styles[`resize${resize}`],\n {\n [textFieldStyles.inputError]: errorText,\n },\n )}\n id={inputId}\n placeholder={placeholder}\n maxLength={maxLength}\n onChange={onChange}\n rows={rows}\n value={value}\n disabled={disabled}\n />\n </Typography>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-darkBackground\" : \"gray700\"}\n >\n {errorText || helperText}\n </Typography>\n </Box>\n )}\n </Box>\n );\n },\n);\n\nexport default TextArea;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TextArea/TextArea.module.css\"; export default {\"textarea\":\"_textarea_1sb0v_1\",\"resizenone\":\"_resizenone_1sb0v_6\",\"resizehorizontal\":\"_resizehorizontal_1sb0v_10\",\"resizevertical\":\"_resizevertical_1sb0v_14\",\"resizeboth\":\"_resizeboth_1sb0v_18\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TextField/TextField.module.css\"; export default {\"textfield\":\"_textfield_f2wi6_1\",\"transparent\":\"_transparent_f2wi6_13\",\"label\":\"_label_f2wi6_28\",\"md\":\"_md_f2wi6_32\",\"height\":\"_height_f2wi6_36\",\"inputError\":\"_inputError_f2wi6_40\",\"transparentInputError\":\"_transparentInputError_f2wi6_49\",\"transparenInputError\":\"_transparenInputError_f2wi6_54\"}"],"mappings":";;;;;;;;;;;;AAEA,SAAmC,OAAO,kBAAkB;;;ACFoC,IAAO,0BAAQ,EAAC,YAAW,qBAAoB,cAAa,uBAAsB,oBAAmB,8BAA6B,kBAAiB,4BAA2B,cAAa,uBAAsB;;;ACA/M,IAAO,2BAAQ,EAAC,aAAY,sBAAqB,eAAc,yBAAwB,SAAQ,mBAAkB,MAAK,gBAAe,UAAS,oBAAmB,cAAa,wBAAuB,yBAAwB,mCAAkC,wBAAuB,iCAAgC;;;AFKxZ,OAAO,gBAAgB;AAuFjB,SAeQ,KAfR;AAxBN,IAAM,WAAW;AAAA,EACf,SAASA,UACP;AAAA,IACE,eAAe;AAAA,IACf,UAAU,eAAe;AAAA,IACzB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA,SAAS;AAAA,EACX,GACA,cACc;AACd,UAAM,aAAa,cAAc;AACjC,UAAM,WAAW,CAAC,cAAc;AAChC,UAAM,UAAU,MAAM;AACtB,UAAM,UAAU,kBAAM;AAEtB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAU;AAAA,QACV,KAAK;AAAA,QACL,OAAM;AAAA,QACN,2BAA2B;AAAA,UACzB,SAAS;AAAA,YACP,SAAS,WAAW,MAAM;AAAA,UAC5B;AAAA,QACF;AAAA,QACA,UAAS;AAAA,QAER;AAAA,mBACC,oBAAC,WAAM,WAAW,yBAAgB,OAAO,SAAS,SAChD,8BAAC,eAAI,UAAU,GACb,8BAAC,sBAAW,MAAM,KAAK,OAAM,WAC1B,iBACH,GACF,GACF;AAAA,UAEF,oBAAC,sBAAW,MAAM,KAChB;AAAA,YAAC;AAAA;AAAA,cACC,eAAa;AAAA,cACb,KAAK;AAAA,cACL,WAAW;AAAA,gBACT,yBAAgB;AAAA,gBAChB,wBAAO;AAAA,gBACP,wBAAO,SAAS,QAAQ;AAAA,gBACxB;AAAA,kBACE,CAAC,yBAAgB,UAAU,GAAG;AAAA,gBAChC;AAAA,cACF;AAAA,cACA,IAAI;AAAA,cACJ;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACF,GACF;AAAA,WACE,cAAc,cACd,oBAAC,eAAI,UAAU,GACb;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,OAAO,YAAY,+BAA+B;AAAA,cAEjD,uBAAa;AAAA;AAAA,UAChB,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,IAAO,mBAAQ;","names":["TextArea"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./KKADUD65.js";
|
|
5
5
|
import {
|
|
6
6
|
Typography_default
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./RJQ2LSPP.js";
|
|
8
8
|
import {
|
|
9
9
|
useIsHydrated
|
|
10
10
|
} from "./JB65NEXK.js";
|
|
@@ -114,4 +114,4 @@ var Checkbox_default = Checkbox;
|
|
|
114
114
|
export {
|
|
115
115
|
Checkbox_default
|
|
116
116
|
};
|
|
117
|
-
//# sourceMappingURL=
|
|
117
|
+
//# sourceMappingURL=P5BVB22B.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _QODNNCT2cjs = require('./QODNNCT2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _RVU3UEZIcjs = require('./RVU3UEZI.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _K4AUV2VKcjs = require('./K4AUV2VK.cjs');
|
|
@@ -76,7 +76,7 @@ var Chip = _react.forwardRef.call(void 0,
|
|
|
76
76
|
onClick: onChange,
|
|
77
77
|
children: [
|
|
78
78
|
Icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { className: iconStyles, size: 100 }),
|
|
79
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: Icon ? 1 : 0, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
79
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: Icon ? 1 : 0, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _RVU3UEZIcjs.Typography_default, { size: 100, color, weight: "medium", children: text }) })
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
82
|
);
|
|
@@ -88,4 +88,4 @@ var Chip_default = Chip;
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
exports.Chip_default = Chip_default;
|
|
91
|
-
//# sourceMappingURL=
|
|
91
|
+
//# sourceMappingURL=PBHDA7GV.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _AI52ORKAcjs = require('./AI52ORKA.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _RYUXG4AScjs = require('./RYUXG4AS.cjs');
|
|
@@ -19,7 +19,7 @@ var RichSelectRadioButton_default = _react.forwardRef.call(void 0,
|
|
|
19
19
|
function RichSelectRadioButton(props, ref) {
|
|
20
20
|
const _a = props, { size, name } = _a, otherProps = _X2SDR4SDcjs.__objRest.call(void 0, _a, ["size", "name"]);
|
|
21
21
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _RYUXG4AScjs.RichSelectItem_default, _X2SDR4SDcjs.__spreadProps.call(void 0, _X2SDR4SDcjs.__spreadValues.call(void 0, {}, otherProps), { ref, children: ({ isSelected, isFocusVisible, isDisabled }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
22
|
-
|
|
22
|
+
_AI52ORKAcjs.RadioButton_default,
|
|
23
23
|
{
|
|
24
24
|
checked: isSelected,
|
|
25
25
|
disabled: isDisabled,
|
|
@@ -37,4 +37,4 @@ var RichSelectRadioButton_default = _react.forwardRef.call(void 0,
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
exports.RichSelectRadioButton_default = RichSelectRadioButton_default;
|
|
40
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=PBOAPP74.cjs.map
|
|
@@ -7,7 +7,7 @@ var _3UEOKPM2cjs = require('./3UEOKPM2.cjs');
|
|
|
7
7
|
var _7DGFMDT7cjs = require('./7DGFMDT7.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _SW6S6ZCIcjs = require('./SW6S6ZCI.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _QODNNCT2cjs = require('./QODNNCT2.cjs');
|
|
@@ -46,7 +46,7 @@ function TabButton({
|
|
|
46
46
|
"data-testid": dataTestId,
|
|
47
47
|
accessibilityLabel,
|
|
48
48
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
49
|
-
|
|
49
|
+
_SW6S6ZCIcjs.TabInternal,
|
|
50
50
|
{
|
|
51
51
|
text,
|
|
52
52
|
selected,
|
|
@@ -64,4 +64,4 @@ function TabButton({
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
exports.TabButton = TabButton;
|
|
67
|
-
//# sourceMappingURL=
|
|
67
|
+
//# sourceMappingURL=Q65LBFK3.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _RVU3UEZIcjs = require('./RVU3UEZI.cjs');
|
|
5
5
|
|
|
6
6
|
// src/Heading/Heading.tsx
|
|
7
7
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -28,7 +28,7 @@ var Heading = ({
|
|
|
28
28
|
size = 400
|
|
29
29
|
}) => {
|
|
30
30
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
31
|
-
|
|
31
|
+
_RVU3UEZIcjs.Typography_default,
|
|
32
32
|
{
|
|
33
33
|
align,
|
|
34
34
|
as,
|
|
@@ -47,4 +47,4 @@ var Heading_default = Heading;
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
exports.Heading_default = Heading_default;
|
|
50
|
-
//# sourceMappingURL=
|
|
50
|
+
//# sourceMappingURL=Q7CC3YA4.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Heading/Heading.tsx"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/Heading/Heading.tsx"],"names":[],"mappings":";;;;;;AAuGI;AApGJ,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AACF,GAGkC;AAChC,MAAI,cAAc,WAAW,SAAS,KAAK;AACzC,WAAO;AAAA,EACT,WAAW,cAAc,SAAS;AAChC,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAKA,IAAM,UAAU,CAAC;AAAA,EACf,QAAQ;AAAA,EACR,KAAK;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AACT,MAsEoB;AAClB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,QAAQ,OAAO,EAAE,WAAW,KAAK,CAAC;AAAA,MAEjC;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,kBAAQ","sourcesContent":["import { type ComponentProps, type ReactElement, type ReactNode } from \"react\";\nimport Typography from \"../Typography/Typography\";\n\nfunction weight({\n fontStyle,\n size,\n}: {\n fontStyle: ComponentProps<typeof Heading>[\"fontStyle\"];\n size: ComponentProps<typeof Heading>[\"size\"];\n}): \"bold\" | \"medium\" | \"regular\" {\n if (fontStyle === \"serif\" && size === 400) {\n return \"bold\";\n } else if (fontStyle === \"serif\") {\n return \"medium\";\n } else {\n return \"regular\";\n }\n}\n\n/**\n * [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.\n */\nconst Heading = ({\n align = \"start\",\n as = \"h1\",\n children,\n color = \"gray900\",\n \"data-testid\": dataTestId,\n fontStyle = \"sans-serif\",\n lineClamp,\n size = 400,\n}: {\n /**\n * Aligns the text to the left, right, or center of the container.\n * * `start` and `end` will align the text to the left or right of the container depending on the locale.\n * * `forceLeft` and `forceRight` will align the text to the left or right of the container regardless of the locale (should be used sparingly).\n *\n * @defaultValue \"start\"\n */\n align?: \"start\" | \"end\" | \"forceLeft\" | \"center\" | \"forceRight\";\n /**\n * DOM element to render as.\n *\n * @defaultValue \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n /**\n * The text to be rendered\n */\n children?: ReactNode;\n /**\n * The color of the text.\n *\n * @defaultValue \"gray900\"\n */\n color?:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"success\"\n | \"white\"\n | \"inherit\";\n /**\n * Test id for the text.\n */\n \"data-testid\"?: string;\n /**\n * Style of the font\n *\n * Classic only supports `sans-serif`\n *\n * @defaultValue \"sans-serif\"\n */\n fontStyle?: \"serif\" | \"sans-serif\";\n /**\n * The number of lines we should truncate the text at\n */\n lineClamp?: number | undefined;\n /**\n * Size of the text\n *\n * Mobile: (viewport width < 480px):\n * * `400`: 25px\n * * `500`: 32px\n * * `700`: 38px\n * * `800`: 46px\n * * `900`: 55px\n * * `1100`: 83px\n *\n * Desktop (viewport width >= 480px):\n * * `400`: 25px\n * * `500`: 32px\n * * `700`: 49px\n * * `800`: 63px\n * * `900`: 76px\n * * `1100`: 119px\n *\n * @defaultValue 400\n */\n size?: 400 | 500 | 700 | 800 | 900 | 1100;\n}): ReactElement => {\n return (\n <Typography\n align={align}\n as={as}\n color={color}\n fontStyle={fontStyle}\n data-testid={dataTestId}\n lineClamp={lineClamp}\n size={size}\n weight={weight({ fontStyle, size })}\n >\n {children}\n </Typography>\n );\n};\n\nexport default Heading;\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _QODNNCT2cjs = require('./QODNNCT2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _RVU3UEZIcjs = require('./RVU3UEZI.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _K4AUV2VKcjs = require('./K4AUV2VK.cjs');
|
|
@@ -16,7 +16,7 @@ var _react = require('react');
|
|
|
16
16
|
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
17
17
|
|
|
18
18
|
// css-module:./TextField.module.css#css-module
|
|
19
|
-
var TextField_module_default = { "textfield": "
|
|
19
|
+
var TextField_module_default = { "textfield": "_textfield_f2wi6_1", "transparent": "_transparent_f2wi6_13", "label": "_label_f2wi6_28", "md": "_md_f2wi6_32", "height": "_height_f2wi6_36", "inputError": "_inputError_f2wi6_40", "transparentInputError": "_transparentInputError_f2wi6_49", "transparenInputError": "_transparenInputError_f2wi6_54" };
|
|
20
20
|
|
|
21
21
|
// src/TextField/TextField.tsx
|
|
22
22
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -24,6 +24,7 @@ function TextField({
|
|
|
24
24
|
autoComplete,
|
|
25
25
|
"data-testid": dataTestId,
|
|
26
26
|
disabled: disabledProp = false,
|
|
27
|
+
on = "lightBackground",
|
|
27
28
|
errorText = "",
|
|
28
29
|
helperText = "",
|
|
29
30
|
id,
|
|
@@ -39,6 +40,8 @@ function TextField({
|
|
|
39
40
|
const disabled = !isHydrated || disabledProp;
|
|
40
41
|
const reactId = _react.useId.call(void 0, );
|
|
41
42
|
const inputId = id != null ? id : reactId;
|
|
43
|
+
const textColor = on === "darkBackground" ? "white" : "gray900";
|
|
44
|
+
const errorTextColor = on !== "darkBackground" ? "destructive-lightBackground" : "destructive-darkBackground";
|
|
42
45
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
43
46
|
_QODNNCT2cjs.Box_default,
|
|
44
47
|
{
|
|
@@ -52,14 +55,20 @@ function TextField({
|
|
|
52
55
|
}
|
|
53
56
|
},
|
|
54
57
|
children: [
|
|
55
|
-
label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: TextField_module_default.label, htmlFor: inputId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
58
|
+
label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: TextField_module_default.label, htmlFor: inputId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _RVU3UEZIcjs.Typography_default, { size: 100, color: textColor, children: label }) }) }),
|
|
56
59
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
57
60
|
"input",
|
|
58
61
|
{
|
|
59
62
|
autoComplete,
|
|
60
|
-
className: _classnames2.default.call(void 0,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
className: _classnames2.default.call(void 0,
|
|
64
|
+
TextField_module_default.textfield,
|
|
65
|
+
TextField_module_default.md,
|
|
66
|
+
TextField_module_default.height,
|
|
67
|
+
errorText && (on === "darkBackground" ? TextField_module_default.transparentInputError : TextField_module_default.inputError),
|
|
68
|
+
{
|
|
69
|
+
[TextField_module_default.transparent]: on === "darkBackground"
|
|
70
|
+
}
|
|
71
|
+
),
|
|
63
72
|
"data-testid": dataTestId,
|
|
64
73
|
disabled,
|
|
65
74
|
id: inputId,
|
|
@@ -71,14 +80,7 @@ function TextField({
|
|
|
71
80
|
step
|
|
72
81
|
}
|
|
73
82
|
),
|
|
74
|
-
(helperText || errorText) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
75
|
-
_5NQO6SP3cjs.Typography_default,
|
|
76
|
-
{
|
|
77
|
-
size: 100,
|
|
78
|
-
color: errorText ? "destructive-darkBackground" : "gray700",
|
|
79
|
-
children: errorText || helperText
|
|
80
|
-
}
|
|
81
|
-
) })
|
|
83
|
+
(helperText || errorText) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _RVU3UEZIcjs.Typography_default, { size: 100, color: errorText ? errorTextColor : textColor, children: errorText || helperText }) })
|
|
82
84
|
]
|
|
83
85
|
}
|
|
84
86
|
);
|
|
@@ -87,4 +89,4 @@ function TextField({
|
|
|
87
89
|
|
|
88
90
|
|
|
89
91
|
exports.TextField = TextField;
|
|
90
|
-
//# sourceMappingURL=
|
|
92
|
+
//# sourceMappingURL=R3XTMI64.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/TextField/TextField.tsx","css-module:./TextField.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAAA,EAGE;AAAA,OACK;AACP,OAAO,gBAAgB;;;ACL2E,IAAO,2BAAQ,EAAC,aAAY,sBAAqB,eAAc,yBAAwB,SAAQ,mBAAkB,MAAK,gBAAe,UAAS,oBAAmB,cAAa,wBAAuB,yBAAwB,mCAAkC,wBAAuB,iCAAgC;;;ADyGpZ,SAcQ,KAdR;AA3FW,SAAR,UAA2B;AAAA,EAChC;AAAA,EACA,eAAe;AAAA,EACf,UAAU,eAAe;AAAA,EACzB,KAAK;AAAA,EACL,YAAY;AAAA,EACZ,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AACF,GAiEiB;AACf,QAAM,aAAa,cAAc;AACjC,QAAM,WAAW,CAAC,cAAc;AAChC,QAAM,UAAU,MAAM;AACtB,QAAM,UAAU,kBAAM;AACtB,QAAM,YAAY,OAAO,mBAAmB,UAAU;AACtD,QAAM,iBACJ,OAAO,mBACH,gCACA;AACN,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAU;AAAA,MACV,KAAK;AAAA,MACL,OAAM;AAAA,MACN,2BAA2B;AAAA,QACzB,SAAS;AAAA,UACP,SAAS,WAAW,MAAM;AAAA,QAC5B;AAAA,MACF;AAAA,MAEC;AAAA,iBACC,oBAAC,WAAM,WAAW,yBAAO,OAAO,SAAS,SACvC,8BAAC,eAAI,UAAU,GACb,8BAAC,sBAAW,MAAM,KAAK,OAAO,WAC3B,iBACH,GACF,GACF;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAW;AAAA,cACT,yBAAO;AAAA,cACP,yBAAO;AAAA,cACP,yBAAO;AAAA,cACP,cACG,OAAO,mBACJ,yBAAO,wBACP,yBAAO;AAAA,cACb;AAAA,gBACE,CAAC,yBAAO,WAAW,GAAG,OAAO;AAAA,cAC/B;AAAA,YACF;AAAA,YACA,eAAa;AAAA,YACb;AAAA,YACA,IAAI;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,SACE,cAAc,cACd,oBAAC,eAAI,UAAU,GACb,8BAAC,sBAAW,MAAM,KAAK,OAAO,YAAY,iBAAiB,WACxD,uBAAa,YAChB,GACF;AAAA;AAAA;AAAA,EAEJ;AAEJ","sourcesContent":["import React, {\n type ReactElement,\n type HTMLInputTypeAttribute,\n useId,\n} from \"react\";\nimport classNames from \"classnames\";\nimport styles from \"./TextField.module.css\";\nimport Box from \"../Box/Box\";\nimport Typography from \"../Typography/Typography\";\nimport useIsHydrated from \"../useIsHydrated\";\n\n/**\n * [TextField](https://cambly-syntax.vercel.app/?path=/docs/components-textfield--docs) is a component that allows users to enter text.\n */\nexport default function TextField({\n autoComplete,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n on = \"lightBackground\",\n errorText = \"\",\n helperText = \"\",\n id,\n label,\n maxLength,\n onChange,\n placeholder = \"\",\n type = \"text\",\n value = \"\",\n step,\n}: {\n /**\n * The autocomplete attribute specifies whether or not an input field should have autocomplete enabled.\n *\n * Feel free to add new values from the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) as needed\n */\n autoComplete?: \"current-password\" | \"new-password\" | \"off\" | \"on\" | \"email\";\n /**\n * A data-testid to make querying for the TextField easier.\n */\n \"data-testid\"?: string;\n /**\n * If true, the TextField will be disabled.\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * Text shown below TextField if there is an input error.\n */\n errorText?: string;\n /**\n * Informative helper text shown below TextField\n */\n helperText?: string;\n /**\n * TextField id, if not provided, a unique id will be generated\n */\n id?: string;\n /**\n * TextField visible label\n */\n label: string;\n /**\n * Maximum length of the TextField\n */\n maxLength?: number;\n /**\n * The callback to be called the input changes\n */\n onChange: React.ChangeEventHandler<HTMLInputElement>;\n /**\n * Optional TextField placeholder text\n */\n placeholder?: string;\n /**\n * Input type of the TextField\n *\n * See [full list of input types](https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types)\n */\n type?: HTMLInputTypeAttribute;\n /**\n * Value of the TextField\n */\n value: string;\n /**\n * Specified legal number intervals for an input field. Specifically for time or number. If for time, specify in milliseconds. Must be a positive value.\n */\n step?: number;\n}): ReactElement {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const reactId = useId();\n const inputId = id ?? reactId;\n const textColor = on === \"darkBackground\" ? \"white\" : \"gray900\";\n const errorTextColor =\n on !== \"darkBackground\"\n ? \"destructive-lightBackground\"\n : \"destructive-darkBackground\";\n return (\n <Box\n display=\"flex\"\n direction=\"column\"\n gap={2}\n width=\"100%\"\n dangerouslySetInlineStyle={{\n __style: {\n opacity: disabled ? 0.5 : 1,\n },\n }}\n >\n {label && (\n <label className={styles.label} htmlFor={inputId}>\n <Box paddingX={1}>\n <Typography size={100} color={textColor}>\n {label}\n </Typography>\n </Box>\n </label>\n )}\n <input\n autoComplete={autoComplete}\n className={classNames(\n styles.textfield,\n styles.md,\n styles.height,\n errorText &&\n (on === \"darkBackground\"\n ? styles.transparentInputError\n : styles.inputError),\n {\n [styles.transparent]: on === \"darkBackground\",\n },\n )}\n data-testid={dataTestId}\n disabled={disabled}\n id={inputId}\n maxLength={maxLength}\n type={type}\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n step={step}\n />\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography size={100} color={errorText ? errorTextColor : textColor}>\n {errorText || helperText}\n </Typography>\n </Box>\n )}\n </Box>\n );\n}\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TextField/TextField.module.css\"; export default {\"textfield\":\"_textfield_f2wi6_1\",\"transparent\":\"_transparent_f2wi6_13\",\"label\":\"_label_f2wi6_28\",\"md\":\"_md_f2wi6_32\",\"height\":\"_height_f2wi6_36\",\"inputError\":\"_inputError_f2wi6_40\",\"transparentInputError\":\"_transparentInputError_f2wi6_49\",\"transparenInputError\":\"_transparenInputError_f2wi6_54\"}"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
textColor
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./YSI244J6.js";
|
|
5
5
|
|
|
6
6
|
// src/Typography/Typography.tsx
|
|
7
7
|
import classNames from "classnames";
|
|
8
8
|
import { forwardRef } from "react";
|
|
9
9
|
|
|
10
10
|
// css-module:./Typography.module.css#css-module
|
|
11
|
-
var Typography_module_default = { "typography": "
|
|
11
|
+
var Typography_module_default = { "typography": "_typography_15w34_1", "sansSerif": "_sansSerif_15w34_22", "serif": "_serif_15w34_27", "size0": "_size0_15w34_73", "size100": "_size100_15w34_77", "size200": "_size200_15w34_81", "size300": "_size300_15w34_85", "size400": "_size400_15w34_89", "size500": "_size500_15w34_93", "size700": "_size700_15w34_97", "size800": "_size800_15w34_101", "size900": "_size900_15w34_105", "size1100": "_size1100_15w34_109", "center": "_center_15w34_137", "forceLeft": "_forceLeft_15w34_141", "forceRight": "_forceRight_15w34_145", "start": "_start_15w34_149", "end": "_end_15w34_153", "regular": "_regular_15w34_159", "medium": "_medium_15w34_163", "semiBold": "_semiBold_15w34_167", "bold": "_bold_15w34_171", "underline": "_underline_15w34_175", "inline": "_inline_15w34_179", "uppercase": "_uppercase_15w34_183", "lineClamp": "_lineClamp_15w34_187", "p100": "_p100_15w34_196", "p200": "_p200_15w34_200", "p300": "_p300_15w34_204", "p400": "_p400_15w34_208", "p500": "_p500_15w34_212" };
|
|
12
12
|
|
|
13
13
|
// src/Typography/Typography.tsx
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -61,4 +61,4 @@ var Typography_default = Typography;
|
|
|
61
61
|
export {
|
|
62
62
|
Typography_default
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=
|
|
64
|
+
//# sourceMappingURL=RJQ2LSPP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Typography/Typography.tsx","css-module:./Typography.module.css#css-module"],"sourcesContent":["import classNames from \"classnames\";\nimport { forwardRef, type ReactElement, type ReactNode } from \"react\";\nimport styles from \"./Typography.module.css\";\nimport textColor from \"../colors/textColors\";\n\n/**\n * [Typography](https://cambly-syntax.vercel.app/?path=/docs/components-typography--docs) is a component that renders text.\n */\nconst Typography = forwardRef<\n HTMLDivElement,\n {\n /**\n * Aligns the text to the left, right, or center of the container.\n * * `start` and `end` will align the text to the left or right of the container depending on the locale.\n * * `forceLeft` and `forceRight` will align the text to the left or right of the container regardless of the locale (should be used sparingly).\n *\n * @defaultValue \"start\"\n */\n align?: \"start\" | \"end\" | \"forceLeft\" | \"center\" | \"forceRight\";\n /**\n * DOM element to render as.\n *\n * @defaultValue \"div\"\n */\n as?: \"div\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\";\n /**\n * The text to be rendered\n */\n children?: ReactNode;\n /**\n * The color of the text.\n *\n * @defaultValue \"gray900\"\n */\n color?:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"destructive-darkBackground\"\n | \"destructive-lightBackground\"\n | \"success\"\n | \"success-darkBackground\"\n | \"white\"\n | \"white-secondary\"\n | \"inherit\";\n /**\n * Test id for the text\n */\n \"data-testid\"?: string;\n /**\n * Style of the font\n *\n * Classic only supports `sans-serif`\n *\n * @defaultValue \"sans-serif\"\n */\n fontStyle?: \"serif\" | \"sans-serif\";\n /**\n * The id for the element\n */\n id?: string;\n /**\n * Whether the text should flow inline with other elements.\n *\n * @defaultValue false\n */\n inline?: boolean;\n /**\n * The number of lines we should truncate the text at\n */\n lineClamp?: number | undefined;\n /**\n * Size of the text.\n *\n * Mobile (viewport width <= 480px)::\n * * `0`: 12px\n * * `100`: 13px\n * * `200`: 16px\n * * `300`: 19px\n * * `400`: 25px\n * * `500`: 32px\n * * `700`: 38px\n * * `800`: 46px\n * * `900`: 55px\n * * `1100`: 83px\n *\n * Desktop (viewport width > 480px):\n * * `0`: 12px\n * * `100`: 13px\n * * `200`: 16px\n * * `300`: 20px\n * * `400`: 25px\n * * `500`: 32px\n * * `700`: 49px\n * * `800`: 63px\n * * `900`: 76px\n * * `1100`: 119px\n *\n * @defaultValue 200\n */\n size?: 0 | 100 | 200 | 300 | 400 | 500 | 700 | 800 | 900 | 1100;\n /**\n * The tooltip to be displayed when the user hovers the text\n */\n tooltip?: string;\n /**\n * Whether the text should be transformed to uppercase.\n *\n * @defaultValue \"none\"\n */\n transform?: \"none\" | \"uppercase\";\n /**\n * Whether the text has an underline.\n *\n * @defaultValue false\n */\n underline?: boolean;\n /**\n * Indicates the boldness of the text.\n *\n * * `regular`: 400\n * * `medium`: 510\n * * `semiBold`: 590\n * * `bold`: 710\n *\n * @defaultValue \"regular\"\n */\n weight?: \"regular\" | \"medium\" | \"semiBold\" | \"bold\";\n }\n>(function Typography(\n {\n align = \"start\",\n as = \"div\",\n children,\n color = \"gray900\",\n \"data-testid\": dataTestId,\n fontStyle = \"sans-serif\",\n id,\n inline = false,\n lineClamp = undefined,\n size = 200,\n tooltip,\n transform = \"none\",\n underline = false,\n weight = \"regular\",\n },\n ref,\n): ReactElement {\n const Tag = as;\n\n return (\n <Tag\n id={id}\n className={classNames(\n styles.typography,\n styles[align],\n styles[weight],\n fontStyle === \"serif\" ? styles.serif : styles.sansSerif,\n textColor(color),\n inline && styles.inline,\n styles[`size${size}`],\n transform === \"uppercase\" && styles.uppercase,\n underline && styles.underline,\n lineClamp != null && styles.lineClamp,\n as === \"p\" && styles[`p${size}`],\n )}\n data-testid={dataTestId}\n style={{\n WebkitLineClamp: lineClamp,\n }}\n title={tooltip}\n ref={ref}\n >\n {children}\n </Tag>\n );\n});\n\nexport default Typography;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Typography/Typography.module.css\"; export default {\"typography\":\"_typography_15w34_1\",\"sansSerif\":\"_sansSerif_15w34_22\",\"serif\":\"_serif_15w34_27\",\"size0\":\"_size0_15w34_73\",\"size100\":\"_size100_15w34_77\",\"size200\":\"_size200_15w34_81\",\"size300\":\"_size300_15w34_85\",\"size400\":\"_size400_15w34_89\",\"size500\":\"_size500_15w34_93\",\"size700\":\"_size700_15w34_97\",\"size800\":\"_size800_15w34_101\",\"size900\":\"_size900_15w34_105\",\"size1100\":\"_size1100_15w34_109\",\"center\":\"_center_15w34_137\",\"forceLeft\":\"_forceLeft_15w34_141\",\"forceRight\":\"_forceRight_15w34_145\",\"start\":\"_start_15w34_149\",\"end\":\"_end_15w34_153\",\"regular\":\"_regular_15w34_159\",\"medium\":\"_medium_15w34_163\",\"semiBold\":\"_semiBold_15w34_167\",\"bold\":\"_bold_15w34_171\",\"underline\":\"_underline_15w34_175\",\"inline\":\"_inline_15w34_179\",\"uppercase\":\"_uppercase_15w34_183\",\"lineClamp\":\"_lineClamp_15w34_187\",\"p100\":\"_p100_15w34_196\",\"p200\":\"_p200_15w34_200\",\"p300\":\"_p300_15w34_204\",\"p400\":\"_p400_15w34_208\",\"p500\":\"_p500_15w34_212\"}"],"mappings":";;;;;;AAAA,OAAO,gBAAgB;AACvB,SAAS,kBAAqD;;;ACDsC,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,aAAY,uBAAsB,SAAQ,mBAAkB,SAAQ,mBAAkB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,sBAAqB,WAAU,sBAAqB,YAAW,uBAAsB,UAAS,qBAAoB,aAAY,wBAAuB,cAAa,yBAAwB,SAAQ,oBAAmB,OAAM,kBAAiB,WAAU,sBAAqB,UAAS,qBAAoB,YAAW,uBAAsB,QAAO,mBAAkB,aAAY,wBAAuB,UAAS,qBAAoB,aAAY,wBAAuB,aAAY,wBAAuB,QAAO,mBAAkB,QAAO,mBAAkB,QAAO,mBAAkB,QAAO,mBAAkB,QAAO,kBAAiB;;;ADwJ3gC;AAhJJ,IAAM,aAAa,WA0HjB,SAASA,YACT;AAAA,EACE,QAAQ;AAAA,EACR,KAAK;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,SAAS;AACX,GACA,KACc;AACd,QAAM,MAAM;AAEZ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,0BAAO;AAAA,QACP,0BAAO,KAAK;AAAA,QACZ,0BAAO,MAAM;AAAA,QACb,cAAc,UAAU,0BAAO,QAAQ,0BAAO;AAAA,QAC9C,UAAU,KAAK;AAAA,QACf,UAAU,0BAAO;AAAA,QACjB,0BAAO,OAAO,MAAM;AAAA,QACpB,cAAc,eAAe,0BAAO;AAAA,QACpC,aAAa,0BAAO;AAAA,QACpB,aAAa,QAAQ,0BAAO;AAAA,QAC5B,OAAO,OAAO,0BAAO,IAAI,MAAM;AAAA,MACjC;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,iBAAiB;AAAA,MACnB;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,qBAAQ;","names":["Typography"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _TA4EX7DLcjs = require('./TA4EX7DL.cjs');
|
|
5
5
|
|
|
6
6
|
// src/Typography/Typography.tsx
|
|
7
7
|
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
8
8
|
var _react = require('react');
|
|
9
9
|
|
|
10
10
|
// css-module:./Typography.module.css#css-module
|
|
11
|
-
var Typography_module_default = { "typography": "
|
|
11
|
+
var Typography_module_default = { "typography": "_typography_15w34_1", "sansSerif": "_sansSerif_15w34_22", "serif": "_serif_15w34_27", "size0": "_size0_15w34_73", "size100": "_size100_15w34_77", "size200": "_size200_15w34_81", "size300": "_size300_15w34_85", "size400": "_size400_15w34_89", "size500": "_size500_15w34_93", "size700": "_size700_15w34_97", "size800": "_size800_15w34_101", "size900": "_size900_15w34_105", "size1100": "_size1100_15w34_109", "center": "_center_15w34_137", "forceLeft": "_forceLeft_15w34_141", "forceRight": "_forceRight_15w34_145", "start": "_start_15w34_149", "end": "_end_15w34_153", "regular": "_regular_15w34_159", "medium": "_medium_15w34_163", "semiBold": "_semiBold_15w34_167", "bold": "_bold_15w34_171", "underline": "_underline_15w34_175", "inline": "_inline_15w34_179", "uppercase": "_uppercase_15w34_183", "lineClamp": "_lineClamp_15w34_187", "p100": "_p100_15w34_196", "p200": "_p200_15w34_200", "p300": "_p300_15w34_204", "p400": "_p400_15w34_208", "p500": "_p500_15w34_212" };
|
|
12
12
|
|
|
13
13
|
// src/Typography/Typography.tsx
|
|
14
14
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -38,7 +38,7 @@ var Typography = _react.forwardRef.call(void 0, function Typography2({
|
|
|
38
38
|
Typography_module_default[align],
|
|
39
39
|
Typography_module_default[weight],
|
|
40
40
|
fontStyle === "serif" ? Typography_module_default.serif : Typography_module_default.sansSerif,
|
|
41
|
-
|
|
41
|
+
_TA4EX7DLcjs.textColor.call(void 0, color),
|
|
42
42
|
inline && Typography_module_default.inline,
|
|
43
43
|
Typography_module_default[`size${size}`],
|
|
44
44
|
transform === "uppercase" && Typography_module_default.uppercase,
|
|
@@ -61,4 +61,4 @@ var Typography_default = Typography;
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
exports.Typography_default = Typography_default;
|
|
64
|
-
//# sourceMappingURL=
|
|
64
|
+
//# sourceMappingURL=RVU3UEZI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Typography/Typography.tsx","css-module:./Typography.module.css#css-module"],"names":["Typography"],"mappings":";;;;;;AAAA,OAAO,gBAAgB;AACvB,SAAS,kBAAqD;;;ACDsC,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,aAAY,uBAAsB,SAAQ,mBAAkB,SAAQ,mBAAkB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,sBAAqB,WAAU,sBAAqB,YAAW,uBAAsB,UAAS,qBAAoB,aAAY,wBAAuB,cAAa,yBAAwB,SAAQ,oBAAmB,OAAM,kBAAiB,WAAU,sBAAqB,UAAS,qBAAoB,YAAW,uBAAsB,QAAO,mBAAkB,aAAY,wBAAuB,UAAS,qBAAoB,aAAY,wBAAuB,aAAY,wBAAuB,QAAO,mBAAkB,QAAO,mBAAkB,QAAO,mBAAkB,QAAO,mBAAkB,QAAO,kBAAiB;;;ADwJ3gC;AAhJJ,IAAM,aAAa,WA0HjB,SAASA,YACT;AAAA,EACE,QAAQ;AAAA,EACR,KAAK;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,SAAS;AACX,GACA,KACc;AACd,QAAM,MAAM;AAEZ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,0BAAO;AAAA,QACP,0BAAO,KAAK;AAAA,QACZ,0BAAO,MAAM;AAAA,QACb,cAAc,UAAU,0BAAO,QAAQ,0BAAO;AAAA,QAC9C,UAAU,KAAK;AAAA,QACf,UAAU,0BAAO;AAAA,QACjB,0BAAO,OAAO,MAAM;AAAA,QACpB,cAAc,eAAe,0BAAO;AAAA,QACpC,aAAa,0BAAO;AAAA,QACpB,aAAa,QAAQ,0BAAO;AAAA,QAC5B,OAAO,OAAO,0BAAO,IAAI,MAAM;AAAA,MACjC;AAAA,MACA,eAAa;AAAA,MACb,OAAO;AAAA,QACL,iBAAiB;AAAA,MACnB;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,qBAAQ","sourcesContent":["import classNames from \"classnames\";\nimport { forwardRef, type ReactElement, type ReactNode } from \"react\";\nimport styles from \"./Typography.module.css\";\nimport textColor from \"../colors/textColors\";\n\n/**\n * [Typography](https://cambly-syntax.vercel.app/?path=/docs/components-typography--docs) is a component that renders text.\n */\nconst Typography = forwardRef<\n HTMLDivElement,\n {\n /**\n * Aligns the text to the left, right, or center of the container.\n * * `start` and `end` will align the text to the left or right of the container depending on the locale.\n * * `forceLeft` and `forceRight` will align the text to the left or right of the container regardless of the locale (should be used sparingly).\n *\n * @defaultValue \"start\"\n */\n align?: \"start\" | \"end\" | \"forceLeft\" | \"center\" | \"forceRight\";\n /**\n * DOM element to render as.\n *\n * @defaultValue \"div\"\n */\n as?: \"div\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\";\n /**\n * The text to be rendered\n */\n children?: ReactNode;\n /**\n * The color of the text.\n *\n * @defaultValue \"gray900\"\n */\n color?:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"destructive-darkBackground\"\n | \"destructive-lightBackground\"\n | \"success\"\n | \"success-darkBackground\"\n | \"white\"\n | \"white-secondary\"\n | \"inherit\";\n /**\n * Test id for the text\n */\n \"data-testid\"?: string;\n /**\n * Style of the font\n *\n * Classic only supports `sans-serif`\n *\n * @defaultValue \"sans-serif\"\n */\n fontStyle?: \"serif\" | \"sans-serif\";\n /**\n * The id for the element\n */\n id?: string;\n /**\n * Whether the text should flow inline with other elements.\n *\n * @defaultValue false\n */\n inline?: boolean;\n /**\n * The number of lines we should truncate the text at\n */\n lineClamp?: number | undefined;\n /**\n * Size of the text.\n *\n * Mobile (viewport width <= 480px)::\n * * `0`: 12px\n * * `100`: 13px\n * * `200`: 16px\n * * `300`: 19px\n * * `400`: 25px\n * * `500`: 32px\n * * `700`: 38px\n * * `800`: 46px\n * * `900`: 55px\n * * `1100`: 83px\n *\n * Desktop (viewport width > 480px):\n * * `0`: 12px\n * * `100`: 13px\n * * `200`: 16px\n * * `300`: 20px\n * * `400`: 25px\n * * `500`: 32px\n * * `700`: 49px\n * * `800`: 63px\n * * `900`: 76px\n * * `1100`: 119px\n *\n * @defaultValue 200\n */\n size?: 0 | 100 | 200 | 300 | 400 | 500 | 700 | 800 | 900 | 1100;\n /**\n * The tooltip to be displayed when the user hovers the text\n */\n tooltip?: string;\n /**\n * Whether the text should be transformed to uppercase.\n *\n * @defaultValue \"none\"\n */\n transform?: \"none\" | \"uppercase\";\n /**\n * Whether the text has an underline.\n *\n * @defaultValue false\n */\n underline?: boolean;\n /**\n * Indicates the boldness of the text.\n *\n * * `regular`: 400\n * * `medium`: 510\n * * `semiBold`: 590\n * * `bold`: 710\n *\n * @defaultValue \"regular\"\n */\n weight?: \"regular\" | \"medium\" | \"semiBold\" | \"bold\";\n }\n>(function Typography(\n {\n align = \"start\",\n as = \"div\",\n children,\n color = \"gray900\",\n \"data-testid\": dataTestId,\n fontStyle = \"sans-serif\",\n id,\n inline = false,\n lineClamp = undefined,\n size = 200,\n tooltip,\n transform = \"none\",\n underline = false,\n weight = \"regular\",\n },\n ref,\n): ReactElement {\n const Tag = as;\n\n return (\n <Tag\n id={id}\n className={classNames(\n styles.typography,\n styles[align],\n styles[weight],\n fontStyle === \"serif\" ? styles.serif : styles.sansSerif,\n textColor(color),\n inline && styles.inline,\n styles[`size${size}`],\n transform === \"uppercase\" && styles.uppercase,\n underline && styles.underline,\n lineClamp != null && styles.lineClamp,\n as === \"p\" && styles[`p${size}`],\n )}\n data-testid={dataTestId}\n style={{\n WebkitLineClamp: lineClamp,\n }}\n title={tooltip}\n ref={ref}\n >\n {children}\n </Tag>\n );\n});\n\nexport default Typography;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Typography/Typography.module.css\"; export default {\"typography\":\"_typography_15w34_1\",\"sansSerif\":\"_sansSerif_15w34_22\",\"serif\":\"_serif_15w34_27\",\"size0\":\"_size0_15w34_73\",\"size100\":\"_size100_15w34_77\",\"size200\":\"_size200_15w34_81\",\"size300\":\"_size300_15w34_85\",\"size400\":\"_size400_15w34_89\",\"size500\":\"_size500_15w34_93\",\"size700\":\"_size700_15w34_97\",\"size800\":\"_size800_15w34_101\",\"size900\":\"_size900_15w34_105\",\"size1100\":\"_size1100_15w34_109\",\"center\":\"_center_15w34_137\",\"forceLeft\":\"_forceLeft_15w34_141\",\"forceRight\":\"_forceRight_15w34_145\",\"start\":\"_start_15w34_149\",\"end\":\"_end_15w34_153\",\"regular\":\"_regular_15w34_159\",\"medium\":\"_medium_15w34_163\",\"semiBold\":\"_semiBold_15w34_167\",\"bold\":\"_bold_15w34_171\",\"underline\":\"_underline_15w34_175\",\"inline\":\"_inline_15w34_179\",\"uppercase\":\"_uppercase_15w34_183\",\"lineClamp\":\"_lineClamp_15w34_187\",\"p100\":\"_p100_15w34_196\",\"p200\":\"_p200_15w34_200\",\"p300\":\"_p300_15w34_204\",\"p400\":\"_p400_15w34_208\",\"p500\":\"_p500_15w34_212\"}"]}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./VV2NJABK.js";
|
|
8
8
|
import {
|
|
9
9
|
TabInternal
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./45DUMC5J.js";
|
|
11
11
|
import {
|
|
12
12
|
Box_default
|
|
13
13
|
} from "./IB6JZQF3.js";
|
|
@@ -64,4 +64,4 @@ function TabButton({
|
|
|
64
64
|
export {
|
|
65
65
|
TabButton
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=
|
|
67
|
+
//# sourceMappingURL=RX3JA6WI.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _XLUVINJWcjs = require('./XLUVINJW.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _RVU3UEZIcjs = require('./RVU3UEZI.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _K4AUV2VKcjs = require('./K4AUV2VK.cjs');
|
|
@@ -98,7 +98,7 @@ var Checkbox = ({
|
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
100
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
101
|
-
|
|
101
|
+
_RVU3UEZIcjs.Typography_default,
|
|
102
102
|
{
|
|
103
103
|
size: typographySize[size],
|
|
104
104
|
color: error ? "destructive-darkBackground" : "primary",
|
|
@@ -114,4 +114,4 @@ var Checkbox_default = Checkbox;
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
exports.Checkbox_default = Checkbox_default;
|
|
117
|
-
//# sourceMappingURL=
|
|
117
|
+
//# sourceMappingURL=S7BCIAUQ.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _Q7CC3YA4cjs = require('./Q7CC3YA4.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _HUIHS6RNcjs = require('./HUIHS6RN.cjs');
|
|
@@ -93,7 +93,7 @@ function Modal({
|
|
|
93
93
|
),
|
|
94
94
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _QODNNCT2cjs.Box_default, { display: "flex", direction: "column", width: "100%", children: [
|
|
95
95
|
image && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { children: image }),
|
|
96
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { padding: 6, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
96
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QODNNCT2cjs.Box_default, { padding: 6, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Q7CC3YA4cjs.Heading_default, { as: "h1", size: 700, fontStyle: "serif", children: header }) }),
|
|
97
97
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
98
98
|
_QODNNCT2cjs.Box_default,
|
|
99
99
|
{
|
|
@@ -130,4 +130,4 @@ Modal.displayName = "Modal";
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
exports.Modal = Modal;
|
|
133
|
-
//# sourceMappingURL=
|
|
133
|
+
//# sourceMappingURL=SAPSO6DD.cjs.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _QODNNCT2cjs = require('./QODNNCT2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _RVU3UEZIcjs = require('./RVU3UEZI.cjs');
|
|
8
8
|
|
|
9
9
|
// css-module:./Badge.module.css#css-module
|
|
10
10
|
var Badge_module_default = { "icon": "_icon_1g9xb_1" };
|
|
@@ -45,7 +45,7 @@ var Badge = ({
|
|
|
45
45
|
justifyContent: "center",
|
|
46
46
|
minHeight: 24,
|
|
47
47
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
48
|
-
|
|
48
|
+
_RVU3UEZIcjs.Typography_default,
|
|
49
49
|
{
|
|
50
50
|
size: 100,
|
|
51
51
|
weight: "medium",
|
|
@@ -53,7 +53,7 @@ var Badge = ({
|
|
|
53
53
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _QODNNCT2cjs.Box_default, { display: "flex", gap: 1, alignItems: "center", justifyContent: "start", children: [
|
|
54
54
|
Icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { className: Badge_module_default.icon, size: 100 }),
|
|
55
55
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
56
|
-
|
|
56
|
+
_RVU3UEZIcjs.Typography_default,
|
|
57
57
|
{
|
|
58
58
|
color: textColorForBackgroundColor(color),
|
|
59
59
|
size: 100,
|
|
@@ -72,4 +72,4 @@ var Badge_default = Badge;
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
exports.Badge_default = Badge_default;
|
|
75
|
-
//# sourceMappingURL=
|
|
75
|
+
//# sourceMappingURL=SJSSW5MP.cjs.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _QODNNCT2cjs = require('./QODNNCT2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _RVU3UEZIcjs = require('./RVU3UEZI.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _2XIVACBMcjs = require('./2XIVACBM.cjs');
|
|
@@ -40,7 +40,7 @@ var ItemCountIcon = ({
|
|
|
40
40
|
rounding: "full",
|
|
41
41
|
padding: 1,
|
|
42
42
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
43
|
-
|
|
43
|
+
_RVU3UEZIcjs.Typography_default,
|
|
44
44
|
{
|
|
45
45
|
color: on === "lightBackground" ? "white" : "primary",
|
|
46
46
|
weight: "semiBold",
|
|
@@ -79,7 +79,7 @@ function TabInternal({
|
|
|
79
79
|
paddingY: 2,
|
|
80
80
|
children: [
|
|
81
81
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
82
|
-
|
|
82
|
+
_RVU3UEZIcjs.Typography_default,
|
|
83
83
|
{
|
|
84
84
|
size: 0,
|
|
85
85
|
transform: "uppercase",
|
|
@@ -98,4 +98,4 @@ function TabInternal({
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
exports.TabInternal = TabInternal;
|
|
101
|
-
//# sourceMappingURL=
|
|
101
|
+
//# sourceMappingURL=SW6S6ZCI.cjs.map
|
|
@@ -16,8 +16,10 @@ function textColor(color) {
|
|
|
16
16
|
return _2XIVACBMcjs.colors_module_default.inheritColor;
|
|
17
17
|
case "destructive-primary":
|
|
18
18
|
return _2XIVACBMcjs.colors_module_default.cambioDestructive900Color;
|
|
19
|
+
case "destructive-lightBackground":
|
|
20
|
+
return _2XIVACBMcjs.colors_module_default.cambioDestructive900Color;
|
|
19
21
|
case "destructive-darkBackground":
|
|
20
|
-
return _2XIVACBMcjs.colors_module_default.
|
|
22
|
+
return _2XIVACBMcjs.colors_module_default.cambioDestructive300Color;
|
|
21
23
|
case "success":
|
|
22
24
|
return _2XIVACBMcjs.colors_module_default.cambioSuccess700Color;
|
|
23
25
|
case "success-darkBackground":
|
|
@@ -30,4 +32,4 @@ function textColor(color) {
|
|
|
30
32
|
|
|
31
33
|
|
|
32
34
|
exports.textColor = textColor;
|
|
33
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=TA4EX7DL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/colors/textColors.ts"],"names":[],"mappings":";;;;;;AAEe,SAAR,UACL,OAYQ;AACR,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IACrB,KAAK;AACH,aAAO,sBAAY;AAAA,IAErB;AACE,aAAO,sBAAY;AAAA,EACvB;AACF","sourcesContent":["import colorStyles from \"../colors/colors.module.css\";\n\nexport default function textColor(\n color:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"destructive-lightBackground\"\n | \"destructive-darkBackground\"\n | \"success\"\n | \"success-darkBackground\"\n | \"white\"\n | \"white-secondary\"\n | \"inherit\",\n): string {\n switch (color) {\n case \"gray700\":\n return colorStyles.cambioGray800Color;\n case \"white\":\n return colorStyles.cambioWhiteColor;\n case \"white-secondary\":\n return colorStyles.cambioWhite70Color;\n case \"inherit\":\n return colorStyles.inheritColor;\n case \"destructive-primary\":\n return colorStyles.cambioDestructive900Color;\n case \"destructive-lightBackground\":\n return colorStyles.cambioDestructive900Color;\n case \"destructive-darkBackground\":\n return colorStyles.cambioDestructive300Color;\n case \"success\":\n return colorStyles.cambioSuccess700Color;\n case \"success-darkBackground\":\n return colorStyles.cambioSuccess100Color;\n // primary / gray900\n default:\n return colorStyles.cambioBlackColor;\n }\n}\n"]}
|