@x-plat/design-system 0.1.1

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.
Files changed (165) hide show
  1. package/README.md +123 -0
  2. package/dist/attributes-DJIWir_0.d.cts +7 -0
  3. package/dist/attributes-DJIWir_0.d.ts +7 -0
  4. package/dist/breakpoints-DsXkJgdl.d.cts +35 -0
  5. package/dist/breakpoints-DsXkJgdl.d.ts +35 -0
  6. package/dist/colors-BG91q_uV.d.cts +133 -0
  7. package/dist/colors-BG91q_uV.d.ts +133 -0
  8. package/dist/components/Button/index.cjs +203 -0
  9. package/dist/components/Button/index.css +1231 -0
  10. package/dist/components/Button/index.d.cts +132 -0
  11. package/dist/components/Button/index.d.ts +132 -0
  12. package/dist/components/Button/index.js +176 -0
  13. package/dist/components/Card/index.cjs +56 -0
  14. package/dist/components/Card/index.css +27 -0
  15. package/dist/components/Card/index.d.cts +13 -0
  16. package/dist/components/Card/index.d.ts +13 -0
  17. package/dist/components/Card/index.js +29 -0
  18. package/dist/components/Chart/index.cjs +393 -0
  19. package/dist/components/Chart/index.css +4 -0
  20. package/dist/components/Chart/index.d.cts +10 -0
  21. package/dist/components/Chart/index.d.ts +10 -0
  22. package/dist/components/Chart/index.js +367 -0
  23. package/dist/components/CheckBox/index.cjs +1116 -0
  24. package/dist/components/CheckBox/index.css +598 -0
  25. package/dist/components/CheckBox/index.d.cts +132 -0
  26. package/dist/components/CheckBox/index.d.ts +132 -0
  27. package/dist/components/CheckBox/index.js +1089 -0
  28. package/dist/components/Chip/index.cjs +193 -0
  29. package/dist/components/Chip/index.css +1227 -0
  30. package/dist/components/Chip/index.d.cts +132 -0
  31. package/dist/components/Chip/index.d.ts +132 -0
  32. package/dist/components/Chip/index.js +166 -0
  33. package/dist/components/DatePicker/index.cjs +1653 -0
  34. package/dist/components/DatePicker/index.css +1417 -0
  35. package/dist/components/DatePicker/index.d.cts +56 -0
  36. package/dist/components/DatePicker/index.d.ts +56 -0
  37. package/dist/components/DatePicker/index.js +1613 -0
  38. package/dist/components/HtmlTypeWriter/index.cjs +172 -0
  39. package/dist/components/HtmlTypeWriter/index.css +23 -0
  40. package/dist/components/HtmlTypeWriter/index.d.cts +14 -0
  41. package/dist/components/HtmlTypeWriter/index.d.ts +14 -0
  42. package/dist/components/HtmlTypeWriter/index.js +135 -0
  43. package/dist/components/ImageSelector/index.cjs +1063 -0
  44. package/dist/components/ImageSelector/index.css +85 -0
  45. package/dist/components/ImageSelector/index.d.cts +10 -0
  46. package/dist/components/ImageSelector/index.d.ts +10 -0
  47. package/dist/components/ImageSelector/index.js +1026 -0
  48. package/dist/components/Input/index.cjs +410 -0
  49. package/dist/components/Input/index.css +74 -0
  50. package/dist/components/Input/index.d.cts +23 -0
  51. package/dist/components/Input/index.d.ts +23 -0
  52. package/dist/components/Input/index.js +372 -0
  53. package/dist/components/Modal/index.cjs +101 -0
  54. package/dist/components/Modal/index.css +39 -0
  55. package/dist/components/Modal/index.d.cts +16 -0
  56. package/dist/components/Modal/index.d.ts +16 -0
  57. package/dist/components/Modal/index.js +64 -0
  58. package/dist/components/PopOver/index.cjs +176 -0
  59. package/dist/components/PopOver/index.css +27 -0
  60. package/dist/components/PopOver/index.d.cts +15 -0
  61. package/dist/components/PopOver/index.d.ts +15 -0
  62. package/dist/components/PopOver/index.js +139 -0
  63. package/dist/components/Radio/index.cjs +257 -0
  64. package/dist/components/Radio/index.css +777 -0
  65. package/dist/components/Radio/index.d.cts +154 -0
  66. package/dist/components/Radio/index.d.ts +154 -0
  67. package/dist/components/Radio/index.js +219 -0
  68. package/dist/components/Select/index.cjs +1203 -0
  69. package/dist/components/Select/index.css +136 -0
  70. package/dist/components/Select/index.d.cts +44 -0
  71. package/dist/components/Select/index.d.ts +44 -0
  72. package/dist/components/Select/index.js +1165 -0
  73. package/dist/components/Swiper/index.cjs +144 -0
  74. package/dist/components/Swiper/index.d.cts +24 -0
  75. package/dist/components/Swiper/index.d.ts +24 -0
  76. package/dist/components/Swiper/index.js +128 -0
  77. package/dist/components/Switch/index.cjs +240 -0
  78. package/dist/components/Switch/index.css +780 -0
  79. package/dist/components/Switch/index.d.cts +131 -0
  80. package/dist/components/Switch/index.d.ts +131 -0
  81. package/dist/components/Switch/index.js +203 -0
  82. package/dist/components/Tab/index.cjs +122 -0
  83. package/dist/components/Tab/index.css +59 -0
  84. package/dist/components/Tab/index.d.cts +18 -0
  85. package/dist/components/Tab/index.d.ts +18 -0
  86. package/dist/components/Tab/index.js +85 -0
  87. package/dist/components/Table/index.cjs +384 -0
  88. package/dist/components/Table/index.css +4093 -0
  89. package/dist/components/Table/index.d.cts +174 -0
  90. package/dist/components/Table/index.d.ts +174 -0
  91. package/dist/components/Table/index.js +343 -0
  92. package/dist/components/TextArea/index.cjs +114 -0
  93. package/dist/components/TextArea/index.css +34 -0
  94. package/dist/components/TextArea/index.d.cts +6 -0
  95. package/dist/components/TextArea/index.d.ts +6 -0
  96. package/dist/components/TextArea/index.js +77 -0
  97. package/dist/components/Tooltip/index.cjs +210 -0
  98. package/dist/components/Tooltip/index.css +599 -0
  99. package/dist/components/Tooltip/index.d.cts +134 -0
  100. package/dist/components/Tooltip/index.d.ts +134 -0
  101. package/dist/components/Tooltip/index.js +173 -0
  102. package/dist/components/Video/index.cjs +269 -0
  103. package/dist/components/Video/index.css +71 -0
  104. package/dist/components/Video/index.d.cts +15 -0
  105. package/dist/components/Video/index.d.ts +15 -0
  106. package/dist/components/Video/index.js +232 -0
  107. package/dist/components/index.cjs +3221 -0
  108. package/dist/components/index.css +9972 -0
  109. package/dist/components/index.d.cts +23 -0
  110. package/dist/components/index.d.ts +23 -0
  111. package/dist/components/index.js +3167 -0
  112. package/dist/index.cjs +8216 -0
  113. package/dist/index.css +10087 -0
  114. package/dist/index.d.cts +31 -0
  115. package/dist/index.d.ts +31 -0
  116. package/dist/index.js +7855 -0
  117. package/dist/layout/Grid/FullGrid/index.cjs +54 -0
  118. package/dist/layout/Grid/FullGrid/index.css +21 -0
  119. package/dist/layout/Grid/FullGrid/index.d.cts +9 -0
  120. package/dist/layout/Grid/FullGrid/index.d.ts +9 -0
  121. package/dist/layout/Grid/FullGrid/index.js +27 -0
  122. package/dist/layout/Grid/FullScreen/index.cjs +54 -0
  123. package/dist/layout/Grid/FullScreen/index.css +23 -0
  124. package/dist/layout/Grid/FullScreen/index.d.cts +9 -0
  125. package/dist/layout/Grid/FullScreen/index.d.ts +9 -0
  126. package/dist/layout/Grid/FullScreen/index.js +27 -0
  127. package/dist/layout/Grid/GapGrid/index.cjs +32 -0
  128. package/dist/layout/Grid/GapGrid/index.d.cts +12 -0
  129. package/dist/layout/Grid/GapGrid/index.d.ts +12 -0
  130. package/dist/layout/Grid/GapGrid/index.js +11 -0
  131. package/dist/layout/Grid/Item/index.cjs +71 -0
  132. package/dist/layout/Grid/Item/index.css +19 -0
  133. package/dist/layout/Grid/Item/index.d.cts +20 -0
  134. package/dist/layout/Grid/Item/index.d.ts +20 -0
  135. package/dist/layout/Grid/Item/index.js +44 -0
  136. package/dist/layout/Grid/index.cjs +95 -0
  137. package/dist/layout/Grid/index.css +65 -0
  138. package/dist/layout/Grid/index.d.cts +5 -0
  139. package/dist/layout/Grid/index.d.ts +5 -0
  140. package/dist/layout/Grid/index.js +65 -0
  141. package/dist/layout/Header/index.cjs +45 -0
  142. package/dist/layout/Header/index.css +11 -0
  143. package/dist/layout/Header/index.d.cts +10 -0
  144. package/dist/layout/Header/index.d.ts +10 -0
  145. package/dist/layout/Header/index.js +18 -0
  146. package/dist/layout/Layout/index.cjs +44 -0
  147. package/dist/layout/Layout/index.css +23 -0
  148. package/dist/layout/Layout/index.d.cts +15 -0
  149. package/dist/layout/Layout/index.d.ts +15 -0
  150. package/dist/layout/Layout/index.js +17 -0
  151. package/dist/layout/SideBar/index.cjs +101 -0
  152. package/dist/layout/SideBar/index.css +10 -0
  153. package/dist/layout/SideBar/index.d.cts +16 -0
  154. package/dist/layout/SideBar/index.d.ts +16 -0
  155. package/dist/layout/SideBar/index.js +62 -0
  156. package/dist/layout/index.cjs +188 -0
  157. package/dist/layout/index.css +112 -0
  158. package/dist/layout/index.d.cts +8 -0
  159. package/dist/layout/index.d.ts +8 -0
  160. package/dist/layout/index.js +143 -0
  161. package/dist/tokens/index.cjs +6225 -0
  162. package/dist/tokens/index.d.cts +593 -0
  163. package/dist/tokens/index.d.ts +593 -0
  164. package/dist/tokens/index.js +5900 -0
  165. package/package.json +86 -0
