@foxford/ui 2.85.0-beta-d216815-20251015 → 2.86.0-beta-b007b52-20251030
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/components/FormLabel/FormLabel.js +1 -1
- package/components/FormLabel/FormLabel.js.map +1 -1
- package/components/FormLabel/FormLabel.mjs +1 -1
- package/components/FormLabel/FormLabel.mjs.map +1 -1
- package/components/FormLabel/constants.js +1 -1
- package/components/FormLabel/constants.js.map +1 -1
- package/components/FormLabel/constants.mjs +1 -1
- package/components/FormLabel/constants.mjs.map +1 -1
- package/components/FormLabel/style.js +1 -1
- package/components/FormLabel/style.js.map +1 -1
- package/components/FormLabel/style.mjs +1 -1
- package/components/FormLabel/style.mjs.map +1 -1
- package/components/InputCheckbox/InputCheckbox.js.map +1 -1
- package/components/InputCheckbox/InputCheckbox.mjs.map +1 -1
- package/components/InputCheckbox/constants.js.map +1 -1
- package/components/InputCheckbox/constants.mjs.map +1 -1
- package/components/InputCheckbox/style.js +1 -1
- package/components/InputCheckbox/style.js.map +1 -1
- package/components/InputCheckbox/style.mjs +1 -1
- package/components/InputCheckbox/style.mjs.map +1 -1
- package/components/InputRadio/InputRadio.js.map +1 -1
- package/components/InputRadio/InputRadio.mjs.map +1 -1
- package/components/InputRadio/constants.js.map +1 -1
- package/components/InputRadio/constants.mjs.map +1 -1
- package/components/Switch/Switch.js +1 -1
- package/components/Switch/Switch.js.map +1 -1
- package/components/Switch/Switch.mjs +1 -1
- package/components/Switch/Switch.mjs.map +1 -1
- package/components/Switch/constants.js.map +1 -1
- package/components/Switch/constants.mjs.map +1 -1
- package/dts/index.d.ts +622 -321
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/InputCheckbox/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport Checked from './images/checked.svg?module'\nimport Indeterminate from './images/indeterminate.svg?module'\nimport type { StyledInputCheckboxProps, InputCheckboxPalette } from './types'\n\nconst shouldForwardInputCheckboxProp = createShouldForwardProp(\n (propKey) => !['inline', 'error', 'success', 'onColored', 'indeterminate', 'disabled'].includes(propKey)\n)\n\nexport const Input = styled.input`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n border: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n &:focus {\n outline: none;\n }\n`\n\nexport const InputMask = styled.span`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n border: 1px solid transparent;\n`\n\nexport const InputChecked = styled(Checked)`\n box-sizing: border-box;\n width: 90%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n`\n\nexport const InputIndeterminate = styled(Indeterminate)`\n box-sizing: border-box;\n width: 90%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n`\n\nconst template = (palette: InputCheckboxPalette) => `\n & > ${InputMask} {\n background-color: ${palette.backgroundColor};\n border-color: ${palette.borderColor};\n color: ${palette.color};\n }\n &:hover > ${InputMask} {\n background-color: ${palette.backgroundColorHover};\n border-color: ${palette.borderColorHover};\n color: ${palette.colorHover};\n }\n & > ${Input}:checked:not(:disabled) + ${InputMask} {\n background-color: ${palette.backgroundColorChecked};\n border-color: ${palette.borderColorChecked};\n color: ${palette.colorChecked};\n }\n & > ${Input}:disabled:not(:checked) + ${InputMask} {\n background-color: ${palette.backgroundColorDisabled};\n border-color: ${palette.borderColorDisabled};\n color: ${palette.colorDisabled};\n }\n & > ${Input}:disabled:checked + ${InputMask} {\n background-color: ${palette.backgroundColorDisabledChecked};\n border-color: ${palette.borderColorDisabledChecked};\n color: ${palette.colorDisabledChecked};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-error-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-error-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-success-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-success-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['bg-brand-primary-basic'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['bg-brand-primary-basic'],\n borderColorChecked: theme.colors['bg-brand-primary-basic'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n contrast: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-error-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['bg-brand-primary-basic'],\n backgroundColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['bg-brand-primary-basic'],\n backgroundColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['bg-brand-primary-basic'],\n backgroundColorChecked: theme.colors['bg-oncolor-primary'],\n borderColorChecked: theme.colors['bg-oncolor-primary'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.span.withConfig<StyledInputCheckboxProps>({\n shouldForwardProp: shouldForwardInputCheckboxProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n position: relative;\n display: ${props.inline ? 'inline-flex' : 'flex'};\n flex-shrink: 0;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n & > ${Input} {\n cursor: inherit;\n }\n & > ${Input}:checked + ${InputMask} > ${InputChecked} {\n opacity: 1;\n }\n & > ${Input}:focus-visible + ${InputMask} {\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n `}\n ${(props) => {\n const schema = props.contrast || props.onColored ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.error) return schema.error\n if (props.success) return schema.success\n\n return schema.default\n }}\n\n ${responsiveSize}\n`\n"],"names":["shouldForwardInputCheckboxProp","createShouldForwardProp","propKey","includes","Input","styled","input","withConfig","displayName","componentId","InputMask","span","InputChecked","default","Checked","InputIndeterminate","Indeterminate","template","palette","backgroundColor","borderColor","color","backgroundColorHover","borderColorHover","colorHover","backgroundColorChecked","borderColorChecked","colorChecked","backgroundColorDisabled","borderColorDisabled","colorDisabled","backgroundColorDisabledChecked","borderColorDisabledChecked","colorDisabledChecked","COLOR_SCHEMA","error","css","theme","indeterminate","colors","success","contrast","Root","shouldForwardProp","props","inline","disabled","white","schema","onColored","responsiveSize"],"mappings":"2XAOA,MAAMA,+BAAiCC,MAAAA,yBACpCC,IAAa,CAAC,SAAU,QAAS,UAAW,YAAa,gBAAiB,YAAYC,SAASD,WAGrFE,MAAQC,gBAAAA,QAAOC,MAAKC,WAAA,CAAAC,YAAA,uBAAAC,YAAA,mBAAZJ,CAcpB,CAAA,sJAEYK,UAAYL,gBAAAA,QAAOM,KAAIJ,WAAA,CAAAC,YAAA,2BAAAC,YAAA,mBAAXJ,CASxB,CAAA,oIAEM,MAAMO,aAAeP,gBAAMQ,QAACC,iBAAQP,WAAA,CAAAC,YAAA,8BAAAC,YAAA,mBAAfJ,CAQ3B,CAAA,iHAEM,MAAMU,mBAAqBV,gBAAMQ,QAACG,uBAAcT,WAAA,CAAAC,YAAA,oCAAAC,YAAA,mBAArBJ,CAOjC,CAAA,uGAED,MAAMY,SAAYC,GAAkC,WAC5CR,sCACgBQ,EAAQC,uCACZD,EAAQE,4BACfF,EAAQG,4BAEPX,sCACUQ,EAAQI,4CACZJ,EAAQK,iCACfL,EAAQM,2BAEbpB,kCAAkCM,sCAClBQ,EAAQO,8CACZP,EAAQQ,mCACfR,EAAQS,6BAEbvB,kCAAkCM,sCAClBQ,EAAQU,+CACZV,EAAQW,oCACfX,EAAQY,8BAEb1B,4BAA4BM,sCACZQ,EAAQa,sDACZb,EAAQc,2CACfd,EAAQe,+BAIrB,MAAMC,aAAe,CACnBrB,QAAS,CACPsB,MAAOC,OAAAA,IAAG,CAAA,GAAA,KACN,EAAGC,QAA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jB,qBAAsBgB,EAAgBD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,qBACxFhB,iBAAkBe,EAAgBD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,wBACpFZ,aAAcU,EAAME,OAAO,0BAC3Bd,uBAAwBY,EAAME,OAAO,sBACrCb,mBAAoBW,EAAME,OAAO,sBACjCT,cAAeO,EAAME,OAAO,uBAC5BX,wBAAyBU,EACrBD,EAAME,OAAO,sBACbF,EAAME,OAAO,qBACjBV,oBAAqBS,EAAgBD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,mBACvFN,qBAAsBI,EAAME,OAAO,uBACnCR,+BAAgCM,EAAME,OAAO,sBAC7CP,2BAA4BK,EAAME,OAAO,yBACtCrB,QAMN,MAAMwB,KAAOrC,gBAAAA,QAAOM,KAAKJ,WAAqC,CACnEoC,kBAAmB3C,iCACnBO,WAAA,CAAAC,YAAA,sBAAAC,YAAA,mBAFkBJ,CAElB,CAAA,GAAA,IAAA,IAAA,KACGuC,GAAU,yGAIEA,EAAMC,OAAS,cAAgB,iDAEhCD,EAAME,SAAW,cAAgB,yBACrC1C,yDAGAA,mBAAmBM,eAAeE,2DAGlCR,yBAAyBM,8CACLkC,EAAMP,MAAME,OAAOQ,oBAAoBH,EAAMP,MAAME,OAAO,yGAKrFK,IACD,MAAMI,EAASJ,EAAMH,UAAYG,EAAMK,UAAYf,aAAaO,SAAWP,aAAarB,QAExF,OAAI+B,EAAMT,MAAca,EAAOb,MAC3BS,EAAMJ,QAAgBQ,EAAOR,QAE1BQ,EAAOnC,OAAO,GAGrBqC,eAAcA"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/InputCheckbox/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport Checked from './images/checked.svg?module'\nimport Indeterminate from './images/indeterminate.svg?module'\nimport type { StyledInputCheckboxProps, InputCheckboxPalette } from './types'\n\nconst shouldForwardInputCheckboxProp = createShouldForwardProp(\n (propKey) => !['inline', 'error', 'success', 'onColored', 'indeterminate', 'disabled'].includes(propKey)\n)\n\nexport const Input = styled.input`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n border: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n &:focus {\n outline: none;\n }\n`\n\nexport const InputMask = styled.span`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n border: 1px solid transparent;\n`\n\nexport const InputChecked = styled(Checked)`\n box-sizing: border-box;\n width: 80%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n`\n\nexport const InputIndeterminate = styled(Indeterminate)`\n box-sizing: border-box;\n width: 80%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n`\n\nconst template = (palette: InputCheckboxPalette) => `\n & > ${InputMask} {\n background-color: ${palette.backgroundColor};\n border-color: ${palette.borderColor};\n color: ${palette.color};\n }\n &:hover > ${InputMask} {\n background-color: ${palette.backgroundColorHover};\n border-color: ${palette.borderColorHover};\n color: ${palette.colorHover};\n }\n & > ${Input}:checked:not(:disabled) + ${InputMask} {\n background-color: ${palette.backgroundColorChecked};\n border-color: ${palette.borderColorChecked};\n color: ${palette.colorChecked};\n }\n & > ${Input}:disabled:not(:checked) + ${InputMask} {\n background-color: ${palette.backgroundColorDisabled};\n border-color: ${palette.borderColorDisabled};\n color: ${palette.colorDisabled};\n }\n & > ${Input}:disabled:checked + ${InputMask} {\n background-color: ${palette.backgroundColorDisabledChecked};\n border-color: ${palette.borderColorDisabledChecked};\n color: ${palette.colorDisabledChecked};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-error-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-error-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-success-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-success-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['bg-brand-primary-basic'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['bg-brand-primary-basic'],\n borderColorChecked: theme.colors['bg-brand-primary-basic'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n contrast: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-error-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['bg-brand-primary-basic'],\n backgroundColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['bg-brand-primary-basic'],\n backgroundColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['bg-brand-primary-basic'],\n backgroundColorChecked: theme.colors['bg-oncolor-primary'],\n borderColorChecked: theme.colors['bg-oncolor-primary'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.span.withConfig<StyledInputCheckboxProps>({\n shouldForwardProp: shouldForwardInputCheckboxProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n position: relative;\n display: ${props.inline ? 'inline-flex' : 'flex'};\n flex-shrink: 0;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n & > ${Input} {\n cursor: inherit;\n }\n & > ${Input}:checked + ${InputMask} > ${InputChecked} {\n opacity: 1;\n }\n & > ${Input}:focus-visible + ${InputMask} {\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n `}\n ${(props) => {\n const schema = props.contrast || props.onColored ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.error) return schema.error\n if (props.success) return schema.success\n\n return schema.default\n }}\n\n ${responsiveSize}\n`\n"],"names":["shouldForwardInputCheckboxProp","createShouldForwardProp","propKey","includes","Input","styled","input","withConfig","displayName","componentId","InputMask","span","InputChecked","default","Checked","InputIndeterminate","Indeterminate","template","palette","backgroundColor","borderColor","color","backgroundColorHover","borderColorHover","colorHover","backgroundColorChecked","borderColorChecked","colorChecked","backgroundColorDisabled","borderColorDisabled","colorDisabled","backgroundColorDisabledChecked","borderColorDisabledChecked","colorDisabledChecked","COLOR_SCHEMA","error","css","theme","indeterminate","colors","success","contrast","Root","shouldForwardProp","props","inline","disabled","white","schema","onColored","responsiveSize"],"mappings":"2XAOA,MAAMA,+BAAiCC,MAAAA,yBACpCC,IAAa,CAAC,SAAU,QAAS,UAAW,YAAa,gBAAiB,YAAYC,SAASD,WAGrFE,MAAQC,gBAAAA,QAAOC,MAAKC,WAAA,CAAAC,YAAA,uBAAAC,YAAA,mBAAZJ,CAcpB,CAAA,sJAEYK,UAAYL,gBAAAA,QAAOM,KAAIJ,WAAA,CAAAC,YAAA,2BAAAC,YAAA,mBAAXJ,CASxB,CAAA,oIAEM,MAAMO,aAAeP,gBAAMQ,QAACC,iBAAQP,WAAA,CAAAC,YAAA,8BAAAC,YAAA,mBAAfJ,CAQ3B,CAAA,iHAEM,MAAMU,mBAAqBV,gBAAMQ,QAACG,uBAAcT,WAAA,CAAAC,YAAA,oCAAAC,YAAA,mBAArBJ,CAOjC,CAAA,uGAED,MAAMY,SAAYC,GAAkC,WAC5CR,sCACgBQ,EAAQC,uCACZD,EAAQE,4BACfF,EAAQG,4BAEPX,sCACUQ,EAAQI,4CACZJ,EAAQK,iCACfL,EAAQM,2BAEbpB,kCAAkCM,sCAClBQ,EAAQO,8CACZP,EAAQQ,mCACfR,EAAQS,6BAEbvB,kCAAkCM,sCAClBQ,EAAQU,+CACZV,EAAQW,oCACfX,EAAQY,8BAEb1B,4BAA4BM,sCACZQ,EAAQa,sDACZb,EAAQc,2CACfd,EAAQe,+BAIrB,MAAMC,aAAe,CACnBrB,QAAS,CACPsB,MAAOC,OAAAA,IAAG,CAAA,GAAA,KACN,EAAGC,QAAOnB,UAASoB,mBACnBrB,SAAS,CACPI,MAAOgB,EAAME,OAAO,2BACpBpB,gBAAiBmB,EAAgB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BD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,wBACpFZ,aAAcU,EAAME,OAAO,0BAC3Bd,uBAAwBY,EAAME,OAAO,sBACrCb,mBAAoBW,EAAME,OAAO,sBACjCT,cAAeO,EAAME,OAAO,uBAC5BX,wBAAyBU,EACrBD,EAAME,OAAO,sBACbF,EAAME,OAAO,qBACjBV,oBAAqBS,EAAgBD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,mBACvFN,qBAAsBI,EAAME,OAAO,uBACnCR,+BAAgCM,EAAME,OAAO,sBAC7CP,2BAA4BK,EAAME,OAAO,yBACtCrB,QAMN,MAAMwB,KAAOrC,gBAAAA,QAAOM,KAAKJ,WAAqC,CACnEoC,kBAAmB3C,iCACnBO,WAAA,CAAAC,YAAA,sBAAAC,YAAA,mBAFkBJ,CAElB,CAAA,GAAA,IAAA,IAAA,KACGuC,GAAU,yGAIEA,EAAMC,OAAS,cAAgB,iDAEhCD,EAAME,SAAW,cAAgB,yBACrC1C,yDAGAA,mBAAmBM,eAAeE,2DAGlCR,yBAAyBM,8CACLkC,EAAMP,MAAME,OAAOQ,oBAAoBH,EAAMP,MAAME,OAAO,yGAKrFK,IACD,MAAMI,EAASJ,EAAMH,UAAYG,EAAMK,UAAYf,aAAaO,SAAWP,aAAarB,QAExF,OAAI+B,EAAMT,MAAca,EAAOb,MAC3BS,EAAMJ,QAAgBQ,EAAOR,QAE1BQ,EAAOnC,OAAO,GAGrBqC,eAAcA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled,{css}from'styled-components';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import SvgChecked from'./images/checked.svg.mjs';import SvgIndeterminate from'./images/indeterminate.svg.mjs';const shouldForwardInputCheckboxProp=createShouldForwardProp((o=>!['inline','error','success','onColored','indeterminate','disabled'].includes(o)));const Input=styled.input.withConfig({displayName:"InputCheckbox__Input",componentId:"ui__sc-3ztnvc-0"})(["box-sizing:border-box;position:absolute;top:0;left:0;margin:0;border:none;opacity:0;width:100%;height:100%;z-index:1;&:focus{outline:none;}"]);const InputMask=styled.span.withConfig({displayName:"InputCheckbox__InputMask",componentId:"ui__sc-3ztnvc-1"})(["box-sizing:border-box;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit;border:1px solid transparent;"]);const InputChecked=styled(SvgChecked).withConfig({displayName:"InputCheckbox__InputChecked",componentId:"ui__sc-3ztnvc-2"})(["box-sizing:border-box;width:
|
|
1
|
+
import styled,{css}from'styled-components';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import SvgChecked from'./images/checked.svg.mjs';import SvgIndeterminate from'./images/indeterminate.svg.mjs';const shouldForwardInputCheckboxProp=createShouldForwardProp((o=>!['inline','error','success','onColored','indeterminate','disabled'].includes(o)));const Input=styled.input.withConfig({displayName:"InputCheckbox__Input",componentId:"ui__sc-3ztnvc-0"})(["box-sizing:border-box;position:absolute;top:0;left:0;margin:0;border:none;opacity:0;width:100%;height:100%;z-index:1;&:focus{outline:none;}"]);const InputMask=styled.span.withConfig({displayName:"InputCheckbox__InputMask",componentId:"ui__sc-3ztnvc-1"})(["box-sizing:border-box;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit;border:1px solid transparent;"]);const InputChecked=styled(SvgChecked).withConfig({displayName:"InputCheckbox__InputChecked",componentId:"ui__sc-3ztnvc-2"})(["box-sizing:border-box;width:80%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;"]);const InputIndeterminate=styled(SvgIndeterminate).withConfig({displayName:"InputCheckbox__InputIndeterminate",componentId:"ui__sc-3ztnvc-3"})(["box-sizing:border-box;width:80%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);"]);const template=o=>`\n & > ${InputMask} {\n background-color: ${o.backgroundColor};\n border-color: ${o.borderColor};\n color: ${o.color};\n }\n &:hover > ${InputMask} {\n background-color: ${o.backgroundColorHover};\n border-color: ${o.borderColorHover};\n color: ${o.colorHover};\n }\n & > ${Input}:checked:not(:disabled) + ${InputMask} {\n background-color: ${o.backgroundColorChecked};\n border-color: ${o.borderColorChecked};\n color: ${o.colorChecked};\n }\n & > ${Input}:disabled:not(:checked) + ${InputMask} {\n background-color: ${o.backgroundColorDisabled};\n border-color: ${o.borderColorDisabled};\n color: ${o.colorDisabled};\n }\n & > ${Input}:disabled:checked + ${InputMask} {\n background-color: ${o.backgroundColorDisabledChecked};\n border-color: ${o.borderColorDisabledChecked};\n color: ${o.colorDisabledChecked};\n }\n`;const COLOR_SCHEMA={default:{error:css(["",""],(({theme:o,palette:r,indeterminate:e})=>template({color:o.colors['content-oncolor-primary'],backgroundColor:e?o.colors['alert-bg-error-500']:o.colors['bg-onmain-primary'],borderColor:o.colors['alert-bg-error-500'],colorHover:o.colors['content-oncolor-primary'],backgroundColorHover:e?o.colors['alert-bg-error-500']:o.colors['bg-onmain-primary'],borderColorHover:o.colors['alert-bg-error-500'],colorChecked:o.colors['content-oncolor-primary'],backgroundColorChecked:o.colors['alert-bg-error-500'],borderColorChecked:o.colors['alert-bg-error-500'],colorDisabled:o.colors['bg-onmain-secondary'],backgroundColorDisabled:e?o.colors['bg-disabled-active']:o.colors['bg-disabled-large'],borderColorDisabled:e?o.colors['bg-disabled-active']:o.colors['border-disabled'],colorDisabledChecked:o.colors['bg-onmain-secondary'],backgroundColorDisabledChecked:o.colors['bg-disabled-active'],borderColorDisabledChecked:o.colors['bg-disabled-active'],...r}))),success:css(["",""],(({theme:o,palette:r,indeterminate:e})=>template({color:o.colors['content-oncolor-primary'],backgroundColor:e?o.colors['alert-bg-success-500']:o.colors['bg-onmain-primary'],borderColor:o.colors['alert-bg-success-500'],colorHover:o.colors['content-oncolor-primary'],backgroundColorHover:e?o.colors['alert-bg-success-500']:o.colors['bg-onmain-primary'],borderColorHover:o.colors['alert-bg-success-500'],colorChecked:o.colors['content-oncolor-primary'],backgroundColorChecked:o.colors['alert-bg-success-500'],borderColorChecked:o.colors['alert-bg-success-500'],colorDisabled:o.colors['bg-onmain-secondary'],backgroundColorDisabled:e?o.colors['bg-disabled-active']:o.colors['bg-disabled-large'],borderColorDisabled:e?o.colors['bg-disabled-active']:o.colors['border-disabled'],colorDisabledChecked:o.colors['bg-onmain-secondary'],backgroundColorDisabledChecked:o.colors['bg-disabled-active'],borderColorDisabledChecked:o.colors['bg-disabled-active'],...r}))),default:css(["",""],(({theme:o,palette:r,indeterminate:e})=>template({color:o.colors['content-oncolor-primary'],backgroundColor:e?o.colors['bg-brand-primary-basic']:o.colors['bg-onmain-primary'],borderColor:e?o.colors['bg-brand-primary-basic']:o.colors['border-onmain-default-small'],colorHover:o.colors['content-oncolor-primary'],backgroundColorHover:e?o.colors['bg-brand-primary-basic']:o.colors['bg-onmain-primary'],borderColorHover:e?o.colors['bg-brand-primary-basic']:o.colors['border-brand-primary'],colorChecked:o.colors['content-oncolor-primary'],backgroundColorChecked:o.colors['bg-brand-primary-basic'],borderColorChecked:o.colors['bg-brand-primary-basic'],colorDisabled:o.colors['bg-onmain-secondary'],backgroundColorDisabled:e?o.colors['bg-disabled-active']:o.colors['bg-disabled-large'],borderColorDisabled:e?o.colors['bg-disabled-active']:o.colors['border-disabled'],colorDisabledChecked:o.colors['bg-onmain-secondary'],backgroundColorDisabledChecked:o.colors['bg-disabled-active'],borderColorDisabledChecked:o.colors['bg-disabled-active'],...r})))},contrast:{error:css(["",""],(({theme:o,palette:r,indeterminate:e})=>template({color:o.colors['content-oncolor-primary'],backgroundColor:e?o.colors['alert-bg-error-500']:o.colors['bg-onmain-secondary'],borderColor:e?o.colors['alert-bg-error-500']:o.colors['alert-error'],colorHover:o.colors['content-oncolor-primary'],backgroundColorHover:e?o.colors['alert-bg-error-500']:o.colors['bg-onmain-secondary'],borderColorHover:e?o.colors['alert-bg-error-500']:o.colors['alert-error'],colorChecked:o.colors['content-oncolor-primary'],backgroundColorChecked:o.colors['alert-bg-error-500'],borderColorChecked:o.colors['alert-bg-error-500'],colorDisabled:o.colors['bg-onmain-secondary'],backgroundColorDisabled:e?o.colors['bg-disabled-active']:o.colors['bg-disabled-small'],borderColorDisabled:e?o.colors['bg-disabled-active']:o.colors['border-disabled'],colorDisabledChecked:o.colors['bg-onmain-secondary'],backgroundColorDisabledChecked:o.colors['bg-disabled-active'],borderColorDisabledChecked:o.colors['bg-disabled-active'],...r}))),success:css(["",""],(({theme:o,palette:r,indeterminate:e})=>template({color:o.colors['content-oncolor-primary'],backgroundColor:e?o.colors['alert-bg-success-500']:o.colors['bg-onmain-secondary'],borderColor:e?o.colors['alert-bg-success-500']:o.colors['alert-success'],colorHover:o.colors['content-oncolor-primary'],backgroundColorHover:e?o.colors['alert-bg-success-500']:o.colors['bg-onmain-secondary'],borderColorHover:e?o.colors['alert-bg-success-500']:o.colors['alert-success'],colorChecked:o.colors['content-oncolor-primary'],backgroundColorChecked:o.colors['alert-bg-success-500'],borderColorChecked:o.colors['alert-bg-success-500'],colorDisabled:o.colors['bg-onmain-secondary'],backgroundColorDisabled:e?o.colors['bg-disabled-active']:o.colors['bg-disabled-small'],borderColorDisabled:e?o.colors['bg-disabled-active']:o.colors['border-disabled'],colorDisabledChecked:o.colors['bg-onmain-secondary'],backgroundColorDisabledChecked:o.colors['bg-disabled-active'],borderColorDisabledChecked:o.colors['bg-disabled-active'],...r}))),default:css(["",""],(({theme:o,palette:r,indeterminate:e})=>template({color:o.colors['bg-brand-primary-basic'],backgroundColor:e?o.colors['bg-oncolor-primary']:o.colors['bg-onmain-primary'],borderColor:e?o.colors['bg-oncolor-primary']:o.colors['border-onmain-default-small'],colorHover:o.colors['bg-brand-primary-basic'],backgroundColorHover:e?o.colors['bg-oncolor-primary']:o.colors['bg-onmain-primary'],borderColorHover:e?o.colors['bg-oncolor-primary']:o.colors['border-brand-primary'],colorChecked:o.colors['bg-brand-primary-basic'],backgroundColorChecked:o.colors['bg-oncolor-primary'],borderColorChecked:o.colors['bg-oncolor-primary'],colorDisabled:o.colors['bg-onmain-secondary'],backgroundColorDisabled:e?o.colors['bg-disabled-active']:o.colors['bg-disabled-small'],borderColorDisabled:e?o.colors['bg-disabled-active']:o.colors['border-disabled'],colorDisabledChecked:o.colors['bg-onmain-secondary'],backgroundColorDisabledChecked:o.colors['bg-disabled-active'],borderColorDisabledChecked:o.colors['bg-disabled-active'],...r})))}};const Root=styled.span.withConfig({shouldForwardProp:shouldForwardInputCheckboxProp}).withConfig({displayName:"InputCheckbox__Root",componentId:"ui__sc-3ztnvc-4"})([""," "," ",""],(o=>`\n box-sizing: border-box;\n isolation: isolate;\n position: relative;\n display: ${o.inline?'inline-flex':'flex'};\n flex-shrink: 0;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n & > ${Input} {\n cursor: inherit;\n }\n & > ${Input}:checked + ${InputMask} > ${InputChecked} {\n opacity: 1;\n }\n & > ${Input}:focus-visible + ${InputMask} {\n box-shadow: 0 0 0 2px ${o.theme.colors.white}, 0 0 0 4px ${o.theme.colors['border-focus']};\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n `),(o=>{const r=o.contrast||o.onColored?COLOR_SCHEMA.contrast:COLOR_SCHEMA.default;return o.error?r.error:o.success?r.success:r.default}),responsiveSize);export{Input,InputChecked,InputIndeterminate,InputMask,Root};
|
|
2
2
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/InputCheckbox/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport Checked from './images/checked.svg?module'\nimport Indeterminate from './images/indeterminate.svg?module'\nimport type { StyledInputCheckboxProps, InputCheckboxPalette } from './types'\n\nconst shouldForwardInputCheckboxProp = createShouldForwardProp(\n (propKey) => !['inline', 'error', 'success', 'onColored', 'indeterminate', 'disabled'].includes(propKey)\n)\n\nexport const Input = styled.input`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n border: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n &:focus {\n outline: none;\n }\n`\n\nexport const InputMask = styled.span`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n border: 1px solid transparent;\n`\n\nexport const InputChecked = styled(Checked)`\n box-sizing: border-box;\n width: 90%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n`\n\nexport const InputIndeterminate = styled(Indeterminate)`\n box-sizing: border-box;\n width: 90%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n`\n\nconst template = (palette: InputCheckboxPalette) => `\n & > ${InputMask} {\n background-color: ${palette.backgroundColor};\n border-color: ${palette.borderColor};\n color: ${palette.color};\n }\n &:hover > ${InputMask} {\n background-color: ${palette.backgroundColorHover};\n border-color: ${palette.borderColorHover};\n color: ${palette.colorHover};\n }\n & > ${Input}:checked:not(:disabled) + ${InputMask} {\n background-color: ${palette.backgroundColorChecked};\n border-color: ${palette.borderColorChecked};\n color: ${palette.colorChecked};\n }\n & > ${Input}:disabled:not(:checked) + ${InputMask} {\n background-color: ${palette.backgroundColorDisabled};\n border-color: ${palette.borderColorDisabled};\n color: ${palette.colorDisabled};\n }\n & > ${Input}:disabled:checked + ${InputMask} {\n background-color: ${palette.backgroundColorDisabledChecked};\n border-color: ${palette.borderColorDisabledChecked};\n color: ${palette.colorDisabledChecked};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-error-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-error-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-success-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-success-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['bg-brand-primary-basic'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['bg-brand-primary-basic'],\n borderColorChecked: theme.colors['bg-brand-primary-basic'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n contrast: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-error-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['bg-brand-primary-basic'],\n backgroundColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['bg-brand-primary-basic'],\n backgroundColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['bg-brand-primary-basic'],\n backgroundColorChecked: theme.colors['bg-oncolor-primary'],\n borderColorChecked: theme.colors['bg-oncolor-primary'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.span.withConfig<StyledInputCheckboxProps>({\n shouldForwardProp: shouldForwardInputCheckboxProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n position: relative;\n display: ${props.inline ? 'inline-flex' : 'flex'};\n flex-shrink: 0;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n & > ${Input} {\n cursor: inherit;\n }\n & > ${Input}:checked + ${InputMask} > ${InputChecked} {\n opacity: 1;\n }\n & > ${Input}:focus-visible + ${InputMask} {\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n `}\n ${(props) => {\n const schema = props.contrast || props.onColored ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.error) return schema.error\n if (props.success) return schema.success\n\n return schema.default\n }}\n\n ${responsiveSize}\n`\n"],"names":["shouldForwardInputCheckboxProp","createShouldForwardProp","propKey","includes","Input","styled","input","withConfig","displayName","componentId","InputMask","span","InputChecked","Checked","InputIndeterminate","Indeterminate","template","palette","backgroundColor","borderColor","color","backgroundColorHover","borderColorHover","colorHover","backgroundColorChecked","borderColorChecked","colorChecked","backgroundColorDisabled","borderColorDisabled","colorDisabled","backgroundColorDisabledChecked","borderColorDisabledChecked","colorDisabledChecked","COLOR_SCHEMA","default","error","css","theme","indeterminate","colors","success","contrast","Root","shouldForwardProp","props","inline","disabled","white","schema","onColored","responsiveSize"],"mappings":"wRAOA,MAAMA,+BAAiCC,yBACpCC,IAAa,CAAC,SAAU,QAAS,UAAW,YAAa,gBAAiB,YAAYC,SAASD,WAGrFE,MAAQC,OAAOC,MAAKC,WAAA,CAAAC,YAAA,uBAAAC,YAAA,mBAAZJ,CAcpB,CAAA,sJAEYK,UAAYL,OAAOM,KAAIJ,WAAA,CAAAC,YAAA,2BAAAC,YAAA,mBAAXJ,CASxB,CAAA,oIAEM,MAAMO,aAAeP,OAAOQ,YAAQN,WAAA,CAAAC,YAAA,8BAAAC,YAAA,mBAAfJ,CAQ3B,CAAA,iHAEM,MAAMS,mBAAqBT,OAAOU,kBAAcR,WAAA,CAAAC,YAAA,oCAAAC,YAAA,mBAArBJ,CAOjC,CAAA,uGAED,MAAMW,SAAYC,GAAkC,WAC5CP,sCACgBO,EAAQC,uCACZD,EAAQE,4BACfF,EAAQG,4BAEPV,sCACUO,EAAQI,4CACZJ,EAAQK,iCACfL,EAAQM,2BAEbnB,kCAAkCM,sCAClBO,EAAQO,8CACZP,EAAQQ,mCACfR,EAAQS,6BAEbtB,kCAAkCM,sCAClBO,EAAQU,+CACZV,EAAQW,oCACfX,EAAQY,8BAEbzB,4BAA4BM,sCACZO,EAAQa,sDACZb,EAAQc,2CACfd,EAAQe,+BAIrB,MAAMC,aAAe,CACnBC,QAAS,CACPC,MAAOC,IAAG,CAAA,GAAA,KACN,EAAGC,QAAOpB,UAASqB,mBACnBtB,SAAS,CACPI,MAAOiB,EAAME,OAAO,2BACpBrB,gBAAiBoB,EAAgBD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,qBACnFpB,YAAakB,EAAME,OAAO,sBAC1BhB,WAAYc,EAAME,OAAO,2BACzBlB,qBAAsBiB,EAAgBD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,qBACxFjB,iBAAkBe,EAAME,OAAO,sBAC/Bb,aAAcW,EAA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EAAgBD,EAAME,OAAO,sBAAwBF,EAAME,OAAO,mBACvFP,qBAAsBK,EAAME,OAAO,uBACnCT,+BAAgCO,EAAME,OAAO,sBAC7CR,2BAA4BM,EAAME,OAAO,yBACtCtB,QAMN,MAAMyB,KAAOrC,OAAOM,KAAKJ,WAAqC,CACnEoC,kBAAmB3C,iCACnBO,WAAA,CAAAC,YAAA,sBAAAC,YAAA,mBAFkBJ,CAElB,CAAA,GAAA,IAAA,IAAA,KACGuC,GAAU,yGAIEA,EAAMC,OAAS,cAAgB,iDAEhCD,EAAME,SAAW,cAAgB,yBACrC1C,yDAGAA,mBAAmBM,eAAeE,2DAGlCR,yBAAyBM,8CACLkC,EAAMP,MAAME,OAAOQ,oBAAoBH,EAAMP,MAAME,OAAO,yGAKrFK,IACD,MAAMI,EAASJ,EAAMH,UAAYG,EAAMK,UAAYhB,aAAaQ,SAAWR,aAAaC,QAExF,OAAIU,EAAMT,MAAca,EAAOb,MAC3BS,EAAMJ,QAAgBQ,EAAOR,QAE1BQ,EAAOd,OAAO,GAGrBgB"}
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/InputCheckbox/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport Checked from './images/checked.svg?module'\nimport Indeterminate from './images/indeterminate.svg?module'\nimport type { StyledInputCheckboxProps, InputCheckboxPalette } from './types'\n\nconst shouldForwardInputCheckboxProp = createShouldForwardProp(\n (propKey) => !['inline', 'error', 'success', 'onColored', 'indeterminate', 'disabled'].includes(propKey)\n)\n\nexport const Input = styled.input`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n margin: 0;\n border: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n &:focus {\n outline: none;\n }\n`\n\nexport const InputMask = styled.span`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n border: 1px solid transparent;\n`\n\nexport const InputChecked = styled(Checked)`\n box-sizing: border-box;\n width: 80%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n opacity: 0;\n`\n\nexport const InputIndeterminate = styled(Indeterminate)`\n box-sizing: border-box;\n width: 80%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n`\n\nconst template = (palette: InputCheckboxPalette) => `\n & > ${InputMask} {\n background-color: ${palette.backgroundColor};\n border-color: ${palette.borderColor};\n color: ${palette.color};\n }\n &:hover > ${InputMask} {\n background-color: ${palette.backgroundColorHover};\n border-color: ${palette.borderColorHover};\n color: ${palette.colorHover};\n }\n & > ${Input}:checked:not(:disabled) + ${InputMask} {\n background-color: ${palette.backgroundColorChecked};\n border-color: ${palette.borderColorChecked};\n color: ${palette.colorChecked};\n }\n & > ${Input}:disabled:not(:checked) + ${InputMask} {\n background-color: ${palette.backgroundColorDisabled};\n border-color: ${palette.borderColorDisabled};\n color: ${palette.colorDisabled};\n }\n & > ${Input}:disabled:checked + ${InputMask} {\n background-color: ${palette.backgroundColorDisabledChecked};\n border-color: ${palette.borderColorDisabledChecked};\n color: ${palette.colorDisabledChecked};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-error-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-error-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-primary'],\n borderColor: theme.colors['alert-bg-success-500'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: theme.colors['alert-bg-success-500'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['bg-brand-primary-basic'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate\n ? theme.colors['bg-brand-primary-basic']\n : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['bg-brand-primary-basic'],\n borderColorChecked: theme.colors['bg-brand-primary-basic'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-large'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n contrast: {\n error: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-error-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-error-500'] : theme.colors['alert-error'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-error-500'],\n borderColorChecked: theme.colors['alert-bg-error-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n success: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['content-oncolor-primary'],\n backgroundColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['bg-onmain-secondary'],\n borderColor: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorHover: theme.colors['content-oncolor-primary'],\n backgroundColorHover: indeterminate\n ? theme.colors['alert-bg-success-500']\n : theme.colors['bg-onmain-secondary'],\n borderColorHover: indeterminate ? theme.colors['alert-bg-success-500'] : theme.colors['alert-success'],\n colorChecked: theme.colors['content-oncolor-primary'],\n backgroundColorChecked: theme.colors['alert-bg-success-500'],\n borderColorChecked: theme.colors['alert-bg-success-500'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n default: css<StyledInputCheckboxProps>`\n ${({ theme, palette, indeterminate }) =>\n template({\n color: theme.colors['bg-brand-primary-basic'],\n backgroundColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColor: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-onmain-default-small'],\n colorHover: theme.colors['bg-brand-primary-basic'],\n backgroundColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['bg-onmain-primary'],\n borderColorHover: indeterminate ? theme.colors['bg-oncolor-primary'] : theme.colors['border-brand-primary'],\n colorChecked: theme.colors['bg-brand-primary-basic'],\n backgroundColorChecked: theme.colors['bg-oncolor-primary'],\n borderColorChecked: theme.colors['bg-oncolor-primary'],\n colorDisabled: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabled: indeterminate\n ? theme.colors['bg-disabled-active']\n : theme.colors['bg-disabled-small'],\n borderColorDisabled: indeterminate ? theme.colors['bg-disabled-active'] : theme.colors['border-disabled'],\n colorDisabledChecked: theme.colors['bg-onmain-secondary'],\n backgroundColorDisabledChecked: theme.colors['bg-disabled-active'],\n borderColorDisabledChecked: theme.colors['bg-disabled-active'],\n ...palette,\n })}\n `,\n },\n}\n\nexport const Root = styled.span.withConfig<StyledInputCheckboxProps>({\n shouldForwardProp: shouldForwardInputCheckboxProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n position: relative;\n display: ${props.inline ? 'inline-flex' : 'flex'};\n flex-shrink: 0;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n & > ${Input} {\n cursor: inherit;\n }\n & > ${Input}:checked + ${InputMask} > ${InputChecked} {\n opacity: 1;\n }\n & > ${Input}:focus-visible + ${InputMask} {\n box-shadow: 0 0 0 2px ${props.theme.colors.white}, 0 0 0 4px ${props.theme.colors['border-focus']};\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n `}\n ${(props) => {\n const schema = props.contrast || props.onColored ? COLOR_SCHEMA.contrast : COLOR_SCHEMA.default\n\n if (props.error) return schema.error\n if (props.success) return schema.success\n\n return schema.default\n }}\n\n ${responsiveSize}\n`\n"],"names":["shouldForwardInputCheckboxProp","createShouldForwardProp","propKey","includes","Input","styled","input","withConfig","displayName","componentId","InputMask","span","InputChecked","Checked","InputIndeterminate","Indeterminate","template","palette","backgroundColor","borderColor","color","backgroundColorHover","borderColorHover","colorHover","backgroundColorChecked","borderColorChecked","colorChecked","backgroundColorDisabled","borderColorDisabled","colorDisabled","backgroundColorDisabledChecked","borderColorDisabledChecked","colorDisabledChecked","COLOR_SCHEMA","default","error","css","theme","indeterminate","colors","success","contrast","Root","shouldForwardProp","props","inline","disabled","white","schema","onColored","responsiveSize"],"mappings":"wRAOA,MAAMA,+BAAiCC,yBACpCC,IAAa,CAAC,SAAU,QAAS,UAAW,YAAa,gBAAiB,YAAYC,SAASD,WA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,KAAKJ,WAAqC,CACnEoC,kBAAmB3C,iCACnBO,WAAA,CAAAC,YAAA,sBAAAC,YAAA,mBAFkBJ,CAElB,CAAA,GAAA,IAAA,IAAA,KACGuC,GAAU,yGAIEA,EAAMC,OAAS,cAAgB,iDAEhCD,EAAME,SAAW,cAAgB,yBACrC1C,yDAGAA,mBAAmBM,eAAeE,2DAGlCR,yBAAyBM,8CACLkC,EAAMP,MAAME,OAAOQ,oBAAoBH,EAAMP,MAAME,OAAO,yGAKrFK,IACD,MAAMI,EAASJ,EAAMH,UAAYG,EAAMK,UAAYhB,aAAaQ,SAAWR,aAAaC,QAExF,OAAIU,EAAMT,MAAca,EAAOb,MAC3BS,EAAMJ,QAAgBQ,EAAOR,QAE1BQ,EAAOd,OAAO,GAGrBgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputRadio.js","sources":["../../../../src/components/InputRadio/InputRadio.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { InputRadioProps } from './types'\n\nconst COMPONENT_NAME = 'InputRadio'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"InputRadio.js","sources":["../../../../src/components/InputRadio/InputRadio.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { InputRadioProps } from './types'\n\nconst COMPONENT_NAME = 'InputRadio'\n\n/**\n *\n * *v1.0.0*\n *\n * Контрол для выбора единственного активного состояния элемента.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<input\\> элемента.\n *\n * @visibleName Radio\n */\nconst InputRadio: React.ForwardRefExoticComponent<InputRadioProps> = withMergedProps<InputRadioProps, HTMLInputElement>(\n forwardRef<HTMLInputElement, MergedProps<InputRadioProps>>(\n (\n {\n size = 'm',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n preset,\n inline,\n error,\n success,\n contrast,\n onColored,\n palette,\n style,\n className,\n disabled,\n ...inputProps\n },\n ref\n ) => {\n return (\n <Styled.Root\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n preset={preset}\n inline={inline}\n error={error}\n success={success}\n contrast={contrast}\n onColored={onColored}\n palette={palette}\n style={style}\n className={className}\n disabled={disabled}\n >\n <Styled.Input {...inputProps} disabled={disabled} type='radio' ref={ref} />\n <Styled.InputMask />\n </Styled.Root>\n )\n }\n ),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { InputRadio, COMPONENT_NAME }\n"],"names":["InputRadio","withMergedProps","forwardRef","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","preset","inline","error","success","contrast","onColored","palette","style","className","disabled","inputProps","ref","_jsxs","Styled","children","_jsx","jsx","type","displayName","SIZES"],"mappings":"yNAmBA,MAAMA,WAA+DC,gBAAAA,gBACnEC,MAAAA,YACE,EAEIC,OAAO,IACPC,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,YACAC,SACAC,SACAC,QACAC,UACAC,WACAC,YACAC,gBACAC,EACAC,YACAC,cACGC,GAELC,IAGEC,WAAAA,KAACC,MAAAA,KAAW,CACVtB,KAAMA,EACNC,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,MAAOA,EACPC,UAAWA,EACXC,OAAQA,EACRC,OAAQA,EACRC,MAAOA,EACPC,QAASA,EACTC,SAAUA,EACVC,UAAWA,EACXC,QAASA,EACTC,MAAOA,EACPC,UAAWA,EACXC,SAAUA,EAASK,SAEnBC,CAAAA,WAAAC,IAACH,YAAY,IAAKH,EAAYD,SAAUA,EAAUQ,KAAK,QAAQN,IAAKA,IACpEI,WAAAC,IAACH,yBAKT,CACEK,YApEmB,aAqEnBpB,MAAOqB,UAAAA,+BArEY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputRadio.mjs","sources":["../../../../src/components/InputRadio/InputRadio.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { InputRadioProps } from './types'\n\nconst COMPONENT_NAME = 'InputRadio'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"InputRadio.mjs","sources":["../../../../src/components/InputRadio/InputRadio.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { InputRadioProps } from './types'\n\nconst COMPONENT_NAME = 'InputRadio'\n\n/**\n *\n * *v1.0.0*\n *\n * Контрол для выбора единственного активного состояния элемента.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<input\\> элемента.\n *\n * @visibleName Radio\n */\nconst InputRadio: React.ForwardRefExoticComponent<InputRadioProps> = withMergedProps<InputRadioProps, HTMLInputElement>(\n forwardRef<HTMLInputElement, MergedProps<InputRadioProps>>(\n (\n {\n size = 'm',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n preset,\n inline,\n error,\n success,\n contrast,\n onColored,\n palette,\n style,\n className,\n disabled,\n ...inputProps\n },\n ref\n ) => {\n return (\n <Styled.Root\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n preset={preset}\n inline={inline}\n error={error}\n success={success}\n contrast={contrast}\n onColored={onColored}\n palette={palette}\n style={style}\n className={className}\n disabled={disabled}\n >\n <Styled.Input {...inputProps} disabled={disabled} type='radio' ref={ref} />\n <Styled.InputMask />\n </Styled.Root>\n )\n }\n ),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { InputRadio, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","InputRadio","withMergedProps","forwardRef","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","preset","inline","error","success","contrast","onColored","palette","style","className","disabled","inputProps","ref","_jsxs","Styled","children","_jsx","type","displayName","SIZES"],"mappings":"mNAOMA,MAAAA,eAAiB,aAYvB,MAAMC,WAA+DC,gBACnEC,YACE,EAEIC,OAAO,IACPC,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,YACAC,SACAC,SACAC,QACAC,UACAC,WACAC,YACAC,UACAC,QACAC,YACAC,cACGC,GAELC,IAGEC,KAACC,KAAW,CACVtB,KAAMA,EACNC,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,MAAOA,EACPC,UAAWA,EACXC,OAAQA,EACRC,OAAQA,EACRC,MAAOA,EACPC,QAASA,EACTC,SAAUA,EACVC,UAAWA,EACXC,QAASA,EACTC,MAAOA,EACPC,UAAWA,EACXC,SAAUA,EAASK,SAEnBC,CAAAA,IAACF,MAAY,IAAKH,EAAYD,SAAUA,EAAUO,KAAK,QAAQL,IAAKA,IACpEI,IAACF,mBAKT,CACEI,YApEmB,aAqEnBnB,MAAOoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/InputRadio/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/InputRadio/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: {\n width: 32,\n height: 32,\n },\n l: {\n width: 28,\n height: 28,\n },\n m: {\n width: 24,\n height: 24,\n },\n s: {\n width: 20,\n height: 20,\n },\n xs: {\n width: 18,\n height: 18,\n },\n}\n"],"names":["xl","width","height","l","m","s","xs"],"mappings":"2BAGkD,CAChDA,GAAI,CACFC,MAAO,GACPC,OAAQ,IAEVC,EAAG,CACDF,MAAO,GACPC,OAAQ,IAEVE,EAAG,CACDH,MAAO,GACPC,OAAQ,IAEVG,EAAG,CACDJ,MAAO,GACPC,OAAQ,IAEVI,GAAI,CACFL,MAAO,GACPC,OAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/InputRadio/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/InputRadio/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: {\n width: 32,\n height: 32,\n },\n l: {\n width: 28,\n height: 28,\n },\n m: {\n width: 24,\n height: 24,\n },\n s: {\n width: 20,\n height: 20,\n },\n xs: {\n width: 18,\n height: 18,\n },\n}\n"],"names":["SIZES","xl","width","height","l","m","s","xs"],"mappings":"AAGO,MAAMA,MAAqC,CAChDC,GAAI,CACFC,MAAO,GACPC,OAAQ,IAEVC,EAAG,CACDF,MAAO,GACPC,OAAQ,IAEVE,EAAG,CACDH,MAAO,GACPC,OAAQ,IAEVG,EAAG,CACDJ,MAAO,GACPC,OAAQ,IAEVI,GAAI,CACFL,MAAO,GACPC,OAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var Knob=require('./Knob.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');const Switch=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:i="
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var Knob=require('./Knob.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');const Switch=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:i="s",knobProps:t={},sizeXXS:r,sizeXS:n,sizeS:a,sizeM:c,sizeL:o,sizeXL:l,sizes:z,sizeUnits:u,preset:d,inline:j,palette:p,style:h,className:x,disabled:S,...w}=e;const b={size:i,sizeXXS:r,sizeXS:n,sizeS:a,sizeM:c,sizeL:o,sizeXL:l};return jsxRuntime.jsxs(style.Root,{...b,sizes:z,sizeUnits:u,preset:d,inline:j,palette:p,style:h,className:x,disabled:S,children:[jsxRuntime.jsx(style.Input,{...w,disabled:S,type:"checkbox",ref:s}),jsxRuntime.jsx(style.Track,{children:jsxRuntime.jsx(Knob.Knob,{...b,...t})})]})})),{displayName:"Switch",sizes:constants.SIZES});exports.COMPONENT_NAME="Switch",exports.Switch=Switch;
|
|
2
2
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Knob } from './Knob'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { SwitchProps } from './types'\n\nconst COMPONENT_NAME = 'Switch'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Knob } from './Knob'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { SwitchProps } from './types'\n\nconst COMPONENT_NAME = 'Switch'\n\n/**\n *\n * *v1.0.0*\n *\n * Контрол для переключения между двумя значениями: включено или выключено.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<input\\> элемента.\n */\nconst Switch: React.ForwardRefExoticComponent<SwitchProps> = withMergedProps<SwitchProps, HTMLInputElement>(\n forwardRef<HTMLInputElement, MergedProps<SwitchProps>>((props, ref) => {\n const {\n size = 's',\n knobProps = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n preset,\n inline,\n palette,\n style,\n className,\n disabled,\n ...inputProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n return (\n <Styled.Root\n {...sizeProps}\n sizes={sizes}\n sizeUnits={sizeUnits}\n preset={preset}\n inline={inline}\n palette={palette}\n style={style}\n className={className}\n disabled={disabled}\n >\n <Styled.Input {...inputProps} disabled={disabled} type='checkbox' ref={ref} />\n <Styled.Track>\n <Knob {...sizeProps} {...knobProps} />\n </Styled.Track>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Switch, COMPONENT_NAME }\n"],"names":["Switch","withMergedProps","forwardRef","props","ref","size","knobProps","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","preset","inline","palette","style","className","disabled","inputProps","sizeProps","_jsxs","Styled","children","_jsx","jsx","type","Knob","displayName","SIZES"],"mappings":"uPAkBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAuD,CAACC,EAAOC,KAC7D,MAAMC,KACJA,EAAO,IAAGC,UACVA,EAAY,CAAE,EAAAC,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,OACNA,EAAMC,QACNA,QACAC,EAAKC,UACLA,EAASC,SACTA,KACGC,GACDlB,EAEJ,MAAMmB,EAAY,CAChBjB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEW,WAAAA,KAACC,MAAAA,KAAW,IACNF,EACJT,MAAOA,EACPC,UAAWA,EACXC,OAAQA,EACRC,OAAQA,EACRC,QAASA,EACTC,MAAOA,EACPC,UAAWA,EACXC,SAAUA,EAASK,SAEnBC,CAAAA,WAAAC,IAACH,YAAY,IAAKH,EAAYD,SAAUA,EAAUQ,KAAK,WAAWxB,IAAKA,IACvEsB,WAAAC,IAACH,YAAY,CAAAC,SACXC,WAAAC,IAACE,UAAI,IAAKP,KAAehB,QAEf,IAGlB,CACEwB,YA9DmB,SA+DnBjB,MAAOkB,UAAAA,+BA/DY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Knob}from'./Knob.mjs';import{SIZES}from'./constants.mjs';import{Root,Input,Track}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';const COMPONENT_NAME='Switch';const Switch=withMergedProps(forwardRef(((s,e)=>{const{size:i="
|
|
1
|
+
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Knob}from'./Knob.mjs';import{SIZES}from'./constants.mjs';import{Root,Input,Track}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';const COMPONENT_NAME='Switch';const Switch=withMergedProps(forwardRef(((s,e)=>{const{size:i="s",knobProps:t={},sizeXXS:r,sizeXS:o,sizeS:n,sizeM:c,sizeL:m,sizeXL:p,sizes:z,sizeUnits:a,preset:l,inline:d,palette:S,style:f,className:h,disabled:j,...w}=s;const x={size:i,sizeXXS:r,sizeXS:o,sizeS:n,sizeM:c,sizeL:m,sizeXL:p};return jsxs(Root,{...x,sizes:z,sizeUnits:a,preset:l,inline:d,palette:S,style:f,className:h,disabled:j,children:[jsx(Input,{...w,disabled:j,type:"checkbox",ref:e}),jsx(Track,{children:jsx(Knob,{...x,...t})})]})})),{displayName:"Switch",sizes:SIZES});export{COMPONENT_NAME,Switch};
|
|
2
2
|
//# sourceMappingURL=Switch.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.mjs","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Knob } from './Knob'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { SwitchProps } from './types'\n\nconst COMPONENT_NAME = 'Switch'\n\n/**\n *\n *
|
|
1
|
+
{"version":3,"file":"Switch.mjs","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Knob } from './Knob'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { SwitchProps } from './types'\n\nconst COMPONENT_NAME = 'Switch'\n\n/**\n *\n * *v1.0.0*\n *\n * Контрол для переключения между двумя значениями: включено или выключено.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<input\\> элемента.\n */\nconst Switch: React.ForwardRefExoticComponent<SwitchProps> = withMergedProps<SwitchProps, HTMLInputElement>(\n forwardRef<HTMLInputElement, MergedProps<SwitchProps>>((props, ref) => {\n const {\n size = 's',\n knobProps = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n preset,\n inline,\n palette,\n style,\n className,\n disabled,\n ...inputProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n return (\n <Styled.Root\n {...sizeProps}\n sizes={sizes}\n sizeUnits={sizeUnits}\n preset={preset}\n inline={inline}\n palette={palette}\n style={style}\n className={className}\n disabled={disabled}\n >\n <Styled.Input {...inputProps} disabled={disabled} type='checkbox' ref={ref} />\n <Styled.Track>\n <Knob {...sizeProps} {...knobProps} />\n </Styled.Track>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Switch, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Switch","withMergedProps","forwardRef","props","ref","size","knobProps","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","preset","inline","palette","style","className","disabled","inputProps","sizeProps","_jsxs","Styled","children","_jsx","type","Knob","displayName","SIZES"],"mappings":"4OAQMA,MAAAA,eAAiB,SAUjBC,MAAAA,OAAuDC,gBAC3DC,YAAuD,CAACC,EAAOC,KAC7D,MAAMC,KACJA,EAAO,IAAGC,UACVA,EAAY,CAAE,EAAAC,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,OACNA,EAAMC,QACNA,EAAOC,MACPA,EAAKC,UACLA,EAASC,SACTA,KACGC,GACDlB,EAEJ,MAAMmB,EAAY,CAChBjB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEW,KAACC,KAAW,IACNF,EACJT,MAAOA,EACPC,UAAWA,EACXC,OAAQA,EACRC,OAAQA,EACRC,QAASA,EACTC,MAAOA,EACPC,UAAWA,EACXC,SAAUA,EAASK,SAEnBC,CAAAA,IAACF,MAAY,IAAKH,EAAYD,SAAUA,EAAUO,KAAK,WAAWvB,IAAKA,IACvEsB,IAACF,MAAY,CAAAC,SACXC,IAACE,KAAI,IAAKN,KAAehB,QAEf,IAGlB,CACEuB,YA9DmB,SA+DnBhB,MAAOiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/Switch/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/Switch/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nconst SIZE_SWITCH: CSSProperties = {\n width: 44,\n height: 24,\n borderRadius: 48,\n}\n\nconst SIZE_KNOB: CSSProperties = {\n width: 16,\n height: 16,\n borderRadius: '50%',\n}\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: SIZE_SWITCH,\n l: SIZE_SWITCH,\n m: SIZE_SWITCH,\n s: SIZE_SWITCH,\n xs: SIZE_SWITCH,\n}\n\nexport const SIZES_KNOB: Record<Size, CSSProperties> = {\n xl: SIZE_KNOB,\n l: SIZE_KNOB,\n m: SIZE_KNOB,\n s: SIZE_KNOB,\n xs: SIZE_KNOB,\n}\n"],"names":["SIZE_SWITCH","width","height","borderRadius","SIZE_KNOB","SIZES_KNOB","xl","l","m","s","xs"],"mappings":"aAGA,MAAMA,YAA6B,CACjCC,MAAO,GACPC,OAAQ,GACRC,aAAc,IAGhB,MAAMC,UAA2B,CAC/BH,MAAO,GACPC,OAAQ,GACRC,aAAc,OAWT,MAAME,WAA0C,CACrDC,GAAIF,UACJG,EAAGH,UACHI,EAAGJ,UACHK,EAAGL,UACHM,GAAIN,yBAb4C,CAChDE,GAAIN,YACJO,EAAGP,YACHQ,EAAGR,YACHS,EAAGT,YACHU,GAAIV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Switch/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Switch/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from './types'\n\nconst SIZE_SWITCH: CSSProperties = {\n width: 44,\n height: 24,\n borderRadius: 48,\n}\n\nconst SIZE_KNOB: CSSProperties = {\n width: 16,\n height: 16,\n borderRadius: '50%',\n}\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xl: SIZE_SWITCH,\n l: SIZE_SWITCH,\n m: SIZE_SWITCH,\n s: SIZE_SWITCH,\n xs: SIZE_SWITCH,\n}\n\nexport const SIZES_KNOB: Record<Size, CSSProperties> = {\n xl: SIZE_KNOB,\n l: SIZE_KNOB,\n m: SIZE_KNOB,\n s: SIZE_KNOB,\n xs: SIZE_KNOB,\n}\n"],"names":["SIZE_SWITCH","width","height","borderRadius","SIZE_KNOB","SIZES","xl","l","m","s","xs","SIZES_KNOB"],"mappings":"AAGA,MAAMA,YAA6B,CACjCC,MAAO,GACPC,OAAQ,GACRC,aAAc,IAGhB,MAAMC,UAA2B,CAC/BH,MAAO,GACPC,OAAQ,GACRC,aAAc,OAGT,MAAME,MAAqC,CAChDC,GAAIN,YACJO,EAAGP,YACHQ,EAAGR,YACHS,EAAGT,YACHU,GAAIV,aAGC,MAAMW,WAA0C,CACrDL,GAAIF,UACJG,EAAGH,UACHI,EAAGJ,UACHK,EAAGL,UACHM,GAAIN"}
|