@lunit/design-system 1.0.0-b.1 → 1.0.0-b.3
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/cjs/components/Alert/index.js +1 -1
- package/dist/cjs/components/Alert/index.js.map +1 -1
- package/dist/cjs/components/Button/index.js +1 -1
- package/dist/cjs/components/Button/index.js.map +1 -1
- package/dist/cjs/components/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/components/Typography/index.js +1 -1
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +3 -3
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/TextField/TextField.js +16 -12
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +6 -7
- package/dist/components/TextField/TextField.style.js.map +1 -1
- package/dist/components/Typography/Typography.js +7 -0
- package/dist/components/Typography/Typography.js.map +1 -0
- package/dist/components/Typography/index.js +1 -2
- package/dist/components/Typography/index.js.map +1 -1
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/types/components/Button/Button.d.ts +2 -2
- package/dist/types/components/Button/Button.styled.d.ts +2 -2
- package/dist/types/components/Button/Button.types.d.ts +11 -1
- package/dist/types/components/Chip/Chip.d.ts +2 -2
- package/dist/types/components/Chip/Chip.styled.d.ts +4 -4
- package/dist/types/components/Chip/Chip.types.d.ts +7 -1
- package/dist/types/components/TextField/TextField.d.ts +3 -2
- package/dist/types/components/Typography/Typography.d.ts +11 -0
- package/dist/types/components/Typography/index.d.ts +1 -7
- package/dist/types/foundation/colors/index.d.ts +3 -0
- package/dist/types/foundation/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Button/Button.styled.ts +3 -3
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Button/Button.types.ts +19 -1
- package/src/components/Chip/Chip.tsx +10 -2
- package/src/components/Chip/Chip.types.ts +15 -1
- package/src/components/TextField/TextField.style.ts +6 -7
- package/src/components/TextField/TextField.tsx +55 -47
- package/src/components/Typography/Typography.tsx +18 -0
- package/src/components/Typography/index.ts +1 -9
- package/src/foundation/colors/index.ts +2 -0
- package/src/stories/components/Button/BasicButton.stories.tsx +1 -3
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +6 -0
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +24 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/TextField/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,mCCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,2B,aCA7C,MAAM,EAA+BA,Q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BT,KAAMO,EACNN,YAAaU,MAKtB,EAGGQ,EAAiB,EACrB7E,OAAO,QACP8E,cACGR,MAEI,SAACxB,EAAa,IAAKwB,EAAWjC,cAAerC,EAAMC,WAAS,IAyBrE,EAtBmB8D,IACjB,MAAM,KACJgB,EAAI,KACJ/E,EAAI,UACJC,GAAY,EAAK,QACjB+E,EAAU,cACPV,GACDP,EAEJ,OAAO9D,GACL,SAAC4E,EAAc,IACTP,EACJW,QAASC,IACTlF,KAAMA,EACNgF,QAASA,EACTD,KAAMA,KAGR,SAACjB,EAAe,IAAKQ,EAAWtE,KAAMA,EAAMgF,QAASA,GACtD,E","sources":["webpack://@lunit/design-system/webpack/bootstrap","webpack://@lunit/design-system/webpack/runtime/compat get default export","webpack://@lunit/design-system/webpack/runtime/define property getters","webpack://@lunit/design-system/webpack/runtime/hasOwnProperty shorthand","webpack://@lunit/design-system/webpack/runtime/make namespace object","webpack://@lunit/design-system/external commonjs \"react/jsx-runtime\"","webpack://@lunit/design-system/external commonjs \"@mui/material/TextField\"","webpack://@lunit/design-system/external commonjs \"@mui/material/styles\"","webpack://@lunit/design-system/./src/components/TextField/TextField.style.ts","webpack://@lunit/design-system/./src/components/TextField/TextFieldIcon.tsx","webpack://@lunit/design-system/./src/components/TextField/TextField.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TextField\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/styles\");","import MuiTextField from \"@mui/material/TextField\";\nimport { styled } from \"@mui/material/styles\";\n\nimport type { ColorToken } from \"@/foundation/colors/types\";\nimport type { Typography } from \"@mui/material/styles/createTypography\";\nimport type { TextFieldProps, TextFieldSize } from \"./TextField.types\";\n\ntype BaseTextFieldProps = Omit<TextFieldProps, \"size\"> & {\n textFieldSize: TextFieldSize;\n hasLeftIcon?: boolean;\n hasRightIcon?: boolean;\n};\n\ninterface GetTextFieldPaddingBySizeParams {\n multiline?: boolean;\n size: TextFieldSize;\n hasLeftIcon?: boolean;\n hasRightIcon?: boolean;\n}\n\nconst getSinglelineTextFieldPaddingByIconAndSize = ({\n size,\n hasLeftIcon,\n hasRightIcon,\n}: Pick<\n GetTextFieldPaddingBySizeParams,\n \"size\" | \"hasLeftIcon\" | \"hasRightIcon\"\n>) => {\n switch (size) {\n case \"small\":\n return `4px ${hasRightIcon ? \"8px\" : \"12px\"} 4px ${\n hasLeftIcon ? \"8px\" : \"12px\"\n }}`;\n case \"medium\":\n return `8px ${hasRightIcon ? \"12px\" : \"16px\"} 8px ${\n hasLeftIcon ? \"12px\" : \"16px\"\n }}`;\n case \"large\":\n return `10px ${hasRightIcon ? \"12px\" : \"16px\"} 10px ${\n hasLeftIcon ? \"12px\" : \"16px\"\n }}`;\n }\n};\n\nconst getMultilineTextFieldPaddingByIconAndSize = ({\n size,\n}: Pick<GetTextFieldPaddingBySizeParams, \"size\">) => {\n switch (size) {\n case \"small\":\n return \"4px 4px 4px 12px\";\n case \"medium\":\n return \"8px 4px 8px 16px\";\n case \"large\":\n return \"10px 4px 10px 16px\";\n }\n};\n\nconst getTextFieldPaddingBySize = ({\n size,\n multiline,\n hasLeftIcon,\n hasRightIcon,\n}: GetTextFieldPaddingBySizeParams) => {\n return multiline\n ? getMultilineTextFieldPaddingByIconAndSize({ size })\n : getSinglelineTextFieldPaddingByIconAndSize({\n size,\n hasLeftIcon,\n hasRightIcon,\n });\n};\n\nconst commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({\n \"&.MuiTextField-root\": {\n width: \"100%\",\n },\n \"& .MuiOutlinedInput-root\": {\n borderRadius: \"8px\",\n width: \"100%\",\n\n \"& fieldset\": {\n border: \"none\",\n },\n \"&.Mui-error fieldset\": {\n border: `1px solid ${lunit_token.component.textfield_border_error}`,\n },\n \"&.Mui-focused fieldset\": {\n border: `1px solid ${lunit_token.core.focused}`,\n },\n \"&.Mui-disabled\": {\n opacity: 0.38,\n \"&:hover::before\": {\n backgroundColor: lunit_token.component.textfield_bg,\n },\n },\n \"& input, textarea\": {\n padding: 0,\n textOverflow: \"ellipsis\",\n \"&::placeholder\": {\n color: lunit_token.core.text_medium,\n opacity: 1,\n WebkitTextFillColor: lunit_token.core.text_medium,\n },\n },\n \"& textarea\": {\n height: \"100% !important\",\n overflowY: \"scroll !important\",\n \"&::-webkit-scrollbar\": {\n width: \"6px\",\n },\n \"&::-webkit-scrollbar-thumb\": {\n borderRadius: \"6px\",\n backgroundColor: lunit_token.component.scrollbars_bg,\n },\n },\n background: lunit_token.component.textfield_bg,\n overflow: \"hidden\",\n color: lunit_token.core.text_normal,\n \"&:hover\": {\n position: \"relative\",\n zIndex: 0,\n backgroundColor: lunit_token.component.textfield_bg,\n },\n \"&:hover::before\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n },\n \"&.Mui-focused\": {\n \"&:hover::before\": {\n backgroundColor: lunit_token.component.textfield_bg,\n },\n },\n },\n \"& .MuiFormHelperText-root\": {\n \"&.Mui-disabled\": {\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n});\n\nconst sizeStyle = ({\n lunit_token,\n textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n typography,\n multiline,\n}: Pick<\n BaseTextFieldProps,\n \"textFieldSize\" | \"hasLeftIcon\" | \"hasRightIcon\" | \"multiline\"\n> & { lunit_token: ColorToken; typography: Typography }) => ({\n ...(textFieldSize === \"small\" && {\n \"& .MuiInputBase-root\": {\n padding: getTextFieldPaddingBySize({\n size: textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n multiline,\n }),\n \"& input, textarea\": {\n ...typography.body2_14_regular,\n },\n \"& input\": {\n height: \"20px\",\n },\n \"& textarea\": {\n minHeight: \"92px\",\n paddingRight: \"2px\",\n },\n },\n \"& .MuiFormHelperText-root\": {\n ...typography.body2_14_regular,\n color: lunit_token.core.text_medium,\n margin: 0,\n marginTop: \"4px\",\n paddingLeft: \"4px\",\n\n \"&.Mui-disabled\": {\n color: lunit_token.core.text_medium,\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n }),\n ...(textFieldSize === \"medium\" && {\n \"& .MuiInputBase-root\": {\n padding: getTextFieldPaddingBySize({\n size: textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n multiline,\n }),\n \"& input, textarea\": {\n ...typography.body2_14_regular,\n },\n \"& input\": {\n height: \"20px\",\n },\n \"& textarea\": {\n minHeight: \"84px\",\n paddingRight: \"6px\",\n },\n },\n \"& .MuiFormHelperText-root\": {\n ...typography.body2_14_regular,\n color: lunit_token.core.text_medium,\n margin: 0,\n marginTop: \"4px\",\n paddingLeft: \"4px\",\n\n \"&.Mui-disabled\": {\n color: lunit_token.core.text_medium,\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n }),\n ...(textFieldSize === \"large\" && {\n \"& .MuiInputBase-root\": {\n padding: getTextFieldPaddingBySize({\n size: textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n multiline,\n }),\n \"& input, textarea\": {\n ...typography.body1_16_regular,\n },\n \"& input\": {\n height: \"24px\",\n },\n \"& textarea\": {\n minHeight: \"80px\",\n paddingRight: \"6px\",\n },\n },\n \"& .MuiFormHelperText-root\": {\n ...typography.body1_16_regular,\n color: lunit_token.core.text_medium,\n margin: 0,\n marginTop: \"4px\",\n paddingLeft: \"4px\",\n\n \"&.Mui-disabled\": {\n color: lunit_token.core.text_medium,\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n }),\n});\n\nconst BaseTextField = styled(MuiTextField, {\n shouldForwardProp: (prop: string) =>\n ![\n \"leftIconSx\",\n \"rightIconSx\",\n \"leftIcon\",\n \"rightIcon\",\n \"textFieldSize\",\n \"hasLeftIcon\",\n \"hasRightIcon\",\n \"onLeftIconClick\",\n \"onRightIconClick\",\n ].includes(prop),\n})<BaseTextFieldProps>(\n ({\n theme: {\n typography,\n palette: { lunit_token },\n },\n multiline,\n textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n }) => ({\n ...commonStyle({ lunit_token }),\n ...sizeStyle({\n lunit_token,\n textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n typography,\n multiline,\n }),\n })\n);\n\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minWidth: \"28px\",\n minHeight: \"28px\",\n margin: \"-4px 0\",\n\n \"& svg\": {\n width: \"20px\",\n height: \"20px\",\n color: theme.palette.lunit_token.core.text_normal,\n },\n}));\n\nexport { BaseTextField, IconWrapper };\n","import React from \"react\";\n\nimport { IconWrapper } from \"./TextField.style\";\n\nimport type { SxProps } from \"@mui/material\";\n\ninterface TextFieldProps {\n sx?: SxProps;\n icon: JSX.Element;\n onIconClick?: () => void;\n}\n\nconst TextFieldIcon = ({ sx, icon, onIconClick }: TextFieldProps) => {\n return (\n <IconWrapper\n sx={{ cursor: onIconClick ? \"pointer\" : \"auto\", ...sx }}\n onClick={onIconClick}\n >\n {icon}\n </IconWrapper>\n );\n};\n\nexport default TextFieldIcon;\n","import React from \"react\";\n\nimport TextFieldIcon from \"./TextFieldIcon\";\nimport { BaseTextField } from \"./TextField.style\";\n\nimport type {\n TextFieldProps,\n MultiTextFieldProps,\n SingleTextFieldProps,\n} from \"./TextField.types\";\n\nconst SingleTextField = (props: SingleTextFieldProps) => {\n const {\n size = \"small\",\n leftIcon,\n rightIcon,\n leftIconSx,\n rightIconSx,\n onLeftIconClick,\n onRightIconClick,\n ...restProps\n } = props;\n\n return (\n <BaseTextField\n {...restProps}\n textFieldSize={size}\n hasLeftIcon={Boolean(leftIcon)}\n hasRightIcon={Boolean(rightIcon)}\n InputProps={{\n startAdornment: leftIcon && (\n <TextFieldIcon\n sx={{ marginRight: \"4px\", ...leftIconSx }}\n icon={leftIcon}\n onIconClick={onLeftIconClick}\n />\n ),\n endAdornment: rightIcon && (\n <TextFieldIcon\n sx={{ marginLeft: \"4px\", ...rightIconSx }}\n icon={rightIcon}\n onIconClick={onRightIconClick}\n />\n ),\n }}\n />\n );\n};\n\nconst MultiTextField = ({\n size = \"small\",\n onChange,\n ...restProps\n}: MultiTextFieldProps) => {\n return <BaseTextField {...restProps} textFieldSize={size} multiline />;\n};\n\nconst TextField = (props: TextFieldProps) => {\n const {\n rows,\n size,\n multiline = false,\n variant = \"outlined\",\n ...restProps\n } = props;\n\n return multiline ? (\n <MultiTextField\n {...restProps}\n maxRows={Infinity}\n size={size}\n variant={variant}\n rows={rows}\n />\n ) : (\n <SingleTextField {...restProps} size={size} variant={variant} />\n );\n};\n\nexport default TextField;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","getTextFieldPaddingBySize","size","multiline","hasLeftIcon","hasRightIcon","getMultilineTextFieldPaddingByIconAndSize","getSinglelineTextFieldPaddingByIconAndSize","commonStyle","lunit_token","width","borderRadius","border","component","textfield_border_error","core","focused","opacity","backgroundColor","textfield_bg","padding","textOverflow","color","text_medium","WebkitTextFillColor","height","overflowY","scrollbars_bg","background","overflow","text_normal","position","zIndex","content","top","left","hover","text_error","sizeStyle","textFieldSize","typography","body2_14_regular","minHeight","paddingRight","margin","marginTop","paddingLeft","body1_16_regular","BaseTextField","styled","shouldForwardProp","includes","theme","palette","IconWrapper","display","alignItems","justifyContent","minWidth","sx","icon","onIconClick","cursor","onClick","SingleTextField","props","leftIcon","rightIcon","leftIconSx","rightIconSx","onLeftIconClick","onRightIconClick","restProps","Boolean","InputProps","startAdornment","marginRight","endAdornment","marginLeft","MultiTextField","onChange","rows","variant","maxRows","Infinity"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/TextField/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,mCCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,SCAvC,EAA+BA,QAAQ,2B,aCA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C7BV,KAAMQ,EACNP,YAAaW,IAGjBO,aAAcV,IACZ,SAAC,EAAa,CACZV,GAAI,CAAEqB,WAAY,SAAUT,GAC5BX,KAAMS,EACNR,YAAaY,OAIhBC,IAGR,IAICO,GAAiB,IAAAhB,aACrB,EAAG/D,OAAO,WAAYyE,GAAaR,KAE/B,SAACnB,EAAa,IAAK2B,EAAWR,IAAKA,EAAK7B,cAAepC,EAAMC,WAAS,MA4B5E,GAvBkB,IAAA8D,aAA2C,CAACC,EAAOC,KACnE,MAAM,KACJe,EAAI,KACJhF,EAAI,UACJC,GAAY,EAAK,QACjBgF,EAAU,cACPR,GACDT,EAEJ,OAAO/D,GACL,SAAC8E,EAAc,IACTN,EACJR,IAAKA,EACLiB,QAASC,IACTnF,KAAMA,EACNiF,QAASA,EACTD,KAAMA,KAGR,SAAClB,EAAe,IAAKW,EAAWR,IAAKA,EAAKjE,KAAMA,EAAMiF,QAASA,GAChE,I","sources":["webpack://@lunit/design-system/webpack/bootstrap","webpack://@lunit/design-system/webpack/runtime/compat get default export","webpack://@lunit/design-system/webpack/runtime/define property getters","webpack://@lunit/design-system/webpack/runtime/hasOwnProperty shorthand","webpack://@lunit/design-system/webpack/runtime/make namespace object","webpack://@lunit/design-system/external commonjs \"react/jsx-runtime\"","webpack://@lunit/design-system/external commonjs \"react\"","webpack://@lunit/design-system/external commonjs \"@mui/material/TextField\"","webpack://@lunit/design-system/external commonjs \"@mui/material/styles\"","webpack://@lunit/design-system/./src/components/TextField/TextField.style.ts","webpack://@lunit/design-system/./src/components/TextField/TextFieldIcon.tsx","webpack://@lunit/design-system/./src/components/TextField/TextField.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TextField\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/styles\");","import MuiTextField from \"@mui/material/TextField\";\nimport { styled } from \"@mui/material/styles\";\n\nimport type { ColorToken } from \"@/foundation/colors/types\";\nimport type { Typography } from \"@mui/material/styles/createTypography\";\nimport type { TextFieldProps, TextFieldSize } from \"./TextField.types\";\n\ntype BaseTextFieldProps = Omit<TextFieldProps, \"size\"> & {\n textFieldSize: TextFieldSize;\n hasLeftIcon?: boolean;\n hasRightIcon?: boolean;\n};\n\ninterface GetTextFieldPaddingBySizeParams {\n multiline?: boolean;\n size: TextFieldSize;\n hasLeftIcon?: boolean;\n hasRightIcon?: boolean;\n}\n\nconst getSinglelineTextFieldPaddingByIconAndSize = ({\n size,\n hasLeftIcon,\n hasRightIcon,\n}: Pick<\n GetTextFieldPaddingBySizeParams,\n \"size\" | \"hasLeftIcon\" | \"hasRightIcon\"\n>) => {\n switch (size) {\n case \"small\":\n return `4px ${hasRightIcon ? \"8px\" : \"12px\"} 4px ${\n hasLeftIcon ? \"8px\" : \"12px\"\n }}`;\n case \"medium\":\n return `8px ${hasRightIcon ? \"12px\" : \"16px\"} 8px ${\n hasLeftIcon ? \"12px\" : \"16px\"\n }}`;\n case \"large\":\n return `10px ${hasRightIcon ? \"12px\" : \"16px\"} 10px ${\n hasLeftIcon ? \"12px\" : \"16px\"\n }}`;\n }\n};\n\nconst getMultilineTextFieldPaddingByIconAndSize = ({\n size,\n}: Pick<GetTextFieldPaddingBySizeParams, \"size\">) => {\n switch (size) {\n case \"small\":\n return \"4px 4px 4px 12px\";\n case \"medium\":\n return \"8px 4px 8px 16px\";\n case \"large\":\n return \"10px 4px 10px 16px\";\n }\n};\n\nconst getTextFieldPaddingBySize = ({\n size,\n multiline,\n hasLeftIcon,\n hasRightIcon,\n}: GetTextFieldPaddingBySizeParams) => {\n return multiline\n ? getMultilineTextFieldPaddingByIconAndSize({ size })\n : getSinglelineTextFieldPaddingByIconAndSize({\n size,\n hasLeftIcon,\n hasRightIcon,\n });\n};\n\nconst commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({\n \"& .MuiOutlinedInput-root\": {\n borderRadius: \"8px\",\n\n \"& fieldset\": {\n border: \"none\",\n },\n \"&.Mui-error fieldset\": {\n border: `1px solid ${lunit_token.component.textfield_border_error}`,\n },\n \"&.Mui-focused fieldset\": {\n border: `1px solid ${lunit_token.core.focused}`,\n },\n \"&.Mui-error.Mui-focused fieldset\": {\n border: `2px solid ${lunit_token.component.textfield_border_error}`,\n },\n \"&.Mui-disabled\": {\n opacity: 0.38,\n \"&:hover::before\": {\n backgroundColor: lunit_token.component.textfield_bg,\n },\n },\n \"& input, textarea\": {\n padding: 0,\n textOverflow: \"ellipsis\",\n \"&::placeholder\": {\n color: lunit_token.core.text_light,\n opacity: 1,\n WebkitTextFillColor: lunit_token.core.text_light,\n },\n },\n \"& textarea\": {\n height: \"100% !important\",\n overflowY: \"scroll !important\",\n \"&::-webkit-scrollbar\": {\n width: \"6px\",\n },\n \"&::-webkit-scrollbar-thumb\": {\n borderRadius: \"6px\",\n backgroundColor: lunit_token.component.scrollbars_bg,\n },\n },\n background: lunit_token.component.textfield_bg,\n color: lunit_token.core.text_normal,\n \"&:hover\": {\n position: \"relative\",\n zIndex: 0,\n backgroundColor: lunit_token.component.textfield_bg,\n },\n \"&:hover::before\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n borderRadius: \"8px\",\n },\n \"&.Mui-focused\": {\n \"&:hover::before\": {\n backgroundColor: lunit_token.component.textfield_bg,\n },\n },\n },\n \"& .MuiFormHelperText-root\": {\n \"&.Mui-disabled\": {\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n});\n\nconst sizeStyle = ({\n lunit_token,\n textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n typography,\n multiline,\n}: Pick<\n BaseTextFieldProps,\n \"textFieldSize\" | \"hasLeftIcon\" | \"hasRightIcon\" | \"multiline\"\n> & { lunit_token: ColorToken; typography: Typography }) => ({\n ...(textFieldSize === \"small\" && {\n \"& .MuiInputBase-root\": {\n padding: getTextFieldPaddingBySize({\n size: textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n multiline,\n }),\n \"& input, textarea\": {\n ...typography.body2_14_regular,\n },\n \"& input\": {\n height: \"20px\",\n },\n \"& textarea\": {\n minHeight: \"92px\",\n paddingRight: \"2px\",\n },\n },\n \"& .MuiFormHelperText-root\": {\n ...typography.body2_14_regular,\n color: lunit_token.core.text_medium,\n margin: 0,\n marginTop: \"4px\",\n paddingLeft: \"4px\",\n\n \"&.Mui-disabled\": {\n color: lunit_token.core.text_medium,\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n }),\n ...(textFieldSize === \"medium\" && {\n \"& .MuiInputBase-root\": {\n padding: getTextFieldPaddingBySize({\n size: textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n multiline,\n }),\n \"& input, textarea\": {\n ...typography.body2_14_regular,\n },\n \"& input\": {\n height: \"20px\",\n },\n \"& textarea\": {\n minHeight: \"84px\",\n paddingRight: \"6px\",\n },\n },\n \"& .MuiFormHelperText-root\": {\n ...typography.body2_14_regular,\n color: lunit_token.core.text_medium,\n margin: 0,\n marginTop: \"4px\",\n paddingLeft: \"4px\",\n\n \"&.Mui-disabled\": {\n color: lunit_token.core.text_medium,\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n }),\n ...(textFieldSize === \"large\" && {\n \"& .MuiInputBase-root\": {\n padding: getTextFieldPaddingBySize({\n size: textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n multiline,\n }),\n \"& input, textarea\": {\n ...typography.body1_16_regular,\n },\n \"& input\": {\n height: \"24px\",\n },\n \"& textarea\": {\n minHeight: \"80px\",\n paddingRight: \"6px\",\n },\n },\n \"& .MuiFormHelperText-root\": {\n ...typography.body1_16_regular,\n color: lunit_token.core.text_medium,\n margin: 0,\n marginTop: \"4px\",\n paddingLeft: \"4px\",\n\n \"&.Mui-disabled\": {\n color: lunit_token.core.text_medium,\n opacity: 0.38,\n },\n \"&.Mui-error\": {\n color: lunit_token.core.text_error,\n },\n },\n }),\n});\n\nconst BaseTextField = styled(MuiTextField, {\n shouldForwardProp: (prop: string) =>\n ![\n \"leftIconSx\",\n \"rightIconSx\",\n \"leftIcon\",\n \"rightIcon\",\n \"textFieldSize\",\n \"hasLeftIcon\",\n \"hasRightIcon\",\n \"onLeftIconClick\",\n \"onRightIconClick\",\n ].includes(prop),\n})<BaseTextFieldProps>(\n ({\n theme: {\n typography,\n palette: { lunit_token },\n },\n multiline,\n textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n }) => ({\n ...commonStyle({ lunit_token }),\n ...sizeStyle({\n lunit_token,\n textFieldSize,\n hasLeftIcon,\n hasRightIcon,\n typography,\n multiline,\n }),\n })\n);\n\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minWidth: \"28px\",\n minHeight: \"28px\",\n margin: \"-4px 0\",\n\n \"& svg\": {\n width: \"20px\",\n height: \"20px\",\n color: theme.palette.lunit_token.core.text_normal,\n },\n}));\n\nexport { BaseTextField, IconWrapper };\n","import React from \"react\";\n\nimport { IconWrapper } from \"./TextField.style\";\n\nimport type { SxProps } from \"@mui/material\";\n\ninterface TextFieldProps {\n sx?: SxProps;\n icon: JSX.Element;\n onIconClick?: () => void;\n}\n\nconst TextFieldIcon = ({ sx, icon, onIconClick }: TextFieldProps) => {\n return (\n <IconWrapper\n sx={{ cursor: onIconClick ? \"pointer\" : \"auto\", ...sx }}\n onClick={onIconClick}\n >\n {icon}\n </IconWrapper>\n );\n};\n\nexport default TextFieldIcon;\n","import React, { forwardRef } from \"react\";\n\nimport TextFieldIcon from \"./TextFieldIcon\";\nimport { BaseTextField } from \"./TextField.style\";\n\nimport type {\n TextFieldProps,\n MultiTextFieldProps,\n SingleTextFieldProps,\n} from \"./TextField.types\";\n\nconst SingleTextField = forwardRef<HTMLDivElement, SingleTextFieldProps>(\n (props, ref) => {\n const {\n size = \"small\",\n leftIcon,\n rightIcon,\n leftIconSx,\n rightIconSx,\n onLeftIconClick,\n onRightIconClick,\n InputProps,\n ...restProps\n } = props;\n\n return (\n <BaseTextField\n {...restProps}\n ref={ref}\n textFieldSize={size}\n hasLeftIcon={Boolean(leftIcon)}\n hasRightIcon={Boolean(rightIcon)}\n InputProps={{\n ...{\n startAdornment: leftIcon && (\n <TextFieldIcon\n sx={{ marginRight: \"4px\", ...leftIconSx }}\n icon={leftIcon}\n onIconClick={onLeftIconClick}\n />\n ),\n endAdornment: rightIcon && (\n <TextFieldIcon\n sx={{ marginLeft: \"4px\", ...rightIconSx }}\n icon={rightIcon}\n onIconClick={onRightIconClick}\n />\n ),\n },\n ...InputProps,\n }}\n />\n );\n }\n);\n\nconst MultiTextField = forwardRef<HTMLDivElement, MultiTextFieldProps>(\n ({ size = \"small\", ...restProps }, ref) => {\n return (\n <BaseTextField {...restProps} ref={ref} textFieldSize={size} multiline />\n );\n }\n);\n\nconst TextField = forwardRef<HTMLDivElement, TextFieldProps>((props, ref) => {\n const {\n rows,\n size,\n multiline = false,\n variant = \"outlined\",\n ...restProps\n } = props;\n\n return multiline ? (\n <MultiTextField\n {...restProps}\n ref={ref}\n maxRows={Infinity}\n size={size}\n variant={variant}\n rows={rows}\n />\n ) : (\n <SingleTextField {...restProps} ref={ref} size={size} variant={variant} />\n );\n});\n\nexport default TextField;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","getTextFieldPaddingBySize","size","multiline","hasLeftIcon","hasRightIcon","getMultilineTextFieldPaddingByIconAndSize","getSinglelineTextFieldPaddingByIconAndSize","commonStyle","lunit_token","borderRadius","border","component","textfield_border_error","core","focused","opacity","backgroundColor","textfield_bg","padding","textOverflow","color","text_light","WebkitTextFillColor","height","overflowY","width","scrollbars_bg","background","text_normal","position","zIndex","content","top","left","hover","text_error","sizeStyle","textFieldSize","typography","body2_14_regular","minHeight","paddingRight","text_medium","margin","marginTop","paddingLeft","body1_16_regular","BaseTextField","styled","shouldForwardProp","includes","theme","palette","IconWrapper","display","alignItems","justifyContent","minWidth","sx","icon","onIconClick","cursor","onClick","SingleTextField","forwardRef","props","ref","leftIcon","rightIcon","leftIconSx","rightIconSx","onLeftIconClick","onRightIconClick","InputProps","restProps","Boolean","startAdornment","marginRight","endAdornment","marginLeft","MultiTextField","rows","variant","maxRows","Infinity"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(o,n)=>{for(var t in n)e.o(n,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:n[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{default:()=>x});const n=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("@mui/material"),i=({kind:e,size:o,selected:n=!1})=>"small"===o?"outlined"!==e||n?"4px 8px":"3px 7px":"medium"===o?"outlined"!==e||n?"8px 12px":"7px 11px":"outlined"!==e||n?"10px 12px":"9px 11px",d=({kind:e,size:o,selected:n=!1})=>"small"===o?"outlined"!==e||n?"4px":"3px":"medium"===o?"outlined"!==e||n?"8px":"7px":"outlined"!==e||n?"12px":"11px",l=e=>({position:"relative",zIndex:0,backgroundColor:e}),c="8px",p=({size:e,kind:o,hasIconOnly:n,typography:t,selected:r=!1})=>({..."small"===e&&{...t.button2,padding:`${n?d({kind:o,size:e,selected:r}):i({kind:o,size:e,selected:r})}`,minWidth:"28px",
|
|
1
|
+
(()=>{"use strict";var e={d:(o,n)=>{for(var t in n)e.o(n,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:n[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{default:()=>x});const n=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("@mui/material"),i=({kind:e,size:o,selected:n=!1})=>"small"===o?"outlined"!==e||n?"4px 8px":"3px 7px":"medium"===o?"outlined"!==e||n?"8px 12px":"7px 11px":"outlined"!==e||n?"10px 12px":"9px 11px",d=({kind:e,size:o,selected:n=!1})=>"small"===o?"outlined"!==e||n?"4px":"3px":"medium"===o?"outlined"!==e||n?"8px":"7px":"outlined"!==e||n?"12px":"11px",l=e=>({position:"relative",zIndex:0,backgroundColor:e}),c="8px",p=({size:e,kind:o,hasIconOnly:n,typography:t,selected:r=!1})=>({..."small"===e&&{...t.button2,padding:`${n?d({kind:o,size:e,selected:r}):i({kind:o,size:e,selected:r})}`,minWidth:"28px",height:"28px"},..."medium"===e&&{...t.button2,padding:`${n?d({kind:o,size:e,selected:r}):i({kind:o,size:e,selected:r})}`,minWidth:"36px",height:"36px"},..."large"===e&&{...t.button1,padding:`${n?d({kind:o,size:e,selected:r}):i({kind:o,size:e,selected:r})}`,minWidth:"44px",height:"44px"}}),a=({kind:e,color:o,lunit_token:n})=>({..."contained"===e&&"primary"===o&&{color:n.component.btn_primary_text_2,backgroundColor:n.component.btn_primary_bg,"&:hover":l(n.component.btn_primary_bg),"&.Mui-disabled":{opacity:.38,border:"none",color:n.component.btn_primary_text_2}},..."contained"===e&&"secondary"===o&&{color:n.component.btn_secondary_text,backgroundColor:n.component.btn_secondary_bg,"&:hover":l(n.component.btn_secondary_bg),"&.Mui-disabled":{opacity:.38,border:"none",color:n.component.btn_secondary_text}},..."contained"===e&&"error"===o&&{color:n.component.btn_primary_text_2,backgroundColor:n.component.btn_error_bg,"&:hover":l(n.component.btn_error_bg),"&.Mui-disabled":{opacity:.38,border:"none",color:n.component.btn_primary_text_2}},..."ghost"===e&&"primary"===o&&{color:n.component.btn_primary_text_1,border:"none","&:hover":l("none"),"&.Mui-disabled":{opacity:.38,border:"none",color:n.component.btn_primary_text_1}},..."ghost"===e&&"secondary"===o&&{color:n.component.btn_secondary_text,border:"none","&:hover":l("none"),"&.Mui-disabled":{opacity:.38,border:"none",color:n.component.btn_secondary_text}},..."ghost"===e&&"error"===o&&{color:n.component.btn_error_text,"&:hover":l("none"),"&.Mui-disabled":{opacity:.38,border:"none",color:n.component.btn_error_text}},..."outlined"===e&&"primary"===o&&{color:n.component.btn_primary_text_1,border:`1px solid ${n.component.btn_primary_border}`,"&:hover":l("none"),"&:hover:before":{content:"''",position:"absolute",left:"-1px",top:"-1px",width:"calc(100% + 2px)",height:"calc(100% + 2px)",zIndex:-1,backgroundColor:n.core.hover,borderRadius:c},"&.Mui-disabled":{opacity:.38,color:n.component.btn_primary_text_1}},..."outlined"===e&&"secondary"===o&&{color:n.component.btn_secondary_text,border:`1px solid ${n.component.btn_secondary_border}`,"&:hover":l("none"),"&:hover:before":{content:"''",position:"absolute",left:"-1px",top:"-1px",width:"calc(100% + 2px)",height:"calc(100% + 2px)",zIndex:-1,backgroundColor:n.core.hover,borderRadius:c},"&.Mui-disabled":{opacity:.38,color:n.component.btn_secondary_text}}}),s=({lunit_token:e})=>({fontWeight:"500",borderRadius:c,textTransform:"initial","&.Mui-focusVisible":{"&::after":{position:"absolute",width:"calc(100% + 6px)",height:"calc(100% + 6px)",content:'""',borderRadius:"11px",border:`1px solid ${e.core.focused}`,boxSizing:"border-box"}},"&:hover:before":{content:"''",position:"absolute",left:0,top:0,width:"100%",height:"100%",zIndex:-1,backgroundColor:e.core.hover,borderRadius:c}}),b=({size:e,hasIconOnly:o})=>({"& .MuiButton-startIcon":{width:"20px",height:"20px",margin:0,marginRight:o?"0px":"large"===e?"8px":"4px","*:nth-of-type(1)":{fontSize:"20px"}},svg:{width:"20px",height:"20px",margin:0,marginRight:o?"0px":"large"===e?"8px":"4px"}}),u=((0,t.styled)(r.Button,{shouldForwardProp:e=>!["kind","hasIconOnly"].includes(e)})((({theme:{typography:e,palette:{lunit_token:o}},kind:n,size:t,color:r,hasIconOnly:i})=>({...s({lunit_token:o}),...b({size:t,hasIconOnly:i}),...p({size:t,kind:n,hasIconOnly:i,typography:e}),...a({kind:n,color:r,lunit_token:o})}))),(0,t.styled)(r.ToggleButton,{shouldForwardProp:e=>!["icon","kind","selectedColor","hasIconOnly"].includes(e)})((({theme:{typography:e,palette:{lunit_token:o}},kind:n,size:t,color:r,selectedColor:i,hasIconOnly:d,selected:l})=>({border:"none",...s({lunit_token:o}),...b({size:t,hasIconOnly:d}),...p({size:t,kind:n,hasIconOnly:d,selected:l,typography:e}),...a({kind:n,color:r,lunit_token:o}),..."primary"===i&&{"&.Mui-selected, &.Mui-selected:hover":{border:"none",backgroundColor:o.component.btn_selected_primary_bg,color:o.component.btn_selected_primary_text}},..."secondary"===i&&{"&.Mui-selected, &.Mui-selected:hover":{border:"none",backgroundColor:o.component.btn_selected_secondary_bg,color:o.component.btn_selected_secondary_text}}})))),m=(0,t.styled)("div")({display:"flex",alignItems:"center"}),x=e=>{const{kind:o="contained",size:t="small",color:r="primary",selectedColor:i="primary",className:d="",icon:l,selected:c,children:p,...a}=e,s=Boolean(l&&!p),b=d.replace("MuiToggleButtonGroup-grouped","").replace("MuiToggleButtonGroup-groupedHorizontal","");return(0,n.jsx)(n.Fragment,{children:"contained"===o||"ghost"===o?(0,n.jsx)(u,{className:`${o} ${b}`,selected:c,kind:o,color:r,size:t,hasIconOnly:s,selectedColor:i,disableRipple:!0,disableFocusRipple:!0,...a,children:s?l:(0,n.jsx)(n.Fragment,{children:l?(0,n.jsxs)(m,{children:[l,p]}):p})}):(0,n.jsx)(u,{className:`outlined ${b}`,selected:c,kind:"outlined",color:"primary",size:t,hasIconOnly:s,selectedColor:i,disableRipple:!0,disableFocusRipple:!0,...a,children:s?l:(0,n.jsx)(n.Fragment,{children:l?(0,n.jsxs)(m,{children:[l,p]}):p})})})};module.exports=o})();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/ToggleButton/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFV,EAAyBC,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,mCCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,E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ACVF,KAAK,WACLiB,MAAM,UACNhB,KAAMA,EACNQ,YAAaA,EACb6C,cAAeA,EACfgB,eAAa,EACbC,oBAAkB,KACdL,EAAW,SAEbzD,EAWE,GAVF,8BACGuD,GACC,UAACL,EAAsB,WACpBK,EACAC,KAED,OAUf,E","sources":["webpack://@lunit/design-system/webpack/bootstrap","webpack://@lunit/design-system/webpack/runtime/define property getters","webpack://@lunit/design-system/webpack/runtime/hasOwnProperty shorthand","webpack://@lunit/design-system/webpack/runtime/make namespace object","webpack://@lunit/design-system/external commonjs \"react/jsx-runtime\"","webpack://@lunit/design-system/external commonjs \"@mui/material/styles\"","webpack://@lunit/design-system/external commonjs \"@mui/material\"","webpack://@lunit/design-system/./src/components/Button/utils/getButtonPaddingBySizeAndKind.ts","webpack://@lunit/design-system/./src/components/Button/utils/getIconButtonPaddingBySizeAndKind.ts","webpack://@lunit/design-system/./src/components/Button/utils/getHoverStyle.ts","webpack://@lunit/design-system/./src/components/Button/Button.styled.ts","webpack://@lunit/design-system/./src/components/ToggleButton/ToggleButton.styled.ts","webpack://@lunit/design-system/./src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/styles\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import { OUTLINED_BORDER_WIDTH } from \"../const\";\n\nimport type { ButtonProps } from \"../Button.types\";\nimport { ToggleButtonProps } from \"@/components/ToggleButton/ToggleButton.types\";\n\ntype GetButtonPaddingBySizeAndKindParams = Pick<ButtonProps, \"kind\" | \"size\"> &\n Pick<ToggleButtonProps, \"selected\">;\n\n/**\n * When kind is outlined,\n * the padding value must include the border width of outlined.\n * This function takes care of this.\n */\nexport const getButtonPaddingBySizeAndKind = ({\n kind,\n size,\n selected = false,\n}: GetButtonPaddingBySizeAndKindParams) => {\n if (size === \"small\") {\n return kind === \"outlined\" && !selected\n ? `${4 - OUTLINED_BORDER_WIDTH}px ${8 - OUTLINED_BORDER_WIDTH}px`\n : \"4px 8px\";\n }\n\n if (size === \"medium\") {\n return kind === \"outlined\" && !selected\n ? `${8 - OUTLINED_BORDER_WIDTH}px ${12 - OUTLINED_BORDER_WIDTH}px`\n : \"8px 12px\";\n }\n\n // size === \"large\"\n return kind === \"outlined\" && !selected\n ? `${10 - OUTLINED_BORDER_WIDTH}px ${12 - OUTLINED_BORDER_WIDTH}px`\n : \"10px 12px\";\n};\n","import { OUTLINED_BORDER_WIDTH } from \"../const\";\n\nimport type { ButtonProps } from \"../Button.types\";\nimport { ToggleButtonProps } from \"@/components/ToggleButton/ToggleButton.types\";\n\ntype GetIconButtonPaddingBySizeAndKindProps = Pick<\n ButtonProps,\n \"kind\" | \"size\"\n> &\n Pick<ToggleButtonProps, \"selected\">;\n\n/**\n * When kind is outlined,\n * the padding value must include the border width of outlined.\n * This function takes care of this.\n */\nexport const getIconButtonPaddingBySizeAndKind = ({\n kind,\n size,\n selected = false,\n}: GetIconButtonPaddingBySizeAndKindProps) => {\n if (size === \"small\") {\n return kind === \"outlined\" && !selected\n ? `${4 - OUTLINED_BORDER_WIDTH}px`\n : \"4px\";\n }\n\n if (size === \"medium\") {\n return kind === \"outlined\" && !selected\n ? `${8 - OUTLINED_BORDER_WIDTH}px`\n : \"8px\";\n }\n\n // size === \"large\"\n return kind === \"outlined\" && !selected\n ? `${12 - OUTLINED_BORDER_WIDTH}px`\n : \"12px\";\n};\n","const getHoverStyle = (backgroundColor: React.CSSProperties[\"color\"]) => ({\n position: \"relative\",\n zIndex: 0,\n backgroundColor,\n});\n\nexport default getHoverStyle;\n","import { styled } from \"@mui/material/styles\";\nimport { Button as MuiButton } from \"@mui/material\";\n\nimport { ColorToken } from \"@/foundation/colors/types\";\nimport { PADDING_OF_FOCUS, OUTLINED_BORDER_WIDTH } from \"./const\";\nimport { getButtonPaddingBySizeAndKind } from \"./utils/getButtonPaddingBySizeAndKind\";\nimport { getIconButtonPaddingBySizeAndKind } from \"./utils/getIconButtonPaddingBySizeAndKind\";\nimport getHoverStyle from \"./utils/getHoverStyle\";\n\nimport type { ButtonProps } from \"./Button.types\";\nimport type { ToggleButtonProps } from \"../ToggleButton/ToggleButton.types\";\nimport type { Typography } from \"@mui/material/styles/createTypography\";\n\ntype KindStyleParams = Pick<ButtonProps, \"kind\" | \"color\"> & {\n lunit_token: ColorToken;\n};\n\ntype CustomButtonProps = ButtonProps & { hasIconOnly: boolean };\n\ntype sizeStyleParams = Pick<\n CustomButtonProps,\n \"size\" | \"hasIconOnly\" | \"kind\"\n> &\n Pick<ToggleButtonProps, \"selected\"> & { typography: Typography };\n\nconst borderRadius = \"8px\";\n\nexport const sizeStyle = ({\n size,\n kind,\n hasIconOnly,\n typography,\n selected = false,\n}: sizeStyleParams) => ({\n ...(size === \"small\" && {\n ...typography.button2,\n padding: `${\n hasIconOnly\n ? getIconButtonPaddingBySizeAndKind({ kind, size, selected })\n : getButtonPaddingBySizeAndKind({ kind, size, selected })\n }`,\n minWidth: \"28px\",\n minHeight: \"28px\",\n }),\n ...(size === \"medium\" && {\n ...typography.button2,\n padding: `${\n hasIconOnly\n ? getIconButtonPaddingBySizeAndKind({ kind, size, selected })\n : getButtonPaddingBySizeAndKind({ kind, size, selected })\n }`,\n minWidth: \"36px\",\n minHeight: \"36px\",\n }),\n ...(size === \"large\" && {\n ...typography.button1,\n padding: `${\n hasIconOnly\n ? getIconButtonPaddingBySizeAndKind({ kind, size, selected })\n : getButtonPaddingBySizeAndKind({ kind, size, selected })\n }`,\n minWidth: \"44px\",\n minHeight: \"44px\",\n }),\n});\n\nexport const kindStyle = ({ kind, color, lunit_token }: KindStyleParams) => ({\n // kind: container\n ...(kind === \"contained\" &&\n color === \"primary\" && {\n color: lunit_token.component.btn_primary_text_2,\n backgroundColor: lunit_token.component.btn_primary_bg,\n \"&:hover\": getHoverStyle(lunit_token.component.btn_primary_bg),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_primary_text_2,\n },\n }),\n ...(kind === \"contained\" &&\n color === \"secondary\" && {\n color: lunit_token.component.btn_secondary_text,\n backgroundColor: lunit_token.component.btn_secondary_bg,\n \"&:hover\": getHoverStyle(lunit_token.component.btn_secondary_bg),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_secondary_text,\n },\n }),\n ...(kind === \"contained\" &&\n color === \"error\" && {\n color: lunit_token.component.btn_primary_text_2,\n backgroundColor: lunit_token.component.btn_error_bg,\n \"&:hover\": getHoverStyle(lunit_token.component.btn_error_bg),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_primary_text_2,\n },\n }),\n // kind: ghost\n ...(kind === \"ghost\" &&\n color === \"primary\" && {\n color: lunit_token.component.btn_primary_text_1,\n border: \"none\",\n \"&:hover\": getHoverStyle(\"none\"),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_primary_text_1,\n },\n }),\n ...(kind === \"ghost\" &&\n color === \"secondary\" && {\n color: lunit_token.component.btn_secondary_text,\n border: \"none\",\n \"&:hover\": getHoverStyle(\"none\"),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_secondary_text,\n },\n }),\n ...(kind === \"ghost\" &&\n color === \"error\" && {\n color: lunit_token.component.btn_error_text,\n \"&:hover\": getHoverStyle(\"none\"),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_error_text,\n },\n }),\n // kind: outlined\n ...(kind === \"outlined\" &&\n color === \"primary\" && {\n color: lunit_token.component.btn_primary_text_1,\n border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.component.btn_primary_border}`,\n \"&:hover\": getHoverStyle(\"none\"),\n \"&:hover:before\": {\n content: \"''\",\n position: \"absolute\",\n left: \"-1px\",\n top: \"-1px\",\n width: \"calc(100% + 2px)\",\n height: \"calc(100% + 2px)\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n borderRadius,\n },\n \"&.Mui-disabled\": {\n opacity: 0.38,\n color: lunit_token.component.btn_primary_text_1,\n },\n }),\n ...(kind === \"outlined\" &&\n color === \"secondary\" && {\n color: lunit_token.component.btn_secondary_text,\n border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.component.btn_secondary_border}`,\n \"&:hover\": getHoverStyle(\"none\"),\n \"&:hover:before\": {\n content: \"''\",\n position: \"absolute\",\n left: \"-1px\",\n top: \"-1px\",\n width: \"calc(100% + 2px)\",\n height: \"calc(100% + 2px)\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n borderRadius,\n },\n \"&.Mui-disabled\": {\n opacity: 0.38,\n color: lunit_token.component.btn_secondary_text,\n },\n }),\n});\n\nexport const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) =>\n ({\n fontWeight: \"500\",\n borderRadius,\n textTransform: \"initial\",\n \"&.Mui-focusVisible\": {\n \"&::after\": {\n position: \"absolute\",\n width: `calc(100% + ${PADDING_OF_FOCUS}px)`,\n height: `calc(100% + ${PADDING_OF_FOCUS}px)`,\n content: '\"\"',\n borderRadius: \"11px\",\n border: `1px solid ${lunit_token.core.focused}`,\n boxSizing: \"border-box\",\n },\n },\n \"&:hover:before\": {\n content: \"''\",\n position: \"absolute\",\n left: 0,\n top: 0,\n width: \"100%\",\n height: \"100%\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n borderRadius,\n },\n } as const);\n\nexport const iconStyle = ({\n size,\n hasIconOnly,\n}: Pick<CustomButtonProps, \"size\" | \"hasIconOnly\">) => ({\n \"& .MuiButton-startIcon\": {\n width: \"20px\",\n height: \"20px\",\n margin: 0,\n marginRight: hasIconOnly ? \"0px\" : size === \"large\" ? \"8px\" : \"4px\",\n\n // This style was added for Mui Button Svg Icon handling\n \"*:nth-of-type(1)\": {\n fontSize: \"20px\",\n },\n },\n svg: {\n width: \"20px\",\n height: \"20px\",\n margin: 0,\n marginRight: hasIconOnly ? \"0px\" : size === \"large\" ? \"8px\" : \"4px\",\n },\n});\n\nexport const CustomButton = styled(MuiButton, {\n shouldForwardProp: (prop: string) => {\n return ![\"kind\", \"hasIconOnly\"].includes(prop);\n },\n})<CustomButtonProps>(\n ({\n theme: {\n typography,\n palette: { lunit_token },\n },\n kind,\n size,\n color,\n hasIconOnly,\n }) => ({\n ...commonStyle({ lunit_token }),\n ...iconStyle({ size, hasIconOnly }),\n ...sizeStyle({ size, kind, hasIconOnly, typography }),\n ...kindStyle({ kind, color, lunit_token }),\n })\n);\n","import { styled } from \"@mui/material/styles\";\nimport { ToggleButton as MuiToggleButton } from \"@mui/material\";\n\nimport type { ToggleButtonProps } from \"../ToggleButton/ToggleButton.types\";\nimport {\n commonStyle,\n sizeStyle,\n kindStyle,\n iconStyle,\n} from \"../Button/Button.styled\";\n\ntype CustomToggleButtonProps = ToggleButtonProps & { hasIconOnly: boolean };\n\nexport const CustomToggleButton = styled(MuiToggleButton, {\n shouldForwardProp: (prop: string) => {\n return ![\"icon\", \"kind\", \"selectedColor\", \"hasIconOnly\"].includes(prop);\n },\n})<CustomToggleButtonProps>(\n ({\n theme: {\n typography,\n palette: { lunit_token },\n },\n kind,\n size,\n color,\n selectedColor,\n hasIconOnly,\n selected,\n }) => {\n return {\n border: \"none\",\n ...commonStyle({ lunit_token }),\n ...iconStyle({ size, hasIconOnly }),\n ...sizeStyle({ size, kind, hasIconOnly, selected, typography }),\n ...kindStyle({ kind, color, lunit_token }),\n ...(selectedColor === \"primary\" && {\n \"&.Mui-selected, &.Mui-selected:hover\": {\n border: \"none\",\n backgroundColor: lunit_token.component.btn_selected_primary_bg,\n color: lunit_token.component.btn_selected_primary_text,\n },\n }),\n ...(selectedColor === \"secondary\" && {\n \"&.Mui-selected, &.Mui-selected:hover\": {\n border: \"none\",\n backgroundColor: lunit_token.component.btn_selected_secondary_bg,\n color: lunit_token.component.btn_selected_secondary_text,\n },\n }),\n };\n }\n);\n\nexport const IconAndChildrenWrapper = styled(\"div\")({\n display: \"flex\",\n alignItems: \"center\",\n});\n","import React from \"react\";\nimport {\n CustomToggleButton,\n IconAndChildrenWrapper,\n} from \"./ToggleButton.styled\";\nimport type { ToggleButtonProps } from \"./ToggleButton.types\";\n\nconst ToggleButton = (props: ToggleButtonProps) => {\n const {\n kind = \"contained\",\n size = \"small\",\n color = \"primary\",\n selectedColor = \"primary\",\n className = \"\",\n icon,\n selected,\n children,\n ...buttonProps\n } = props;\n\n const hasIconOnly = Boolean(icon && !children);\n const excludeToggleGroupClass = className\n .replace(\"MuiToggleButtonGroup-grouped\", \"\")\n .replace(\"MuiToggleButtonGroup-groupedHorizontal\", \"\");\n\n return (\n <>\n {kind === \"contained\" || kind === \"ghost\" ? (\n <CustomToggleButton\n className={`${kind} ${excludeToggleGroupClass}`}\n selected={selected}\n kind={kind}\n color={color}\n size={size}\n hasIconOnly={hasIconOnly}\n selectedColor={selectedColor}\n disableRipple\n disableFocusRipple\n {...buttonProps}\n >\n {!hasIconOnly ? (\n <>\n {icon ? (\n <IconAndChildrenWrapper>\n {icon}\n {children}\n </IconAndChildrenWrapper>\n ) : (\n children\n )}\n </>\n ) : (\n icon\n )}\n </CustomToggleButton>\n ) : (\n <CustomToggleButton\n className={`outlined ${excludeToggleGroupClass}`}\n selected={selected}\n kind=\"outlined\"\n color=\"primary\"\n size={size}\n hasIconOnly={hasIconOnly}\n selectedColor={selectedColor}\n disableRipple\n disableFocusRipple\n {...buttonProps}\n >\n {!hasIconOnly ? (\n <>\n {icon ? (\n <IconAndChildrenWrapper>\n {icon}\n {children}\n </IconAndChildrenWrapper>\n ) : (\n children\n )}\n </>\n ) : (\n icon\n )}\n </CustomToggleButton>\n )}\n </>\n );\n};\n\nexport default ToggleButton;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","getButtonPaddingBySizeAndKind","kind","size","selected","getIconButtonPaddingBySizeAndKind","backgroundColor","position","zIndex","borderRadius","sizeStyle","hasIconOnly","typography","button2","padding","minWidth","minHeight","button1","kindStyle","color","lunit_token","component","btn_primary_text_2","btn_primary_bg","opacity","border","btn_secondary_text","btn_secondary_bg","btn_error_bg","btn_primary_text_1","btn_error_text","btn_primary_border","content","left","top","width","height","core","hover","btn_secondary_border","commonStyle","fontWeight","textTransform","focused","boxSizing","iconStyle","margin","marginRight","fontSize","svg","CustomToggleButton","styled","shouldForwardProp","includes","theme","palette","selectedColor","btn_selected_primary_bg","btn_selected_primary_text","btn_selected_secondary_bg","btn_selected_secondary_text","IconAndChildrenWrapper","display","alignItems","props","className","icon","children","buttonProps","Boolean","excludeToggleGroupClass","replace","disableRipple","disableFocusRipple"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/ToggleButton/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KA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,EACNiB,MAAOA,EACPhB,KAAMA,EACNQ,YAAaA,EACb4C,cAAeA,EACfgB,eAAa,EACbC,oBAAkB,KACdL,EAAW,SAEbxD,EAWE,GAVF,8BACGsD,GACC,UAACL,EAAsB,WACpBK,EACAC,KAED,OASV,SAACjB,EAAkB,CACjBe,UAAW,YAAYK,IACvBjE,SAAUA,EACVF,KAAK,WACLiB,MAAM,UACNhB,KAAMA,EACNQ,YAAaA,EACb4C,cAAeA,EACfgB,eAAa,EACbC,oBAAkB,KACdL,EAAW,SAEbxD,EAWE,GAVF,8BACGsD,GACC,UAACL,EAAsB,WACpBK,EACAC,KAED,OAUf,E","sources":["webpack://@lunit/design-system/webpack/bootstrap","webpack://@lunit/design-system/webpack/runtime/define property getters","webpack://@lunit/design-system/webpack/runtime/hasOwnProperty shorthand","webpack://@lunit/design-system/webpack/runtime/make namespace object","webpack://@lunit/design-system/external commonjs \"react/jsx-runtime\"","webpack://@lunit/design-system/external commonjs \"@mui/material/styles\"","webpack://@lunit/design-system/external commonjs \"@mui/material\"","webpack://@lunit/design-system/./src/components/Button/utils/getButtonPaddingBySizeAndKind.ts","webpack://@lunit/design-system/./src/components/Button/utils/getIconButtonPaddingBySizeAndKind.ts","webpack://@lunit/design-system/./src/components/Button/utils/getHoverStyle.ts","webpack://@lunit/design-system/./src/components/Button/Button.styled.ts","webpack://@lunit/design-system/./src/components/ToggleButton/ToggleButton.styled.ts","webpack://@lunit/design-system/./src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/styles\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import { OUTLINED_BORDER_WIDTH } from \"../const\";\n\nimport type { ButtonProps } from \"../Button.types\";\nimport { ToggleButtonProps } from \"@/components/ToggleButton/ToggleButton.types\";\n\ntype GetButtonPaddingBySizeAndKindParams = Pick<ButtonProps, \"kind\" | \"size\"> &\n Pick<ToggleButtonProps, \"selected\">;\n\n/**\n * When kind is outlined,\n * the padding value must include the border width of outlined.\n * This function takes care of this.\n */\nexport const getButtonPaddingBySizeAndKind = ({\n kind,\n size,\n selected = false,\n}: GetButtonPaddingBySizeAndKindParams) => {\n if (size === \"small\") {\n return kind === \"outlined\" && !selected\n ? `${4 - OUTLINED_BORDER_WIDTH}px ${8 - OUTLINED_BORDER_WIDTH}px`\n : \"4px 8px\";\n }\n\n if (size === \"medium\") {\n return kind === \"outlined\" && !selected\n ? `${8 - OUTLINED_BORDER_WIDTH}px ${12 - OUTLINED_BORDER_WIDTH}px`\n : \"8px 12px\";\n }\n\n // size === \"large\"\n return kind === \"outlined\" && !selected\n ? `${10 - OUTLINED_BORDER_WIDTH}px ${12 - OUTLINED_BORDER_WIDTH}px`\n : \"10px 12px\";\n};\n","import { OUTLINED_BORDER_WIDTH } from \"../const\";\n\nimport type { ButtonProps } from \"../Button.types\";\nimport { ToggleButtonProps } from \"@/components/ToggleButton/ToggleButton.types\";\n\ntype GetIconButtonPaddingBySizeAndKindProps = Pick<\n ButtonProps,\n \"kind\" | \"size\"\n> &\n Pick<ToggleButtonProps, \"selected\">;\n\n/**\n * When kind is outlined,\n * the padding value must include the border width of outlined.\n * This function takes care of this.\n */\nexport const getIconButtonPaddingBySizeAndKind = ({\n kind,\n size,\n selected = false,\n}: GetIconButtonPaddingBySizeAndKindProps) => {\n if (size === \"small\") {\n return kind === \"outlined\" && !selected\n ? `${4 - OUTLINED_BORDER_WIDTH}px`\n : \"4px\";\n }\n\n if (size === \"medium\") {\n return kind === \"outlined\" && !selected\n ? `${8 - OUTLINED_BORDER_WIDTH}px`\n : \"8px\";\n }\n\n // size === \"large\"\n return kind === \"outlined\" && !selected\n ? `${12 - OUTLINED_BORDER_WIDTH}px`\n : \"12px\";\n};\n","const getHoverStyle = (backgroundColor: React.CSSProperties[\"color\"]) => ({\n position: \"relative\",\n zIndex: 0,\n backgroundColor,\n});\n\nexport default getHoverStyle;\n","import { styled } from \"@mui/material/styles\";\nimport { Button as MuiButton } from \"@mui/material\";\n\nimport { ColorToken } from \"@/foundation/colors/types\";\nimport { PADDING_OF_FOCUS, OUTLINED_BORDER_WIDTH } from \"./const\";\nimport { getButtonPaddingBySizeAndKind } from \"./utils/getButtonPaddingBySizeAndKind\";\nimport { getIconButtonPaddingBySizeAndKind } from \"./utils/getIconButtonPaddingBySizeAndKind\";\nimport getHoverStyle from \"./utils/getHoverStyle\";\n\nimport type { ButtonProps } from \"./Button.types\";\nimport type { ToggleButtonProps } from \"../ToggleButton/ToggleButton.types\";\nimport type { Typography } from \"@mui/material/styles/createTypography\";\n\ntype KindStyleParams = Pick<ButtonProps, \"kind\" | \"color\"> & {\n lunit_token: ColorToken;\n};\n\ntype CustomButtonProps = ButtonProps & { hasIconOnly: boolean };\n\ntype sizeStyleParams = Pick<\n CustomButtonProps,\n \"size\" | \"hasIconOnly\" | \"kind\"\n> &\n Pick<ToggleButtonProps, \"selected\"> & { typography: Typography };\n\nconst borderRadius = \"8px\";\n\nexport const sizeStyle = ({\n size,\n kind,\n hasIconOnly,\n typography,\n selected = false,\n}: sizeStyleParams) => ({\n ...(size === \"small\" && {\n ...typography.button2,\n padding: `${\n hasIconOnly\n ? getIconButtonPaddingBySizeAndKind({ kind, size, selected })\n : getButtonPaddingBySizeAndKind({ kind, size, selected })\n }`,\n minWidth: \"28px\",\n height: \"28px\",\n }),\n ...(size === \"medium\" && {\n ...typography.button2,\n padding: `${\n hasIconOnly\n ? getIconButtonPaddingBySizeAndKind({ kind, size, selected })\n : getButtonPaddingBySizeAndKind({ kind, size, selected })\n }`,\n minWidth: \"36px\",\n height: \"36px\",\n }),\n ...(size === \"large\" && {\n ...typography.button1,\n padding: `${\n hasIconOnly\n ? getIconButtonPaddingBySizeAndKind({ kind, size, selected })\n : getButtonPaddingBySizeAndKind({ kind, size, selected })\n }`,\n minWidth: \"44px\",\n height: \"44px\",\n }),\n});\n\nexport const kindStyle = ({ kind, color, lunit_token }: KindStyleParams) => ({\n // kind: container\n ...(kind === \"contained\" &&\n color === \"primary\" && {\n color: lunit_token.component.btn_primary_text_2,\n backgroundColor: lunit_token.component.btn_primary_bg,\n \"&:hover\": getHoverStyle(lunit_token.component.btn_primary_bg),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_primary_text_2,\n },\n }),\n ...(kind === \"contained\" &&\n color === \"secondary\" && {\n color: lunit_token.component.btn_secondary_text,\n backgroundColor: lunit_token.component.btn_secondary_bg,\n \"&:hover\": getHoverStyle(lunit_token.component.btn_secondary_bg),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_secondary_text,\n },\n }),\n ...(kind === \"contained\" &&\n color === \"error\" && {\n color: lunit_token.component.btn_primary_text_2,\n backgroundColor: lunit_token.component.btn_error_bg,\n \"&:hover\": getHoverStyle(lunit_token.component.btn_error_bg),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_primary_text_2,\n },\n }),\n // kind: ghost\n ...(kind === \"ghost\" &&\n color === \"primary\" && {\n color: lunit_token.component.btn_primary_text_1,\n border: \"none\",\n \"&:hover\": getHoverStyle(\"none\"),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_primary_text_1,\n },\n }),\n ...(kind === \"ghost\" &&\n color === \"secondary\" && {\n color: lunit_token.component.btn_secondary_text,\n border: \"none\",\n \"&:hover\": getHoverStyle(\"none\"),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_secondary_text,\n },\n }),\n ...(kind === \"ghost\" &&\n color === \"error\" && {\n color: lunit_token.component.btn_error_text,\n \"&:hover\": getHoverStyle(\"none\"),\n \"&.Mui-disabled\": {\n opacity: 0.38,\n border: \"none\",\n color: lunit_token.component.btn_error_text,\n },\n }),\n // kind: outlined\n ...(kind === \"outlined\" &&\n color === \"primary\" && {\n color: lunit_token.component.btn_primary_text_1,\n border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.component.btn_primary_border}`,\n \"&:hover\": getHoverStyle(\"none\"),\n \"&:hover:before\": {\n content: \"''\",\n position: \"absolute\",\n left: \"-1px\",\n top: \"-1px\",\n width: \"calc(100% + 2px)\",\n height: \"calc(100% + 2px)\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n borderRadius,\n },\n \"&.Mui-disabled\": {\n opacity: 0.38,\n color: lunit_token.component.btn_primary_text_1,\n },\n }),\n ...(kind === \"outlined\" &&\n color === \"secondary\" && {\n color: lunit_token.component.btn_secondary_text,\n border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.component.btn_secondary_border}`,\n \"&:hover\": getHoverStyle(\"none\"),\n \"&:hover:before\": {\n content: \"''\",\n position: \"absolute\",\n left: \"-1px\",\n top: \"-1px\",\n width: \"calc(100% + 2px)\",\n height: \"calc(100% + 2px)\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n borderRadius,\n },\n \"&.Mui-disabled\": {\n opacity: 0.38,\n color: lunit_token.component.btn_secondary_text,\n },\n }),\n});\n\nexport const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) =>\n ({\n fontWeight: \"500\",\n borderRadius,\n textTransform: \"initial\",\n \"&.Mui-focusVisible\": {\n \"&::after\": {\n position: \"absolute\",\n width: `calc(100% + ${PADDING_OF_FOCUS}px)`,\n height: `calc(100% + ${PADDING_OF_FOCUS}px)`,\n content: '\"\"',\n borderRadius: \"11px\",\n border: `1px solid ${lunit_token.core.focused}`,\n boxSizing: \"border-box\",\n },\n },\n \"&:hover:before\": {\n content: \"''\",\n position: \"absolute\",\n left: 0,\n top: 0,\n width: \"100%\",\n height: \"100%\",\n zIndex: -1,\n backgroundColor: lunit_token.core.hover,\n borderRadius,\n },\n } as const);\n\nexport const iconStyle = ({\n size,\n hasIconOnly,\n}: Pick<CustomButtonProps, \"size\" | \"hasIconOnly\">) => ({\n \"& .MuiButton-startIcon\": {\n width: \"20px\",\n height: \"20px\",\n margin: 0,\n marginRight: hasIconOnly ? \"0px\" : size === \"large\" ? \"8px\" : \"4px\",\n\n // This style was added for Mui Button Svg Icon handling\n \"*:nth-of-type(1)\": {\n fontSize: \"20px\",\n },\n },\n svg: {\n width: \"20px\",\n height: \"20px\",\n margin: 0,\n marginRight: hasIconOnly ? \"0px\" : size === \"large\" ? \"8px\" : \"4px\",\n },\n});\n\nexport const CustomButton = styled(MuiButton, {\n shouldForwardProp: (prop: string) => {\n return ![\"kind\", \"hasIconOnly\"].includes(prop);\n },\n})<CustomButtonProps>(\n ({\n theme: {\n typography,\n palette: { lunit_token },\n },\n kind,\n size,\n color,\n hasIconOnly,\n }) => ({\n ...commonStyle({ lunit_token }),\n ...iconStyle({ size, hasIconOnly }),\n ...sizeStyle({ size, kind, hasIconOnly, typography }),\n ...kindStyle({ kind, color, lunit_token }),\n })\n);\n","import { styled } from \"@mui/material/styles\";\nimport { ToggleButton as MuiToggleButton } from \"@mui/material\";\n\nimport type { ToggleButtonProps } from \"../ToggleButton/ToggleButton.types\";\nimport {\n commonStyle,\n sizeStyle,\n kindStyle,\n iconStyle,\n} from \"../Button/Button.styled\";\n\ntype CustomToggleButtonProps = ToggleButtonProps & { hasIconOnly: boolean };\n\nexport const CustomToggleButton = styled(MuiToggleButton, {\n shouldForwardProp: (prop: string) => {\n return ![\"icon\", \"kind\", \"selectedColor\", \"hasIconOnly\"].includes(prop);\n },\n})<CustomToggleButtonProps>(\n ({\n theme: {\n typography,\n palette: { lunit_token },\n },\n kind,\n size,\n color,\n selectedColor,\n hasIconOnly,\n selected,\n }) => {\n return {\n border: \"none\",\n ...commonStyle({ lunit_token }),\n ...iconStyle({ size, hasIconOnly }),\n ...sizeStyle({ size, kind, hasIconOnly, selected, typography }),\n ...kindStyle({ kind, color, lunit_token }),\n ...(selectedColor === \"primary\" && {\n \"&.Mui-selected, &.Mui-selected:hover\": {\n border: \"none\",\n backgroundColor: lunit_token.component.btn_selected_primary_bg,\n color: lunit_token.component.btn_selected_primary_text,\n },\n }),\n ...(selectedColor === \"secondary\" && {\n \"&.Mui-selected, &.Mui-selected:hover\": {\n border: \"none\",\n backgroundColor: lunit_token.component.btn_selected_secondary_bg,\n color: lunit_token.component.btn_selected_secondary_text,\n },\n }),\n };\n }\n);\n\nexport const IconAndChildrenWrapper = styled(\"div\")({\n display: \"flex\",\n alignItems: \"center\",\n});\n","import React from \"react\";\nimport {\n CustomToggleButton,\n IconAndChildrenWrapper,\n} from \"./ToggleButton.styled\";\nimport type { ToggleButtonProps } from \"./ToggleButton.types\";\n\nconst ToggleButton = (props: ToggleButtonProps) => {\n const {\n kind = \"contained\",\n size = \"small\",\n color = \"primary\",\n selectedColor = \"primary\",\n className = \"\",\n icon,\n selected,\n children,\n ...buttonProps\n } = props;\n\n const hasIconOnly = Boolean(icon && !children);\n const excludeToggleGroupClass = className\n .replace(\"MuiToggleButtonGroup-grouped\", \"\")\n .replace(\"MuiToggleButtonGroup-groupedHorizontal\", \"\");\n\n return (\n <>\n {kind === \"contained\" || kind === \"ghost\" ? (\n <CustomToggleButton\n className={`${kind} ${excludeToggleGroupClass}`}\n selected={selected}\n kind={kind}\n color={color}\n size={size}\n hasIconOnly={hasIconOnly}\n selectedColor={selectedColor}\n disableRipple\n disableFocusRipple\n {...buttonProps}\n >\n {!hasIconOnly ? (\n <>\n {icon ? (\n <IconAndChildrenWrapper>\n {icon}\n {children}\n </IconAndChildrenWrapper>\n ) : (\n children\n )}\n </>\n ) : (\n icon\n )}\n </CustomToggleButton>\n ) : (\n <CustomToggleButton\n className={`outlined ${excludeToggleGroupClass}`}\n selected={selected}\n kind=\"outlined\"\n color=\"primary\"\n size={size}\n hasIconOnly={hasIconOnly}\n selectedColor={selectedColor}\n disableRipple\n disableFocusRipple\n {...buttonProps}\n >\n {!hasIconOnly ? (\n <>\n {icon ? (\n <IconAndChildrenWrapper>\n {icon}\n {children}\n </IconAndChildrenWrapper>\n ) : (\n children\n )}\n </>\n ) : (\n icon\n )}\n </CustomToggleButton>\n )}\n </>\n );\n};\n\nexport default ToggleButton;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","getButtonPaddingBySizeAndKind","kind","size","selected","getIconButtonPaddingBySizeAndKind","backgroundColor","position","zIndex","borderRadius","sizeStyle","hasIconOnly","typography","button2","padding","minWidth","height","button1","kindStyle","color","lunit_token","component","btn_primary_text_2","btn_primary_bg","opacity","border","btn_secondary_text","btn_secondary_bg","btn_error_bg","btn_primary_text_1","btn_error_text","btn_primary_border","content","left","top","width","core","hover","btn_secondary_border","commonStyle","fontWeight","textTransform","focused","boxSizing","iconStyle","margin","marginRight","fontSize","svg","CustomToggleButton","styled","shouldForwardProp","includes","theme","palette","selectedColor","btn_selected_primary_bg","btn_selected_primary_text","btn_selected_secondary_bg","btn_selected_secondary_text","IconAndChildrenWrapper","display","alignItems","props","className","icon","children","buttonProps","Boolean","excludeToggleGroupClass","replace","disableRipple","disableFocusRipple"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>
|
|
1
|
+
(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>n});const t=require("react/jsx-runtime"),o=require("@mui/material/Typography");var a=e.n(o);const n=e=>(0,t.jsx)(a(),{...e});module.exports=r})();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Typography/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,mCCL9D,MAAM,EAA+BC,QAAQ,
|
|
1
|
+
{"version":3,"file":"components/Typography/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,mCCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,4B,aCW7C,MAMA,EALEC,IAEO,SAAC,IAAa,IAAKA,I","sources":["webpack://@lunit/design-system/webpack/bootstrap","webpack://@lunit/design-system/webpack/runtime/compat get default export","webpack://@lunit/design-system/webpack/runtime/define property getters","webpack://@lunit/design-system/webpack/runtime/hasOwnProperty shorthand","webpack://@lunit/design-system/webpack/runtime/make namespace object","webpack://@lunit/design-system/external commonjs \"react/jsx-runtime\"","webpack://@lunit/design-system/external commonjs \"@mui/material/Typography\"","webpack://@lunit/design-system/./src/components/Typography/Typography.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Typography\");","import React from \"react\";\nimport MuiTypography from \"@mui/material/Typography\";\n\nimport type { TypographyProps } from \"@mui/material/Typography\";\nimport type { TypographyPropsVariantOverridesType } from \"../../foundation/Typography\";\n\ndeclare module \"@mui/material/Typography\" {\n interface TypographyPropsVariantOverrides\n extends TypographyPropsVariantOverridesType {}\n}\n\nconst Typography = <C extends React.ElementType>(\n props: TypographyProps<C, { component?: C }>\n) => {\n return <MuiTypography {...props} />;\n};\n\nexport default Typography;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","props"],"sourceRoot":""}
|