@cambly/syntax-core 10.35.0 → 10.37.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 +3 -3
- package/dist/Badge/Badge.d.ts +2 -24
- package/dist/Badge/Badge.js +2 -2
- package/dist/Button/Button.cjs +8 -8
- package/dist/Button/Button.css +19 -19
- package/dist/Button/Button.css.map +1 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +7 -7
- package/dist/Button/constants/iconSize.cjs +2 -2
- package/dist/Button/constants/iconSize.css +19 -19
- package/dist/Button/constants/iconSize.css.map +1 -1
- package/dist/Button/constants/iconSize.js +1 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/Checkbox/Checkbox.cjs +3 -3
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Checkbox/Checkbox.js +2 -2
- package/dist/Chip/Chip.cjs +3 -3
- package/dist/Chip/Chip.d.ts +1 -11
- package/dist/Chip/Chip.js +2 -2
- package/dist/Dialog/ModalDialog.cjs +6 -6
- package/dist/Dialog/ModalDialog.js +5 -5
- package/dist/Heading/Heading.cjs +3 -3
- package/dist/Heading/Heading.d.ts +1 -1
- package/dist/Heading/Heading.js +2 -2
- package/dist/IconButton/IconButton.cjs +5 -5
- package/dist/IconButton/IconButton.js +4 -4
- package/dist/LinkButton/LinkButton.cjs +8 -7
- package/dist/LinkButton/LinkButton.css +19 -19
- package/dist/LinkButton/LinkButton.css.map +1 -1
- package/dist/LinkButton/LinkButton.d.ts +6 -0
- package/dist/LinkButton/LinkButton.js +7 -6
- package/dist/Modal/Modal.cjs +8 -8
- package/dist/Modal/Modal.d.ts +1 -15
- package/dist/Modal/Modal.js +7 -7
- package/dist/Popover/Popover.cjs +7 -7
- package/dist/Popover/Popover.js +6 -6
- package/dist/RadioButton/RadioButton.cjs +3 -3
- package/dist/RadioButton/RadioButton.d.ts +1 -1
- package/dist/RadioButton/RadioButton.js +2 -2
- package/dist/RichSelect/RichSelectBox.cjs +14 -14
- package/dist/RichSelect/RichSelectBox.css +19 -19
- package/dist/RichSelect/RichSelectBox.css.map +1 -1
- package/dist/RichSelect/RichSelectBox.d.ts +1 -1
- package/dist/RichSelect/RichSelectBox.js +13 -13
- package/dist/RichSelect/RichSelectChip.cjs +4 -4
- package/dist/RichSelect/RichSelectChip.js +3 -3
- package/dist/RichSelect/RichSelectList.cjs +19 -19
- package/dist/RichSelect/RichSelectList.css +19 -19
- package/dist/RichSelect/RichSelectList.css.map +1 -1
- package/dist/RichSelect/RichSelectList.d.ts +1 -7
- package/dist/RichSelect/RichSelectList.js +18 -18
- package/dist/RichSelect/RichSelectRadioButton.cjs +4 -4
- package/dist/RichSelect/RichSelectRadioButton.d.ts +1 -1
- package/dist/RichSelect/RichSelectRadioButton.js +3 -3
- package/dist/RichSelect/RichSelectSection.cjs +3 -3
- package/dist/RichSelect/RichSelectSection.js +2 -2
- package/dist/SelectList/SelectList.cjs +4 -4
- package/dist/SelectList/SelectList.d.ts +1 -11
- package/dist/SelectList/SelectList.js +3 -3
- package/dist/TapArea/TapArea.d.ts +1 -1
- package/dist/TextArea/TextArea.cjs +3 -3
- package/dist/TextArea/TextArea.d.ts +0 -8
- package/dist/TextArea/TextArea.js +2 -2
- package/dist/TextField/TextField.cjs +3 -3
- package/dist/TextField/TextField.d.ts +1 -9
- package/dist/TextField/TextField.js +2 -2
- package/dist/Tooltip/Tooltip.cjs +3 -3
- package/dist/Tooltip/Tooltip.js +2 -2
- package/dist/Typography/Typography.cjs +2 -2
- package/dist/Typography/Typography.d.ts +2 -4
- package/dist/Typography/Typography.js +1 -1
- package/dist/__chunks/{HAI43LQ2.cjs → 272LSIIS.cjs} +3 -3
- package/dist/__chunks/{LFL4LK4W.js → 2F77AU5B.js} +1 -1
- package/dist/__chunks/{LFL4LK4W.js.map → 2F77AU5B.js.map} +1 -1
- package/dist/__chunks/{YAM7DAOZ.js → 2IXPTAJD.js} +2 -13
- package/dist/__chunks/2IXPTAJD.js.map +1 -0
- package/dist/__chunks/{P4NYXJEO.js → 2LV4KJ5U.js} +2 -2
- package/dist/__chunks/{YQS4VRJE.cjs → 36DIFAKH.cjs} +22 -24
- package/dist/__chunks/36DIFAKH.cjs.map +1 -0
- package/dist/__chunks/{2MQDGNBM.cjs → 3OMIAWRN.cjs} +41 -17
- package/dist/__chunks/3OMIAWRN.cjs.map +1 -0
- package/dist/__chunks/{4SQ2LELV.js → 44BDRP6O.js} +2 -2
- package/dist/__chunks/{S5B7CZKL.cjs → 52L4VM3G.cjs} +3 -3
- package/dist/__chunks/{GUCD3CDN.cjs → 65OHGDU2.cjs} +19 -19
- package/dist/__chunks/65OHGDU2.cjs.map +1 -0
- package/dist/__chunks/{GF53QRQ7.cjs → 6BULM4PL.cjs} +10 -10
- package/dist/__chunks/{QMC6ZFD4.cjs → 7IV2L4B4.cjs} +3 -3
- package/dist/__chunks/{QX3BNIF3.js → 7JPWJT4Z.js} +2 -2
- package/dist/__chunks/{DSLMOEWK.js → B4BYSLWK.js} +2 -4
- package/dist/__chunks/B4BYSLWK.js.map +1 -0
- package/dist/__chunks/BHN2OODF.cjs +17 -0
- package/dist/__chunks/BHN2OODF.cjs.map +1 -0
- package/dist/__chunks/{ZX3VWSSV.js → BW5Q7OJQ.js} +4 -9
- package/dist/__chunks/BW5Q7OJQ.js.map +1 -0
- package/dist/__chunks/{BYVURUTU.cjs → C3KZXHTV.cjs} +1 -1
- package/dist/__chunks/C3KZXHTV.cjs.map +1 -0
- package/dist/__chunks/C7PW7CPK.js +17 -0
- package/dist/__chunks/C7PW7CPK.js.map +1 -0
- package/dist/__chunks/{LFPS43OR.cjs → CA6LTZL7.cjs} +3 -3
- package/dist/__chunks/{ZQRUOZFX.cjs → CGBH73TM.cjs} +3 -3
- package/dist/__chunks/{YFEKBWH2.cjs → DOQ5YEJ4.cjs} +3 -3
- package/dist/__chunks/DOQ5YEJ4.cjs.map +1 -0
- package/dist/__chunks/{6CZHUML6.js → ECA33JJ5.js} +1 -1
- package/dist/__chunks/ECA33JJ5.js.map +1 -0
- package/dist/__chunks/{JHWCONNT.cjs → EMUPGJ7I.cjs} +5 -7
- package/dist/__chunks/EMUPGJ7I.cjs.map +1 -0
- package/dist/__chunks/{2IY4AFLZ.cjs → FPDQA475.cjs} +4 -6
- package/dist/__chunks/FPDQA475.cjs.map +1 -0
- package/dist/__chunks/{WYKA74SC.js → GJMFOAIB.js} +2 -2
- package/dist/__chunks/{2OLGBVRM.js → H6VD4C7I.js} +2 -2
- package/dist/__chunks/{N6YLXBLU.js → HLC7NU6Z.js} +2 -2
- package/dist/__chunks/{YF53K6PE.js → HXTCI7A3.js} +2 -2
- package/dist/__chunks/{SND6HHAL.cjs → JHUEQO5Q.cjs} +3 -3
- package/dist/__chunks/{K6TH7UPQ.js → JOVGUW46.js} +4 -6
- package/dist/__chunks/JOVGUW46.js.map +1 -0
- package/dist/__chunks/{6RR4OL4S.cjs → L2CARKP7.cjs} +3 -3
- package/dist/__chunks/{MYNQCB3D.js → LX5KVHM2.js} +15 -15
- package/dist/__chunks/LX5KVHM2.js.map +1 -0
- package/dist/__chunks/{JFI6TDAC.js → MEOMWLNG.js} +4 -4
- package/dist/__chunks/{LBA34HLF.cjs → MKZONAGT.cjs} +1 -1
- package/dist/__chunks/MKZONAGT.cjs.map +1 -0
- package/dist/__chunks/{ZTXNFBB6.js → N5N4HUQB.js} +2 -2
- package/dist/__chunks/{GNJNJVEO.cjs → NCDLHBVI.cjs} +7 -9
- package/dist/__chunks/NCDLHBVI.cjs.map +1 -0
- package/dist/__chunks/{HHOEMHQE.cjs → NXQTDCKY.cjs} +1 -1
- package/dist/__chunks/{HHOEMHQE.cjs.map → NXQTDCKY.cjs.map} +1 -1
- package/dist/__chunks/{AV5B2KHQ.js → PO66GRTH.js} +5 -5
- package/dist/__chunks/{5VVFGPW6.cjs → PROA22UK.cjs} +7 -7
- package/dist/__chunks/{XL37HTXI.js → PX2UXNON.js} +2 -2
- package/dist/__chunks/{MFNU3HMC.js → QF2477HJ.js} +11 -13
- package/dist/__chunks/QF2477HJ.js.map +1 -0
- package/dist/__chunks/{SJRKFU77.js → QVOCSKIN.js} +36 -12
- package/dist/__chunks/QVOCSKIN.js.map +1 -0
- package/dist/__chunks/{UVVLYBDQ.cjs → QVR3OSXW.cjs} +3 -3
- package/dist/__chunks/{M3PAAPMI.cjs → RAL6R27S.cjs} +1 -1
- package/dist/__chunks/RAL6R27S.cjs.map +1 -0
- package/dist/__chunks/{BZ2W7SUB.cjs → S77S5MVX.cjs} +3 -3
- package/dist/__chunks/{DEXL5BXD.js → T6PXFSRX.js} +1 -1
- package/dist/__chunks/T6PXFSRX.js.map +1 -0
- package/dist/__chunks/{W54J4A4T.cjs → TY6VF7DF.cjs} +6 -11
- package/dist/__chunks/TY6VF7DF.cjs.map +1 -0
- package/dist/__chunks/{J32DPXIR.js → UU3JE4UT.js} +2 -4
- package/dist/__chunks/UU3JE4UT.js.map +1 -0
- package/dist/__chunks/{423C767D.js → UVQS6LU3.js} +1 -1
- package/dist/__chunks/UVQS6LU3.js.map +1 -0
- package/dist/__chunks/{OWUHE3QB.js → WHQ73FAY.js} +2 -2
- package/dist/__chunks/WHQ73FAY.js.map +1 -0
- package/dist/__chunks/{XCSW34UM.cjs → XCGRNBQH.cjs} +2 -13
- package/dist/__chunks/XCGRNBQH.cjs.map +1 -0
- package/dist/__chunks/{XIKD47WC.js → Y3D5XFML.js} +6 -30
- package/dist/__chunks/Y3D5XFML.js.map +1 -0
- package/dist/__chunks/{525TQTCQ.cjs → YICZLNHI.cjs} +8 -32
- package/dist/__chunks/YICZLNHI.cjs.map +1 -0
- package/dist/colors/backgroundColor.cjs +2 -2
- package/dist/colors/backgroundColor.d.ts +2 -2
- package/dist/colors/backgroundColor.js +1 -1
- package/dist/colors/border.cjs +2 -2
- package/dist/colors/border.d.ts +2 -2
- package/dist/colors/border.js +1 -1
- package/dist/colors/foregroundColor.cjs +2 -2
- package/dist/colors/foregroundColor.d.ts +2 -2
- package/dist/colors/foregroundColor.js +1 -1
- package/dist/constants.cjs +1 -17
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.ts +2 -3
- package/dist/constants.js +0 -16
- package/dist/constants.js.map +1 -1
- package/dist/index.cjs +28 -28
- package/dist/index.css +19 -19
- package/dist/index.css.map +1 -1
- package/dist/index.js +27 -27
- package/package.json +1 -1
- package/dist/__chunks/2IY4AFLZ.cjs.map +0 -1
- package/dist/__chunks/2MQDGNBM.cjs.map +0 -1
- package/dist/__chunks/423C767D.js.map +0 -1
- package/dist/__chunks/525TQTCQ.cjs.map +0 -1
- package/dist/__chunks/6CZHUML6.js.map +0 -1
- package/dist/__chunks/BYVURUTU.cjs.map +0 -1
- package/dist/__chunks/DEXL5BXD.js.map +0 -1
- package/dist/__chunks/DSLMOEWK.js.map +0 -1
- package/dist/__chunks/GNJNJVEO.cjs.map +0 -1
- package/dist/__chunks/GUCD3CDN.cjs.map +0 -1
- package/dist/__chunks/J32DPXIR.js.map +0 -1
- package/dist/__chunks/JHWCONNT.cjs.map +0 -1
- package/dist/__chunks/JWJK72BH.js +0 -17
- package/dist/__chunks/JWJK72BH.js.map +0 -1
- package/dist/__chunks/K6TH7UPQ.js.map +0 -1
- package/dist/__chunks/LBA34HLF.cjs.map +0 -1
- package/dist/__chunks/M3PAAPMI.cjs.map +0 -1
- package/dist/__chunks/MFNU3HMC.js.map +0 -1
- package/dist/__chunks/MYNQCB3D.js.map +0 -1
- package/dist/__chunks/OWUHE3QB.js.map +0 -1
- package/dist/__chunks/SJRKFU77.js.map +0 -1
- package/dist/__chunks/UAXX2ZEQ.cjs +0 -17
- package/dist/__chunks/UAXX2ZEQ.cjs.map +0 -1
- package/dist/__chunks/W54J4A4T.cjs.map +0 -1
- package/dist/__chunks/XCSW34UM.cjs.map +0 -1
- package/dist/__chunks/XIKD47WC.js.map +0 -1
- package/dist/__chunks/YAM7DAOZ.js.map +0 -1
- package/dist/__chunks/YFEKBWH2.cjs.map +0 -1
- package/dist/__chunks/YQS4VRJE.cjs.map +0 -1
- package/dist/__chunks/ZX3VWSSV.js.map +0 -1
- /package/dist/__chunks/{HAI43LQ2.cjs.map → 272LSIIS.cjs.map} +0 -0
- /package/dist/__chunks/{P4NYXJEO.js.map → 2LV4KJ5U.js.map} +0 -0
- /package/dist/__chunks/{4SQ2LELV.js.map → 44BDRP6O.js.map} +0 -0
- /package/dist/__chunks/{S5B7CZKL.cjs.map → 52L4VM3G.cjs.map} +0 -0
- /package/dist/__chunks/{GF53QRQ7.cjs.map → 6BULM4PL.cjs.map} +0 -0
- /package/dist/__chunks/{QMC6ZFD4.cjs.map → 7IV2L4B4.cjs.map} +0 -0
- /package/dist/__chunks/{QX3BNIF3.js.map → 7JPWJT4Z.js.map} +0 -0
- /package/dist/__chunks/{LFPS43OR.cjs.map → CA6LTZL7.cjs.map} +0 -0
- /package/dist/__chunks/{ZQRUOZFX.cjs.map → CGBH73TM.cjs.map} +0 -0
- /package/dist/__chunks/{WYKA74SC.js.map → GJMFOAIB.js.map} +0 -0
- /package/dist/__chunks/{2OLGBVRM.js.map → H6VD4C7I.js.map} +0 -0
- /package/dist/__chunks/{N6YLXBLU.js.map → HLC7NU6Z.js.map} +0 -0
- /package/dist/__chunks/{YF53K6PE.js.map → HXTCI7A3.js.map} +0 -0
- /package/dist/__chunks/{SND6HHAL.cjs.map → JHUEQO5Q.cjs.map} +0 -0
- /package/dist/__chunks/{6RR4OL4S.cjs.map → L2CARKP7.cjs.map} +0 -0
- /package/dist/__chunks/{JFI6TDAC.js.map → MEOMWLNG.js.map} +0 -0
- /package/dist/__chunks/{ZTXNFBB6.js.map → N5N4HUQB.js.map} +0 -0
- /package/dist/__chunks/{AV5B2KHQ.js.map → PO66GRTH.js.map} +0 -0
- /package/dist/__chunks/{5VVFGPW6.cjs.map → PROA22UK.cjs.map} +0 -0
- /package/dist/__chunks/{XL37HTXI.js.map → PX2UXNON.js.map} +0 -0
- /package/dist/__chunks/{UVVLYBDQ.cjs.map → QVR3OSXW.cjs.map} +0 -0
- /package/dist/__chunks/{BZ2W7SUB.cjs.map → S77S5MVX.cjs.map} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
SelectList
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/JOVGUW46.js";
|
|
5
5
|
import "../__chunks/Y47XTR6M.js";
|
|
6
|
-
import "../__chunks/
|
|
6
|
+
import "../__chunks/2F77AU5B.js";
|
|
7
7
|
import "../__chunks/KKADUD65.js";
|
|
8
8
|
import "../__chunks/J6DAGNNN.js";
|
|
9
9
|
import "../__chunks/4U4UW4AK.js";
|
|
10
10
|
import "../__chunks/KBIW5XV4.js";
|
|
11
11
|
import "../__chunks/4U4UW4AK.js";
|
|
12
|
-
import "../__chunks/
|
|
12
|
+
import "../__chunks/2IXPTAJD.js";
|
|
13
13
|
import "../__chunks/S6TNP7G5.js";
|
|
14
14
|
import "../__chunks/4U4UW4AK.js";
|
|
15
15
|
import "../__chunks/JB65NEXK.js";
|
|
@@ -48,7 +48,7 @@ declare const TapArea: React__default.ForwardRefExoticComponent<React__default.A
|
|
|
48
48
|
*
|
|
49
49
|
* @defaultValue "none"
|
|
50
50
|
*/
|
|
51
|
-
rounding?: "
|
|
51
|
+
rounding?: "none" | "md" | "sm" | "full" | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* The tab index of the tap area
|
|
54
54
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _EMUPGJ7Icjs = require('../__chunks/EMUPGJ7I.cjs');
|
|
5
5
|
require('../__chunks/WFVGNGEP.cjs');
|
|
6
6
|
require('../__chunks/DB7KX3J2.cjs');
|
|
7
7
|
|
|
8
8
|
require('../__chunks/CHDS4D44.cjs');
|
|
9
9
|
|
|
10
|
-
require('../__chunks/
|
|
10
|
+
require('../__chunks/XCGRNBQH.cjs');
|
|
11
11
|
require('../__chunks/QT6IRCGW.cjs');
|
|
12
12
|
|
|
13
13
|
require('../__chunks/K4AUV2VK.cjs');
|
|
14
14
|
require('../__chunks/X2SDR4SD.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.default =
|
|
17
|
+
exports.default = _EMUPGJ7Icjs.TextArea_default;
|
|
18
18
|
//# sourceMappingURL=TextArea.cjs.map
|
|
@@ -37,14 +37,6 @@ type TextAreaProps = {
|
|
|
37
37
|
* Placeholder text to display when TextArea is empty
|
|
38
38
|
*/
|
|
39
39
|
placeholder?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Size of the TextArea. Defines the font size and padding.
|
|
42
|
-
*
|
|
43
|
-
* Cambio only supports `md`
|
|
44
|
-
*
|
|
45
|
-
* @defaultValue "md"
|
|
46
|
-
*/
|
|
47
|
-
size?: "sm" | "md" | "lg";
|
|
48
40
|
/**
|
|
49
41
|
* Number of rows to display
|
|
50
42
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
TextArea_default
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/B4BYSLWK.js";
|
|
5
5
|
import "../__chunks/4U4UW4AK.js";
|
|
6
6
|
import "../__chunks/J6DAGNNN.js";
|
|
7
7
|
import "../__chunks/4U4UW4AK.js";
|
|
8
8
|
import "../__chunks/KBIW5XV4.js";
|
|
9
9
|
import "../__chunks/4U4UW4AK.js";
|
|
10
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/2IXPTAJD.js";
|
|
11
11
|
import "../__chunks/S6TNP7G5.js";
|
|
12
12
|
import "../__chunks/4U4UW4AK.js";
|
|
13
13
|
import "../__chunks/JB65NEXK.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _FPDQA475cjs = require('../__chunks/FPDQA475.cjs');
|
|
5
5
|
require('../__chunks/WFVGNGEP.cjs');
|
|
6
6
|
require('../__chunks/DB7KX3J2.cjs');
|
|
7
7
|
|
|
8
8
|
require('../__chunks/CHDS4D44.cjs');
|
|
9
9
|
|
|
10
|
-
require('../__chunks/
|
|
10
|
+
require('../__chunks/XCGRNBQH.cjs');
|
|
11
11
|
require('../__chunks/QT6IRCGW.cjs');
|
|
12
12
|
|
|
13
13
|
require('../__chunks/K4AUV2VK.cjs');
|
|
14
14
|
require('../__chunks/X2SDR4SD.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.default =
|
|
17
|
+
exports.default = _FPDQA475cjs.TextField;
|
|
18
18
|
//# sourceMappingURL=TextField.cjs.map
|
|
@@ -3,7 +3,7 @@ import React__default, { HTMLInputTypeAttribute, ReactElement } from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* [TextField](https://cambly-syntax.vercel.app/?path=/docs/components-textfield--docs) is a component that allows users to enter text.
|
|
5
5
|
*/
|
|
6
|
-
declare function TextField({ autoComplete, "data-testid": dataTestId, disabled: disabledProp, errorText, helperText, id, label, onChange, placeholder,
|
|
6
|
+
declare function TextField({ autoComplete, "data-testid": dataTestId, disabled: disabledProp, errorText, helperText, id, label, onChange, placeholder, type, value, }: {
|
|
7
7
|
/**
|
|
8
8
|
* The autocomplete attribute specifies whether or not an input field should have autocomplete enabled.
|
|
9
9
|
*
|
|
@@ -44,14 +44,6 @@ declare function TextField({ autoComplete, "data-testid": dataTestId, disabled:
|
|
|
44
44
|
* Optional TextField placeholder text
|
|
45
45
|
*/
|
|
46
46
|
placeholder?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Size of the TextField
|
|
49
|
-
*
|
|
50
|
-
* * `md`: 48px
|
|
51
|
-
*
|
|
52
|
-
* @defaultValue "md"
|
|
53
|
-
*/
|
|
54
|
-
size?: "sm" | "md" | "lg";
|
|
55
47
|
/**
|
|
56
48
|
* Input type of the TextField
|
|
57
49
|
*
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
TextField
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/UU3JE4UT.js";
|
|
5
5
|
import "../__chunks/4U4UW4AK.js";
|
|
6
6
|
import "../__chunks/J6DAGNNN.js";
|
|
7
7
|
import "../__chunks/4U4UW4AK.js";
|
|
8
8
|
import "../__chunks/KBIW5XV4.js";
|
|
9
9
|
import "../__chunks/4U4UW4AK.js";
|
|
10
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/2IXPTAJD.js";
|
|
11
11
|
import "../__chunks/S6TNP7G5.js";
|
|
12
12
|
import "../__chunks/4U4UW4AK.js";
|
|
13
13
|
import "../__chunks/JB65NEXK.js";
|
package/dist/Tooltip/Tooltip.cjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _7IV2L4B4cjs = require('../__chunks/7IV2L4B4.cjs');
|
|
6
6
|
require('../__chunks/PLUVW6AM.cjs');
|
|
7
7
|
require('../__chunks/IL22HCBF.cjs');
|
|
8
8
|
require('../__chunks/WFVGNGEP.cjs');
|
|
9
9
|
require('../__chunks/CHDS4D44.cjs');
|
|
10
10
|
|
|
11
|
-
require('../__chunks/
|
|
11
|
+
require('../__chunks/XCGRNBQH.cjs');
|
|
12
12
|
require('../__chunks/QT6IRCGW.cjs');
|
|
13
13
|
|
|
14
14
|
require('../__chunks/LLFHCGRA.cjs');
|
|
@@ -19,5 +19,5 @@ require('../__chunks/X2SDR4SD.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
exports.AriaTooltip =
|
|
22
|
+
exports.AriaTooltip = _7IV2L4B4cjs.AriaTooltip; exports.default = _7IV2L4B4cjs.Tooltip_default;
|
|
23
23
|
//# sourceMappingURL=Tooltip.cjs.map
|
package/dist/Tooltip/Tooltip.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AriaTooltip,
|
|
4
4
|
Tooltip_default
|
|
5
|
-
} from "../__chunks/
|
|
5
|
+
} from "../__chunks/GJMFOAIB.js";
|
|
6
6
|
import "../__chunks/ZOWOFYUE.js";
|
|
7
7
|
import "../__chunks/AVREYFSM.js";
|
|
8
8
|
import "../__chunks/4U4UW4AK.js";
|
|
9
9
|
import "../__chunks/KBIW5XV4.js";
|
|
10
10
|
import "../__chunks/4U4UW4AK.js";
|
|
11
|
-
import "../__chunks/
|
|
11
|
+
import "../__chunks/2IXPTAJD.js";
|
|
12
12
|
import "../__chunks/S6TNP7G5.js";
|
|
13
13
|
import "../__chunks/4U4UW4AK.js";
|
|
14
14
|
import "../__chunks/SVZOETLJ.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _XCGRNBQHcjs = require('../__chunks/XCGRNBQH.cjs');
|
|
5
5
|
require('../__chunks/QT6IRCGW.cjs');
|
|
6
6
|
require('../__chunks/WFVGNGEP.cjs');
|
|
7
7
|
require('../__chunks/X2SDR4SD.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _XCGRNBQHcjs.Typography_default;
|
|
11
11
|
//# sourceMappingURL=Typography.cjs.map
|
|
@@ -28,7 +28,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
|
|
|
28
28
|
*
|
|
29
29
|
* @defaultValue "gray900"
|
|
30
30
|
*/
|
|
31
|
-
color?: "
|
|
31
|
+
color?: "gray700" | "gray900" | "white" | "inherit" | "primary" | "destructive-primary" | "destructive-darkBackground" | "success" | "success-darkBackground" | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* Test id for the text
|
|
34
34
|
*/
|
|
@@ -111,11 +111,9 @@ declare const Typography: React.ForwardRefExoticComponent<{
|
|
|
111
111
|
* * `semiBold`: 590
|
|
112
112
|
* * `bold`: 710
|
|
113
113
|
*
|
|
114
|
-
* `interactive` and `heavy` are deprecated
|
|
115
|
-
*
|
|
116
114
|
* @defaultValue "regular"
|
|
117
115
|
*/
|
|
118
|
-
weight?: "bold" | "regular" | "
|
|
116
|
+
weight?: "bold" | "regular" | "medium" | "semiBold" | undefined;
|
|
119
117
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
120
118
|
|
|
121
119
|
export { Typography as default };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _XLUVINJWcjs = require('./XLUVINJW.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _XCGRNBQHcjs = require('./XCGRNBQH.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _QT6IRCGWcjs = require('./QT6IRCGW.cjs');
|
|
@@ -98,7 +98,7 @@ var Checkbox = ({
|
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
100
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
101
|
-
|
|
101
|
+
_XCGRNBQHcjs.Typography_default,
|
|
102
102
|
{
|
|
103
103
|
size: typographySize[size],
|
|
104
104
|
color: error ? "destructive-primary" : "gray900",
|
|
@@ -114,4 +114,4 @@ var Checkbox_default = Checkbox;
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
exports.Checkbox_default = Checkbox_default;
|
|
117
|
-
//# sourceMappingURL=
|
|
117
|
+
//# sourceMappingURL=272LSIIS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on
|
|
1
|
+
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Thu, 11 Apr 2024 19:10:05 GMT\n */\n\nexport const ColorBaseBlack = \"#000000\";\nexport const ColorBaseDestructive100 = \"#fef3f5\";\nexport const ColorBaseDestructive200 = \"#fad6de\";\nexport const ColorBaseDestructive300 = \"#f2a2b2\";\nexport const ColorBaseDestructive700 = \"#d32a4b\";\nexport const ColorBaseDestructive800 = \"#81162c\";\nexport const ColorBaseDestructive900 = \"#55101d\";\nexport const ColorBaseGray10 = \"#cbcbcb\"; // Used as the default color for dividers and inner strokes\nexport const ColorBaseGray30 = \"#000000\"; // For IconButton background when on top of an image\nexport const ColorBaseGray60 = \"#000000\"; // Used for icon background in classroom video grid\nexport const ColorBaseGray80 = \"#000000\"; // Used as the background for modals\nexport const ColorBaseGray100 = \"#f7f7f7\";\nexport const ColorBaseGray200 = \"#f0f0f0\"; // Used for light mode backgrounds when showing card content on top\nexport const ColorBaseGray300 = \"#d0d0d0\"; // Used for component outlines, eg: select and textfield\nexport const ColorBaseGray700 = \"#767676\"; // For secondary text in light mode\nexport const ColorBaseGray800 = \"#353535\";\nexport const ColorBaseGray900 = \"#191919\"; // Default text color, Classroom background\nexport const ColorBaseOrange100 = \"#fdf2f0\";\nexport const ColorBaseOrange200 = \"#f6cdc4\";\nexport const ColorBaseOrange300 = \"#ec9987\";\nexport const ColorBaseOrange700 = \"#c34124\";\nexport const ColorBaseOrange800 = \"#732818\";\nexport const ColorBaseOrange900 = \"#4d1a10\";\nexport const ColorBasePrimary100 = \"#eff6fa\";\nexport const ColorBasePrimary200 = \"#c1dbe7\";\nexport const ColorBasePrimary300 = \"#84b7d0\";\nexport const ColorBasePrimary700 = \"#236482\";\nexport const ColorBasePrimary800 = \"#274858\";\nexport const ColorBasePrimary900 = \"#1b303b\";\nexport const ColorBaseSuccess100 = \"#eff7f1\";\nexport const ColorBaseSuccess200 = \"#bddcc6\";\nexport const ColorBaseSuccess300 = \"#81ba92\";\nexport const ColorBaseSuccess700 = \"#397b4d\";\nexport const ColorBaseSuccess800 = \"#2d4936\";\nexport const ColorBaseSuccess900 = \"#1e3124\";\nexport const ColorBasePurple100 = \"#f9f5fa\";\nexport const ColorBasePurple200 = \"#e8dceb\";\nexport const ColorBasePurple300 = \"#cdb4d3\";\nexport const ColorBasePurple700 = \"#8b5f95\";\nexport const ColorBasePurple800 = \"#523b58\";\nexport const ColorBasePurple900 = \"#37273b\";\nexport const ColorBaseYellow100 = \"#fdf5d9\";\nexport const ColorBaseYellow200 = \"#fbe8a3\";\nexport const ColorBaseYellow300 = \"#f8d663\";\nexport const ColorBaseYellow700 = \"#ffc929\";\nexport const ColorBaseYellow800 = \"#765f1c\";\nexport const ColorBaseYellow900 = \"#3b3009\";\nexport const ColorBaseWhite = \"#ffffff\";\nexport const ColorCambioBlack = \"#050500\";\nexport const ColorCambioWhite = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#888077\";\nexport const ColorCambioGray800 = \"#5c554d\";\nexport const ColorCambioGray870 = \"#5c554d\";\nexport const ColorCambioGray900 = \"#312b23\";\nexport const ColorCambioDestructive100 = \"#ffdeda\";\nexport const ColorCambioDestructive300 = \"#ff8071\";\nexport const ColorCambioDestructive370 = \"#ff8071\";\nexport const ColorCambioDestructive700 = \"#c93f32\";\nexport const ColorCambioDestructive770 = \"#c93f32\";\nexport const ColorCambioDestructive900 = \"#6d0002\";\nexport const ColorCambioSuccess100 = \"#daf2c8\";\nexport const ColorCambioSuccess300 = \"#84ce64\";\nexport const ColorCambioSuccess370 = \"#84ce64\";\nexport const ColorCambioSuccess700 = \"#3c7f20\";\nexport const ColorCambioSuccess770 = \"#3c7f20\";\nexport const ColorCambioSuccess900 = \"#103e00\";\nexport const ColorCambioRed = \"#f56e56\";\nexport const ColorCambioOrange = \"#ff8f57\";\nexport const ColorCambioTan = \"#ffb47d\";\nexport const ColorCambioCream = \"#fffad1\";\nexport const ColorCambioPurple = \"#6840a8\";\nexport const ColorCambioLilac = \"#b59ef0\";\nexport const ColorCambioThistle = \"#d69ca4\";\nexport const ColorCambioPink = \"#ffccea\";\nexport const ColorCambioNavy = \"#191142\";\nexport const ColorCambioTeal = \"#44a6cf\";\nexport const ColorCambioSlate = \"#7c9fc6\";\nexport const ColorCambioSky = \"#b1e8fc\";\nexport const ColorCambioYellow700 = \"#ffe733\";\nexport const ColorCambioTransparentFull = \"#000000\";\nexport const Elevation400 = \"0px 16px 32px 0px #00000040\";\nexport const SyntaxFontSansSerif = \"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\n"],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB;","names":[]}
|
|
@@ -32,16 +32,6 @@ function textColor(color) {
|
|
|
32
32
|
return colors_module_default.cambioBlackColor;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
function convertWeight(weight) {
|
|
36
|
-
switch (weight) {
|
|
37
|
-
case "interactive":
|
|
38
|
-
return "medium";
|
|
39
|
-
case "heavy":
|
|
40
|
-
return "regular";
|
|
41
|
-
default:
|
|
42
|
-
return weight;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
35
|
var Typography = forwardRef(function Typography2({
|
|
46
36
|
align = "start",
|
|
47
37
|
as = "div",
|
|
@@ -59,7 +49,6 @@ var Typography = forwardRef(function Typography2({
|
|
|
59
49
|
weight = "regular"
|
|
60
50
|
}, ref) {
|
|
61
51
|
const Tag = as;
|
|
62
|
-
const weightStyles = Typography_module_default[`${convertWeight(weight)}`];
|
|
63
52
|
return /* @__PURE__ */ jsx(
|
|
64
53
|
Tag,
|
|
65
54
|
{
|
|
@@ -67,7 +56,7 @@ var Typography = forwardRef(function Typography2({
|
|
|
67
56
|
className: classNames(
|
|
68
57
|
Typography_module_default.typography,
|
|
69
58
|
Typography_module_default[align],
|
|
70
|
-
|
|
59
|
+
Typography_module_default[weight],
|
|
71
60
|
fontStyle === "serif" ? Typography_module_default.serif : Typography_module_default.sansSerif,
|
|
72
61
|
textColor(color),
|
|
73
62
|
inline && Typography_module_default.inline,
|
|
@@ -91,4 +80,4 @@ var Typography_default = Typography;
|
|
|
91
80
|
export {
|
|
92
81
|
Typography_default
|
|
93
82
|
};
|
|
94
|
-
//# sourceMappingURL=
|
|
83
|
+
//# sourceMappingURL=2IXPTAJD.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 colorStyles from \"../colors/colors.module.css\";\n\nfunction textColor(\n color:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"destructive-darkBackground\"\n | \"success\"\n | \"success-darkBackground\"\n | \"white\"\n | \"inherit\",\n): string {\n switch (color) {\n case \"gray700\":\n return colorStyles.cambioGray800Color;\n case \"white\":\n return colorStyles.cambioWhiteColor;\n case \"inherit\":\n return colorStyles.inheritColor;\n case \"destructive-primary\":\n return colorStyles.cambioDestructive900Color;\n case \"destructive-darkBackground\":\n return colorStyles.cambioDestructive100Color;\n case \"success\":\n return colorStyles.cambioSuccess900Color;\n case \"success-darkBackground\":\n return colorStyles.cambioSuccess100Color;\n // primary / gray900\n default:\n return colorStyles.cambioBlackColor;\n }\n}\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\";\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 | \"success\"\n | \"success-darkBackground\"\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 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 * * `100`: 14px\n * * `200`: 16px\n * * `300`: 18px\n * * `400`: 20px\n * * `500`: 23px\n * * `600`: 26px\n * * `700`: 29px\n * * `800`: 33px\n * * `900`: 37px\n * * `1000`: 41px\n * * `1100`: 46px\n *\n * Desktop (viewport width > 480px):\n * * `100`: 13px\n * * `200`: 16px\n * * `300`: 20px\n * * `400`: 25px\n * * `500`: 31px\n * * `600`: 39px\n * * `700`: 49px\n * * `800`: 61px\n * * `900`: 76px\n * * `1000`: 95px\n * * `1100`: 119px\n *\n * @defaultValue 200\n */\n size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 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 )}\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_t1t27_1\",\"sansSerif\":\"_sansSerif_t1t27_22\",\"serif\":\"_serif_t1t27_27\",\"size100\":\"_size100_t1t27_71\",\"size200\":\"_size200_t1t27_75\",\"size300\":\"_size300_t1t27_79\",\"size400\":\"_size400_t1t27_83\",\"size500\":\"_size500_t1t27_87\",\"size600\":\"_size600_t1t27_91\",\"size700\":\"_size700_t1t27_95\",\"size800\":\"_size800_t1t27_99\",\"size900\":\"_size900_t1t27_103\",\"size1000\":\"_size1000_t1t27_144\",\"size1100\":\"_size1100_t1t27_148\",\"center\":\"_center_t1t27_154\",\"forceLeft\":\"_forceLeft_t1t27_158\",\"forceRight\":\"_forceRight_t1t27_162\",\"start\":\"_start_t1t27_166\",\"end\":\"_end_t1t27_170\",\"regular\":\"_regular_t1t27_176\",\"medium\":\"_medium_t1t27_180\",\"semiBold\":\"_semiBold_t1t27_184\",\"bold\":\"_bold_t1t27_188\",\"underline\":\"_underline_t1t27_192\",\"inline\":\"_inline_t1t27_196\",\"uppercase\":\"_uppercase_t1t27_200\",\"lineClamp\":\"_lineClamp_t1t27_204\"}"],"mappings":";;;;;;AAAA,OAAO,gBAAgB;AACvB,SAAS,kBAAqD;;;ACDsC,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,aAAY,uBAAsB,SAAQ,mBAAkB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,WAAU,sBAAqB,YAAW,uBAAsB,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,uBAAsB;;;ADyLl7B;AApLJ,SAAS,UACP,OAUQ;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,IAErB;AACE,aAAO,sBAAY;AAAA,EACvB;AACF;AAKA,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,MAC9B;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"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./TZGJS522.js";
|
|
5
5
|
import {
|
|
6
6
|
IconButton_default
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./MEOMWLNG.js";
|
|
8
8
|
import {
|
|
9
9
|
padding_module_default
|
|
10
10
|
} from "./ZOWOFYUE.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
AriaModal,
|
|
158
158
|
ModalDialog_default
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=
|
|
160
|
+
//# sourceMappingURL=2LV4KJ5U.js.map
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _6BULM4PLcjs = require('./6BULM4PL.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _L2CARKP7cjs = require('./L2CARKP7.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _S77S5MVXcjs = require('./S77S5MVX.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _76LTWV2Qcjs = require('./76LTWV2Q.cjs');
|
|
@@ -19,19 +19,19 @@ var _3UEOKPM2cjs = require('./3UEOKPM2.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _NXQTDCKYcjs = require('./NXQTDCKY.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _JHUEQO5Qcjs = require('./JHUEQO5Q.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _QVR3OSXWcjs = require('./QVR3OSXW.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var _DB7KX3J2cjs = require('./DB7KX3J2.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _XCGRNBQHcjs = require('./XCGRNBQH.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
var _K4AUV2VKcjs = require('./K4AUV2VK.cjs');
|
|
@@ -77,8 +77,7 @@ function RichSelectList(props) {
|
|
|
77
77
|
placeholderText,
|
|
78
78
|
selectTextValue,
|
|
79
79
|
selectedValues: selectedValuesProp,
|
|
80
|
-
defaultSelectedValues: defaultSelectedValuesProp
|
|
81
|
-
size = "md"
|
|
80
|
+
defaultSelectedValues: defaultSelectedValuesProp
|
|
82
81
|
} = _a, richSelectBoxProps = _X2SDR4SDcjs.__objRest.call(void 0, _a, [
|
|
83
82
|
"autosave",
|
|
84
83
|
"children",
|
|
@@ -93,8 +92,7 @@ function RichSelectList(props) {
|
|
|
93
92
|
"placeholderText",
|
|
94
93
|
"selectTextValue",
|
|
95
94
|
"selectedValues",
|
|
96
|
-
"defaultSelectedValues"
|
|
97
|
-
"size"
|
|
95
|
+
"defaultSelectedValues"
|
|
98
96
|
]);
|
|
99
97
|
const reactId = _react.useId.call(void 0, );
|
|
100
98
|
const inputId = id != null ? id : reactId;
|
|
@@ -102,11 +100,11 @@ function RichSelectList(props) {
|
|
|
102
100
|
const disabled = !isHydrated || disabledProp;
|
|
103
101
|
const overlayHandlerRef = _react.useRef.call(void 0, {});
|
|
104
102
|
const selectedKeysProp = _react.useMemo.call(void 0,
|
|
105
|
-
() =>
|
|
103
|
+
() => _6BULM4PLcjs.convertSelection.call(void 0, selectedValuesProp),
|
|
106
104
|
[selectedValuesProp]
|
|
107
105
|
);
|
|
108
106
|
const defaultSelectedKeys = _react.useMemo.call(void 0,
|
|
109
|
-
() =>
|
|
107
|
+
() => _6BULM4PLcjs.convertSelection.call(void 0, defaultSelectedValuesProp, /* @__PURE__ */ new Set()),
|
|
110
108
|
[defaultSelectedValuesProp]
|
|
111
109
|
);
|
|
112
110
|
const [selectedKeys, setSelectedKeys] = _utils.useControlledState.call(void 0,
|
|
@@ -144,7 +142,7 @@ function RichSelectList(props) {
|
|
|
144
142
|
_reactariacomponents.Provider,
|
|
145
143
|
{
|
|
146
144
|
values: [
|
|
147
|
-
[
|
|
145
|
+
[_6BULM4PLcjs.RichSelectBoxContext, { autoFocus: true }],
|
|
148
146
|
[_76LTWV2Qcjs.DialogContext, { padding: autosave ? void 0 : 0 }]
|
|
149
147
|
// this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided
|
|
150
148
|
],
|
|
@@ -168,11 +166,11 @@ function RichSelectList(props) {
|
|
|
168
166
|
(_a2 = fieldRef.current) == null ? void 0 : _a2.focus();
|
|
169
167
|
_interactions.setInteractionModality.call(void 0, "keyboard");
|
|
170
168
|
},
|
|
171
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DB7KX3J2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
169
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DB7KX3J2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _XCGRNBQHcjs.Typography_default, { size: 100, color: "gray700", children: label }) })
|
|
172
170
|
})
|
|
173
171
|
) }),
|
|
174
172
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
175
|
-
|
|
173
|
+
_S77S5MVXcjs.Popover_default,
|
|
176
174
|
{
|
|
177
175
|
ref: overlayHandlerRef,
|
|
178
176
|
disabled,
|
|
@@ -184,7 +182,7 @@ function RichSelectList(props) {
|
|
|
184
182
|
padding: autosave ? void 0 : 5,
|
|
185
183
|
dangerouslySetInlineStyle: autosave ? void 0 : { __style: { paddingBottom: 0 } },
|
|
186
184
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
187
|
-
|
|
185
|
+
_6BULM4PLcjs.RichSelectBox_default,
|
|
188
186
|
_X2SDR4SDcjs.__spreadProps.call(void 0, _X2SDR4SDcjs.__spreadValues.call(void 0, {
|
|
189
187
|
autosave,
|
|
190
188
|
selectedValues: selectedKeys,
|
|
@@ -207,7 +205,7 @@ function RichSelectList(props) {
|
|
|
207
205
|
rounding: "md"
|
|
208
206
|
}, fieldProps), {
|
|
209
207
|
ref: fieldRef,
|
|
210
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: SelectList_module_default.selectWrapper,
|
|
208
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: SelectList_module_default.selectWrapper, children: [
|
|
211
209
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
212
210
|
"div",
|
|
213
211
|
{
|
|
@@ -233,7 +231,7 @@ function RichSelectList(props) {
|
|
|
233
231
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
232
|
"path",
|
|
235
233
|
{
|
|
236
|
-
fill: errorText ?
|
|
234
|
+
fill: errorText ? _NXQTDCKYcjs.ColorBaseDestructive700 : _NXQTDCKYcjs.ColorBaseGray800,
|
|
237
235
|
d: "M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z"
|
|
238
236
|
}
|
|
239
237
|
)
|
|
@@ -245,7 +243,7 @@ function RichSelectList(props) {
|
|
|
245
243
|
}
|
|
246
244
|
),
|
|
247
245
|
(helperText || errorText) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _DB7KX3J2cjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
248
|
-
|
|
246
|
+
_XCGRNBQHcjs.Typography_default,
|
|
249
247
|
_X2SDR4SDcjs.__spreadProps.call(void 0, _X2SDR4SDcjs.__spreadValues.call(void 0, {
|
|
250
248
|
size: 100,
|
|
251
249
|
color: errorText ? "destructive-primary" : "gray700"
|
|
@@ -260,12 +258,12 @@ function RichSelectList(props) {
|
|
|
260
258
|
);
|
|
261
259
|
}
|
|
262
260
|
var RichSelectList_default = Object.assign(RichSelectList, {
|
|
263
|
-
Section:
|
|
264
|
-
Chip:
|
|
265
|
-
RadioButton:
|
|
261
|
+
Section: _JHUEQO5Qcjs.RichSelectSection_default,
|
|
262
|
+
Chip: _L2CARKP7cjs.RichSelectChip_default,
|
|
263
|
+
RadioButton: _QVR3OSXWcjs.RichSelectRadioButton_default
|
|
266
264
|
});
|
|
267
265
|
|
|
268
266
|
|
|
269
267
|
|
|
270
268
|
exports.RichSelectList_default = RichSelectList_default;
|
|
271
|
-
//# sourceMappingURL=
|
|
269
|
+
//# sourceMappingURL=36DIFAKH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/RichSelect/RichSelectList.tsx","css-module:../SelectList/SelectList.module.css#css-module"],"names":["_a"],"mappings":"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","sourcesContent":["import React, {\n type ReactElement,\n useMemo,\n type SyntheticEvent,\n useRef,\n useId,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray800,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport Popover from \"../Popover/Popover\";\nimport {\n Label as ReactAriaLabel,\n Provider as ReactAriaProvider,\n} from \"react-aria-components\";\nimport { useControlledState } from \"@react-stately/utils\";\nimport { setInteractionModality } from \"@react-aria/interactions\";\nimport { DialogContext } from \"../Dialog/Dialog\";\nimport styles from \"../SelectList/SelectList.module.css\";\nimport RichSelectBox, {\n RichSelectBoxContext,\n convertSelection,\n type RichSelectBoxProps,\n} from \"./RichSelectBox\";\nimport TapArea from \"../TapArea/TapArea\";\nimport { type OverlayHandlerRef } from \"../react-aria-utils/Triggerable\";\nimport Box from \"../Box/Box\";\nimport RichSelectSection from \"./RichSelectSection\";\nimport RichSelectChip from \"./RichSelectChip\";\nimport RichSelectRadioButton from \"./RichSelectRadioButton\";\nimport { useField } from \"react-aria\";\n\nconst NOOP = () => undefined;\n\nexport type RichSelectListProps = RichSelectBoxProps & {\n /** Test id for the select element */\n \"data-testid\"?: string;\n /**\n * Disables the select dropdown entirely\n * @defaultValue false\n */\n disabled?: boolean;\n /** Callback to be called when select is clicked */\n onClick?: (event: SyntheticEvent<HTMLDivElement>) => void;\n /** Text shown below select box if there is an input error. */\n errorText?: string;\n /** Text shown below select box */\n helperText?: string;\n /**\n * RichSelectList id, if not provided, a unique id will be generated\n */\n id?: string;\n /** Text shown above select box */\n label: string;\n /**\n * Text showing in select box if no option has been chosen.\n * There should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /** Use to render (override) text shown in the select box */\n selectTextValue?: (selectedValues?: \"all\" | string[]) => string | undefined;\n};\n\n/**\n * [RichSelectList](https://cambly-syntax.vercel.app/?path=/docs/components-richselectlist--docs) is a dropdown menu that allows users to select one or multiple options from a list.\n *\n * Example Usage:\n ```\n <RichSelectList\n label=\"My Label\"\n multiple\n onChange={() => { ... }}\n primaryButtonText=\"Save\"\n primaryButtonAccessibilityLabel=\"Save\"\n secondaryButtonText=\"Clear\"\n secondaryButtonAccessibilityLabel=\"Clear\"\n >\n <RichSelectList.Section label=\"Cities\">\n <RichSelectList.Chip label=\"San Francisco\" value=\"sf\" />\n <RichSelectList.Chip label=\"New York\" value=\"ny\" disabled />\n <RichSelectList.Chip label=\"Tulsa\" value=\"tulsa\" />\n <RichSelectList.Chip label=\"Chicago\" value=\"chicago\" disabled />\n </RichSelectList.Section>\n </RichSelectList>\n ```\n */\nfunction RichSelectList(props: RichSelectListProps): ReactElement {\n const {\n autosave,\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n label,\n id,\n onChange,\n onClick = NOOP,\n placeholderText,\n selectTextValue,\n selectedValues: selectedValuesProp,\n defaultSelectedValues: defaultSelectedValuesProp,\n ...richSelectBoxProps\n } = props;\n\n const reactId = useId();\n const inputId = id ?? reactId;\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n\n // passed to popover, which attached open/close methods\n const overlayHandlerRef = useRef<OverlayHandlerRef>({});\n\n const selectedKeysProp = useMemo(\n () => convertSelection(selectedValuesProp),\n [selectedValuesProp],\n );\n const defaultSelectedKeys = useMemo(\n () => convertSelection(defaultSelectedValuesProp, new Set()),\n [defaultSelectedValuesProp],\n );\n const [selectedKeys, setSelectedKeys] = useControlledState(\n selectedKeysProp!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- there is a bug in the typedef for useControlledState from react-stately. Internally they rely on value (first arg) able to be undefined\n defaultSelectedKeys,\n (value) => {\n const _value = value === \"all\" ? \"all\" : [...value].map(String);\n onChange(_value);\n if (!autosave) overlayHandlerRef.current.close?.();\n },\n );\n\n const selectedTextValue = useMemo(() => {\n if (selectTextValue)\n return (\n selectTextValue(\n selectedKeys === \"all\" ? \"all\" : [...selectedKeys].map(String),\n ) ?? placeholderText\n );\n if (selectedKeys === \"all\") return \"All selected\";\n if (selectedKeys.size) return `${selectedKeys.size} selected`;\n return placeholderText;\n }, [selectTextValue, selectedKeys, placeholderText]);\n\n const fieldRef = useRef<HTMLDivElement>(null);\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField({\n label, // this is the label for the select box\n description: helperText,\n errorMessage: errorText,\n });\n\n return (\n <ReactAriaProvider\n values={[\n [RichSelectBoxContext, { autoFocus: true }],\n [DialogContext, { padding: autosave ? undefined : 0 }], // this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided\n ]}\n >\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n onClick={onClick}\n >\n {label && (\n <>\n <ReactAriaLabel\n data-testid={[dataTestId, \"label\"].filter(Boolean).join(\"-\")}\n {...labelProps}\n onClick={() => {\n if (disabled) return;\n fieldRef.current?.focus();\n setInteractionModality(\"keyboard\"); // Show the focus ring so the user knows where focus went\n }}\n >\n <Box paddingX={1}>\n <Typography size={100} color=\"gray700\">\n {label}\n </Typography>\n </Box>\n </ReactAriaLabel>\n </>\n )}\n <Popover\n ref={overlayHandlerRef}\n disabled={disabled}\n content={\n // this Box wrapper is to reapply the padding that was stripped from popover's dialog to show the sticky save/close buttons. Ideally this could be avoided\n <Box\n padding={autosave ? undefined : 5}\n dangerouslySetInlineStyle={\n autosave ? undefined : { __style: { paddingBottom: 0 } }\n }\n >\n <RichSelectBox\n autosave={autosave}\n selectedValues={selectedKeys}\n defaultSelectedValues={defaultSelectedKeys}\n onChange={(selected) => setSelectedKeys(new Set(selected))}\n {...richSelectBoxProps}\n accessibilityLabel={inputId}\n >\n {children}\n </RichSelectBox>\n </Box>\n }\n >\n <TapArea\n data-testid={dataTestId}\n disabled={disabled}\n onClick={onClick}\n rounding=\"md\"\n {...fieldProps}\n ref={fieldRef}\n >\n <div className={styles.selectWrapper}>\n <div\n className={classNames(\n styles.selectBox,\n styles.selectBoxCambio,\n {\n [styles.unselected]:\n !errorText &&\n selectedKeys !== \"all\" &&\n !selectedKeys.size,\n [styles.selected]:\n !errorText &&\n (selectedKeys === \"all\" || selectedKeys.size),\n [styles.selectErrorCambio]: errorText,\n },\n )}\n >\n {selectedTextValue}\n </div>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={\n errorText ? ColorBaseDestructive700 : ColorBaseGray800\n }\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n </TapArea>\n </Popover>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : \"gray700\"}\n {...(errorText ? errorMessageProps : descriptionProps)}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n </ReactAriaProvider>\n );\n}\n\nexport default Object.assign(RichSelectList, {\n Section: RichSelectSection,\n Chip: RichSelectChip,\n RadioButton: RichSelectRadioButton,\n});\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1f379_1\",\"opacityOverlay\":\"_opacityOverlay_1f379_7\",\"selectWrapper\":\"_selectWrapper_1f379_11\",\"selectBox\":\"_selectBox_1f379_16\",\"selectBoxCambio\":\"_selectBoxCambio_1f379_32\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1f379_41\",\"unselected\":\"_unselected_1f379_46\",\"selected\":\"_selected_1f379_50\",\"arrowIcon\":\"_arrowIcon_1f379_54\",\"selectErrorCambio\":\"_selectErrorCambio_1f379_68\"}"]}
|