@mrshmllw/smores-react 12.3.3 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProgressIndicator/components/StepItem.js +2 -2
- package/dist/ProgressIndicator/components/StepItem.js.map +1 -1
- package/dist/Tag/Tag.d.ts +1 -0
- package/dist/Tag/Tag.js +1 -1
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/fields/components/InternalField.js +3 -1
- package/dist/fields/components/InternalField.js.map +1 -1
- package/package.json +18 -18
@@ -9,7 +9,7 @@ export const StepItem = ({ label, isSimple = false, isCurrentStep, stepWidth, on
|
|
9
9
|
return (React.createElement(SimpleItem, { "$completed": isCompleted, "$lastCompleted": isLastCompleted, width: stepWidth, height: "12px" }));
|
10
10
|
}
|
11
11
|
return (React.createElement(ProgressItem, { flex: true, alignItems: "flex-start", "$completed": isCompleted, "$lastCompleted": isLastCompleted, width: stepWidth },
|
12
|
-
React.createElement(ClickableArea, { flex: true, direction: "column", alignItems: "center", onClick: onClick, "$isDisabled": isDisabled },
|
12
|
+
React.createElement(ClickableArea, { flex: true, "data-testid": `step-item-${label}`, direction: "column", alignItems: "center", onClick: onClick, "$isDisabled": isDisabled },
|
13
13
|
React.createElement(ProgressIndicator, { "$completed": isCompleted, "$currentStep": isCurrentStep, flex: true, alignItems: "center", justifyContent: "center" }, isCompleted && React.createElement(Icon, { render: "tick", size: 16, color: "cream" })),
|
14
14
|
React.createElement(StyledText, { typo: "caption" }, label)),
|
15
15
|
isCompleted && !isLastItem && React.createElement(CompletedBar, null)));
|
@@ -67,7 +67,7 @@ const CompletedBar = styled(Box) `
|
|
67
67
|
height: 12px;
|
68
68
|
width: 100%;
|
69
69
|
top: 7px;
|
70
|
-
left:
|
70
|
+
left: 13px;
|
71
71
|
background: ${theme.colors.pistachio};
|
72
72
|
z-index: 0;
|
73
73
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StepItem.js","sourceRoot":"","sources":["../../../src/ProgressIndicator/components/StepItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAajC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,aAAa,EACb,SAAS,EACT,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,eAAe,GAAG,KAAK,EACvB,UAAU,GAAG,KAAK,EAClB,UAAU,GACI,EAAE,EAAE;IAClB,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CACL,oBAAC,UAAU,kBACG,WAAW,oBACP,eAAe,EAC/B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAC,MAAM,GACb,CACH,CAAA;IACH,CAAC;IAED,OAAO,CACL,oBAAC,YAAY,IACX,IAAI,QACJ,UAAU,EAAC,YAAY,gBACX,WAAW,oBACP,eAAe,EAC/B,KAAK,EAAE,SAAS;QAEhB,oBAAC,aAAa,IACZ,IAAI,
|
1
|
+
{"version":3,"file":"StepItem.js","sourceRoot":"","sources":["../../../src/ProgressIndicator/components/StepItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,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,MAAM,CAAC,GAAG,CAAC,CAAsB;;;IAGhD,eAAe;;gBAEH,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAC/B,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;CAC/C,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAsB;;;;;;;;;CASrD,CAAA;AACD,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAsB;;YAE3C,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;CAClE,CAAA;AAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAsB;;;;;;gBAM3C,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,EAAE,CAC7C,UAAU,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;CAC5E,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;iBAEd,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;CAExC,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;gBAMhB,KAAK,CAAC,MAAM,CAAC,SAAS;;CAErC,CAAA","sourcesContent":["import { Box } from '../../Box'\nimport { StepData } from 'ProgressIndicator/types'\nimport React from 'react'\nimport styled, { css } from 'styled-components'\nimport { theme } from '../../theme'\nimport { Text } from '../../Text'\nimport { Icon } from '../../Icon'\n\nexport interface StepItemProps extends Pick<StepData, 'label'> {\n isCompleted?: boolean\n isLastCompleted?: boolean\n isDisabled: boolean\n isCurrentStep: boolean\n isSimple?: boolean\n onClick: () => void\n stepWidth: string\n isLastItem: boolean\n}\n\nexport const StepItem = ({\n label,\n isSimple = false,\n isCurrentStep,\n stepWidth,\n onClick,\n isCompleted = false,\n isLastCompleted = false,\n isLastItem = false,\n isDisabled,\n}: StepItemProps) => {\n if (isSimple) {\n return (\n <SimpleItem\n $completed={isCompleted}\n $lastCompleted={isLastCompleted}\n width={stepWidth}\n height=\"12px\"\n />\n )\n }\n\n return (\n <ProgressItem\n flex\n alignItems=\"flex-start\"\n $completed={isCompleted}\n $lastCompleted={isLastCompleted}\n width={stepWidth}\n >\n <ClickableArea\n flex\n data-testid={`step-item-${label}`}\n direction=\"column\"\n alignItems=\"center\"\n onClick={onClick}\n $isDisabled={isDisabled}\n >\n <ProgressIndicator\n $completed={isCompleted}\n $currentStep={isCurrentStep}\n flex\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n {isCompleted && <Icon render=\"tick\" size={16} color=\"cream\" />}\n </ProgressIndicator>\n <StyledText typo=\"caption\">{label}</StyledText>\n </ClickableArea>\n {isCompleted && !isLastItem && <CompletedBar />}\n </ProgressItem>\n )\n}\n\ninterface StyledComponentProps {\n $completed?: boolean\n $lastCompleted?: boolean\n $currentStep?: boolean\n $isDisabled?: boolean\n $completedStep?: boolean\n}\n\nconst lastCompleted = css`\n border-radius: 0 100px 100px 0;\n\n &:first-child {\n border-radius: 100px;\n }\n`\n\nconst borderRadiusCss = css<StyledComponentProps>`\n &:first-child {\n border-radius: 100px 0 0 100px;\n }\n\n ${({ $lastCompleted }) => $lastCompleted && lastCompleted}\n`\n\nconst SimpleItem = styled(Box)<StyledComponentProps>`\n position: relative;\n z-index: 1;\n ${borderRadiusCss}\n\n background: ${({ $completed }) =>\n $completed ? theme.colors.pistachio : 'none'};\n`\n\nconst ProgressItem = styled(Box)<StyledComponentProps>`\n position: relative;\n z-index: 1;\n top: 9px;\n left: -10px;\n\n &:last-child {\n width: auto;\n }\n`\nconst ClickableArea = styled(Box)<StyledComponentProps>`\n position: relative;\n cursor: ${({ $isDisabled }) => ($isDisabled ? 'auto' : 'pointer')};\n`\n\nconst ProgressIndicator = styled(Box)<StyledComponentProps>`\n border-radius: 50%;\n height: 24px;\n width: 24px;\n position: relative;\n z-index: 1;\n background: ${({ $completed, $currentStep }) =>\n $completed || $currentStep ? theme.colors.pistachio : theme.colors.matcha};\n`\n\nconst StyledText = styled(Text)`\n margin-top: 2px;\n font-weight: ${theme.font.weight.medium};\n white-space: nowrap;\n`\n\nconst CompletedBar = styled(Box)`\n position: absolute;\n height: 12px;\n width: 100%;\n top: 7px;\n left: 13px;\n background: ${theme.colors.pistachio};\n z-index: 0;\n`\n"]}
|
package/dist/Tag/Tag.d.ts
CHANGED
package/dist/Tag/Tag.js
CHANGED
@@ -4,7 +4,7 @@ import { Box } from '../Box';
|
|
4
4
|
import { Text } from '../Text';
|
5
5
|
import { theme } from '../theme';
|
6
6
|
import { Icon } from '../Icon';
|
7
|
-
export const Tag = ({ label, color, borderColor, bgColor, className, icon, iconColor, ...marginProps }) => (React.createElement(Wrapper, { "$bgColor": bgColor, className: className, "$borderColor": borderColor, ...marginProps, alignContent: "center", justifyContent: "center" },
|
7
|
+
export const Tag = ({ label, color, borderColor, bgColor, className, icon, iconColor, onClick, ...marginProps }) => (React.createElement(Wrapper, { "$bgColor": bgColor, className: className, "$borderColor": borderColor, ...marginProps, alignContent: "center", justifyContent: "center", onClick: onClick },
|
8
8
|
icon && (React.createElement(TagIcon, { render: icon, color: iconColor, size: 16, "data-testid": `tag-icon-${icon}` })),
|
9
9
|
React.createElement(TagText, { tag: "span", typo: "label", color: color }, label)));
|
10
10
|
const Wrapper = styled(Box) `
|
package/dist/Tag/Tag.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAItC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,E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C9D,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAC7B,YAAY,IAAI,aAAa,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;;;;;;;;;CAS5D,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;;CAO3B,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE3B,CAAA","sourcesContent":["import React, { FC } from 'react'\nimport styled from 'styled-components'\nimport { MarginProps } from '../utils/space'\n\nimport { TransientProps } from 'utils/utilTypes'\nimport { Box } from '../Box'\nimport { Text } from '../Text'\nimport { Color, theme } from '../theme'\nimport { Icon } from '../Icon'\nimport { Icons } from 'Icon/iconsList'\n\nexport type TagProps = {\n label: string\n color: Color\n bgColor: Color\n borderColor?: Color\n className?: string\n icon?: Icons\n iconColor?: Color\n onClick?: () => void\n} & MarginProps\n\nexport const Tag: FC<TagProps> = ({\n label,\n color,\n borderColor,\n bgColor,\n className,\n icon,\n iconColor,\n onClick,\n ...marginProps\n}) => (\n <Wrapper\n $bgColor={bgColor}\n className={className}\n $borderColor={borderColor}\n {...marginProps}\n alignContent=\"center\"\n justifyContent=\"center\"\n onClick={onClick}\n >\n {icon && (\n <TagIcon\n render={icon}\n color={iconColor}\n size={16}\n data-testid={`tag-icon-${icon}`}\n />\n )}\n <TagText tag=\"span\" typo=\"label\" color={color}>\n {label}\n </TagText>\n </Wrapper>\n)\n\ntype WrapperProps = TransientProps<Pick<TagProps, 'bgColor' | 'borderColor'>>\n\nconst Wrapper = styled(Box)<WrapperProps>`\n background-color: ${({ $bgColor }) => $bgColor && theme.colors[$bgColor]};\n border: ${({ $borderColor }) =>\n $borderColor && `1px solid ${theme.colors[$borderColor]}`};\n\n border-radius: 6px;\n padding: 4px 8px;\n\n height: 22px;\n\n box-sizing: border-box;\n display: inline-flex;\n`\n\nconst TagText = styled(Text)`\n display: flex;\n align-items: center;\n font-size: 10px;\n font-weight: 500;\n line-height: 12px;\n text-transform: uppercase;\n`\n\nconst TagIcon = styled(Icon)`\n padding-right: 4px;\n`\n"]}
|
@@ -15,7 +15,9 @@ export const InternalField = ({ children, fieldType, renderAsTitle, htmlFor, cla
|
|
15
15
|
fieldType === 'field' && assistiveText && !renderAsTitle && (React.createElement(Text, { tag: labelTag, typo: "caption", color: error ? 'strawberry' : 'sesame', mt: { custom: 4 } }, assistiveText)),
|
16
16
|
error &&
|
17
17
|
errorMsg &&
|
18
|
-
(typeof errorMsg === 'string' ? (React.createElement(
|
18
|
+
(typeof errorMsg === 'string' ? (React.createElement(Box, { flex: true, alignItems: "center", mt: "8px", gap: { custom: 4 } },
|
19
|
+
React.createElement(Icon, { render: "warning", size: 16, color: "strawberry" }),
|
20
|
+
React.createElement(Text, { tag: "span", typo: "caption", color: "strawberry" }, errorMsg))) : (React.createElement(Box, { mt: "8px" }, errorMsg))),
|
19
21
|
completed !== undefined && (React.createElement(AnimationWrapper, { "$displayStatus": completed, "$isError": !!(error && errorMsg) },
|
20
22
|
React.createElement(StatusWrapper, { mt: '8px' },
|
21
23
|
React.createElement(Icon, { render: "included", size: 16, color: "apple" }),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InternalField.js","sourceRoot":"","sources":["../../../src/fields/components/InternalField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAUjC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,SAAS,EACT,KAAK,EACL,aAAa,EACb,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SA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,QAAQ,CACJ,CACH,CACP,CAAC,CAAC,CAAC,CACF,oBAAC,GAAG,IAAC,EAAE,EAAC,KAAK,IAAE,QAAQ,CAAO,CAC/B,CAAC;QAGH,SAAS,KAAK,SAAS,IAAI,CAC1B,oBAAC,gBAAgB,sBACC,SAAS,cACf,CAAC,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC;YAE/B,oBAAC,aAAa,IAAC,EAAE,EAAE,KAAK;gBACtB,oBAAC,IAAI,IAAC,MAAM,EAAC,UAAU,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,OAAO,GAAG;gBAClD,oBAAC,IAAI,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,OAAO,eAE3B,CACO,CACC,CACpB,CACS,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAGlC;;;;IAIE,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,CACvB,cAAc;IACd,GAAG,CAAA;;;KAGF;;;IAGD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACjB,QAAQ;IACR,GAAG,CAAA;;KAEF;CACJ,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;CAIhC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;;;CAQ5B,CAAA","sourcesContent":["import React, { ReactNode } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { Box } from '../../Box'\nimport { Icon } from '../../Icon'\nimport { Text } from '../../Text'\nimport { CommonFieldProps } from '../commonFieldTypes'\n\ninterface InternalFieldProps extends CommonFieldProps {\n children: ReactNode\n className?: string\n htmlFor?: string\n fieldType: 'field' | 'fieldset'\n}\n\nexport const InternalField = ({\n children,\n fieldType,\n renderAsTitle,\n htmlFor,\n className,\n label,\n assistiveText,\n error,\n errorMsg,\n required,\n completed,\n ...marginProps\n}: InternalFieldProps) => {\n const labelTag = fieldType === 'field' ? 'label' : 'legend'\n\n return (\n <Container\n forwardedAs={fieldType === 'field' ? 'div' : 'fieldset'}\n className={className}\n {...marginProps}\n >\n {label && (\n <>\n {renderAsTitle ? (\n <Box mb=\"16px\">\n <Text tag={labelTag} typo=\"heading-small\" htmlFor={htmlFor}>\n {label}\n </Text>\n\n {assistiveText && (\n <Text tag=\"p\" color=\"sesame\" mt={{ custom: 4 }}>\n {assistiveText}\n </Text>\n )}\n </Box>\n ) : (\n <Text\n tag={labelTag}\n typo=\"label\"\n color={error ? 'strawberry' : 'sesame'}\n htmlFor={htmlFor}\n mb={{ custom: 4 }}\n >\n {label}\n {required && (\n <Text tag=\"span\" typo=\"body-small\" color=\"strawberry\">\n *\n </Text>\n )}\n </Text>\n )}\n </>\n )}\n\n <Box>{children}</Box>\n {fieldType === 'field' && assistiveText && !renderAsTitle && (\n <Text\n tag={labelTag}\n typo=\"caption\"\n color={error ? 'strawberry' : 'sesame'}\n mt={{ custom: 4 }}\n >\n {assistiveText}\n </Text>\n )}\n\n {error &&\n errorMsg &&\n (typeof errorMsg === 'string' ? (\n <Box flex alignItems=\"center\" mt=\"8px\" gap={{ custom: 4 }}>\n <Icon render=\"warning\" size={16} color=\"strawberry\" />\n <Text tag=\"span\" typo=\"caption\" color=\"strawberry\">\n {errorMsg}\n </Text>\n </Box>\n ) : (\n <Box mt=\"8px\">{errorMsg}</Box>\n ))}\n\n {/* When completed is false, whitespace is rendered */}\n {completed !== undefined && (\n <AnimationWrapper\n $displayStatus={completed}\n $isError={!!(error && errorMsg)}\n >\n <StatusWrapper mt={'8px'}>\n <Icon render=\"included\" size={16} color=\"apple\" />\n <Text typo=\"caption\" color=\"apple\">\n Complete\n </Text>\n </StatusWrapper>\n </AnimationWrapper>\n )}\n </Container>\n )\n}\n\nconst AnimationWrapper = styled(Box)<{\n $displayStatus: boolean\n $isError: boolean\n}>`\n width: 0;\n overflow: hidden;\n\n ${({ $displayStatus }) =>\n $displayStatus &&\n css`\n transition: width 0.6s ease-in;\n width: 100%;\n `}\n\n /* This enables animation to appear when previous state is error */\n ${({ $isError }) =>\n $isError &&\n css`\n height: 0;\n `}\n`\n\nconst StatusWrapper = styled(Box)`\n display: flex;\n align-items: center;\n gap: 4px;\n`\n\nconst Container = styled(Box)`\n display: flex;\n flex-direction: column;\n position: relative;\n width: 100%;\n\n // In case, the element is a 'fieldset', we remove the border\n border: 0;\n`\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mrshmllw/smores-react",
|
3
|
-
"version": "12.
|
3
|
+
"version": "12.4.0",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"description": "Collection of React components used by Marshmallow Technology",
|
6
6
|
"type": "module",
|
@@ -39,9 +39,9 @@
|
|
39
39
|
"@commitlint/types": "^19.8.0",
|
40
40
|
"@semantic-release/changelog": "^6.0.3",
|
41
41
|
"@semantic-release/git": "^10.0.1",
|
42
|
-
"@semantic-release/github": "^11.0.
|
42
|
+
"@semantic-release/github": "^11.0.2",
|
43
43
|
"@semantic-release/npm": "^12.0.0",
|
44
|
-
"@snyk/protect": "^1.1296.
|
44
|
+
"@snyk/protect": "^1.1296.2",
|
45
45
|
"@storybook/addon-a11y": "^8.6.12",
|
46
46
|
"@storybook/addon-coverage": "^1.0.5",
|
47
47
|
"@storybook/addon-essentials": "^8.6.12",
|
@@ -55,22 +55,22 @@
|
|
55
55
|
"@testing-library/react": "^16.3.0",
|
56
56
|
"@types/body-scroll-lock": "^3.1.0",
|
57
57
|
"@types/dompurify": "^3.2.0",
|
58
|
-
"@types/node": "^22.14
|
59
|
-
"@types/react": "^19.1.
|
60
|
-
"@types/react-dom": "^19.1.
|
61
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
62
|
-
"@typescript-eslint/parser": "^8.
|
58
|
+
"@types/node": "^22.15.14",
|
59
|
+
"@types/react": "^19.1.3",
|
60
|
+
"@types/react-dom": "^19.1.3",
|
61
|
+
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
62
|
+
"@typescript-eslint/parser": "^8.31.1",
|
63
63
|
"axe-playwright": "^2.1.0",
|
64
64
|
"conventional-changelog-conventionalcommits": "^8.0.0",
|
65
|
-
"eslint": "^9.
|
65
|
+
"eslint": "^9.26.0",
|
66
66
|
"eslint-config-prettier": "^10.1.2",
|
67
|
-
"eslint-plugin-prettier": "^5.
|
67
|
+
"eslint-plugin-prettier": "^5.4.0",
|
68
68
|
"eslint-plugin-react": "^7.37.5",
|
69
69
|
"eslint-plugin-react-hooks": "^5.2.0",
|
70
70
|
"husky": "^9.1.7",
|
71
71
|
"jsdom": "^26.1.0",
|
72
|
-
"lint-staged": "^15.5.
|
73
|
-
"playwright": "^1.
|
72
|
+
"lint-staged": "^15.5.2",
|
73
|
+
"playwright": "^1.52.0",
|
74
74
|
"prettier": "^3.5.3",
|
75
75
|
"react": "^19.0.0",
|
76
76
|
"react-dom": "^19.1.0",
|
@@ -79,18 +79,18 @@
|
|
79
79
|
"storybook": "^8.0.4",
|
80
80
|
"styled-components": "^6.1.17",
|
81
81
|
"typescript": "^5.8.3",
|
82
|
-
"typescript-eslint": "^8.
|
83
|
-
"vite": "^6.
|
84
|
-
"vitest": "^3.1.
|
82
|
+
"typescript-eslint": "^8.32.0",
|
83
|
+
"vite": "^6.3.5",
|
84
|
+
"vitest": "^3.1.3"
|
85
85
|
},
|
86
86
|
"dependencies": {
|
87
|
-
"@floating-ui/react": "0.27.
|
88
|
-
"@lexical/react": "^0.
|
87
|
+
"@floating-ui/react": "0.27.8",
|
88
|
+
"@lexical/react": "^0.31.0",
|
89
89
|
"body-scroll-lock": "^4.0.0-beta.0",
|
90
90
|
"date-fns": "^4.1.0",
|
91
91
|
"dompurify": "^3.2.5",
|
92
92
|
"fuse.js": "^7.1.0",
|
93
|
-
"lexical": "^0.
|
93
|
+
"lexical": "^0.31.0",
|
94
94
|
"polished": "^4.1.3"
|
95
95
|
},
|
96
96
|
"peerDependencies": {
|