@gisce/react-ooui 1.1.48 → 1.1.49

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["Separator.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzD,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,KAAK,gBASrC,CAAC"}
1
+ {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["Separator.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAGzD,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,KAAK,gBAcrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.1.48",
3
+ "version": "1.1.49",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -19,3 +19,15 @@ export const Default = (): React.ReactElement => {
19
19
  </LocaleProvider>
20
20
  );
21
21
  };
22
+
23
+ export const WithIcon = (): React.ReactElement => {
24
+ const ooui = new SeparatorOoui({
25
+ string: "General",
26
+ icon: "home"
27
+ });
28
+ return (
29
+ <LocaleProvider lang="en_US">
30
+ <Separator ooui={ooui} showLabel />
31
+ </LocaleProvider>
32
+ );
33
+ };
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
- import { Divider } from "antd";
2
+ import { Divider, Space } from "antd";
3
3
  import { Separator as SeparatorOoui } from "@gisce/ooui";
4
+ import iconMapper from "@/helpers/iconMapper";
4
5
 
5
6
  type Props = {
6
7
  ooui: SeparatorOoui;
@@ -8,11 +9,16 @@ type Props = {
8
9
 
9
10
  export const Separator = (props: Props) => {
10
11
  const { ooui } = props;
11
- const { label } = ooui;
12
+ const { label, icon } = ooui;
13
+ const Icon : React.ElementType | undefined = iconMapper(icon || "");
14
+
12
15
 
13
16
  return (
14
17
  <Divider orientation="left" className="text-sm">
15
- {label}
18
+ <Space>
19
+ {Icon ? <Icon /> : null}
20
+ {label}
21
+ </Space>
16
22
  </Divider>
17
23
  );
18
24
  };