@mrshmllw/smores-react 12.2.0 → 12.2.1-crumbs-fix-adding-generic-classname-to-field.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.
@@ -5,7 +5,7 @@ import { Icon } from '../../Icon';
|
|
5
5
|
import { Text } from '../../Text';
|
6
6
|
export const InternalField = ({ children, fieldType, renderAsTitle, htmlFor, className, label, assistiveText, error, errorMsg, required, completed, ...marginProps }) => {
|
7
7
|
const labelTag = fieldType === 'field' ? 'label' : 'legend';
|
8
|
-
return (React.createElement(Container, { forwardedAs: fieldType === 'field' ? 'div' : 'fieldset', className: className, ...marginProps },
|
8
|
+
return (React.createElement(Container, { forwardedAs: fieldType === 'field' ? 'div' : 'fieldset', className: 'SMORES_INTERNAL_FIELD' + ' ' + className, ...marginProps },
|
9
9
|
label && (React.createElement(React.Fragment, null, renderAsTitle ? (React.createElement(Box, { mb: "16px" },
|
10
10
|
React.createElement(Text, { tag: labelTag, typo: "heading-small", htmlFor: htmlFor }, label),
|
11
11
|
assistiveText && (React.createElement(Text, { tag: "p", color: "sesame", mt: { custom: 4 } }, assistiveText)))) : (React.createElement(Text, { tag: labelTag, typo: "label", color: error ? 'strawberry' : 'sesame', htmlFor: htmlFor, mb: { custom: 4 } },
|
@@ -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,SAAS,EACT,GAAG,WAAW,EACK,EAAE,EAAE;IACvB,MAAM,QAAQ,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3D,OAAO,CACL,oBAAC,SAAS,IACR,WAAW,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,EACvD,SAAS,EAAE,SAAS,
|
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,SAAS,EACT,GAAG,WAAW,EACK,EAAE,EAAE;IACvB,MAAM,QAAQ,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3D,OAAO,CACL,oBAAC,SAAS,IACR,WAAW,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,EACvD,SAAS,EAAE,uBAAuB,GAAG,GAAG,GAAG,SAAS,KAChD,WAAW;QAEd,KAAK,IAAI,CACR,0CACG,aAAa,CAAC,CAAC,CAAC,CACf,oBAAC,G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AC,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={'SMORES_INTERNAL_FIELD' + ' ' + 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 <Text tag=\"span\" typo=\"caption\" color=\"strawberry\" mt=\"8px\">\n {errorMsg}\n </Text>\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.2.
|
3
|
+
"version": "12.2.1-crumbs-fix-adding-generic-classname-to-field.1",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"description": "Collection of React components used by Marshmallow Technology",
|
6
6
|
"type": "module",
|
@@ -42,55 +42,55 @@
|
|
42
42
|
"@semantic-release/github": "^11.0.1",
|
43
43
|
"@semantic-release/npm": "^12.0.0",
|
44
44
|
"@snyk/protect": "^1.1296.0",
|
45
|
-
"@storybook/addon-a11y": "^8.6.
|
45
|
+
"@storybook/addon-a11y": "^8.6.10",
|
46
46
|
"@storybook/addon-coverage": "^1.0.5",
|
47
|
-
"@storybook/addon-essentials": "^8.6.
|
48
|
-
"@storybook/addon-interactions": "^8.6.
|
49
|
-
"@storybook/addon-links": "^8.6.
|
50
|
-
"@storybook/preview-api": "^8.6.
|
51
|
-
"@storybook/react": "^8.6.
|
52
|
-
"@storybook/react-vite": "^8.6.
|
47
|
+
"@storybook/addon-essentials": "^8.6.10",
|
48
|
+
"@storybook/addon-interactions": "^8.6.10",
|
49
|
+
"@storybook/addon-links": "^8.6.10",
|
50
|
+
"@storybook/preview-api": "^8.6.10",
|
51
|
+
"@storybook/react": "^8.6.10",
|
52
|
+
"@storybook/react-vite": "^8.6.10",
|
53
53
|
"@storybook/test": "^8.2.1",
|
54
54
|
"@storybook/test-runner": "^0.22.0",
|
55
55
|
"@testing-library/react": "^16.2.0",
|
56
56
|
"@types/body-scroll-lock": "^3.1.0",
|
57
57
|
"@types/dompurify": "^3.2.0",
|
58
|
-
"@types/node": "^22.13.
|
59
|
-
"@types/react": "^19.0.
|
58
|
+
"@types/node": "^22.13.14",
|
59
|
+
"@types/react": "^19.0.12",
|
60
60
|
"@types/react-dom": "^19.0.4",
|
61
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
62
|
-
"@typescript-eslint/parser": "^8.
|
61
|
+
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
62
|
+
"@typescript-eslint/parser": "^8.28.0",
|
63
63
|
"axe-playwright": "^2.1.0",
|
64
64
|
"conventional-changelog-conventionalcommits": "^8.0.0",
|
65
|
-
"eslint": "^9.
|
65
|
+
"eslint": "^9.23.0",
|
66
66
|
"eslint-config-prettier": "^10.1.1",
|
67
|
-
"eslint-plugin-prettier": "^5.2.
|
67
|
+
"eslint-plugin-prettier": "^5.2.5",
|
68
68
|
"eslint-plugin-react": "^7.37.4",
|
69
69
|
"eslint-plugin-react-hooks": "^5.2.0",
|
70
70
|
"husky": "^9.1.7",
|
71
71
|
"jsdom": "^26.0.0",
|
72
72
|
"lint-staged": "^15.5.0",
|
73
|
-
"playwright": "^1.51.
|
73
|
+
"playwright": "^1.51.1",
|
74
74
|
"prettier": "^3.5.3",
|
75
75
|
"react": "^19.0.0",
|
76
76
|
"react-dom": "^19.0.0",
|
77
77
|
"rimraf": "^6.0.1",
|
78
78
|
"semantic-release": "^24.2.3",
|
79
79
|
"storybook": "^8.0.4",
|
80
|
-
"styled-components": "^6.1.
|
80
|
+
"styled-components": "^6.1.16",
|
81
81
|
"typescript": "^5.8.2",
|
82
|
-
"typescript-eslint": "^8.
|
83
|
-
"vite": "^6.2.
|
84
|
-
"vitest": "^3.0.
|
82
|
+
"typescript-eslint": "^8.28.0",
|
83
|
+
"vite": "^6.2.3",
|
84
|
+
"vitest": "^3.0.9"
|
85
85
|
},
|
86
86
|
"dependencies": {
|
87
87
|
"@floating-ui/react": "0.27.5",
|
88
|
-
"@lexical/react": "^0.
|
88
|
+
"@lexical/react": "^0.29.0",
|
89
89
|
"body-scroll-lock": "^4.0.0-beta.0",
|
90
90
|
"date-fns": "^4.1.0",
|
91
91
|
"dompurify": "^3.2.4",
|
92
92
|
"fuse.js": "^7.1.0",
|
93
|
-
"lexical": "^0.
|
93
|
+
"lexical": "^0.29.0",
|
94
94
|
"polished": "^4.1.3"
|
95
95
|
},
|
96
96
|
"peerDependencies": {
|