@@ -0,0 +1,5 @@
1
+ export { FullGrid } from './FullGrid/index.js';
2
+ export { FullScreen } from './FullScreen/index.js';
3
+ export { GridItem } from './Item/index.js';
4
+ export { B as BREAKPOINT_KEYS_ORDERED, a as BreakpointKey, b as GridColumnConfig, G as GridSpanFor } from '../../breakpoints-DsXkJgdl.js';
5
+ import 'react';
@@ -0,0 +1,65 @@
1
+ // node_modules/clsx/dist/clsx.mjs
2
+ function r(e) {
3
+ var t, f, n = "";
4
+ if ("string" == typeof e || "number" == typeof e) n += e;
5
+ else if ("object" == typeof e) if (Array.isArray(e)) {
6
+ var o = e.length;
7
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
8
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
9
+ return n;
10
+ }
11
+ function clsx() {
12
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
13
+ return n;
14
+ }
15
+ var clsx_default = clsx;
16
+
17
+ // src/layout/Grid/FullGrid/FullGrid.tsx
18
+ import { jsx } from "react/jsx-runtime";
19
+ var FullGrid = (props) => {
20
+ const { children, className } = props;
21
+ return /* @__PURE__ */ jsx("div", { className: clsx_default("lib-xplat-full-grid", className), children });
22
+ };
23
+ FullGrid.displayName = "FullGrid";
24
+ var FullGrid_default = FullGrid;
25
+
26
+ // src/layout/Grid/FullScreen/FullScreen.tsx
27
+ import { jsx as jsx2 } from "react/jsx-runtime";
28
+ var FullScreen = (props) => {
29
+ const { children, className } = props;
30
+ return /* @__PURE__ */ jsx2("div", { className: clsx_default("lib-xplat-full-screen", className), children });
31
+ };
32
+ FullScreen.displayName = "FullScreen";
33
+ var FullScreen_default = FullScreen;
34
+
35
+ // src/tokens/breakpoints.ts
36
+ var BREAKPOINT_KEYS_ORDERED = ["laptop", "tablet", "mobile"];
37
+
38
+ // src/layout/Grid/Item/Item.tsx
39
+ import { jsx as jsx3 } from "react/jsx-runtime";
40
+ var calculateSpans = (column) => {
41
+ const spans = {};
42
+ let inherited = column.default;
43
+ for (const key of BREAKPOINT_KEYS_ORDERED) {
44
+ inherited = column[key] ?? inherited;
45
+ spans[key] = inherited;
46
+ }
47
+ return spans;
48
+ };
49
+ var GridItem = ({ column, children, className }) => {
50
+ const spans = calculateSpans(column);
51
+ const style = {};
52
+ style["--column-default"] = spans[BREAKPOINT_KEYS_ORDERED[0]];
53
+ Object.entries(spans).forEach(([key, value]) => {
54
+ style[`--column-${key}`] = value;
55
+ });
56
+ return /* @__PURE__ */ jsx3("div", { className: clsx_default("lib-xplat-grid-item", className), style, children });
57
+ };
58
+ GridItem.displayName = "GridItem";
59
+ var Item_default = GridItem;
60
+ export {
61
+ BREAKPOINT_KEYS_ORDERED,
62
+ FullGrid_default as FullGrid,
63
+ FullScreen_default as FullScreen,
64
+ Item_default as GridItem
65
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/layout/Header/index.ts
21
+ var Header_exports = {};
22
+ __export(Header_exports, {
23
+ Header: () => Header_default
24
+ });
25
+ module.exports = __toCommonJS(Header_exports);
26
+
27
+ // src/layout/Header/Header.tsx
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ var Header = ({
30
+ logo,
31
+ centerContent,
32
+ rightContent
33
+ }) => {
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "lib-xplat-layout-header", children: [
35
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: logo }),
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: centerContent }),
37
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: rightContent })
38
+ ] });
39
+ };
40
+ Header.displayName = "Header";
41
+ var Header_default = Header;
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ Header
45
+ });
@@ -0,0 +1,11 @@
1
+ /* src/layout/Header/header.scss */
2
+ .lib-xplat-layout-header {
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: space-between;
6
+ padding: 16px;
7
+ border-bottom: 1px solid #E5E5E5;
8
+ background-color: #FFFFFF;
9
+ width: 100%;
10
+ box-sizing: border-box;
11
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+
3
+ interface HeaderProps {
4
+ logo?: React.ReactNode;
5
+ centerContent?: React.ReactElement;
6
+ rightContent?: React.ReactElement;
7
+ }
8
+ declare const Header: React.FC<HeaderProps>;
9
+
10
+ export { Header };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+
3
+ interface HeaderProps {
4
+ logo?: React.ReactNode;
5
+ centerContent?: React.ReactElement;
6
+ rightContent?: React.ReactElement;
7
+ }
8
+ declare const Header: React.FC<HeaderProps>;
9
+
10
+ export { Header };
@@ -0,0 +1,18 @@
1
+ // src/layout/Header/Header.tsx
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ var Header = ({
4
+ logo,
5
+ centerContent,
6
+ rightContent
7
+ }) => {
8
+ return /* @__PURE__ */ jsxs("div", { className: "lib-xplat-layout-header", children: [
9
+ /* @__PURE__ */ jsx("div", { children: logo }),
10
+ /* @__PURE__ */ jsx("div", { children: centerContent }),
11
+ /* @__PURE__ */ jsx("div", { children: rightContent })
12
+ ] });
13
+ };
14
+ Header.displayName = "Header";
15
+ var Header_default = Header;
16
+ export {
17
+ Header_default as Header
18
+ };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/layout/Layout/index.ts
21
+ var Layout_exports = {};
22
+ __export(Layout_exports, {
23
+ Layout: () => Layout_default
24
+ });
25
+ module.exports = __toCommonJS(Layout_exports);
26
+
27
+ // src/layout/Layout/Layout.tsx
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ var Layout = (props) => {
30
+ const { header, sideBar, children } = props;
31
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "lib-xplat-layout-content-wrapper", children: [
32
+ sideBar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: sideBar }),
33
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "lib-xplat-layout-content", children: [
34
+ header && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "lib-xplat-layout-conent-header", children: header }),
35
+ children
36
+ ] })
37
+ ] }) });
38
+ };
39
+ Layout.displayName = "Layout";
40
+ var Layout_default = Layout;
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ Layout
44
+ });
@@ -0,0 +1,23 @@
1
+ /* src/layout/Layout/layout.scss */
2
+ .lib-xplat-layout {
3
+ width: 100vw;
4
+ height: 100vh;
5
+ overflow: hidden;
6
+ background-color: #FAFAFA;
7
+ }
8
+ .lib-xplat-layout > .lib-xplat-layout-content-wrapper {
9
+ display: flex;
10
+ height: 100%;
11
+ }
12
+ .lib-xplat-layout > .lib-xplat-layout-content-wrapper > .lib-xplat-layout-content {
13
+ flex: 1;
14
+ overflow: auto;
15
+ width: 100%;
16
+ display: flex;
17
+ flex-direction: column;
18
+ }
19
+ .lib-xplat-layout > .lib-xplat-layout-content-wrapper > .lib-xplat-layout-content > .lib-xplat-layout-conent-header {
20
+ position: sticky;
21
+ top: 0;
22
+ z-index: 10;
23
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Header } from '../Header/index.cjs';
3
+
4
+ interface SidebarChildProps {
5
+ handleSwitchSideBar: () => void;
6
+ [key: string]: unknown;
7
+ }
8
+ interface LayoutProps {
9
+ header?: React.ReactElement<typeof Header>;
10
+ sideBar?: React.ReactElement<SidebarChildProps>;
11
+ children?: React.ReactNode;
12
+ }
13
+ declare const Layout: React.FC<LayoutProps>;
14
+
15
+ export { Layout };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Header } from '../Header/index.js';
3
+
4
+ interface SidebarChildProps {
5
+ handleSwitchSideBar: () => void;
6
+ [key: string]: unknown;
7
+ }
8
+ interface LayoutProps {
9
+ header?: React.ReactElement<typeof Header>;
10
+ sideBar?: React.ReactElement<SidebarChildProps>;
11
+ children?: React.ReactNode;
12
+ }
13
+ declare const Layout: React.FC<LayoutProps>;
14
+
15
+ export { Layout };
@@ -0,0 +1,17 @@
1
+ // src/layout/Layout/Layout.tsx
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ var Layout = (props) => {
4
+ const { header, sideBar, children } = props;
5
+ return /* @__PURE__ */ jsx("div", { className: "lib-xplat-layout", children: /* @__PURE__ */ jsxs("div", { className: "lib-xplat-layout-content-wrapper", children: [
6
+ sideBar && /* @__PURE__ */ jsx(Fragment, { children: sideBar }),
7
+ /* @__PURE__ */ jsxs("div", { className: "lib-xplat-layout-content", children: [
8
+ header && /* @__PURE__ */ jsx("div", { className: "lib-xplat-layout-conent-header", children: header }),
9
+ children
10
+ ] })
11
+ ] }) });
12
+ };
13
+ Layout.displayName = "Layout";
14
+ var Layout_default = Layout;
15
+ export {
16
+ Layout_default as Layout
17
+ };
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/layout/SideBar/index.ts
31
+ var SideBar_exports = {};
32
+ __export(SideBar_exports, {
33
+ SideBar: () => SideBar_default,
34
+ SideBarContext: () => SideBarContext_default,
35
+ useSideBarContext: () => useSideBarContext
36
+ });
37
+ module.exports = __toCommonJS(SideBar_exports);
38
+
39
+ // src/layout/SideBar/SideBar.tsx
40
+ var import_react2 = __toESM(require("react"), 1);
41
+
42
+ // node_modules/clsx/dist/clsx.mjs
43
+ function r(e) {
44
+ var t, f, n = "";
45
+ if ("string" == typeof e || "number" == typeof e) n += e;
46
+ else if ("object" == typeof e) if (Array.isArray(e)) {
47
+ var o = e.length;
48
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
49
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
50
+ return n;
51
+ }
52
+ function clsx() {
53
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
54
+ return n;
55
+ }
56
+ var clsx_default = clsx;
57
+
58
+ // src/layout/SideBar/SideBarContext.tsx
59
+ var import_react = __toESM(require("react"), 1);
60
+ var SideBarContext = import_react.default.createContext(null);
61
+ var useSideBarContext = () => {
62
+ const ctx = import_react.default.useContext(SideBarContext);
63
+ if (!ctx) throw new Error("Error");
64
+ return ctx;
65
+ };
66
+ var SideBarContext_default = SideBarContext;
67
+
68
+ // src/layout/SideBar/SideBar.tsx
69
+ var import_jsx_runtime = require("react/jsx-runtime");
70
+ var SideBar = (props) => {
71
+ const { children, className } = props;
72
+ const [isOpen, setIsOpen] = import_react2.default.useState(true);
73
+ const handleSwitchSideBar = () => {
74
+ setIsOpen((prev) => !prev);
75
+ };
76
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
77
+ SideBarContext_default.Provider,
78
+ {
79
+ value: { isSidebarOpen: isOpen, handleSwitchSideBar },
80
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
81
+ "div",
82
+ {
83
+ className: clsx_default(
84
+ "lib-xplat-layout-sidebar",
85
+ isOpen ? "large" : "small",
86
+ className
87
+ ),
88
+ children
89
+ }
90
+ )
91
+ }
92
+ );
93
+ };
94
+ SideBar.displayName = "SideBar";
95
+ var SideBar_default = SideBar;
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ SideBar,
99
+ SideBarContext,
100
+ useSideBarContext
101
+ });
@@ -0,0 +1,10 @@
1
+ /* src/layout/SideBar/sidebar.scss */
2
+ .lib-xplat-layout-sidebar {
3
+ transition: all 0.3s ease-in-out;
4
+ }
5
+ .lib-xplat-layout-sidebar.large {
6
+ width: 260px;
7
+ }
8
+ .lib-xplat-layout-sidebar.small {
9
+ width: 72px;
10
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+
3
+ interface SideBarProps {
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ }
7
+ declare const SideBar: React.FC<SideBarProps>;
8
+
9
+ interface SideBarContextProps {
10
+ isSidebarOpen: boolean;
11
+ handleSwitchSideBar: () => void;
12
+ }
13
+ declare const SideBarContext: React.Context<SideBarContextProps | null>;
14
+ declare const useSideBarContext: () => SideBarContextProps;
15
+
16
+ export { SideBar, SideBarContext, useSideBarContext };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+
3
+ interface SideBarProps {
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ }
7
+ declare const SideBar: React.FC<SideBarProps>;
8
+
9
+ interface SideBarContextProps {
10
+ isSidebarOpen: boolean;
11
+ handleSwitchSideBar: () => void;
12
+ }
13
+ declare const SideBarContext: React.Context<SideBarContextProps | null>;
14
+ declare const useSideBarContext: () => SideBarContextProps;
15
+
16
+ export { SideBar, SideBarContext, useSideBarContext };
@@ -0,0 +1,62 @@
1
+ // src/layout/SideBar/SideBar.tsx
2
+ import React2 from "react";
3
+
4
+ // node_modules/clsx/dist/clsx.mjs
5
+ function r(e) {
6
+ var t, f, n = "";
7
+ if ("string" == typeof e || "number" == typeof e) n += e;
8
+ else if ("object" == typeof e) if (Array.isArray(e)) {
9
+ var o = e.length;
10
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
11
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
12
+ return n;
13
+ }
14
+ function clsx() {
15
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
16
+ return n;
17
+ }
18
+ var clsx_default = clsx;
19
+
20
+ // src/layout/SideBar/SideBarContext.tsx
21
+ import React from "react";
22
+ var SideBarContext = React.createContext(null);
23
+ var useSideBarContext = () => {
24
+ const ctx = React.useContext(SideBarContext);
25
+ if (!ctx) throw new Error("Error");
26
+ return ctx;
27
+ };
28
+ var SideBarContext_default = SideBarContext;
29
+
30
+ // src/layout/SideBar/SideBar.tsx
31
+ import { jsx } from "react/jsx-runtime";
32
+ var SideBar = (props) => {
33
+ const { children, className } = props;
34
+ const [isOpen, setIsOpen] = React2.useState(true);
35
+ const handleSwitchSideBar = () => {
36
+ setIsOpen((prev) => !prev);
37
+ };
38
+ return /* @__PURE__ */ jsx(
39
+ SideBarContext_default.Provider,
40
+ {
41
+ value: { isSidebarOpen: isOpen, handleSwitchSideBar },
42
+ children: /* @__PURE__ */ jsx(
43
+ "div",
44
+ {
45
+ className: clsx_default(
46
+ "lib-xplat-layout-sidebar",
47
+ isOpen ? "large" : "small",
48
+ className
49
+ ),
50
+ children
51
+ }
52
+ )
53
+ }
54
+ );
55
+ };
56
+ SideBar.displayName = "SideBar";
57
+ var SideBar_default = SideBar;
58
+ export {
59
+ SideBar_default as SideBar,
60
+ SideBarContext_default as SideBarContext,
61
+ useSideBarContext
62
+ };