@cambly/syntax-core 10.13.0 → 10.14.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.d.ts +7 -1
- package/dist/Button/Button.js +3 -3
- package/dist/Chip/Chip.cjs +2 -2
- package/dist/Chip/Chip.css +20 -14
- package/dist/Chip/Chip.css.map +1 -1
- package/dist/Chip/Chip.d.ts +6 -0
- package/dist/Chip/Chip.js +1 -1
- package/dist/Dialog/ModalDialog.cjs +5 -5
- package/dist/Dialog/ModalDialog.css +18 -22
- package/dist/Dialog/ModalDialog.css.map +1 -1
- package/dist/Dialog/ModalDialog.js +4 -4
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.css +18 -22
- package/dist/IconButton/IconButton.css.map +1 -1
- package/dist/IconButton/IconButton.d.ts +6 -0
- package/dist/IconButton/IconButton.js +3 -3
- package/dist/LinkButton/LinkButton.cjs +4 -4
- package/dist/LinkButton/LinkButton.d.ts +6 -0
- package/dist/LinkButton/LinkButton.js +3 -3
- package/dist/Popover/Popover.cjs +6 -6
- package/dist/Popover/Popover.css +18 -22
- package/dist/Popover/Popover.css.map +1 -1
- package/dist/Popover/Popover.js +5 -5
- package/dist/RichSelect/RichSelectBox.cjs +7 -7
- package/dist/RichSelect/RichSelectBox.css +20 -14
- package/dist/RichSelect/RichSelectBox.css.map +1 -1
- package/dist/RichSelect/RichSelectBox.js +6 -6
- package/dist/RichSelect/RichSelectChip.cjs +3 -3
- package/dist/RichSelect/RichSelectChip.css +20 -14
- package/dist/RichSelect/RichSelectChip.css.map +1 -1
- package/dist/RichSelect/RichSelectChip.js +2 -2
- package/dist/RichSelect/RichSelectList.cjs +12 -12
- package/dist/RichSelect/RichSelectList.css +38 -36
- package/dist/RichSelect/RichSelectList.css.map +1 -1
- package/dist/RichSelect/RichSelectList.js +11 -11
- package/dist/SelectList/SelectList.cjs +3 -3
- package/dist/SelectList/SelectList.js +2 -2
- package/dist/__chunks/{DSMWIJEY.cjs → 3P4HISCU.cjs} +3 -3
- package/dist/__chunks/{TIG3BSZG.js → 4FB7KTL3.js} +2 -2
- package/dist/__chunks/{OLWEXK5F.cjs → 4TWU6PQA.cjs} +6 -6
- package/dist/__chunks/{JGXQJLCD.js → 53RQSOUJ.js} +6 -5
- package/dist/__chunks/53RQSOUJ.js.map +1 -0
- package/dist/__chunks/{4JXNDR7B.cjs → 5T5R6ZMD.cjs} +6 -5
- package/dist/__chunks/5T5R6ZMD.cjs.map +1 -0
- package/dist/__chunks/{HZ7TRVX2.cjs → 5WZOSAYH.cjs} +12 -12
- package/dist/__chunks/{H6JCVQBU.cjs → DA3CET5G.cjs} +1 -1
- package/dist/__chunks/{H6JCVQBU.cjs.map → DA3CET5G.cjs.map} +1 -1
- package/dist/__chunks/{ZLBPIQ2I.js → E7G4CMBM.js} +2 -2
- package/dist/__chunks/{BXUTWPRU.cjs → EVDDEHP3.cjs} +3 -3
- package/dist/__chunks/{EE5VI7K5.js → F4PJ53QQ.js} +1 -1
- package/dist/__chunks/{EE5VI7K5.js.map → F4PJ53QQ.js.map} +1 -1
- package/dist/__chunks/{G7GMDR6I.js → FKHOGYZI.js} +2 -2
- package/dist/__chunks/{NUDTHTSM.js → FQMG5WUT.js} +5 -5
- package/dist/__chunks/{PRE7WZF5.js → GHPZTFQK.js} +2 -2
- package/dist/__chunks/HCM63U3J.cjs +64 -0
- package/dist/__chunks/HCM63U3J.cjs.map +1 -0
- package/dist/__chunks/{7P7YX4X2.cjs → IMYS42TL.cjs} +8 -8
- package/dist/__chunks/IMYS42TL.cjs.map +1 -0
- package/dist/__chunks/JGYZV3JA.js +64 -0
- package/dist/__chunks/JGYZV3JA.js.map +1 -0
- package/dist/__chunks/{L3CUWPPD.js → M2ABILBX.js} +8 -8
- package/dist/__chunks/M2ABILBX.js.map +1 -0
- package/dist/__chunks/{GRYQKIWR.cjs → MUNI4VXL.cjs} +31 -5
- package/dist/__chunks/MUNI4VXL.cjs.map +1 -0
- package/dist/__chunks/{YGM4Z46I.js → NKWR4CYF.js} +6 -5
- package/dist/__chunks/NKWR4CYF.js.map +1 -0
- package/dist/__chunks/OFW6A65B.js +82 -0
- package/dist/__chunks/OFW6A65B.js.map +1 -0
- package/dist/__chunks/{SFJT2TM2.cjs → OXXXLEUD.cjs} +6 -5
- package/dist/__chunks/OXXXLEUD.cjs.map +1 -0
- package/dist/__chunks/{L4RR2XJT.js → PX3OQSL4.js} +3 -3
- package/dist/__chunks/QWMAWIWI.cjs +82 -0
- package/dist/__chunks/QWMAWIWI.cjs.map +1 -0
- package/dist/__chunks/{2ZUWZKPV.js → YKGFFSWB.js} +32 -6
- package/dist/__chunks/YKGFFSWB.js.map +1 -0
- package/dist/__chunks/{XSHPEZBA.cjs → ZDDA4AKB.cjs} +3 -3
- package/dist/__chunks/{RZCA77DH.cjs → ZDSY6FEO.cjs} +3 -3
- package/dist/colors/backgroundColor.cjs +2 -2
- package/dist/colors/backgroundColor.d.ts +1 -1
- package/dist/colors/backgroundColor.js +1 -1
- package/dist/colors/foregroundColor.cjs +2 -2
- package/dist/colors/foregroundColor.d.ts +1 -1
- package/dist/colors/foregroundColor.js +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.css +38 -36
- package/dist/index.css.map +1 -1
- package/dist/index.js +13 -13
- package/package.json +2 -2
- package/dist/__chunks/2ZUWZKPV.js.map +0 -1
- package/dist/__chunks/4JXNDR7B.cjs.map +0 -1
- package/dist/__chunks/7P7YX4X2.cjs.map +0 -1
- package/dist/__chunks/A4O4F3KK.cjs +0 -57
- package/dist/__chunks/A4O4F3KK.cjs.map +0 -1
- package/dist/__chunks/GRYQKIWR.cjs.map +0 -1
- package/dist/__chunks/JGXQJLCD.js.map +0 -1
- package/dist/__chunks/JVOQF4CG.js +0 -44
- package/dist/__chunks/JVOQF4CG.js.map +0 -1
- package/dist/__chunks/L3CUWPPD.js.map +0 -1
- package/dist/__chunks/RKEF7WKZ.cjs +0 -44
- package/dist/__chunks/RKEF7WKZ.cjs.map +0 -1
- package/dist/__chunks/SFJT2TM2.cjs.map +0 -1
- package/dist/__chunks/Y2OAIOQE.js +0 -57
- package/dist/__chunks/Y2OAIOQE.js.map +0 -1
- package/dist/__chunks/YGM4Z46I.js.map +0 -1
- /package/dist/__chunks/{DSMWIJEY.cjs.map → 3P4HISCU.cjs.map} +0 -0
- /package/dist/__chunks/{TIG3BSZG.js.map → 4FB7KTL3.js.map} +0 -0
- /package/dist/__chunks/{OLWEXK5F.cjs.map → 4TWU6PQA.cjs.map} +0 -0
- /package/dist/__chunks/{HZ7TRVX2.cjs.map → 5WZOSAYH.cjs.map} +0 -0
- /package/dist/__chunks/{ZLBPIQ2I.js.map → E7G4CMBM.js.map} +0 -0
- /package/dist/__chunks/{BXUTWPRU.cjs.map → EVDDEHP3.cjs.map} +0 -0
- /package/dist/__chunks/{G7GMDR6I.js.map → FKHOGYZI.js.map} +0 -0
- /package/dist/__chunks/{NUDTHTSM.js.map → FQMG5WUT.js.map} +0 -0
- /package/dist/__chunks/{PRE7WZF5.js.map → GHPZTFQK.js.map} +0 -0
- /package/dist/__chunks/{L4RR2XJT.js.map → PX3OQSL4.js.map} +0 -0
- /package/dist/__chunks/{XSHPEZBA.cjs.map → ZDDA4AKB.cjs.map} +0 -0
- /package/dist/__chunks/{RZCA77DH.cjs.map → ZDSY6FEO.cjs.map} +0 -0
|
@@ -15,11 +15,11 @@ var _HWQUS53Mcjs = require('./HWQUS53M.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _HCM63U3Jcjs = require('./HCM63U3J.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _QWMAWIWIcjs = require('./QWMAWIWI.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
var _27K33DEMcjs = require('./27K33DEM.cjs');
|
|
@@ -55,14 +55,15 @@ var Button = _react.forwardRef.call(void 0,
|
|
|
55
55
|
fullWidth = false,
|
|
56
56
|
startIcon: StartIcon,
|
|
57
57
|
endIcon: EndIcon,
|
|
58
|
+
on = "lightBackground",
|
|
58
59
|
onClick,
|
|
59
60
|
tooltip,
|
|
60
61
|
type = "button"
|
|
61
62
|
}, ref) => {
|
|
62
63
|
const isHydrated = _K4AUV2VKcjs.useIsHydrated.call(void 0, );
|
|
63
64
|
const { themeName } = _6W5WRS53cjs.useTheme.call(void 0, );
|
|
64
|
-
const foregroundColorClass = themeName === "classic" ?
|
|
65
|
-
const backgroundColorClass = themeName === "classic" ?
|
|
65
|
+
const foregroundColorClass = themeName === "classic" ? _HCM63U3Jcjs.classicForegroundColor.call(void 0, _HWQUS53Mcjs.classicColor.call(void 0, color)) : _HCM63U3Jcjs.cambioForegroundColor.call(void 0, _HWQUS53Mcjs.cambioColor.call(void 0, color), on);
|
|
66
|
+
const backgroundColorClass = themeName === "classic" ? _QWMAWIWIcjs.classicBackgroundColor.call(void 0, _HWQUS53Mcjs.classicColor.call(void 0, color)) : _QWMAWIWIcjs.cambioBackgroundColor.call(void 0, _HWQUS53Mcjs.cambioColor.call(void 0, color), on);
|
|
66
67
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
67
68
|
"button",
|
|
68
69
|
{
|
|
@@ -133,4 +134,4 @@ var Button_default = Button;
|
|
|
133
134
|
|
|
134
135
|
|
|
135
136
|
exports.Button_default = Button_default;
|
|
136
|
-
//# sourceMappingURL=
|
|
137
|
+
//# sourceMappingURL=5T5R6ZMD.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,aAAY,uBAAsB,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,YAAW,sBAAqB,YAAW,sBAAqB,YAAW,sBAAqB,QAAO,kBAAiB,UAAS,qBAAoB,UAAS,qBAAoB,UAAS,qBAAoB,mBAAkB,8BAA6B,8BAA6B,yCAAwC,WAAU,sBAAqB,6BAA4B,sCAAqC,iBAAgB,2BAA0B;;;ADuK7sB,SAyBI,KAzBJ;AAnCN,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;AACjC,UAAM,EAAE,UAAU,IAAI,SAAS;AAE/B,UAAM,uBACJ,cAAc,YACV,uBAAuB,aAAa,KAAK,CAAC,IAC1C,sBAAsB,YAAY,KAAK,GAAG,EAAE;AAElD,UAAM,uBACJ,cAAc,YACV,uBAAuB,aAAa,KAAK,CAAC,IAC1C,sBAAsB,YAAY,KAAK,GAAG,EAAE;AAElD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb;AAAA,QACA,cAAY;AAAA,QACZ;AAAA,QACA,OAAO;AAAA,QACP,UAAU,CAAC,cAAc,YAAY;AAAA,QACrC;AAAA,QACA,WAAW;AAAA,UACT,sBAAO;AAAA,UACP;AAAA,UACA;AAAA,UACA,cAAc,YAAY,sBAAO,IAAI,IAAI,sBAAO,GAAG,YAAY;AAAA,UAC/D;AAAA,YACE,CAAC,sBAAO,SAAS,GAAG;AAAA,YACpB,CAAC,sBAAO,SAAS,GACf,cAAc,cAAc,SAAS,QAAQ,SAAS;AAAA,YACxD,CAAC,sBAAO,eAAe,GACrB,cAAc,aAAa,UAAU;AAAA,YACvC,CAAC,sBAAO,0BAA0B,GAChC,cAAc,aAAa,UAAU;AAAA,UACzC;AAAA,QACF;AAAA,QAEC;AAAA,WAAC,WAAW,aAAa,cAAc,aACtC,oBAAC,aAAU,WAAW,WAAW,sBAAO,MAAM,iBAAS,IAAI,CAAC,GAAG;AAAA,WAE9D,WAAW,eAAiB,CAAC,WAAW,SACzC,oBAAC,eAAI,UAAU,GACb;AAAA,YAAC;AAAA;AAAA,cACC,MACE,cAAc,YAAY,oBAAY,IAAI,IAAI,oBAAY,IAAI;AAAA,cAGhE;AAAA,gBAAC;AAAA;AAAA,kBAEC,WAAW;AAAA,kBACX,OAAO,EAAE,YAAY,IAAI;AAAA,kBAExB,oBAAU,cAAc;AAAA;AAAA,cAC3B;AAAA;AAAA,UACF,GACF;AAAA,UAED,CAAC,WAAW,WAAW,cAAc,aACpC,oBAAC,WAAQ,WAAW,WAAW,sBAAO,MAAM,iBAAS,IAAI,CAAC,GAAG;AAAA,UAE9D,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 { useTheme } from \"../ThemeProvider/ThemeProvider\";\nimport { classicColor, cambioColor } from \"./constants/color\";\nimport {\n classicBackgroundColor,\n cambioBackgroundColor,\n} from \"../colors/backgroundColor\";\nimport {\n classicForegroundColor,\n cambioForegroundColor,\n} from \"../colors/foregroundColor\";\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 * Classic only:\n * * `inverse`\n * * `success`\n *\n * Cambio only:\n * * `success-primary`\n * * `success-secondary`\n * * `success-tertiary`\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\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\"\n | \"inverse\";\n /**\n * The size of the button\n *\n * Classic:\n * * `sm`: 32px\n * * `md`: 40px\n * * `lg`: 48px\n *\n * Cambio:\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 * Note: startIcon is not supported in the Cambio theme\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 * Note: endIcon is not supported in the Cambio theme\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 (Cambio only)\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 const { themeName } = useTheme();\n\n const foregroundColorClass =\n themeName === \"classic\"\n ? classicForegroundColor(classicColor(color))\n : cambioForegroundColor(cambioColor(color), on);\n\n const backgroundColorClass =\n themeName === \"classic\"\n ? classicBackgroundColor(classicColor(color))\n : cambioBackgroundColor(cambioColor(color), on);\n\n return (\n <button\n data-testid={dataTestId}\n ref={ref}\n aria-label={accessibilityLabel}\n type={type}\n title={tooltip}\n disabled={!isHydrated || disabled || loading}\n onClick={onClick}\n className={classNames(\n styles.button,\n foregroundColorClass,\n backgroundColorClass,\n themeName === \"classic\" ? styles[size] : styles[`${size}Cambio`],\n {\n [styles.fullWidth]: fullWidth,\n [styles.buttonGap]:\n themeName === \"classic\" && (size === \"lg\" || size === \"md\"),\n [styles.secondaryBorder]:\n themeName === \"classic\" && color === \"secondary\",\n [styles.secondaryDestructiveBorder]:\n themeName === \"classic\" && color === \"destructive-secondary\",\n },\n )}\n >\n {!loading && StartIcon && themeName === \"classic\" && (\n <StartIcon className={classNames(styles.icon, iconSize[size])} />\n )}\n {((loading && loadingText) || (!loading && text)) && (\n <Box paddingX={1}>\n <Typography\n size={\n themeName === \"classic\" ? textVariant[size] : textVariant[size]\n }\n >\n <span\n // Temporary - until we have cambio colors on Typogrphay\n className={foregroundColorClass}\n style={{ fontWeight: 500 }}\n >\n {loading ? loadingText : text}\n </span>\n </Typography>\n </Box>\n )}\n {!loading && EndIcon && themeName === \"classic\" && (\n <EndIcon className={classNames(styles.icon, iconSize[size])} />\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_ddq3j_1\",\"buttonGap\":\"_buttonGap_ddq3j_9\",\"fullWidth\":\"_fullWidth_ddq3j_50\",\"sm\":\"_sm_ddq3j_54\",\"md\":\"_md_ddq3j_61\",\"lg\":\"_lg_ddq3j_68\",\"smCambio\":\"_smCambio_ddq3j_75\",\"mdCambio\":\"_mdCambio_ddq3j_82\",\"lgCambio\":\"_lgCambio_ddq3j_89\",\"icon\":\"_icon_ddq3j_96\",\"smIcon\":\"_smIcon_ddq3j_100\",\"mdIcon\":\"_mdIcon_ddq3j_107\",\"lgIcon\":\"_lgIcon_ddq3j_114\",\"secondaryBorder\":\"_secondaryBorder_ddq3j_121\",\"secondaryDestructiveBorder\":\"_secondaryDestructiveBorder_ddq3j_125\",\"loading\":\"_loading_ddq3j_139\",\"syntaxButtonLoadingRotate\":\"_syntaxButtonLoadingRotate_ddq3j_1\",\"loadingCircle\":\"_loadingCircle_ddq3j_143\"}"]}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _4TWU6PQAcjs = require('./4TWU6PQA.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _ZDDA4AKBcjs = require('./ZDDA4AKB.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _EVDDEHP3cjs = require('./EVDDEHP3.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _VL5ONCQDcjs = require('./VL5ONCQD.cjs');
|
|
@@ -19,7 +19,7 @@ var _UKLQ64N7cjs = require('./UKLQ64N7.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _DA3CET5Gcjs = require('./DA3CET5G.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
var _NFDOY7GEcjs = require('./NFDOY7GE.cjs');
|
|
@@ -107,11 +107,11 @@ function RichSelectList(props) {
|
|
|
107
107
|
const disabled = !isHydrated || disabledProp;
|
|
108
108
|
const overlayHandlerRef = _react.useRef.call(void 0, {});
|
|
109
109
|
const selectedKeysProp = _react.useMemo.call(void 0,
|
|
110
|
-
() =>
|
|
110
|
+
() => _4TWU6PQAcjs.convertSelection.call(void 0, selectedValuesProp),
|
|
111
111
|
[selectedValuesProp]
|
|
112
112
|
);
|
|
113
113
|
const defaultSelectedKeys = _react.useMemo.call(void 0,
|
|
114
|
-
() =>
|
|
114
|
+
() => _4TWU6PQAcjs.convertSelection.call(void 0, defaultSelectedValuesProp, /* @__PURE__ */ new Set()),
|
|
115
115
|
[defaultSelectedValuesProp]
|
|
116
116
|
);
|
|
117
117
|
const [selectedKeys, setSelectedKeys] = _utils.useControlledState.call(void 0,
|
|
@@ -149,7 +149,7 @@ function RichSelectList(props) {
|
|
|
149
149
|
_reactariacomponents.Provider,
|
|
150
150
|
{
|
|
151
151
|
values: [
|
|
152
|
-
[
|
|
152
|
+
[_4TWU6PQAcjs.RichSelectBoxContext, { autoFocus: true }],
|
|
153
153
|
[_VL5ONCQDcjs.DialogContext, { padding: autosave ? void 0 : 0 }]
|
|
154
154
|
// this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided
|
|
155
155
|
],
|
|
@@ -180,7 +180,7 @@ function RichSelectList(props) {
|
|
|
180
180
|
})
|
|
181
181
|
),
|
|
182
182
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
183
|
-
|
|
183
|
+
_EVDDEHP3cjs.Popover_default,
|
|
184
184
|
{
|
|
185
185
|
ref: overlayHandlerRef,
|
|
186
186
|
disabled,
|
|
@@ -192,7 +192,7 @@ function RichSelectList(props) {
|
|
|
192
192
|
padding: autosave ? void 0 : 5,
|
|
193
193
|
dangerouslySetInlineStyle: autosave ? void 0 : { __style: { paddingBottom: 0 } },
|
|
194
194
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
195
|
-
|
|
195
|
+
_4TWU6PQAcjs.RichSelectBox_default,
|
|
196
196
|
_X2SDR4SDcjs.__spreadProps.call(void 0, _X2SDR4SDcjs.__spreadValues.call(void 0, {
|
|
197
197
|
autosave,
|
|
198
198
|
selectedValues: selectedKeys,
|
|
@@ -237,7 +237,7 @@ function RichSelectList(props) {
|
|
|
237
237
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
238
238
|
"path",
|
|
239
239
|
{
|
|
240
|
-
fill: errorText ?
|
|
240
|
+
fill: errorText ? _DA3CET5Gcjs.ColorBaseDestructive700 : _DA3CET5Gcjs.ColorBaseGray800,
|
|
241
241
|
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"
|
|
242
242
|
}
|
|
243
243
|
)
|
|
@@ -265,11 +265,11 @@ function RichSelectList(props) {
|
|
|
265
265
|
}
|
|
266
266
|
var RichSelectList_default = Object.assign(RichSelectList, {
|
|
267
267
|
Section: _NFDOY7GEcjs.RichSelectSection_default,
|
|
268
|
-
Chip:
|
|
268
|
+
Chip: _ZDDA4AKBcjs.RichSelectChip_default,
|
|
269
269
|
RadioButton: _I5HC6BIKcjs.RichSelectRadioButton_default
|
|
270
270
|
});
|
|
271
271
|
|
|
272
272
|
|
|
273
273
|
|
|
274
274
|
exports.RichSelectList_default = RichSelectList_default;
|
|
275
|
-
//# sourceMappingURL=
|
|
275
|
+
//# sourceMappingURL=5WZOSAYH.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 Mon, 18 Mar 2024 15:48:20 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\";\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
ModalDialog_default
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./GHPZTFQK.js";
|
|
5
5
|
import {
|
|
6
6
|
Dialog_default
|
|
7
7
|
} from "./A7AAGKC2.js";
|
|
@@ -141,4 +141,4 @@ export {
|
|
|
141
141
|
AriaPopover,
|
|
142
142
|
Popover_default
|
|
143
143
|
};
|
|
144
|
-
//# sourceMappingURL=
|
|
144
|
+
//# sourceMappingURL=E7G4CMBM.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
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 _3P4HISCUcjs = require('./3P4HISCU.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _VL5ONCQDcjs = require('./VL5ONCQD.cjs');
|
|
@@ -100,7 +100,7 @@ var Popover = _react.forwardRef.call(void 0, function Popover2(props, ref) {
|
|
|
100
100
|
} = props;
|
|
101
101
|
const modal = !children || modalProp;
|
|
102
102
|
const modalNode = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
103
|
-
|
|
103
|
+
_3P4HISCUcjs.ModalDialog_default,
|
|
104
104
|
{
|
|
105
105
|
accessibilityLabel,
|
|
106
106
|
accessibilityCloseLabel,
|
|
@@ -141,4 +141,4 @@ var Popover_default = Popover;
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
exports.AriaPopover = AriaPopover; exports.Popover_default = Popover_default;
|
|
144
|
-
//# sourceMappingURL=
|
|
144
|
+
//# sourceMappingURL=EVDDEHP3.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on
|
|
1
|
+
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 18 Mar 2024 15:48:20 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\";\n"],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
ColorBaseDestructive700,
|
|
7
7
|
ColorBaseGray800
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./F4PJ53QQ.js";
|
|
9
9
|
import {
|
|
10
10
|
Focus_module_default
|
|
11
11
|
} from "./KKADUD65.js";
|
|
@@ -145,4 +145,4 @@ SelectList.Option = SelectOption_default;
|
|
|
145
145
|
export {
|
|
146
146
|
SelectList
|
|
147
147
|
};
|
|
148
|
-
//# sourceMappingURL=
|
|
148
|
+
//# sourceMappingURL=FKHOGYZI.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
RichSelectBoxContext,
|
|
4
4
|
RichSelectBox_default,
|
|
5
5
|
convertSelection
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./PX3OQSL4.js";
|
|
7
7
|
import {
|
|
8
8
|
RichSelectChip_default
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./4FB7KTL3.js";
|
|
10
10
|
import {
|
|
11
11
|
Popover_default
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./E7G4CMBM.js";
|
|
13
13
|
import {
|
|
14
14
|
DialogContext
|
|
15
15
|
} from "./A7AAGKC2.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
ColorBaseDestructive700,
|
|
21
21
|
ColorBaseGray800
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./F4PJ53QQ.js";
|
|
23
23
|
import {
|
|
24
24
|
RichSelectSection_default
|
|
25
25
|
} from "./53I23AHM.js";
|
|
@@ -272,4 +272,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
|
|
|
272
272
|
export {
|
|
273
273
|
RichSelectList_default
|
|
274
274
|
};
|
|
275
|
-
//# sourceMappingURL=
|
|
275
|
+
//# sourceMappingURL=FQMG5WUT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
IconButton_default
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./M2ABILBX.js";
|
|
5
5
|
import {
|
|
6
6
|
Dialog_default
|
|
7
7
|
} from "./A7AAGKC2.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
AriaModal,
|
|
158
158
|
ModalDialog_default
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=
|
|
160
|
+
//# sourceMappingURL=GHPZTFQK.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _VKB7KOAHcjs = require('./VKB7KOAH.cjs');
|
|
5
|
+
|
|
6
|
+
// src/colors/foregroundColor.ts
|
|
7
|
+
function classicForegroundColor(color) {
|
|
8
|
+
switch (color) {
|
|
9
|
+
case "secondary":
|
|
10
|
+
case "tertiary":
|
|
11
|
+
return _VKB7KOAHcjs.colors_module_default.primary700Color;
|
|
12
|
+
case "destructive-secondary":
|
|
13
|
+
case "destructive-tertiary":
|
|
14
|
+
return _VKB7KOAHcjs.colors_module_default.destructive700Color;
|
|
15
|
+
case "branded":
|
|
16
|
+
return _VKB7KOAHcjs.colors_module_default.gray900Color;
|
|
17
|
+
case "inverse":
|
|
18
|
+
return _VKB7KOAHcjs.colors_module_default.whiteColor;
|
|
19
|
+
default:
|
|
20
|
+
return _VKB7KOAHcjs.colors_module_default.whiteColor;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function cambioForegroundColor(color, on) {
|
|
24
|
+
if (on === "lightBackground") {
|
|
25
|
+
switch (color) {
|
|
26
|
+
case "primary":
|
|
27
|
+
case "success-primary":
|
|
28
|
+
case "destructive-primary":
|
|
29
|
+
return _VKB7KOAHcjs.colors_module_default.cambioWhiteColor;
|
|
30
|
+
case "success-secondary":
|
|
31
|
+
case "success-tertiary":
|
|
32
|
+
return _VKB7KOAHcjs.colors_module_default.cambioSuccess900Color;
|
|
33
|
+
case "destructive-secondary":
|
|
34
|
+
case "destructive-tertiary":
|
|
35
|
+
return _VKB7KOAHcjs.colors_module_default.cambioDestructive900Color;
|
|
36
|
+
default:
|
|
37
|
+
return _VKB7KOAHcjs.colors_module_default.cambioBlackColor;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
switch (color) {
|
|
41
|
+
case "primary":
|
|
42
|
+
case "success-primary":
|
|
43
|
+
case "destructive-primary":
|
|
44
|
+
return _VKB7KOAHcjs.colors_module_default.cambioBlackColor;
|
|
45
|
+
case "secondary":
|
|
46
|
+
case "tertiary":
|
|
47
|
+
return _VKB7KOAHcjs.colors_module_default.cambioWhiteColor;
|
|
48
|
+
case "success-secondary":
|
|
49
|
+
case "success-tertiary":
|
|
50
|
+
return _VKB7KOAHcjs.colors_module_default.cambioSuccess100Color;
|
|
51
|
+
case "destructive-secondary":
|
|
52
|
+
case "destructive-tertiary":
|
|
53
|
+
return _VKB7KOAHcjs.colors_module_default.cambioDestructive100Color;
|
|
54
|
+
default:
|
|
55
|
+
return _VKB7KOAHcjs.colors_module_default.cambioBlackColor;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
exports.classicForegroundColor = classicForegroundColor; exports.cambioForegroundColor = cambioForegroundColor;
|
|
64
|
+
//# sourceMappingURL=HCM63U3J.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/colors/foregroundColor.ts"],"names":[],"mappings":";;;;;;AAGO,SAAS,uBAAuB,OAAuC;AAC5E,UAAQ,OAAO;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB;AACE,aAAO,sBAAO;AAAA,EAClB;AACF;AAEO,SAAS,sBACd,OACA,IACQ;AACR,MAAI,OAAO,mBAAmB;AAC5B,YAAQ,OAAO;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB;AACE,eAAO,sBAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,OAAO;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB;AACE,eAAO,sBAAO;AAAA,IAClB;AAAA,EACF;AACF","sourcesContent":["import { type CambioColor, type Color } from \"../constants\";\nimport styles from \"./colors.module.css\";\n\nexport function classicForegroundColor(color: (typeof Color)[number]): string {\n switch (color) {\n case \"secondary\":\n case \"tertiary\":\n return styles.primary700Color;\n case \"destructive-secondary\":\n case \"destructive-tertiary\":\n return styles.destructive700Color;\n case \"branded\":\n return styles.gray900Color;\n case \"inverse\":\n return styles.whiteColor;\n default:\n return styles.whiteColor;\n }\n}\n\nexport function cambioForegroundColor(\n color: (typeof CambioColor)[number],\n on: \"lightBackground\" | \"darkBackground\",\n): string {\n if (on === \"lightBackground\") {\n switch (color) {\n case \"primary\":\n case \"success-primary\":\n case \"destructive-primary\":\n return styles.cambioWhiteColor;\n case \"success-secondary\":\n case \"success-tertiary\":\n return styles.cambioSuccess900Color;\n case \"destructive-secondary\":\n case \"destructive-tertiary\":\n return styles.cambioDestructive900Color;\n default:\n return styles.cambioBlackColor;\n }\n } else {\n switch (color) {\n case \"primary\":\n case \"success-primary\":\n case \"destructive-primary\":\n return styles.cambioBlackColor;\n case \"secondary\":\n case \"tertiary\":\n return styles.cambioWhiteColor;\n case \"success-secondary\":\n case \"success-tertiary\":\n return styles.cambioSuccess100Color;\n case \"destructive-secondary\":\n case \"destructive-tertiary\":\n return styles.cambioDestructive100Color;\n default: // branded\n return styles.cambioBlackColor;\n }\n }\n}\n"]}
|
|
@@ -9,11 +9,11 @@ var _HWQUS53Mcjs = require('./HWQUS53M.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _HCM63U3Jcjs = require('./HCM63U3J.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _QWMAWIWIcjs = require('./QWMAWIWI.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _6W5WRS53cjs = require('./6W5WRS53.cjs');
|
|
@@ -26,7 +26,7 @@ var _classnames = require('classnames'); var _classnames2 = _interopRequireDefau
|
|
|
26
26
|
var _react = require('react');
|
|
27
27
|
|
|
28
28
|
// css-module:./IconButton.module.css#css-module
|
|
29
|
-
var IconButton_module_default = { "iconButton": "
|
|
29
|
+
var IconButton_module_default = { "iconButton": "_iconButton_4ynk4_1", "iconButtonNoBorder": "_iconButtonNoBorder_4ynk4_8", "sm": "_sm_4ynk4_49", "md": "_md_4ynk4_54", "lg": "_lg_4ynk4_59", "smCambio": "_smCambio_4ynk4_64", "mdCambio": "_mdCambio_4ynk4_69", "lgCambio": "_lgCambio_4ynk4_74", "smIcon": "_smIcon_4ynk4_79", "mdIcon": "_mdIcon_4ynk4_86", "lgIcon": "_lgIcon_4ynk4_93", "smIconCambio": "_smIconCambio_4ynk4_100", "mdIconCambio": "_mdIconCambio_4ynk4_107", "lgIconCambio": "_lgIconCambio_4ynk4_114" };
|
|
30
30
|
|
|
31
31
|
// src/IconButton/IconButton.tsx
|
|
32
32
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -38,8 +38,7 @@ var classicIconSize = {
|
|
|
38
38
|
var cambioIconSize = {
|
|
39
39
|
sm: IconButton_module_default.smIconCambio,
|
|
40
40
|
md: IconButton_module_default.mdIconCambio,
|
|
41
|
-
lg: IconButton_module_default.lgIconCambio
|
|
42
|
-
xl: IconButton_module_default.xlIconCambio
|
|
41
|
+
lg: IconButton_module_default.lgIconCambio
|
|
43
42
|
};
|
|
44
43
|
var IconButton = _react.forwardRef.call(void 0,
|
|
45
44
|
({
|
|
@@ -50,12 +49,13 @@ var IconButton = _react.forwardRef.call(void 0,
|
|
|
50
49
|
icon: Icon,
|
|
51
50
|
size = "md",
|
|
52
51
|
tooltip,
|
|
52
|
+
on = "lightBackground",
|
|
53
53
|
onClick
|
|
54
54
|
}, ref) => {
|
|
55
55
|
const isHydrated = _K4AUV2VKcjs.useIsHydrated.call(void 0, );
|
|
56
56
|
const { themeName } = _6W5WRS53cjs.useTheme.call(void 0, );
|
|
57
|
-
const foregroundColorClass = themeName === "classic" ?
|
|
58
|
-
const backgroundColorClass = themeName === "classic" ?
|
|
57
|
+
const foregroundColorClass = themeName === "classic" ? _HCM63U3Jcjs.classicForegroundColor.call(void 0, _HWQUS53Mcjs.classicColor.call(void 0, color)) : _HCM63U3Jcjs.cambioForegroundColor.call(void 0, _HWQUS53Mcjs.cambioColor.call(void 0, color), on);
|
|
58
|
+
const backgroundColorClass = themeName === "classic" ? _QWMAWIWIcjs.classicBackgroundColor.call(void 0, _HWQUS53Mcjs.classicColor.call(void 0, color)) : _QWMAWIWIcjs.cambioBackgroundColor.call(void 0, _HWQUS53Mcjs.cambioColor.call(void 0, color), on);
|
|
59
59
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
60
60
|
"button",
|
|
61
61
|
{
|
|
@@ -93,4 +93,4 @@ var IconButton_default = IconButton;
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
exports.IconButton_default = IconButton_default;
|
|
96
|
-
//# sourceMappingURL=
|
|
96
|
+
//# sourceMappingURL=IMYS42TL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/IconButton/IconButton.tsx","css-module:./IconButton.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,gBAAgB;AAKvB,SAAgB,kBAAkB;;;ACLkE,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,sBAAqB,+BAA8B,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,YAAW,sBAAqB,YAAW,sBAAqB,YAAW,sBAAqB,UAAS,oBAAmB,UAAS,oBAAmB,UAAS,oBAAmB,gBAAe,2BAA0B,gBAAe,2BAA0B,gBAAe,0BAAyB;;;ADoK5iB;AAnJR,IAAM,kBAAkB;AAAA,EACtB,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AACb;AAEA,IAAM,iBAAiB;AAAA,EACrB,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AACb;AAmFA,IAAM,aAAa;AAAA,EACjB,CACE;AAAA,IACE;AAAA,IACA,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,IACP;AAAA,IACA,KAAK;AAAA,IACL;AAAA,EACF,GACA,QACG;AACH,UAAM,aAAa,cAAc;AACjC,UAAM,EAAE,UAAU,IAAI,SAAS;AAE/B,UAAM,uBACJ,cAAc,YACV,uBAAuB,aAAa,KAAK,CAAC,IAC1C,sBAAsB,YAAY,KAAK,GAAG,EAAE;AAElD,UAAM,uBACJ,cAAc,YACV,uBAAuB,aAAa,KAAK,CAAC,IAC1C,sBAAsB,YAAY,KAAK,GAAG,EAAE;AAElD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY;AAAA,QACZ,eAAa;AAAA,QACb,MAAK;AAAA,QACL,OAAO;AAAA,QACP,UAAU,CAAC,cAAc;AAAA,QACzB;AAAA,QACA,WAAW;AAAA,UACT,0BAAO;AAAA,UACP;AAAA,UACA;AAAA,UACA,cAAc,YAAY,0BAAO,IAAI,IAAI,0BAAO,GAAG,YAAY;AAAA,UAC/D;AAAA,YACE,CAAC,sBAAa,eAAe,GAC3B,cAAc,aAAa,UAAU;AAAA,YACvC,CAAC,sBAAa,0BAA0B,GACtC,cAAc,aAAa,UAAU;AAAA,YACvC,CAAC,0BAAO,kBAAkB,GACvB,cAAc,aACb,CAAC,CAAC,aAAa,uBAAuB,EAAE,SAAS,KAAK,KACxD,cAAc;AAAA,UAClB;AAAA,QACF;AAAA,QACA;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,WACE,cAAc,YACV,gBAAgB,IAAI,IACpB,eAAe,IAAI;AAAA;AAAA,QAE3B;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AAEzB,IAAO,qBAAQ","sourcesContent":["import classNames from \"classnames\";\nimport {\n classicForegroundColor,\n cambioForegroundColor,\n} from \"../colors/foregroundColor\";\nimport React, { forwardRef } from \"react\";\nimport { type Size } from \"../constants\";\nimport styles from \"./IconButton.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\nimport { classicColor, cambioColor } from \"../Button/constants/color\";\nimport buttonStyles from \"../Button/Button.module.css\";\nimport {\n classicBackgroundColor,\n cambioBackgroundColor,\n} from \"../colors/backgroundColor\";\n\nconst classicIconSize = {\n sm: styles.smIcon,\n md: styles.mdIcon,\n lg: styles.lgIcon,\n};\n\nconst cambioIconSize = {\n sm: styles.smIconCambio,\n md: styles.mdIconCambio,\n lg: styles.lgIconCambio,\n};\n\ntype IconButtonProps = {\n /**\n * The color of the button\n *\n * Classic only:\n * * `inverse`\n * * `success`\n *\n * Cambio only:\n * * `success-primary`\n * * `success-secondary`\n * * `success-tertiary`\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\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\"\n | \"inverse\";\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The size of the button\n *\n * Classic:\n * * `sm`: 32px\n * * `md`: 40px\n * * `lg`: 48px\n *\n * Cambio:\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 * The icon to be displayed. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n icon: React.ComponentType<{ className?: string }>;\n /**\n * If `true`, the button will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button (Cambio only)\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\n/**\n * [IconButton](https://cambly-syntax.vercel.app/?path=/docs/components-iconbutton--docs) is a clickable element that is used to perform an action.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n accessibilityLabel,\n color = \"primary\",\n \"data-testid\": dataTestId,\n disabled = false,\n icon: Icon,\n size = \"md\",\n tooltip,\n on = \"lightBackground\",\n onClick,\n }: IconButtonProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n const { themeName } = useTheme();\n\n const foregroundColorClass =\n themeName === \"classic\"\n ? classicForegroundColor(classicColor(color))\n : cambioForegroundColor(cambioColor(color), on);\n\n const backgroundColorClass =\n themeName === \"classic\"\n ? classicBackgroundColor(classicColor(color))\n : cambioBackgroundColor(cambioColor(color), on);\n\n return (\n <button\n aria-label={accessibilityLabel}\n data-testid={dataTestId}\n type=\"button\"\n title={tooltip}\n disabled={!isHydrated || disabled}\n onClick={onClick}\n className={classNames(\n styles.iconButton,\n foregroundColorClass,\n backgroundColorClass,\n themeName === \"classic\" ? styles[size] : styles[`${size}Cambio`],\n {\n [buttonStyles.secondaryBorder]:\n themeName === \"classic\" && color === \"secondary\",\n [buttonStyles.secondaryDestructiveBorder]:\n themeName === \"classic\" && color === \"destructive-secondary\",\n [styles.iconButtonNoBorder]:\n (themeName === \"classic\" &&\n ![\"secondary\", \"destructive-secondary\"].includes(color)) ||\n themeName === \"cambio\",\n },\n )}\n ref={ref}\n >\n <Icon\n className={\n themeName === \"classic\"\n ? classicIconSize[size]\n : cambioIconSize[size]\n }\n />\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n\nexport default IconButton;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/IconButton/IconButton.module.css\"; export default {\"iconButton\":\"_iconButton_4ynk4_1\",\"iconButtonNoBorder\":\"_iconButtonNoBorder_4ynk4_8\",\"sm\":\"_sm_4ynk4_49\",\"md\":\"_md_4ynk4_54\",\"lg\":\"_lg_4ynk4_59\",\"smCambio\":\"_smCambio_4ynk4_64\",\"mdCambio\":\"_mdCambio_4ynk4_69\",\"lgCambio\":\"_lgCambio_4ynk4_74\",\"smIcon\":\"_smIcon_4ynk4_79\",\"mdIcon\":\"_mdIcon_4ynk4_86\",\"lgIcon\":\"_lgIcon_4ynk4_93\",\"smIconCambio\":\"_smIconCambio_4ynk4_100\",\"mdIconCambio\":\"_mdIconCambio_4ynk4_107\",\"lgIconCambio\":\"_lgIconCambio_4ynk4_114\"}"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import {
|
|
3
|
+
colors_module_default
|
|
4
|
+
} from "./FMQVMNVR.js";
|
|
5
|
+
|
|
6
|
+
// src/colors/foregroundColor.ts
|
|
7
|
+
function classicForegroundColor(color) {
|
|
8
|
+
switch (color) {
|
|
9
|
+
case "secondary":
|
|
10
|
+
case "tertiary":
|
|
11
|
+
return colors_module_default.primary700Color;
|
|
12
|
+
case "destructive-secondary":
|
|
13
|
+
case "destructive-tertiary":
|
|
14
|
+
return colors_module_default.destructive700Color;
|
|
15
|
+
case "branded":
|
|
16
|
+
return colors_module_default.gray900Color;
|
|
17
|
+
case "inverse":
|
|
18
|
+
return colors_module_default.whiteColor;
|
|
19
|
+
default:
|
|
20
|
+
return colors_module_default.whiteColor;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function cambioForegroundColor(color, on) {
|
|
24
|
+
if (on === "lightBackground") {
|
|
25
|
+
switch (color) {
|
|
26
|
+
case "primary":
|
|
27
|
+
case "success-primary":
|
|
28
|
+
case "destructive-primary":
|
|
29
|
+
return colors_module_default.cambioWhiteColor;
|
|
30
|
+
case "success-secondary":
|
|
31
|
+
case "success-tertiary":
|
|
32
|
+
return colors_module_default.cambioSuccess900Color;
|
|
33
|
+
case "destructive-secondary":
|
|
34
|
+
case "destructive-tertiary":
|
|
35
|
+
return colors_module_default.cambioDestructive900Color;
|
|
36
|
+
default:
|
|
37
|
+
return colors_module_default.cambioBlackColor;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
switch (color) {
|
|
41
|
+
case "primary":
|
|
42
|
+
case "success-primary":
|
|
43
|
+
case "destructive-primary":
|
|
44
|
+
return colors_module_default.cambioBlackColor;
|
|
45
|
+
case "secondary":
|
|
46
|
+
case "tertiary":
|
|
47
|
+
return colors_module_default.cambioWhiteColor;
|
|
48
|
+
case "success-secondary":
|
|
49
|
+
case "success-tertiary":
|
|
50
|
+
return colors_module_default.cambioSuccess100Color;
|
|
51
|
+
case "destructive-secondary":
|
|
52
|
+
case "destructive-tertiary":
|
|
53
|
+
return colors_module_default.cambioDestructive100Color;
|
|
54
|
+
default:
|
|
55
|
+
return colors_module_default.cambioBlackColor;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
classicForegroundColor,
|
|
62
|
+
cambioForegroundColor
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=JGYZV3JA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/colors/foregroundColor.ts"],"sourcesContent":["import { type CambioColor, type Color } from \"../constants\";\nimport styles from \"./colors.module.css\";\n\nexport function classicForegroundColor(color: (typeof Color)[number]): string {\n switch (color) {\n case \"secondary\":\n case \"tertiary\":\n return styles.primary700Color;\n case \"destructive-secondary\":\n case \"destructive-tertiary\":\n return styles.destructive700Color;\n case \"branded\":\n return styles.gray900Color;\n case \"inverse\":\n return styles.whiteColor;\n default:\n return styles.whiteColor;\n }\n}\n\nexport function cambioForegroundColor(\n color: (typeof CambioColor)[number],\n on: \"lightBackground\" | \"darkBackground\",\n): string {\n if (on === \"lightBackground\") {\n switch (color) {\n case \"primary\":\n case \"success-primary\":\n case \"destructive-primary\":\n return styles.cambioWhiteColor;\n case \"success-secondary\":\n case \"success-tertiary\":\n return styles.cambioSuccess900Color;\n case \"destructive-secondary\":\n case \"destructive-tertiary\":\n return styles.cambioDestructive900Color;\n default:\n return styles.cambioBlackColor;\n }\n } else {\n switch (color) {\n case \"primary\":\n case \"success-primary\":\n case \"destructive-primary\":\n return styles.cambioBlackColor;\n case \"secondary\":\n case \"tertiary\":\n return styles.cambioWhiteColor;\n case \"success-secondary\":\n case \"success-tertiary\":\n return styles.cambioSuccess100Color;\n case \"destructive-secondary\":\n case \"destructive-tertiary\":\n return styles.cambioDestructive100Color;\n default: // branded\n return styles.cambioBlackColor;\n }\n }\n}\n"],"mappings":";;;;;;AAGO,SAAS,uBAAuB,OAAuC;AAC5E,UAAQ,OAAO;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB,KAAK;AACH,aAAO,sBAAO;AAAA,IAChB;AACE,aAAO,sBAAO;AAAA,EAClB;AACF;AAEO,SAAS,sBACd,OACA,IACQ;AACR,MAAI,OAAO,mBAAmB;AAC5B,YAAQ,OAAO;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB;AACE,eAAO,sBAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,OAAO;AAAA,MACb,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AACH,eAAO,sBAAO;AAAA,MAChB;AACE,eAAO,sBAAO;AAAA,IAClB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
cambioForegroundColor,
|
|
11
11
|
classicForegroundColor
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./JGYZV3JA.js";
|
|
13
13
|
import {
|
|
14
14
|
cambioBackgroundColor,
|
|
15
15
|
classicBackgroundColor
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./OFW6A65B.js";
|
|
17
17
|
import {
|
|
18
18
|
useTheme
|
|
19
19
|
} from "./FY4WHNNR.js";
|
|
@@ -26,7 +26,7 @@ import classNames from "classnames";
|
|
|
26
26
|
import { forwardRef } from "react";
|
|
27
27
|
|
|
28
28
|
// css-module:./IconButton.module.css#css-module
|
|
29
|
-
var IconButton_module_default = { "iconButton": "
|
|
29
|
+
var IconButton_module_default = { "iconButton": "_iconButton_4ynk4_1", "iconButtonNoBorder": "_iconButtonNoBorder_4ynk4_8", "sm": "_sm_4ynk4_49", "md": "_md_4ynk4_54", "lg": "_lg_4ynk4_59", "smCambio": "_smCambio_4ynk4_64", "mdCambio": "_mdCambio_4ynk4_69", "lgCambio": "_lgCambio_4ynk4_74", "smIcon": "_smIcon_4ynk4_79", "mdIcon": "_mdIcon_4ynk4_86", "lgIcon": "_lgIcon_4ynk4_93", "smIconCambio": "_smIconCambio_4ynk4_100", "mdIconCambio": "_mdIconCambio_4ynk4_107", "lgIconCambio": "_lgIconCambio_4ynk4_114" };
|
|
30
30
|
|
|
31
31
|
// src/IconButton/IconButton.tsx
|
|
32
32
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -38,8 +38,7 @@ var classicIconSize = {
|
|
|
38
38
|
var cambioIconSize = {
|
|
39
39
|
sm: IconButton_module_default.smIconCambio,
|
|
40
40
|
md: IconButton_module_default.mdIconCambio,
|
|
41
|
-
lg: IconButton_module_default.lgIconCambio
|
|
42
|
-
xl: IconButton_module_default.xlIconCambio
|
|
41
|
+
lg: IconButton_module_default.lgIconCambio
|
|
43
42
|
};
|
|
44
43
|
var IconButton = forwardRef(
|
|
45
44
|
({
|
|
@@ -50,12 +49,13 @@ var IconButton = forwardRef(
|
|
|
50
49
|
icon: Icon,
|
|
51
50
|
size = "md",
|
|
52
51
|
tooltip,
|
|
52
|
+
on = "lightBackground",
|
|
53
53
|
onClick
|
|
54
54
|
}, ref) => {
|
|
55
55
|
const isHydrated = useIsHydrated();
|
|
56
56
|
const { themeName } = useTheme();
|
|
57
|
-
const foregroundColorClass = themeName === "classic" ? classicForegroundColor(classicColor(color)) : cambioForegroundColor(cambioColor(color));
|
|
58
|
-
const backgroundColorClass = themeName === "classic" ? classicBackgroundColor(classicColor(color)) : cambioBackgroundColor(cambioColor(color));
|
|
57
|
+
const foregroundColorClass = themeName === "classic" ? classicForegroundColor(classicColor(color)) : cambioForegroundColor(cambioColor(color), on);
|
|
58
|
+
const backgroundColorClass = themeName === "classic" ? classicBackgroundColor(classicColor(color)) : cambioBackgroundColor(cambioColor(color), on);
|
|
59
59
|
return /* @__PURE__ */ jsx(
|
|
60
60
|
"button",
|
|
61
61
|
{
|
|
@@ -93,4 +93,4 @@ var IconButton_default = IconButton;
|
|
|
93
93
|
export {
|
|
94
94
|
IconButton_default
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=
|
|
96
|
+
//# sourceMappingURL=M2ABILBX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/IconButton/IconButton.tsx","css-module:./IconButton.module.css#css-module"],"sourcesContent":["import classNames from \"classnames\";\nimport {\n classicForegroundColor,\n cambioForegroundColor,\n} from \"../colors/foregroundColor\";\nimport React, { forwardRef } from \"react\";\nimport { type Size } from \"../constants\";\nimport styles from \"./IconButton.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\nimport { classicColor, cambioColor } from \"../Button/constants/color\";\nimport buttonStyles from \"../Button/Button.module.css\";\nimport {\n classicBackgroundColor,\n cambioBackgroundColor,\n} from \"../colors/backgroundColor\";\n\nconst classicIconSize = {\n sm: styles.smIcon,\n md: styles.mdIcon,\n lg: styles.lgIcon,\n};\n\nconst cambioIconSize = {\n sm: styles.smIconCambio,\n md: styles.mdIconCambio,\n lg: styles.lgIconCambio,\n};\n\ntype IconButtonProps = {\n /**\n * The color of the button\n *\n * Classic only:\n * * `inverse`\n * * `success`\n *\n * Cambio only:\n * * `success-primary`\n * * `success-secondary`\n * * `success-tertiary`\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\"\n | \"success-primary\"\n | \"success-secondary\"\n | \"success-tertiary\"\n | \"inverse\";\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The size of the button\n *\n * Classic:\n * * `sm`: 32px\n * * `md`: 40px\n * * `lg`: 48px\n *\n * Cambio:\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 * The icon to be displayed. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)\n */\n icon: React.ComponentType<{ className?: string }>;\n /**\n * If `true`, the button will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Indicate whether the button renders on a light or dark background. Changes the color of the button (Cambio only)\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\n/**\n * [IconButton](https://cambly-syntax.vercel.app/?path=/docs/components-iconbutton--docs) is a clickable element that is used to perform an action.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n accessibilityLabel,\n color = \"primary\",\n \"data-testid\": dataTestId,\n disabled = false,\n icon: Icon,\n size = \"md\",\n tooltip,\n on = \"lightBackground\",\n onClick,\n }: IconButtonProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n const { themeName } = useTheme();\n\n const foregroundColorClass =\n themeName === \"classic\"\n ? classicForegroundColor(classicColor(color))\n : cambioForegroundColor(cambioColor(color), on);\n\n const backgroundColorClass =\n themeName === \"classic\"\n ? classicBackgroundColor(classicColor(color))\n : cambioBackgroundColor(cambioColor(color), on);\n\n return (\n <button\n aria-label={accessibilityLabel}\n data-testid={dataTestId}\n type=\"button\"\n title={tooltip}\n disabled={!isHydrated || disabled}\n onClick={onClick}\n className={classNames(\n styles.iconButton,\n foregroundColorClass,\n backgroundColorClass,\n themeName === \"classic\" ? styles[size] : styles[`${size}Cambio`],\n {\n [buttonStyles.secondaryBorder]:\n themeName === \"classic\" && color === \"secondary\",\n [buttonStyles.secondaryDestructiveBorder]:\n themeName === \"classic\" && color === \"destructive-secondary\",\n [styles.iconButtonNoBorder]:\n (themeName === \"classic\" &&\n ![\"secondary\", \"destructive-secondary\"].includes(color)) ||\n themeName === \"cambio\",\n },\n )}\n ref={ref}\n >\n <Icon\n className={\n themeName === \"classic\"\n ? classicIconSize[size]\n : cambioIconSize[size]\n }\n />\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n\nexport default IconButton;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/IconButton/IconButton.module.css\"; export default {\"iconButton\":\"_iconButton_4ynk4_1\",\"iconButtonNoBorder\":\"_iconButtonNoBorder_4ynk4_8\",\"sm\":\"_sm_4ynk4_49\",\"md\":\"_md_4ynk4_54\",\"lg\":\"_lg_4ynk4_59\",\"smCambio\":\"_smCambio_4ynk4_64\",\"mdCambio\":\"_mdCambio_4ynk4_69\",\"lgCambio\":\"_lgCambio_4ynk4_74\",\"smIcon\":\"_smIcon_4ynk4_79\",\"mdIcon\":\"_mdIcon_4ynk4_86\",\"lgIcon\":\"_lgIcon_4ynk4_93\",\"smIconCambio\":\"_smIconCambio_4ynk4_100\",\"mdIconCambio\":\"_mdIconCambio_4ynk4_107\",\"lgIconCambio\":\"_lgIconCambio_4ynk4_114\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,gBAAgB;AAKvB,SAAgB,kBAAkB;;;ACLkE,IAAO,4BAAQ,EAAC,cAAa,uBAAsB,sBAAqB,+BAA8B,MAAK,gBAAe,MAAK,gBAAe,MAAK,gBAAe,YAAW,sBAAqB,YAAW,sBAAqB,YAAW,sBAAqB,UAAS,oBAAmB,UAAS,oBAAmB,UAAS,oBAAmB,gBAAe,2BAA0B,gBAAe,2BAA0B,gBAAe,0BAAyB;;;ADoK5iB;AAnJR,IAAM,kBAAkB;AAAA,EACtB,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AACb;AAEA,IAAM,iBAAiB;AAAA,EACrB,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AAAA,EACX,IAAI,0BAAO;AACb;AAmFA,IAAM,aAAa;AAAA,EACjB,CACE;AAAA,IACE;AAAA,IACA,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,IACP;AAAA,IACA,KAAK;AAAA,IACL;AAAA,EACF,GACA,QACG;AACH,UAAM,aAAa,cAAc;AACjC,UAAM,EAAE,UAAU,IAAI,SAAS;AAE/B,UAAM,uBACJ,cAAc,YACV,uBAAuB,aAAa,KAAK,CAAC,IAC1C,sBAAsB,YAAY,KAAK,GAAG,EAAE;AAElD,UAAM,uBACJ,cAAc,YACV,uBAAuB,aAAa,KAAK,CAAC,IAC1C,sBAAsB,YAAY,KAAK,GAAG,EAAE;AAElD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY;AAAA,QACZ,eAAa;AAAA,QACb,MAAK;AAAA,QACL,OAAO;AAAA,QACP,UAAU,CAAC,cAAc;AAAA,QACzB;AAAA,QACA,WAAW;AAAA,UACT,0BAAO;AAAA,UACP;AAAA,UACA;AAAA,UACA,cAAc,YAAY,0BAAO,IAAI,IAAI,0BAAO,GAAG,YAAY;AAAA,UAC/D;AAAA,YACE,CAAC,sBAAa,eAAe,GAC3B,cAAc,aAAa,UAAU;AAAA,YACvC,CAAC,sBAAa,0BAA0B,GACtC,cAAc,aAAa,UAAU;AAAA,YACvC,CAAC,0BAAO,kBAAkB,GACvB,cAAc,aACb,CAAC,CAAC,aAAa,uBAAuB,EAAE,SAAS,KAAK,KACxD,cAAc;AAAA,UAClB;AAAA,QACF;AAAA,QACA;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,WACE,cAAc,YACV,gBAAgB,IAAI,IACpB,eAAe,IAAI;AAAA;AAAA,QAE3B;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AAEzB,IAAO,qBAAQ;","names":[]}
|