@jenesei-software/jenesei-kit-react 1.0.0 → 1.0.1
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/README.md +0 -1
- package/build/{area-DfCAwCiZ.js → area-3gVEQsJq.js} +20 -22
- package/build/area-3gVEQsJq.js.map +1 -0
- package/build/area-C8w6fMSn.cjs +38 -0
- package/build/area-C8w6fMSn.cjs.map +1 -0
- package/build/{area-9NUxwBGc.cjs → area-E4w7aKuZ.cjs} +2 -2
- package/build/{area-9NUxwBGc.cjs.map → area-E4w7aKuZ.cjs.map} +1 -1
- package/build/{area-BnAddPtl.js → area-EcUYP2tl.js} +2 -2
- package/build/{area-BnAddPtl.js.map → area-EcUYP2tl.js.map} +1 -1
- package/build/area-preview.cjs.js +1 -1
- package/build/area-preview.es.js +1 -1
- package/build/area-skeleton.cjs.js +1 -1
- package/build/area-skeleton.es.js +1 -1
- package/build/build-info.txt +3 -3
- package/build/{component-C2JFFh-k.js → component--cOriuv7.js} +103 -27
- package/build/component--cOriuv7.js.map +1 -0
- package/build/{component-CFMlaYj1.js → component-9m1Ib3fS.js} +2 -2
- package/build/{component-CFMlaYj1.js.map → component-9m1Ib3fS.js.map} +1 -1
- package/build/{component-CuiUpH8H.js → component-B1IQ5CfM.js} +10 -10
- package/build/component-B1IQ5CfM.js.map +1 -0
- package/build/{component-C52VCES6.cjs → component-BnYw0FvH.cjs} +21 -17
- package/build/component-BnYw0FvH.cjs.map +1 -0
- package/build/{component-nFn_uOy_.cjs → component-Bovatz78.cjs} +2 -2
- package/build/{component-nFn_uOy_.cjs.map → component-Bovatz78.cjs.map} +1 -1
- package/build/{component-UW1VzyvB.cjs → component-C0atFCun.cjs} +2 -2
- package/build/{component-UW1VzyvB.cjs.map → component-C0atFCun.cjs.map} +1 -1
- package/build/{component-DZxbW_Jz.js → component-CbPhVNw5.js} +30 -28
- package/build/component-CbPhVNw5.js.map +1 -0
- package/build/component-CbnBTIR5.cjs +2 -0
- package/build/component-CbnBTIR5.cjs.map +1 -0
- package/build/{component-xnEaYd4a.cjs → component-D7A-4DNQ.cjs} +2 -2
- package/build/{component-xnEaYd4a.cjs.map → component-D7A-4DNQ.cjs.map} +1 -1
- package/build/{component-CBshLNEf.js → component-DURhph1i.js} +3 -3
- package/build/{component-CBshLNEf.js.map → component-DURhph1i.js.map} +1 -1
- package/build/component-X4e7zEKk.cjs +90 -0
- package/build/component-X4e7zEKk.cjs.map +1 -0
- package/build/component-accordion.cjs.js +1 -1
- package/build/component-accordion.es.js +1 -1
- package/build/component-button-group.cjs.js +1 -1
- package/build/component-button-group.d.ts +5 -1
- package/build/component-button-group.es.js +1 -1
- package/build/component-button.cjs.js +1 -1
- package/build/component-button.d.ts +6 -2
- package/build/component-button.es.js +1 -1
- package/build/component-checkbox-group.cjs.js +1 -1
- package/build/component-checkbox-group.d.ts +2 -1
- package/build/component-checkbox-group.es.js +1 -1
- package/build/component-checkbox.cjs.js +1 -1
- package/build/component-checkbox.d.ts +2 -1
- package/build/component-checkbox.es.js +1 -1
- package/build/component-date-picker.cjs.js +1 -1
- package/build/component-date-picker.d.ts +93 -70
- package/build/component-date-picker.es.js +1 -1
- package/build/component-icon.cjs.js +1 -1
- package/build/component-icon.es.js +1 -1
- package/build/component-image-button.cjs.js +1 -1
- package/build/component-image-button.d.ts +5 -1
- package/build/component-image-button.es.js +1 -1
- package/build/component-image-select.cjs.js +1 -1
- package/build/component-image-select.d.ts +5 -1
- package/build/component-image-select.es.js +1 -1
- package/build/component-image-slider.cjs.js +1 -1
- package/build/component-image-slider.es.js +1 -1
- package/build/component-image.cjs.js +1 -1
- package/build/component-image.es.js +1 -1
- package/build/component-input-otp.cjs.js +1 -1
- package/build/component-input-otp.d.ts +31 -19
- package/build/component-input-otp.es.js +1 -1
- package/build/component-input.cjs.js +1 -1
- package/build/component-input.d.ts +48 -38
- package/build/component-input.es.js +4 -4
- package/build/component-map.cjs.js +1 -1
- package/build/component-map.es.js +1 -1
- package/build/component-pagination.cjs.js +1 -1
- package/build/component-pagination.d.ts +5 -1
- package/build/component-pagination.es.js +1 -1
- package/build/component-range.cjs.js +1 -1
- package/build/component-range.d.ts +28 -18
- package/build/component-range.es.js +1 -1
- package/build/component-ripple.cjs.js +1 -1
- package/build/component-ripple.es.js +1 -1
- package/build/component-select.cjs.js +1 -1
- package/build/component-select.d.ts +125 -230
- package/build/component-select.es.js +16 -20
- package/build/component-separator.cjs.js +1 -1
- package/build/component-separator.d.ts +3 -2
- package/build/component-separator.es.js +1 -1
- package/build/component-textarea.cjs.js +1 -1
- package/build/component-textarea.d.ts +74 -53
- package/build/component-textarea.es.js +4 -8
- package/build/component-toggle.cjs.js +1 -1
- package/build/component-toggle.es.js +1 -1
- package/build/component-tooltip.cjs.js +1 -1
- package/build/component-tooltip.d.ts +9 -2
- package/build/component-tooltip.es.js +1 -1
- package/build/component-typography.cjs.js +1 -1
- package/build/component-typography.d.ts +8 -2
- package/build/component-typography.es.js +1 -1
- package/build/{component-ByY_9Ryc.js → component-vpCWcIhC.js} +2 -2
- package/build/{component-ByY_9Ryc.js.map → component-vpCWcIhC.js.map} +1 -1
- package/build/{component.components-CaR5gfQW.cjs → component.components-1kRDD3KO.cjs} +2 -2
- package/build/{component.components-CaR5gfQW.cjs.map → component.components-1kRDD3KO.cjs.map} +1 -1
- package/build/{component.components-BAAT5GTH.js → component.components-CQ3LLnFl.js} +5 -5
- package/build/{component.components-BAAT5GTH.js.map → component.components-CQ3LLnFl.js.map} +1 -1
- package/build/{component.constants-DRvp5Bez.js → component.constants-B1rq1PLe.js} +2 -2
- package/build/{component.constants-DRvp5Bez.js.map → component.constants-B1rq1PLe.js.map} +1 -1
- package/build/{component.constants-DbNhxh0k.js → component.constants-B95xyW0s.js} +211 -207
- package/build/component.constants-B95xyW0s.js.map +1 -0
- package/build/{component.constants-BeWW8Ijx.cjs → component.constants-BLHg7rcI.cjs} +2 -2
- package/build/{component.constants-BeWW8Ijx.cjs.map → component.constants-BLHg7rcI.cjs.map} +1 -1
- package/build/component.constants-Gz2mf7IF.cjs +22 -0
- package/build/component.constants-Gz2mf7IF.cjs.map +1 -0
- package/build/{component.styles-BfvB83xM.cjs → component.styles-B-ZAk_1C.cjs} +7 -7
- package/build/component.styles-B-ZAk_1C.cjs.map +1 -0
- package/build/{component.styles-Do1NYZEO.js → component.styles-BI4OuDrG.js} +32 -20
- package/build/component.styles-BI4OuDrG.js.map +1 -0
- package/build/component.styles-BLh29xwF.cjs +10 -0
- package/build/component.styles-BLh29xwF.cjs.map +1 -0
- package/build/component.styles-BnJjm_ES.js +37 -0
- package/build/component.styles-BnJjm_ES.js.map +1 -0
- package/build/{component.styles-RkQwTlwG.js → component.styles-BoBaG6sX.js} +13 -5
- package/build/component.styles-BoBaG6sX.js.map +1 -0
- package/build/component.styles-BrGPrrEb.cjs +39 -0
- package/build/component.styles-BrGPrrEb.cjs.map +1 -0
- package/build/{component.styles-ZtwHuL4x.cjs → component.styles-Bz2vyHqK.cjs} +5 -7
- package/build/component.styles-Bz2vyHqK.cjs.map +1 -0
- package/build/{component.styles-CVBpx4fw.js → component.styles-BzNkEurr.js} +13 -13
- package/build/component.styles-BzNkEurr.js.map +1 -0
- package/build/component.styles-CLn52hJD.cjs +14 -0
- package/build/component.styles-CLn52hJD.cjs.map +1 -0
- package/build/{component.styles-DOPCUXcr.js → component.styles-CRWn1pVi.js} +11 -13
- package/build/component.styles-CRWn1pVi.js.map +1 -0
- package/build/{component.styles-CmEFZfA5.js → component.styles-CccZrbSA.js} +53 -42
- package/build/component.styles-CccZrbSA.js.map +1 -0
- package/build/component.styles-CdtZm7bl.cjs +165 -0
- package/build/component.styles-CdtZm7bl.cjs.map +1 -0
- package/build/{component.styles-BapdQNhL.js → component.styles-CiGPOpxk.js} +5 -5
- package/build/component.styles-CiGPOpxk.js.map +1 -0
- package/build/component.styles-CvJK1eif.cjs +230 -0
- package/build/component.styles-CvJK1eif.cjs.map +1 -0
- package/build/component.styles-D6KuudL3.js +1372 -0
- package/build/component.styles-D6KuudL3.js.map +1 -0
- package/build/{component.styles-DyGfo9t0.cjs → component.styles-DDUGBJle.cjs} +2 -2
- package/build/{component.styles-DyGfo9t0.cjs.map → component.styles-DDUGBJle.cjs.map} +1 -1
- package/build/{component.styles-CTo5NC52.js → component.styles-DMBvhmz6.js} +4 -4
- package/build/{component.styles-CTo5NC52.js.map → component.styles-DMBvhmz6.js.map} +1 -1
- package/build/component.styles-DWoybqna.cjs +137 -0
- package/build/component.styles-DWoybqna.cjs.map +1 -0
- package/build/component.styles-DhI3n-dL.js +213 -0
- package/build/component.styles-DhI3n-dL.js.map +1 -0
- package/build/{component.styles-DxeG9Opm.cjs → component.styles-DjLSmx3e.cjs} +2 -2
- package/build/{component.styles-DxeG9Opm.cjs.map → component.styles-DjLSmx3e.cjs.map} +1 -1
- package/build/component.styles-DqTkSP8L.js +1023 -0
- package/build/component.styles-DqTkSP8L.js.map +1 -0
- package/build/{component.styles-Dok17vPl.js → component.styles-DuIrUV9k.js} +2 -2
- package/build/{component.styles-Dok17vPl.js.map → component.styles-DuIrUV9k.js.map} +1 -1
- package/build/component.styles-DwdN7mQq.cjs +99 -0
- package/build/component.styles-DwdN7mQq.cjs.map +1 -0
- package/build/{component.styles-CV7jTFCg.js → component.styles-iWM1hPGZ.js} +62 -31
- package/build/component.styles-iWM1hPGZ.js.map +1 -0
- package/build/{component.styles-CZu2m0O4.cjs → component.styles-q4ne6jV1.cjs} +2 -2
- package/build/{component.styles-CZu2m0O4.cjs.map → component.styles-q4ne6jV1.cjs.map} +1 -1
- package/build/{component.styles-C6LohBfF.js → component.styles-uPfiNBIy.js} +3 -3
- package/build/{component.styles-C6LohBfF.js.map → component.styles-uPfiNBIy.js.map} +1 -1
- package/build/component.styles-vcNQJK0U.cjs +65 -0
- package/build/component.styles-vcNQJK0U.cjs.map +1 -0
- package/build/component.styles-w3iWQMCq.cjs +13 -0
- package/build/component.styles-w3iWQMCq.cjs.map +1 -0
- package/build/consts.cjs.js.map +1 -1
- package/build/consts.es.js.map +1 -1
- package/build/context-app.cjs.js +1 -1
- package/build/context-app.es.js +1 -1
- package/build/context-dialog.cjs.js +1 -1
- package/build/context-dialog.es.js +1 -1
- package/build/context-sonner.cjs.js +1 -1
- package/build/context-sonner.es.js +1 -1
- package/build/{context.constants-DqYjo5m4.js → context.constants-BAz35AJw.js} +5 -5
- package/build/{context.constants-DqYjo5m4.js.map → context.constants-BAz35AJw.js.map} +1 -1
- package/build/{context.constants-B29-_8v3.cjs → context.constants-BJPyze-d.cjs} +2 -2
- package/build/{context.constants-B29-_8v3.cjs.map → context.constants-BJPyze-d.cjs.map} +1 -1
- package/build/{context.constants-CsZRZ7gH.js → context.constants-COR-ReeN.js} +2 -2
- package/build/{context.constants-CsZRZ7gH.js.map → context.constants-COR-ReeN.js.map} +1 -1
- package/build/{context.constants-BaD7xj_m.cjs → context.constants-fwK8ogSf.cjs} +2 -2
- package/build/{context.constants-BaD7xj_m.cjs.map → context.constants-fwK8ogSf.cjs.map} +1 -1
- package/build/{context.hooks-gyzZSaVi.js → context.hooks-Bs1dD25S.js} +4 -4
- package/build/{context.hooks-gyzZSaVi.js.map → context.hooks-Bs1dD25S.js.map} +1 -1
- package/build/{context.hooks-CTi-CVKx.cjs → context.hooks-KAyS_7Pj.cjs} +3 -3
- package/build/{context.hooks-CTi-CVKx.cjs.map → context.hooks-KAyS_7Pj.cjs.map} +1 -1
- package/build/functions.cjs.js.map +1 -1
- package/build/functions.es.js +7 -4
- package/build/functions.es.js.map +1 -1
- package/build/hooks-use-deep-compare-memoize.d.ts +1 -1
- package/build/index.cjs.js +1 -1
- package/build/index.d.ts +289 -227
- package/build/index.es.js +133 -139
- package/build/{style-CEGJOjRW.js → style-Bvt_Melk.js} +32 -12
- package/build/style-Bvt_Melk.js.map +1 -0
- package/build/{style-DeAgDHyI.js → style-DjCgiI7l.js} +3 -3
- package/build/{style-DeAgDHyI.js.map → style-DjCgiI7l.js.map} +1 -1
- package/build/style-add.cjs.js +1 -1
- package/build/style-add.d.ts +11 -1
- package/build/style-add.es.js +6 -4
- package/build/{style-CtGd1JVB.cjs → style-eIuUYu9x.cjs} +2 -2
- package/build/{style-CtGd1JVB.cjs.map → style-eIuUYu9x.cjs.map} +1 -1
- package/build/style-error.cjs.js +1 -1
- package/build/style-error.es.js +1 -1
- package/build/{style-Dm74EPGE.cjs → style-f3_KtJIt.cjs} +30 -14
- package/build/style-f3_KtJIt.cjs.map +1 -0
- package/build/style-theme.cjs.js +1 -1
- package/build/style-theme.es.js +1 -1
- package/build/{theme.global-bN9HlSWE.js → theme.global-B46v_8eu.js} +2 -1
- package/build/{theme.global-bN9HlSWE.js.map → theme.global-B46v_8eu.js.map} +1 -1
- package/build/{theme.global-D6XU05Et.cjs → theme.global-BdZkriPJ.cjs} +2 -1
- package/build/{theme.global-D6XU05Et.cjs.map → theme.global-BdZkriPJ.cjs.map} +1 -1
- package/build/{use-BVj4dgbW.js → use-B6rT81uF.js} +6 -6
- package/build/{use-BVj4dgbW.js.map → use-B6rT81uF.js.map} +1 -1
- package/build/{use-BhofoOgk.cjs → use-BnaBipTR.cjs} +2 -2
- package/build/{use-BhofoOgk.cjs.map → use-BnaBipTR.cjs.map} +1 -1
- package/build/use-C1l0O0Qo.cjs.map +1 -1
- package/build/use-DT0XgvJT.js.map +1 -1
- package/package.json +2 -12
- package/build/area-ClrrGVJG.cjs +0 -40
- package/build/area-ClrrGVJG.cjs.map +0 -1
- package/build/area-DfCAwCiZ.js.map +0 -1
- package/build/component-BnI7BIp-.cjs +0 -2
- package/build/component-BnI7BIp-.cjs.map +0 -1
- package/build/component-C2JFFh-k.js.map +0 -1
- package/build/component-C52VCES6.cjs.map +0 -1
- package/build/component-CuiUpH8H.js.map +0 -1
- package/build/component-D1NPhRuV.cjs +0 -90
- package/build/component-D1NPhRuV.cjs.map +0 -1
- package/build/component-DZxbW_Jz.js.map +0 -1
- package/build/component.constants-D9wVZ3zy.cjs +0 -22
- package/build/component.constants-D9wVZ3zy.cjs.map +0 -1
- package/build/component.constants-DbNhxh0k.js.map +0 -1
- package/build/component.styles-B1DIataj.cjs +0 -10
- package/build/component.styles-B1DIataj.cjs.map +0 -1
- package/build/component.styles-BFwkFWkd.cjs +0 -39
- package/build/component.styles-BFwkFWkd.cjs.map +0 -1
- package/build/component.styles-BSEA2Dqn.cjs +0 -8
- package/build/component.styles-BSEA2Dqn.cjs.map +0 -1
- package/build/component.styles-BapdQNhL.js.map +0 -1
- package/build/component.styles-BfvB83xM.cjs.map +0 -1
- package/build/component.styles-Bn6ylF83.js +0 -859
- package/build/component.styles-Bn6ylF83.js.map +0 -1
- package/build/component.styles-BsZIuwWJ.cjs +0 -140
- package/build/component.styles-BsZIuwWJ.cjs.map +0 -1
- package/build/component.styles-CEBh8X5q.js +0 -20
- package/build/component.styles-CEBh8X5q.js.map +0 -1
- package/build/component.styles-CPsxMKVK.cjs +0 -73
- package/build/component.styles-CPsxMKVK.cjs.map +0 -1
- package/build/component.styles-CV7jTFCg.js.map +0 -1
- package/build/component.styles-CVBpx4fw.js.map +0 -1
- package/build/component.styles-CmBcHREH.cjs +0 -13
- package/build/component.styles-CmBcHREH.cjs.map +0 -1
- package/build/component.styles-CmEFZfA5.js.map +0 -1
- package/build/component.styles-DHIw8p8e.cjs +0 -158
- package/build/component.styles-DHIw8p8e.cjs.map +0 -1
- package/build/component.styles-DOPCUXcr.js.map +0 -1
- package/build/component.styles-Dj3h7jd9.cjs +0 -165
- package/build/component.styles-Dj3h7jd9.cjs.map +0 -1
- package/build/component.styles-Do1NYZEO.js.map +0 -1
- package/build/component.styles-DpkFoWEh.cjs +0 -81
- package/build/component.styles-DpkFoWEh.cjs.map +0 -1
- package/build/component.styles-DqsBDAEo.js +0 -202
- package/build/component.styles-DqsBDAEo.js.map +0 -1
- package/build/component.styles-Du2y0R4W.js +0 -177
- package/build/component.styles-Du2y0R4W.js.map +0 -1
- package/build/component.styles-RkQwTlwG.js.map +0 -1
- package/build/component.styles-ZtwHuL4x.cjs.map +0 -1
- package/build/style-CEGJOjRW.js.map +0 -1
- package/build/style-Dm74EPGE.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-B-ZAk_1C.cjs","sources":["../src/components/icon/component.styles.ts","../src/components/icon/component.tsx"],"sourcesContent":["import styled, { css } from 'styled-components'\n\nimport { addColorTransition } from '@local/styles/add'\nimport { addSX } from '@local/styles/sx'\nimport { KEY_SIZE_DATA } from '@local/theme'\n\nimport { StyledIconIdItemProps } from '.'\n\nexport const StyledSVG = styled.svg<StyledIconIdItemProps>`\n color: ${props => (props.$color ? props.theme.palette[props.$color] : 'inherit')};\n\n ${props => css`\n height: ${props.$size !== '100%' ? `${KEY_SIZE_DATA[props.$size].heightIcon}px` : '100%'};\n min-height: ${props.$size !== '100%' ? `${KEY_SIZE_DATA[props.$size].heightIcon}px` : '100%'};\n\n width: ${props.$size !== '100%' ? `${KEY_SIZE_DATA[props.$size].heightIcon}px` : '100%'};\n min-width: ${props.$size !== '100%' ? `${KEY_SIZE_DATA[props.$size].heightIcon}px` : '100%'};\n\n transform: rotate(${props.$turn || 0}deg);\n `}\n ${props =>\n props.$order !== undefined &&\n css`\n order: ${props.$order};\n `};\n ${addColorTransition};\n & path {\n ${addColorTransition};\n }\n ${addSX};\n`\n","import { JeneseiPalette } from '@local/theme/theme';\n\nimport { useMemo } from 'react';\n\nimport IconCheckboxJSON from './component-checkbox.json';\nimport IconIdJSON from './component-id.json';\nimport IconLoadingJSON from './component-loading.json';\nimport IconLogoJSON from './component-logo.json';\nimport IconRealEbailJSON from './component-realebail.json';\nimport {\n IconItemProps,\n IconTypeMap,\n StyledSVG,\n TIconCheckboxNameString,\n TIconIdNameString,\n TIconLoadingNameString,\n TIconLogoNameString,\n TIconRealEbailNameString,\n} from '.';\n\nexport const Icon = <T extends keyof IconTypeMap>(props: IconItemProps<T>) => {\n const icon = useMemo(() => {\n let icon = null;\n\n switch (props.type) {\n case 'id':\n icon = IconIdJSON[props.name as TIconIdNameString];\n break;\n case 'realebail':\n icon = IconRealEbailJSON[props.name as TIconRealEbailNameString];\n break;\n case 'logo':\n icon = IconLogoJSON[props.name as TIconLogoNameString];\n break;\n case 'checkbox':\n icon = IconCheckboxJSON[props.name as TIconCheckboxNameString];\n break;\n case 'loading':\n icon = IconLoadingJSON[props.name as TIconLoadingNameString];\n break;\n }\n return icon;\n }, [props.name, props.type]);\n\n const primaryColor = props.primaryColor ? JeneseiPalette[props.primaryColor] : 'currentColor';\n const secondColor = props.secondColor ? JeneseiPalette[props.secondColor] : 'currentColor';\n\n if (!icon) {\n console.warn(`Icon ${props.name} not found in the library.`);\n return null;\n }\n\n const getFillColor = (fillType?: string): string | undefined => {\n if (fillType === 'primaryColor') return primaryColor;\n if (fillType === 'secondColor') return secondColor;\n return 'currentColor';\n };\n\n const contentPaths =\n (props.type == 'id' || props.type === 'checkbox' || props.type === 'realebail' || props.type === 'logo') &&\n typeof icon === 'object' &&\n 'paths' in icon\n ? (icon.paths ?? []).map((path, index) => (\n <path\n key={`${props.type}-${props.name}-path-${index}`}\n id={'id' in path ? (path.id as string) : undefined}\n d={path.d}\n clipRule='evenodd'\n fillRule='evenodd'\n fill={'fill' in path ? getFillColor(path.fill as string) : 'currentColor'}\n />\n ))\n : null;\n\n const contentLoadings = props.type === 'loading' ? (icon as string) : null;\n\n return (\n <StyledSVG\n width='24'\n height='24'\n viewBox='0 0 24 24'\n xmlns='http://www.w3.org/2000/svg'\n $size={props.size}\n $turn={props.turn}\n $order={props.order}\n $color={props.primaryColor || undefined}\n $sx={props.sx}\n className={props.className}\n onClick={props.onClick}\n tabIndex={props.tabIndex}\n dangerouslySetInnerHTML={contentLoadings ? { __html: contentLoadings } : undefined}\n >\n {contentPaths}\n </StyledSVG>\n );\n};\n"],"names":["StyledSVG","styled","svg","props","$color","theme","palette","css","$size","KEY_SIZE_DATA","heightIcon","$turn","$order","addColorTransition","addSX","icon","useMemo","type","IconIdJSON","name","IconRealEbailJSON","IconLogoJSON","IconCheckboxJSON","IconLoadingJSON","primaryColor","JeneseiPalette","secondColor","console","warn","contentPaths","paths","map","path","index","jsx","id","d","clipRule","fillRule","fill","fillType","contentLoadings","width","height","viewBox","xmlns","size","turn","order","$sx","sx","className","onClick","tabIndex","dangerouslySetInnerHTML","__html","children"],"mappings":"upqPAQaA,EAAYC,EAAOC,GAAA;WACrBC,GAAUA,EAAMC,OAASD,EAAME,MAAMC,QAAQH,EAAMC,QAAU;;IAEpED,GAASI,EAAAA,GAAAA;cACiB,SAAhBJ,EAAMK,MAAmB,GAAGC,EAAAA,cAAcN,EAAMK,OAAOE,eAAiB;kBACpD,SAAhBP,EAAMK,MAAmB,GAAGC,EAAAA,cAAcN,EAAMK,OAAOE,eAAiB;;aAE7D,SAAhBP,EAAMK,MAAmB,GAAGC,EAAAA,cAAcN,EAAMK,OAAOE,eAAiB;iBACpD,SAAhBP,EAAMK,MAAmB,GAAGC,EAAAA,cAAcN,EAAMK,OAAOE,eAAiB;;wBAEjEP,EAAMQ,OAAS;;IAEnCR,QACiB,IAAjBA,EAAMS,QACNL,EAAAA,GAAAA;eACWJ,EAAMS;;IAEjBC;;MAEEA;;IAEFC;eCT8CX,IAChD,MAAMY,EAAOC,EAAAA,QAAQ,KACnB,IAAID,EAAO,KAEX,OAAQZ,EAAMc,MACZ,IAAK,KACHF,EAAOG,EAAWf,EAAMgB,MACxB,MACF,IAAK,YACHJ,EAAOK,EAAkBjB,EAAMgB,MAC/B,MACF,IAAK,OACHJ,EAAOM,EAAalB,EAAMgB,MAC1B,MACF,IAAK,WACHJ,EAAOO,EAAiBnB,EAAMgB,MAC9B,MACF,IAAK,UACHJ,EAAOQ,EAAgBpB,EAAMgB,MAGjC,OAAOJ,GACN,CAACZ,EAAMgB,KAAMhB,EAAMc,OAEhBO,EAAerB,EAAMqB,aAAeC,EAAAA,eAAetB,EAAMqB,cAAgB,eACzEE,EAAcvB,EAAMuB,YAAcD,EAAAA,eAAetB,EAAMuB,aAAe,eAE5E,IAAKX,EAEH,OADAY,QAAQC,KAAK,QAAQzB,EAAMgB,kCACpB,KAGT,MAMMU,EACW,MAAd1B,EAAMc,MAA+B,aAAfd,EAAMc,MAAsC,cAAfd,EAAMc,MAAuC,SAAfd,EAAMc,MACxE,iBAATF,KACP,UAAWA,GAWP,MAVCA,EAAKe,OAAS,IAAIC,IAAI,CAACC,EAAMC,KAC5BC,SAAAA,kBAAAA,IAAC,OAAA,CAECC,GAAI,OAAQH,EAAQA,EAAKG,QAAgB,EACzCC,EAAGJ,EAAKI,EACRC,SAAS,UACTC,SAAS,UACTC,KAAM,SAAUP,GAjBJQ,EAiBwBR,EAAKO,KAhBhC,iBAAbC,EAAoChB,EACvB,gBAAbgB,EAAmCd,EAChC,gBAc4D,gBALtD,GAAGvB,EAAMc,QAAQd,EAAMgB,aAAac,KAZ9B,IAACO,IAsBhBC,EAAiC,YAAftC,EAAMc,KAAsBF,EAAkB,KAEtE,SACEmB,kBAAAA,IAAClC,EAAA,CACC0C,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,MAAM,6BACNrC,MAAOL,EAAM2C,KACbnC,MAAOR,EAAM4C,KACbnC,OAAQT,EAAM6C,MACd5C,OAAQD,EAAMqB,mBAAgB,EAC9ByB,IAAK9C,EAAM+C,GACXC,UAAWhD,EAAMgD,UACjBC,QAASjD,EAAMiD,QACfC,SAAUlD,EAAMkD,SAChBC,wBAAyBb,EAAkB,CAAEc,OAAQd,QAAoB,EAExEe,SAAA3B"}
|
|
@@ -1,16 +1,40 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "./jsx-runtime-BrDlu8eK.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as Skeleton } from "./area-DfCAwCiZ.js";
|
|
2
|
+
import { a as Skeleton } from "./area-3gVEQsJq.js";
|
|
4
3
|
import { b as Stack } from "./component-jPZYT5iL.js";
|
|
5
|
-
import
|
|
6
|
-
import { b as addTransition } from "./style-
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import { b as addTransition } from "./style-Bvt_Melk.js";
|
|
7
6
|
import { a as addSX } from "./style-plT9Ah7t.js";
|
|
7
|
+
import styled from "styled-components";
|
|
8
8
|
const Image = (props) => {
|
|
9
9
|
const [isPending, setIsPending] = useState(true);
|
|
10
10
|
const [isError, setIsError] = useState(false);
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
if (!props.src) return;
|
|
13
|
+
const img = new window.Image();
|
|
14
|
+
img.onload = () => {
|
|
15
|
+
setIsPending(false);
|
|
16
|
+
setIsError(false);
|
|
17
|
+
};
|
|
18
|
+
img.onerror = () => {
|
|
19
|
+
setIsPending(false);
|
|
20
|
+
setIsError(true);
|
|
21
|
+
};
|
|
22
|
+
img.src = props.src;
|
|
23
|
+
if (img.complete) {
|
|
24
|
+
if (img.naturalWidth > 0) {
|
|
25
|
+
setIsPending(false);
|
|
26
|
+
setIsError(false);
|
|
27
|
+
} else {
|
|
28
|
+
setIsPending(false);
|
|
29
|
+
setIsError(true);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return () => {
|
|
33
|
+
img.onload = null;
|
|
34
|
+
img.onerror = null;
|
|
35
|
+
setIsPending(true);
|
|
36
|
+
setIsError(false);
|
|
37
|
+
};
|
|
14
38
|
}, [props.src]);
|
|
15
39
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
16
40
|
Stack,
|
|
@@ -52,19 +76,7 @@ const Image = (props) => {
|
|
|
52
76
|
}
|
|
53
77
|
}
|
|
54
78
|
) : null : null,
|
|
55
|
-
!isError && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56
|
-
ImageIMG,
|
|
57
|
-
{
|
|
58
|
-
loading: "lazy",
|
|
59
|
-
$isPending: isPending,
|
|
60
|
-
src: props.src,
|
|
61
|
-
alt: props.alt,
|
|
62
|
-
onLoadStart: () => setIsPending(true),
|
|
63
|
-
onLoad: () => setIsPending(false),
|
|
64
|
-
onError: () => setIsError(true),
|
|
65
|
-
$sx: props.sxImage
|
|
66
|
-
}
|
|
67
|
-
),
|
|
79
|
+
!isError && /* @__PURE__ */ jsxRuntimeExports.jsx(ImageIMG, { loading: "lazy", $isPending: isPending, src: props.src, alt: props.alt, $sx: props.sxImage }),
|
|
68
80
|
isError ? props.componentFallback || null : null
|
|
69
81
|
]
|
|
70
82
|
}
|
|
@@ -83,4 +95,4 @@ export {
|
|
|
83
95
|
Image as I,
|
|
84
96
|
ImageIMG as a
|
|
85
97
|
};
|
|
86
|
-
//# sourceMappingURL=component.styles-
|
|
98
|
+
//# sourceMappingURL=component.styles-BI4OuDrG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-BI4OuDrG.js","sources":["../src/components/image/component.tsx","../src/components/image/component.styles.tsx"],"sourcesContent":["import { Skeleton } from '@local/areas/skeleton';\nimport { Stack } from '@local/components/stack';\n\nimport { FC, useEffect, useState } from 'react';\n\nimport { ImageIMG, ImageProps } from '.';\n\nexport const Image: FC<ImageProps> = (props) => {\n const [isPending, setIsPending] = useState(true);\n const [isError, setIsError] = useState(false);\n\n useEffect(() => {\n if (!props.src) return;\n\n const img = new (window.Image as { new (width?: number, height?: number): HTMLImageElement })();\n\n img.onload = () => {\n setIsPending(false);\n setIsError(false);\n };\n\n img.onerror = () => {\n setIsPending(false);\n setIsError(true);\n };\n\n img.src = props.src;\n\n if (img.complete) {\n if (img.naturalWidth > 0) {\n setIsPending(false);\n setIsError(false);\n } else {\n setIsPending(false);\n setIsError(true);\n }\n }\n\n return () => {\n img.onload = null;\n img.onerror = null;\n setIsPending(true);\n setIsError(false);\n };\n }, [props.src]);\n return (\n <Stack\n sx={(theme) => ({\n ...props?.sxStack,\n default: {\n position: 'relative',\n overflow: 'hidden',\n ...(props.isShowBeforeImage\n ? {\n '&::before': {\n width: '100%',\n height: '100%',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundImage: `url(${props.src})`,\n backgroundRepeat: 'no-repeat',\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n filter: 'blur(20px)',\n transform: 'scale(1.1)',\n zIndex: 0,\n },\n }\n : {}),\n ...(props?.sxStack\n ? typeof props?.sxStack === 'function'\n ? props?.sxStack(theme).default\n : props?.sxStack.default\n : {}),\n },\n })}\n >\n {!isError ? (\n props.componentLoading || isPending ? (\n <Skeleton\n visible\n sx={{\n default: {\n width: '100%',\n height: '100%',\n },\n }}\n />\n ) : null\n ) : null}\n {!isError && (\n <ImageIMG loading='lazy' $isPending={isPending} src={props.src} alt={props.alt} $sx={props.sxImage} />\n )}\n {isError ? props.componentFallback || null : null}\n </Stack>\n );\n};\n","import { addTransition } from '@local/styles/add'\nimport { addSX } from '@local/styles/sx'\n\nimport styled from 'styled-components'\n\nimport { ImageIMGProps } from '.'\n\nexport const ImageIMG = styled.img<ImageIMGProps>`\n position: absolute;\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: ${props => (props.$isPending ? 0 : 1)};\n ${addTransition};\n ${addSX};\n`\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;AAOO,MAAM,QAAwB,CAAC,UAAU;AAC9C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,IAAI;AAC/C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAE5C,YAAU,MAAM;AACd,QAAI,CAAC,MAAM,IAAK;AAEhB,UAAM,MAAM,IAAK,OAAO,MAAA;AAExB,QAAI,SAAS,MAAM;AACjB,mBAAa,KAAK;AAClB,iBAAW,KAAK;AAAA,IAAA;AAGlB,QAAI,UAAU,MAAM;AAClB,mBAAa,KAAK;AAClB,iBAAW,IAAI;AAAA,IAAA;AAGjB,QAAI,MAAM,MAAM;AAEhB,QAAI,IAAI,UAAU;AAChB,UAAI,IAAI,eAAe,GAAG;AACxB,qBAAa,KAAK;AAClB,mBAAW,KAAK;AAAA,MAAA,OACX;AACL,qBAAa,KAAK;AAClB,mBAAW,IAAI;AAAA,MAAA;AAAA,IACjB;A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;AAAA;AAAA,aAKlB,CAAA,UAAU,MAAM,aAAa,IAAI,CAAE;AAAA,IAC5C,aAAa;AAAA,IACb,KAAK;AAAA;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BcGej2Kr.cjs"),t=require("./area-C8w6fMSn.cjs"),n=require("./component-BV_7tGiu.cjs"),o=require("react"),r=require("./style-f3_KtJIt.cjs"),s=require("./style-fRZ6xrVp.cjs"),i=require("styled-components").img`
|
|
2
|
+
position: absolute;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
object-fit: cover;
|
|
6
|
+
opacity: ${e=>e.$isPending?0:1};
|
|
7
|
+
${r.addTransition};
|
|
8
|
+
${s.addSX};
|
|
9
|
+
`;exports.Image=r=>{const[s,l]=o.useState(!0),[a,c]=o.useState(!1);return o.useEffect(()=>{if(!r.src)return;const e=new window.Image;return e.onload=()=>{l(!1),c(!1)},e.onerror=()=>{l(!1),c(!0)},e.src=r.src,e.complete&&(e.naturalWidth>0?(l(!1),c(!1)):(l(!1),c(!0))),()=>{e.onload=null,e.onerror=null,l(!0),c(!1)}},[r.src]),e.jsxRuntimeExports.jsxs(n.Stack,{sx:e=>({...null==r?void 0:r.sxStack,default:{position:"relative",overflow:"hidden",...r.isShowBeforeImage?{"&::before":{width:"100%",height:"100%",content:'""',position:"absolute",inset:0,backgroundImage:`url(${r.src})`,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",filter:"blur(20px)",transform:"scale(1.1)",zIndex:0}}:{},...(null==r?void 0:r.sxStack)?"function"==typeof(null==r?void 0:r.sxStack)?null==r?void 0:r.sxStack(e).default:null==r?void 0:r.sxStack.default:{}}}),children:[a?null:r.componentLoading||s?e.jsxRuntimeExports.jsx(t.Skeleton,{visible:!0,sx:{default:{width:"100%",height:"100%"}}}):null,!a&&e.jsxRuntimeExports.jsx(i,{loading:"lazy",$isPending:s,src:r.src,alt:r.alt,$sx:r.sxImage}),a&&r.componentFallback||null]})},exports.ImageIMG=i;
|
|
10
|
+
//# sourceMappingURL=component.styles-BLh29xwF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-BLh29xwF.cjs","sources":["../src/components/image/component.styles.tsx","../src/components/image/component.tsx"],"sourcesContent":["import { addTransition } from '@local/styles/add'\nimport { addSX } from '@local/styles/sx'\n\nimport styled from 'styled-components'\n\nimport { ImageIMGProps } from '.'\n\nexport const ImageIMG = styled.img<ImageIMGProps>`\n position: absolute;\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: ${props => (props.$isPending ? 0 : 1)};\n ${addTransition};\n ${addSX};\n`\n","import { Skeleton } from '@local/areas/skeleton';\nimport { Stack } from '@local/components/stack';\n\nimport { FC, useEffect, useState } from 'react';\n\nimport { ImageIMG, ImageProps } from '.';\n\nexport const Image: FC<ImageProps> = (props) => {\n const [isPending, setIsPending] = useState(true);\n const [isError, setIsError] = useState(false);\n\n useEffect(() => {\n if (!props.src) return;\n\n const img = new (window.Image as { new (width?: number, height?: number): HTMLImageElement })();\n\n img.onload = () => {\n setIsPending(false);\n setIsError(false);\n };\n\n img.onerror = () => {\n setIsPending(false);\n setIsError(true);\n };\n\n img.src = props.src;\n\n if (img.complete) {\n if (img.naturalWidth > 0) {\n setIsPending(false);\n setIsError(false);\n } else {\n setIsPending(false);\n setIsError(true);\n }\n }\n\n return () => {\n img.onload = null;\n img.onerror = null;\n setIsPending(true);\n setIsError(false);\n };\n }, [props.src]);\n return (\n <Stack\n sx={(theme) => ({\n ...props?.sxStack,\n default: {\n position: 'relative',\n overflow: 'hidden',\n ...(props.isShowBeforeImage\n ? {\n '&::before': {\n width: '100%',\n height: '100%',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundImage: `url(${props.src})`,\n backgroundRepeat: 'no-repeat',\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n filter: 'blur(20px)',\n transform: 'scale(1.1)',\n zIndex: 0,\n },\n }\n : {}),\n ...(props?.sxStack\n ? typeof props?.sxStack === 'function'\n ? props?.sxStack(theme).default\n : props?.sxStack.default\n : {}),\n },\n })}\n >\n {!isError ? (\n props.componentLoading || isPending ? (\n <Skeleton\n visible\n sx={{\n default: {\n width: '100%',\n height: '100%',\n },\n }}\n />\n ) : null\n ) : null}\n {!isError && (\n <ImageIMG loading='lazy' $isPending={isPending} src={props.src} alt={props.alt} $sx={props.sxImage} />\n )}\n {isError ? props.componentFallback || null : null}\n </Stack>\n );\n};\n"],"names":["ImageIMG","img","props","$isPending","addTransition","addSX","isPending","setIsPending","useState","isError","setIsError","useEffect","src","window","Image","onload","onerror","complete","naturalWidth","jsxs","Stack","sx","theme","sxStack","default","position","overflow","isShowBeforeImage","width","height","content","inset","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","filter","transform","zIndex","children","componentLoading","jsx","Skeleton","visible","loading","alt","$sx","sxImage","componentFallback"],"mappings":"yNAOaA,+BAAkBC,GAAA;;;;;aAKlBC,GAAUA,EAAMC,WAAa,EAAI;IAC1CC;IACAC;gBCPkCH,IACpC,MAAOI,EAAWC,GAAgBC,EAAAA,UAAS,IACpCC,EAASC,GAAcF,EAAAA,UAAS,GAoCvC,OAlCAG,EAAAA,UAAU,KACR,IAAKT,EAAMU,IAAK,OAEhB,MAAMX,EAAM,IAAKY,OAAOC,MAwBxB,OAtBAb,EAAIc,OAAS,KACXR,GAAa,GACbG,GAAW,IAGbT,EAAIe,QAAU,KACZT,GAAa,GACbG,GAAW,IAGbT,EAAIW,IAAMV,EAAMU,IAEZX,EAAIgB,WACFhB,EAAIiB,aAAe,GACrBX,GAAa,GACbG,GAAW,KAEXH,GAAa,GACbG,GAAW,KAIR,KACLT,EAAIc,OAAS,KACbd,EAAIe,QAAU,KACdT,GAAa,GACbG,GAAW,KAEZ,CAACR,EAAMU,QAERO,kBAAAA,KAACC,EAAAA,MAAA,CACCC,GAAKC,IAAA,IACA,MAAApB,OAAA,EAAAA,EAAOqB,QACVC,QAAS,CACPC,SAAU,WACVC,SAAU,YACNxB,EAAMyB,kBACN,CACE,YAAa,CACXC,MAAO,OACPC,OAAQ,OACRC,QAAS,KACTL,SAAU,WACVM,MAAO,EACPC,gBAAiB,OAAO9B,EAAMU,OAC9BqB,iBAAkB,YAClBC,eAAgB,QAChBC,mBAAoB,SACpBC,OAAQ,aACRC,UAAW,aACXC,OAAQ,IAGZ,CAAA,MACA,MAAApC,OAAA,EAAAA,EAAOqB,SACmB,yBAAnBrB,WAAOqB,SACZ,MAAArB,OAAA,EAAAA,EAAOqB,QAAQD,GAAOE,QACtB,MAAAtB,OAAA,EAAAA,EAAOqB,QAAQC,QACjB,CAAA,KAIPe,SAAA,CAAC9B,EAYE,KAXFP,EAAMsC,kBAAoBlC,IACxBmC,kBAAAA,IAACC,EAAAA,SAAA,CACCC,SAAO,EACPtB,GAAI,CACFG,QAAS,CACPI,MAAO,OACPC,OAAQ,WAIZ,MAEJpB,GACAgC,EAAAA,kBAAAA,IAACzC,EAAA,CAAS4C,QAAQ,OAAOzC,WAAYG,EAAWM,IAAKV,EAAMU,IAAKiC,IAAK3C,EAAM2C,IAAKC,IAAK5C,EAAM6C,UAE5FtC,GAAUP,EAAM8C,mBAA4B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "./jsx-runtime-BrDlu8eK.js";
|
|
2
|
+
import { a as addSX } from "./style-plT9Ah7t.js";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
const Separator = (props) => {
|
|
5
|
+
const color = props.color || "grayMonica";
|
|
6
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7
|
+
SeparatorWrapper,
|
|
8
|
+
{
|
|
9
|
+
role: "separator",
|
|
10
|
+
"aria-orientation": props.type,
|
|
11
|
+
$radius: props.radius,
|
|
12
|
+
$color: color,
|
|
13
|
+
$sx: props.sx,
|
|
14
|
+
$type: props.type,
|
|
15
|
+
$thickness: props.thickness
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
const DEFAULT_SEPARATOR_SIZE = "1px";
|
|
20
|
+
const SeparatorWrapper = styled.div`
|
|
21
|
+
flex-grow: 1;
|
|
22
|
+
flex-shrink: 1;
|
|
23
|
+
|
|
24
|
+
width: ${(props) => props.$type === "horizontal" ? "auto" : props.$thickness || DEFAULT_SEPARATOR_SIZE};
|
|
25
|
+
max-width: ${(props) => props.$type === "horizontal" ? "100%" : props.$thickness || DEFAULT_SEPARATOR_SIZE};
|
|
26
|
+
height: ${(props) => props.$type === "vertical" ? "auto" : props.$thickness || DEFAULT_SEPARATOR_SIZE};
|
|
27
|
+
max-height: ${(props) => props.$type === "vertical" ? "100%" : props.$thickness || DEFAULT_SEPARATOR_SIZE};
|
|
28
|
+
|
|
29
|
+
background: ${(props) => props.$color && props.theme.palette[props.$color]};
|
|
30
|
+
border-radius: ${(props) => props.$radius || "0px"};
|
|
31
|
+
${addSX};
|
|
32
|
+
`;
|
|
33
|
+
export {
|
|
34
|
+
Separator as S,
|
|
35
|
+
SeparatorWrapper as a
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=component.styles-BnJjm_ES.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-BnJjm_ES.js","sources":["../src/components/separator/component.tsx","../src/components/separator/component.styles.tsx"],"sourcesContent":["import { IThemePaletteKeys } from '@local/theme/theme.interface';\n\nimport { FC } from 'react';\n\nimport { SeparatorProps, SeparatorWrapper } from '.';\n\nexport const Separator: FC<SeparatorProps> = (props) => {\n const color: IThemePaletteKeys = props.color || 'grayMonica';\n return (\n <SeparatorWrapper\n role='separator'\n aria-orientation={props.type}\n $radius={props.radius}\n $color={color}\n $sx={props.sx}\n $type={props.type}\n $thickness={props.thickness}\n />\n );\n};\n","import { addSX } from '@local/styles/sx';\n\nimport styled from 'styled-components';\n\nimport { SeparatorWrapperProps } from '.';\n\nconst DEFAULT_SEPARATOR_SIZE = '1px';\n\nexport const SeparatorWrapper = styled.div<SeparatorWrapperProps>`\n flex-grow: 1;\n flex-shrink: 1;\n\n width: ${(props) => (props.$type === 'horizontal' ? 'auto' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n max-width: ${(props) => (props.$type === 'horizontal' ? '100%' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n height: ${(props) => (props.$type === 'vertical' ? 'auto' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n max-height: ${(props) => (props.$type === 'vertical' ? '100%' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n\n background: ${(props) => props.$color && props.theme.palette[props.$color]};\n border-radius: ${(props) => props.$radius || '0px'};\n ${addSX};\n`;\n"],"names":["jsx"],"mappings":";;;AAMO,MAAM,YAAgC,CAAC,UAAU;AACtD,QAAM,QAA2B,MAAM,SAAS;AAChD,SACEA,kCAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,oBAAkB,MAAM;AAAA,MACxB,SAAS,MAAM;AAAA,MACf,QAAQ;AAAA,MACR,KAAK,MAAM;AAAA,MACX,OAAO,MAAM;AAAA,MACb,YAAY,MAAM;AAAA,IAAA;AAAA,EAAA;AAGxB;ACbA,MAAM,yBAAyB;AAExB,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA,WAI5B,CAAC,UAAW,MAAM,UAAU,eAAe,SAAS,MAAM,cAAc,sBAAuB;AAAA,eAC3F,CAAC,UAAW,MAAM,UAAU,eAAe,SAAS,MAAM,cAAc,sBAAuB;AAAA,YAClG,CAAC,UAAW,MAAM,UAAU,aAAa,SAAS,MAAM,cAAc,sBAAuB;AAAA,gBACzF,CAAC,UAAW,MAAM,UAAU,aAAa,SAAS,MAAM,cAAc,sBAAuB;AAAA;AAAA,gBAE7F,CAAC,UAAU,MAAM,UAAU,MAAM,MAAM,QAAQ,MAAM,MAAM,CAAC;AAAA,mBACzD,CAAC,UAAU,MAAM,WAAW,KAAK;AAAA,IAChD,KAAK;AAAA;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "./jsx-runtime-BrDlu8eK.js";
|
|
2
|
+
import { b as ErrorMessage } from "./style-DjCgiI7l.js";
|
|
2
3
|
import { useState, useRef, useCallback } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "./component.styles-Du2y0R4W.js";
|
|
4
|
+
import { I as Input } from "./component-B1IQ5CfM.js";
|
|
5
|
+
import "./component.styles-D6KuudL3.js";
|
|
6
6
|
import styled, { css } from "styled-components";
|
|
7
7
|
import { a as addSX } from "./style-plT9Ah7t.js";
|
|
8
|
-
import { K as KEY_SIZE_DATA } from "./theme.global-
|
|
8
|
+
import { K as KEY_SIZE_DATA } from "./theme.global-B46v_8eu.js";
|
|
9
9
|
const InputOTP = (props) => {
|
|
10
10
|
const [otp, setOtp] = useState(new Array(props.length).fill(""));
|
|
11
11
|
const inputsRef = useRef([]);
|
|
@@ -119,6 +119,14 @@ const InputOTP = (props) => {
|
|
|
119
119
|
}
|
|
120
120
|
}, 0);
|
|
121
121
|
},
|
|
122
|
+
onFocus: (e) => {
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
if ((_a = wrapperRef.current) == null ? void 0 : _a.contains(document.activeElement)) {
|
|
126
|
+
(_b = props.onFocus) == null ? void 0 : _b.call(props, e);
|
|
127
|
+
}
|
|
128
|
+
}, 0);
|
|
129
|
+
},
|
|
122
130
|
$sx: props.sx,
|
|
123
131
|
children: otp.map((digit, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
124
132
|
Input,
|
|
@@ -167,4 +175,4 @@ export {
|
|
|
167
175
|
InputOTPSizeConstructor as b,
|
|
168
176
|
InputOTPWrapper as c
|
|
169
177
|
};
|
|
170
|
-
//# sourceMappingURL=component.styles-
|
|
178
|
+
//# sourceMappingURL=component.styles-BoBaG6sX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-BoBaG6sX.js","sources":["../src/components/input-otp/component.tsx","../src/components/input-otp/component.styles.ts"],"sourcesContent":["import { ErrorMessage } from '@local/styles/error'\n\nimport { ClipboardEvent, FocusEvent, KeyboardEvent, useCallback, useRef, useState } from 'react'\n\nimport { Input } from '../input'\nimport { InputOTPProps, InputOTPWrapper } from '.'\n\nexport const InputOTP = (props: InputOTPProps) => {\n const [otp, setOtp] = useState<string[]>(new Array(props.length).fill(''))\n const inputsRef = useRef<(HTMLInputElement | null)[]>([])\n const wrapperRef = useRef<HTMLDivElement | null>(null)\n\n const handlePaste = useCallback(\n (index: number, e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault()\n\n const pasteData = e.clipboardData.getData('Text')\n const digits = pasteData.replace(/\\D/g, '').split('')\n\n if (!digits.length) return\n\n setOtp(prevOtp => {\n const newOtp = [...prevOtp]\n let currentIndex = index\n\n for (let i = 0; i < digits.length && currentIndex < newOtp.length; i++) {\n newOtp[currentIndex] = digits[i]\n currentIndex++\n }\n\n const joined = newOtp.join('')\n\n props.onChange?.(joined)\n\n if (newOtp.every(char => char !== '')) {\n props.onComplete?.(joined)\n }\n\n setTimeout(() => {\n const firstEmpty = newOtp.findIndex(char => char === '')\n if (firstEmpty !== -1) {\n inputsRef.current[firstEmpty]?.focus()\n } else if (currentIndex < newOtp.length) {\n inputsRef.current[currentIndex]?.focus()\n }\n }, 0)\n\n return newOtp\n })\n },\n [props]\n )\n\n const handleChange = useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return\n\n setOtp(prevOtp => {\n const newOtp = [...prevOtp]\n newOtp[index] = value.slice(-1)\n\n if (props.onChange) {\n props.onChange(newOtp.join(''))\n }\n\n if (newOtp.every(char => char !== '')) {\n props.onComplete?.(newOtp.join(''))\n }\n\n if (value && index < prevOtp.length - 1) {\n setTimeout(() => {\n inputsRef.current[index + 1]?.focus()\n }, 0)\n }\n\n return newOtp\n })\n },\n [props]\n )\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n const input = inputsRef.current[index]\n\n if (!input) return\n\n if (e.key === 'ArrowRight') {\n const nextIndex = index < otp.length - 1 ? index + 1 : 0\n const nextInput = inputsRef.current[nextIndex]\n\n if (nextInput) {\n nextInput.focus()\n setTimeout(() => nextInput.setSelectionRange(0, nextInput.value.length), 0)\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const prevIndex = index > 0 ? index - 1 : otp.length - 1\n const prevInput = inputsRef.current[prevIndex]\n\n if (prevInput) {\n prevInput.focus()\n setTimeout(() => prevInput.setSelectionRange(0, prevInput.value.length), 0)\n }\n }\n\n if (e.key === 'Backspace') {\n if (input.value) {\n setTimeout(() => input.setSelectionRange(0, input.value.length), 0)\n } else if (index > 0) {\n setTimeout(() => {\n const prevInput = inputsRef.current[index - 1]\n if (prevInput) {\n prevInput.focus()\n prevInput.setSelectionRange(0, prevInput.value.length)\n }\n }, 0)\n }\n }\n }\n\n const handleFocusInput = useCallback((e: FocusEvent<HTMLInputElement>) => {\n setTimeout(() => e.target.setSelectionRange(0, e.target.value.length), 0)\n }, [])\n return (\n <>\n <InputOTPWrapper\n $error={props.error}\n $size={props.size}\n id={props.id}\n ref={wrapperRef}\n onBlur={e => {\n setTimeout(() => {\n if (wrapperRef.current && !wrapperRef.current.contains(document.activeElement)) {\n props.onBlur?.(e)\n }\n }, 0)\n }}\n onFocus={e => {\n setTimeout(() => {\n if (wrapperRef.current?.contains(document.activeElement)) {\n props.onFocus?.(e)\n }\n }, 0)\n }}\n $sx={props.sx}\n >\n {otp.map((digit, index) => (\n <Input\n isWidthAsHeight\n key={index}\n tabIndex={index + 1}\n ref={el => {\n inputsRef.current[index] = el\n }}\n variety=\"standard\"\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onFocus={handleFocusInput}\n onPaste={e => handlePaste(index, e)}\n onChange={value => handleChange(index, value)}\n onKeyDown={e => handleKeyDown(index, e)}\n genre={props.genre}\n size={props.size}\n />\n ))}\n </InputOTPWrapper>\n {props?.error ? <ErrorMessage {...props.error} size={props?.error.size ?? props.size} /> : null}\n </>\n )\n}\n","import styled, { css } from 'styled-components'\n\nimport { addSX } from '@local/styles/sx'\nimport { IThemeSizePropertyDefault, KEY_SIZE_DATA } from '@local/theme'\n\nimport { InputOTPWrapperProps } from '.'\n\n/****************************************** Size *************************************************/\nexport const InputOTPSize = css<InputOTPWrapperProps>`\n ${props => InputOTPSizeConstructor({ ...KEY_SIZE_DATA[props.$size], ...props })};\n`\nexport const InputOTPSizeConstructor = (props: IThemeSizePropertyDefault & InputOTPWrapperProps) => css`\n gap: ${props.padding - 2}px;\n width: 100%;\n`\n\nexport const InputOTPWrapper = styled.div<InputOTPWrapperProps>`\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n ${InputOTPSize};\n ${addSX};\n`\n"],"names":["_a","_b","jsxs","Fragment","jsx"],"mappings":";;;;;;;;AAOO,MAAM,WAAW,CAAC,UAAyB;AAChD,QAAM,CAAC,KAAK,MAAM,IAAI,SAAmB,IAAI,MAAM,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC;AACzE,QAAM,YAAY,OAAoC,EAAE;AACxD,QAAM,aAAa,OAA8B,IAAI;AAErD,QAAM,cAAc;AAAA,IAClB,CAAC,OAAe,MAAwC;AACtD,QAAE,eAAA;AAEF,YAAM,YAAY,EAAE,cAAc,QAAQ,MAAM;AAChD,YAAM,SAAS,UAAU,QAAQ,OAAO,EAAE,EAAE,MAAM,EAAE;AAEpD,UAAI,CAAC,OAAO,OAAQ;AAEpB,aAAO,CAAA,YAAW;;AAChB,cAAM,SAAS,CAAC,GAAG,OAAO;AAC1B,YAAI,eAAe;AAEnB,iBAAS,IAAI,GAAG,IAAI,OAAO,UAAU,eAAe,OAAO,QAAQ,KAAK;AACtE,iBAAO,YAAY,IAAI,OAAO,CAAC;AAC/B;AAAA,QAAA;AAGF,cAAM,SAAS,OAAO,KAAK,EAAE;AAE7B,oBAA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SAC3F,MAAM,UAAU,CAAC;AAAA;AAAA;AAInB,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA,IAIlC,YAAY;AAAA,IACZ,KAAK;AAAA;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BcGej2Kr.cjs"),t=require("./consts.cjs.js"),s=require("./use-BnaBipTR.cjs"),i=require("./component-X4e7zEKk.cjs"),r=require("./component.styles-BLh29xwF.cjs"),o=require("./component-BV_7tGiu.cjs"),n=require("styled-components"),a=require("./component-BnYw0FvH.cjs"),l=require("./context.constants-BJPyze-d.cjs"),d=require("./theme.global-BdZkriPJ.cjs"),u=require("react"),c=require("./style-eIuUYu9x.cjs"),g=require("framer-motion"),p=require("./style-fRZ6xrVp.cjs"),m=n.css`
|
|
2
|
+
${e=>n.css`
|
|
3
|
+
background: ${e.theme.colors.imageSelect[e.$genre].background.rest};
|
|
4
|
+
color: ${e.theme.colors.imageSelect[e.$genre].color.rest};
|
|
5
|
+
&:active {
|
|
6
|
+
background: ${e.theme.colors.imageSelect[e.$genre].background.rest};
|
|
7
|
+
color: ${e.theme.colors.imageSelect[e.$genre].color.rest};
|
|
8
|
+
}
|
|
9
|
+
&:focus-visible {
|
|
10
|
+
background: ${e.theme.colors.imageSelect[e.$genre].background.rest};
|
|
11
|
+
color: ${e.theme.colors.imageSelect[e.$genre].color.rest};
|
|
12
|
+
}
|
|
13
|
+
`};
|
|
14
|
+
`,x=n.css`
|
|
15
|
+
${e=>h(d.KEY_SIZE_DATA[e.$size])};
|
|
16
|
+
`,h=e=>n.css`
|
|
17
|
+
padding: ${e.padding}px;
|
|
18
|
+
border-radius: ${e.radius}px;
|
|
19
|
+
`,j=n.css`
|
|
20
|
+
${e=>f(d.KEY_SIZE_DATA[e.$size])};
|
|
21
|
+
`,f=e=>n.css`
|
|
22
|
+
gap: ${e.padding-2}px;
|
|
23
|
+
`,S=n.div`
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
width: 100%;
|
|
27
|
+
${j};
|
|
28
|
+
${c.addError};
|
|
29
|
+
${p.addSX};
|
|
30
|
+
`,b=n(g.motion.div)`
|
|
31
|
+
border: 2px dashed;
|
|
32
|
+
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
width: 100%;
|
|
36
|
+
${m}
|
|
37
|
+
${x}
|
|
38
|
+
`;exports.ImageSelect=p=>{const{onChange:m}=p,x=u.useMemo(()=>d.KEY_SIZE_DATA[p.size],[p.size]),[h,j]=u.useState(p.images||[]),[f,v]=u.useState(!1),$=u.useRef(null),y=n.useTheme(),E=u.useCallback(e=>{e&&j(t=>{const s=e.map((e,s)=>({...e,index:t.length+s})),i=[...t,...s];return null==m||m(i),i})},[m]),z=()=>{var e;null==(e=$.current)||e.click()},{handleAddFiles:R}=s.useImageCrop({onSave:E,locale:p.locale,dialog:{button:{genre:p.propsButton.default.genre,size:p.propsButton.default.size},buttonDelete:{genre:p.propsButton.delete.genre,size:p.propsButton.delete.size}},imageSettings:{maxSize:p.imageSettings.maxSize,maxCount:p.imageSettings.maxCount-h.length,aspect:p.imageSettings.aspect},refInput:$}),{handleAdd:k}=(t=>{const s=u.useMemo(()=>d.KEY_SIZE_DATA[t.size],[t.size]),n=u.useMemo(()=>`${s.radius}px`,[s.radius]),{add:c}=l.useDialog({br:n,propsDialog:{borderRadius:n,padding:"0",background:"whiteStandard"}});return{handleAdd:u.useCallback(s=>{c({content:(n,l)=>e.jsxRuntimeExports.jsxs(o.Stack,{sx:{default:{position:"relative",overflow:"hidden",aspectRatio:2*t.imageSettings.aspect+" / 2",width:"auto",maxWidth:"70dvw",height:"85dvh",borderRadius:null==n?void 0:n.br},tablet:{maxWidth:"95dvw"}},children:[e.jsxRuntimeExports.jsx(r.Image,{sxStack:e=>({default:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",backgroundColor:e.palette.black10,position:"absolute",pointerEvents:"none"}}),isShowBeforeImage:!0,sxImage:{default:{objectFit:"contain"}},alt:null==s?void 0:s.imageSrc,src:null==s?void 0:s.imageSrc,componentFallback:e.jsxRuntimeExports.jsx(a.Typography,{sx:{default:{variant:"h6"}},children:t.locale.imageFallback})}),e.jsxRuntimeExports.jsx(i.Button,{sx:{default:{position:"absolute",bottom:15,right:15}},genre:"realebail-white",size:"small",icons:[{type:"id",name:"Arrow4"}],isWidthAsHeight:!0,isHiddenBorder:!0,isRadius:!0,onClick:()=>null==l?void 0:l()})]})})},[c,t.imageSettings.aspect,t.locale.imageFallback])}})({size:p.size,locale:p.locale,imageSettings:p.imageSettings,genre:p.genre});return u.useEffect(()=>{j(p.images||[])},[p.images]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(S,{$genre:p.genre,$size:p.size,id:p.id,$sx:p.sx,$error:p.error,children:[e.jsxRuntimeExports.jsxs(b,{onDrop:e=>{(e=>{var t;e.preventDefault(),(null==(t=e.dataTransfer.files)?void 0:t.length)&&R(e.dataTransfer.files)})(e),v(!1)},onDragOver:e=>e.preventDefault(),onDragEnter:()=>v(!0),onDragLeave:()=>v(!1),animate:{borderColor:f?y.colors.imageSelect[p.genre].border.hover:y.colors.imageSelect[p.genre].border.rest},transition:{duration:.3},$genre:p.genre,$size:p.size,children:[e.jsxRuntimeExports.jsxs(g.motion.div,{transition:{layout:{duration:.3,ease:"easeInOut",type:"spring"}},layout:!0,style:{display:"flex",flexWrap:"wrap",gap:x.padding-2+"px"},children:[h.map(t=>t.url&&e.jsxRuntimeExports.jsxs(g.motion.div,{style:{position:"relative",width:`${p.imageSettings.width}px`,height:`${p.imageSettings.height}px`,userSelect:"none",overflow:"hidden",borderRadius:`${x.radius}px`,flexGrow:1},layout:!0,transition:{layout:{duration:.3,ease:"easeInOut",type:"spring"}},children:[e.jsxRuntimeExports.jsx(r.Image,{sxStack:e=>({default:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",backgroundColor:e.palette.black10,position:"absolute",pointerEvents:"none"}}),isShowBeforeImage:p.isContain,sxImage:{default:{objectFit:p.isContain?"contain":"cover"}},alt:t.name||"image",src:t.url,componentFallback:e.jsxRuntimeExports.jsx(a.Typography,{sx:{default:{variant:"h6"}},children:p.locale.imageFallback})}),e.jsxRuntimeExports.jsx(i.Button,{sx:{default:{position:"absolute",top:5,right:5}},genre:p.genre,size:"small",icons:[{type:"id",name:"Close"}],isWidthAsHeight:!0,isHiddenBorder:!0,isRadius:!0,onClick:()=>{return e=t.id,void j(t=>{const s=t.filter(t=>t.id!==e);return null==m||m(s),s});var e}}),e.jsxRuntimeExports.jsx(i.Button,{sx:{default:{position:"absolute",bottom:5,right:5}},genre:p.genre,size:"small",icons:[{type:"id",name:"Activity"}],isWidthAsHeight:!0,isHiddenBorder:!0,isRadius:!0,onClick:()=>t.url&&k({id:t.id,imageSrc:t.url})})]},t.id)),0===h.length?e.jsxRuntimeExports.jsx("div",{onClick:z,style:{position:"relative",width:`${p.imageSettings.width}px`,height:`${p.imageSettings.height}px`,userSelect:"none",overflow:"hidden",borderRadius:`${x.radius}px`,flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:"pointer"},children:e.jsxRuntimeExports.jsx(a.Typography,{style:{color:y.colors.imageSelect[p.genre].color.rest},sx:{default:{}},children:p.locale.dragAndDrop})},"empty"):null]}),e.jsxRuntimeExports.jsx("input",{ref:$,type:"file",accept:t.ImageSupportedFormatsForInput,multiple:!0,style:{display:"none"},onChange:e=>{e.target.files&&R(e.target.files)}})]}),e.jsxRuntimeExports.jsxs(o.Stack,{sx:{default:{flexGrow:1,gap:x.padding-2+"px"}},children:[e.jsxRuntimeExports.jsx(i.Button,{type:"button",genre:p.genre,size:p.size,sx:{default:{flexGrow:3}},isRadius:!0,onClick:z,children:p.locale.buttonAdd}),e.jsxRuntimeExports.jsx(i.Button,{isRadius:!0,type:"button",sx:{default:{flexGrow:1}},onClick:()=>{j(p.defaultImages||[]),null==m||m(p.defaultImages||[])},genre:p.genre,size:p.size,children:p.locale.buttonReset})]})]}),(null==p?void 0:p.error)?e.jsxRuntimeExports.jsx(c.ErrorMessage,{...p.error,size:(null==p?void 0:p.error.size)??p.size}):null]})},exports.ImageSelectListSize=x,exports.ImageSelectListSizeConstructor=h,exports.ImageSelectListWrapper=b,exports.ImageSelectSize=j,exports.ImageSelectSizeConstructor=f,exports.ImageSelectWrapper=S;
|
|
39
|
+
//# sourceMappingURL=component.styles-BrGPrrEb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-BrGPrrEb.cjs","sources":["../src/components/image-select/component.styles.ts","../src/components/image-select/component.tsx","../src/hooks/use-image-view/use.tsx"],"sourcesContent":["import { motion } from 'framer-motion'\nimport styled, { css } from 'styled-components'\n\nimport { addError } from '@local/styles/error'\nimport { addSX } from '@local/styles/sx'\nimport { IThemeSizePropertyDefault, KEY_SIZE_DATA } from '@local/theme'\n\nimport { ImageSelectWrapperProps } from '.'\n\nconst ImageSelectListGenre = css<ImageSelectWrapperProps>`\n ${props => css`\n background: ${props.theme.colors.imageSelect[props.$genre].background.rest};\n color: ${props.theme.colors.imageSelect[props.$genre].color.rest};\n &:active {\n background: ${props.theme.colors.imageSelect[props.$genre].background.rest};\n color: ${props.theme.colors.imageSelect[props.$genre].color.rest};\n }\n &:focus-visible {\n background: ${props.theme.colors.imageSelect[props.$genre].background.rest};\n color: ${props.theme.colors.imageSelect[props.$genre].color.rest};\n }\n `};\n`\n/****************************************** Size *************************************************/\nexport const ImageSelectListSize = css<ImageSelectWrapperProps>`\n ${props => ImageSelectListSizeConstructor(KEY_SIZE_DATA[props.$size])};\n`\nexport const ImageSelectListSizeConstructor = (props: IThemeSizePropertyDefault) => css`\n padding: ${props.padding}px;\n border-radius: ${props.radius}px;\n`\nexport const ImageSelectSize = css<ImageSelectWrapperProps>`\n ${props => ImageSelectSizeConstructor(KEY_SIZE_DATA[props.$size])};\n`\nexport const ImageSelectSizeConstructor = (props: IThemeSizePropertyDefault) => css`\n gap: ${props.padding - 2}px;\n`\nexport const ImageSelectWrapper = styled.div<ImageSelectWrapperProps>`\n display: flex;\n flex-direction: column;\n width: 100%;\n ${ImageSelectSize};\n ${addError};\n ${addSX};\n`\nexport const ImageSelectListWrapper = styled(motion.div)<ImageSelectWrapperProps>`\n border: 2px dashed;\n\n display: flex;\n flex-direction: column;\n width: 100%;\n ${ImageSelectListGenre}\n ${ImageSelectListSize}\n`\n","import { ImageSupportedFormatsForInput } from '@local/consts';\nimport { useImageCrop } from '@local/hooks/use-image-crop';\nimport { useImageView } from '@local/hooks/use-image-view';\nimport { ErrorMessage } from '@local/styles/error';\nimport { KEY_SIZE_DATA } from '@local/theme';\n\nimport { motion } from 'framer-motion';\nimport { DragEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { Button } from '../button';\nimport { Image } from '../image';\nimport { Stack } from '../stack';\nimport { Typography } from '../typography';\nimport { ImageSelectItemProps, ImageSelectListWrapper, ImageSelectProps, ImageSelectWrapper } from '.';\n\nexport const ImageSelect = (props: ImageSelectProps) => {\n const { onChange } = props;\n\n const size = useMemo(() => KEY_SIZE_DATA[props.size], [props.size]);\n\n const [images, setImages] = useState<ImageSelectItemProps[]>(props.images || []);\n\n const [isDraggingOver, setIsDraggingOver] = useState(false);\n\n const refInput = useRef<HTMLInputElement | null>(null);\n\n const theme = useTheme();\n\n const handleDrop = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n if (e.dataTransfer.files?.length) {\n handleAddFilesCrop(e.dataTransfer.files);\n }\n };\n\n const handleDelete = (id: number) => {\n setImages((prev) => {\n const finalImages = prev.filter((img) => img.id !== id);\n onChange?.(finalImages);\n return finalImages;\n });\n };\n\n const handleOnSave = useCallback(\n (files: ImageSelectItemProps[] | null) => {\n if (files) {\n setImages((prev) => {\n const newImages = files.map((file, idx) => ({\n ...file,\n index: prev.length + idx,\n }));\n const finalImages = [...prev, ...newImages];\n onChange?.(finalImages);\n return finalImages;\n });\n }\n },\n [onChange],\n );\n\n const openFileDialog = () => {\n refInput.current?.click();\n };\n\n const resetImages = () => {\n setImages(props.defaultImages || []);\n onChange?.(props.defaultImages || []);\n };\n\n const { handleAddFiles: handleAddFilesCrop } = useImageCrop({\n onSave: handleOnSave,\n locale: props.locale,\n dialog: {\n button: {\n genre: props.propsButton.default.genre,\n size: props.propsButton.default.size,\n },\n buttonDelete: {\n genre: props.propsButton.delete.genre,\n size: props.propsButton.delete.size,\n },\n },\n imageSettings: {\n maxSize: props.imageSettings.maxSize,\n maxCount: props.imageSettings.maxCount - images.length,\n aspect: props.imageSettings.aspect,\n },\n refInput: refInput,\n });\n\n const { handleAdd } = useImageView({\n size: props.size,\n locale: props.locale,\n imageSettings: props.imageSettings,\n genre: props.genre,\n });\n\n useEffect(() => {\n setImages(props.images || []);\n }, [props.images]);\n\n return (\n <>\n <ImageSelectWrapper $genre={props.genre} $size={props.size} id={props.id} $sx={props.sx} $error={props.error}>\n <ImageSelectListWrapper\n onDrop={(e) => {\n handleDrop(e);\n setIsDraggingOver(false);\n }}\n onDragOver={(e) => e.preventDefault()}\n onDragEnter={() => setIsDraggingOver(true)}\n onDragLeave={() => setIsDraggingOver(false)}\n animate={{\n borderColor: isDraggingOver\n ? theme.colors.imageSelect[props.genre].border.hover\n : theme.colors.imageSelect[props.genre].border.rest,\n }}\n transition={{ duration: 0.3 }}\n $genre={props.genre}\n $size={props.size}\n >\n <motion.div\n transition={{\n layout: {\n duration: 0.3,\n ease: 'easeInOut',\n type: 'spring',\n },\n }}\n layout\n style={{ display: 'flex', flexWrap: 'wrap', gap: `${size.padding - 2}px` }}\n >\n {images.map(\n (img) =>\n img.url && (\n <motion.div\n key={img.id}\n style={{\n position: 'relative',\n width: `${props.imageSettings.width}px`,\n height: `${props.imageSettings.height}px`,\n userSelect: 'none',\n overflow: 'hidden',\n borderRadius: `${size.radius}px`,\n flexGrow: 1,\n }}\n layout\n transition={{\n layout: {\n duration: 0.3,\n ease: 'easeInOut',\n type: 'spring',\n },\n }}\n >\n <Image\n sxStack={(theme) => ({\n default: {\n width: '100%',\n height: '100%',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.palette.black10,\n position: 'absolute',\n pointerEvents: 'none',\n },\n })}\n isShowBeforeImage={props.isContain}\n sxImage={{\n default: {\n objectFit: props.isContain ? 'contain' : 'cover',\n },\n }}\n alt={img.name || 'image'}\n src={img.url}\n componentFallback={\n <Typography\n sx={{\n default: {\n variant: 'h6',\n },\n }}\n >\n {props.locale.imageFallback}\n </Typography>\n }\n />\n <Button\n sx={{\n default: {\n position: 'absolute',\n top: 5,\n right: 5,\n },\n }}\n genre={props.genre}\n size='small'\n icons={[\n {\n type: 'id',\n name: 'Close',\n },\n ]}\n isWidthAsHeight\n isHiddenBorder\n isRadius\n onClick={() => handleDelete(img.id)}\n />\n <Button\n sx={{\n default: {\n position: 'absolute',\n bottom: 5,\n right: 5,\n },\n }}\n genre={props.genre}\n size='small'\n icons={[\n {\n type: 'id',\n name: 'Activity',\n },\n ]}\n isWidthAsHeight\n isHiddenBorder\n isRadius\n onClick={() => img.url && handleAdd({ id: img.id, imageSrc: img.url })}\n />\n </motion.div>\n ),\n )}\n {images.length === 0 ? (\n <div\n onClick={openFileDialog}\n key='empty'\n style={{\n position: 'relative',\n width: `${props.imageSettings.width}px`,\n height: `${props.imageSettings.height}px`,\n userSelect: 'none',\n overflow: 'hidden',\n borderRadius: `${size.radius}px`,\n flexGrow: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n cursor: 'pointer',\n }}\n >\n <Typography\n style={{\n color: theme.colors.imageSelect[props.genre].color.rest,\n }}\n sx={{\n default: {},\n }}\n >\n {props.locale.dragAndDrop}\n </Typography>\n </div>\n ) : null}\n </motion.div>\n\n <input\n ref={refInput}\n type='file'\n accept={ImageSupportedFormatsForInput}\n multiple\n style={{ display: 'none' }}\n onChange={(e) => {\n if (e.target.files) handleAddFilesCrop(e.target.files);\n }}\n />\n </ImageSelectListWrapper>\n <Stack sx={{ default: { flexGrow: 1, gap: `${size.padding - 2}px` } }}>\n <Button\n type='button'\n genre={props.genre}\n size={props.size}\n sx={{\n default: {\n flexGrow: 3,\n },\n }}\n isRadius\n onClick={openFileDialog}\n >\n {props.locale.buttonAdd}\n </Button>\n <Button\n isRadius\n type='button'\n sx={{\n default: {\n flexGrow: 1,\n },\n }}\n onClick={resetImages}\n genre={props.genre}\n size={props.size}\n >\n {props.locale.buttonReset}\n </Button>\n </Stack>\n </ImageSelectWrapper>\n {props?.error ? <ErrorMessage {...props.error} size={props?.error.size ?? props.size} /> : null}\n </>\n );\n};\n","import { Button } from '@local/components/button'\nimport { Image } from '@local/components/image'\nimport { SliderImageProps } from '@local/components/image-slider'\nimport { Stack } from '@local/components/stack'\nimport { Typography } from '@local/components/typography'\nimport { useDialog } from '@local/contexts/context-dialog'\nimport { KEY_SIZE_DATA } from '@local/theme'\n\nimport { useCallback, useMemo } from 'react'\n\nimport { useImageViewProps } from '.'\n\nexport const useImageView = (props: useImageViewProps) => {\n const size = useMemo(() => KEY_SIZE_DATA[props.size], [props.size])\n const br = useMemo(() => `${size.radius}px`, [size.radius])\n\n const { add } = useDialog<{\n br?: string\n }>({\n br: br,\n propsDialog: {\n borderRadius: br,\n padding: '0',\n background: 'whiteStandard'\n }\n })\n const handleAdd = useCallback(\n (image: SliderImageProps) => {\n add({\n content: (params, remove) => (\n <Stack\n sx={{\n default: {\n position: 'relative',\n overflow: 'hidden',\n aspectRatio: `${props.imageSettings.aspect * 2} / 2`,\n width: 'auto',\n maxWidth: '70dvw',\n height: '85dvh',\n borderRadius: params?.br\n },\n tablet: {\n maxWidth: '95dvw'\n }\n }}\n >\n <Image\n sxStack={theme => ({\n default: {\n width: '100%',\n height: '100%',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.palette.black10,\n position: 'absolute',\n pointerEvents: 'none'\n }\n })}\n isShowBeforeImage\n sxImage={{\n default: {\n objectFit: 'contain'\n }\n }}\n alt={image?.imageSrc}\n src={image?.imageSrc}\n componentFallback={\n <Typography\n sx={{\n default: {\n variant: 'h6'\n }\n }}\n >\n {props.locale.imageFallback}\n </Typography>\n }\n />\n <Button\n sx={{\n default: {\n position: 'absolute',\n bottom: 15,\n right: 15\n }\n }}\n genre=\"realebail-white\"\n size=\"small\"\n icons={[\n {\n type: 'id',\n name: 'Arrow4'\n }\n ]}\n isWidthAsHeight\n isHiddenBorder\n isRadius\n onClick={() => remove?.()}\n />\n </Stack>\n )\n })\n },\n [add, props.imageSettings.aspect, props.locale.imageFallback]\n )\n return { handleAdd }\n}\n"],"names":["ImageSelectListGenre","css","props","theme","colors","imageSelect","$genre","background","rest","color","ImageSelectListSize","ImageSelectListSizeConstructor","KEY_SIZE_DATA","$size","padding","radius","ImageSelectSize","ImageSelectSizeConstructor","ImageSelectWrapper","styled","div","addError","addSX","ImageSelectListWrapper","motion","onChange","size","useMemo","images","setImages","useState","isDraggingOver","setIsDraggingOver","refInput","useRef","useTheme","handleOnSave","useCallback","files","prev","newImages","map","file","idx","index","length","finalImages","openFileDialog","_a","current","click","handleAddFiles","handleAddFilesCrop","useImageCrop","onSave","locale","dialog","button","genre","propsButton","default","buttonDelete","delete","imageSettings","maxSize","maxCount","aspect","handleAdd","br","add","useDialog","propsDialog","borderRadius","image","content","params","remove","jsxs","Stack","sx","position","overflow","aspectRatio","width","maxWidth","height","tablet","children","jsx","Image","sxStack","alignItems","justifyContent","backgroundColor","palette","black10","pointerEvents","isShowBeforeImage","sxImage","objectFit","alt","imageSrc","src","componentFallback","Typography","variant","imageFallback","Button","bottom","right","icons","type","name","isWidthAsHeight","isHiddenBorder","isRadius","onClick","useImageView","useEffect","Fragment","id","$sx","$error","error","onDrop","e","preventDefault","dataTransfer","handleDrop","onDragOver","onDragEnter","onDragLeave","animate","borderColor","border","hover","transition","duration","layout","ease","style","display","flexWrap","gap","img","url","userSelect","flexGrow","isContain","top","handleDelete","filter","textAlign","cursor","dragAndDrop","ref","accept","ImageSupportedFormatsForInput","multiple","target","buttonAdd","defaultImages","buttonReset","ErrorMessage"],"mappings":"+fASMA,EAAuBC,EAAAA,GAAAA;IACzBC,GAASD,EAAAA,GAAAA;kBACKC,EAAMC,MAAMC,OAAOC,YAAYH,EAAMI,QAAQC,WAAWC;aAC7DN,EAAMC,MAAMC,OAAOC,YAAYH,EAAMI,QAAQG,MAAMD;;oBAE5CN,EAAMC,MAAMC,OAAOC,YAAYH,EAAMI,QAAQC,WAAWC;eAC7DN,EAAMC,MAAMC,OAAOC,YAAYH,EAAMI,QAAQG,MAAMD;;;oBAG9CN,EAAMC,MAAMC,OAAOC,YAAYH,EAAMI,QAAQC,WAAWC;eAC7DN,EAAMC,MAAMC,OAAOC,YAAYH,EAAMI,QAAQG,MAAMD;;;EAKrDE,EAAsBT,EAAAA,GAAAA;OACtBU,EAA+BC,EAAAA,cAAcV,EAAMW;EAEnDF,EAAkCT,GAAqCD,EAAAA,GAAAA;aACvEC,EAAMY;mBACAZ,EAAMa;EAEZC,EAAkBf,EAAAA,GAAAA;OAClBgB,EAA2BL,EAAAA,cAAcV,EAAMW;EAE/CI,EAA8Bf,GAAqCD,EAAAA,GAAAA;SACvEC,EAAMY,QAAU;EAEZI,EAAqBC,EAAOC,GAAA;;;;IAIrCJ;IACAK;IACAC;EAESC,EAAyBJ,EAAOK,EAAAA,OAAOJ,IAAG;;;;;;IAMnDpB;IACAU;sBCpCwBR,IAC1B,MAAMuB,SAAEA,GAAavB,EAEfwB,EAAOC,UAAQ,IAAMf,gBAAcV,EAAMwB,MAAO,CAACxB,EAAMwB,QAEtDE,EAAQC,GAAaC,EAAAA,SAAiC5B,EAAM0B,QAAU,KAEtEG,EAAgBC,GAAqBF,EAAAA,UAAS,GAE/CG,EAAWC,EAAAA,OAAgC,MAE3C/B,EAAQgC,EAAAA,WAiBRC,EAAeC,EAAAA,YAClBC,IACKA,GACFT,EAAWU,IACT,MAAMC,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BcGej2Kr.cjs"),r=require("react"),s=require("styled-components"),o=require("./style-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BcGej2Kr.cjs"),r=require("react"),s=require("styled-components"),o=require("./style-eIuUYu9x.cjs"),i=require("./component.styles-B-ZAk_1C.cjs"),c=require("./component.styles-Dpg-__rn.cjs"),t=require("./component-D7A-4DNQ.cjs"),n=require("./component-BnYw0FvH.cjs"),d=require("./style-f3_KtJIt.cjs"),h=require("./style-fRZ6xrVp.cjs"),l=require("./theme.global-BdZkriPJ.cjs"),a=s.css`
|
|
2
2
|
${e=>x({...l.KEY_SIZE_DATA[e.$size],isWidthAsHeight:e.$isWidthAsHeight})};
|
|
3
3
|
`,x=e=>s.css`
|
|
4
4
|
height: ${e.height}px;
|
|
@@ -24,14 +24,12 @@
|
|
|
24
24
|
}
|
|
25
25
|
`};
|
|
26
26
|
`,$=s.css`
|
|
27
|
+
${d.addDisabled};
|
|
27
28
|
${e=>e.$isDisabled?s.css`
|
|
28
|
-
opacity: 0.5;
|
|
29
29
|
background: ${e.theme.colors.checkbox[e.$genre].background.rest} !important;
|
|
30
30
|
border-color: ${e.theme.colors.checkbox[e.$genre].border.rest} !important;
|
|
31
31
|
color: ${e.theme.colors.checkbox[e.$genre].color.rest} !important;
|
|
32
|
-
`:
|
|
33
|
-
opacity: 1;
|
|
34
|
-
`}
|
|
32
|
+
`:""}
|
|
35
33
|
`,g=s.css`
|
|
36
34
|
${e=>e.$isHiddenBorder&&s.css`
|
|
37
35
|
border-color: transparent !important;
|
|
@@ -48,9 +46,9 @@
|
|
|
48
46
|
${c.addRippleDefault};
|
|
49
47
|
${d.addTransition};
|
|
50
48
|
${p};
|
|
51
|
-
${$}
|
|
52
49
|
${g};
|
|
53
50
|
${a};
|
|
51
|
+
${$}
|
|
54
52
|
${d.addOutline};
|
|
55
53
|
${o.addError};
|
|
56
54
|
${n.addSXTypography};
|
|
@@ -72,4 +70,4 @@
|
|
|
72
70
|
}
|
|
73
71
|
`}
|
|
74
72
|
`;exports.Checkbox=c=>{const n=r.useCallback(e=>{var r;null==(r=c.onChange)||r.call(c,e)},[c]),d=s.useTheme(),h=r.useMemo(()=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(b,{size:c.sizeIcon||c.size,name:c.view,type:"checkbox",order:c.iconOrder,$genre:c.genre,$checked:c.checked}),c.children&&c.children]}),[c.checked,c.children,c.genre,c.iconOrder,c.size,c.sizeIcon,c.view]),l=e.jsxRuntimeExports.jsx(i.Icon,{size:c.size,type:"loading",name:"Line"});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(u,{type:"button",$genre:c.genre,$error:c.error,$view:c.view,$checked:c.checked,$isWidthAsHeight:c.isWidthAsHeight,$size:c.size,$isDisabled:c.isDisabled,$isHiddenBorder:c.isHiddenBorder,$isNotBackground:c.isNotBackground,$sx:c.sx,$sxTypography:c.sxTypography,disabled:c.isDisabled,tabIndex:0,onClick:()=>!c.isDisabled&&n(!c.checked),children:[e.jsxRuntimeExports.jsx(t.Ripple,{color:d.colors.checkbox[c.genre].color.rest,isDisabled:c.isDisabled}),c.isOnlyLoading?c.isLoading?l:h:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[h,c.isLoading&&l]})]}),(null==c?void 0:c.error)?e.jsxRuntimeExports.jsx(o.ErrorMessage,{...c.error,size:(null==c?void 0:c.error.size)??c.size}):null]})},exports.CheckboxGenre=p,exports.CheckboxSize=a,exports.CheckboxSizeConstructor=x,exports.CheckboxWrapper=u,exports.StyledIcon=b;
|
|
75
|
-
//# sourceMappingURL=component.styles-
|
|
73
|
+
//# sourceMappingURL=component.styles-Bz2vyHqK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-Bz2vyHqK.cjs","sources":["../src/components/checkbox/component.styles.ts","../src/components/checkbox/component.tsx"],"sourcesContent":["import { Icon } from '@local/components/icon';\nimport { addSXTypography, getFontSizeStyles } from '@local/components/typography';\nimport { addDisabled, addOutline, addTransition } from '@local/styles/add';\nimport { addError } from '@local/styles/error';\nimport { addSX } from '@local/styles/sx';\nimport { IThemeSizePropertyDefault, KEY_SIZE_DATA } from '@local/theme';\n\nimport styled, { css } from 'styled-components';\n\nimport { addRippleDefault } from '../ripple';\nimport { StyledCheckboxProps, StyledIconProps } from '.';\n\n/****************************************** Size *************************************************/\nexport const CheckboxSize = css<StyledCheckboxProps>`\n ${(props) => CheckboxSizeConstructor({ ...KEY_SIZE_DATA[props.$size], isWidthAsHeight: props.$isWidthAsHeight })};\n`;\nexport const CheckboxSizeConstructor = (\n props: IThemeSizePropertyDefault & {\n isWidthAsHeight?: boolean;\n },\n) => css`\n height: ${props.height}px;\n min-height: ${props.height}px;\n border-radius: ${props.radius}px;\n gap: ${props.padding - 2}px;\n ${(params) => getFontSizeStyles(props.font, 700, params.theme.font.family)};\n padding: ${props.padding - 4}px;\n ${\n props.isWidthAsHeight &&\n css`\n width: ${props.height}px;\n min-width: ${props.height}px;\n padding: 0px;\n `\n };\n`;\n\n/****************************************** Genre *************************************************/\nexport const CheckboxGenre = css<StyledCheckboxProps>`\n ${(props) => css`\n background: ${props.theme.colors.checkbox[props.$genre].background.rest};\n border-color: ${props.theme.colors.checkbox[props.$genre].border.rest};\n color: ${props.theme.colors.checkbox[props.$genre].color.rest};\n &:hover {\n background: ${props.theme.colors.checkbox[props.$genre].background.hover};\n border-color: ${props.theme.colors.checkbox[props.$genre].border.hover};\n color: ${props.theme.colors.checkbox[props.$genre].color.hover};\n }\n `};\n`;\n\n/****************************************** Disabled *************************************************/\nconst addCheckboxDisabled = css<StyledCheckboxProps>`\n ${addDisabled};\n ${(props) =>\n props.$isDisabled\n ? css`\n background: ${props.theme.colors.checkbox[props.$genre].background.rest} !important;\n border-color: ${props.theme.colors.checkbox[props.$genre].border.rest} !important;\n color: ${props.theme.colors.checkbox[props.$genre].color.rest} !important;\n `\n : ''}\n`;\n\n/****************************************** HiddenBorder *************************************************/\nconst CheckboxHiddenBorder = css<StyledCheckboxProps>`\n ${(props) =>\n props.$isHiddenBorder &&\n css`\n border-color: transparent !important;\n `}\n`;\n\n/****************************************** Default *************************************************/\nexport const CheckboxWrapper = styled.button<StyledCheckboxProps>`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border: 1px solid transparent;\n user-select: none;\n cursor: pointer;\n background-color: ${(props) => props.$isNotBackground && 'transparent'};\n\n ${addRippleDefault};\n ${addTransition};\n ${CheckboxGenre};\n ${CheckboxHiddenBorder};\n ${CheckboxSize};\n ${addCheckboxDisabled}\n ${addOutline};\n ${addError};\n ${addSXTypography};\n ${addSX};\n`;\n\n/****************************************** Styled *************************************************/\nexport const StyledIcon = styled(Icon)<StyledIconProps>`\n ${(props) =>\n props.$checked\n ? css`\n & #check {\n color: inherit;\n }\n & #uncheck {\n color: transparent;\n }\n `\n : css`\n & #check {\n color: transparent;\n }\n & #uncheck {\n color: inherit;\n }\n `}\n`;\n","import { FC, useCallback, useMemo } from 'react'\nimport { useTheme } from 'styled-components'\n\nimport { ErrorMessage } from '@local/styles/error'\n\nimport { CheckboxProps, CheckboxWrapper, StyledIcon } from '.'\nimport { Icon } from '../icon'\nimport { Ripple } from '../ripple'\n\nexport const Checkbox: FC<CheckboxProps> = props => {\n const handleOnClick = useCallback(\n (checked: boolean) => {\n props.onChange?.(checked)\n },\n [props]\n )\n const theme = useTheme()\n const children = useMemo(\n () => (\n <>\n <StyledIcon\n size={props.sizeIcon || props.size}\n name={props.view}\n type=\"checkbox\"\n order={props.iconOrder}\n $genre={props.genre}\n $checked={props.checked}\n />\n {props.children && props.children}\n </>\n ),\n [props.checked, props.children, props.genre, props.iconOrder, props.size, props.sizeIcon, props.view]\n )\n const LoadingComponent = <Icon size={props.size} type=\"loading\" name=\"Line\" />\n\n return (\n <>\n <CheckboxWrapper\n type=\"button\"\n $genre={props.genre}\n $error={props.error}\n $view={props.view}\n $checked={props.checked}\n $isWidthAsHeight={props.isWidthAsHeight}\n $size={props.size}\n $isDisabled={props.isDisabled}\n $isHiddenBorder={props.isHiddenBorder}\n $isNotBackground={props.isNotBackground}\n $sx={props.sx}\n $sxTypography={props.sxTypography}\n disabled={props.isDisabled}\n tabIndex={0}\n onClick={() => !props.isDisabled && handleOnClick(!props.checked)}\n >\n <Ripple color={theme.colors.checkbox[props.genre].color.rest} isDisabled={props.isDisabled} />\n {props.isOnlyLoading ? (\n props.isLoading ? (\n LoadingComponent\n ) : (\n children\n )\n ) : (\n <>\n {children}\n {props.isLoading && LoadingComponent}\n </>\n )}\n </CheckboxWrapper>\n {props?.error ? <ErrorMessage {...props.error} size={props?.error.size ?? props.size} /> : null}\n </>\n )\n}\n"],"names":["CheckboxSize","css","props","CheckboxSizeConstructor","KEY_SIZE_DATA","$size","isWidthAsHeight","$isWidthAsHeight","height","radius","padding","params","getFontSizeStyles","font","theme","family","CheckboxGenre","colors","checkbox","$genre","background","rest","border","color","hover","addCheckboxDisabled","addDisabled","$isDisabled","CheckboxHiddenBorder","$isHiddenBorder","CheckboxWrapper","styled","button","$isNotBackground","addRippleDefault","addTransition","addOutline","addError","addSXTypography","addSX","StyledIcon","Icon","$checked","handleOnClick","useCallback","checked","_a","onChange","call","useTheme","children","useMemo","jsxs","Fragment","jsx","size","sizeIcon","name","view","type","order","iconOrder","genre","LoadingComponent","$error","error","$view","isDisabled","isHiddenBorder","isNotBackground","$sx","sx","$sxTypography","sxTypography","disabled","tabIndex","onClick","Ripple","isOnlyLoading","isLoading","ErrorMessage"],"mappings":"kaAaaA,EAAeC,EAAAA,GAAAA;IACvBC,GAAUC,EAAwB,IAAKC,EAAAA,cAAcF,EAAMG,OAAQC,gBAAiBJ,EAAMK;EAElFJ,EACXD,GAGGD,EAAAA,GAAAA;YACOC,EAAMM;gBACFN,EAAMM;mBACHN,EAAMO;SAChBP,EAAMQ,QAAU;IACpBC,GAAWC,oBAAkBV,EAAMW,KAAM,IAAKF,EAA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AM6E,WAAahB,eAIzB7D,WAAO+D,OAAQX,EAAAA,kBAAAA,IAAC0B,EAAAA,aAAA,IAAiB9E,EAAM+D,MAAOV,MAAM,MAAArD,OAAA,EAAAA,EAAO+D,MAAMV,OAAQrD,EAAMqD,OAAW"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "./jsx-runtime-BrDlu8eK.js";
|
|
2
|
-
import { motion } from "framer-motion";
|
|
3
|
-
import { useMemo, useCallback, useState, useRef, useEffect } from "react";
|
|
4
|
-
import styled, { useTheme, css } from "styled-components";
|
|
5
2
|
import { ImageSupportedFormatsForInput } from "./consts.es.js";
|
|
6
|
-
import { u as useImageCrop } from "./use-
|
|
7
|
-
import { c as Button } from "./component-
|
|
8
|
-
import { I as Image } from "./component.styles-
|
|
3
|
+
import { u as useImageCrop } from "./use-B6rT81uF.js";
|
|
4
|
+
import { c as Button } from "./component-CbPhVNw5.js";
|
|
5
|
+
import { I as Image } from "./component.styles-BI4OuDrG.js";
|
|
9
6
|
import { b as Stack } from "./component-jPZYT5iL.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import styled, { useTheme, css } from "styled-components";
|
|
8
|
+
import { j as Typography } from "./component--cOriuv7.js";
|
|
9
|
+
import { a as useDialog } from "./context.constants-COR-ReeN.js";
|
|
10
|
+
import { K as KEY_SIZE_DATA } from "./theme.global-B46v_8eu.js";
|
|
11
|
+
import { useMemo, useCallback, useState, useRef, useEffect } from "react";
|
|
12
|
+
import { b as ErrorMessage, a as addError } from "./style-DjCgiI7l.js";
|
|
13
|
+
import { motion } from "framer-motion";
|
|
14
14
|
import { a as addSX } from "./style-plT9Ah7t.js";
|
|
15
15
|
const useImageView = (props) => {
|
|
16
16
|
const size = useMemo(() => KEY_SIZE_DATA[props.size], [props.size]);
|
|
@@ -328,7 +328,7 @@ const ImageSelect = (props) => {
|
|
|
328
328
|
img.id
|
|
329
329
|
)
|
|
330
330
|
),
|
|
331
|
-
images.length === 0
|
|
331
|
+
images.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
332
332
|
"div",
|
|
333
333
|
{
|
|
334
334
|
onClick: openFileDialog,
|
|
@@ -360,7 +360,7 @@ const ImageSelect = (props) => {
|
|
|
360
360
|
)
|
|
361
361
|
},
|
|
362
362
|
"empty"
|
|
363
|
-
)
|
|
363
|
+
) : null
|
|
364
364
|
]
|
|
365
365
|
}
|
|
366
366
|
),
|
|
@@ -471,4 +471,4 @@ export {
|
|
|
471
471
|
ImageSelectWrapper as e,
|
|
472
472
|
ImageSelectListWrapper as f
|
|
473
473
|
};
|
|
474
|
-
//# sourceMappingURL=component.styles-
|
|
474
|
+
//# sourceMappingURL=component.styles-BzNkEurr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-BzNkEurr.js","sources":["../src/hooks/use-image-view/use.tsx","../src/components/image-select/component.tsx","../src/components/image-select/component.styles.ts"],"sourcesContent":["import { Button } from '@local/components/button'\nimport { Image } from '@local/components/image'\nimport { SliderImageProps } from '@local/components/image-slider'\nimport { Stack } from '@local/components/stack'\nimport { Typography } from '@local/components/typography'\nimport { useDialog } from '@local/contexts/context-dialog'\nimport { KEY_SIZE_DATA } from '@local/theme'\n\nimport { useCallback, useMemo } from 'react'\n\nimport { useImageViewProps } from '.'\n\nexport const useImageView = (props: useImageViewProps) => {\n const size = useMemo(() => KEY_SIZE_DATA[props.size], [props.size])\n const br = useMemo(() => `${size.radius}px`, [size.radius])\n\n const { add } = useDialog<{\n br?: string\n }>({\n br: br,\n propsDialog: {\n borderRadius: br,\n padding: '0',\n background: 'whiteStandard'\n }\n })\n const handleAdd = useCallback(\n (image: SliderImageProps) => {\n add({\n content: (params, remove) => (\n <Stack\n sx={{\n default: {\n position: 'relative',\n overflow: 'hidden',\n aspectRatio: `${props.imageSettings.aspect * 2} / 2`,\n width: 'auto',\n maxWidth: '70dvw',\n height: '85dvh',\n borderRadius: params?.br\n },\n tablet: {\n maxWidth: '95dvw'\n }\n }}\n >\n <Image\n sxStack={theme => ({\n default: {\n width: '100%',\n height: '100%',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.palette.black10,\n position: 'absolute',\n pointerEvents: 'none'\n }\n })}\n isShowBeforeImage\n sxImage={{\n default: {\n objectFit: 'contain'\n }\n }}\n alt={image?.imageSrc}\n src={image?.imageSrc}\n componentFallback={\n <Typography\n sx={{\n default: {\n variant: 'h6'\n }\n }}\n >\n {props.locale.imageFallback}\n </Typography>\n }\n />\n <Button\n sx={{\n default: {\n position: 'absolute',\n bottom: 15,\n right: 15\n }\n }}\n genre=\"realebail-white\"\n size=\"small\"\n icons={[\n {\n type: 'id',\n name: 'Arrow4'\n }\n ]}\n isWidthAsHeight\n isHiddenBorder\n isRadius\n onClick={() => remove?.()}\n />\n </Stack>\n )\n })\n },\n [add, props.imageSettings.aspect, props.locale.imageFallback]\n )\n return { handleAdd }\n}\n","import { ImageSupportedFormatsForInput } from '@local/consts';\nimport { useImageCrop } from '@local/hooks/use-image-crop';\nimport { useImageView } from '@local/hooks/use-image-view';\nimport { ErrorMessage } from '@local/styles/error';\nimport { KEY_SIZE_DATA } from '@local/theme';\n\nimport { motion } from 'framer-motion';\nimport { DragEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { Button } from '../button';\nimport { Image } from '../image';\nimport { Stack } from '../stack';\nimport { Typography } from '../typography';\nimport { ImageSelectItemProps, ImageSelectListWrapper, ImageSelectProps, ImageSelectWrapper } from '.';\n\nexport const ImageSelect = (props: ImageSelectProps) => {\n const { onChange } = props;\n\n const size = useMemo(() => KEY_SIZE_DATA[props.size], [props.size]);\n\n const [images, setImages] = useState<ImageSelectItemProps[]>(props.images || []);\n\n const [isDraggingOver, setIsDraggingOver] = useState(false);\n\n const refInput = useRef<HTMLInputElement | null>(null);\n\n const theme = useTheme();\n\n const handleDrop = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n if (e.dataTransfer.files?.length) {\n handleAddFilesCrop(e.dataTransfer.files);\n }\n };\n\n const handleDelete = (id: number) => {\n setImages((prev) => {\n const finalImages = prev.filter((img) => img.id !== id);\n onChange?.(finalImages);\n return finalImages;\n });\n };\n\n const handleOnSave = useCallback(\n (files: ImageSelectItemProps[] | null) => {\n if (files) {\n setImages((prev) => {\n const newImages = files.map((file, idx) => ({\n ...file,\n index: prev.length + idx,\n }));\n const finalImages = [...prev, ...newImages];\n onChange?.(finalImages);\n return finalImages;\n });\n }\n },\n [onChange],\n );\n\n const openFileDialog = () => {\n refInput.current?.click();\n };\n\n const resetImages = () => {\n setImages(props.defaultImages || []);\n onChange?.(props.defaultImages || []);\n };\n\n const { handleAddFiles: handleAddFilesCrop } = useImageCrop({\n onSave: handleOnSave,\n locale: props.locale,\n dialog: {\n button: {\n genre: props.propsButton.default.genre,\n size: props.propsButton.default.size,\n },\n buttonDelete: {\n genre: props.propsButton.delete.genre,\n size: props.propsButton.delete.size,\n },\n },\n imageSettings: {\n maxSize: props.imageSettings.maxSize,\n maxCount: props.imageSettings.maxCount - images.length,\n aspect: props.imageSettings.aspect,\n },\n refInput: refInput,\n });\n\n const { handleAdd } = useImageView({\n size: props.size,\n locale: props.locale,\n imageSettings: props.imageSettings,\n genre: props.genre,\n });\n\n useEffect(() => {\n setImages(props.images || []);\n }, [props.images]);\n\n return (\n <>\n <ImageSelectWrapper $genre={props.genre} $size={props.size} id={props.id} $sx={props.sx} $error={props.error}>\n <ImageSelectListWrapper\n onDrop={(e) => {\n handleDrop(e);\n setIsDraggingOver(false);\n }}\n onDragOver={(e) => e.preventDefault()}\n onDragEnter={() => setIsDraggingOver(true)}\n onDragLeave={() => setIsDraggingOver(false)}\n animate={{\n borderColor: isDraggingOver\n ? theme.colors.imageSelect[props.genre].border.hover\n : theme.colors.imageSelect[props.genre].border.rest,\n }}\n transition={{ duration: 0.3 }}\n $genre={props.genre}\n $size={props.size}\n >\n <motion.div\n transition={{\n layout: {\n duration: 0.3,\n ease: 'easeInOut',\n type: 'spring',\n },\n }}\n layout\n style={{ display: 'flex', flexWrap: 'wrap', gap: `${size.padding - 2}px` }}\n >\n {images.map(\n (img) =>\n img.url && (\n <motion.div\n key={img.id}\n style={{\n position: 'relative',\n width: `${props.imageSettings.width}px`,\n height: `${props.imageSettings.height}px`,\n userSelect: 'none',\n overflow: 'hidden',\n borderRadius: `${size.radius}px`,\n flexGrow: 1,\n }}\n layout\n transition={{\n layout: {\n duration: 0.3,\n ease: 'easeInOut',\n type: 'spring',\n },\n }}\n >\n <Image\n sxStack={(theme) => ({\n default: {\n width: '100%',\n height: '100%',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.palette.black10,\n position: 'absolute',\n pointerEvents: 'none',\n },\n })}\n isShowBeforeImage={props.isContain}\n sxImage={{\n default: {\n objectFit: props.isContain ? 'contain' : 'cover',\n },\n }}\n alt={img.name || 'image'}\n src={img.url}\n componentFallback={\n <Typography\n sx={{\n default: {\n variant: 'h6',\n },\n }}\n >\n {props.locale.imageFallback}\n </Typography>\n }\n />\n <Button\n sx={{\n default: {\n position: 'absolute',\n top: 5,\n right: 5,\n },\n }}\n genre={props.genre}\n size='small'\n icons={[\n {\n type: 'id',\n name: 'Close',\n },\n ]}\n isWidthAsHeight\n isHiddenBorder\n isRadius\n onClick={() => handleDelete(img.id)}\n />\n <Button\n sx={{\n default: {\n position: 'absolute',\n bottom: 5,\n right: 5,\n },\n }}\n genre={props.genre}\n size='small'\n icons={[\n {\n type: 'id',\n name: 'Activity',\n },\n ]}\n isWidthAsHeight\n isHiddenBorder\n isRadius\n onClick={() => img.url && handleAdd({ id: img.id, imageSrc: img.url })}\n />\n </motion.div>\n ),\n )}\n {images.length === 0 ? (\n <div\n onClick={openFileDialog}\n key='empty'\n style={{\n position: 'relative',\n width: `${props.imageSettings.width}px`,\n height: `${props.imageSettings.height}px`,\n userSelect: 'none',\n overflow: 'hidden',\n borderRadius: `${size.radius}px`,\n flexGrow: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n cursor: 'pointer',\n }}\n >\n <Typography\n style={{\n color: theme.colors.imageSelect[props.genre].color.rest,\n }}\n sx={{\n default: {},\n }}\n >\n {props.locale.dragAndDrop}\n </Typography>\n </div>\n ) : null}\n </motion.div>\n\n <input\n ref={refInput}\n type='file'\n accept={ImageSupportedFormatsForInput}\n multiple\n style={{ display: 'none' }}\n onChange={(e) => {\n if (e.target.files) handleAddFilesCrop(e.target.files);\n }}\n />\n </ImageSelectListWrapper>\n <Stack sx={{ default: { flexGrow: 1, gap: `${size.padding - 2}px` } }}>\n <Button\n type='button'\n genre={props.genre}\n size={props.size}\n sx={{\n default: {\n flexGrow: 3,\n },\n }}\n isRadius\n onClick={openFileDialog}\n >\n {props.locale.buttonAdd}\n </Button>\n <Button\n isRadius\n type='button'\n sx={{\n default: {\n flexGrow: 1,\n },\n }}\n onClick={resetImages}\n genre={props.genre}\n size={props.size}\n >\n {props.locale.buttonReset}\n </Button>\n </Stack>\n </ImageSelectWrapper>\n {props?.error ? <ErrorMessage {...props.error} size={props?.error.size ?? props.size} /> : null}\n </>\n );\n};\n","import { motion } from 'framer-motion'\nimport styled, { css } from 'styled-components'\n\nimport { addError } from '@local/styles/error'\nimport { addSX } from '@local/styles/sx'\nimport { IThemeSizePropertyDefault, KEY_SIZE_DATA } from '@local/theme'\n\nimport { ImageSelectWrapperProps } from '.'\n\nconst ImageSelectListGenre = css<ImageSelectWrapperProps>`\n ${props => css`\n background: ${props.theme.colors.imageSelect[props.$genre].background.rest};\n color: ${props.theme.colors.imageSelect[props.$genre].color.rest};\n &:active {\n background: ${props.theme.colors.imageSelect[props.$genre].background.rest};\n color: ${props.theme.colors.imageSelect[props.$genre].color.rest};\n }\n &:focus-visible {\n background: ${props.theme.colors.imageSelect[props.$genre].background.rest};\n color: ${props.theme.colors.imageSelect[props.$genre].color.rest};\n }\n `};\n`\n/****************************************** Size *************************************************/\nexport const ImageSelectListSize = css<ImageSelectWrapperProps>`\n ${props => ImageSelectListSizeConstructor(KEY_SIZE_DATA[props.$size])};\n`\nexport const ImageSelectListSizeConstructor = (props: IThemeSizePropertyDefault) => css`\n padding: ${props.padding}px;\n border-radius: ${props.radius}px;\n`\nexport const ImageSelectSize = css<ImageSelectWrapperProps>`\n ${props => ImageSelectSizeConstructor(KEY_SIZE_DATA[props.$size])};\n`\nexport const ImageSelectSizeConstructor = (props: IThemeSizePropertyDefault) => css`\n gap: ${props.padding - 2}px;\n`\nexport const ImageSelectWrapper = styled.div<ImageSelectWrapperProps>`\n display: flex;\n flex-direction: column;\n width: 100%;\n ${ImageSelectSize};\n ${addError};\n ${addSX};\n`\nexport const ImageSelectListWrapper = styled(motion.div)<ImageSelectWrapperProps>`\n border: 2px dashed;\n\n display: flex;\n flex-direction: column;\n width: 100%;\n ${ImageSelectListGenre}\n ${ImageSelectListSize}\n`\n"],"names":["jsxs","jsx","Fragment","theme"],"mappings":";;;;;;;;;;;;;;AAYO,MAAM,eAAe,CAAC,UAA6B;AACxD,QAAM,OAAO,QAAQ,MAAM,cAAc,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;AAClE,QAAM,KAAK,QAAQ,MAAM,GAAG,KAAK,MAAM,MAAM,CAAC,KAAK,MAAM,CAAC;AAE1D,QAAM,EAAE,IAAA,IAAQ,UAEb;AAAA,IACD;AAAA,IACA,aAAa;AAAA,MACX,cAAc;AAAA,MACd,SAAS;AAAA,MACT,YAAY;AAAA,IAAA;AAAA,EACd,CACD;AACD,QAAM,YAAY;AAAA,IAChB,CAAC,UAA4B;AAC3B,UAAI;AAAA,QACF,SAAS,CAAC,QAAQ,WAChBA,kCAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,cACF,SAAS;AAAA,gBACP,UAAU;AAAA,gBACV,UAAU;AAAA,gBACV,aAAa,GAAG,MAAM,cAAc,SAAS,CAA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AI;AAAA;AAAA;AAAA,oBAGlD,MAAM,MAAM,OAAO,YAAY,MAAM,MAAM,EAAE,WAAW,IAAI;AAAA,eACjE,MAAM,MAAM,OAAO,YAAY,MAAM,MAAM,EAAE,MAAM,IAAI;AAAA;AAAA,GAEnE;AAAA;AAGI,MAAM,sBAAsB;AAAA,IAC/B,WAAS,+BAA+B,cAAc,MAAM,KAAK,CAAC,CAAC;AAAA;AAEhE,MAAM,iCAAiC,CAAC,UAAqC;AAAA,aACvE,MAAM,OAAO;AAAA,mBACP,MAAM,MAAM;AAAA;AAExB,MAAM,kBAAkB;AAAA,IAC3B,WAAS,2BAA2B,cAAc,MAAM,KAAK,CAAC,CAAC;AAAA;AAE5D,MAAM,6BAA6B,CAAC,UAAqC;AAAA,SACvE,MAAM,UAAU,CAAC;AAAA;AAEnB,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA,IAIrC,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,KAAK;AAAA;AAEF,MAAM,yBAAyB,OAAO,OAAO,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnD,oBAAoB;AAAA,IACpB,mBAAmB;AAAA;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BcGej2Kr.cjs"),t=require("./style-fRZ6xrVp.cjs"),r=require("styled-components"),s="1px",o=r.div`
|
|
2
|
+
flex-grow: 1;
|
|
3
|
+
flex-shrink: 1;
|
|
4
|
+
|
|
5
|
+
width: ${e=>"horizontal"===e.$type?"auto":e.$thickness||s};
|
|
6
|
+
max-width: ${e=>"horizontal"===e.$type?"100%":e.$thickness||s};
|
|
7
|
+
height: ${e=>"vertical"===e.$type?"auto":e.$thickness||s};
|
|
8
|
+
max-height: ${e=>"vertical"===e.$type?"100%":e.$thickness||s};
|
|
9
|
+
|
|
10
|
+
background: ${e=>e.$color&&e.theme.palette[e.$color]};
|
|
11
|
+
border-radius: ${e=>e.$radius||"0px"};
|
|
12
|
+
${t.addSX};
|
|
13
|
+
`;exports.Separator=t=>{const r=t.color||"grayMonica";return e.jsxRuntimeExports.jsx(o,{role:"separator","aria-orientation":t.type,$radius:t.radius,$color:r,$sx:t.sx,$type:t.type,$thickness:t.thickness})},exports.SeparatorWrapper=o;
|
|
14
|
+
//# sourceMappingURL=component.styles-CLn52hJD.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.styles-CLn52hJD.cjs","sources":["../src/components/separator/component.styles.tsx","../src/components/separator/component.tsx"],"sourcesContent":["import { addSX } from '@local/styles/sx';\n\nimport styled from 'styled-components';\n\nimport { SeparatorWrapperProps } from '.';\n\nconst DEFAULT_SEPARATOR_SIZE = '1px';\n\nexport const SeparatorWrapper = styled.div<SeparatorWrapperProps>`\n flex-grow: 1;\n flex-shrink: 1;\n\n width: ${(props) => (props.$type === 'horizontal' ? 'auto' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n max-width: ${(props) => (props.$type === 'horizontal' ? '100%' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n height: ${(props) => (props.$type === 'vertical' ? 'auto' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n max-height: ${(props) => (props.$type === 'vertical' ? '100%' : props.$thickness || DEFAULT_SEPARATOR_SIZE)};\n\n background: ${(props) => props.$color && props.theme.palette[props.$color]};\n border-radius: ${(props) => props.$radius || '0px'};\n ${addSX};\n`;\n","import { IThemePaletteKeys } from '@local/theme/theme.interface';\n\nimport { FC } from 'react';\n\nimport { SeparatorProps, SeparatorWrapper } from '.';\n\nexport const Separator: FC<SeparatorProps> = (props) => {\n const color: IThemePaletteKeys = props.color || 'grayMonica';\n return (\n <SeparatorWrapper\n role='separator'\n aria-orientation={props.type}\n $radius={props.radius}\n $color={color}\n $sx={props.sx}\n $type={props.type}\n $thickness={props.thickness}\n />\n );\n};\n"],"names":["DEFAULT_SEPARATOR_SIZE","SeparatorWrapper","styled","div","props","$type","$thickness","$color","theme","palette","$radius","addSX","color","jsx","role","type","radius","$sx","sx","thickness"],"mappings":"4HAMMA,EAAyB,MAElBC,EAAmBC,EAAOC,GAAA;;;;WAI3BC,GAA2B,eAAhBA,EAAMC,MAAyB,OAASD,EAAME,YAAcN;eACnEI,GAA2B,eAAhBA,EAAMC,MAAyB,OAASD,EAAME,YAAcN;YAC1EI,GAA2B,aAAhBA,EAAMC,MAAuB,OAASD,EAAME,YAAcN;gBACjEI,GAA2B,aAAhBA,EAAMC,MAAuB,OAASD,EAAME,YAAcN;;gBAErEI,GAAUA,EAAMG,QAAUH,EAAMI,MAAMC,QAAQL,EAAMG;mBACjDH,GAAUA,EAAMM,SAAW;IAC3CC;oBCb0CP,IAC5C,MAAMQ,EAA2BR,EAAMQ,OAAS,aAChD,SACEC,kBAAAA,IAACZ,EAAA,CACCa,KAAK,YACL,mBAAkBV,EAAMW,KACxBL,QAASN,EAAMY,OACfT,OAAQK,EACRK,IAAKb,EAAMc,GACXb,MAAOD,EAAMW,KACbT,WAAYF,EAAMe"}
|