@cambly/syntax-core 10.36.0 → 10.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/Button.cjs +4 -4
- package/dist/Button/Button.css +19 -19
- package/dist/Button/Button.css.map +1 -1
- package/dist/Button/Button.js +3 -3
- package/dist/Button/constants/iconSize.cjs +2 -2
- package/dist/Button/constants/iconSize.css +19 -19
- package/dist/Button/constants/iconSize.css.map +1 -1
- package/dist/Button/constants/iconSize.js +1 -1
- package/dist/LinkButton/LinkButton.cjs +4 -3
- package/dist/LinkButton/LinkButton.css +19 -19
- package/dist/LinkButton/LinkButton.css.map +1 -1
- package/dist/LinkButton/LinkButton.d.ts +6 -0
- package/dist/LinkButton/LinkButton.js +3 -2
- package/dist/RichSelect/RichSelectBox.cjs +5 -5
- package/dist/RichSelect/RichSelectBox.css +19 -19
- package/dist/RichSelect/RichSelectBox.css.map +1 -1
- package/dist/RichSelect/RichSelectBox.js +4 -4
- package/dist/RichSelect/RichSelectList.cjs +7 -7
- package/dist/RichSelect/RichSelectList.css +19 -19
- package/dist/RichSelect/RichSelectList.css.map +1 -1
- package/dist/RichSelect/RichSelectList.js +6 -6
- package/dist/SelectList/SelectList.cjs +3 -3
- package/dist/SelectList/SelectList.js +2 -2
- package/dist/__chunks/{BBDZRW7U.js → 2F77AU5B.js} +1 -1
- package/dist/__chunks/{BBDZRW7U.js.map → 2F77AU5B.js.map} +1 -1
- package/dist/__chunks/{UGIRVBGY.cjs → 36DIFAKH.cjs} +8 -8
- package/dist/__chunks/{C2F5LYEQ.cjs → 3OMIAWRN.cjs} +34 -9
- package/dist/__chunks/3OMIAWRN.cjs.map +1 -0
- package/dist/__chunks/{S5CYISJE.cjs → 65OHGDU2.cjs} +11 -9
- package/dist/__chunks/65OHGDU2.cjs.map +1 -0
- package/dist/__chunks/{6PNFY6W6.cjs → 6BULM4PL.cjs} +4 -4
- package/dist/__chunks/BHN2OODF.cjs +17 -0
- package/dist/__chunks/BHN2OODF.cjs.map +1 -0
- package/dist/__chunks/C7PW7CPK.js +17 -0
- package/dist/__chunks/C7PW7CPK.js.map +1 -0
- package/dist/__chunks/{FWLRUQPX.js → JOVGUW46.js} +2 -2
- package/dist/__chunks/{JYW7KNV7.js → LX5KVHM2.js} +10 -8
- package/dist/__chunks/LX5KVHM2.js.map +1 -0
- package/dist/__chunks/{WBKZQ5CY.cjs → NCDLHBVI.cjs} +3 -3
- package/dist/__chunks/{VBSPIS4Y.cjs → NXQTDCKY.cjs} +1 -1
- package/dist/__chunks/{VBSPIS4Y.cjs.map → NXQTDCKY.cjs.map} +1 -1
- package/dist/__chunks/{EDYJVVT6.js → PO66GRTH.js} +2 -2
- package/dist/__chunks/{F2PXZG4G.js → QF2477HJ.js} +3 -3
- package/dist/__chunks/{DLZDG6HM.js → QVOCSKIN.js} +32 -7
- package/dist/__chunks/QVOCSKIN.js.map +1 -0
- package/dist/index.cjs +9 -9
- package/dist/index.css +19 -19
- package/dist/index.css.map +1 -1
- package/dist/index.js +8 -8
- package/package.json +1 -1
- package/dist/__chunks/C2F5LYEQ.cjs.map +0 -1
- package/dist/__chunks/DLZDG6HM.js.map +0 -1
- package/dist/__chunks/JWJK72BH.js +0 -17
- package/dist/__chunks/JWJK72BH.js.map +0 -1
- package/dist/__chunks/JYW7KNV7.js.map +0 -1
- package/dist/__chunks/S5CYISJE.cjs.map +0 -1
- package/dist/__chunks/UAXX2ZEQ.cjs +0 -17
- package/dist/__chunks/UAXX2ZEQ.cjs.map +0 -1
- /package/dist/__chunks/{UGIRVBGY.cjs.map → 36DIFAKH.cjs.map} +0 -0
- /package/dist/__chunks/{6PNFY6W6.cjs.map → 6BULM4PL.cjs.map} +0 -0
- /package/dist/__chunks/{FWLRUQPX.js.map → JOVGUW46.js.map} +0 -0
- /package/dist/__chunks/{WBKZQ5CY.cjs.map → NCDLHBVI.cjs.map} +0 -0
- /package/dist/__chunks/{EDYJVVT6.js.map → PO66GRTH.js.map} +0 -0
- /package/dist/__chunks/{F2PXZG4G.js.map → QF2477HJ.js.map} +0 -0
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
var _5JUNB754cjs = require('./5JUNB754.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _3P2PWHOUcjs = require('./3P2PWHOU.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _BHN2OODFcjs = require('./BHN2OODF.cjs');
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
var _MKZONAGTcjs = require('./MKZONAGT.cjs');
|
|
@@ -23,7 +26,7 @@ var _react = require('react');
|
|
|
23
26
|
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
24
27
|
|
|
25
28
|
// css-module:../Button/Button.module.css#css-module
|
|
26
|
-
var Button_module_default = { "button": "
|
|
29
|
+
var Button_module_default = { "button": "_button_hjka3_1", "buttonGap": "_buttonGap_hjka3_8", "disabled": "_disabled_hjka3_42", "disabledPrimary": "_disabledPrimary_hjka3_49", "fullWidth": "_fullWidth_hjka3_53", "sm": "_sm_hjka3_57", "md": "_md_hjka3_64", "lg": "_lg_hjka3_71", "icon": "_icon_hjka3_78", "smIcon": "_smIcon_hjka3_82", "mdIcon": "_mdIcon_hjka3_89", "lgIcon": "_lgIcon_hjka3_96", "loading": "_loading_hjka3_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_hjka3_1", "loadingCircle": "_loadingCircle_hjka3_117" };
|
|
27
30
|
|
|
28
31
|
// css-module:./LinkButton.module.css#css-module
|
|
29
32
|
var LinkButton_module_default = { "linkButton": "_linkButton_1qjrb_1", "fitContent": "_fitContent_1qjrb_11" };
|
|
@@ -39,6 +42,7 @@ var LinkButton = _react.forwardRef.call(void 0,
|
|
|
39
42
|
"data-testid": dataTestId,
|
|
40
43
|
color = "primary",
|
|
41
44
|
size = "md",
|
|
45
|
+
loading = false,
|
|
42
46
|
fullWidth = false,
|
|
43
47
|
startIcon: StartIcon,
|
|
44
48
|
endIcon: EndIcon,
|
|
@@ -65,37 +69,58 @@ var LinkButton = _react.forwardRef.call(void 0,
|
|
|
65
69
|
{
|
|
66
70
|
[Button_module_default.fullWidth]: fullWidth,
|
|
67
71
|
[LinkButton_module_default.fitContent]: !fullWidth,
|
|
68
|
-
[Button_module_default.buttonGap]: size === "lg" || size === "md"
|
|
72
|
+
[Button_module_default.buttonGap]: size === "lg" || size === "md",
|
|
73
|
+
[Button_module_default.disabled]: loading
|
|
69
74
|
}
|
|
70
75
|
),
|
|
71
76
|
onClick,
|
|
72
77
|
children: [
|
|
73
|
-
StartIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
78
|
+
!loading && StartIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
74
79
|
StartIcon,
|
|
75
80
|
{
|
|
76
81
|
className: _classnames2.default.call(void 0,
|
|
77
82
|
Button_module_default.icon,
|
|
78
|
-
|
|
83
|
+
_BHN2OODFcjs.iconSize_default[size],
|
|
79
84
|
foregroundColorClass
|
|
80
85
|
)
|
|
81
86
|
}
|
|
82
87
|
),
|
|
83
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _XCGRNBQHcjs.Typography_default, { size: _5JUNB754cjs.textVariant_default[size], weight: "medium", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
88
|
+
!loading && text && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _XCGRNBQHcjs.Typography_default, { size: _5JUNB754cjs.textVariant_default[size], weight: "medium", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
84
89
|
"span",
|
|
85
90
|
{
|
|
86
91
|
className: foregroundColorClass,
|
|
87
92
|
children: text
|
|
88
93
|
}
|
|
89
94
|
) }),
|
|
90
|
-
EndIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
95
|
+
!loading && EndIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
91
96
|
EndIcon,
|
|
92
97
|
{
|
|
93
98
|
className: _classnames2.default.call(void 0,
|
|
94
99
|
Button_module_default.icon,
|
|
95
|
-
|
|
100
|
+
_BHN2OODFcjs.iconSize_default[size],
|
|
96
101
|
foregroundColorClass
|
|
97
102
|
)
|
|
98
103
|
}
|
|
104
|
+
),
|
|
105
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
106
|
+
"svg",
|
|
107
|
+
{
|
|
108
|
+
className: _classnames2.default.call(void 0, Button_module_default.loading, foregroundColorClass),
|
|
109
|
+
viewBox: "22 22 44 44",
|
|
110
|
+
width: _3P2PWHOUcjs.loadingIconSize_default[size],
|
|
111
|
+
height: _3P2PWHOUcjs.loadingIconSize_default[size],
|
|
112
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
113
|
+
"circle",
|
|
114
|
+
{
|
|
115
|
+
className: Button_module_default.loadingCircle,
|
|
116
|
+
cx: "44",
|
|
117
|
+
cy: "44",
|
|
118
|
+
r: "20.2",
|
|
119
|
+
fill: "none",
|
|
120
|
+
strokeWidth: "3.6"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
99
124
|
)
|
|
100
125
|
]
|
|
101
126
|
}
|
|
@@ -108,4 +133,4 @@ var LinkButton_default = LinkButton;
|
|
|
108
133
|
|
|
109
134
|
|
|
110
135
|
exports.LinkButton_default = LinkButton_default;
|
|
111
|
-
//# sourceMappingURL=
|
|
136
|
+
//# sourceMappingURL=3OMIAWRN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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,SAAS,kBAA2C;AACpD,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;;;ACAte,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,cAAa,uBAAsB;;;AFyHpL,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;AAAA,UACjB;AAAA,YACE,CAAC,sBAAa,SAAS,GAAG;AAAA,YAC1B,CAAC,0BAAO,UAAU,GAAG,CAAC;AAAA,YACtB,CAAC,sBAAa,SAAS,GAAG,SAAS,QAAQ,SAAS;AAAA,YACpD,CAAC,sBAAa,QAAQ,GAAG;AAAA,UAC3B;AAAA,QACF;AAAA,QACA;AAAA,QAEC;AAAA,WAAC,WAAW,aACX;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,sBAAa;AAAA,gBACb,iBAAS,IAAI;AAAA,gBACb;AAAA,cACF;AAAA;AAAA,UACF;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,iBAAS,IAAI;AAAA,gBACb;AAAA,cACF;AAAA;AAAA,UACF;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 { forwardRef, type HtmlHTMLAttributes } 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 iconSize 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\";\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?: React.ComponentType<{ className?: string }>;\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?: React.ComponentType<{ className?: string }>;\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 iconSize[size],\n foregroundColorClass,\n )}\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 iconSize[size],\n foregroundColorClass,\n )}\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_hjka3_1\",\"buttonGap\":\"_buttonGap_hjka3_8\",\"disabled\":\"_disabled_hjka3_42\",\"disabledPrimary\":\"_disabledPrimary_hjka3_49\",\"fullWidth\":\"_fullWidth_hjka3_53\",\"sm\":\"_sm_hjka3_57\",\"md\":\"_md_hjka3_64\",\"lg\":\"_lg_hjka3_71\",\"icon\":\"_icon_hjka3_78\",\"smIcon\":\"_smIcon_hjka3_82\",\"mdIcon\":\"_mdIcon_hjka3_89\",\"lgIcon\":\"_lgIcon_hjka3_96\",\"loading\":\"_loading_hjka3_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_hjka3_1\",\"loadingCircle\":\"_loadingCircle_hjka3_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,13 +1,13 @@
|
|
|
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 _5JUNB754cjs = require('./5JUNB754.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _3P2PWHOUcjs = require('./3P2PWHOU.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _BHN2OODFcjs = require('./BHN2OODF.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _MKZONAGTcjs = require('./MKZONAGT.cjs');
|
|
@@ -32,7 +32,7 @@ var _react = require('react');
|
|
|
32
32
|
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
33
33
|
|
|
34
34
|
// css-module:./Button.module.css#css-module
|
|
35
|
-
var Button_module_default = { "button": "
|
|
35
|
+
var Button_module_default = { "button": "_button_hjka3_1", "buttonGap": "_buttonGap_hjka3_8", "disabled": "_disabled_hjka3_42", "disabledPrimary": "_disabledPrimary_hjka3_49", "fullWidth": "_fullWidth_hjka3_53", "sm": "_sm_hjka3_57", "md": "_md_hjka3_64", "lg": "_lg_hjka3_71", "icon": "_icon_hjka3_78", "smIcon": "_smIcon_hjka3_82", "mdIcon": "_mdIcon_hjka3_89", "lgIcon": "_lgIcon_hjka3_96", "loading": "_loading_hjka3_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_hjka3_1", "loadingCircle": "_loadingCircle_hjka3_117" };
|
|
36
36
|
|
|
37
37
|
// src/Button/Button.tsx
|
|
38
38
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -58,6 +58,7 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
58
58
|
const foregroundColorClass = _MKZONAGTcjs.foregroundColor.call(void 0, color, on);
|
|
59
59
|
const backgroundColorClass = _RAL6R27Scjs.backgroundColor.call(void 0, color, on);
|
|
60
60
|
const disabledPrimary = color === "primary" && disabled;
|
|
61
|
+
const isDisabled = !isHydrated || disabled || loading;
|
|
61
62
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
62
63
|
"button",
|
|
63
64
|
{
|
|
@@ -66,7 +67,7 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
66
67
|
"aria-label": accessibilityLabel,
|
|
67
68
|
type,
|
|
68
69
|
title: tooltip,
|
|
69
|
-
disabled:
|
|
70
|
+
disabled: isDisabled,
|
|
70
71
|
onClick,
|
|
71
72
|
className: _classnames2.default.call(void 0,
|
|
72
73
|
Button_module_default.button,
|
|
@@ -76,7 +77,8 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
76
77
|
Button_module_default[size],
|
|
77
78
|
{
|
|
78
79
|
[Button_module_default.fullWidth]: fullWidth,
|
|
79
|
-
[Button_module_default.buttonGap]: size === "lg" || size === "md"
|
|
80
|
+
[Button_module_default.buttonGap]: size === "lg" || size === "md",
|
|
81
|
+
[Button_module_default.disabled]: isDisabled
|
|
80
82
|
}
|
|
81
83
|
),
|
|
82
84
|
children: [
|
|
@@ -85,7 +87,7 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
85
87
|
{
|
|
86
88
|
className: _classnames2.default.call(void 0,
|
|
87
89
|
Button_module_default.icon,
|
|
88
|
-
|
|
90
|
+
_BHN2OODFcjs.iconSize_default[size],
|
|
89
91
|
disabledPrimary && Button_module_default.disabledPrimary
|
|
90
92
|
)
|
|
91
93
|
}
|
|
@@ -105,7 +107,7 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
105
107
|
{
|
|
106
108
|
className: _classnames2.default.call(void 0,
|
|
107
109
|
Button_module_default.icon,
|
|
108
|
-
|
|
110
|
+
_BHN2OODFcjs.iconSize_default[size],
|
|
109
111
|
disabledPrimary && Button_module_default.disabledPrimary
|
|
110
112
|
)
|
|
111
113
|
}
|
|
@@ -141,4 +143,4 @@ var Button_default = Button;
|
|
|
141
143
|
|
|
142
144
|
|
|
143
145
|
exports.Button_default = Button_default;
|
|
144
|
-
//# sourceMappingURL=
|
|
146
|
+
//# sourceMappingURL=65OHGDU2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Button/Button.tsx","css-module:./Button.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,kBAAkB;AAClC,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;;;ADuIpkB,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,sBAAO;AAAA,UACP;AAAA,UACA;AAAA,UACA,OAAO,OAAO,EAAE;AAAA,UAChB,sBAAO,IAAI;AAAA,UACX;AAAA,YACE,CAAC,sBAAO,SAAS,GAAG;AAAA,YACpB,CAAC,sBAAO,SAAS,GAAG,SAAS,QAAQ,SAAS;AAAA,YAC9C,CAAC,sBAAO,QAAQ,GAAG;AAAA,UACrB;AAAA,QACF;AAAA,QAEC;AAAA,WAAC,WAAW,aACX;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,sBAAO;AAAA,gBACP,iBAAS,IAAI;AAAA,gBACb,mBAAmB,sBAAO;AAAA,cAC5B;AAAA;AAAA,UACF;AAAA,WAEC,WAAW,eAAiB,CAAC,WAAW,SACzC,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,iBAAS,IAAI;AAAA,gBACb,mBAAmB,sBAAO;AAAA,cAC5B;AAAA;AAAA,UACF;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 } from \"react\";\nimport classNames from \"classnames\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport iconSize 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\";\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?: React.ComponentType<{ className?: string }>;\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?: React.ComponentType<{ className?: string }>;\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 iconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\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 iconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\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_hjka3_1\",\"buttonGap\":\"_buttonGap_hjka3_8\",\"disabled\":\"_disabled_hjka3_42\",\"disabledPrimary\":\"_disabledPrimary_hjka3_49\",\"fullWidth\":\"_fullWidth_hjka3_53\",\"sm\":\"_sm_hjka3_57\",\"md\":\"_md_hjka3_64\",\"lg\":\"_lg_hjka3_71\",\"icon\":\"_icon_hjka3_78\",\"smIcon\":\"_smIcon_hjka3_82\",\"mdIcon\":\"_mdIcon_hjka3_89\",\"lgIcon\":\"_lgIcon_hjka3_96\",\"loading\":\"_loading_hjka3_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_hjka3_1\",\"loadingCircle\":\"_loadingCircle_hjka3_117\"}"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _C5XPZTFOcjs = require('./C5XPZTFO.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _65OHGDU2cjs = require('./65OHGDU2.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _DMA6PPUZcjs = require('./DMA6PPUZ.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
|
+
_65OHGDU2cjs.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
|
+
_65OHGDU2cjs.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=6BULM4PL.cjs.map
|
|
@@ -0,0 +1,17 @@
|
|
|
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_hjka3_1", "buttonGap": "_buttonGap_hjka3_8", "disabled": "_disabled_hjka3_42", "disabledPrimary": "_disabledPrimary_hjka3_49", "fullWidth": "_fullWidth_hjka3_53", "sm": "_sm_hjka3_57", "md": "_md_hjka3_64", "lg": "_lg_hjka3_71", "icon": "_icon_hjka3_78", "smIcon": "_smIcon_hjka3_82", "mdIcon": "_mdIcon_hjka3_89", "lgIcon": "_lgIcon_hjka3_96", "loading": "_loading_hjka3_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_hjka3_1", "loadingCircle": "_loadingCircle_hjka3_117" };
|
|
5
|
+
|
|
6
|
+
// src/Button/constants/iconSize.ts
|
|
7
|
+
var iconSize = {
|
|
8
|
+
sm: Button_module_default.smIcon,
|
|
9
|
+
md: Button_module_default.mdIcon,
|
|
10
|
+
lg: Button_module_default.lgIcon
|
|
11
|
+
};
|
|
12
|
+
var iconSize_default = iconSize;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.iconSize_default = iconSize_default;
|
|
17
|
+
//# sourceMappingURL=BHN2OODF.cjs.map
|
|
@@ -0,0 +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;;;ACE1kB,IAAM,WAAW;AAAA,EACf,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AACb;AAEA,IAAO,mBAAQ","sourcesContent":["import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"_button_hjka3_1\",\"buttonGap\":\"_buttonGap_hjka3_8\",\"disabled\":\"_disabled_hjka3_42\",\"disabledPrimary\":\"_disabledPrimary_hjka3_49\",\"fullWidth\":\"_fullWidth_hjka3_53\",\"sm\":\"_sm_hjka3_57\",\"md\":\"_md_hjka3_64\",\"lg\":\"_lg_hjka3_71\",\"icon\":\"_icon_hjka3_78\",\"smIcon\":\"_smIcon_hjka3_82\",\"mdIcon\":\"_mdIcon_hjka3_89\",\"lgIcon\":\"_lgIcon_hjka3_96\",\"loading\":\"_loading_hjka3_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_hjka3_1\",\"loadingCircle\":\"_loadingCircle_hjka3_117\"}","import styles from \"../Button.module.css\";\n\nconst iconSize = {\n sm: styles.smIcon,\n md: styles.mdIcon,\n lg: styles.lgIcon,\n};\n\nexport default iconSize;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
// css-module:../Button.module.css#css-module
|
|
4
|
+
var Button_module_default = { "button": "_button_hjka3_1", "buttonGap": "_buttonGap_hjka3_8", "disabled": "_disabled_hjka3_42", "disabledPrimary": "_disabledPrimary_hjka3_49", "fullWidth": "_fullWidth_hjka3_53", "sm": "_sm_hjka3_57", "md": "_md_hjka3_64", "lg": "_lg_hjka3_71", "icon": "_icon_hjka3_78", "smIcon": "_smIcon_hjka3_82", "mdIcon": "_mdIcon_hjka3_89", "lgIcon": "_lgIcon_hjka3_96", "loading": "_loading_hjka3_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_hjka3_1", "loadingCircle": "_loadingCircle_hjka3_117" };
|
|
5
|
+
|
|
6
|
+
// src/Button/constants/iconSize.ts
|
|
7
|
+
var iconSize = {
|
|
8
|
+
sm: Button_module_default.smIcon,
|
|
9
|
+
md: Button_module_default.mdIcon,
|
|
10
|
+
lg: Button_module_default.lgIcon
|
|
11
|
+
};
|
|
12
|
+
var iconSize_default = iconSize;
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
iconSize_default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=C7PW7CPK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["css-module:../Button.module.css#css-module","../../src/Button/constants/iconSize.ts"],"sourcesContent":["import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Button/Button.module.css\"; export default {\"button\":\"_button_hjka3_1\",\"buttonGap\":\"_buttonGap_hjka3_8\",\"disabled\":\"_disabled_hjka3_42\",\"disabledPrimary\":\"_disabledPrimary_hjka3_49\",\"fullWidth\":\"_fullWidth_hjka3_53\",\"sm\":\"_sm_hjka3_57\",\"md\":\"_md_hjka3_64\",\"lg\":\"_lg_hjka3_71\",\"icon\":\"_icon_hjka3_78\",\"smIcon\":\"_smIcon_hjka3_82\",\"mdIcon\":\"_mdIcon_hjka3_89\",\"lgIcon\":\"_lgIcon_hjka3_96\",\"loading\":\"_loading_hjka3_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_hjka3_1\",\"loadingCircle\":\"_loadingCircle_hjka3_117\"}","import styles from \"../Button.module.css\";\n\nconst iconSize = {\n sm: styles.smIcon,\n md: styles.mdIcon,\n lg: styles.lgIcon,\n};\n\nexport default iconSize;\n"],"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;;;ACE1kB,IAAM,WAAW;AAAA,EACf,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AAAA,EACX,IAAI,sBAAO;AACb;AAEA,IAAO,mBAAQ;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
ColorBaseDestructive700,
|
|
7
7
|
ColorBaseGray800
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./2F77AU5B.js";
|
|
9
9
|
import {
|
|
10
10
|
Focus_module_default
|
|
11
11
|
} from "./KKADUD65.js";
|
|
@@ -122,4 +122,4 @@ SelectList.Option = SelectOption_default;
|
|
|
122
122
|
export {
|
|
123
123
|
SelectList
|
|
124
124
|
};
|
|
125
|
-
//# sourceMappingURL=
|
|
125
|
+
//# sourceMappingURL=JOVGUW46.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import {
|
|
3
|
-
loadingIconSize_default
|
|
4
|
-
} from "./QSC7CAQA.js";
|
|
5
2
|
import {
|
|
6
3
|
textVariant_default
|
|
7
4
|
} from "./Z5ZUAP2B.js";
|
|
5
|
+
import {
|
|
6
|
+
loadingIconSize_default
|
|
7
|
+
} from "./QSC7CAQA.js";
|
|
8
8
|
import {
|
|
9
9
|
iconSize_default
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./C7PW7CPK.js";
|
|
11
11
|
import {
|
|
12
12
|
foregroundColor
|
|
13
13
|
} from "./UVQS6LU3.js";
|
|
@@ -32,7 +32,7 @@ import { forwardRef } from "react";
|
|
|
32
32
|
import classNames from "classnames";
|
|
33
33
|
|
|
34
34
|
// css-module:./Button.module.css#css-module
|
|
35
|
-
var Button_module_default = { "button": "
|
|
35
|
+
var Button_module_default = { "button": "_button_hjka3_1", "buttonGap": "_buttonGap_hjka3_8", "disabled": "_disabled_hjka3_42", "disabledPrimary": "_disabledPrimary_hjka3_49", "fullWidth": "_fullWidth_hjka3_53", "sm": "_sm_hjka3_57", "md": "_md_hjka3_64", "lg": "_lg_hjka3_71", "icon": "_icon_hjka3_78", "smIcon": "_smIcon_hjka3_82", "mdIcon": "_mdIcon_hjka3_89", "lgIcon": "_lgIcon_hjka3_96", "loading": "_loading_hjka3_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_hjka3_1", "loadingCircle": "_loadingCircle_hjka3_117" };
|
|
36
36
|
|
|
37
37
|
// src/Button/Button.tsx
|
|
38
38
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -58,6 +58,7 @@ var Button = forwardRef(
|
|
|
58
58
|
const foregroundColorClass = foregroundColor(color, on);
|
|
59
59
|
const backgroundColorClass = backgroundColor(color, on);
|
|
60
60
|
const disabledPrimary = color === "primary" && disabled;
|
|
61
|
+
const isDisabled = !isHydrated || disabled || loading;
|
|
61
62
|
return /* @__PURE__ */ jsxs(
|
|
62
63
|
"button",
|
|
63
64
|
{
|
|
@@ -66,7 +67,7 @@ var Button = forwardRef(
|
|
|
66
67
|
"aria-label": accessibilityLabel,
|
|
67
68
|
type,
|
|
68
69
|
title: tooltip,
|
|
69
|
-
disabled:
|
|
70
|
+
disabled: isDisabled,
|
|
70
71
|
onClick,
|
|
71
72
|
className: classNames(
|
|
72
73
|
Button_module_default.button,
|
|
@@ -76,7 +77,8 @@ var Button = forwardRef(
|
|
|
76
77
|
Button_module_default[size],
|
|
77
78
|
{
|
|
78
79
|
[Button_module_default.fullWidth]: fullWidth,
|
|
79
|
-
[Button_module_default.buttonGap]: size === "lg" || size === "md"
|
|
80
|
+
[Button_module_default.buttonGap]: size === "lg" || size === "md",
|
|
81
|
+
[Button_module_default.disabled]: isDisabled
|
|
80
82
|
}
|
|
81
83
|
),
|
|
82
84
|
children: [
|
|
@@ -141,4 +143,4 @@ var Button_default = Button;
|
|
|
141
143
|
export {
|
|
142
144
|
Button_default
|
|
143
145
|
};
|
|
144
|
-
//# sourceMappingURL=
|
|
146
|
+
//# sourceMappingURL=LX5KVHM2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Button/Button.tsx","css-module:./Button.module.css#css-module"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport classNames from \"classnames\";\nimport { type Size } from \"../constants\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport iconSize 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\";\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?: React.ComponentType<{ className?: string }>;\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?: React.ComponentType<{ className?: string }>;\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 iconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\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 iconSize[size],\n disabledPrimary && styles.disabledPrimary,\n )}\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_hjka3_1\",\"buttonGap\":\"_buttonGap_hjka3_8\",\"disabled\":\"_disabled_hjka3_42\",\"disabledPrimary\":\"_disabledPrimary_hjka3_49\",\"fullWidth\":\"_fullWidth_hjka3_53\",\"sm\":\"_sm_hjka3_57\",\"md\":\"_md_hjka3_64\",\"lg\":\"_lg_hjka3_71\",\"icon\":\"_icon_hjka3_78\",\"smIcon\":\"_smIcon_hjka3_82\",\"mdIcon\":\"_mdIcon_hjka3_89\",\"lgIcon\":\"_lgIcon_hjka3_96\",\"loading\":\"_loading_hjka3_113\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_hjka3_1\",\"loadingCircle\":\"_loadingCircle_hjka3_117\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,kBAAkB;AAClC,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;;;ADuIpkB,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,sBAAO;AAAA,UACP;AAAA,UACA;AAAA,UACA,OAAO,OAAO,EAAE;AAAA,UAChB,sBAAO,IAAI;AAAA,UACX;AAAA,YACE,CAAC,sBAAO,SAAS,GAAG;AAAA,YACpB,CAAC,sBAAO,SAAS,GAAG,SAAS,QAAQ,SAAS;AAAA,YAC9C,CAAC,sBAAO,QAAQ,GAAG;AAAA,UACrB;AAAA,QACF;AAAA,QAEC;AAAA,WAAC,WAAW,aACX;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,sBAAO;AAAA,gBACP,iBAAS,IAAI;AAAA,gBACb,mBAAmB,sBAAO;AAAA,cAC5B;AAAA;AAAA,UACF;AAAA,WAEC,WAAW,eAAiB,CAAC,WAAW,SACzC,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,iBAAS,IAAI;AAAA,gBACb,mBAAmB,sBAAO;AAAA,cAC5B;AAAA;AAAA,UACF;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":[]}
|
|
@@ -5,7 +5,7 @@ var _4UJE5GMHcjs = require('./4UJE5GMH.cjs');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _NXQTDCKYcjs = require('./NXQTDCKY.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _XLUVINJWcjs = require('./XLUVINJW.cjs');
|
|
@@ -98,7 +98,7 @@ function SelectList({
|
|
|
98
98
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
99
99
|
"path",
|
|
100
100
|
{
|
|
101
|
-
fill: errorText ?
|
|
101
|
+
fill: errorText ? _NXQTDCKYcjs.ColorBaseDestructive700 : _NXQTDCKYcjs.ColorBaseGray800,
|
|
102
102
|
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"
|
|
103
103
|
}
|
|
104
104
|
)
|
|
@@ -122,4 +122,4 @@ SelectList.Option = _4UJE5GMHcjs.SelectOption_default;
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
exports.SelectList = SelectList;
|
|
125
|
-
//# sourceMappingURL=
|
|
125
|
+
//# sourceMappingURL=NCDLHBVI.cjs.map
|
|
@@ -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 Thu, 11 Apr 2024 19:10:05 GMT\n */\n\nexport const ColorBaseBlack = \"#000000\";\nexport const ColorBaseDestructive100 = \"#fef3f5\";\nexport const ColorBaseDestructive200 = \"#fad6de\";\nexport const ColorBaseDestructive300 = \"#f2a2b2\";\nexport const ColorBaseDestructive700 = \"#d32a4b\";\nexport const ColorBaseDestructive800 = \"#81162c\";\nexport const ColorBaseDestructive900 = \"#55101d\";\nexport const ColorBaseGray10 = \"#cbcbcb\"; // Used as the default color for dividers and inner strokes\nexport const ColorBaseGray30 = \"#000000\"; // For IconButton background when on top of an image\nexport const ColorBaseGray60 = \"#000000\"; // Used for icon background in classroom video grid\nexport const ColorBaseGray80 = \"#000000\"; // Used as the background for modals\nexport const ColorBaseGray100 = \"#f7f7f7\";\nexport const ColorBaseGray200 = \"#f0f0f0\"; // Used for light mode backgrounds when showing card content on top\nexport const ColorBaseGray300 = \"#d0d0d0\"; // Used for component outlines, eg: select and textfield\nexport const ColorBaseGray700 = \"#767676\"; // For secondary text in light mode\nexport const ColorBaseGray800 = \"#353535\";\nexport const ColorBaseGray900 = \"#191919\"; // Default text color, Classroom background\nexport const ColorBaseOrange100 = \"#fdf2f0\";\nexport const ColorBaseOrange200 = \"#f6cdc4\";\nexport const ColorBaseOrange300 = \"#ec9987\";\nexport const ColorBaseOrange700 = \"#c34124\";\nexport const ColorBaseOrange800 = \"#732818\";\nexport const ColorBaseOrange900 = \"#4d1a10\";\nexport const ColorBasePrimary100 = \"#eff6fa\";\nexport const ColorBasePrimary200 = \"#c1dbe7\";\nexport const ColorBasePrimary300 = \"#84b7d0\";\nexport const ColorBasePrimary700 = \"#236482\";\nexport const ColorBasePrimary800 = \"#274858\";\nexport const ColorBasePrimary900 = \"#1b303b\";\nexport const ColorBaseSuccess100 = \"#eff7f1\";\nexport const ColorBaseSuccess200 = \"#bddcc6\";\nexport const ColorBaseSuccess300 = \"#81ba92\";\nexport const ColorBaseSuccess700 = \"#397b4d\";\nexport const ColorBaseSuccess800 = \"#2d4936\";\nexport const ColorBaseSuccess900 = \"#1e3124\";\nexport const ColorBasePurple100 = \"#f9f5fa\";\nexport const ColorBasePurple200 = \"#e8dceb\";\nexport const ColorBasePurple300 = \"#cdb4d3\";\nexport const ColorBasePurple700 = \"#8b5f95\";\nexport const ColorBasePurple800 = \"#523b58\";\nexport const ColorBasePurple900 = \"#37273b\";\nexport const ColorBaseYellow100 = \"#fdf5d9\";\nexport const ColorBaseYellow200 = \"#fbe8a3\";\nexport const ColorBaseYellow300 = \"#f8d663\";\nexport const ColorBaseYellow700 = \"#ffc929\";\nexport const ColorBaseYellow800 = \"#765f1c\";\nexport const ColorBaseYellow900 = \"#3b3009\";\nexport const ColorBaseWhite = \"#ffffff\";\nexport const ColorCambioBlack = \"#050500\";\nexport const ColorCambioWhite = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#888077\";\nexport const ColorCambioGray800 = \"#5c554d\";\nexport const ColorCambioGray870 = \"#5c554d\";\nexport const ColorCambioGray900 = \"#312b23\";\nexport const ColorCambioDestructive100 = \"#ffdeda\";\nexport const ColorCambioDestructive300 = \"#ff8071\";\nexport const ColorCambioDestructive370 = \"#ff8071\";\nexport const ColorCambioDestructive700 = \"#c93f32\";\nexport const ColorCambioDestructive770 = \"#c93f32\";\nexport const ColorCambioDestructive900 = \"#6d0002\";\nexport const ColorCambioSuccess100 = \"#daf2c8\";\nexport const ColorCambioSuccess300 = \"#84ce64\";\nexport const ColorCambioSuccess370 = \"#84ce64\";\nexport const ColorCambioSuccess700 = \"#3c7f20\";\nexport const ColorCambioSuccess770 = \"#3c7f20\";\nexport const ColorCambioSuccess900 = \"#103e00\";\nexport const ColorCambioRed = \"#f56e56\";\nexport const ColorCambioOrange = \"#ff8f57\";\nexport const ColorCambioTan = \"#ffb47d\";\nexport const ColorCambioCream = \"#fffad1\";\nexport const ColorCambioPurple = \"#6840a8\";\nexport const ColorCambioLilac = \"#b59ef0\";\nexport const ColorCambioThistle = \"#d69ca4\";\nexport const ColorCambioPink = \"#ffccea\";\nexport const ColorCambioNavy = \"#191142\";\nexport const ColorCambioTeal = \"#44a6cf\";\nexport const ColorCambioSlate = \"#7c9fc6\";\nexport const ColorCambioSky = \"#b1e8fc\";\nexport const ColorCambioYellow700 = \"#ffe733\";\nexport const ColorCambioTransparentFull = \"#000000\";\nexport const Elevation400 = \"0px 16px 32px 0px #00000040\";\nexport const SyntaxFontSansSerif = \"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\n"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./BOX3VY3Q.js";
|
|
5
5
|
import {
|
|
6
6
|
Button_default
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./LX5KVHM2.js";
|
|
8
8
|
import {
|
|
9
9
|
Divider
|
|
10
10
|
} from "./TK2EQ6QG.js";
|
|
@@ -208,4 +208,4 @@ export {
|
|
|
208
208
|
RichSelectBoxContext,
|
|
209
209
|
RichSelectBox_default
|
|
210
210
|
};
|
|
211
|
-
//# sourceMappingURL=
|
|
211
|
+
//# sourceMappingURL=PO66GRTH.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
RichSelectBoxContext,
|
|
4
4
|
RichSelectBox_default,
|
|
5
5
|
convertSelection
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./PO66GRTH.js";
|
|
7
7
|
import {
|
|
8
8
|
RichSelectChip_default
|
|
9
9
|
} from "./N5N4HUQB.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
ColorBaseDestructive700,
|
|
21
21
|
ColorBaseGray800
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./2F77AU5B.js";
|
|
23
23
|
import {
|
|
24
24
|
RichSelectSection_default
|
|
25
25
|
} from "./HXTCI7A3.js";
|
|
@@ -266,4 +266,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
|
|
|
266
266
|
export {
|
|
267
267
|
RichSelectList_default
|
|
268
268
|
};
|
|
269
|
-
//# sourceMappingURL=
|
|
269
|
+
//# sourceMappingURL=QF2477HJ.js.map
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
textVariant_default
|
|
4
4
|
} from "./Z5ZUAP2B.js";
|
|
5
|
+
import {
|
|
6
|
+
loadingIconSize_default
|
|
7
|
+
} from "./QSC7CAQA.js";
|
|
5
8
|
import {
|
|
6
9
|
iconSize_default
|
|
7
|
-
} from "./
|
|
10
|
+
} from "./C7PW7CPK.js";
|
|
8
11
|
import {
|
|
9
12
|
foregroundColor
|
|
10
13
|
} from "./UVQS6LU3.js";
|
|
@@ -23,7 +26,7 @@ import { forwardRef } from "react";
|
|
|
23
26
|
import classNames from "classnames";
|
|
24
27
|
|
|
25
28
|
// css-module:../Button/Button.module.css#css-module
|
|
26
|
-
var Button_module_default = { "button": "
|
|
29
|
+
var Button_module_default = { "button": "_button_hjka3_1", "buttonGap": "_buttonGap_hjka3_8", "disabled": "_disabled_hjka3_42", "disabledPrimary": "_disabledPrimary_hjka3_49", "fullWidth": "_fullWidth_hjka3_53", "sm": "_sm_hjka3_57", "md": "_md_hjka3_64", "lg": "_lg_hjka3_71", "icon": "_icon_hjka3_78", "smIcon": "_smIcon_hjka3_82", "mdIcon": "_mdIcon_hjka3_89", "lgIcon": "_lgIcon_hjka3_96", "loading": "_loading_hjka3_113", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_hjka3_1", "loadingCircle": "_loadingCircle_hjka3_117" };
|
|
27
30
|
|
|
28
31
|
// css-module:./LinkButton.module.css#css-module
|
|
29
32
|
var LinkButton_module_default = { "linkButton": "_linkButton_1qjrb_1", "fitContent": "_fitContent_1qjrb_11" };
|
|
@@ -39,6 +42,7 @@ var LinkButton = forwardRef(
|
|
|
39
42
|
"data-testid": dataTestId,
|
|
40
43
|
color = "primary",
|
|
41
44
|
size = "md",
|
|
45
|
+
loading = false,
|
|
42
46
|
fullWidth = false,
|
|
43
47
|
startIcon: StartIcon,
|
|
44
48
|
endIcon: EndIcon,
|
|
@@ -65,12 +69,13 @@ var LinkButton = forwardRef(
|
|
|
65
69
|
{
|
|
66
70
|
[Button_module_default.fullWidth]: fullWidth,
|
|
67
71
|
[LinkButton_module_default.fitContent]: !fullWidth,
|
|
68
|
-
[Button_module_default.buttonGap]: size === "lg" || size === "md"
|
|
72
|
+
[Button_module_default.buttonGap]: size === "lg" || size === "md",
|
|
73
|
+
[Button_module_default.disabled]: loading
|
|
69
74
|
}
|
|
70
75
|
),
|
|
71
76
|
onClick,
|
|
72
77
|
children: [
|
|
73
|
-
StartIcon && /* @__PURE__ */ jsx(
|
|
78
|
+
!loading && StartIcon && /* @__PURE__ */ jsx(
|
|
74
79
|
StartIcon,
|
|
75
80
|
{
|
|
76
81
|
className: classNames(
|
|
@@ -80,14 +85,14 @@ var LinkButton = forwardRef(
|
|
|
80
85
|
)
|
|
81
86
|
}
|
|
82
87
|
),
|
|
83
|
-
/* @__PURE__ */ jsx(Typography_default, { size: textVariant_default[size], weight: "medium", children: /* @__PURE__ */ jsx(
|
|
88
|
+
!loading && text && /* @__PURE__ */ jsx(Typography_default, { size: textVariant_default[size], weight: "medium", children: /* @__PURE__ */ jsx(
|
|
84
89
|
"span",
|
|
85
90
|
{
|
|
86
91
|
className: foregroundColorClass,
|
|
87
92
|
children: text
|
|
88
93
|
}
|
|
89
94
|
) }),
|
|
90
|
-
EndIcon && /* @__PURE__ */ jsx(
|
|
95
|
+
!loading && EndIcon && /* @__PURE__ */ jsx(
|
|
91
96
|
EndIcon,
|
|
92
97
|
{
|
|
93
98
|
className: classNames(
|
|
@@ -96,6 +101,26 @@ var LinkButton = forwardRef(
|
|
|
96
101
|
foregroundColorClass
|
|
97
102
|
)
|
|
98
103
|
}
|
|
104
|
+
),
|
|
105
|
+
loading && /* @__PURE__ */ jsx(
|
|
106
|
+
"svg",
|
|
107
|
+
{
|
|
108
|
+
className: classNames(Button_module_default.loading, foregroundColorClass),
|
|
109
|
+
viewBox: "22 22 44 44",
|
|
110
|
+
width: loadingIconSize_default[size],
|
|
111
|
+
height: loadingIconSize_default[size],
|
|
112
|
+
children: /* @__PURE__ */ jsx(
|
|
113
|
+
"circle",
|
|
114
|
+
{
|
|
115
|
+
className: Button_module_default.loadingCircle,
|
|
116
|
+
cx: "44",
|
|
117
|
+
cy: "44",
|
|
118
|
+
r: "20.2",
|
|
119
|
+
fill: "none",
|
|
120
|
+
strokeWidth: "3.6"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
99
124
|
)
|
|
100
125
|
]
|
|
101
126
|
}
|
|
@@ -108,4 +133,4 @@ var LinkButton_default = LinkButton;
|
|
|
108
133
|
export {
|
|
109
134
|
LinkButton_default
|
|
110
135
|
};
|
|
111
|
-
//# sourceMappingURL=
|
|
136
|
+
//# sourceMappingURL=QVOCSKIN.js.map
|