@gisce/react-ooui 1.1.25 → 1.1.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -39,7 +39,7 @@
39
39
  "@gisce/ooui": "^0.17.12",
40
40
  "@gisce/react-formiga-table": "^0.5.0",
41
41
  "@monaco-editor/react": "^4.4.5",
42
- "@tabler/icons": "^1.96.0",
42
+ "@tabler/icons-react": "^2.11.0",
43
43
  "antd": "^4.12.3",
44
44
  "buffer": "^6.0.3",
45
45
  "fiber-diagram": "github:gisce/fiber-diagram",
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import * as AntIcons from "@ant-design/icons";
3
- import * as TablerIcons from "@tabler/icons";
3
+ import * as TablerIcons from "@tabler/icons-react";
4
+ import Icon from "@ant-design/icons";
4
5
 
5
6
  type TablerKey = keyof typeof TablerIcons;
6
7
  type AntKey = keyof typeof AntIcons;
@@ -131,7 +132,17 @@ function getIconForKey(key: string) {
131
132
 
132
133
  const tablerKey: TablerKey = `Icon${IconCamelCase}` as any;
133
134
  if (TablerIcons[tablerKey]) {
134
- return TablerIcons[tablerKey];
135
+ const TablerIcon = () =>
136
+ React.createElement(TablerIcons[tablerKey] as any, {
137
+ fill: "transparent",
138
+ height: 17,
139
+ width: 17,
140
+ });
141
+ const CustomIcon = () =>
142
+ React.createElement(Icon, {
143
+ component: TablerIcon,
144
+ });
145
+ return CustomIcon;
135
146
  }
136
147
 
137
148
  return undefined;
@@ -167,3 +167,30 @@ export const IconTabs = (): React.ReactElement => {
167
167
  </LocaleProvider>
168
168
  );
169
169
  };
170
+
171
+
172
+ export const IconTablerTabs = (): React.ReactElement => {
173
+
174
+ const arch = `<form>
175
+ <notebook name="notebook">
176
+ <page string="Home" icon="bolt">
177
+ <field name="name" />
178
+ </page>
179
+ <page string="Attributes" icon="address-book">
180
+ <field name="surname" />
181
+ </page>
182
+ </notebook>
183
+ </form>`;
184
+
185
+ const formOoui = new FormOoui(fields);
186
+ formOoui.parse(arch);
187
+ const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
188
+
189
+ return (
190
+ <LocaleProvider lang="en_US">
191
+ <Form>
192
+ <Notebook ooui={notebookOoui} />
193
+ </Form>
194
+ </LocaleProvider>
195
+ );
196
+ };