@mittwald/flow-react-components 0.2.0-alpha.604 → 0.2.0-alpha.606
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 +10 -0
- package/dist/assets/doc-properties.json +106 -87
- package/dist/css/all.css +1 -1
- package/dist/js/components/src/components/Message/Message.mjs +3 -2
- package/dist/js/components/src/components/Message/Message.mjs.map +1 -1
- package/dist/types/components/Message/Message.d.ts +1 -0
- package/dist/types/components/Message/Message.d.ts.map +1 -1
- package/dist/types/components/Message/stories/Default.stories.d.ts +2 -0
- package/dist/types/components/Message/stories/Default.stories.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -15,8 +15,9 @@ import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
|
15
15
|
import { ClearPropsContext } from '../../lib/propsContext/components/ClearPropsContext.mjs';
|
|
16
16
|
|
|
17
17
|
const Message = flowComponent("Message", (props) => {
|
|
18
|
-
const { type = "responder", children, className } = props;
|
|
18
|
+
const { type = "responder", children, className, color } = props;
|
|
19
19
|
const rootClassName = clsx(styles.message, styles[type], className);
|
|
20
|
+
const style = color ? { "--message-background": color } : void 0;
|
|
20
21
|
const propsContext = {
|
|
21
22
|
Content: {
|
|
22
23
|
className: styles.content,
|
|
@@ -51,7 +52,7 @@ const Message = flowComponent("Message", (props) => {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
|
-
return /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children: /* @__PURE__ */ jsx("article", { className: rootClassName, children }) });
|
|
55
|
+
return /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children: /* @__PURE__ */ jsx("article", { className: rootClassName, style, children }) });
|
|
55
56
|
});
|
|
56
57
|
|
|
57
58
|
export { Message, Message as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.mjs","sources":["../../../../../../src/components/Message/Message.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./Message.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { IconContextMenu } from \"@/components/Icon/components/icons\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport ClearPropsContext from \"@/lib/propsContext/components/ClearPropsContext\";\n\nexport interface MessageProps\n extends PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps {\n /** Determines the color and orientation of the message. @default \"responder\" */\n type?: \"responder\" | \"sender\";\n}\n\n/** @flr-generate all */\nexport const Message = flowComponent(\"Message\", (props) => {\n const { type = \"responder\", children, className } = props;\n\n const rootClassName = clsx(styles.message, styles[type], className);\n\n const propsContext: PropsContext = {\n Content: {\n className: styles.content,\n children: dynamic((props) => {\n return (\n <>\n <div className={styles.tip} />\n {props.children}\n </>\n );\n }),\n },\n Header: {\n className: styles.header,\n Button: {\n className: styles.action,\n size: \"s\",\n variant: \"plain\",\n color: \"secondary\",\n },\n ContextMenuTrigger: {\n Button: {\n className: styles.action,\n size: \"s\",\n variant: \"plain\",\n color: \"secondary\",\n children: <IconContextMenu />,\n },\n },\n Text: { className: styles.date },\n Align: {\n wrapWith: <ClearPropsContext />,\n className: styles.user,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <article className={rootClassName}
|
|
1
|
+
{"version":3,"file":"Message.mjs","sources":["../../../../../../src/components/Message/Message.tsx"],"sourcesContent":["import type { CSSProperties, PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./Message.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { IconContextMenu } from \"@/components/Icon/components/icons\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport ClearPropsContext from \"@/lib/propsContext/components/ClearPropsContext\";\n\nexport interface MessageProps\n extends PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps {\n /** Determines the color and orientation of the message. @default \"responder\" */\n type?: \"responder\" | \"sender\";\n color?: string;\n}\n\n/** @flr-generate all */\nexport const Message = flowComponent(\"Message\", (props) => {\n const { type = \"responder\", children, className, color } = props;\n\n const rootClassName = clsx(styles.message, styles[type], className);\n\n const style = color\n ? ({ \"--message-background\": color } as CSSProperties)\n : undefined;\n\n const propsContext: PropsContext = {\n Content: {\n className: styles.content,\n children: dynamic((props) => {\n return (\n <>\n <div className={styles.tip} />\n {props.children}\n </>\n );\n }),\n },\n Header: {\n className: styles.header,\n Button: {\n className: styles.action,\n size: \"s\",\n variant: \"plain\",\n color: \"secondary\",\n },\n ContextMenuTrigger: {\n Button: {\n className: styles.action,\n size: \"s\",\n variant: \"plain\",\n color: \"secondary\",\n children: <IconContextMenu />,\n },\n },\n Text: { className: styles.date },\n Align: {\n wrapWith: <ClearPropsContext />,\n className: styles.user,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <article className={rootClassName} style={style}>\n {children}\n </article>\n </PropsContextProvider>\n );\n});\n\nexport default Message;\n"],"names":["props"],"mappings":";;;;;;;;;;;;;;AA0BO,MAAM,OAAA,GAAU,aAAA,CAAc,SAAA,EAAW,CAAC,KAAA,KAAU;AACzD,EAAA,MAAM,EAAE,IAAA,GAAO,WAAA,EAAa,QAAA,EAAU,SAAA,EAAW,OAAM,GAAI,KAAA;AAE3D,EAAA,MAAM,gBAAgB,IAAA,CAAK,MAAA,CAAO,SAAS,MAAA,CAAO,IAAI,GAAG,SAAS,CAAA;AAElE,EAAA,MAAM,KAAA,GAAQ,KAAA,GACT,EAAE,sBAAA,EAAwB,OAAM,GACjC,MAAA;AAEJ,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,QAAA,EAAU,OAAA,CAAQ,CAACA,MAAAA,KAAU;AAC3B,QAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,GAAA,EAAK,CAAA;AAAA,UAC3BA,MAAAA,CAAM;AAAA,SAAA,EACT,CAAA;AAAA,MAEJ,CAAC;AAAA,KACH;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,WAAW,MAAA,CAAO,MAAA;AAAA,MAClB,MAAA,EAAQ;AAAA,QACN,WAAW,MAAA,CAAO,MAAA;AAAA,QAClB,IAAA,EAAM,GAAA;AAAA,QACN,OAAA,EAAS,OAAA;AAAA,QACT,KAAA,EAAO;AAAA,OACT;AAAA,MACA,kBAAA,EAAoB;AAAA,QAClB,MAAA,EAAQ;AAAA,UACN,WAAW,MAAA,CAAO,MAAA;AAAA,UAClB,IAAA,EAAM,GAAA;AAAA,UACN,OAAA,EAAS,OAAA;AAAA,UACT,KAAA,EAAO,WAAA;AAAA,UACP,QAAA,sBAAW,eAAA,EAAA,EAAgB;AAAA;AAC7B,OACF;AAAA,MACA,IAAA,EAAM,EAAE,SAAA,EAAW,MAAA,CAAO,IAAA,EAAK;AAAA,MAC/B,KAAA,EAAO;AAAA,QACL,QAAA,sBAAW,iBAAA,EAAA,EAAkB,CAAA;AAAA,QAC7B,WAAW,MAAA,CAAO;AAAA;AACpB;AACF,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,aAAQ,SAAA,EAAW,aAAA,EAAe,KAAA,EAChC,QAAA,EACH,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -4,6 +4,7 @@ import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
|
|
|
4
4
|
export interface MessageProps extends PropsWithChildren, PropsWithClassName, FlowComponentProps {
|
|
5
5
|
/** Determines the color and orientation of the message. @default "responder" */
|
|
6
6
|
type?: "responder" | "sender";
|
|
7
|
+
color?: string;
|
|
7
8
|
}
|
|
8
9
|
/** @flr-generate all */
|
|
9
10
|
export declare const Message: import('react').FunctionComponent<MessageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/components/Message/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/components/Message/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAO5D,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAG9C,MAAM,WAAW,YACf,SAAQ,iBAAiB,EACvB,kBAAkB,EAClB,kBAAkB;IACpB,gFAAgF;IAChF,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAwB;AACxB,eAAO,MAAM,OAAO,iGAqDlB,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -6,4 +6,6 @@ type Story = StoryObj<typeof Message>;
|
|
|
6
6
|
export declare const Default: Story;
|
|
7
7
|
export declare const Sender: Story;
|
|
8
8
|
export declare const MessageOnly: Story;
|
|
9
|
+
export declare const CustomColor: Story;
|
|
10
|
+
export declare const SenderCustomColor: Story;
|
|
9
11
|
//# sourceMappingURL=Default.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Message/stories/Default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAW/C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAiC9B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,MAAM,EAAE,KAAoC,CAAC;AAE1D,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Message/stories/Default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAW/C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAiC9B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,MAAM,EAAE,KAAoC,CAAC;AAE1D,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAE/B,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.606",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@internationalized/string-compiler": "^3.2.6",
|
|
62
62
|
"@mittwald/password-tools-js": "3.0.0-alpha.18",
|
|
63
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
63
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.606",
|
|
64
64
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
65
65
|
"@react-aria/form": "^3.1.2",
|
|
66
66
|
"@react-aria/live-announcer": "^3.4.4",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@faker-js/faker": "^10.1.0",
|
|
106
106
|
"@internationalized/date": "^3.10.0",
|
|
107
107
|
"@mittwald/flow-core": "",
|
|
108
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
108
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.606",
|
|
109
109
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
110
110
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
111
111
|
"@mittwald/typescript-config": "",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"optional": true
|
|
175
175
|
}
|
|
176
176
|
},
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "77bc10e4fe30b6c9449adc4bf3ead8f88c21d4bd"
|
|
178
178
|
}
|