@cambly/syntax-core 18.2.0 → 18.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/Avatar.d.ts +1 -1
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Button/Button.cjs +3 -3
- package/dist/Button/Button.css +22 -22
- package/dist/Button/Button.css.map +1 -1
- package/dist/Button/Button.js +2 -2
- package/dist/Button/constants/iconSize.cjs +2 -2
- package/dist/Button/constants/iconSize.css +22 -22
- 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.d.ts +1 -1
- package/dist/Dialog/ModalDialog.cjs +4 -4
- package/dist/Dialog/ModalDialog.css +22 -22
- package/dist/Dialog/ModalDialog.css.map +1 -1
- package/dist/Dialog/ModalDialog.js +3 -3
- package/dist/Heading/Heading.d.ts +1 -1
- package/dist/IconButton/IconButton.cjs +3 -3
- package/dist/IconButton/IconButton.css +22 -22
- package/dist/IconButton/IconButton.css.map +1 -1
- package/dist/IconButton/IconButton.js +2 -2
- package/dist/LinkButton/LinkButton.cjs +3 -3
- package/dist/LinkButton/LinkButton.css +22 -22
- package/dist/LinkButton/LinkButton.css.map +1 -1
- package/dist/LinkButton/LinkButton.js +2 -2
- package/dist/Modal/Modal.cjs +4 -4
- package/dist/Modal/Modal.css +22 -22
- package/dist/Modal/Modal.css.map +1 -1
- package/dist/Modal/Modal.js +3 -3
- package/dist/Popover/Popover.cjs +5 -5
- package/dist/Popover/Popover.css +22 -22
- package/dist/Popover/Popover.css.map +1 -1
- package/dist/Popover/Popover.js +4 -4
- package/dist/RadioButton/RadioButton.d.ts +1 -1
- package/dist/RichSelect/RichSelectBox.cjs +4 -4
- package/dist/RichSelect/RichSelectBox.css +22 -22
- package/dist/RichSelect/RichSelectBox.css.map +1 -1
- package/dist/RichSelect/RichSelectBox.d.ts +1 -1
- package/dist/RichSelect/RichSelectBox.js +3 -3
- package/dist/RichSelect/RichSelectList.cjs +9 -9
- package/dist/RichSelect/RichSelectList.css +22 -22
- package/dist/RichSelect/RichSelectList.css.map +1 -1
- package/dist/RichSelect/RichSelectList.d.ts +1 -1
- package/dist/RichSelect/RichSelectList.js +8 -8
- package/dist/RichSelect/RichSelectRadioButton.d.ts +1 -1
- package/dist/SelectList/SelectList.cjs +3 -3
- package/dist/SelectList/SelectList.js +2 -2
- package/dist/TapArea/TapArea.d.ts +1 -1
- package/dist/Typography/Typography.d.ts +1 -1
- package/dist/__chunks/{32CNLC3O.cjs → 325VK7L2.cjs} +3 -3
- package/dist/__chunks/{WJMQX7BT.js → 3A6QVJ43.js} +2 -2
- package/dist/__chunks/{C22XFS4G.js → 42LZ6YP3.js} +2 -2
- package/dist/__chunks/{TGVUPAOJ.js → 572U5GX5.js} +2 -2
- package/dist/__chunks/{ABFXR32K.js → 5QPF5U2V.js} +3 -3
- package/dist/__chunks/{ABFXR32K.js.map → 5QPF5U2V.js.map} +1 -1
- package/dist/__chunks/{X6XQ2P7Y.cjs → 6JEGAMYW.cjs} +7 -7
- package/dist/__chunks/{X6XQ2P7Y.cjs.map → 6JEGAMYW.cjs.map} +1 -1
- package/dist/__chunks/{QFAVMHP7.cjs → 7ZSZT5AE.cjs} +1 -1
- package/dist/__chunks/{QFAVMHP7.cjs.map → 7ZSZT5AE.cjs.map} +1 -1
- package/dist/__chunks/{C56KH2IB.js → ASKKVHEA.js} +2 -2
- package/dist/__chunks/{ZGOHDWOB.cjs → DOYGRWJR.cjs} +4 -4
- package/dist/__chunks/{PL26LIZU.cjs → DX4XKSUL.cjs} +10 -10
- package/dist/__chunks/EGB44W5V.cjs +22 -0
- package/dist/__chunks/{4Y7TNMFL.cjs.map → EGB44W5V.cjs.map} +1 -1
- package/dist/__chunks/{IAPKNBLZ.js → GN5VNYV3.js} +3 -3
- package/dist/__chunks/{IAPKNBLZ.js.map → GN5VNYV3.js.map} +1 -1
- package/dist/__chunks/{F5FOZNTK.js → HPCC6K5T.js} +2 -2
- package/dist/__chunks/{GW6SAUW3.cjs → IBNQI7PM.cjs} +4 -4
- package/dist/__chunks/{DJ6I4764.js → JITGKYWW.js} +2 -2
- package/dist/__chunks/{T6HS7FEY.cjs → K4QY6POL.cjs} +7 -7
- package/dist/__chunks/{T6HS7FEY.cjs.map → K4QY6POL.cjs.map} +1 -1
- package/dist/__chunks/{FTXYKEQI.js → K6B6RNZA.js} +1 -1
- package/dist/__chunks/{FTXYKEQI.js.map → K6B6RNZA.js.map} +1 -1
- package/dist/__chunks/{WEOENL5J.cjs → KXPCTYHD.cjs} +3 -3
- package/dist/__chunks/{EGAJ7S43.js → NTIK3YXD.js} +4 -4
- package/dist/__chunks/TLUQZXLV.js +22 -0
- package/dist/__chunks/{EH75XYWO.js.map → TLUQZXLV.js.map} +1 -1
- package/dist/__chunks/{PN5H4EFM.cjs → XDQTI6T5.cjs} +3 -3
- package/dist/__chunks/{VCGJYZYA.cjs → YRFKC6UH.cjs} +3 -3
- package/dist/index.cjs +12 -12
- package/dist/index.css +22 -22
- package/dist/index.css.map +1 -1
- package/dist/index.js +11 -11
- package/package.json +3 -3
- package/dist/__chunks/4Y7TNMFL.cjs +0 -22
- package/dist/__chunks/EH75XYWO.js +0 -22
- /package/dist/__chunks/{32CNLC3O.cjs.map → 325VK7L2.cjs.map} +0 -0
- /package/dist/__chunks/{WJMQX7BT.js.map → 3A6QVJ43.js.map} +0 -0
- /package/dist/__chunks/{C22XFS4G.js.map → 42LZ6YP3.js.map} +0 -0
- /package/dist/__chunks/{TGVUPAOJ.js.map → 572U5GX5.js.map} +0 -0
- /package/dist/__chunks/{C56KH2IB.js.map → ASKKVHEA.js.map} +0 -0
- /package/dist/__chunks/{ZGOHDWOB.cjs.map → DOYGRWJR.cjs.map} +0 -0
- /package/dist/__chunks/{PL26LIZU.cjs.map → DX4XKSUL.cjs.map} +0 -0
- /package/dist/__chunks/{F5FOZNTK.js.map → HPCC6K5T.js.map} +0 -0
- /package/dist/__chunks/{GW6SAUW3.cjs.map → IBNQI7PM.cjs.map} +0 -0
- /package/dist/__chunks/{DJ6I4764.js.map → JITGKYWW.js.map} +0 -0
- /package/dist/__chunks/{WEOENL5J.cjs.map → KXPCTYHD.cjs.map} +0 -0
- /package/dist/__chunks/{EGAJ7S43.js.map → NTIK3YXD.js.map} +0 -0
- /package/dist/__chunks/{PN5H4EFM.cjs.map → XDQTI6T5.cjs.map} +0 -0
- /package/dist/__chunks/{VCGJYZYA.cjs.map → YRFKC6UH.cjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LinkButton/LinkButton.tsx","css-module:../Button/Button.module.css#css-module","css-module:./LinkButton.module.css#css-module"],"sourcesContent":["import {\n forwardRef,\n type HtmlHTMLAttributes,\n type ComponentProps,\n} from \"react\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport buttonStyles from \"../Button/Button.module.css\";\nimport {\n materialIconSize,\n internalIconSize,\n} from \"../Button/constants/iconSize\";\nimport textVariant from \"../Button/constants/textVariant\";\nimport loadingIconSize from \"../Button/constants/loadingIconSize\";\nimport styles from \"./LinkButton.module.css\";\nimport { backgroundColor } from \"../colors//backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype LinkButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The link that the LinkButton should route to.\n *\n */\n href?: string;\n /**\n * The target attribute specifies where to open the linked document.\n *\n */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n /**\n * The rel attribute specifies the relationship between the document and the link.\n *\n */\n rel?: HtmlHTMLAttributes<HTMLAnchorElement>[\"rel\"];\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * An optional onClick event. This is used for certain wrapper's support (such as react-router-dom).\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n};\n\n/**\n * [LinkButton](https://cambly-syntax.vercel.app/?path=/docs/components-linkbutton--docs) is a \"variation\" of Button that should look identical to Button, but should be used to render links instead.\n */\nconst LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n (\n {\n text,\n href,\n target,\n rel,\n \"data-testid\": dataTestId,\n color = \"primary\",\n size = \"md\",\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n }: LinkButtonProps,\n ref,\n ) => {\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n\n return (\n <a\n href={href}\n data-testid={dataTestId}\n target={target}\n ref={ref}\n rel={rel}\n className={classNames(\n styles.linkButton,\n buttonStyles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n buttonStyles[size],\n {\n [buttonStyles.fullWidth]: fullWidth,\n [styles.fitContent]: !fullWidth,\n [buttonStyles.buttonGap]: size === \"lg\" || size === \"md\",\n [buttonStyles.disabled]: loading,\n },\n )}\n onClick={onClick}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {!loading && text && (\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n // Temporary - until we have cambio colors on Typogrphay\n className={foregroundColorClass}\n >\n {text}\n </span>\n </Typography>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(buttonStyles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={buttonStyles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </a>\n );\n },\n);\n\nLinkButton.displayName = \"LinkButton\";\n\nexport default LinkButton;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"
|
|
1
|
+
{"version":3,"sources":["../../src/LinkButton/LinkButton.tsx","css-module:../Button/Button.module.css#css-module","css-module:./LinkButton.module.css#css-module"],"sourcesContent":["import {\n forwardRef,\n type HtmlHTMLAttributes,\n type ComponentProps,\n} from \"react\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport buttonStyles from \"../Button/Button.module.css\";\nimport {\n materialIconSize,\n internalIconSize,\n} from \"../Button/constants/iconSize\";\nimport textVariant from \"../Button/constants/textVariant\";\nimport loadingIconSize from \"../Button/constants/loadingIconSize\";\nimport styles from \"./LinkButton.module.css\";\nimport { backgroundColor } from \"../colors//backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype LinkButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The link that the LinkButton should route to.\n *\n */\n href?: string;\n /**\n * The target attribute specifies where to open the linked document.\n *\n */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n /**\n * The rel attribute specifies the relationship between the document and the link.\n *\n */\n rel?: HtmlHTMLAttributes<HTMLAnchorElement>[\"rel\"];\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * An optional onClick event. This is used for certain wrapper's support (such as react-router-dom).\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n};\n\n/**\n * [LinkButton](https://cambly-syntax.vercel.app/?path=/docs/components-linkbutton--docs) is a \"variation\" of Button that should look identical to Button, but should be used to render links instead.\n */\nconst LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n (\n {\n text,\n href,\n target,\n rel,\n \"data-testid\": dataTestId,\n color = \"primary\",\n size = \"md\",\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n }: LinkButtonProps,\n ref,\n ) => {\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n\n return (\n <a\n href={href}\n data-testid={dataTestId}\n target={target}\n ref={ref}\n rel={rel}\n className={classNames(\n styles.linkButton,\n buttonStyles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n buttonStyles[size],\n {\n [buttonStyles.fullWidth]: fullWidth,\n [styles.fitContent]: !fullWidth,\n [buttonStyles.buttonGap]: size === \"lg\" || size === \"md\",\n [buttonStyles.disabled]: loading,\n },\n )}\n onClick={onClick}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {!loading && text && (\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n // Temporary - until we have cambio colors on Typogrphay\n className={foregroundColorClass}\n >\n {text}\n </span>\n </Typography>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(buttonStyles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={buttonStyles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </a>\n );\n },\n);\n\nLinkButton.displayName = \"LinkButton\";\n\nexport default LinkButton;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"_button_17niw_1\",\"buttonGap\":\"_buttonGap_17niw_8\",\"disabled\":\"_disabled_17niw_42\",\"disabledPrimary\":\"_disabledPrimary_17niw_49\",\"fullWidth\":\"_fullWidth_17niw_53\",\"sm\":\"_sm_17niw_57\",\"md\":\"_md_17niw_64\",\"lg\":\"_lg_17niw_71\",\"icon\":\"_icon_17niw_78\",\"smIcon\":\"_smIcon_17niw_82\",\"mdIcon\":\"_mdIcon_17niw_89\",\"lgIcon\":\"_lgIcon_17niw_96\",\"loading\":\"_loading_17niw_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_17niw_1\",\"loadingCircle\":\"_loadingCircle_17niw_117\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/LinkButton/LinkButton.module.css\"; export default {\"linkButton\":\"_linkButton_1qjrb_1\",\"fitContent\":\"_fitContent_1qjrb_11\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,OAGK;AACP,OAAO,gBAAgB;;;ACLqE,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,aAAY,sBAAqB,YAAW,sBAAqB,mBAAkB,6BAA4B,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,QAAO,kBAAiB,UAAS,oBAAmB,UAAS,oBAAmB,UAAS,oBAAmB,WAAU,sBAAqB,6BAA4B,sCAAqC,iBAAgB,2BAA0B;;;ACAte,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,cAAa,uBAAsB;;;AFqIpL,SAuBI,KAvBJ;AAvBN,IAAM,aAAa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ACA,MAAM,iBAAiB,IAAI;AAAA;AAAA,UAC7B;AAAA,UAED,WACC;AAAA,YAAC;AAAA;AAAA,cACC,WAAW,WAAW,sBAAa,SAAS,oBAAoB;AAAA,cAChE,SAAQ;AAAA,cACR,OAAO,wBAAgB,IAAI;AAAA,cAC3B,QAAQ,wBAAgB,IAAI;AAAA,cAE5B;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,sBAAa;AAAA,kBACxB,IAAG;AAAA,kBACH,IAAG;AAAA,kBACH,GAAE;AAAA,kBACF,MAAK;AAAA,kBACL,aAAY;AAAA;AAAA,cACd;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AAEzB,IAAO,qBAAQ;","names":[]}
|
|
@@ -8,7 +8,7 @@ var _3P2PWHOUcjs = require('./3P2PWHOU.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _EGB44W5Vcjs = require('./EGB44W5V.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _LZYX5BWDcjs = require('./LZYX5BWD.cjs');
|
|
@@ -29,7 +29,7 @@ var _react = require('react');
|
|
|
29
29
|
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
30
30
|
|
|
31
31
|
// css-module:../Button/Button.module.css#css-module
|
|
32
|
-
var Button_module_default = { "button": "
|
|
32
|
+
var Button_module_default = { "button": "_button_17niw_1", "buttonGap": "_buttonGap_17niw_8", "disabled": "_disabled_17niw_42", "disabledPrimary": "_disabledPrimary_17niw_49", "fullWidth": "_fullWidth_17niw_53", "sm": "_sm_17niw_57", "md": "_md_17niw_64", "lg": "_lg_17niw_71", "icon": "_icon_17niw_78", "smIcon": "_smIcon_17niw_82", "mdIcon": "_mdIcon_17niw_89", "lgIcon": "_lgIcon_17niw_96", "loading": "_loading_17niw_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_17niw_1", "loadingCircle": "_loadingCircle_17niw_117" };
|
|
33
33
|
|
|
34
34
|
// css-module:./LinkButton.module.css#css-module
|
|
35
35
|
var LinkButton_module_default = { "linkButton": "_linkButton_1qjrb_1", "fitContent": "_fitContent_1qjrb_11" };
|
|
@@ -83,10 +83,10 @@ var LinkButton = _react.forwardRef.call(void 0,
|
|
|
83
83
|
{
|
|
84
84
|
className: _classnames2.default.call(void 0,
|
|
85
85
|
Button_module_default.icon,
|
|
86
|
-
|
|
86
|
+
_EGB44W5Vcjs.materialIconSize[size],
|
|
87
87
|
foregroundColorClass
|
|
88
88
|
),
|
|
89
|
-
size:
|
|
89
|
+
size: _EGB44W5Vcjs.internalIconSize[size]
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
92
|
!loading && text && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FEFAG4KTcjs.Typography_default, { size: _5JUNB754cjs.textVariant_default[size], weight: "medium", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -101,10 +101,10 @@ var LinkButton = _react.forwardRef.call(void 0,
|
|
|
101
101
|
{
|
|
102
102
|
className: _classnames2.default.call(void 0,
|
|
103
103
|
Button_module_default.icon,
|
|
104
|
-
|
|
104
|
+
_EGB44W5Vcjs.materialIconSize[size],
|
|
105
105
|
foregroundColorClass
|
|
106
106
|
),
|
|
107
|
-
size:
|
|
107
|
+
size: _EGB44W5Vcjs.internalIconSize[size]
|
|
108
108
|
}
|
|
109
109
|
),
|
|
110
110
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -138,4 +138,4 @@ var LinkButton_default = LinkButton;
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
exports.LinkButton_default = LinkButton_default;
|
|
141
|
-
//# sourceMappingURL=
|
|
141
|
+
//# sourceMappingURL=6JEGAMYW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LinkButton/LinkButton.tsx","css-module:../Button/Button.module.css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AEC;AAAA,WAAC,WAAW,aACX;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,sBAAa;AAAA,gBACb,iBAAiB,IAAI;AAAA,gBACrB;AAAA,cACF;AAAA,cACA,MAAM,iBAAiB,IAAI;AAAA;AAAA,UAC7B;AAAA,UAED,CAAC,WAAW,QACX,oBAAC,sBAAW,MAAM,oBAAY,IAAI,GAAG,QAAO,UAC1C;AAAA,YAAC;AAAA;AAAA,cAEC,WAAW;AAAA,cAEV;AAAA;AAAA,UACH,GACF;AAAA,UAED,CAAC,WAAW,WACX;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,sBAAa;AAAA,gBACb,iBAAiB,IAAI;AAAA,gBACrB;AAAA,cACF;AAAA,cACA,MAAM,iBAAiB,IAAI;AAAA;AAAA,UAC7B;AAAA,UAED,WACC;AAAA,YAAC;AAAA;AAAA,cACC,WAAW,WAAW,sBAAa,SAAS,oBAAoB;AAAA,cAChE,SAAQ;AAAA,cACR,OAAO,wBAAgB,IAAI;AAAA,cAC3B,QAAQ,wBAAgB,IAAI;AAAA,cAE5B;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,sBAAa;AAAA,kBACxB,IAAG;AAAA,kBACH,IAAG;AAAA,kBACH,GAAE;AAAA,kBACF,MAAK;AAAA,kBACL,aAAY;AAAA;AAAA,cACd;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AAEzB,IAAO,qBAAQ","sourcesContent":["import {\n forwardRef,\n type HtmlHTMLAttributes,\n type ComponentProps,\n} from \"react\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport buttonStyles from \"../Button/Button.module.css\";\nimport {\n materialIconSize,\n internalIconSize,\n} from \"../Button/constants/iconSize\";\nimport textVariant from \"../Button/constants/textVariant\";\nimport loadingIconSize from \"../Button/constants/loadingIconSize\";\nimport styles from \"./LinkButton.module.css\";\nimport { backgroundColor } from \"../colors//backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype LinkButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The link that the LinkButton should route to.\n *\n */\n href?: string;\n /**\n * The target attribute specifies where to open the linked document.\n *\n */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n /**\n * The rel attribute specifies the relationship between the document and the link.\n *\n */\n rel?: HtmlHTMLAttributes<HTMLAnchorElement>[\"rel\"];\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * An optional onClick event. This is used for certain wrapper's support (such as react-router-dom).\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n};\n\n/**\n * [LinkButton](https://cambly-syntax.vercel.app/?path=/docs/components-linkbutton--docs) is a \"variation\" of Button that should look identical to Button, but should be used to render links instead.\n */\nconst LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n (\n {\n text,\n href,\n target,\n rel,\n \"data-testid\": dataTestId,\n color = \"primary\",\n size = \"md\",\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n }: LinkButtonProps,\n ref,\n ) => {\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n\n return (\n <a\n href={href}\n data-testid={dataTestId}\n target={target}\n ref={ref}\n rel={rel}\n className={classNames(\n styles.linkButton,\n buttonStyles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n buttonStyles[size],\n {\n [buttonStyles.fullWidth]: fullWidth,\n [styles.fitContent]: !fullWidth,\n [buttonStyles.buttonGap]: size === \"lg\" || size === \"md\",\n [buttonStyles.disabled]: loading,\n },\n )}\n onClick={onClick}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {!loading && text && (\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n // Temporary - until we have cambio colors on Typogrphay\n className={foregroundColorClass}\n >\n {text}\n </span>\n </Typography>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(buttonStyles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={buttonStyles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </a>\n );\n },\n);\n\nLinkButton.displayName = \"LinkButton\";\n\nexport default LinkButton;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"
|
|
1
|
+
{"version":3,"sources":["../../src/LinkButton/LinkButton.tsx","css-module:../Button/Button.module.css#css-module","css-module:./LinkButton.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,OAGK;AACP,OAAO,gBAAgB;;;ACLqE,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,aAAY,sBAAqB,YAAW,sBAAqB,mBAAkB,6BAA4B,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,QAAO,kBAAiB,UAAS,oBAAmB,UAAS,oBAAmB,UAAS,oBAAmB,WAAU,sBAAqB,6BAA4B,sCAAqC,iBAAgB,2BAA0B;;;ACAte,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,cAAa,uBAAsB;;;AFqIpL,SAuBI,KAvBJ;AAvBN,IAAM,aAAa;AAAA,EACjB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,IACT,KAAK;AAAA,IACL;AAAA,EACF,GACA,QACG;AACH,UAAM,uBAAuB,gBAAgB,OAAO,EAAE;AACtD,UAAM,uBAAuB,gBAAgB,OAAO,EAAE;AAEtD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT,0BAAO;AAAA,UACP,sBAAa;AAAA,UACb;AAAA,UACA;AAAA,UACA,OAAO,OAAO,EAAE;AAAA,UAChB,sBAAa,IAAI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} from \"react\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport buttonStyles from \"../Button/Button.module.css\";\nimport {\n materialIconSize,\n internalIconSize,\n} from \"../Button/constants/iconSize\";\nimport textVariant from \"../Button/constants/textVariant\";\nimport loadingIconSize from \"../Button/constants/loadingIconSize\";\nimport styles from \"./LinkButton.module.css\";\nimport { backgroundColor } from \"../colors//backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype LinkButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The link that the LinkButton should route to.\n *\n */\n href?: string;\n /**\n * The target attribute specifies where to open the linked document.\n *\n */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n /**\n * The rel attribute specifies the relationship between the document and the link.\n *\n */\n rel?: HtmlHTMLAttributes<HTMLAnchorElement>[\"rel\"];\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * An optional onClick event. This is used for certain wrapper's support (such as react-router-dom).\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n};\n\n/**\n * [LinkButton](https://cambly-syntax.vercel.app/?path=/docs/components-linkbutton--docs) is a \"variation\" of Button that should look identical to Button, but should be used to render links instead.\n */\nconst LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(\n (\n {\n text,\n href,\n target,\n rel,\n \"data-testid\": dataTestId,\n color = \"primary\",\n size = \"md\",\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n }: LinkButtonProps,\n ref,\n ) => {\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n\n return (\n <a\n href={href}\n data-testid={dataTestId}\n target={target}\n ref={ref}\n rel={rel}\n className={classNames(\n styles.linkButton,\n buttonStyles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n buttonStyles[size],\n {\n [buttonStyles.fullWidth]: fullWidth,\n [styles.fitContent]: !fullWidth,\n [buttonStyles.buttonGap]: size === \"lg\" || size === \"md\",\n [buttonStyles.disabled]: loading,\n },\n )}\n onClick={onClick}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {!loading && text && (\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n // Temporary - until we have cambio colors on Typogrphay\n className={foregroundColorClass}\n >\n {text}\n </span>\n </Typography>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n buttonStyles.icon,\n materialIconSize[size],\n foregroundColorClass,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(buttonStyles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={buttonStyles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </a>\n );\n },\n);\n\nLinkButton.displayName = \"LinkButton\";\n\nexport default LinkButton;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"_button_17niw_1\",\"buttonGap\":\"_buttonGap_17niw_8\",\"disabled\":\"_disabled_17niw_42\",\"disabledPrimary\":\"_disabledPrimary_17niw_49\",\"fullWidth\":\"_fullWidth_17niw_53\",\"sm\":\"_sm_17niw_57\",\"md\":\"_md_17niw_64\",\"lg\":\"_lg_17niw_71\",\"icon\":\"_icon_17niw_78\",\"smIcon\":\"_smIcon_17niw_82\",\"mdIcon\":\"_mdIcon_17niw_89\",\"lgIcon\":\"_lgIcon_17niw_96\",\"loading\":\"_loading_17niw_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_17niw_1\",\"loadingCircle\":\"_loadingCircle_17niw_117\"}","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/LinkButton/LinkButton.module.css\"; export default {\"linkButton\":\"_linkButton_1qjrb_1\",\"fitContent\":\"_fitContent_1qjrb_11\"}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"names":[],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB","sourcesContent":["/**\n * Do not edit directly\n * Generated on
|
|
1
|
+
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"names":[],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB","sourcesContent":["/**\n * Do not edit directly\n * Generated on Tue, 16 Jul 2024 18:41:25 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 ColorCambioWhite40 = \"#ffffff\";\nexport const ColorCambioWhite70 = \"#ffffff\";\nexport const ColorCambioWhite100 = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray270 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#5e5952\";\nexport const ColorCambioGray800 = \"#363432\";\nexport const ColorCambioGray870 = \"#5e5952\";\nexport const ColorCambioGray900 = \"#262625\";\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\";\nexport const ShadowInteractive = \"0px 3px 16px 0px rgba(144, 134, 130, 0.05), 0px 2px 30px 0px rgba(144, 134, 130, 0.02)\";\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
Button_default
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./GN5VNYV3.js";
|
|
5
5
|
import {
|
|
6
6
|
Divider
|
|
7
7
|
} from "./YAZOHZLW.js";
|
|
@@ -208,4 +208,4 @@ export {
|
|
|
208
208
|
RichSelectBoxContext,
|
|
209
209
|
RichSelectBox_default
|
|
210
210
|
};
|
|
211
|
-
//# sourceMappingURL=
|
|
211
|
+
//# sourceMappingURL=ASKKVHEA.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _EGB44W5Vcjs = require('./EGB44W5V.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _LZYX5BWDcjs = require('./LZYX5BWD.cjs');
|
|
@@ -60,8 +60,8 @@ var IconButton = _react.forwardRef.call(void 0,
|
|
|
60
60
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
61
61
|
Icon,
|
|
62
62
|
{
|
|
63
|
-
className:
|
|
64
|
-
size:
|
|
63
|
+
className: _EGB44W5Vcjs.materialIconSize[size],
|
|
64
|
+
size: _EGB44W5Vcjs.internalIconSize[size]
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
}
|
|
@@ -74,4 +74,4 @@ var IconButton_default = IconButton;
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
exports.IconButton_default = IconButton_default;
|
|
77
|
-
//# sourceMappingURL=
|
|
77
|
+
//# sourceMappingURL=DOYGRWJR.cjs.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _325VK7L2cjs = require('./325VK7L2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _J27AGJQBcjs = require('./J27AGJQB.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _7ZSZT5AEcjs = require('./7ZSZT5AE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _IBNQI7PMcjs = require('./IBNQI7PM.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _I76WKOLEcjs = require('./I76WKOLE.cjs');
|
|
@@ -100,11 +100,11 @@ function RichSelectList(props) {
|
|
|
100
100
|
const disabled = !isHydrated || disabledProp;
|
|
101
101
|
const overlayHandlerRef = _react.useRef.call(void 0, {});
|
|
102
102
|
const selectedKeysProp = _react.useMemo.call(void 0,
|
|
103
|
-
() =>
|
|
103
|
+
() => _IBNQI7PMcjs.convertSelection.call(void 0, selectedValuesProp),
|
|
104
104
|
[selectedValuesProp]
|
|
105
105
|
);
|
|
106
106
|
const defaultSelectedKeys = _react.useMemo.call(void 0,
|
|
107
|
-
() =>
|
|
107
|
+
() => _IBNQI7PMcjs.convertSelection.call(void 0, defaultSelectedValuesProp, /* @__PURE__ */ new Set()),
|
|
108
108
|
[defaultSelectedValuesProp]
|
|
109
109
|
);
|
|
110
110
|
const [selectedKeys, setSelectedKeys] = _utils.useControlledState.call(void 0,
|
|
@@ -142,7 +142,7 @@ function RichSelectList(props) {
|
|
|
142
142
|
_reactariacomponents.Provider,
|
|
143
143
|
{
|
|
144
144
|
values: [
|
|
145
|
-
[
|
|
145
|
+
[_IBNQI7PMcjs.RichSelectBoxContext, { autoFocus: true }],
|
|
146
146
|
[_J27AGJQBcjs.DialogContext, { padding: autosave ? void 0 : 0 }]
|
|
147
147
|
// this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided
|
|
148
148
|
],
|
|
@@ -170,7 +170,7 @@ function RichSelectList(props) {
|
|
|
170
170
|
})
|
|
171
171
|
) }),
|
|
172
172
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
173
|
-
|
|
173
|
+
_325VK7L2cjs.Popover_default,
|
|
174
174
|
{
|
|
175
175
|
ref: overlayHandlerRef,
|
|
176
176
|
disabled,
|
|
@@ -183,7 +183,7 @@ function RichSelectList(props) {
|
|
|
183
183
|
dangerouslySetInlineStyle: autosave ? void 0 : { __style: { paddingBottom: 0 } },
|
|
184
184
|
role: "menu",
|
|
185
185
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
186
|
-
|
|
186
|
+
_IBNQI7PMcjs.RichSelectBox_default,
|
|
187
187
|
_X2SDR4SDcjs.__spreadProps.call(void 0, _X2SDR4SDcjs.__spreadValues.call(void 0, {
|
|
188
188
|
autosave,
|
|
189
189
|
selectedValues: selectedKeys,
|
|
@@ -232,7 +232,7 @@ function RichSelectList(props) {
|
|
|
232
232
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
233
|
"path",
|
|
234
234
|
{
|
|
235
|
-
fill: errorText ?
|
|
235
|
+
fill: errorText ? _7ZSZT5AEcjs.ColorBaseDestructive700 : _7ZSZT5AEcjs.ColorBaseGray800,
|
|
236
236
|
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"
|
|
237
237
|
}
|
|
238
238
|
)
|
|
@@ -267,4 +267,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
|
|
|
267
267
|
|
|
268
268
|
|
|
269
269
|
exports.RichSelectList_default = RichSelectList_default;
|
|
270
|
-
//# sourceMappingURL=
|
|
270
|
+
//# sourceMappingURL=DX4XKSUL.cjs.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
|
+
|
|
3
|
+
// css-module:../Button.module.css#css-module
|
|
4
|
+
var Button_module_default = { "button": "_button_17niw_1", "buttonGap": "_buttonGap_17niw_8", "disabled": "_disabled_17niw_42", "disabledPrimary": "_disabledPrimary_17niw_49", "fullWidth": "_fullWidth_17niw_53", "sm": "_sm_17niw_57", "md": "_md_17niw_64", "lg": "_lg_17niw_71", "icon": "_icon_17niw_78", "smIcon": "_smIcon_17niw_82", "mdIcon": "_mdIcon_17niw_89", "lgIcon": "_lgIcon_17niw_96", "loading": "_loading_17niw_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_17niw_1", "loadingCircle": "_loadingCircle_17niw_117" };
|
|
5
|
+
|
|
6
|
+
// src/Button/constants/iconSize.ts
|
|
7
|
+
var materialIconSize = {
|
|
8
|
+
sm: Button_module_default.smIcon,
|
|
9
|
+
md: Button_module_default.mdIcon,
|
|
10
|
+
lg: Button_module_default.lgIcon
|
|
11
|
+
};
|
|
12
|
+
var internalIconSize = {
|
|
13
|
+
sm: 100,
|
|
14
|
+
md: 200,
|
|
15
|
+
lg: 300
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.materialIconSize = materialIconSize; exports.internalIconSize = internalIconSize;
|
|
22
|
+
//# sourceMappingURL=EGB44W5V.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["css-module:../Button.module.css#css-module","../../src/Button/constants/iconSize.ts"],"names":[],"mappings":";;;AAA4F,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,aAAY,sBAAqB,YAAW,sBAAqB,mBAAkB,6BAA4B,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,QAAO,kBAAiB,UAAS,oBAAmB,UAAS,oBAAmB,UAAS,oBAAmB,WAAU,sBAAqB,6BAA4B,sCAAqC,iBAAgB,2BAA0B;;;ACEnkB,IAAM,mBAAmB;AAAA,EAC9B,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AACb;AAEO,IAAM,mBAAmB;AAAA,EAC9B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN","sourcesContent":["import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"
|
|
1
|
+
{"version":3,"sources":["css-module:../Button.module.css#css-module","../../src/Button/constants/iconSize.ts"],"names":[],"mappings":";;;AAA4F,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,aAAY,sBAAqB,YAAW,sBAAqB,mBAAkB,6BAA4B,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,QAAO,kBAAiB,UAAS,oBAAmB,UAAS,oBAAmB,UAAS,oBAAmB,WAAU,sBAAqB,6BAA4B,sCAAqC,iBAAgB,2BAA0B;;;ACEnkB,IAAM,mBAAmB;AAAA,EAC9B,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AACb;AAEO,IAAM,mBAAmB;AAAA,EAC9B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN","sourcesContent":["import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"_button_17niw_1\",\"buttonGap\":\"_buttonGap_17niw_8\",\"disabled\":\"_disabled_17niw_42\",\"disabledPrimary\":\"_disabledPrimary_17niw_49\",\"fullWidth\":\"_fullWidth_17niw_53\",\"sm\":\"_sm_17niw_57\",\"md\":\"_md_17niw_64\",\"lg\":\"_lg_17niw_71\",\"icon\":\"_icon_17niw_78\",\"smIcon\":\"_smIcon_17niw_82\",\"mdIcon\":\"_mdIcon_17niw_89\",\"lgIcon\":\"_lgIcon_17niw_96\",\"loading\":\"_loading_17niw_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_17niw_1\",\"loadingCircle\":\"_loadingCircle_17niw_117\"}","import styles from \"../Button.module.css\";\n\nexport const materialIconSize = {\n sm: styles.smIcon,\n md: styles.mdIcon,\n lg: styles.lgIcon,\n};\n\nexport const internalIconSize = {\n sm: 100,\n md: 200,\n lg: 300,\n} as const;\n"]}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
internalIconSize,
|
|
10
10
|
materialIconSize
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./TLUQZXLV.js";
|
|
12
12
|
import {
|
|
13
13
|
Box_default
|
|
14
14
|
} from "./65PMWIHY.js";
|
|
@@ -33,7 +33,7 @@ import { forwardRef } from "react";
|
|
|
33
33
|
import classNames from "classnames";
|
|
34
34
|
|
|
35
35
|
// css-module:./Button.module.css#css-module
|
|
36
|
-
var Button_module_default = { "button": "
|
|
36
|
+
var Button_module_default = { "button": "_button_17niw_1", "buttonGap": "_buttonGap_17niw_8", "disabled": "_disabled_17niw_42", "disabledPrimary": "_disabledPrimary_17niw_49", "fullWidth": "_fullWidth_17niw_53", "sm": "_sm_17niw_57", "md": "_md_17niw_64", "lg": "_lg_17niw_71", "icon": "_icon_17niw_78", "smIcon": "_smIcon_17niw_82", "mdIcon": "_mdIcon_17niw_89", "lgIcon": "_lgIcon_17niw_96", "loading": "_loading_17niw_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_17niw_1", "loadingCircle": "_loadingCircle_17niw_117" };
|
|
37
37
|
|
|
38
38
|
// src/Button/Button.tsx
|
|
39
39
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -146,4 +146,4 @@ var Button_default = Button;
|
|
|
146
146
|
export {
|
|
147
147
|
Button_default
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=
|
|
149
|
+
//# sourceMappingURL=GN5VNYV3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button/Button.tsx","css-module:./Button.module.css#css-module"],"sourcesContent":["import React, { forwardRef, type ComponentProps } from \"react\";\nimport classNames from \"classnames\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport { materialIconSize, internalIconSize } from \"./constants/iconSize\";\nimport textVariant from \"./constants/textVariant\";\nimport loadingIconSize from \"./constants/loadingIconSize\";\nimport styles from \"./Button.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport { backgroundColor } from \"../colors/backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype ButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The text to be displayed inside the button when it is in a loading state\n */\n loadingText?: string;\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n *\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the button will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * The callback to be called when the button is clicked\n */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /**\n * The tooltip to be displayed when the user hovers over the button\n */\n tooltip?: string;\n /**\n * The type you want to set for the primitive `<button/>`\n */\n type?: \"button\" | \"submit\" | \"reset\";\n};\n\n/**\n * [Button](https://cambly-syntax.vercel.app/?path=/docs/components-button--docs) is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n \"data-testid\": dataTestId,\n text,\n loadingText,\n color = \"primary\",\n size = \"md\",\n accessibilityLabel,\n disabled = false,\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n tooltip,\n type = \"button\",\n }: ButtonProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n const disabledPrimary = color === \"primary\" && disabled;\n const isDisabled = !isHydrated || disabled || loading;\n\n return (\n <button\n data-testid={dataTestId}\n ref={ref}\n aria-label={accessibilityLabel}\n type={type}\n title={tooltip}\n disabled={isDisabled}\n onClick={onClick}\n className={classNames(\n styles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n styles[size],\n {\n [styles.fullWidth]: fullWidth,\n [styles.buttonGap]: size === \"lg\" || size === \"md\",\n [styles.disabled]: isDisabled,\n },\n )}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {((loading && loadingText) || (!loading && text)) && (\n <Box paddingX={1}>\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n className={classNames(\n foregroundColorClass,\n disabledPrimary && styles.disabledPrimary,\n )}\n >\n {loading ? loadingText : text}\n </span>\n </Typography>\n </Box>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(styles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={styles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </button>\n );\n },\n);\n\nButton.displayName = \"Button\";\n\nexport default Button;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"
|
|
1
|
+
{"version":3,"sources":["../../src/Button/Button.tsx","css-module:./Button.module.css#css-module"],"sourcesContent":["import React, { forwardRef, type ComponentProps } from \"react\";\nimport classNames from \"classnames\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport { materialIconSize, internalIconSize } from \"./constants/iconSize\";\nimport textVariant from \"./constants/textVariant\";\nimport loadingIconSize from \"./constants/loadingIconSize\";\nimport styles from \"./Button.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport { backgroundColor } from \"../colors/backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype ButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The text to be displayed inside the button when it is in a loading state\n */\n loadingText?: string;\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n *\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the button will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * The callback to be called when the button is clicked\n */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /**\n * The tooltip to be displayed when the user hovers over the button\n */\n tooltip?: string;\n /**\n * The type you want to set for the primitive `<button/>`\n */\n type?: \"button\" | \"submit\" | \"reset\";\n};\n\n/**\n * [Button](https://cambly-syntax.vercel.app/?path=/docs/components-button--docs) is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n \"data-testid\": dataTestId,\n text,\n loadingText,\n color = \"primary\",\n size = \"md\",\n accessibilityLabel,\n disabled = false,\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n tooltip,\n type = \"button\",\n }: ButtonProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n const disabledPrimary = color === \"primary\" && disabled;\n const isDisabled = !isHydrated || disabled || loading;\n\n return (\n <button\n data-testid={dataTestId}\n ref={ref}\n aria-label={accessibilityLabel}\n type={type}\n title={tooltip}\n disabled={isDisabled}\n onClick={onClick}\n className={classNames(\n styles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n styles[size],\n {\n [styles.fullWidth]: fullWidth,\n [styles.buttonGap]: size === \"lg\" || size === \"md\",\n [styles.disabled]: isDisabled,\n },\n )}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {((loading && loadingText) || (!loading && text)) && (\n <Box paddingX={1}>\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n className={classNames(\n foregroundColorClass,\n disabledPrimary && styles.disabledPrimary,\n )}\n >\n {loading ? loadingText : text}\n </span>\n </Typography>\n </Box>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(styles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={styles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </button>\n );\n },\n);\n\nButton.displayName = \"Button\";\n\nexport default Button;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"_button_17niw_1\",\"buttonGap\":\"_buttonGap_17niw_8\",\"disabled\":\"_disabled_17niw_42\",\"disabledPrimary\":\"_disabledPrimary_17niw_49\",\"fullWidth\":\"_fullWidth_17niw_53\",\"sm\":\"_sm_17niw_57\",\"md\":\"_md_17niw_64\",\"lg\":\"_lg_17niw_71\",\"icon\":\"_icon_17niw_78\",\"smIcon\":\"_smIcon_17niw_82\",\"mdIcon\":\"_mdIcon_17niw_89\",\"lgIcon\":\"_lgIcon_17niw_96\",\"loading\":\"_loading_17niw_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_17niw_1\",\"loadingCircle\":\"_loadingCircle_17niw_117\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,kBAAuC;AACvD,OAAO,gBAAgB;;;ACDqE,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,aAAY,sBAAqB,YAAW,sBAAqB,mBAAkB,6BAA4B,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,QAAO,kBAAiB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zC,oBAAC,eAAI,UAAU,GACb,8BAAC,sBAAW,MAAM,oBAAY,IAAI,GAAG,QAAO,UAC1C;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,mBAAmB,sBAAO;AAAA,cAC5B;AAAA,cAEC,oBAAU,cAAc;AAAA;AAAA,UAC3B,GACF,GACF;AAAA,UAED,CAAC,WAAW,WACX;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,sBAAO;AAAA,gBACP,iBAAiB,IAAI;AAAA,gBACrB,mBAAmB,sBAAO;AAAA,cAC5B;AAAA,cACA,MAAM,iBAAiB,IAAI;AAAA;AAAA,UAC7B;AAAA,UAED,WACC;AAAA,YAAC;AAAA;AAAA,cACC,WAAW,WAAW,sBAAO,SAAS,oBAAoB;AAAA,cAC1D,SAAQ;AAAA,cACR,OAAO,wBAAgB,IAAI;AAAA,cAC3B,QAAQ,wBAAgB,IAAI;AAAA,cAE5B;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,sBAAO;AAAA,kBAClB,IAAG;AAAA,kBACH,IAAG;AAAA,kBACH,GAAE;AAAA,kBACF,MAAK;AAAA,kBACL,aAAY;AAAA;AAAA,cACd;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AAErB,IAAO,iBAAQ;","names":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ColorBaseDestructive700,
|
|
4
4
|
ColorBaseGray800
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./K6B6RNZA.js";
|
|
6
6
|
import {
|
|
7
7
|
Focus_module_default
|
|
8
8
|
} from "./KKADUD65.js";
|
|
@@ -136,4 +136,4 @@ SelectList.Option = SelectOption_default;
|
|
|
136
136
|
export {
|
|
137
137
|
SelectList
|
|
138
138
|
};
|
|
139
|
-
//# sourceMappingURL=
|
|
139
|
+
//# sourceMappingURL=HPCC6K5T.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _K4QY6POLcjs = require('./K4QY6POL.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _42SRFCQLcjs = require('./42SRFCQL.cjs');
|
|
@@ -169,7 +169,7 @@ var RichSelectBox = _react.forwardRef.call(void 0,
|
|
|
169
169
|
justifyContent: "end",
|
|
170
170
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _C5XPZTFOcjs.ButtonGroup_default, { orientation: "horizontal", children: [
|
|
171
171
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
172
|
-
|
|
172
|
+
_K4QY6POLcjs.Button_default,
|
|
173
173
|
{
|
|
174
174
|
onClick: clearChanges,
|
|
175
175
|
color: "secondary",
|
|
@@ -179,7 +179,7 @@ var RichSelectBox = _react.forwardRef.call(void 0,
|
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
181
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
182
|
-
|
|
182
|
+
_K4QY6POLcjs.Button_default,
|
|
183
183
|
{
|
|
184
184
|
onClick: saveChanges,
|
|
185
185
|
text: primaryButtonText,
|
|
@@ -208,4 +208,4 @@ var RichSelectBox_default = Object.assign(RichSelectBox, {
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
exports.convertSelection = convertSelection; exports.RichSelectBoxContext = RichSelectBoxContext; exports.RichSelectBox_default = RichSelectBox_default;
|
|
211
|
-
//# sourceMappingURL=
|
|
211
|
+
//# sourceMappingURL=IBNQI7PM.cjs.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
internalIconSize,
|
|
4
4
|
materialIconSize
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./TLUQZXLV.js";
|
|
6
6
|
import {
|
|
7
7
|
foregroundColor
|
|
8
8
|
} from "./VRJAMHSI.js";
|
|
@@ -74,4 +74,4 @@ var IconButton_default = IconButton;
|
|
|
74
74
|
export {
|
|
75
75
|
IconButton_default
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=
|
|
77
|
+
//# sourceMappingURL=JITGKYWW.js.map
|
|
@@ -8,7 +8,7 @@ var _3P2PWHOUcjs = require('./3P2PWHOU.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _EGB44W5Vcjs = require('./EGB44W5V.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _KJLBDAZHcjs = require('./KJLBDAZH.cjs');
|
|
@@ -33,7 +33,7 @@ var _react = require('react');
|
|
|
33
33
|
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
34
34
|
|
|
35
35
|
// css-module:./Button.module.css#css-module
|
|
36
|
-
var Button_module_default = { "button": "
|
|
36
|
+
var Button_module_default = { "button": "_button_17niw_1", "buttonGap": "_buttonGap_17niw_8", "disabled": "_disabled_17niw_42", "disabledPrimary": "_disabledPrimary_17niw_49", "fullWidth": "_fullWidth_17niw_53", "sm": "_sm_17niw_57", "md": "_md_17niw_64", "lg": "_lg_17niw_71", "icon": "_icon_17niw_78", "smIcon": "_smIcon_17niw_82", "mdIcon": "_mdIcon_17niw_89", "lgIcon": "_lgIcon_17niw_96", "loading": "_loading_17niw_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_17niw_1", "loadingCircle": "_loadingCircle_17niw_117" };
|
|
37
37
|
|
|
38
38
|
// src/Button/Button.tsx
|
|
39
39
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -88,10 +88,10 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
88
88
|
{
|
|
89
89
|
className: _classnames2.default.call(void 0,
|
|
90
90
|
Button_module_default.icon,
|
|
91
|
-
|
|
91
|
+
_EGB44W5Vcjs.materialIconSize[size],
|
|
92
92
|
disabledPrimary && Button_module_default.disabledPrimary
|
|
93
93
|
),
|
|
94
|
-
size:
|
|
94
|
+
size: _EGB44W5Vcjs.internalIconSize[size]
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
97
|
(loading && loadingText || !loading && text) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KJLBDAZHcjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FEFAG4KTcjs.Typography_default, { size: _5JUNB754cjs.textVariant_default[size], weight: "medium", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -109,10 +109,10 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
109
109
|
{
|
|
110
110
|
className: _classnames2.default.call(void 0,
|
|
111
111
|
Button_module_default.icon,
|
|
112
|
-
|
|
112
|
+
_EGB44W5Vcjs.materialIconSize[size],
|
|
113
113
|
disabledPrimary && Button_module_default.disabledPrimary
|
|
114
114
|
),
|
|
115
|
-
size:
|
|
115
|
+
size: _EGB44W5Vcjs.internalIconSize[size]
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -146,4 +146,4 @@ var Button_default = Button;
|
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
exports.Button_default = Button_default;
|
|
149
|
-
//# sourceMappingURL=
|
|
149
|
+
//# sourceMappingURL=K4QY6POL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button/Button.tsx","css-module:./Button.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,kBAAuC;AACvD,OAAO,gBAAgB;;;ACDqE,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,aAAY,sBAAqB,YAAW,sBAAqB,mBAAkB,6BAA4B,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,QAAO,kBAAiB,UAAS,oBAAm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AI,UAAU,GACb,8BAAC,sBAAW,MAAM,oBAAY,IAAI,GAAG,QAAO,UAC1C;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,mBAAmB,sBAAO;AAAA,cAC5B;AAAA,cAEC,oBAAU,cAAc;AAAA;AAAA,UAC3B,GACF,GACF;AAAA,UAED,CAAC,WAAW,WACX;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,sBAAO;AAAA,gBACP,iBAAiB,IAAI;AAAA,gBACrB,mBAAmB,sBAAO;AAAA,cAC5B;AAAA,cACA,MAAM,iBAAiB,IAAI;AAAA;AAAA,UAC7B;AAAA,UAED,WACC;AAAA,YAAC;AAAA;AAAA,cACC,WAAW,WAAW,sBAAO,SAAS,oBAAoB;AAAA,cAC1D,SAAQ;AAAA,cACR,OAAO,wBAAgB,IAAI;AAAA,cAC3B,QAAQ,wBAAgB,IAAI;AAAA,cAE5B;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW,sBAAO;AAAA,kBAClB,IAAG;AAAA,kBACH,IAAG;AAAA,kBACH,GAAE;AAAA,kBACF,MAAK;AAAA,kBACL,aAAY;AAAA;AAAA,cACd;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AAErB,IAAO,iBAAQ","sourcesContent":["import React, { forwardRef, type ComponentProps } from \"react\";\nimport classNames from \"classnames\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport { materialIconSize, internalIconSize } from \"./constants/iconSize\";\nimport textVariant from \"./constants/textVariant\";\nimport loadingIconSize from \"./constants/loadingIconSize\";\nimport styles from \"./Button.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport { backgroundColor } from \"../colors/backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype ButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The text to be displayed inside the button when it is in a loading state\n */\n loadingText?: string;\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n *\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the button will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * The callback to be called when the button is clicked\n */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /**\n * The tooltip to be displayed when the user hovers over the button\n */\n tooltip?: string;\n /**\n * The type you want to set for the primitive `<button/>`\n */\n type?: \"button\" | \"submit\" | \"reset\";\n};\n\n/**\n * [Button](https://cambly-syntax.vercel.app/?path=/docs/components-button--docs) is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n \"data-testid\": dataTestId,\n text,\n loadingText,\n color = \"primary\",\n size = \"md\",\n accessibilityLabel,\n disabled = false,\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n tooltip,\n type = \"button\",\n }: ButtonProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n const disabledPrimary = color === \"primary\" && disabled;\n const isDisabled = !isHydrated || disabled || loading;\n\n return (\n <button\n data-testid={dataTestId}\n ref={ref}\n aria-label={accessibilityLabel}\n type={type}\n title={tooltip}\n disabled={isDisabled}\n onClick={onClick}\n className={classNames(\n styles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n styles[size],\n {\n [styles.fullWidth]: fullWidth,\n [styles.buttonGap]: size === \"lg\" || size === \"md\",\n [styles.disabled]: isDisabled,\n },\n )}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {((loading && loadingText) || (!loading && text)) && (\n <Box paddingX={1}>\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n className={classNames(\n foregroundColorClass,\n disabledPrimary && styles.disabledPrimary,\n )}\n >\n {loading ? loadingText : text}\n </span>\n </Typography>\n </Box>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(styles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={styles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </button>\n );\n },\n);\n\nButton.displayName = \"Button\";\n\nexport default Button;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"
|
|
1
|
+
{"version":3,"sources":["../../src/Button/Button.tsx","css-module:./Button.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,kBAAuC;AACvD,OAAO,gBAAgB;;;ACDqE,IAAO,wBAAQ,EAAC,UAAS,mBAAkB,aAAY,sBAAqB,YAAW,sBAAqB,mBAAkB,6BAA4B,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,QAAO,kBAAiB,UAAS,oBAAmB,UAAS,oBAAmB,UAAS,oBAAmB,WAAU,sBAAqB,6BAA4B,sCAAqC,iBAAgB,2BAA0B;;;AD4IpkB,SAsBI,KAtBJ;AA7BN,IAAM,SAAS;AAAA,EACb,CACE;AAAA,IACE,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,OAAO;AAAA,IACP;AAAA,IACA,WAAW;AAAA,IACX,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,IACT,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA,OAAO;AAAA,EACT,GACA,QACG;AACH,UAAM,aAAa,cAAc;AAEjC,UAAM,uBAAuB,gBAAgB,OAAO,EAAE;AACtD,UAAM,uBAAuB,gBAAgB,OAAO,EAAE;AACtD,UAAM,kBAAkB,UAAU,aAAa;AAC/C,UAAM,aAAa,CAAC,cAAc,YAAY;AAE9C,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb;AAAA,QACA,cAAY;AAAA,QACZ;AAAA,QACA,OAAO;AAAA,QACP,UAAU;AAAA,QACV;AAAA,QACA,WAAW;AAAA,UACT,sBA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AAA;AAAA,cACd;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AAErB,IAAO,iBAAQ","sourcesContent":["import React, { forwardRef, type ComponentProps } from \"react\";\nimport classNames from \"classnames\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport { materialIconSize, internalIconSize } from \"./constants/iconSize\";\nimport textVariant from \"./constants/textVariant\";\nimport loadingIconSize from \"./constants/loadingIconSize\";\nimport styles from \"./Button.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport { backgroundColor } from \"../colors/backgroundColor\";\nimport { foregroundColor } from \"../colors/foregroundColor\";\nimport { border } from \"../colors/border\";\nimport type InternalIcon from \"../Icon/Icon\";\n\ntype ButtonProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The text to be displayed inside the button\n */\n text: string;\n /**\n * The text to be displayed inside the button when it is in a loading state\n */\n loadingText?: string;\n /**\n * The color of the button\n *\n * @defaultValue \"primary\"\n */\n color?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"destructive-primary\"\n | \"destructive-secondary\"\n | \"destructive-tertiary\"\n | \"branded\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\";\n /**\n * The size of the button\n *\n * * `sm`: 32px\n * * `md`: 48px\n * * `lg`: 64px\n *\n * @defaultValue \"md\"\n */\n size?: (typeof Size)[number];\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the button will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the button will be in a loading state\n *\n * @defaultValue false\n */\n loading?: boolean;\n /**\n * If `true`, the button will take up the full width of its container\n *\n * @defaultValue false\n */\n fullWidth?: boolean;\n /**\n * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n startIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n endIcon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * The callback to be called when the button is clicked\n */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /**\n * The tooltip to be displayed when the user hovers over the button\n */\n tooltip?: string;\n /**\n * The type you want to set for the primitive `<button/>`\n */\n type?: \"button\" | \"submit\" | \"reset\";\n};\n\n/**\n * [Button](https://cambly-syntax.vercel.app/?path=/docs/components-button--docs) is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n \"data-testid\": dataTestId,\n text,\n loadingText,\n color = \"primary\",\n size = \"md\",\n accessibilityLabel,\n disabled = false,\n loading = false,\n fullWidth = false,\n startIcon: StartIcon,\n endIcon: EndIcon,\n on = \"lightBackground\",\n onClick,\n tooltip,\n type = \"button\",\n }: ButtonProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n\n const foregroundColorClass = foregroundColor(color, on);\n const backgroundColorClass = backgroundColor(color, on);\n const disabledPrimary = color === \"primary\" && disabled;\n const isDisabled = !isHydrated || disabled || loading;\n\n return (\n <button\n data-testid={dataTestId}\n ref={ref}\n aria-label={accessibilityLabel}\n type={type}\n title={tooltip}\n disabled={isDisabled}\n onClick={onClick}\n className={classNames(\n styles.button,\n foregroundColorClass,\n backgroundColorClass,\n border(color, on),\n styles[size],\n {\n [styles.fullWidth]: fullWidth,\n [styles.buttonGap]: size === \"lg\" || size === \"md\",\n [styles.disabled]: isDisabled,\n },\n )}\n >\n {!loading && StartIcon && (\n <StartIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {((loading && loadingText) || (!loading && text)) && (\n <Box paddingX={1}>\n <Typography size={textVariant[size]} weight=\"medium\">\n <span\n className={classNames(\n foregroundColorClass,\n disabledPrimary && styles.disabledPrimary,\n )}\n >\n {loading ? loadingText : text}\n </span>\n </Typography>\n </Box>\n )}\n {!loading && EndIcon && (\n <EndIcon\n className={classNames(\n styles.icon,\n materialIconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\n size={internalIconSize[size]}\n />\n )}\n {loading && (\n <svg\n className={classNames(styles.loading, foregroundColorClass)}\n viewBox=\"22 22 44 44\"\n width={loadingIconSize[size]}\n height={loadingIconSize[size]}\n >\n <circle\n className={styles.loadingCircle}\n cx=\"44\"\n cy=\"44\"\n r=\"20.2\"\n fill=\"none\"\n strokeWidth=\"3.6\"\n />\n </svg>\n )}\n </button>\n );\n },\n);\n\nButton.displayName = \"Button\";\n\nexport default Button;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"_button_17niw_1\",\"buttonGap\":\"_buttonGap_17niw_8\",\"disabled\":\"_disabled_17niw_42\",\"disabledPrimary\":\"_disabledPrimary_17niw_49\",\"fullWidth\":\"_fullWidth_17niw_53\",\"sm\":\"_sm_17niw_57\",\"md\":\"_md_17niw_64\",\"lg\":\"_lg_17niw_71\",\"icon\":\"_icon_17niw_78\",\"smIcon\":\"_smIcon_17niw_82\",\"mdIcon\":\"_mdIcon_17niw_89\",\"lgIcon\":\"_lgIcon_17niw_96\",\"loading\":\"_loading_17niw_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_17niw_1\",\"loadingCircle\":\"_loadingCircle_17niw_117\"}"]}
|