@socprime/react-ui 0.0.13 → 0.0.14

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": "@socprime/react-ui",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "SOC Prime React UI component library and Storybook design system.",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -46,6 +46,7 @@
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@monaco-editor/react": "^4.7.0",
49
+ "@storybook/addon-docs": "^10.0.0",
49
50
  "@storybook/react-vite": "^10.0.0",
50
51
  "@tanstack/react-table": "^8.21.0",
51
52
  "@xyflow/react": "^12.9.2",
@@ -62,6 +63,9 @@
62
63
  "@monaco-editor/react": {
63
64
  "optional": true
64
65
  },
66
+ "@storybook/addon-docs": {
67
+ "optional": true
68
+ },
65
69
  "@storybook/react-vite": {
66
70
  "optional": true
67
71
  },
@@ -0,0 +1,22 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ Controls,
4
+ Description,
5
+ Primary,
6
+ Stories,
7
+ Subtitle,
8
+ Title
9
+ } from "@storybook/addon-docs/blocks";
10
+ const DocsTemplate = () => {
11
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12
+ /* @__PURE__ */ jsx(Title, {}),
13
+ /* @__PURE__ */ jsx(Subtitle, {}),
14
+ /* @__PURE__ */ jsx(Description, {}),
15
+ /* @__PURE__ */ jsx(Primary, {}),
16
+ /* @__PURE__ */ jsx(Controls, {}),
17
+ /* @__PURE__ */ jsx(Stories, {})
18
+ ] });
19
+ };
20
+ export {
21
+ DocsTemplate
22
+ };
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { withRouter, withTheme } from "../decorators/index.js";
3
3
  import { Toaster } from "../ui/index.js";
4
4
  import { restoreNativeFocus } from "./restoreNativeFocus.js";
5
+ import { DocsTemplate } from "./DocsTemplate.js";
5
6
  function createStorybookPreview() {
6
7
  return {
7
8
  globalTypes: {
@@ -30,7 +31,8 @@ function createStorybookPreview() {
30
31
  }
31
32
  },
32
33
  docs: {
33
- codePanel: true
34
+ codePanel: true,
35
+ page: DocsTemplate
34
36
  },
35
37
  backgrounds: { disable: true },
36
38
  a11y: {
@@ -58,8 +58,10 @@ const Editor = ({
58
58
  });
59
59
  }
60
60
  };
61
- const handleFocus = () => {
62
- editorRef.current?.focus();
61
+ const handleContainerClick = (e) => {
62
+ if (e.target === e.currentTarget) {
63
+ editorRef.current?.focus();
64
+ }
63
65
  };
64
66
  return /* @__PURE__ */ jsxs(
65
67
  "div",
@@ -76,8 +78,7 @@ const Editor = ({
76
78
  className: "h-full",
77
79
  id,
78
80
  "data-name": name,
79
- onFocus: handleFocus,
80
- onClick: handleFocus,
81
+ onClick: handleContainerClick,
81
82
  children: /* @__PURE__ */ jsx(
82
83
  MonacoEditor,
83
84
  {