@metastringfoundation/map-list 0.1.0
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/dist/card.d.ts +7 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +7 -0
- package/dist/components/core/button.d.ts +7 -0
- package/dist/components/core/button.d.ts.map +1 -0
- package/dist/components/core/button.js +21 -0
- package/dist/components/core/highlighter.d.ts +5 -0
- package/dist/components/core/highlighter.d.ts.map +1 -0
- package/dist/components/core/highlighter.js +15 -0
- package/dist/components/core/icons.d.ts +17 -0
- package/dist/components/core/icons.d.ts.map +1 -0
- package/dist/components/core/icons.js +60 -0
- package/dist/components/core/iconts.d.ts +2 -0
- package/dist/components/core/iconts.d.ts.map +1 -0
- package/dist/components/core/iconts.js +2 -0
- package/dist/components/core/index.d.ts +5 -0
- package/dist/components/core/index.d.ts.map +1 -0
- package/dist/components/core/index.js +20 -0
- package/dist/components/core/input.d.ts +14 -0
- package/dist/components/core/input.d.ts.map +1 -0
- package/dist/components/core/input.js +18 -0
- package/dist/components/core/popup.d.ts +5 -0
- package/dist/components/core/popup.d.ts.map +1 -0
- package/dist/components/core/popup.js +11 -0
- package/dist/components/core/tabs.d.ts +46 -0
- package/dist/components/core/tabs.d.ts.map +1 -0
- package/dist/components/core/tabs.js +147 -0
- package/dist/components/infobar/content.d.ts +4 -0
- package/dist/components/infobar/content.d.ts.map +1 -0
- package/dist/components/infobar/content.js +22 -0
- package/dist/components/infobar/index.d.ts +2 -0
- package/dist/components/infobar/index.d.ts.map +1 -0
- package/dist/components/infobar/index.js +17 -0
- package/dist/components/infobar/infobar-panel.d.ts +4 -0
- package/dist/components/infobar/infobar-panel.d.ts.map +1 -0
- package/dist/components/infobar/infobar-panel.js +52 -0
- package/dist/components/map/index.d.ts +2 -0
- package/dist/components/map/index.d.ts.map +1 -0
- package/dist/components/map/index.js +66 -0
- package/dist/components/map/layers/grid/index.d.ts +6 -0
- package/dist/components/map/layers/grid/index.d.ts.map +1 -0
- package/dist/components/map/layers/grid/index.js +31 -0
- package/dist/components/map/layers/highlight/index.d.ts +2 -0
- package/dist/components/map/layers/highlight/index.d.ts.map +1 -0
- package/dist/components/map/layers/highlight/index.js +7 -0
- package/dist/components/map/layers/index.d.ts +6 -0
- package/dist/components/map/layers/index.d.ts.map +1 -0
- package/dist/components/map/layers/index.js +27 -0
- package/dist/components/map/layers/raster/index.d.ts +6 -0
- package/dist/components/map/layers/raster/index.d.ts.map +1 -0
- package/dist/components/map/layers/raster/index.js +19 -0
- package/dist/components/map/layers/vector/index.d.ts +5 -0
- package/dist/components/map/layers/vector/index.d.ts.map +1 -0
- package/dist/components/map/layers/vector/index.js +29 -0
- package/dist/components/map/marker-list/index.d.ts +3 -0
- package/dist/components/map/marker-list/index.d.ts.map +1 -0
- package/dist/components/map/marker-list/index.js +16 -0
- package/dist/components/map/markers-list/index.d.ts +3 -0
- package/dist/components/map/markers-list/index.d.ts.map +1 -0
- package/dist/components/map/markers-list/index.js +16 -0
- package/dist/components/map/popup/index.d.ts +4 -0
- package/dist/components/map/popup/index.d.ts.map +1 -0
- package/dist/components/map/popup/index.js +17 -0
- package/dist/components/sidebar/common/grid-legend.d.ts +4 -0
- package/dist/components/sidebar/common/grid-legend.d.ts.map +1 -0
- package/dist/components/sidebar/common/grid-legend.js +22 -0
- package/dist/components/sidebar/common/info-popover.d.ts +10 -0
- package/dist/components/sidebar/common/info-popover.d.ts.map +1 -0
- package/dist/components/sidebar/common/info-popover.js +32 -0
- package/dist/components/sidebar/common/layer-item-style.d.ts +4 -0
- package/dist/components/sidebar/common/layer-item-style.d.ts.map +1 -0
- package/dist/components/sidebar/common/layer-item-style.js +21 -0
- package/dist/components/sidebar/common/layer-item.d.ts +11 -0
- package/dist/components/sidebar/common/layer-item.d.ts.map +1 -0
- package/dist/components/sidebar/common/layer-item.js +59 -0
- package/dist/components/sidebar/common/moreless.d.ts +4 -0
- package/dist/components/sidebar/common/moreless.d.ts.map +1 -0
- package/dist/components/sidebar/common/moreless.js +10 -0
- package/dist/components/sidebar/common/opacity-handler-addon.d.ts +3 -0
- package/dist/components/sidebar/common/opacity-handler-addon.d.ts.map +1 -0
- package/dist/components/sidebar/common/opacity-handler-addon.js +9 -0
- package/dist/components/sidebar/common/style-legend.d.ts +4 -0
- package/dist/components/sidebar/common/style-legend.d.ts.map +1 -0
- package/dist/components/sidebar/common/style-legend.js +23 -0
- package/dist/components/sidebar/common.d.ts +2 -0
- package/dist/components/sidebar/common.d.ts.map +1 -0
- package/dist/components/sidebar/common.js +2 -0
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/index.d.ts.map +1 -0
- package/dist/components/sidebar/index.js +38 -0
- package/dist/components/sidebar/layers/index.d.ts +2 -0
- package/dist/components/sidebar/layers/index.d.ts.map +1 -0
- package/dist/components/sidebar/layers/index.js +12 -0
- package/dist/components/sidebar/layers/layer-list.d.ts +2 -0
- package/dist/components/sidebar/layers/layer-list.d.ts.map +1 -0
- package/dist/components/sidebar/layers/layer-list.js +64 -0
- package/dist/components/sidebar/layers/search.d.ts +2 -0
- package/dist/components/sidebar/layers/search.d.ts.map +1 -0
- package/dist/components/sidebar/layers/search.js +16 -0
- package/dist/components/sidebar/layers.d.ts +2 -0
- package/dist/components/sidebar/layers.d.ts.map +1 -0
- package/dist/components/sidebar/layers.js +2 -0
- package/dist/components/sidebar/selected/extended.d.ts +3 -0
- package/dist/components/sidebar/selected/extended.d.ts.map +1 -0
- package/dist/components/sidebar/selected/extended.js +7 -0
- package/dist/components/sidebar/selected/index.d.ts +2 -0
- package/dist/components/sidebar/selected/index.d.ts.map +1 -0
- package/dist/components/sidebar/selected/index.js +20 -0
- package/dist/components/sidebar/selected/selected-item-list.d.ts +10 -0
- package/dist/components/sidebar/selected/selected-item-list.d.ts.map +1 -0
- package/dist/components/sidebar/selected/selected-item-list.js +36 -0
- package/dist/components/sidebar/settings/index.d.ts +2 -0
- package/dist/components/sidebar/settings/index.d.ts.map +1 -0
- package/dist/components/sidebar/settings/index.js +16 -0
- package/dist/components/sidebar/settings/layer-selection.d.ts +6 -0
- package/dist/components/sidebar/settings/layer-selection.d.ts.map +1 -0
- package/dist/components/sidebar/settings/layer-selection.js +17 -0
- package/dist/components/sidebar/tabs.d.ts +4 -0
- package/dist/components/sidebar/tabs.d.ts.map +1 -0
- package/dist/components/sidebar/tabs.js +15 -0
- package/dist/gradient.d.ts +6 -0
- package/dist/gradient.d.ts.map +1 -0
- package/dist/gradient.js +9 -0
- package/dist/hooks/use-layers.d.ts +55 -0
- package/dist/hooks/use-layers.d.ts.map +1 -0
- package/dist/hooks/use-layers.js +298 -0
- package/dist/index.css +1129 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/interfaces/index.d.ts +103 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/services/naksha.d.ts +62 -0
- package/dist/services/naksha.d.ts.map +1 -0
- package/dist/services/naksha.js +420 -0
- package/dist/static/constant.d.ts +16 -0
- package/dist/static/constant.d.ts.map +1 -0
- package/dist/static/constant.js +34 -0
- package/dist/static/constants.d.ts +16 -0
- package/dist/static/constants.d.ts.map +1 -0
- package/dist/static/constants.js +34 -0
- package/dist/test.d.ts +2 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +9 -0
- package/dist/turborepo-logo.d.ts +2 -0
- package/dist/turborepo-logo.d.ts.map +1 -0
- package/dist/turborepo-logo.js +8 -0
- package/dist/utils/array-move.d.ts +3 -0
- package/dist/utils/array-move.d.ts.map +1 -0
- package/dist/utils/array-move.js +19 -0
- package/dist/utils/grid.d.ts +22 -0
- package/dist/utils/grid.d.ts.map +1 -0
- package/dist/utils/grid.js +116 -0
- package/dist/utils/naksha.d.ts +32 -0
- package/dist/utils/naksha.d.ts.map +1 -0
- package/dist/utils/naksha.js +141 -0
- package/package.json +57 -0
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,2CAmBA"}
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Card = Card;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function Card({ title, children, href, }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("a", { className: "ui:group ui:rounded-lg ui:border ui:border-transparent ui:px-5 ui:py-4 ui:transition-colors hover:ui:border-neutral-700 hover:ui:bg-neutral-800/30", href: `${href}?utm_source=create-turbo&utm_medium=with-tailwind&utm_campaign=create-turbo"`, rel: "noopener noreferrer", target: "_blank", children: [(0, jsx_runtime_1.jsxs)("h2", { className: "ui:mb-3 ui:text-2xl ui:font-semibold", children: [title, " ", (0, jsx_runtime_1.jsx)("span", { className: "ui:inline-block ui:transition-transform group-hover:ui:translate-x-1 motion-reduce:ui:transform-none", children: "->" })] }), (0, jsx_runtime_1.jsx)("p", { className: "ui:m-0 ui:max-w-[30ch] ui:text-sm ui:opacity-50", children: children })] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const IconButton: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const CloseButton: (props?: any) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const LayersButton: (props?: any) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const InfobarButton: (props?: any) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/core/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,MAAM,yFAOjB,CAAC;AAEH,eAAO,MAAM,UAAU,GAAI,UAAK,4CAQ/B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,WAAM,4CAMjC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,WAAM,4CAOlC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAM,4CAOnC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InfobarButton = exports.LayersButton = exports.CloseButton = exports.IconButton = exports.Button = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
// @ts-nocheck
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const icons_1 = require("./icons");
|
|
11
|
+
exports.Button = react_1.default.forwardRef((props, ref) => ((0, jsx_runtime_1.jsx)("button", { ref: ref, type: "button", className: "h-8 px-3 py-2 rounded-md focus:outline-none focus:ring cursor-pointer text-md flex align-middle items-center gap-2 bg-gray-100 hover:bg-gray-200 text-gray-700 disabled:cursor-not-allowed disabled:bg-gray-100! disabled:opacity-50", ...props })));
|
|
12
|
+
const IconButton = (props) => {
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "h-8 flex gap-2 align-middle p-2 font-medium tracking-wide capitalize transition-colors duration-200 transform bg-white-600 rounded-md focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80 border border-blue-600 text-blue-600 hover:border-blue-500", ...props }));
|
|
14
|
+
};
|
|
15
|
+
exports.IconButton = IconButton;
|
|
16
|
+
const CloseButton = (props) => ((0, jsx_runtime_1.jsx)("button", { className: "absolute top-0 right-0 h-12 w-12 bg-red-100 cursor-pointer hover:bg-red-200 text-red-800 text-lg", children: "\u2715", ...props }));
|
|
17
|
+
exports.CloseButton = CloseButton;
|
|
18
|
+
const LayersButton = (props) => ((0, jsx_runtime_1.jsx)("button", { className: "absolute top-4 left-4 rounded-lg z-10 h-10 w-10 bg-white cursor-pointer hover:bg-gray-100 text-gray-700 text-lg flex items-center justify-center", ...props, children: (0, jsx_runtime_1.jsx)(icons_1.LayersIcon, {}) }));
|
|
19
|
+
exports.LayersButton = LayersButton;
|
|
20
|
+
const InfobarButton = (props) => ((0, jsx_runtime_1.jsx)("button", { className: "absolute top-4 right-4 rounded-lg z-10 h-10 w-10 bg-white cursor-pointer hover:bg-gray-100 text-gray-700 text-lg flex items-center justify-center", ...props, children: (0, jsx_runtime_1.jsx)(icons_1.InfoIcon, {}) }));
|
|
21
|
+
exports.InfobarButton = InfobarButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlighter.d.ts","sourceRoot":"","sources":["../../../src/components/core/highlighter.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAI;;;CAA6B,4CAmBxD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Highlighted = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Highlighted = ({ text = "", highlight = "" }) => {
|
|
6
|
+
if (!highlight.trim()) {
|
|
7
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: text });
|
|
8
|
+
}
|
|
9
|
+
const regex = new RegExp(`(${highlight})`, "gi");
|
|
10
|
+
const parts = text.split(regex);
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: parts
|
|
12
|
+
.filter((part) => part)
|
|
13
|
+
.map((part, i) => regex.test(part) ? ((0, jsx_runtime_1.jsx)("mark", { children: part }, i)) : ((0, jsx_runtime_1.jsx)("span", { children: part }, i))) }));
|
|
14
|
+
};
|
|
15
|
+
exports.Highlighted = Highlighted;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const SearchIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const LayersIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const InfoIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const SlidersIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function AttributionIcon(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function TagIcon(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function LicenseIcon(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function EyeIcon(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function ClockIcon(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function DownloadIcon(): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function ZoomExtentIcon(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function ShareIcon(): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function GrabberIcon(): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function CrossHairIcon(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function DownIcon(): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function UpIcon(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/core/icons.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,+CAgBtB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAetB,CAAC;AACF,eAAO,MAAM,QAAQ,+CAepB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAqBvB,CAAC;AAEF,wBAAgB,eAAe,4CAe9B;AAED,wBAAgB,OAAO,4CAetB;AAED,wBAAgB,WAAW,4CAe1B;AAED,wBAAgB,OAAO,4CAetB;AAED,wBAAgB,SAAS,4CAexB;AAED,wBAAgB,YAAY,4CAe3B;AAED,wBAAgB,cAAc,4CAgB7B;AAED,wBAAgB,SAAS,4CAoBxB;AAED,wBAAgB,WAAW,4CAc1B;AAED,wBAAgB,aAAa,4CAoB5B;AAED,wBAAgB,QAAQ,4CAgBvB;AAED,wBAAgB,MAAM,4CAgBrB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlidersIcon = exports.InfoIcon = exports.LayersIcon = exports.SearchIcon = void 0;
|
|
4
|
+
exports.AttributionIcon = AttributionIcon;
|
|
5
|
+
exports.TagIcon = TagIcon;
|
|
6
|
+
exports.LicenseIcon = LicenseIcon;
|
|
7
|
+
exports.EyeIcon = EyeIcon;
|
|
8
|
+
exports.ClockIcon = ClockIcon;
|
|
9
|
+
exports.DownloadIcon = DownloadIcon;
|
|
10
|
+
exports.ZoomExtentIcon = ZoomExtentIcon;
|
|
11
|
+
exports.ShareIcon = ShareIcon;
|
|
12
|
+
exports.GrabberIcon = GrabberIcon;
|
|
13
|
+
exports.CrossHairIcon = CrossHairIcon;
|
|
14
|
+
exports.DownIcon = DownIcon;
|
|
15
|
+
exports.UpIcon = UpIcon;
|
|
16
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
+
const SearchIcon = () => ((0, jsx_runtime_1.jsx)("svg", { fill: "none", className: "w-5 h-5 text-gray-400", width: "24", height: "24", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }));
|
|
18
|
+
exports.SearchIcon = SearchIcon;
|
|
19
|
+
const LayersIcon = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "18", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 2L2 7 12 12 22 7 12 2z" }), (0, jsx_runtime_1.jsx)("path", { d: "M2 17L12 22 22 17" }), (0, jsx_runtime_1.jsx)("path", { d: "M2 12L12 17 22 12" })] }));
|
|
20
|
+
exports.LayersIcon = LayersIcon;
|
|
21
|
+
const InfoIcon = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "16", x2: "12", y2: "12" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })] }));
|
|
22
|
+
exports.InfoIcon = InfoIcon;
|
|
23
|
+
const SlidersIcon = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "18", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { d: "M4 21L4 14" }), (0, jsx_runtime_1.jsx)("path", { d: "M4 10L4 3" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 21L12 12" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 8L12 3" }), (0, jsx_runtime_1.jsx)("path", { d: "M20 21L20 16" }), (0, jsx_runtime_1.jsx)("path", { d: "M20 12L20 3" }), (0, jsx_runtime_1.jsx)("path", { d: "M1 14L7 14" }), (0, jsx_runtime_1.jsx)("path", { d: "M9 8L15 8" }), (0, jsx_runtime_1.jsx)("path", { d: "M17 16L23 16" })] }));
|
|
24
|
+
exports.SlidersIcon = SlidersIcon;
|
|
25
|
+
function AttributionIcon() {
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 16 16", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", fill: "currentColor", d: "M5.5 3.5a2 2 0 100 4 2 2 0 000-4zM2 5.5a3.5 3.5 0 115.898 2.549 5.507 5.507 0 013.034 4.084.75.75 0 11-1.482.235 4.001 4.001 0 00-7.9 0 .75.75 0 01-1.482-.236A5.507 5.507 0 013.102 8.05 3.49 3.49 0 012 5.5zM11 4a.75.75 0 100 1.5 1.5 1.5 0 01.666 2.844.75.75 0 00-.416.672v.352a.75.75 0 00.574.73c1.2.289 2.162 1.2 2.522 2.372a.75.75 0 101.434-.44 5.01 5.01 0 00-2.56-3.012A3 3 0 0011 4z" }) }));
|
|
27
|
+
}
|
|
28
|
+
function TagIcon() {
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 16 16", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", fill: "currentColor", d: "M2.5 7.775V2.75a.25.25 0 01.25-.25h5.025a.25.25 0 01.177.073l6.25 6.25a.25.25 0 010 .354l-5.025 5.025a.25.25 0 01-.354 0l-6.25-6.25a.25.25 0 01-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 010 2.474l-5.026 5.026a1.75 1.75 0 01-2.474 0l-6.25-6.25A1.75 1.75 0 011 7.775zM6 5a1 1 0 100 2 1 1 0 000-2z" }) }));
|
|
30
|
+
}
|
|
31
|
+
function LicenseIcon() {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 16 16", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", fill: "currentColor", d: "M8.75.75a.75.75 0 00-1.5 0V2h-.984c-.305 0-.604.08-.869.23l-1.288.737A.25.25 0 013.984 3H1.75a.75.75 0 000 1.5h.428L.066 9.192a.75.75 0 00.154.838l.53-.53-.53.53v.001l.002.002.002.002.006.006.016.015.045.04a3.514 3.514 0 00.686.45A4.492 4.492 0 003 11c.88 0 1.556-.22 2.023-.454a3.515 3.515 0 00.686-.45l.045-.04.016-.015.006-.006.002-.002.001-.002L5.25 9.5l.53.53a.75.75 0 00.154-.838L3.822 4.5h.162c.305 0 .604-.08.869-.23l1.289-.737a.25.25 0 01.124-.033h.984V13h-2.5a.75.75 0 000 1.5h6.5a.75.75 0 000-1.5h-2.5V3.5h.984a.25.25 0 01.124.033l1.29.736c.264.152.563.231.868.231h.162l-2.112 4.692a.75.75 0 00.154.838l.53-.53-.53.53v.001l.002.002.002.002.006.006.016.015.045.04a3.517 3.517 0 00.686.45A4.492 4.492 0 0013 11c.88 0 1.556-.22 2.023-.454a3.512 3.512 0 00.686-.45l.045-.04.01-.01.006-.005.006-.006.002-.002.001-.002-.529-.531.53.53a.75.75 0 00.154-.838L13.823 4.5h.427a.75.75 0 000-1.5h-2.234a.25.25 0 01-.124-.033l-1.29-.736A1.75 1.75 0 009.735 2H8.75V.75zM1.695 9.227c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327l-1.305 2.9zm10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327l-1.305 2.9z" }) }));
|
|
33
|
+
}
|
|
34
|
+
function EyeIcon() {
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", fill: "currentColor", d: "M1.679 7.932c.412-.621 1.242-1.75 2.366-2.717C5.175 4.242 6.527 3.5 8 3.5c1.473 0 2.824.742 3.955 1.715 1.124.967 1.954 2.096 2.366 2.717a.119.119 0 010 .136c-.412.621-1.242 1.75-2.366 2.717C10.825 11.758 9.473 12.5 8 12.5c-1.473 0-2.824-.742-3.955-1.715C2.92 9.818 2.09 8.69 1.679 8.068a.119.119 0 010-.136zM8 2c-1.981 0-3.67.992-4.933 2.078C1.797 5.169.88 6.423.43 7.1a1.619 1.619 0 000 1.798c.45.678 1.367 1.932 2.637 3.024C4.329 13.008 6.019 14 8 14c1.981 0 3.67-.992 4.933-2.078 1.27-1.091 2.187-2.345 2.637-3.023a1.619 1.619 0 000-1.798c-.45-.678-1.367-1.932-2.637-3.023C11.671 2.992 9.981 2 8 2zm0 8a2 2 0 100-4 2 2 0 000 4z" }) }));
|
|
36
|
+
}
|
|
37
|
+
function ClockIcon() {
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 16 16", width: "14", height: "14", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", fill: "currentColor", d: "M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.5 4.75a.75.75 0 00-1.5 0v3.5a.75.75 0 00.471.696l2.5 1a.75.75 0 00.557-1.392L8.5 7.742V4.75z" }) }));
|
|
39
|
+
}
|
|
40
|
+
function DownloadIcon() {
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 16 16", width: "16", height: "16", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", fill: "currentColor", d: "M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z" }) }));
|
|
42
|
+
}
|
|
43
|
+
function ZoomExtentIcon() {
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) }));
|
|
45
|
+
}
|
|
46
|
+
function ShareIcon() {
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { display: "inline-block" }, children: [(0, jsx_runtime_1.jsx)("circle", { cx: "18", cy: "5", r: "3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "6", cy: "12", r: "3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "18", cy: "19", r: "3" }), (0, jsx_runtime_1.jsx)("line", { x1: "8.59", y1: "13.51", x2: "15.42", y2: "17.49" }), (0, jsx_runtime_1.jsx)("line", { x1: "15.41", y1: "6.51", x2: "8.59", y2: "10.49" })] }));
|
|
48
|
+
}
|
|
49
|
+
function GrabberIcon() {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 16 16", width: "16", height: "16", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M10 13a1 1 0 100-2 1 1 0 000 2zm-4 0a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zM6 5a1 1 0 100-2 1 1 0 000 2z" }) }));
|
|
51
|
+
}
|
|
52
|
+
function CrossHairIcon() {
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { style: { display: "inline-block" }, width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" }), (0, jsx_runtime_1.jsx)("line", { x1: "22", y1: "12", x2: "18", y2: "12" }), (0, jsx_runtime_1.jsx)("line", { x1: "6", y1: "12", x2: "2", y2: "12" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "6", x2: "12", y2: "2" }), (0, jsx_runtime_1.jsx)("line", { x1: "12", y1: "22", x2: "12", y2: "18" })] }));
|
|
54
|
+
}
|
|
55
|
+
function DownIcon() {
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("polyline", { points: "6 9 12 15 18 9" }) }));
|
|
57
|
+
}
|
|
58
|
+
function UpIcon() {
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { display: "inline-block" }, children: (0, jsx_runtime_1.jsx)("polyline", { points: "18 15 12 9 6 15" }) }));
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconts.d.ts","sourceRoot":"","sources":["../../../src/components/core/iconts.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/core/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./button"), exports);
|
|
18
|
+
__exportStar(require("./input"), exports);
|
|
19
|
+
__exportStar(require("./icons"), exports);
|
|
20
|
+
__exportStar(require("./tabs"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface InputProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Input: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const SelectInput: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const SearchInput: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
interface CheckboxInputProps extends InputProps {
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const CheckboxInput: (props: CheckboxInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/core/input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,UACR,SAAQ,KAAK,CAAC,iBAAiB,CAC7B,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,gBAAgB,CACjB;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,4CAetC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,UAAU,4CAoB5C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,UAAU,4CAW5C,CAAC;AAEF,UAAU,kBAAmB,SAAQ,UAAU;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CAuBpD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckboxInput = exports.SearchInput = exports.SelectInput = exports.Input = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_1 = require("./icons");
|
|
6
|
+
const Input = (props) => ((0, jsx_runtime_1.jsxs)("div", { children: [props.label && ((0, jsx_runtime_1.jsx)("label", { className: "text-gray-700", htmlFor: props.name, children: props.label })), (0, jsx_runtime_1.jsx)("input", { id: props.name, type: "text", name: props.name, className: "block w-full px-4 py-2 mt-2 text-gray-700 bg-white border border-gray-200 rounded-md focus:outline-none focus:ring", ...props })] }));
|
|
7
|
+
exports.Input = Input;
|
|
8
|
+
const SelectInput = (props) => ((0, jsx_runtime_1.jsxs)("div", { children: [props.label && ((0, jsx_runtime_1.jsx)("label", { className: "text-gray-700", htmlFor: props.name, children: props.label })), (0, jsx_runtime_1.jsx)("select", { id: props.name, name: props.name, className: "block w-full px-4 py-2 mt-2 text-gray-700 border bg-white border-gray-200 rounded-md focus:outline-none focus:ring appearance-none text-base", style: {
|
|
9
|
+
backgroundImage: `url("data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E")`,
|
|
10
|
+
backgroundPosition: "right 0.75rem center",
|
|
11
|
+
backgroundSize: "16px 12px",
|
|
12
|
+
backgroundRepeat: "no-repeat",
|
|
13
|
+
}, ...props })] }));
|
|
14
|
+
exports.SelectInput = SelectInput;
|
|
15
|
+
const SearchInput = (props) => ((0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsx)("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3", children: (0, jsx_runtime_1.jsx)(icons_1.SearchIcon, {}) }), (0, jsx_runtime_1.jsx)("input", { type: "search", className: "w-full py-2 pl-10 pr-4 text-gray-700 bg-white border border-gray-300 text-base rounded-md focus:outline-none focus:ring", ...props })] }));
|
|
16
|
+
exports.SearchInput = SearchInput;
|
|
17
|
+
const CheckboxInput = (props) => props.isLoading ? ((0, jsx_runtime_1.jsx)("svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", version: "1.1", className: "inline text-gray-200 animate-spin dark:text-gray-600", children: (0, jsx_runtime_1.jsx)("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: (0, jsx_runtime_1.jsx)("g", { fill: "#212121", fillRule: "nonzero", children: (0, jsx_runtime_1.jsx)("path", { d: "M10,3 C6.13401,3 3,6.13401 3,10 C3,10.2761 2.77614,10.5 2.5,10.5 C2.22386,10.5 2,10.2761 2,10 C2,5.58172 5.58172,2 10,2 C14.4183,2 18,5.58172 18,10 C18,14.4183 14.4183,18 10,18 C9.72386,18 9.5,17.7761 9.5,17.5 C9.5,17.2239 9.72386,17 10,17 C13.866,17 17,13.866 17,10 C17,6.13401 13.866,3 10,3 Z" }) }) }) })) : ((0, jsx_runtime_1.jsx)("input", { type: "checkbox", className: "w-5 h-5 border-gray-100 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", name: props.name, checked: props.checked, onChange: props.onChange }));
|
|
18
|
+
exports.CheckboxInput = CheckboxInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup.d.ts","sourceRoot":"","sources":["../../../src/components/core/popup.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;;;CAAA,2CAchD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = Popup;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
function Popup({ title, children }) {
|
|
9
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: tw `relative inline-block`, children: [(0, jsx_runtime_1.jsx)(_1.IconButton, { onClick: () => setIsOpen(!isOpen), children: title }), (0, jsx_runtime_1.jsx)("div", { className: tw `absolute right-0 z-20 w-48 p-2 mt-2 bg-white rounded-md shadow-xl border-2 border-blue-300 border-opacity-80`, style: isOpen ? {} : { display: "none" }, children: children })] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Native Tabs implementation (no external packages)
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* <Tabs defaultIndex={0}>
|
|
7
|
+
* <TabHeader>
|
|
8
|
+
* <IconTab icon={<IconA />}>Tab A</IconTab>
|
|
9
|
+
* <IconTab icon={<IconB />}>Tab B</IconTab>
|
|
10
|
+
* </TabHeader>
|
|
11
|
+
*
|
|
12
|
+
* <Panel>Content A</Panel>
|
|
13
|
+
* <Panel>Content B</Panel>
|
|
14
|
+
* </Tabs>
|
|
15
|
+
*/
|
|
16
|
+
type TabsProps = {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
defaultIndex?: number;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
type IconTabProps = {
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
isActive?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
type PanelProps = {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
isActive?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
};
|
|
33
|
+
type TabHeaderProps = {
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const Tabs: React.FC<TabsProps>;
|
|
38
|
+
export declare const TabHeader: React.FC<TabHeaderProps>;
|
|
39
|
+
/**
|
|
40
|
+
* IconTab accepts optional injected props `onClick` and `isActive` (these are injected by Tabs when used as children).
|
|
41
|
+
* If you want to use IconTab standalone, you can pass onClick/isActive manually.
|
|
42
|
+
*/
|
|
43
|
+
export declare const IconTab: React.ForwardRefExoticComponent<IconTabProps & React.RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
export declare const Panel: React.FC<PanelProps>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/core/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AAGH,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAWF,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAyHpC,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAU9C,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,OAAO,wFA6BlB,CAAC;AAIH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAOtC,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.Panel = exports.IconTab = exports.TabHeader = exports.Tabs = void 0;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
/* ---------------------- Tabs Provider ---------------------- */
|
|
11
|
+
const TabsContext = react_1.default.createContext(null);
|
|
12
|
+
const Tabs = ({ children, defaultIndex = 0, className }) => {
|
|
13
|
+
const [activeIndex, setActiveIndex] = react_1.default.useState(defaultIndex);
|
|
14
|
+
const tabRefs = react_1.default.useRef([]);
|
|
15
|
+
// find header child and other children
|
|
16
|
+
const arr = react_1.default.Children.toArray(children);
|
|
17
|
+
let headerChild = null;
|
|
18
|
+
const otherChildren = [];
|
|
19
|
+
arr.forEach((ch) => {
|
|
20
|
+
const typeName = ch?.type?.displayName || ch?.type?.name;
|
|
21
|
+
if (typeName === "TabHeader")
|
|
22
|
+
headerChild = ch;
|
|
23
|
+
else
|
|
24
|
+
otherChildren.push(ch);
|
|
25
|
+
});
|
|
26
|
+
// count IconTab children inside headerChild
|
|
27
|
+
const headerChildren = headerChild ? react_1.default.Children.toArray(headerChild.props.children) : [];
|
|
28
|
+
const tabChildren = headerChildren.filter((c) => {
|
|
29
|
+
const tn = c?.type?.displayName || c?.type?.name;
|
|
30
|
+
return tn === "IconTab";
|
|
31
|
+
});
|
|
32
|
+
const tabCount = tabChildren.length;
|
|
33
|
+
// helpers for keyboard navigation
|
|
34
|
+
const focusIndex = (i) => {
|
|
35
|
+
const idx = ((i % tabCount) + tabCount) % tabCount;
|
|
36
|
+
const ref = tabRefs.current[idx];
|
|
37
|
+
if (ref && typeof ref.focus === "function")
|
|
38
|
+
ref.focus();
|
|
39
|
+
};
|
|
40
|
+
const registerTabRef = (index, ref) => {
|
|
41
|
+
tabRefs.current[index] = ref;
|
|
42
|
+
};
|
|
43
|
+
// handle keyboard at tablist level (Left/Right/Home/End)
|
|
44
|
+
const onKeyDown = (e) => {
|
|
45
|
+
if (tabCount === 0)
|
|
46
|
+
return;
|
|
47
|
+
const key = e.key;
|
|
48
|
+
if (key === "ArrowRight") {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
const next = (activeIndex + 1) % tabCount;
|
|
51
|
+
setActiveIndex(next);
|
|
52
|
+
focusIndex(next);
|
|
53
|
+
}
|
|
54
|
+
else if (key === "ArrowLeft") {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
const prev = (activeIndex - 1 + tabCount) % tabCount;
|
|
57
|
+
setActiveIndex(prev);
|
|
58
|
+
focusIndex(prev);
|
|
59
|
+
}
|
|
60
|
+
else if (key === "Home") {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
setActiveIndex(0);
|
|
63
|
+
focusIndex(0);
|
|
64
|
+
}
|
|
65
|
+
else if (key === "End") {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
setActiveIndex(tabCount - 1);
|
|
68
|
+
focusIndex(tabCount - 1);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
// clone header children and inject onClick/isActive props
|
|
72
|
+
let tabIndex = 0;
|
|
73
|
+
const clonedHeader = headerChild && react_1.default.isValidElement(headerChild)
|
|
74
|
+
? react_1.default.cloneElement(headerChild, { ...(headerChild.props || {}), onKeyDown }, react_1.default.Children.map(headerChild.props.children, (child) => {
|
|
75
|
+
if (!react_1.default.isValidElement(child))
|
|
76
|
+
return child;
|
|
77
|
+
const tn = child.type?.displayName || child.type?.name;
|
|
78
|
+
if (tn === "IconTab") {
|
|
79
|
+
const index = tabIndex++;
|
|
80
|
+
return react_1.default.cloneElement(child, {
|
|
81
|
+
onClick: () => {
|
|
82
|
+
setActiveIndex(index);
|
|
83
|
+
},
|
|
84
|
+
isActive: activeIndex === index,
|
|
85
|
+
"data-tab-index": index,
|
|
86
|
+
key: index,
|
|
87
|
+
ref: child.ref, // preserve ref if any
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return child;
|
|
91
|
+
}))
|
|
92
|
+
: null;
|
|
93
|
+
// clone panels: panels are considered all top-level non-header children that are Panel components
|
|
94
|
+
let panelIndex = 0;
|
|
95
|
+
const clonedPanels = otherChildren.map((child) => {
|
|
96
|
+
if (!react_1.default.isValidElement(child))
|
|
97
|
+
return child;
|
|
98
|
+
const tn = child.type?.displayName || child.type?.name;
|
|
99
|
+
if (tn === "Panel") {
|
|
100
|
+
const idx = panelIndex++;
|
|
101
|
+
return react_1.default.cloneElement(child, {
|
|
102
|
+
isActive: activeIndex === idx,
|
|
103
|
+
key: `panel-${idx}`,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return child;
|
|
107
|
+
});
|
|
108
|
+
const contextValue = react_1.default.useMemo(() => ({
|
|
109
|
+
activeIndex,
|
|
110
|
+
setActiveIndex,
|
|
111
|
+
focusIndex,
|
|
112
|
+
tabCount,
|
|
113
|
+
registerTabRef,
|
|
114
|
+
}), [activeIndex, tabCount]);
|
|
115
|
+
return ((0, jsx_runtime_1.jsx)(TabsContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsxs)("div", { className: className ?? "", children: [clonedHeader, clonedPanels] }) }));
|
|
116
|
+
};
|
|
117
|
+
exports.Tabs = Tabs;
|
|
118
|
+
/* ---------------------- TabHeader ---------------------- */
|
|
119
|
+
const TabHeader = ({ children, className }) => {
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)("div", { role: "tablist", "aria-orientation": "horizontal", className: className ?? "flex shrink-0 border-b border-gray-200 justify-around pr-12", children: children }));
|
|
121
|
+
};
|
|
122
|
+
exports.TabHeader = TabHeader;
|
|
123
|
+
exports.TabHeader.displayName = "TabHeader";
|
|
124
|
+
/* ---------------------- IconTab ---------------------- */
|
|
125
|
+
/**
|
|
126
|
+
* IconTab accepts optional injected props `onClick` and `isActive` (these are injected by Tabs when used as children).
|
|
127
|
+
* If you want to use IconTab standalone, you can pass onClick/isActive manually.
|
|
128
|
+
*/
|
|
129
|
+
exports.IconTab = react_1.default.forwardRef(function IconTab({ children, icon, onClick, isActive, className }, ref) {
|
|
130
|
+
// when used inside Tabs, onClick/isActive are injected by clone. If not, default behavior:
|
|
131
|
+
const ctx = react_1.default.useContext(TabsContext);
|
|
132
|
+
const idxAttr = undefined; // we don't rely on it; Tabs injects onClick/isActive
|
|
133
|
+
const handleClick = onClick ?? (() => { });
|
|
134
|
+
const active = typeof isActive === "boolean" ? isActive : false;
|
|
135
|
+
const base = "flex items-center justify-center h-12 px-2 py-2 bg-transparent -mb-px border-b-2 -px-1 whitespace-nowrap focus:outline-none w-full cursor-pointer";
|
|
136
|
+
const activeCls = "text-blue-600 border-blue-500";
|
|
137
|
+
const inactiveCls = "text-gray-700 border-gray-300 hover:border-gray-400";
|
|
138
|
+
return ((0, jsx_runtime_1.jsxs)("button", { ref: ref, type: "button", role: "tab", "aria-selected": active, onClick: handleClick, className: (className ? className + " " : "") + base + " " + (active ? activeCls : inactiveCls), children: [icon, (0, jsx_runtime_1.jsx)("span", { className: "ml-2 text-base", children: children })] }));
|
|
139
|
+
});
|
|
140
|
+
exports.IconTab.displayName = "IconTab";
|
|
141
|
+
/* ---------------------- Panel ---------------------- */
|
|
142
|
+
const Panel = ({ children, className, isActive }) => {
|
|
143
|
+
const active = typeof isActive === "boolean" ? isActive : false;
|
|
144
|
+
return active ? ((0, jsx_runtime_1.jsx)("div", { className: className ?? "w-full flex flex-col flex-1 min-h-0", children: children })) : null;
|
|
145
|
+
};
|
|
146
|
+
exports.Panel = Panel;
|
|
147
|
+
exports.Panel.displayName = "Panel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/components/infobar/content.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,OAAO,EAAE;;CAAA,2CAoCjD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = InfoBarContent;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const map_common_1 = require("@metastringfoundation/map-common");
|
|
9
|
+
const use_layers_1 = __importDefault(require("../../hooks/use-layers"));
|
|
10
|
+
const constants_1 = require("../../static/constants");
|
|
11
|
+
const core_1 = require("../core");
|
|
12
|
+
// import LayerSelection from "../sidebar/settings/layer-selection";
|
|
13
|
+
const infobar_panel_1 = __importDefault(require("./infobar-panel"));
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
function InfoBarContent({ onClose }) {
|
|
16
|
+
const { layer: { selectedFeatures, selectedLayers, selectionStyle }, } = (0, use_layers_1.default)();
|
|
17
|
+
const { t } = (0, map_common_1.useT)();
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "absolute top-0 right-0 bottom-0 left-0 md:top-4 md:right-4 md:bottom-4 md:left-auto bg-white rounded-lg overflow-hidden shadow-md md:max-w-sm w-full z-20 flex flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "h-12 px-4 flex items-center gap-3 flex-1 bg-gray-200", children: [(0, jsx_runtime_1.jsx)(core_1.CrossHairIcon, {}), " ", t("infobar")] }), (0, jsx_runtime_1.jsx)(core_1.CloseButton, { onClick: onClose })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-gray-100 p-4 flex shrink-0 rt" }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col flex-1 overflow-auto gap-3 p-4", children: selectedFeatures.flat(1)?.map((data) => ((0, jsx_runtime_1.jsx)(infobar_panel_1.default, { data: data }, selectedLayers?.[0]?.source.type === "raster" ||
|
|
19
|
+
selectionStyle === constants_1.SELECTION_STYLE.ALL
|
|
20
|
+
? data?.sourceLayer
|
|
21
|
+
: data?.sourceLayer + data?.properties[constants_1.PROPERTY_ID]))) })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/infobar/index.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,OAAO,mDAY9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = InfoBar;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const use_layers_1 = __importDefault(require("../../hooks/use-layers"));
|
|
9
|
+
const core_1 = require("../core");
|
|
10
|
+
const content_1 = __importDefault(require("./content"));
|
|
11
|
+
function InfoBar() {
|
|
12
|
+
const { layer, isInfoBarOpen, setIsInfoBarOpen } = (0, use_layers_1.default)();
|
|
13
|
+
if (!layer.selectedFeatures?.length)
|
|
14
|
+
return null;
|
|
15
|
+
const toggleOpen = () => setIsInfoBarOpen(!isInfoBarOpen);
|
|
16
|
+
return isInfoBarOpen ? ((0, jsx_runtime_1.jsx)(content_1.default, { onClose: toggleOpen })) : ((0, jsx_runtime_1.jsx)(core_1.InfobarButton, { onClick: toggleOpen }));
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infobar-panel.d.ts","sourceRoot":"","sources":["../../../src/components/infobar/infobar-panel.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;;CAAA,2CAyErD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = InfoBarPanel;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const use_layers_1 = __importDefault(require("../../hooks/use-layers"));
|
|
10
|
+
const naksha_1 = require("../../services/naksha");
|
|
11
|
+
const core_1 = require("../core");
|
|
12
|
+
//@ts-ignore
|
|
13
|
+
function InfoBarPanel({ data: payload }) {
|
|
14
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(true);
|
|
15
|
+
const [layerInfo, setLayerInfo,] = (0, react_1.useState)({
|
|
16
|
+
title: payload.sourceLayer,
|
|
17
|
+
properties: [],
|
|
18
|
+
});
|
|
19
|
+
const { layer, mp, query: { clickedLngLat } } = (0, use_layers_1.default)();
|
|
20
|
+
const getPropertyData = async () => {
|
|
21
|
+
let properties;
|
|
22
|
+
const currentLayer = layer.selectedLayers.find((l) => l.id === (payload.sourceLayer || payload.source));
|
|
23
|
+
if (currentLayer.layerType.toLowerCase() === "raster") {
|
|
24
|
+
const { data } = await (0, naksha_1.axGexGetRasterInfoWithLonLat)(
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
mp.geoserver?.endpoint, mp.geoserver?.workspace, {
|
|
27
|
+
bbox: payload.bbox.toString(),
|
|
28
|
+
query_layers: `${mp.geoserver?.workspace}:${currentLayer.id}`,
|
|
29
|
+
layers: `${mp.geoserver?.workspace}:${currentLayer.id}`,
|
|
30
|
+
});
|
|
31
|
+
properties = data?.features[0]
|
|
32
|
+
? Object.entries(data.features[0]?.properties).map(([v, k]) => [
|
|
33
|
+
k || "-",
|
|
34
|
+
])
|
|
35
|
+
: [];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
properties = Object.entries(currentLayer?.data?.propertyMap || {}).map(
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
([k, v]) => [v, payload?.properties?.[k]] || "-");
|
|
41
|
+
}
|
|
42
|
+
setLayerInfo({ title: currentLayer.title, properties });
|
|
43
|
+
};
|
|
44
|
+
(0, react_1.useEffect)(() => {
|
|
45
|
+
getPropertyData();
|
|
46
|
+
}, [clickedLngLat]);
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-gray-100 rounded-lg", children: [(0, jsx_runtime_1.jsxs)("button", { className: `px-4 h-10 flex items-center justify-between bg-gray-100 hover:bg-gray-200
|
|
48
|
+
transition-colors cursor-pointer w-full focus:outline-none focus:ring
|
|
49
|
+
${isOpen ? "bg-gray-200 rounded-t-lg" : "rounded-lg"}`, onClick: () => setIsOpen(!isOpen), children: [layerInfo.title, " ", isOpen ? (0, jsx_runtime_1.jsx)(core_1.UpIcon, {}) : (0, jsx_runtime_1.jsx)(core_1.DownIcon, {})] }), isOpen && ((0, jsx_runtime_1.jsx)("div", { className: "px-4 py-3 flex flex-col gap-3", children: layerInfo.properties.map(
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
([k, v], index) => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-gray-600", children: k }), (0, jsx_runtime_1.jsx)("div", { children: v })] }, k + v + index))) }))] }));
|
|
52
|
+
}
|