@mittwald/flow-react-components 0.2.0-alpha.76 → 0.2.0-alpha.78

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.
@@ -4,16 +4,16 @@ const align = "flow--align";
4
4
  const avatar = "flow--align--avatar";
5
5
  const text = "flow--align--text";
6
6
  const button = "flow--align--button";
7
- const copyButton = "flow--align--copy-button";
8
7
  const contextualHelpTriggerButton = "flow--align--contextual-help-trigger-button";
8
+ const copyButton = "flow--align--copy-button";
9
9
  const icon = "flow--align--icon";
10
10
  const styles = {
11
11
  align: align,
12
12
  avatar: avatar,
13
13
  text: text,
14
14
  button: button,
15
- copyButton: copyButton,
16
15
  contextualHelpTriggerButton: contextualHelpTriggerButton,
16
+ copyButton: copyButton,
17
17
  icon: icon
18
18
  };
19
19
 
@@ -41,7 +41,7 @@ const Notification = (props) => {
41
41
  className: styles.heading,
42
42
  level: 4,
43
43
  children: dynamic((props2) => /* @__PURE__ */ jsxs(Fragment, { children: [
44
- /* @__PURE__ */ jsx(AlertIcon, { status }),
44
+ /* @__PURE__ */ jsx(AlertIcon, { status, className: styles.icon }),
45
45
  props2.children
46
46
  ] }))
47
47
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.mjs","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { Link } from \"@/components/Link\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport styles from \"./Notification.module.scss\";\n\nexport interface NotificationProps\n extends PropsWithChildren<ComponentProps<\"div\">>,\n PropsWithStatus {\n /** A link that is triggered when clicking the notification. */\n href?: string;\n /** Whether the notification should disappear automatically after some time. */\n autoClose?: boolean;\n /** Handler that is called when the notification is clicked. */\n onClick?: () => void;\n /**\n * Handler that is called when the close button of the notification is\n * clicked.\n */\n onClose?: () => void;\n}\n\n/** @flr-generate all */\nexport const Notification: FC<NotificationProps> = (props) => {\n const {\n children,\n className,\n status = \"info\",\n role = \"alert\",\n href,\n onClick,\n onClose,\n autoClose: ignoredAutoClose,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.notification,\n styles[status],\n (onClick || onClose || href) && styles.hasLink,\n className,\n );\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 4,\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} />\n {props.children}\n </>\n )),\n },\n Text: {\n className: styles.text,\n },\n };\n\n const closeButton = onClose && (\n <Button\n size=\"s\"\n className={styles.close}\n variant=\"plain\"\n color=\"secondary\"\n onPress={onClose}\n >\n <IconClose />\n </Button>\n );\n\n return (\n <div {...rest} className={rootClassName} role={role}>\n <Link unstyled href={href} className={styles.link} onPress={onClick}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Link>\n {closeButton}\n </div>\n );\n};\n\nexport default Notification;\n"],"names":["props"],"mappings":";;;;;;;;;;;;;;;;;;AA4Ba,MAAA,YAAA,GAAsC,CAAC,KAAU,KAAA;AAC5D,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAS,GAAA,MAAA;AAAA,IACT,IAAO,GAAA,OAAA;AAAA,IACP,IAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAW,EAAA,gBAAA;AAAA,IACX,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,YAAA;AAAA,IACP,OAAO,MAAM,CAAA;AAAA,IACZ,CAAA,OAAA,IAAW,OAAW,IAAA,IAAA,KAAS,MAAO,CAAA,OAAA;AAAA,IACvC;AAAA,GACF;AAEA,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,OAAS,EAAA;AAAA,MACP,WAAW,MAAO,CAAA,OAAA;AAAA,MAClB,KAAO,EAAA,CAAA;AAAA,MACP,QAAU,EAAA,OAAA,CAAQ,CAACA,MAAAA,qBAEf,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,aAAU,MAAgB,EAAA,CAAA;AAAA,QAC1BA,MAAM,CAAA;AAAA,OAAA,EACT,CACD;AAAA,KACH;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,WAAW,MAAO,CAAA;AAAA;AACpB,GACF;AAEA,EAAA,MAAM,cAAc,OAClB,oBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,GAAA;AAAA,MACL,WAAW,MAAO,CAAA,KAAA;AAAA,MAClB,OAAQ,EAAA,OAAA;AAAA,MACR,KAAM,EAAA,WAAA;AAAA,MACN,OAAS,EAAA,OAAA;AAAA,MAET,8BAAC,SAAU,EAAA,EAAA;AAAA;AAAA,GACb;AAGF,EAAA,4BACG,KAAK,EAAA,EAAA,GAAG,IAAM,EAAA,SAAA,EAAW,eAAe,IACvC,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,QAAA,EAAQ,IAAC,EAAA,IAAA,EAAY,WAAW,MAAO,CAAA,IAAA,EAAM,OAAS,EAAA,OAAA,EAC1D,QAAC,kBAAA,GAAA,CAAA,oBAAA,EAAA,EAAqB,KAAO,EAAA,YAAA,EAC1B,UACH,CACF,EAAA,CAAA;AAAA,IACC;AAAA,GACH,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Notification.mjs","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { Link } from \"@/components/Link\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport styles from \"./Notification.module.scss\";\n\nexport interface NotificationProps\n extends PropsWithChildren<ComponentProps<\"div\">>,\n PropsWithStatus {\n /** A link that is triggered when clicking the notification. */\n href?: string;\n /** Whether the notification should disappear automatically after some time. */\n autoClose?: boolean;\n /** Handler that is called when the notification is clicked. */\n onClick?: () => void;\n /**\n * Handler that is called when the close button of the notification is\n * clicked.\n */\n onClose?: () => void;\n}\n\n/** @flr-generate all */\nexport const Notification: FC<NotificationProps> = (props) => {\n const {\n children,\n className,\n status = \"info\",\n role = \"alert\",\n href,\n onClick,\n onClose,\n autoClose: ignoredAutoClose,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.notification,\n styles[status],\n (onClick || onClose || href) && styles.hasLink,\n className,\n );\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 4,\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Text: {\n className: styles.text,\n },\n };\n\n const closeButton = onClose && (\n <Button\n size=\"s\"\n className={styles.close}\n variant=\"plain\"\n color=\"secondary\"\n onPress={onClose}\n >\n <IconClose />\n </Button>\n );\n\n return (\n <div {...rest} className={rootClassName} role={role}>\n <Link unstyled href={href} className={styles.link} onPress={onClick}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Link>\n {closeButton}\n </div>\n );\n};\n\nexport default Notification;\n"],"names":["props"],"mappings":";;;;;;;;;;;;;;;;;;AA4Ba,MAAA,YAAA,GAAsC,CAAC,KAAU,KAAA;AAC5D,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAS,GAAA,MAAA;AAAA,IACT,IAAO,GAAA,OAAA;AAAA,IACP,IA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AAS,EAAA,OAAA,EAC1D,QAAC,kBAAA,GAAA,CAAA,oBAAA,EAAA,EAAqB,KAAO,EAAA,YAAA,EAC1B,UACH,CACF,EAAA,CAAA;AAAA,IACC;AAAA,GACH,EAAA,CAAA;AAEJ;;;;"}
@@ -3,6 +3,7 @@
3
3
  const notification = "flow--notification";
