@mittwald/flow-react-components 0.2.0-alpha.62 → 0.2.0-alpha.63
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/CHANGELOG.md +6 -0
- package/dist/assets/doc-properties.json +2300 -2281
- package/dist/js/components/Initials/Initials.mjs +11 -2
- package/dist/js/components/Initials/Initials.mjs.map +1 -1
- package/dist/types/components/Initials/Initials.d.ts +1 -0
- package/dist/types/components/Initials/Initials.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -14,12 +14,21 @@ import { onlyText } from 'react-children-utilities';
|
|
|
14
14
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
15
15
|
|
|
16
16
|
const Initials = flowComponent("Initials", (props) => {
|
|
17
|
-
const { children, className, ref } = props;
|
|
17
|
+
const { children, className, "aria-hidden": ariaHidden, ref } = props;
|
|
18
18
|
const textContent = onlyText(children);
|
|
19
19
|
const initials = getInitialsFromString(textContent);
|
|
20
20
|
const rootClassName = clsx(styles.initials, className);
|
|
21
21
|
const initialsElements = initials.map((initial, index) => /* @__PURE__ */ jsx("span", { children: initial }, index));
|
|
22
|
-
return /* @__PURE__ */ jsx(ClearPropsContext, { children: /* @__PURE__ */ jsx(
|
|
22
|
+
return /* @__PURE__ */ jsx(ClearPropsContext, { children: /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
"aria-hidden": ariaHidden,
|
|
26
|
+
"aria-label": textContent,
|
|
27
|
+
className: rootClassName,
|
|
28
|
+
ref,
|
|
29
|
+
children: initialsElements
|
|
30
|
+
}
|
|
31
|
+
) });
|
|
23
32
|
});
|
|
24
33
|
|
|
25
34
|
export { Initials, Initials as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Initials.mjs","sources":["../../../../src/components/Initials/Initials.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport { getInitialsFromString } from \"./lib/getInitialsFromString\";\nimport styles from \"./Initials.module.scss\";\nimport clsx from \"clsx\";\nimport { ClearPropsContext } from \"@/lib/propsContext\";\nimport { onlyText } from \"react-children-utilities\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\n\nexport interface InitialsProps\n extends PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps {}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const Initials = flowComponent(\"Initials\", (props) => {\n const { children, className, ref } = props;\n\n const textContent = onlyText(children);\n const initials = getInitialsFromString(textContent);\n\n const rootClassName = clsx(styles.initials, className);\n\n const initialsElements = initials.map((initial, index) => (\n <span key={index}>{initial}</span>\n ));\n\n return (\n <ClearPropsContext>\n <div
|
|
1
|
+
{"version":3,"file":"Initials.mjs","sources":["../../../../src/components/Initials/Initials.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport { getInitialsFromString } from \"./lib/getInitialsFromString\";\nimport styles from \"./Initials.module.scss\";\nimport clsx from \"clsx\";\nimport { ClearPropsContext } from \"@/lib/propsContext\";\nimport { onlyText } from \"react-children-utilities\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\n\nexport interface InitialsProps\n extends PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps {\n \"aria-hidden\"?: boolean;\n}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const Initials = flowComponent(\"Initials\", (props) => {\n const { children, className, \"aria-hidden\": ariaHidden, ref } = props;\n\n const textContent = onlyText(children);\n const initials = getInitialsFromString(textContent);\n\n const rootClassName = clsx(styles.initials, className);\n\n const initialsElements = initials.map((initial, index) => (\n <span key={index}>{initial}</span>\n ));\n\n return (\n <ClearPropsContext>\n <div\n aria-hidden={ariaHidden}\n aria-label={textContent}\n className={rootClassName}\n ref={ref}\n >\n {initialsElements}\n </div>\n </ClearPropsContext>\n );\n});\n\nexport default Initials;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsBO,MAAM,QAAW,GAAA,aAAA,CAAc,UAAY,EAAA,CAAC,KAAU,KAAA;AAC3D,EAAA,MAAM,EAAE,QAAU,EAAA,SAAA,EAAW,aAAe,EAAA,UAAA,EAAY,KAAQ,GAAA,KAAA;AAEhE,EAAM,MAAA,WAAA,GAAc,SAAS,QAAQ,CAAA;AACrC,EAAM,MAAA,QAAA,GAAW,sBAAsB,WAAW,CAAA;AAElD,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,MAAO,CAAA,QAAA,EAAU,SAAS,CAAA;AAErD,EAAM,MAAA,gBAAA,GAAmB,QAAS,CAAA,GAAA,CAAI,CAAC,OAAA,EAAS,0BAC7C,GAAA,CAAA,MAAA,EAAA,EAAkB,QAAR,EAAA,OAAA,EAAA,EAAA,KAAgB,CAC5B,CAAA;AAED,EAAA,2BACG,iBACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,aAAa,EAAA,UAAA;AAAA,MACb,YAAY,EAAA,WAAA;AAAA,MACZ,SAAW,EAAA,aAAA;AAAA,MACX,GAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GAEL,EAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -2,6 +2,7 @@ import { PropsWithChildren, default as React } from 'react';
|
|
|
2
2
|
import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
|
|
3
3
|
import { PropsWithClassName } from '../../lib/types/props';
|
|
4
4
|
export interface InitialsProps extends PropsWithChildren, PropsWithClassName, FlowComponentProps {
|
|
5
|
+
"aria-hidden"?: boolean;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* @flr-generate all
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Initials.d.ts","sourceRoot":"","sources":["../../../../src/components/Initials/Initials.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,aACf,SAAQ,iBAAiB,EACvB,kBAAkB,EAClB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"Initials.d.ts","sourceRoot":"","sources":["../../../../src/components/Initials/Initials.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,aACf,SAAQ,iBAAiB,EACvB,kBAAkB,EAClB,kBAAkB;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,8EAwBnB,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@chakra-ui/live-region": "^2.1.0",
|
|
54
54
|
"@internationalized/string-compiler": "^3.2.6",
|
|
55
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
55
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.63",
|
|
56
56
|
"@mittwald/react-use-promise": "^2.6.0",
|
|
57
57
|
"@react-aria/form": "^3.0.12",
|
|
58
58
|
"@react-aria/utils": "^3.27.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@faker-js/faker": "^9.5.0",
|
|
92
92
|
"@internationalized/date": "^3.7.0",
|
|
93
93
|
"@mfalkenberg/remote-dom-react": "^1.2.3",
|
|
94
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
94
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.63",
|
|
95
95
|
"@mittwald/react-use-promise": "^2.6.0",
|
|
96
96
|
"@mittwald/typescript-config": "",
|
|
97
97
|
"@nx/storybook": "^20.4.5",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"optional": true
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "e2ec875a4616bd7eb0ad3437d2ebe6261cad43ce"
|
|
172
172
|
}
|