@tedi-design-system/react 18.1.0-rc.1 → 18.1.0-rc.11
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/_virtual/index.cjs10.js +1 -1
- package/_virtual/index.cjs11.js +1 -1
- package/_virtual/index.cjs12.js +1 -1
- package/_virtual/index.cjs13.js +1 -1
- package/_virtual/index.cjs5.js +1 -1
- package/_virtual/index.cjs6.js +1 -1
- package/_virtual/index.cjs7.js +1 -1
- package/_virtual/index.cjs8.js +1 -1
- package/_virtual/index.cjs9.js +1 -1
- package/_virtual/index.es10.js +1 -1
- package/_virtual/index.es11.js +1 -1
- package/_virtual/index.es12.js +1 -1
- package/_virtual/index.es13.js +2 -4
- package/_virtual/index.es14.js +2 -2
- package/_virtual/index.es5.js +4 -2
- package/_virtual/index.es6.js +1 -1
- package/_virtual/index.es7.js +1 -1
- package/_virtual/index.es8.js +1 -1
- package/_virtual/index.es9.js +1 -1
- package/bundle-stats.html +1 -1
- package/community.cjs.js +1 -1
- package/community.es.js +156 -152
- package/external/@mui/system/colorManipulator.cjs.js +1 -1
- package/external/@mui/system/colorManipulator.es.js +2 -2
- package/external/@mui/system/createStyled.cjs.js +1 -1
- package/external/@mui/system/createStyled.es.js +6 -6
- package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
- package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-option.cjs.js +1 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.d.ts +64 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.es.js +75 -0
- package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.d.ts +37 -22
- package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +76 -17
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.es.js +5 -1
- package/src/community/components/map-components/button-group/button-group.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/button-group/button-group.module.scss.es.js +1 -0
- package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
- package/src/community/components/map-components/map-button/map-button.d.ts +8 -3
- package/src/community/components/map-components/map-button/map-button.es.js +42 -33
- package/src/community/components/map-components/map-button/map-button.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/map-button/map-button.module.scss.es.js +3 -0
- package/src/community/components/map-components/split-pane/split-pane.cjs.js +1 -0
- package/src/community/components/map-components/split-pane/split-pane.d.ts +37 -0
- package/src/community/components/map-components/split-pane/split-pane.es.js +128 -0
- package/src/community/components/map-components/split-pane/split-pane.module.scss.cjs.js +1 -0
- package/src/community/components/map-components/split-pane/split-pane.module.scss.es.js +17 -0
- package/src/community/index.d.ts +1 -0
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.es.js +55 -35
- package/src/tedi/components/form/search/search.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/search/search.module.scss.es.js +7 -3
- package/src/tedi/providers/label-provider/label-provider.cjs.js +1 -1
- package/src/tedi/providers/label-provider/label-provider.d.ts +2 -2
- package/src/tedi/providers/label-provider/label-provider.es.js +2 -2
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +7 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +7 -0
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),I=require("../../../../tedi/components/base/icon/icon.cjs.js"),t=require("./base-map-selection.module.scss.cjs.js"),S=require("../../../../tedi/helpers/hooks/use-element-size.cjs.js"),s=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),d=b=>{const{title:l,content:x,selected:c,onSelect:n,type:u="selection",className:h,id:j,multiple:T,disabled:o,tooltipText:p,tooltipType:f="info"}=b,a=r.useRef(null),_=S.useElementSize(a),[y,g]=r.useState(!1);r.useEffect(()=>{const i=a.current;i&&g(i.scrollWidth>i.clientWidth)},[_,l]);const q=()=>{o||n==null||n()},v=i=>{o||(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n==null||n())},M=N.default(t.default["tedi-base-map-selection__wrapper"],c&&t.default["tedi-base-map-selection--selected"],u&&t.default[`tedi-base-map-selection--${u}`],T&&t.default["tedi-base-map-selection--multiple"],o&&t.default["tedi-base-map-selection--disabled"],h),m=e.jsx("div",{ref:a,tabIndex:-1,className:t.default["tedi-base-map-selection__title"],children:l}),E=y?e.jsxs(s.Tooltip,{children:[e.jsx(s.Tooltip.Trigger,{children:m}),e.jsx(s.Tooltip.Content,{children:l})]}):m;return e.jsxs("div",{role:"button",tabIndex:o?-1:0,"aria-pressed":!!c,"aria-disabled":o||void 0,onClick:q,onKeyDown:v,className:M,id:j,children:[e.jsx("div",{"aria-hidden":!0,className:t.default["tedi-base-map-selection__content"],children:x}),p&&e.jsxs(s.Tooltip,{children:[e.jsx(s.Tooltip.Trigger,{children:e.jsx("span",{tabIndex:-1,className:t.default["tedi-base-map-selection__info"],children:e.jsx(I.Icon,{background:"brand-secondary",name:f==="error"?"error":"info",size:16,color:f==="error"?"danger":"brand"})})}),e.jsx(s.Tooltip.Content,{children:p})]}),E]})};d.displayName="BaseMapOption";exports.BaseMapOption=d;exports.default=d;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
export type BaseMapOptionType = 'button' | 'historical' | 'selection';
|
|
3
|
+
export type BaseMapOptionTooltipType = 'info' | 'error';
|
|
4
|
+
export interface BaseMapOptionProps {
|
|
5
|
+
/**
|
|
6
|
+
* The title displayed within the option.
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* The main content of the option, typically a thumbnail. Can be any valid React node.
|
|
11
|
+
*/
|
|
12
|
+
content: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Indicates whether the option is currently selected.
|
|
15
|
+
* Used to apply specific visual styles.
|
|
16
|
+
*/
|
|
17
|
+
selected?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Callback triggered when the option is clicked
|
|
20
|
+
* or activated via keyboard (Enter or Space).
|
|
21
|
+
*/
|
|
22
|
+
onSelect?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* The type of the option, which controls styling.
|
|
25
|
+
* - `'selection'`: thumbnail with the title rendered below (default)
|
|
26
|
+
* - `'button'`: square thumbnail with the title overlaid
|
|
27
|
+
* - `'historical'`: styled for historical context
|
|
28
|
+
* @default 'selection'
|
|
29
|
+
*/
|
|
30
|
+
type?: BaseMapOptionType;
|
|
31
|
+
/**
|
|
32
|
+
* Optional custom class name to apply additional styles.
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* HTML `id` attribute to identify the element.
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* When `true`, renders a "stacked" visual indicating multiple maps.
|
|
41
|
+
*/
|
|
42
|
+
multiple?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Applies disabled style.
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Text shown in a tooltip. When set, an info icon is rendered in the middle of
|
|
49
|
+
* the option and reveals this text on hover.
|
|
50
|
+
*/
|
|
51
|
+
tooltipText?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Visual style of the info icon shown when `tooltipText` is set.
|
|
54
|
+
* - `'info'`: neutral informational icon (default)
|
|
55
|
+
* - `'error'`: error/danger styled icon
|
|
56
|
+
* @default 'info'
|
|
57
|
+
*/
|
|
58
|
+
tooltipType?: BaseMapOptionTooltipType;
|
|
59
|
+
}
|
|
60
|
+
export declare const BaseMapOption: {
|
|
61
|
+
(props: BaseMapOptionProps): JSX.Element;
|
|
62
|
+
displayName: string;
|
|
63
|
+
};
|
|
64
|
+
export default BaseMapOption;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import k from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useRef as C, useState as w, useEffect as z } from "react";
|
|
4
|
+
import { Icon as B } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import t from "./base-map-selection.module.scss.es.js";
|
|
6
|
+
import { useElementSize as D } from "../../../../tedi/helpers/hooks/use-element-size.es.js";
|
|
7
|
+
import { Tooltip as s } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
8
|
+
const M = (b) => {
|
|
9
|
+
const {
|
|
10
|
+
title: r,
|
|
11
|
+
content: u,
|
|
12
|
+
selected: d,
|
|
13
|
+
onSelect: n,
|
|
14
|
+
type: c = "selection",
|
|
15
|
+
className: h,
|
|
16
|
+
id: y,
|
|
17
|
+
multiple: _,
|
|
18
|
+
disabled: o,
|
|
19
|
+
tooltipText: m,
|
|
20
|
+
tooltipType: p = "info"
|
|
21
|
+
} = b, a = C(null), x = D(a), [N, T] = w(!1);
|
|
22
|
+
z(() => {
|
|
23
|
+
const i = a.current;
|
|
24
|
+
i && T(i.scrollWidth > i.clientWidth);
|
|
25
|
+
}, [x, r]);
|
|
26
|
+
const g = () => {
|
|
27
|
+
o || n == null || n();
|
|
28
|
+
}, v = (i) => {
|
|
29
|
+
o || (i.key === "Enter" || i.key === " ") && (i.preventDefault(), n == null || n());
|
|
30
|
+
}, E = k(
|
|
31
|
+
t["tedi-base-map-selection__wrapper"],
|
|
32
|
+
d && t["tedi-base-map-selection--selected"],
|
|
33
|
+
c && t[`tedi-base-map-selection--${c}`],
|
|
34
|
+
_ && t["tedi-base-map-selection--multiple"],
|
|
35
|
+
o && t["tedi-base-map-selection--disabled"],
|
|
36
|
+
h
|
|
37
|
+
), f = /* @__PURE__ */ e("div", { ref: a, tabIndex: -1, className: t["tedi-base-map-selection__title"], children: r }), I = N ? /* @__PURE__ */ l(s, { children: [
|
|
38
|
+
/* @__PURE__ */ e(s.Trigger, { children: f }),
|
|
39
|
+
/* @__PURE__ */ e(s.Content, { children: r })
|
|
40
|
+
] }) : f;
|
|
41
|
+
return /* @__PURE__ */ l(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
role: "button",
|
|
45
|
+
tabIndex: o ? -1 : 0,
|
|
46
|
+
"aria-pressed": !!d,
|
|
47
|
+
"aria-disabled": o || void 0,
|
|
48
|
+
onClick: g,
|
|
49
|
+
onKeyDown: v,
|
|
50
|
+
className: E,
|
|
51
|
+
id: y,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ e("div", { "aria-hidden": !0, className: t["tedi-base-map-selection__content"], children: u }),
|
|
54
|
+
m && /* @__PURE__ */ l(s, { children: [
|
|
55
|
+
/* @__PURE__ */ e(s.Trigger, { children: /* @__PURE__ */ e("span", { tabIndex: -1, className: t["tedi-base-map-selection__info"], children: /* @__PURE__ */ e(
|
|
56
|
+
B,
|
|
57
|
+
{
|
|
58
|
+
background: "brand-secondary",
|
|
59
|
+
name: p === "error" ? "error" : "info",
|
|
60
|
+
size: 16,
|
|
61
|
+
color: p === "error" ? "danger" : "brand"
|
|
62
|
+
}
|
|
63
|
+
) }) }),
|
|
64
|
+
/* @__PURE__ */ e(s.Content, { children: m })
|
|
65
|
+
] }),
|
|
66
|
+
I
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
M.displayName = "BaseMapOption";
|
|
72
|
+
export {
|
|
73
|
+
M as BaseMapOption,
|
|
74
|
+
M as default
|
|
75
|
+
};
|
package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("../../../../../external/classnames/index.cjs.js"),S=require("react"),B=require("../../../../tedi/components/buttons/button/button.cjs.js"),T=require("../../../../tedi/components/form/field/field.cjs.js"),O=require("../../../../tedi/components/form/input-group/input-group.cjs.js"),C=require("../../../../tedi/components/form/slider/slider.cjs.js"),f=require("./base-map-option.cjs.js"),n=require("./base-map-selection.module.scss.cjs.js"),l=require("../../../../tedi/components/overlays/popover/popover.cjs.js"),L=require("../../../../tedi/components/form/input-group/components/input/input.cjs.js"),P=require("../../../../tedi/components/form/input-group/components/suffix/suffix.cjs.js"),c=a=>{const t=Number(a);return Number.isNaN(t)?0:Math.min(100,Math.max(0,t))};function o(a){const{title:t,content:x,children:h,multiple:y=!1,showTransparency:j=!1,transparency:d,defaultTransparency:_,onTransparencyChange:s,transparencyLabel:r="",id:i}=a,p=d!==void 0,[v,g]=S.useState(()=>c(_??0)),u=c(p?d:v),m=M=>{const b=c(M);p||g(b),s==null||s(b)},q=N.default(n.default["tedi-base-map-selection__wrapper"],n.default["tedi-base-map-selection__trigger"],n.default["tedi-base-map-selection--button"],y&&n.default["tedi-base-map-selection--multiple"]);return e.jsxs(l.Popover,{placement:"top-end",children:[e.jsx(l.Popover.Trigger,{children:e.jsxs(B.Button,{noStyle:!0,id:i,className:q,children:[e.jsx("div",{className:n.default["tedi-base-map-selection__content"],"aria-hidden":!0,children:x}),e.jsx("div",{className:n.default["tedi-base-map-selection__title"],children:t})]})}),e.jsxs(l.Popover.Content,{width:"medium",children:[e.jsx("div",{className:n.default["tedi-base-map-selection__options"],children:h}),j&&e.jsx("div",{className:n.default["tedi-base-map-selection__transparency"],children:e.jsx(C.Slider,{label:r,"aria-label":r||"Transparency",min:0,max:100,value:u,onChange:m,minLabel:"0%",maxLabel:"100%",addonRight:e.jsx("div",{className:n.default["tedi-base-map-selection__transparency-field"],children:e.jsxs(O.InputGroupBase,{id:`${i}-transparency`,label:r||"Transparency",hideLabel:!0,children:[e.jsx(L.Input,{children:e.jsx(T.Field,{type:"number",id:`${i}-transparency`,value:String(u),onChange:m})}),e.jsx(P.Suffix,{children:"%"})]})})})})]})]})}o.Option=f.BaseMapOption;o.displayName="BaseMapSelection";exports.BaseMapOption=f.BaseMapOption;exports.BaseMapSelection=o;
|
|
@@ -1,44 +1,59 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
|
|
2
|
+
import { default as BaseMapOption } from './base-map-option';
|
|
3
3
|
export interface BaseMapSelectionProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Title of the trigger button and used as its accessible label.
|
|
6
6
|
*/
|
|
7
7
|
title: string;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Visual content (thumbnail) of the currently active base map, shown on the trigger button.
|
|
10
10
|
*/
|
|
11
11
|
content: React.ReactNode;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* Used to apply specific visual styles.
|
|
13
|
+
* Selectable base map options rendered inside the popover, typically `BaseMapSelection.Option` elements.
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
children: React.ReactNode;
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Renders a "stacked" trigger, indicating that multiple base maps are available.
|
|
18
|
+
* @default false
|
|
20
19
|
*/
|
|
21
|
-
|
|
20
|
+
multiple?: boolean;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* - `'historical'`: styled for historical context
|
|
26
|
-
* - `'selection'`: styled for multi-selection context
|
|
22
|
+
* When `true`, renders a transparency slider at the bottom of the popover.
|
|
23
|
+
* @default false
|
|
27
24
|
*/
|
|
28
|
-
|
|
25
|
+
showTransparency?: boolean;
|
|
29
26
|
/**
|
|
30
|
-
*
|
|
27
|
+
* Controlled transparency value (0-100). Use together with `onTransparencyChange`.
|
|
28
|
+
* Values outside the range are clamped. Omit for uncontrolled usage.
|
|
31
29
|
*/
|
|
32
|
-
|
|
30
|
+
transparency?: number;
|
|
33
31
|
/**
|
|
34
|
-
*
|
|
32
|
+
* Initial transparency value (0-100) for uncontrolled usage. Ignored when `transparency` is provided.
|
|
33
|
+
* @default 0
|
|
35
34
|
*/
|
|
36
|
-
|
|
35
|
+
defaultTransparency?: number;
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
39
|
-
* Affects the visual style.
|
|
37
|
+
* Callback fired when the transparency value changes. The reported value is always clamped to 0-100.
|
|
40
38
|
*/
|
|
41
|
-
|
|
39
|
+
onTransparencyChange?: (value: number) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Label for the transparency slider.
|
|
42
|
+
*/
|
|
43
|
+
transparencyLabel?: string;
|
|
44
|
+
/**
|
|
45
|
+
* HTML `id` attribute applied to the trigger button.
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function BaseMapSelection(props: BaseMapSelectionProps): JSX.Element;
|
|
50
|
+
export declare namespace BaseMapSelection {
|
|
51
|
+
var Option: {
|
|
52
|
+
(props: import("./base-map-option").BaseMapOptionProps): JSX.Element;
|
|
53
|
+
displayName: string;
|
|
54
|
+
};
|
|
55
|
+
var displayName: string;
|
|
42
56
|
}
|
|
43
|
-
export
|
|
57
|
+
export type { BaseMapOptionProps, BaseMapOptionTooltipType, BaseMapOptionType } from './base-map-option';
|
|
58
|
+
export { BaseMapOption };
|
|
44
59
|
export default BaseMapSelection;
|
|
@@ -1,21 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import B from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useState as M } from "react";
|
|
4
|
+
import { Button as C } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
5
|
+
import { Field as L } from "../../../../tedi/components/form/field/field.es.js";
|
|
6
|
+
import { InputGroupBase as w } from "../../../../tedi/components/form/input-group/input-group.es.js";
|
|
7
|
+
import { Slider as j } from "../../../../tedi/components/form/slider/slider.es.js";
|
|
8
|
+
import { BaseMapOption as I } from "./base-map-option.es.js";
|
|
9
|
+
import a from "./base-map-selection.module.scss.es.js";
|
|
10
|
+
import { Popover as l } from "../../../../tedi/components/overlays/popover/popover.es.js";
|
|
11
|
+
import { Input as O } from "../../../../tedi/components/form/input-group/components/input/input.es.js";
|
|
12
|
+
import { Suffix as $ } from "../../../../tedi/components/form/input-group/components/suffix/suffix.es.js";
|
|
13
|
+
const c = (r) => {
|
|
14
|
+
const n = Number(r);
|
|
15
|
+
return Number.isNaN(n) ? 0 : Math.min(100, Math.max(0, n));
|
|
16
|
+
};
|
|
17
|
+
function f(r) {
|
|
18
|
+
const {
|
|
19
|
+
title: n,
|
|
20
|
+
content: b,
|
|
21
|
+
children: y,
|
|
22
|
+
multiple: _ = !1,
|
|
23
|
+
showTransparency: N = !1,
|
|
24
|
+
transparency: m,
|
|
25
|
+
defaultTransparency: g,
|
|
26
|
+
onTransparencyChange: i,
|
|
27
|
+
transparencyLabel: s = "",
|
|
28
|
+
id: o
|
|
29
|
+
} = r, p = m !== void 0, [v, x] = M(
|
|
30
|
+
() => c(g ?? 0)
|
|
31
|
+
), d = c(p ? m : v), u = (S) => {
|
|
32
|
+
const h = c(S);
|
|
33
|
+
p || x(h), i == null || i(h);
|
|
34
|
+
}, T = B(
|
|
35
|
+
a["tedi-base-map-selection__wrapper"],
|
|
36
|
+
a["tedi-base-map-selection__trigger"],
|
|
37
|
+
a["tedi-base-map-selection--button"],
|
|
38
|
+
_ && a["tedi-base-map-selection--multiple"]
|
|
13
39
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
|
|
40
|
+
return /* @__PURE__ */ t(l, { placement: "top-end", children: [
|
|
41
|
+
/* @__PURE__ */ e(l.Trigger, { children: /* @__PURE__ */ t(C, { noStyle: !0, id: o, className: T, children: [
|
|
42
|
+
/* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__content"], "aria-hidden": !0, children: b }),
|
|
43
|
+
/* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__title"], children: n })
|
|
44
|
+
] }) }),
|
|
45
|
+
/* @__PURE__ */ t(l.Content, { width: "medium", children: [
|
|
46
|
+
/* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__options"], children: y }),
|
|
47
|
+
N && /* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__transparency"], children: /* @__PURE__ */ e(
|
|
48
|
+
j,
|
|
49
|
+
{
|
|
50
|
+
label: s,
|
|
51
|
+
"aria-label": s || "Transparency",
|
|
52
|
+
min: 0,
|
|
53
|
+
max: 100,
|
|
54
|
+
value: d,
|
|
55
|
+
onChange: u,
|
|
56
|
+
minLabel: "0%",
|
|
57
|
+
maxLabel: "100%",
|
|
58
|
+
addonRight: /* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__transparency-field"], children: /* @__PURE__ */ t(w, { id: `${o}-transparency`, label: s || "Transparency", hideLabel: !0, children: [
|
|
59
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
60
|
+
L,
|
|
61
|
+
{
|
|
62
|
+
type: "number",
|
|
63
|
+
id: `${o}-transparency`,
|
|
64
|
+
value: String(d),
|
|
65
|
+
onChange: u
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ e($, { children: "%" })
|
|
69
|
+
] }) })
|
|
70
|
+
}
|
|
71
|
+
) })
|
|
72
|
+
] })
|
|
17
73
|
] });
|
|
18
|
-
}
|
|
74
|
+
}
|
|
75
|
+
f.Option = I;
|
|
76
|
+
f.displayName = "BaseMapSelection";
|
|
19
77
|
export {
|
|
20
|
-
|
|
78
|
+
I as BaseMapOption,
|
|
79
|
+
f as BaseMapSelection
|
|
21
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-base-map-selection__wrapper":"tedi-base-map-selection__wrapper-aae7464f","tedi-base-map-selection__content":"tedi-base-map-selection__content-3145448d","tedi-base-map-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-base-map-selection__wrapper":"tedi-base-map-selection__wrapper-aae7464f","tedi-base-map-selection--disabled":"tedi-base-map-selection--disabled-a957b2c8","tedi-base-map-selection__content":"tedi-base-map-selection__content-3145448d","tedi-base-map-selection__info":"tedi-base-map-selection__info-a5674a2d","tedi-base-map-selection__options":"tedi-base-map-selection__options-dce549ce","tedi-base-map-selection__transparency":"tedi-base-map-selection__transparency-d4be551d","tedi-base-map-selection__transparency-field":"tedi-base-map-selection__transparency-field-d8b5a065","tedi-base-map-selection--historical":"tedi-base-map-selection--historical-159d3def","tedi-base-map-selection__title":"tedi-base-map-selection__title-d46b74ec","tedi-base-map-selection--selected":"tedi-base-map-selection--selected-914a0483","tedi-base-map-selection--button":"tedi-base-map-selection--button-0e9e36f4","tedi-base-map-selection--selection":"tedi-base-map-selection--selection-910cae90","tedi-base-map-selection--multiple":"tedi-base-map-selection--multiple-58cb365c"};exports.default=e;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
const e = {
|
|
2
2
|
"tedi-base-map-selection__wrapper": "tedi-base-map-selection__wrapper-aae7464f",
|
|
3
|
+
"tedi-base-map-selection--disabled": "tedi-base-map-selection--disabled-a957b2c8",
|
|
3
4
|
"tedi-base-map-selection__content": "tedi-base-map-selection__content-3145448d",
|
|
5
|
+
"tedi-base-map-selection__info": "tedi-base-map-selection__info-a5674a2d",
|
|
6
|
+
"tedi-base-map-selection__options": "tedi-base-map-selection__options-dce549ce",
|
|
7
|
+
"tedi-base-map-selection__transparency": "tedi-base-map-selection__transparency-d4be551d",
|
|
8
|
+
"tedi-base-map-selection__transparency-field": "tedi-base-map-selection__transparency-field-d8b5a065",
|
|
4
9
|
"tedi-base-map-selection--historical": "tedi-base-map-selection--historical-159d3def",
|
|
5
10
|
"tedi-base-map-selection__title": "tedi-base-map-selection__title-d46b74ec",
|
|
6
|
-
"tedi-map-selection__title": "tedi-map-selection__title-20651d60",
|
|
7
11
|
"tedi-base-map-selection--selected": "tedi-base-map-selection--selected-914a0483",
|
|
8
12
|
"tedi-base-map-selection--button": "tedi-base-map-selection--button-0e9e36f4",
|
|
9
13
|
"tedi-base-map-selection--selection": "tedi-base-map-selection--selection-910cae90",
|
package/src/community/components/map-components/button-group/button-group.module.scss.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-button-group":"tedi-button-group-edc8779d","tedi-button-group--horizontal":"tedi-button-group--horizontal-fb80a2c6","tedi-button-group__item":"tedi-button-group__item-da4d0318","tedi-button-group__suffix":"tedi-button-group__suffix-e19ecebe","tedi-button-group__prefix":"tedi-button-group__prefix-c267ac4b","tedi-button-group--vertical":"tedi-button-group--vertical-eef4c53c","tedi-button-group--stretch":"tedi-button-group--stretch-b9680682"};exports.default=t;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-button-group":"tedi-button-group-edc8779d","tedi-button-group--horizontal":"tedi-button-group--horizontal-fb80a2c6","tedi-button-group__item":"tedi-button-group__item-da4d0318","tedi-button-group__suffix":"tedi-button-group__suffix-e19ecebe","tedi-button-group__prefix":"tedi-button-group__prefix-c267ac4b","tedi-button-group--vertical":"tedi-button-group--vertical-eef4c53c","tedi-button-group__item--active":"tedi-button-group__item--active-d02494ae","tedi-button-group--stretch":"tedi-button-group--stretch-b9680682"};exports.default=t;
|
|
@@ -5,6 +5,7 @@ const t = {
|
|
|
5
5
|
"tedi-button-group__suffix": "tedi-button-group__suffix-e19ecebe",
|
|
6
6
|
"tedi-button-group__prefix": "tedi-button-group__prefix-c267ac4b",
|
|
7
7
|
"tedi-button-group--vertical": "tedi-button-group--vertical-eef4c53c",
|
|
8
|
+
"tedi-button-group__item--active": "tedi-button-group__item--active-d02494ae",
|
|
8
9
|
"tedi-button-group--stretch": "tedi-button-group--stretch-b9680682"
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("../../../../../external/classnames/index.cjs.js"),B=require("react"),S=require("../../../../tedi/components/base/icon/icon.cjs.js"),N=require("../../../../tedi/components/loaders/spinner/spinner.cjs.js"),O=require("../../../../tedi/components/buttons/button/button.cjs.js"),d=require("../map-dropdown/map-dropdown.cjs.js"),t=require("./map-button.module.scss.cjs.js"),l=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),b=f=>{const{size:n="default",icon:r,selected:h=!1,className:x,children:u,hideLabel:c=!1,tooltipContent:p=u,dropdownItems:o,isActive:j,isHovered:g,underline:q,isLoading:i,..._}=f,[w,D]=B.useState(!1),M=h||w,v=m.default(t.default["tedi-map-button"],t.default[`tedi-map-button--${n}`],M&&t.default["tedi-map-button--selected"],o&&t.default["tedi-map-button--dropdown"],j&&t.default["tedi-map-button--is-active"],g&&t.default["tedi-map-button--is-hovered"],q&&t.default["tedi-map-button--underline"],i&&t.default["tedi-map-button--loading"],x),C=e.jsxs(e.Fragment,{children:[i?e.jsx(N.Spinner,{size:n==="small"?16:18,className:t.default["tedi-map-button__icon"]}):r&&e.jsx(S.Icon,{name:r,className:t.default["tedi-map-button__icon"],size:n==="small"?24:18}),!c&&e.jsx("div",{className:m.default(t.default["tedi-map-button__text"]),children:u})]}),s=e.jsx(O.Button,{noStyle:!0,isLoading:i,className:v,size:n,..._,children:C}),T=c&&p?e.jsxs(l.Tooltip,{placement:"right",children:[e.jsx(l.Tooltip.Trigger,{children:s}),e.jsx(l.Tooltip.Content,{children:p})]}):s;return o?e.jsxs(d.MapDropdown,{onOpenChange:D,placement:"right-start",children:[e.jsx(d.MapDropdown.Trigger,{children:s}),e.jsx(d.MapDropdown.Content,{items:o.map(a=>({children:a.children,onClick:a.onClick,isDisabled:a.isDisabled}))})]}):T};exports.MapButton=b;exports.default=b;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { ButtonProps } from '../../../../tedi';
|
|
3
3
|
import { MapDropdownItem } from '../map-dropdown/map-dropdown';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Button props that don't apply to MapButton because it renders `<Button noStyle>` with its own
|
|
6
|
+
* fixed styling. Omitted so the public API only advertises props that actually work here.
|
|
7
|
+
*/
|
|
8
|
+
type OmittedButtonProps = 'size' | 'icon' | 'iconLeft' | 'iconRight' | 'visualType' | 'color' | 'fullWidth' | 'showTooltip' | 'noStyle' | 'renderWrapperElement';
|
|
9
|
+
export interface MapButtonProps extends Omit<ButtonProps, OmittedButtonProps> {
|
|
5
10
|
/**
|
|
6
11
|
* Size of the button. Can be:
|
|
7
12
|
* - `'default'` – standard size.
|
|
@@ -9,8 +14,8 @@ export interface MapButtonProps extends Omit<ButtonProps, 'size'> {
|
|
|
9
14
|
*/
|
|
10
15
|
size?: 'default' | 'small';
|
|
11
16
|
/**
|
|
12
|
-
* Name of the icon to display
|
|
13
|
-
*
|
|
17
|
+
* Name of the icon to display above the label (e.g., Material Symbols name).
|
|
18
|
+
* Replaced by a spinner while `isLoading` is `true`.
|
|
14
19
|
*/
|
|
15
20
|
icon?: string;
|
|
16
21
|
/**
|
|
@@ -1,38 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import {
|
|
1
|
+
import { jsxs as a, Fragment as z, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import b from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useState as I } from "react";
|
|
4
|
+
import { Icon as M } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import { Spinner as O } from "../../../../tedi/components/loaders/spinner/spinner.es.js";
|
|
6
|
+
import { Button as j } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
6
7
|
import { MapDropdown as l } from "../map-dropdown/map-dropdown.es.js";
|
|
7
|
-
import
|
|
8
|
-
import { Tooltip as
|
|
9
|
-
const
|
|
8
|
+
import t from "./map-button.module.scss.es.js";
|
|
9
|
+
import { Tooltip as m } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
10
|
+
const q = (h) => {
|
|
10
11
|
const {
|
|
11
12
|
size: o = "default",
|
|
12
|
-
icon:
|
|
13
|
+
icon: d,
|
|
13
14
|
selected: f = !1,
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
16
|
-
hideLabel:
|
|
17
|
-
tooltipContent:
|
|
15
|
+
className: g,
|
|
16
|
+
children: p,
|
|
17
|
+
hideLabel: c = !1,
|
|
18
|
+
tooltipContent: u = p,
|
|
18
19
|
dropdownItems: n,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/* @__PURE__ */ t(
|
|
20
|
+
isActive: C,
|
|
21
|
+
isHovered: N,
|
|
22
|
+
underline: _,
|
|
23
|
+
isLoading: i,
|
|
24
|
+
...v
|
|
25
|
+
} = h, [w, D] = I(!1), x = f || w, B = b(
|
|
26
|
+
t["tedi-map-button"],
|
|
27
|
+
t[`tedi-map-button--${o}`],
|
|
28
|
+
x && t["tedi-map-button--selected"],
|
|
29
|
+
n && t["tedi-map-button--dropdown"],
|
|
30
|
+
C && t["tedi-map-button--is-active"],
|
|
31
|
+
N && t["tedi-map-button--is-hovered"],
|
|
32
|
+
_ && t["tedi-map-button--underline"],
|
|
33
|
+
i && t["tedi-map-button--loading"],
|
|
34
|
+
g
|
|
35
|
+
), S = /* @__PURE__ */ a(z, { children: [
|
|
36
|
+
i ? /* @__PURE__ */ e(O, { size: o === "small" ? 16 : 18, className: t["tedi-map-button__icon"] }) : d && /* @__PURE__ */ e(M, { name: d, className: t["tedi-map-button__icon"], size: o === "small" ? 24 : 18 }),
|
|
37
|
+
!c && /* @__PURE__ */ e("div", { className: b(t["tedi-map-button__text"]), children: p })
|
|
38
|
+
] }), s = /* @__PURE__ */ e(j, { noStyle: !0, isLoading: i, className: B, size: o, ...v, children: S }), T = c && u ? /* @__PURE__ */ a(m, { placement: "right", children: [
|
|
39
|
+
/* @__PURE__ */ e(m.Trigger, { children: s }),
|
|
40
|
+
/* @__PURE__ */ e(m.Content, { children: u })
|
|
41
|
+
] }) : s;
|
|
42
|
+
return n ? /* @__PURE__ */ a(l, { onOpenChange: D, placement: "right-start", children: [
|
|
43
|
+
/* @__PURE__ */ e(l.Trigger, { children: s }),
|
|
44
|
+
/* @__PURE__ */ e(
|
|
36
45
|
l.Content,
|
|
37
46
|
{
|
|
38
47
|
items: n.map((r) => ({
|
|
@@ -42,9 +51,9 @@ const F = (h) => {
|
|
|
42
51
|
}))
|
|
43
52
|
}
|
|
44
53
|
)
|
|
45
|
-
] }) :
|
|
54
|
+
] }) : T;
|
|
46
55
|
};
|
|
47
56
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
q as MapButton,
|
|
58
|
+
q as default
|
|
50
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-map-button":"tedi-map-button-ff336c6a","tedi-map-button__icon":"tedi-map-button__icon-f9ff78eb","tedi-map-button__text":"tedi-map-button__text-7f6a075e","tedi-map-button--default":"tedi-map-button--default-e1b335b5","tedi-map-button--small":"tedi-map-button--small-75882e8f","tedi-map-button--selected":"tedi-map-button--selected-9473bbd6","tedi-map-button--dropdown":"tedi-map-button--dropdown-ca6f4f3b"};exports.default=t;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-map-button":"tedi-map-button-ff336c6a","tedi-map-button--is-hovered":"tedi-map-button--is-hovered-25c99939","tedi-map-button--is-active":"tedi-map-button--is-active-f0beea2f","tedi-map-button__icon":"tedi-map-button__icon-f9ff78eb","tedi-map-button__text":"tedi-map-button__text-7f6a075e","tedi-map-button--default":"tedi-map-button--default-e1b335b5","tedi-map-button--small":"tedi-map-button--small-75882e8f","tedi-map-button--selected":"tedi-map-button--selected-9473bbd6","tedi-map-button--underline":"tedi-map-button--underline-20dd4ffc","tedi-map-button--dropdown":"tedi-map-button--dropdown-ca6f4f3b"};exports.default=t;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
const t = {
|
|
2
2
|
"tedi-map-button": "tedi-map-button-ff336c6a",
|
|
3
|
+
"tedi-map-button--is-hovered": "tedi-map-button--is-hovered-25c99939",
|
|
4
|
+
"tedi-map-button--is-active": "tedi-map-button--is-active-f0beea2f",
|
|
3
5
|
"tedi-map-button__icon": "tedi-map-button__icon-f9ff78eb",
|
|
4
6
|
"tedi-map-button__text": "tedi-map-button__text-7f6a075e",
|
|
5
7
|
"tedi-map-button--default": "tedi-map-button--default-e1b335b5",
|
|
6
8
|
"tedi-map-button--small": "tedi-map-button--small-75882e8f",
|
|
7
9
|
"tedi-map-button--selected": "tedi-map-button--selected-9473bbd6",
|
|
10
|
+
"tedi-map-button--underline": "tedi-map-button--underline-20dd4ffc",
|
|
8
11
|
"tedi-map-button--dropdown": "tedi-map-button--dropdown-ca6f4f3b"
|
|
9
12
|
};
|
|
10
13
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),P=require("../../../../../external/classnames/index.cjs.js"),p=require("react"),I=require("../../../../tedi/components/base/icon/icon.cjs.js"),K=require("../../../../tedi/components/buttons/button/button.cjs.js"),s=require("./split-pane.module.scss.cjs.js"),O=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),B=20,F=80,M=2,S=(c,a,d)=>Math.max(a,Math.min(d,c)),U=(c,a)=>c?a==="first"?"right":"left":a==="first"?"bottom":"top",A=({direction:c,side:a})=>{const d=U(c==="horizontal",a);return i.jsx("div",{"data-testid":"active-pane-ring","aria-hidden":!0,className:P.default(s.default["tedi-split-pane__ring"],s.default[`tedi-split-pane__ring--omit-${d}`])})},T=c=>{const{first:a,second:d,direction:m,highlightedSide:E,onClose:y,initialRatio:b=50,minRatio:f=B,maxRatio:h=F,onRatioChange:x}=c,{getLabel:g}=O.useLabels(),[v,N]=p.useState(()=>S(b,f,h)),_=p.useRef(v),R=p.useRef(null),r=p.useRef(null),l=m==="horizontal",w=e=>{const o=S(e,f,h);_.current=o,N(o)},L=(e,o)=>{if(!R.current)return;const n=R.current.getBoundingClientRect(),t=l?n.width:n.height;if(t<=0)return;const u=l?(e-n.left)/t*100:(o-n.top)/t*100;w(u)},j=()=>{x==null||x(_.current)},D=()=>{const e=t=>L(t.clientX,t.clientY),o=t=>{const u=t.touches[0];u&&L(u.clientX,u.clientY)},n=()=>{var t;(t=r.current)==null||t.call(r),j()};r.current=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",o),document.removeEventListener("touchend",n),r.current=null},document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),document.addEventListener("touchmove",o),document.addEventListener("touchend",n)};p.useEffect(()=>()=>{var e;(e=r.current)==null||e.call(r)},[]);const q=e=>{e.preventDefault(),D()},z=()=>{D()},k=e=>{const o=l?"ArrowLeft":"ArrowUp",n=l?"ArrowRight":"ArrowDown";let t=null;e.key===o?t=_.current-M:e.key===n?t=_.current+M:e.key==="Home"?t=f:e.key==="End"&&(t=h),t!==null&&(e.preventDefault(),w(t),j())};return i.jsxs("div",{ref:R,"data-testid":"split-pane",className:P.default(s.default["tedi-split-pane"],s.default[`tedi-split-pane--${m}`]),children:[i.jsxs("div",{"data-testid":"split-pane-first",className:s.default["tedi-split-pane__pane"],style:{flexGrow:v},children:[a,E==="first"&&i.jsx(A,{direction:m,side:"first"})]}),i.jsxs("div",{role:"separator",tabIndex:0,"aria-orientation":l?"vertical":"horizontal","aria-valuemin":f,"aria-valuemax":h,"aria-valuenow":Math.round(v),"aria-label":g("splitPaneResize"),"data-testid":"split-pane-divider",className:s.default["tedi-split-pane__divider"],onMouseDown:q,onTouchStart:z,onKeyDown:k,children:[i.jsx("span",{"data-testid":"split-pane-handle","aria-hidden":!0,className:s.default["tedi-split-pane__handle"],children:i.jsx(I.Icon,{name:l?"code":"unfold_more",size:18})}),y&&i.jsx("div",{className:s.default["tedi-split-pane__close"],children:i.jsx(K.Button,{"data-testid":"split-pane-close",visualType:"secondary",icon:"close",onClick:y,onMouseDown:e=>e.stopPropagation(),children:g("close")})})]}),i.jsxs("div",{"data-testid":"split-pane-second",className:s.default["tedi-split-pane__pane"],style:{flexGrow:100-v},children:[d,E==="second"&&i.jsx(A,{direction:m,side:"second"})]})]})};T.displayName="SplitPane";exports.SplitPane=T;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
type PaneSide = 'first' | 'second';
|
|
3
|
+
type SplitPaneDirection = 'horizontal' | 'vertical';
|
|
4
|
+
export interface SplitPaneProps {
|
|
5
|
+
/** Content of the first (left in horizontal, top in vertical) pane. */
|
|
6
|
+
first: ReactNode;
|
|
7
|
+
/** Content of the second (right in horizontal, bottom in vertical) pane. */
|
|
8
|
+
second: ReactNode;
|
|
9
|
+
/** Layout axis: `horizontal` places panes side by side, `vertical` stacks them. */
|
|
10
|
+
direction: SplitPaneDirection;
|
|
11
|
+
/** Draws an accent ring around the given pane to mark it as active. */
|
|
12
|
+
highlightedSide?: PaneSide;
|
|
13
|
+
/** When provided, renders a close button on the divider. */
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Initial size of the first pane as a percentage of the container, clamped to `minRatio`–`maxRatio`.
|
|
17
|
+
* @default 50
|
|
18
|
+
*/
|
|
19
|
+
initialRatio?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Minimum size of the first pane, as a percentage of the container.
|
|
22
|
+
* @default 20
|
|
23
|
+
*/
|
|
24
|
+
minRatio?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum size of the first pane, as a percentage of the container.
|
|
27
|
+
* @default 80
|
|
28
|
+
*/
|
|
29
|
+
maxRatio?: number;
|
|
30
|
+
/** Called with the final ratio (%) when a drag or keyboard adjustment event ends. */
|
|
31
|
+
onRatioChange?: (ratio: number) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const SplitPane: {
|
|
34
|
+
(props: SplitPaneProps): JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
export default SplitPane;
|