4
4
  const link = "flow--notification--link";
5
5
  const heading = "flow--notification--heading";
6
+ const icon = "flow--notification--icon";
6
7
  const text = "flow--notification--text";
7
8
  const close = "flow--notification--close";
8
9
  const info = "flow--notification--info";
@@ -14,6 +15,7 @@ const styles = {
14
15
  notification: notification,
15
16
  link: link,
16
17
  heading: heading,
18
+ icon: icon,
17
19
  text: text,
18
20
  close: close,
19
21
  info: info,
@@ -23,5 +25,5 @@ const styles = {
23
25
  success: success
24
26
  };
25
27
 
26
- export { close, danger, styles as default, hasLink, heading, info, link, notification, success, text, warning };
28
+ export { close, danger, styles as default, hasLink, heading, icon, info, link, notification, success, text, warning };
27
29
  //# sourceMappingURL=Notification.module.scss.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Notification.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.76",
3
+ "version": "0.2.0-alpha.78",
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.76",
55
+ "@mittwald/react-tunnel": "0.2.0-alpha.78",
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.2",
94
- "@mittwald/flow-design-tokens": "0.2.0-alpha.76",
94
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.78",
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": "fb677cf38210c6dfe3018ab2e40cd9033eff801c"
171
+ "gitHead": "610e684130a0ce61b79131e62d1036a6a86437d0"
172
172
  }