@cambly/syntax-core 10.15.0 → 10.17.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.cjs +5 -5
- package/dist/Avatar/Avatar.css +21 -13
- package/dist/Avatar/Avatar.css.map +1 -1
- package/dist/Avatar/Avatar.d.ts +2 -1
- package/dist/Avatar/Avatar.js +4 -4
- package/dist/AvatarGroup/AvatarGroup.cjs +4 -4
- package/dist/AvatarGroup/AvatarGroup.d.ts +2 -1
- package/dist/AvatarGroup/AvatarGroup.js +3 -3
- package/dist/Badge/Badge.cjs +5 -5
- package/dist/Badge/Badge.css +49 -48
- package/dist/Badge/Badge.css.map +1 -1
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +4 -4
- package/dist/Box/Box.cjs +3 -3
- package/dist/Box/Box.js +2 -2
- package/dist/Button/Button.cjs +5 -5
- package/dist/Button/Button.css +49 -48
- package/dist/Button/Button.css.map +1 -1
- package/dist/Button/Button.d.ts +0 -2
- package/dist/Button/Button.js +4 -4
- package/dist/ButtonGroup/ButtonGroup.cjs +3 -3
- package/dist/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +2 -2
- package/dist/Card/Card.cjs +4 -4
- package/dist/Card/Card.js +3 -3
- package/dist/Checkbox/Checkbox.cjs +4 -4
- package/dist/Checkbox/Checkbox.css +72 -65
- package/dist/Checkbox/Checkbox.css.map +1 -1
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Checkbox/Checkbox.js +3 -3
- package/dist/Chip/Chip.cjs +5 -5
- package/dist/Chip/Chip.css +49 -48
- package/dist/Chip/Chip.css.map +1 -1
- package/dist/Chip/Chip.js +4 -4
- package/dist/Dialog/Dialog.cjs +3 -2
- package/dist/Dialog/Dialog.js +2 -1
- package/dist/Dialog/ModalDialog.cjs +6 -6
- package/dist/Dialog/ModalDialog.js +5 -5
- package/dist/Divider/Divider.cjs +3 -3
- package/dist/Divider/Divider.js +2 -2
- package/dist/Heading/Heading.cjs +4 -4
- package/dist/Heading/Heading.css +49 -48
- package/dist/Heading/Heading.css.map +1 -1
- package/dist/Heading/Heading.d.ts +2 -2
- package/dist/Heading/Heading.js +3 -3
- package/dist/IconButton/IconButton.cjs +3 -3
- package/dist/IconButton/IconButton.js +2 -2
- package/dist/LinkButton/LinkButton.cjs +4 -4
- package/dist/LinkButton/LinkButton.css +49 -48
- package/dist/LinkButton/LinkButton.css.map +1 -1
- package/dist/LinkButton/LinkButton.js +3 -3
- package/dist/Modal/Layer.cjs +4 -4
- package/dist/Modal/Layer.js +3 -3
- package/dist/Modal/Modal.cjs +15 -7
- package/dist/Modal/Modal.css +249 -61
- package/dist/Modal/Modal.css.map +1 -1
- package/dist/Modal/Modal.d.ts +5 -1
- package/dist/Modal/Modal.js +14 -6
- package/dist/Popover/Popover.cjs +7 -7
- package/dist/Popover/Popover.js +6 -6
- package/dist/RadioButton/RadioButton.cjs +5 -5
- package/dist/RadioButton/RadioButton.css +49 -48
- package/dist/RadioButton/RadioButton.css.map +1 -1
- package/dist/RadioButton/RadioButton.d.ts +1 -1
- package/dist/RadioButton/RadioButton.js +4 -4
- package/dist/RichSelect/RichSelectBox.cjs +13 -13
- package/dist/RichSelect/RichSelectBox.css +49 -48
- package/dist/RichSelect/RichSelectBox.css.map +1 -1
- package/dist/RichSelect/RichSelectBox.d.ts +1 -1
- package/dist/RichSelect/RichSelectBox.js +12 -12
- package/dist/RichSelect/RichSelectChip.cjs +6 -6
- package/dist/RichSelect/RichSelectChip.css +49 -48
- package/dist/RichSelect/RichSelectChip.css.map +1 -1
- package/dist/RichSelect/RichSelectChip.js +5 -5
- package/dist/RichSelect/RichSelectList.cjs +19 -19
- package/dist/RichSelect/RichSelectList.css +67 -76
- package/dist/RichSelect/RichSelectList.css.map +1 -1
- package/dist/RichSelect/RichSelectList.d.ts +1 -1
- package/dist/RichSelect/RichSelectList.js +18 -18
- package/dist/RichSelect/RichSelectRadioButton.cjs +6 -6
- package/dist/RichSelect/RichSelectRadioButton.css +49 -48
- package/dist/RichSelect/RichSelectRadioButton.css.map +1 -1
- package/dist/RichSelect/RichSelectRadioButton.d.ts +1 -1
- package/dist/RichSelect/RichSelectRadioButton.js +5 -5
- package/dist/RichSelect/RichSelectSection.cjs +4 -4
- package/dist/RichSelect/RichSelectSection.css +49 -48
- package/dist/RichSelect/RichSelectSection.css.map +1 -1
- package/dist/RichSelect/RichSelectSection.js +3 -3
- package/dist/SelectList/SelectList.cjs +6 -6
- package/dist/SelectList/SelectList.css +67 -76
- package/dist/SelectList/SelectList.css.map +1 -1
- package/dist/SelectList/SelectList.js +5 -5
- package/dist/TapArea/TapArea.d.ts +1 -1
- package/dist/TextArea/TextArea.cjs +5 -5
- package/dist/TextArea/TextArea.css +76 -97
- package/dist/TextArea/TextArea.css.map +1 -1
- package/dist/TextArea/TextArea.js +4 -4
- package/dist/TextField/TextField.cjs +5 -5
- package/dist/TextField/TextField.css +69 -85
- package/dist/TextField/TextField.css.map +1 -1
- package/dist/TextField/TextField.js +4 -4
- package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
- package/dist/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/Tooltip/Tooltip.cjs +4 -4
- package/dist/Tooltip/Tooltip.css +49 -48
- 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 -48
- package/dist/Typography/Typography.css.map +1 -1
- package/dist/Typography/Typography.d.ts +5 -5
- package/dist/Typography/Typography.js +2 -2
- package/dist/__chunks/{YKGFFSWB.js → 22W7JX3C.js} +5 -4
- package/dist/__chunks/{YKGFFSWB.js.map → 22W7JX3C.js.map} +1 -1
- package/dist/__chunks/{2A52YKFW.js → 2RIIE7CU.js} +3 -3
- package/dist/__chunks/{2A52YKFW.js.map → 2RIIE7CU.js.map} +1 -1
- package/dist/__chunks/{W7GPAEHP.cjs → 2RKCTJBI.cjs} +5 -5
- package/dist/__chunks/{YLJDLIHH.cjs → 364LH7BQ.cjs} +56 -24
- package/dist/__chunks/364LH7BQ.cjs.map +1 -0
- package/dist/__chunks/{53RQSOUJ.js → 4K4SF7RI.js} +3 -3
- package/dist/__chunks/{E7G4CMBM.js → 4LCJJZPI.js} +3 -3
- package/dist/__chunks/{5T5R6ZMD.cjs → 4U2YGWTW.cjs} +9 -9
- package/dist/__chunks/4U2YGWTW.cjs.map +1 -0
- package/dist/__chunks/{VL5ONCQD.cjs → 577X7X3J.cjs} +6 -2
- package/dist/__chunks/577X7X3J.cjs.map +1 -0
- package/dist/__chunks/{KY6FT2UM.js → 5ODCKBUB.js} +8 -19
- package/dist/__chunks/5ODCKBUB.js.map +1 -0
- package/dist/__chunks/{UYZYKU2W.cjs → 5V4GT2NJ.cjs} +3 -3
- package/dist/__chunks/{CXD34CNP.cjs → 635VMAFB.cjs} +17 -14
- package/dist/__chunks/635VMAFB.cjs.map +1 -0
- package/dist/__chunks/{3P4HISCU.cjs → 762IDERQ.cjs} +7 -7
- package/dist/__chunks/{HMV2F4PF.js → 7NE5Y7AO.js} +10 -7
- package/dist/__chunks/7NE5Y7AO.js.map +1 -0
- package/dist/__chunks/{VOLO4QB4.cjs → 7W5OIL2Y.cjs} +27 -27
- package/dist/__chunks/7W5OIL2Y.cjs.map +1 -0
- package/dist/__chunks/{7TGECM7W.cjs → AL4ECXRL.cjs} +9 -5
- package/dist/__chunks/AL4ECXRL.cjs.map +1 -0
- package/dist/__chunks/{ZM7GAFGB.js → ATD7CPSD.js} +12 -12
- package/dist/__chunks/{ZM7GAFGB.js.map → ATD7CPSD.js.map} +1 -1
- package/dist/__chunks/{KCZFPTFK.js → ATVZZNGI.js} +8 -15
- package/dist/__chunks/ATVZZNGI.js.map +1 -0
- package/dist/__chunks/{53I23AHM.js → BA5NNKNL.js} +2 -2
- package/dist/__chunks/{JZ2Q7R2R.js → COW4SDSF.js} +2 -2
- package/dist/__chunks/{EVDDEHP3.cjs → CYMLBKRU.cjs} +5 -5
- package/dist/__chunks/{GBZPZQPJ.cjs → DC7G3PCP.cjs} +22 -13
- package/dist/__chunks/DC7G3PCP.cjs.map +1 -0
- package/dist/__chunks/{7CXOSI4M.js → DUANKQDU.js} +20 -11
- package/dist/__chunks/DUANKQDU.js.map +1 -0
- package/dist/__chunks/DV73RCNK.cjs +104 -0
- package/dist/__chunks/DV73RCNK.cjs.map +1 -0
- package/dist/__chunks/{A7AAGKC2.js → E5L5ZBOW.js} +6 -2
- package/dist/__chunks/E5L5ZBOW.js.map +1 -0
- package/dist/__chunks/{4SUKTRWG.cjs → EIR3V4AH.cjs} +11 -22
- package/dist/__chunks/EIR3V4AH.cjs.map +1 -0
- package/dist/__chunks/{POGPHQGU.cjs → ESGW3XTV.cjs} +8 -8
- package/dist/__chunks/{4FB7KTL3.js → HA4KAF7N.js} +2 -2
- package/dist/__chunks/{Z2MLFONW.js → HZ3IHMWC.js} +3 -3
- package/dist/__chunks/{GPW7ICYP.cjs → IAOEIH7U.cjs} +8 -8
- package/dist/__chunks/IAOEIH7U.cjs.map +1 -0
- package/dist/__chunks/{T5U2CKTE.js → IJNZIOML.js} +2 -2
- package/dist/__chunks/{FWQWL53Q.js → JGKRNONJ.js} +2 -2
- package/dist/__chunks/{AVW5DTQH.js → JI7DLER5.js} +1 -1
- package/dist/__chunks/{AVW5DTQH.js.map → JI7DLER5.js.map} +1 -1
- package/dist/__chunks/{YGKZCJF5.js → KU5UT5RY.js} +2 -2
- package/dist/__chunks/{IMYS42TL.cjs → OG4RH3QZ.cjs} +3 -3
- package/dist/__chunks/{WGRHH5TF.cjs → OWLMHTW5.cjs} +4 -4
- package/dist/__chunks/{WGRHH5TF.cjs.map → OWLMHTW5.cjs.map} +1 -1
- package/dist/__chunks/{D63KNAL7.js → P234RPXN.js} +4 -4
- package/dist/__chunks/{NFDOY7GE.cjs → Q3I37NS7.cjs} +3 -3
- package/dist/__chunks/{SI257QZE.cjs → Q57JA272.cjs} +11 -18
- package/dist/__chunks/Q57JA272.cjs.map +1 -0
- package/dist/__chunks/{3Y55NZKO.js → Q5GSB3Y5.js} +5 -5
- package/dist/__chunks/Q5GSB3Y5.js.map +1 -0
- package/dist/__chunks/{ZDDA4AKB.cjs → QTGWI2GM.cjs} +3 -3
- package/dist/__chunks/{UTSVZIEK.js → R4TBYKLS.js} +3 -3
- package/dist/__chunks/R4TBYKLS.js.map +1 -0
- package/dist/__chunks/{UEX6TGYL.js → S2VZE6RS.js} +3 -3
- package/dist/__chunks/{M2ABILBX.js → SCQYKMKB.js} +2 -2
- package/dist/__chunks/{MUNI4VXL.cjs → SDTI2RBA.cjs} +8 -7
- package/dist/__chunks/SDTI2RBA.cjs.map +1 -0
- package/dist/__chunks/{TN6NRPAZ.js → SEFHKYBL.js} +48 -16
- package/dist/__chunks/SEFHKYBL.js.map +1 -0
- package/dist/__chunks/{N3BJ3EYD.js → SLPY6EZY.js} +2 -2
- package/dist/__chunks/{27K33DEM.cjs → SNYEHXDA.cjs} +3 -3
- package/dist/__chunks/{OXXXLEUD.cjs → SXABWYV4.cjs} +5 -5
- package/dist/__chunks/{4TWU6PQA.cjs → T75E3KPP.cjs} +18 -18
- package/dist/__chunks/{6W5WRS53.cjs → TBQR2FPS.cjs} +1 -4
- package/dist/__chunks/TBQR2FPS.cjs.map +1 -0
- package/dist/__chunks/{C2JXAQM4.cjs → TIGQFIK5.cjs} +1 -1
- package/dist/__chunks/{C2JXAQM4.cjs.map → TIGQFIK5.cjs.map} +1 -1
- package/dist/__chunks/TLVOHYPL.js +104 -0
- package/dist/__chunks/TLVOHYPL.js.map +1 -0
- package/dist/__chunks/{VDAYXRSA.cjs → UD4IRT6U.cjs} +3 -3
- package/dist/__chunks/{XYAY2TL4.cjs → ULHGK75R.cjs} +5 -5
- package/dist/__chunks/{P3JJQI6N.cjs → VBQTLO2P.cjs} +3 -3
- package/dist/__chunks/{I5HC6BIK.cjs → VW7HLULP.cjs} +3 -3
- package/dist/__chunks/{NKWR4CYF.js → YAL24M7H.js} +6 -6
- package/dist/__chunks/YAL24M7H.js.map +1 -0
- package/dist/__chunks/{REUQRJFK.js → YHHU5RSR.js} +8 -4
- package/dist/__chunks/YHHU5RSR.js.map +1 -0
- package/dist/__chunks/{LLI3KZAR.cjs → ZIBKOWAK.cjs} +5 -5
- package/dist/__chunks/ZIBKOWAK.cjs.map +1 -0
- package/dist/__chunks/{PX3OQSL4.js → ZOWJFE7W.js} +8 -8
- package/dist/__chunks/{FY4WHNNR.js → ZSHAHV4F.js} +1 -4
- package/dist/__chunks/ZSHAHV4F.js.map +1 -0
- package/dist/__chunks/{GHPZTFQK.js → ZWTXIPP3.js} +6 -6
- package/dist/index.cjs +32 -32
- package/dist/index.css +148 -168
- package/dist/index.css.map +1 -1
- package/dist/index.js +31 -31
- package/package.json +1 -1
- package/dist/__chunks/3Y55NZKO.js.map +0 -1
- package/dist/__chunks/4SUKTRWG.cjs.map +0 -1
- package/dist/__chunks/5T5R6ZMD.cjs.map +0 -1
- package/dist/__chunks/6W5WRS53.cjs.map +0 -1
- package/dist/__chunks/7CXOSI4M.js.map +0 -1
- package/dist/__chunks/7TGECM7W.cjs.map +0 -1
- package/dist/__chunks/A7AAGKC2.js.map +0 -1
- package/dist/__chunks/ARCUBQR4.js +0 -122
- package/dist/__chunks/ARCUBQR4.js.map +0 -1
- package/dist/__chunks/CXD34CNP.cjs.map +0 -1
- package/dist/__chunks/FY4WHNNR.js.map +0 -1
- package/dist/__chunks/GBZPZQPJ.cjs.map +0 -1
- package/dist/__chunks/GPW7ICYP.cjs.map +0 -1
- package/dist/__chunks/HMV2F4PF.js.map +0 -1
- package/dist/__chunks/KCZFPTFK.js.map +0 -1
- package/dist/__chunks/KY6FT2UM.js.map +0 -1
- package/dist/__chunks/LLI3KZAR.cjs.map +0 -1
- package/dist/__chunks/MUNI4VXL.cjs.map +0 -1
- package/dist/__chunks/NKWR4CYF.js.map +0 -1
- package/dist/__chunks/REUQRJFK.js.map +0 -1
- package/dist/__chunks/SI257QZE.cjs.map +0 -1
- package/dist/__chunks/TN6NRPAZ.js.map +0 -1
- package/dist/__chunks/UTSVZIEK.js.map +0 -1
- package/dist/__chunks/VL5ONCQD.cjs.map +0 -1
- package/dist/__chunks/VOLO4QB4.cjs.map +0 -1
- package/dist/__chunks/YLJDLIHH.cjs.map +0 -1
- package/dist/__chunks/ZFX4HW2P.cjs +0 -122
- package/dist/__chunks/ZFX4HW2P.cjs.map +0 -1
- /package/dist/__chunks/{W7GPAEHP.cjs.map → 2RKCTJBI.cjs.map} +0 -0
- /package/dist/__chunks/{53RQSOUJ.js.map → 4K4SF7RI.js.map} +0 -0
- /package/dist/__chunks/{E7G4CMBM.js.map → 4LCJJZPI.js.map} +0 -0
- /package/dist/__chunks/{UYZYKU2W.cjs.map → 5V4GT2NJ.cjs.map} +0 -0
- /package/dist/__chunks/{3P4HISCU.cjs.map → 762IDERQ.cjs.map} +0 -0
- /package/dist/__chunks/{53I23AHM.js.map → BA5NNKNL.js.map} +0 -0
- /package/dist/__chunks/{JZ2Q7R2R.js.map → COW4SDSF.js.map} +0 -0
- /package/dist/__chunks/{EVDDEHP3.cjs.map → CYMLBKRU.cjs.map} +0 -0
- /package/dist/__chunks/{POGPHQGU.cjs.map → ESGW3XTV.cjs.map} +0 -0
- /package/dist/__chunks/{4FB7KTL3.js.map → HA4KAF7N.js.map} +0 -0
- /package/dist/__chunks/{Z2MLFONW.js.map → HZ3IHMWC.js.map} +0 -0
- /package/dist/__chunks/{T5U2CKTE.js.map → IJNZIOML.js.map} +0 -0
- /package/dist/__chunks/{FWQWL53Q.js.map → JGKRNONJ.js.map} +0 -0
- /package/dist/__chunks/{YGKZCJF5.js.map → KU5UT5RY.js.map} +0 -0
- /package/dist/__chunks/{IMYS42TL.cjs.map → OG4RH3QZ.cjs.map} +0 -0
- /package/dist/__chunks/{D63KNAL7.js.map → P234RPXN.js.map} +0 -0
- /package/dist/__chunks/{NFDOY7GE.cjs.map → Q3I37NS7.cjs.map} +0 -0
- /package/dist/__chunks/{ZDDA4AKB.cjs.map → QTGWI2GM.cjs.map} +0 -0
- /package/dist/__chunks/{UEX6TGYL.js.map → S2VZE6RS.js.map} +0 -0
- /package/dist/__chunks/{M2ABILBX.js.map → SCQYKMKB.js.map} +0 -0
- /package/dist/__chunks/{N3BJ3EYD.js.map → SLPY6EZY.js.map} +0 -0
- /package/dist/__chunks/{27K33DEM.cjs.map → SNYEHXDA.cjs.map} +0 -0
- /package/dist/__chunks/{OXXXLEUD.cjs.map → SXABWYV4.cjs.map} +0 -0
- /package/dist/__chunks/{4TWU6PQA.cjs.map → T75E3KPP.cjs.map} +0 -0
- /package/dist/__chunks/{VDAYXRSA.cjs.map → UD4IRT6U.cjs.map} +0 -0
- /package/dist/__chunks/{XYAY2TL4.cjs.map → ULHGK75R.cjs.map} +0 -0
- /package/dist/__chunks/{P3JJQI6N.cjs.map → VBQTLO2P.cjs.map} +0 -0
- /package/dist/__chunks/{I5HC6BIK.cjs.map → VW7HLULP.cjs.map} +0 -0
- /package/dist/__chunks/{PX3OQSL4.js.map → ZOWJFE7W.js.map} +0 -0
- /package/dist/__chunks/{GHPZTFQK.js.map → ZWTXIPP3.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Modal/Modal.tsx","css-module:./Modal.module.css#css-module"],"sourcesContent":["import { type ReactElement } from \"react\";\nimport classnames from \"classnames\";\n\nimport Heading from \"../Heading/Heading\";\nimport Box from \"../Box/Box\";\n\nimport FocusTrap from \"./FocusTrap\";\nimport StopScroll from \"./StopScroll\";\nimport Layer from \"./Layer\";\nimport styles from \"./Modal.module.css\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\nfunction XIcon({ color = \"#000\" }: { color?: string }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill={color}>\n <path\n fill=\"inherit\"\n d=\"M11.25.758a.83.83 0 0 0-1.175 0L6 4.825 1.925.75A.83.83 0 1 0 .75 1.925L4.825 6 .75 10.075a.83.83 0 1 0 1.175 1.175L6 7.175l4.075 4.075a.83.83 0 1 0 1.175-1.175L7.175 6l4.075-4.075a.835.835 0 0 0 0-1.167Z\"\n />\n </svg>\n );\n}\n\n// Note: Only sm + lg size currently. design thinks there should only be two sizes.\n// If there IS a md size at some point, we should use the \"size\" const.\nconst sizeWidth = {\n sm: 400,\n lg: 600,\n} as const;\n\n/**\n * [Modal](https://cambly-syntax.vercel.app/?path=/docs/components-modal--docs) is a dialog that appears on top of the main content and locks user interaction within the modal.\n *\n ```\n const [showModal, setShowModal] = useState(false)\n\n return (\n <>\n {showModal && <Modal\n header=\"header text\"\n onDismiss={() => setShowModal(false)}\n footer={\n <>\n <Button\n text=\"Cancel\"\n color=\"secondary\"\n onClick={() => {}}\n />\n <Button\n text=\"Confirm\"\n onClick={() => {}}\n />\n </>\n }\n >\n <Typography>\n Body text goes here!\n </Typography>\n </Modal> }\n </>\n )\n ```\n */\nexport default function Modal({\n header,\n children,\n image,\n onDismiss,\n footer,\n accessibilityCloseLabel = \"close modal\",\n size = \"sm\",\n zIndex = 1,\n \"data-testid\": dataTestId,\n}: {\n /**\n * The modal's main content. Should typically take in `Typography`'d text.\n */\n children: JSX.Element;\n /**\n * The header inside a modal as a string.\n */\n header: string;\n /**\n * What the X button (or clicking out of the modal area) does.\n * Typically used for closing the Modal\n */\n onDismiss: () => void;\n /**\n * The optional image rendered above the Modal.\n * Image size should be 400w x 200h.\n * If images aren't that sized, should ask design to give another image.\n */\n image?: JSX.Element;\n /**\n * The footer for the bottom area of the Modal. Typically used for rendering buttons.\n * * Use Syntax `Button` and pass it into footer.\n * * If one button, just pass it in. If two, wrap in a React fragment (`<> </>`)\n * * If two(2) buttons, put primary button _second_.\n *\n <>\n <Button\n text=\"Cancel\"\n color=\"secondary\"\n onClick={() => {}}\n />\n <Button\n text=\"Confirm\"\n onClick={() => {}}\n />\n </>\n */\n footer?: JSX.Element;\n /**\n * The accessibilty text on the close button.\n * (Sets the aria-label of the button)\n *\n *\n * @defaultValue close modal\n */\n accessibilityCloseLabel?: string;\n /**\n * The size of the card\n *\n * * `sm`: 400px\n * * `lg`: 600px\n *\n *\n * @defaultValue sm\n */\n size?: keyof typeof sizeWidth;\n /**\n * The z-index for the modal.\n * Typically used if there are other things on the page with higher z-index and you need this overlayed on top.\n *\n * @defaultValue 0\n */\n zIndex?: number;\n /**\n * Test id for the modal\n */\n \"data-testid\"?: string;\n}): ReactElement {\n const { themeName } = useTheme();\n return (\n <Layer zIndex={zIndex}>\n <StopScroll>\n <FocusTrap>\n <div\n className={classnames(\n styles.backdrop,\n themeName === \"classic\"\n ? styles.backdropClassic\n : styles.backdropCambio,\n )}\n role=\"presentation\"\n onClick={(e) => e.target === e.currentTarget && onDismiss()}\n onKeyDown={(e) => e.key === \"Escape\" && onDismiss()}\n >\n <Box\n data-testid={dataTestId}\n backgroundColor=\"white\"\n rounding=\"xl\"\n display=\"flex\"\n direction=\"column\"\n minWidth={240}\n maxWidth={sizeWidth[size]}\n width=\"100%\"\n dangerouslySetInlineStyle={{ __style: { overflow: \"hidden\" } }}\n >\n <Box position=\"relative\">\n <button\n aria-label={accessibilityCloseLabel}\n type=\"button\"\n className={classnames(\n styles.closeButton,\n themeName === \"classic\"\n ? styles.closeButtonClassic\n : styles.closeButtonCambio,\n {\n [styles.closeButtonWithImage]:\n !!image && themeName === \"classic\",\n },\n )}\n onClick={onDismiss}\n >\n <XIcon\n color={image && themeName === \"classic\" ? \"#fff\" : \"#000\"}\n />\n </button>\n </Box>\n {image && <Box maxHeight={200}>{image}</Box>}\n <Box\n display=\"flex\"\n gap={3}\n direction=\"column\"\n padding={themeName === \"classic\" ? 9 : 3}\n >\n <Heading\n as=\"h1\"\n size={themeName === \"classic\" ? 500 : 400}\n fontStyle={themeName === \"classic\" ? \"sans-serif\" : \"serif\"}\n >\n {header}\n </Heading>\n <Box marginBottom={themeName === \"classic\" ? 4 : 0}>\n {children}\n </Box>\n {footer && (\n <Box\n display=\"flex\"\n direction=\"column\"\n gap={3}\n smDirection=\"row\"\n smJustifyContent=\"end\"\n lgDirection=\"row\"\n lgJustifyContent=\"end\"\n >\n {footer}\n </Box>\n )}\n </Box>\n </Box>\n </div>\n </FocusTrap>\n </StopScroll>\n </Layer>\n );\n}\n\nModal.displayName = \"Modal\";\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Modal/Modal.module.css\"; export default {\"backdrop\":\"_backdrop_tqzb0_1\",\"backdropClassic\":\"_backdropClassic_tqzb0_11\",\"backdropCambio\":\"_backdropCambio_tqzb0_15\",\"closeButton\":\"_closeButton_tqzb0_19\",\"closeButtonClassic\":\"_closeButtonClassic_tqzb0_34\",\"closeButtonCambio\":\"_closeButtonCambio_tqzb0_41\",\"closeButtonWithImage\":\"_closeButtonWithImage_tqzb0_53\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,gBAAgB;;;ACDmE,IAAO,uBAAQ,EAAC,YAAW,qBAAoB,mBAAkB,6BAA4B,kBAAiB,4BAA2B,eAAc,yBAAwB,sBAAqB,gCAA+B,qBAAoB,+BAA8B,wBAAuB,iCAAgC;;;ADeha,cAgLQ,YAhLR;AAHN,SAAS,MAAM,EAAE,QAAQ,OAAO,GAAuB;AACrD,SACE,oBAAC,SAAI,OAAM,8BAA6B,OAAM,MAAK,QAAO,MAAK,MAAM,OACnE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;AAIA,IAAM,YAAY;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN;AAmCe,SAAR,MAAuB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,0BAA0B;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,eAAe;AACjB,GAoEiB;AACf,QAAM,EAAE,UAAU,IAAI,SAAS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W,cAAc,YAAY,eAAe;AAAA,sBAEnD;AAAA;AAAA,kBACH;AAAA,kBACA,oBAAC,eAAI,cAAc,cAAc,YAAY,IAAI,GAC9C,UACH;AAAA,kBACC,UACC;AAAA,oBAAC;AAAA;AAAA,sBACC,SAAQ;AAAA,sBACR,WAAU;AAAA,sBACV,KAAK;AAAA,sBACL,aAAY;AAAA,sBACZ,kBAAiB;AAAA,sBACjB,aAAY;AAAA,sBACZ,kBAAiB;AAAA,sBAEhB;AAAA;AAAA,kBACH;AAAA;AAAA;AAAA,YAEJ;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF,GACF,GACF;AAEJ;AAEA,MAAM,cAAc;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/AvatarGroup/AvatarGroup.tsx"],"sourcesContent":["import {\n type ReactNode,\n createContext,\n useContext,\n type ReactElement,\n} from \"react\";\nimport Box from \"../Box/Box\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\ntype Size =\n | \"sm\"\n | \"md\"\n | \"lg\"\n /* `xl` is deprecated and mapped to `lg` in Cambio */\n | \"xl\";\ntype Orientation = \"standard\" | \"reverse\";\n\ntype AvatarGroupContextType = {\n size: Size;\n orientation: Orientation;\n};\n\nconst AvatarGroupContext = createContext<AvatarGroupContextType | null>(null);\n\nexport function useAvatarGroup(): AvatarGroupContextType | null {\n const context = useContext(AvatarGroupContext);\n return !context ? null : context;\n}\n\n/**\n * [AvatarGroup](https://cambly-syntax.vercel.app/?path=/docs/components-avatargroup--docs) is a stack of avatars to represent a group of people\n *\n * Pass in Avatar components as children to the AvatarGroup component. The size prop that is passed into the AvatarGroup component will override Avatar's size prop..\n *\n * Usage:\n *\n * <AvatarGroup size=\"xl\" orientation=\"standard\">\n * <Avatar accessibilityLabel=\"Joseph Liotta\" src=\"image.png\" />\n * <Avatar accessibilityLabel=\"Joseph Liotta\" src=\"image.png\" />\n * <Avatar accessibilityLabel=\"Joseph Liotta\" src=\"image.png\" />\n * </AvatarGroup>\n *\n */\nexport default function AvatarGroup({\n size = \"md\",\n orientation = \"standard\",\n children,\n}: {\n /**\n * Size of the avatars in the AvatarGroup.\n *\n * Classic:\n * * `sm`: 24px\n * * `md`: 40px\n * * `lg`: 72px\n * * `xl`: 128px\n *\n * Cambio:\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n * * `xl`: 64px (deprecated, maps to `lg` in Cambio)\n *\n * @defaultValue `md`\n */\n size?: Size;\n /**\n * Orientation of the AvatarGroup.\n * This describes the order of rendering of the Avatar components.\n * Standard renders the Avatar components with the right component on top.\n * Reverse renders the Avatar components with the left component on top.\n *\n * @defaultValue `standard`\n */\n orientation?: Orientation;\n /**\n * Avatars to be rendered within the AvatarGroup.\n */\n children: ReactNode;\n}): ReactElement {\n const { themeName } = useTheme();\n const parsedSize = themeName === \"cambio\" && size === \"xl\" ? \"lg\" : size;\n\n return (\n <AvatarGroupContext.Provider value={{ size: parsedSize, orientation }}>\n <Box\n display=\"flex\"\n justifyContent={orientation === \"standard\" ? \"start\" : \"end\"}\n dangerouslySetInlineStyle={{\n __style: {\n flexDirection: orientation === \"standard\" ? \"row\" : \"row-reverse\",\n },\n }}\n >\n {children}\n </Box>\n </AvatarGroupContext.Provider>\n );\n}\n\nAvatarGroup.displayName = \"AvatarGroup\";\n"],"mappings":";;;;;;;;;AAAA;AAAA,EAEE;AAAA,EACA;AAAA,OAEK;AAgFD;AA/DN,IAAM,qBAAqB,cAA6C,IAAI;AAErE,SAAS,iBAAgD;AAC9D,QAAM,UAAU,WAAW,kBAAkB;AAC7C,SAAO,CAAC,UAAU,OAAO;AAC3B;AAgBe,SAAR,YAA6B;AAAA,EAClC,OAAO;AAAA,EACP,cAAc;AAAA,EACd;AACF,GAgCiB;AACf,QAAM,EAAE,UAAU,IAAI,SAAS;AAC/B,QAAM,aAAa,cAAc,YAAY,SAAS,OAAO,OAAO;AAEpE,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,EAAE,MAAM,YAAY,YAAY,GAClE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,gBAAgB,gBAAgB,aAAa,UAAU;AAAA,MACvD,2BAA2B;AAAA,QACzB,SAAS;AAAA,UACP,eAAe,gBAAgB,aAAa,QAAQ;AAAA,QACtD;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH,GACF;AAEJ;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Dialog/Dialog.tsx","css-module:../elevation/elevation.module.css#css-module","css-module:./Dialog.module.css#css-module"],"names":["Dialog"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO;AAAA,EAEL;AAAA,EAEA;AAAA,OAEK;;;ACN2F,IAAO,2BAAQ,EAAC,yBAAwB,iCAAgC;;;ACA9E,IAAO,wBAAQ,EAAC,UAAS,kBAAiB;;;AFctI,SAAS,UAAU,uBAAuB;AAC1C,OAAO,gBAAgB;AA4DnB;AA5CJ,IAAM,iBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,gBAA+C;AAAA,EACnD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAMO,IAAM,gBAAgB,MAAM,cAAiC,CAAC,CAAC;AActE,IAAM,SAAS,WAAwC,SAASA,QAC9D,OACA,KACc;AACd,QAAM;AAAA,IACJ,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,OAAO;AAAA,EACT,IAAI;AAEJ,QAAM,EAAE,QAAQ,IAAI,WAAW,aAAa;AAE5C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa;AAAA,MAGb,cAAY;AAAA,MACZ,WAAW,WAAW;AAAA,QACpB,mBAAU;AAAA,QACV,mBAAU;AAAA,QACV,mBAAU;AAAA,QACV,mBAAU;AAAA,QACV,mBAAU;AAAA,QACV,mBAAU;AAAA,QACV,sBAAY;AAAA,QACZ,uBAAc,WAAW,4BAAW,cAAc,IAAI,GAAG;AAAA,QACzD,uBAAc,WAAW,4BAAW,cAAc,IAAI,GAAG;AAAA,QACzD,wBAAe,WAAW,eAAe,IAAI,GAAG;AAAA,QAChD,yBAAgB;AAAA,QAChB,sBAAa;AAAA,QACb,sBAAa;AAAA,QACb,sBAAO;AAAA,MACT,CAAC;AAAA,MAEA;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,iBAAQ","sourcesContent":["import React, {\n type ReactNode,\n forwardRef,\n type ReactElement,\n useContext,\n type ComponentProps,\n} from \"react\";\nimport colorStyles from \"../colors/colors.module.css\";\nimport elevationStyles from \"../elevation/elevation.module.css\";\nimport layoutStyles from \"../layout.module.css\";\nimport paddingStyles from \"../Box/padding.module.css\";\nimport roundingStyles from \"../rounding.module.css\";\nimport boxStyles from \"../Box/Box.module.css\";\nimport styles from \"./Dialog.module.css\";\nimport { Dialog as ReactAriaDialog } from \"react-aria-components\";\nimport classNames from \"classnames\";\nimport type Box from \"../Box/Box\";\n\ntype DialogSize = \"sm\" | \"md\" | \"lg\";\ntype DialogRounding = \"lg\" | \"xl\";\nexport type DialogProps = {\n /** Test id for the floating dialog */\n \"data-testid\"?: string;\n /** aria-label for the dialog */\n accessibilityLabel?: string;\n /** Content to be shown inside the dialog. */\n children?: ReactNode;\n /** Optional size of the dialog box */\n size?: DialogSize;\n};\n\nconst sizeToRounding: Record<DialogSize, DialogRounding> = {\n sm: \"lg\",\n md: \"lg\",\n lg: \"xl\",\n};\n\nconst sizeToPadding: Record<DialogSize, 4 | 5 | 6> = {\n sm: 4,\n md: 5,\n lg: 6,\n};\n\ntype DialogContextType = {\n /** padding of dialog content. overrides \\\"size\\\" prop's padding\" */\n padding?: ComponentProps<typeof Box>[\"padding\"];\n};\nexport const DialogContext = React.createContext<DialogContextType>({});\n\n/**\n * Dialog is a display component for showing content in Popovers, Modals, etc...\n *\n * Example Usage:\n ```\n <Dialog accessibilityLabel=\"Select some options\">\n <Box padding={2} maxWidth={400}>\n ... some content goes here\n </Box>\n </Dialog>\n ```\n */\nconst Dialog = forwardRef<HTMLDivElement, DialogProps>(function Dialog(\n props,\n ref,\n): ReactElement {\n const {\n \"data-testid\": dataTestId,\n accessibilityLabel,\n children,\n size = \"md\",\n } = props;\n\n const { padding } = useContext(DialogContext);\n\n return (\n <ReactAriaDialog\n ref={ref}\n data-testid={dataTestId}\n // first thing screen reader reads\n // e.g. \"<this was the label prop>, dialog, 4 items...\"\n aria-label={accessibilityLabel}\n className={classNames([\n boxStyles.box,\n boxStyles.flex,\n boxStyles.column,\n boxStyles.gap4,\n boxStyles.relative,\n boxStyles.overflowauto,\n colorStyles.whiteBackgroundColor,\n paddingStyles[`paddingX${padding ?? sizeToPadding[size]}`],\n paddingStyles[`paddingY${padding ?? sizeToPadding[size]}`],\n roundingStyles[`rounding${sizeToRounding[size]}`],\n elevationStyles.elevation400BoxShadow,\n layoutStyles.fullMaxHeight,\n layoutStyles.visibilityVisible,\n styles.dialog,\n ])}\n >\n {children}\n </ReactAriaDialog>\n );\n});\n\nexport default Dialog;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/elevation/elevation.module.css\"; export default {\"elevation400BoxShadow\":\"_elevation400BoxShadow_vw6sp_1\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Dialog/Dialog.module.css\"; export default {\"dialog\":\"_dialog_1bme6_1\"}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/RichSelect/RichSelectList.tsx","css-module:../SelectList/SelectList.module.css#css-module"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AAQvB;AAAA,EACE,SAAS;AAAA,EACT,YAAY;AAAA,OACP;AACP,SAAS,0BAA0B;AACnC,SAA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,IAAI;AAAA,4BACtC;AAAA,8BACE,CAAC,0BAAO,UAAU,GAChB,CAAC,aACD,iBAAiB,SACjB,CAAC,aAAa;AAAA,8BAChB,CAAC,0BAAO,QAAQ,GACd,CAAC,cACA,iBAAiB,SAAS,aAAa;AAAA,8BAC1C,CAAC,cAAc,YACX,0BAAO,cACP,0BAAO,iBAAiB,GAAG;AAAA,4BACjC;AAAA,0BACF;AAAA,0BAEC;AAAA;AAAA,sBACH;AAAA,sBACA,oBAAC,SAAI,WAAW,0BAAO,WACrB;AAAA,wBAAC;AAAA;AAAA,0BACC,WAAU;AAAA,0BACV,eAAY;AAAA,0BACZ,SAAQ;AAAA,0BACR,OAAO,SAAS,IAAI;AAAA,0BAEpB;AAAA,4BAAC;AAAA;AAAA,8BACC,MACE,YAAY,0BAA0B;AAAA,8BAExC,GAAE;AAAA;AAAA,0BACJ;AAAA;AAAA,sBACF,GACF;AAAA,uBACF;AAAA;AAAA,gBACF;AAAA;AAAA,YACF;AAAA,aACE,cAAc,cACd,oBAAC,eAAI,UAAU,cAAc,YAAY,IAAI,GAC3C;AAAA,cAAC;AAAA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO,YAAY,wBAAwB;AAAA,iBACtC,YAAY,oBAAoB,mBAHtC;AAAA,gBAKE,sBAAY,YAAY;AAAA;AAAA,YAC3B,GACF;AAAA;AAAA;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,yBAAQ,OAAO,OAAO,gBAAgB;AAAA,EAC3C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AACf,CAAC","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\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\nconst NOOP = () => undefined;\n\nconst iconSize = {\n sm: 20,\n md: 24,\n lg: 24,\n} as const;\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 * Size of the select box\n *\n * @defaultValue \"md\"\n */\n size?: \"sm\" | \"md\" | \"lg\";\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 size = \"md\",\n ...richSelectBoxProps\n } = props;\n\n const reactId = useId();\n const inputId = id ?? reactId;\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const { themeName } = useTheme();\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 [styles.selectContainerCambio]: themeName === \"cambio\",\n })}\n >\n {label && (\n <>\n <ReactAriaLabel\n data-testid={[dataTestId, \"label\"].filter(Boolean).join(\"-\")}\n className={classNames(\n themeName === \"cambio\" && styles.labelCambio,\n )}\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={themeName === \"classic\" ? 1 : 3}>\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={size === \"lg\" ? \"lg\" : \"md\"}\n {...fieldProps}\n ref={fieldRef}\n >\n <div className={styles.selectWrapper}>\n <div\n className={classNames(\n styles.selectBox,\n themeName === \"classic\"\n ? styles.selectBoxClassic\n : styles.selectBoxCambio,\n themeName === \"classic\" && styles[size],\n {\n [styles.unselected]:\n !errorText &&\n selectedKeys !== \"all\" &&\n !selectedKeys.size,\n [styles.selected]:\n !errorText &&\n (selectedKeys === \"all\" || selectedKeys.size),\n [themeName === \"classic\"\n ? styles.selectError\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={iconSize[size]}\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={themeName === \"classic\" ? 1 : 0}>\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_hzvfu_1\",\"selectContainerCambio\":\"_selectContainerCambio_hzvfu_7\",\"opacityOverlay\":\"_opacityOverlay_hzvfu_11\",\"labelCambio\":\"_labelCambio_hzvfu_15\",\"selectWrapper\":\"_selectWrapper_hzvfu_26\",\"selectBox\":\"_selectBox_hzvfu_31\",\"selectBoxClassic\":\"_selectBoxClassic_hzvfu_47\",\"selectBoxCambio\":\"_selectBoxCambio_hzvfu_52\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_hzvfu_61\",\"unselected\":\"_unselected_hzvfu_66\",\"selected\":\"_selected_hzvfu_70\",\"arrowIcon\":\"_arrowIcon_hzvfu_74\",\"sm\":\"_sm_hzvfu_88\",\"md\":\"_md_hzvfu_94\",\"lg\":\"_lg_hzvfu_100\",\"selectError\":\"_selectError_hzvfu_106\",\"selectErrorCambio\":\"_selectErrorCambio_hzvfu_112\"}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Modal/Modal.tsx","css-module:./Modal.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,gBAAgB;;;ACDmE,IAAO,uBAAQ,EAAC,YAAW,qBAAoB,mBAAkB,6BAA4B,kBAAiB,4BAA2B,eAAc,yBAAwB,sBAAqB,gCAA+B,qBAAoB,+BAA8B,wBAAuB,iCAAgC;;;ADeha,cAgLQ,YAhLR;AAHN,SAAS,MAAM,EAAE,QAAQ,OAAO,GAAuB;AACrD,SACE,oBAAC,SAAI,OAAM,8BAA6B,OAAM,MAAK,QAAO,MAAK,MAAM,OACnE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,GAAE;AAAA;AAAA,EACJ,GACF;AAEJ;AAIA,IAAM,YAAY;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN;AAmCe,SAAR,MAAuB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,0BAA0B;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,eAAe;AACjB,GAoEiB;AACf,QAAM,EAAE,UAAU,IAAI,SAAS;AAC/B,SACE,oBAAC,SAAM,QACL,8BAAC,cACC,8BAAC,aACC;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT,q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GAC9C,UACH;AAAA,kBACC,UACC;AAAA,oBAAC;AAAA;AAAA,sBACC,SAAQ;AAAA,sBACR,WAAU;AAAA,sBACV,KAAK;AAAA,sBACL,aAAY;AAAA,sBACZ,kBAAiB;AAAA,sBACjB,aAAY;AAAA,sBACZ,kBAAiB;AAAA,sBAEhB;AAAA;AAAA,kBACH;AAAA;AAAA;AAAA,YAEJ;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF,GACF,GACF;AAEJ;AAEA,MAAM,cAAc","sourcesContent":["import { type ReactElement } from \"react\";\nimport classnames from \"classnames\";\n\nimport Heading from \"../Heading/Heading\";\nimport Box from \"../Box/Box\";\n\nimport FocusTrap from \"./FocusTrap\";\nimport StopScroll from \"./StopScroll\";\nimport Layer from \"./Layer\";\nimport styles from \"./Modal.module.css\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\nfunction XIcon({ color = \"#000\" }: { color?: string }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill={color}>\n <path\n fill=\"inherit\"\n d=\"M11.25.758a.83.83 0 0 0-1.175 0L6 4.825 1.925.75A.83.83 0 1 0 .75 1.925L4.825 6 .75 10.075a.83.83 0 1 0 1.175 1.175L6 7.175l4.075 4.075a.83.83 0 1 0 1.175-1.175L7.175 6l4.075-4.075a.835.835 0 0 0 0-1.167Z\"\n />\n </svg>\n );\n}\n\n// Note: Only sm + lg size currently. design thinks there should only be two sizes.\n// If there IS a md size at some point, we should use the \"size\" const.\nconst sizeWidth = {\n sm: 400,\n lg: 600,\n} as const;\n\n/**\n * [Modal](https://cambly-syntax.vercel.app/?path=/docs/components-modal--docs) is a dialog that appears on top of the main content and locks user interaction within the modal.\n *\n ```\n const [showModal, setShowModal] = useState(false)\n\n return (\n <>\n {showModal && <Modal\n header=\"header text\"\n onDismiss={() => setShowModal(false)}\n footer={\n <>\n <Button\n text=\"Cancel\"\n color=\"secondary\"\n onClick={() => {}}\n />\n <Button\n text=\"Confirm\"\n onClick={() => {}}\n />\n </>\n }\n >\n <Typography>\n Body text goes here!\n </Typography>\n </Modal> }\n </>\n )\n ```\n */\nexport default function Modal({\n header,\n children,\n image,\n onDismiss,\n footer,\n accessibilityCloseLabel = \"close modal\",\n size = \"sm\",\n zIndex = 1,\n \"data-testid\": dataTestId,\n}: {\n /**\n * The modal's main content. Should typically take in `Typography`'d text.\n */\n children: JSX.Element;\n /**\n * The header inside a modal as a string.\n */\n header: string;\n /**\n * What the X button (or clicking out of the modal area) does.\n * Typically used for closing the Modal\n */\n onDismiss: () => void;\n /**\n * The optional image rendered above the Modal.\n * Image size should be 400w x 200h.\n * If images aren't that sized, should ask design to give another image.\n */\n image?: JSX.Element;\n /**\n * The footer for the bottom area of the Modal. Typically used for rendering buttons.\n * * Use Syntax `Button` and pass it into footer.\n * * If one button, just pass it in. If two, wrap in a React fragment (`<> </>`)\n * * If two(2) buttons, put primary button _second_.\n *\n <>\n <Button\n text=\"Cancel\"\n color=\"secondary\"\n onClick={() => {}}\n />\n <Button\n text=\"Confirm\"\n onClick={() => {}}\n />\n </>\n */\n footer?: JSX.Element;\n /**\n * The accessibilty text on the close button.\n * (Sets the aria-label of the button)\n *\n *\n * @defaultValue close modal\n */\n accessibilityCloseLabel?: string;\n /**\n * The size of the card\n *\n * * `sm`: 400px\n * * `lg`: 600px\n *\n *\n * @defaultValue sm\n */\n size?: keyof typeof sizeWidth;\n /**\n * The z-index for the modal.\n * Typically used if there are other things on the page with higher z-index and you need this overlayed on top.\n *\n * @defaultValue 0\n */\n zIndex?: number;\n /**\n * Test id for the modal\n */\n \"data-testid\"?: string;\n}): ReactElement {\n const { themeName } = useTheme();\n return (\n <Layer zIndex={zIndex}>\n <StopScroll>\n <FocusTrap>\n <div\n className={classnames(\n styles.backdrop,\n themeName === \"classic\"\n ? styles.backdropClassic\n : styles.backdropCambio,\n )}\n role=\"presentation\"\n onClick={(e) => e.target === e.currentTarget && onDismiss()}\n onKeyDown={(e) => e.key === \"Escape\" && onDismiss()}\n >\n <Box\n data-testid={dataTestId}\n backgroundColor=\"white\"\n rounding=\"xl\"\n display=\"flex\"\n direction=\"column\"\n minWidth={240}\n maxWidth={sizeWidth[size]}\n width=\"100%\"\n dangerouslySetInlineStyle={{ __style: { overflow: \"hidden\" } }}\n >\n <Box position=\"relative\">\n <button\n aria-label={accessibilityCloseLabel}\n type=\"button\"\n className={classnames(\n styles.closeButton,\n themeName === \"classic\"\n ? styles.closeButtonClassic\n : styles.closeButtonCambio,\n {\n [styles.closeButtonWithImage]:\n !!image && themeName === \"classic\",\n },\n )}\n onClick={onDismiss}\n >\n <XIcon\n color={image && themeName === \"classic\" ? \"#fff\" : \"#000\"}\n />\n </button>\n </Box>\n {image && <Box maxHeight={200}>{image}</Box>}\n <Box\n display=\"flex\"\n gap={3}\n direction=\"column\"\n padding={themeName === \"classic\" ? 9 : 3}\n >\n <Heading\n as=\"h1\"\n size={themeName === \"classic\" ? 500 : 400}\n fontStyle={themeName === \"classic\" ? \"sans-serif\" : \"serif\"}\n >\n {header}\n </Heading>\n <Box marginBottom={themeName === \"classic\" ? 4 : 0}>\n {children}\n </Box>\n {footer && (\n <Box\n display=\"flex\"\n direction=\"column\"\n gap={3}\n smDirection=\"row\"\n smJustifyContent=\"end\"\n lgDirection=\"row\"\n lgJustifyContent=\"end\"\n >\n {footer}\n </Box>\n )}\n </Box>\n </Box>\n </div>\n </FocusTrap>\n </StopScroll>\n </Layer>\n );\n}\n\nModal.displayName = \"Modal\";\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Modal/Modal.module.css\"; export default {\"backdrop\":\"_backdrop_tqzb0_1\",\"backdropClassic\":\"_backdropClassic_tqzb0_11\",\"backdropCambio\":\"_backdropCambio_tqzb0_15\",\"closeButton\":\"_closeButton_tqzb0_19\",\"closeButtonClassic\":\"_closeButtonClassic_tqzb0_34\",\"closeButtonCambio\":\"_closeButtonCambio_tqzb0_41\",\"closeButtonWithImage\":\"_closeButtonWithImage_tqzb0_53\"}"]}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _27K33DEMcjs = require('./27K33DEM.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _WGRHH5TFcjs = require('./WGRHH5TF.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _6W5WRS53cjs = require('./6W5WRS53.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _K4AUV2VKcjs = require('./K4AUV2VK.cjs');
|
|
14
|
-
|
|
15
|
-
// src/TextArea/TextArea.tsx
|
|
16
|
-
var _react = require('react');
|
|
17
|
-
|
|
18
|
-
// css-module:./TextArea.module.css#css-module
|
|
19
|
-
var TextArea_module_default = { "textarea": "_textarea_1w1b8_1", "sm": "_sm_1w1b8_5", "md": "_md_1w1b8_10", "lg": "_lg_1w1b8_15", "textareaCambio": "_textareaCambio_1w1b8_20", "fixTextareaHeight": "_fixTextareaHeight_1w1b8_24", "labelCambio": "_labelCambio_1w1b8_28" };
|
|
20
|
-
|
|
21
|
-
// css-module:../TextField/TextField.module.css#css-module
|
|
22
|
-
var TextField_module_default = { "textfield": "_textfield_15iys_1", "textfieldClassic": "_textfieldClassic_15iys_10", "textfieldCambio": "_textfieldCambio_15iys_14", "label": "_label_15iys_29", "labelCambio": "_labelCambio_15iys_33", "labelCambioTextfield": "_labelCambioTextfield_15iys_42", "sm": "_sm_15iys_46", "smCambio": "_smCambio_15iys_53", "mdCambio": "_mdCambio_15iys_57", "lgCambio": "_lgCambio_15iys_61", "heightCambio": "_heightCambio_15iys_65", "smHeight": "_smHeight_15iys_69", "md": "_md_15iys_57", "mdHeight": "_mdHeight_15iys_80", "lg": "_lg_15iys_61", "lgHeight": "_lgHeight_15iys_91", "inputError": "_inputError_15iys_95", "inputErrorCambio": "_inputErrorCambio_15iys_105" };
|
|
23
|
-
|
|
24
|
-
// src/TextArea/TextArea.tsx
|
|
25
|
-
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
26
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
27
|
-
var TextArea = _react.forwardRef.call(void 0,
|
|
28
|
-
function TextArea2({
|
|
29
|
-
"data-testid": dataTestId,
|
|
30
|
-
disabled: disabledProp = false,
|
|
31
|
-
errorText = "",
|
|
32
|
-
helperText = "",
|
|
33
|
-
id,
|
|
34
|
-
label,
|
|
35
|
-
maxLength = 1024,
|
|
36
|
-
placeholder = "",
|
|
37
|
-
rows = 3,
|
|
38
|
-
size = "md",
|
|
39
|
-
value = "",
|
|
40
|
-
onChange
|
|
41
|
-
}, forwardedRef) {
|
|
42
|
-
const isHydrated = _K4AUV2VKcjs.useIsHydrated.call(void 0, );
|
|
43
|
-
const disabled = !isHydrated || disabledProp;
|
|
44
|
-
const reactId = _react.useId.call(void 0, );
|
|
45
|
-
const { themeName } = _6W5WRS53cjs.useTheme.call(void 0, );
|
|
46
|
-
const inputId = id != null ? id : reactId;
|
|
47
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
48
|
-
_27K33DEMcjs.Box_default,
|
|
49
|
-
{
|
|
50
|
-
display: "flex",
|
|
51
|
-
direction: "column",
|
|
52
|
-
gap: 2,
|
|
53
|
-
width: "100%",
|
|
54
|
-
dangerouslySetInlineStyle: {
|
|
55
|
-
__style: {
|
|
56
|
-
opacity: disabled ? 0.5 : 1
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
position: themeName === "cambio" ? "relative" : void 0,
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
62
|
-
"label",
|
|
63
|
-
{
|
|
64
|
-
className: _classnames2.default.call(void 0,
|
|
65
|
-
themeName === "classic" ? TextField_module_default.label : TextField_module_default.labelCambio,
|
|
66
|
-
themeName === "cambio" && TextArea_module_default.labelCambio
|
|
67
|
-
),
|
|
68
|
-
htmlFor: inputId,
|
|
69
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _27K33DEMcjs.Box_default, { paddingX: themeName === "classic" ? 1 : 3, width: "100%", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _WGRHH5TFcjs.Typography_default, { size: 100, color: "gray700", children: label }) })
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _WGRHH5TFcjs.Typography_default, { size: themeName === "cambio" ? 100 : 200, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: _classnames2.default.call(void 0,
|
|
76
|
-
themeName === "cambio" && TextArea_module_default.fixTextareaHeight
|
|
77
|
-
),
|
|
78
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
79
|
-
"textarea",
|
|
80
|
-
{
|
|
81
|
-
"data-testid": dataTestId,
|
|
82
|
-
ref: forwardedRef,
|
|
83
|
-
className: _classnames2.default.call(void 0,
|
|
84
|
-
TextField_module_default.textfield,
|
|
85
|
-
themeName === "classic" ? TextField_module_default.textfieldClassic : TextField_module_default.textfieldCambio,
|
|
86
|
-
themeName === "classic" && TextField_module_default[size],
|
|
87
|
-
themeName === "classic" && TextArea_module_default[size],
|
|
88
|
-
themeName === "classic" ? TextArea_module_default.textarea : TextArea_module_default.textareaCambio,
|
|
89
|
-
{
|
|
90
|
-
[themeName === "classic" ? TextField_module_default.inputError : TextField_module_default.inputErrorCambio]: errorText
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
id: inputId,
|
|
94
|
-
placeholder,
|
|
95
|
-
maxLength,
|
|
96
|
-
onChange,
|
|
97
|
-
rows,
|
|
98
|
-
value,
|
|
99
|
-
disabled
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
) }),
|
|
104
|
-
(helperText || errorText) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _27K33DEMcjs.Box_default, { paddingX: themeName === "classic" ? 1 : 0, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
105
|
-
_WGRHH5TFcjs.Typography_default,
|
|
106
|
-
{
|
|
107
|
-
size: 100,
|
|
108
|
-
color: errorText ? "destructive-primary" : "gray700",
|
|
109
|
-
children: errorText || helperText
|
|
110
|
-
}
|
|
111
|
-
) })
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
var TextArea_default = TextArea;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
exports.TextArea_default = TextArea_default;
|
|
122
|
-
//# sourceMappingURL=ZFX4HW2P.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TextArea/TextArea.tsx","css-module:./TextArea.module.css#css-module","css-module:../TextField/TextField.module.css#css-module"],"names":["TextArea"],"mappings":";;;;;;;;;;;;;;;AAEA,SAAmC,OAAO,kBAAkB;;;ACFoC,IAAO,0BAAQ,EAAC,YAAW,qBAAoB,MAAK,eAAc,MAAK,gBAAe,MAAK,gBAAe,kBAAiB,4BAA2B,qBAAoB,+BAA8B,eAAc,wBAAuB;;;ACA3O,IAAO,2BAAQ,EAAC,aAAY,sBAAqB,oBAAmB,8BAA6B,mBAAkB,6BAA4B,SAAQ,mBAAkB,eAAc,yBAAwB,wBAAuB,kCAAiC,MAAK,gBAAe,YAAW,sBAAqB,YAAW,sBAAqB,YAAW,sBAAqB,gBAAe,0BAAyB,YAAW,sBAAqB,MAAK,gBAAe,YAAW,sBAAqB,MAAK,gBAAe,YAAW,sBAAqB,cAAa,wBAAuB,oBAAmB,8BAA6B;;;AFKjuB,OAAO,gBAAgB;AAuFjB,SAsBM,KAtBN;AAzBN,IAAM,WAAW;AAAA,EACf,SAASA,UACP;AAAA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AAI;AAAA,oBACtC,cAAc,YACV,wBAAO,WACP,wBAAO;AAAA,oBACX;AAAA,sBACE,CAAC,cAAc,YACX,yBAAgB,aAChB,yBAAgB,gBAAgB,GAAG;AAAA,oBACzC;AAAA,kBACF;AAAA,kBACA,IAAI;AAAA,kBACJ;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA;AAAA,cACF;AAAA;AAAA,UACF,GACF;AAAA,WACE,cAAc,cACd,oBAAC,eAAI,UAAU,cAAc,YAAY,IAAI,GAC3C;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,OAAO,YAAY,wBAAwB;AAAA,cAE1C,uBAAa;AAAA;AAAA,UAChB,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,IAAO,mBAAQ","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\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\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 * Size of the TextArea. Defines the font size and padding.\n *\n * Cambio only supports `md`\n *\n * @defaultValue \"md\"\n */\n size?: \"sm\" | \"md\" | \"lg\";\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 size = \"md\",\n value = \"\",\n onChange,\n }: TextAreaProps,\n forwardedRef,\n ): ReactElement {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const reactId = useId();\n const { themeName } = useTheme();\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={themeName === \"cambio\" ? \"relative\" : undefined}\n >\n <label\n className={classNames(\n themeName === \"classic\"\n ? textFieldStyles.label\n : textFieldStyles.labelCambio,\n themeName === \"cambio\" && styles.labelCambio,\n )}\n htmlFor={inputId}\n >\n <Box paddingX={themeName === \"classic\" ? 1 : 3} width=\"100%\">\n <Typography size={100} color=\"gray700\">\n {label}\n </Typography>\n </Box>\n </label>\n <Typography size={themeName === \"cambio\" ? 100 : 200}>\n <div\n className={classNames(\n themeName === \"cambio\" && styles.fixTextareaHeight,\n )}\n >\n <textarea\n data-testid={dataTestId}\n ref={forwardedRef}\n className={classNames(\n textFieldStyles.textfield,\n themeName === \"classic\"\n ? textFieldStyles.textfieldClassic\n : textFieldStyles.textfieldCambio,\n themeName === \"classic\" && textFieldStyles[size],\n themeName === \"classic\" && styles[size],\n themeName === \"classic\"\n ? styles.textarea\n : styles.textareaCambio,\n {\n [themeName === \"classic\"\n ? textFieldStyles.inputError\n : textFieldStyles.inputErrorCambio]: 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 </div>\n </Typography>\n {(helperText || errorText) && (\n <Box paddingX={themeName === \"classic\" ? 1 : 0}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : \"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_1w1b8_1\",\"sm\":\"_sm_1w1b8_5\",\"md\":\"_md_1w1b8_10\",\"lg\":\"_lg_1w1b8_15\",\"textareaCambio\":\"_textareaCambio_1w1b8_20\",\"fixTextareaHeight\":\"_fixTextareaHeight_1w1b8_24\",\"labelCambio\":\"_labelCambio_1w1b8_28\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TextField/TextField.module.css\"; export default {\"textfield\":\"_textfield_15iys_1\",\"textfieldClassic\":\"_textfieldClassic_15iys_10\",\"textfieldCambio\":\"_textfieldCambio_15iys_14\",\"label\":\"_label_15iys_29\",\"labelCambio\":\"_labelCambio_15iys_33\",\"labelCambioTextfield\":\"_labelCambioTextfield_15iys_42\",\"sm\":\"_sm_15iys_46\",\"smCambio\":\"_smCambio_15iys_53\",\"mdCambio\":\"_mdCambio_15iys_57\",\"lgCambio\":\"_lgCambio_15iys_61\",\"heightCambio\":\"_heightCambio_15iys_65\",\"smHeight\":\"_smHeight_15iys_69\",\"md\":\"_md_15iys_57\",\"mdHeight\":\"_mdHeight_15iys_80\",\"lg\":\"_lg_15iys_61\",\"lgHeight\":\"_lgHeight_15iys_91\",\"inputError\":\"_inputError_15iys_95\",\"inputErrorCambio\":\"_inputErrorCambio_15iys_105\"}"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|