@tedi-design-system/react 19.1.0-rc.14 → 19.1.0-rc.16
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/bundle-stats.html +1 -1
- package/community.cjs.js +1 -1
- package/community.es.js +200 -197
- 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/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/dock-panel/dock-panel.cjs.js +2 -0
- package/src/community/components/dock-panel/dock-panel.d.ts +110 -0
- package/src/community/components/dock-panel/dock-panel.es.js +138 -0
- package/src/community/components/dock-panel/dock-panel.module.scss.cjs.js +1 -0
- package/src/community/components/dock-panel/dock-panel.module.scss.es.js +18 -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.es.js +19 -19
- 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 +10 -1
- package/src/community/components/map-components/map-button/map-button.es.js +31 -29
- package/src/community/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "19.1.0-rc.
|
|
3
|
+
"version": "19.1.0-rc.16",
|
|
4
4
|
"description": "TEDI Design System React component library — accessible, reusable UI components. Docs & live examples: https://storybook.tedi.ee/react/rc/",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),$=require("../../../../external/classnames/index.cjs.js"),s=require("react"),le=require("../../../tedi/components/base/typography/heading/heading.cjs.js"),B=require("../../../tedi/components/buttons/button/button.cjs.js"),n=require("./dock-panel.module.scss.cjs.js"),se=["xs","sm","md","lg","xl"],ae={xs:"25%",sm:"35%",md:"50%",lg:"65%",xl:"80%"},de=o=>typeof o=="string"&&se.includes(o),H=o=>de(o)?ae[o]:typeof o=="number"?`${o}px`:o,z=s.forwardRef((o,p)=>{const{title:h,children:g,labels:d,placement:O="right",size:v="default",collapsed:N,defaultCollapsed:M=!1,onCollapsedChange:_,onClose:b,headerActions:k,footer:y,width:E,height:j,maxHeight:i,headingElement:G,id:W,className:J,style:K,...D}=o,Q=s.useId(),x=W??`tedi-dock-panel-${Q}`,I=`${x}-title`,R=`${x}-body`,[U,V]=s.useState(M),X=N!==void 0,l=N??U,r=s.useRef(null),u=s.useRef(null),C=s.useRef(null),f=s.useRef(!1);s.useEffect(()=>{var T;const e=(T=r.current)==null?void 0:T.ownerDocument;if(!e)return;const c=()=>{var q,w,A;const a=e.activeElement,L=!!(a&&((q=u.current)!=null&&q.contains(a)||(w=C.current)!=null&&w.contains(a)));(L||a!==e.body||!((A=u.current)!=null&&A.hidden))&&(f.current=L)},S=()=>{var a;(a=u.current)!=null&&a.hidden||(f.current=!1)};return c(),e.addEventListener("focusin",c),e.addEventListener("focusout",S),()=>{e.removeEventListener("focusin",c),e.removeEventListener("focusout",S)}},[]),s.useEffect(()=>{var e;l&&f.current&&((e=r.current)==null||e.focus(),f.current=!1)},[l]);const Y=()=>{var c;const e=!l;(c=r.current)==null||c.focus(),X||V(e),_==null||_(e)},m={...K};E!==void 0&&(m["--dock-panel-width"]=H(E)),j!==void 0&&(m["--dock-panel-height"]=H(j)),i!==void 0&&(m["--dock-panel-max-height"]=typeof i=="number"?`${i}px`:i);const Z=G??(v==="small"?"h4":"h3"),ee=l?"small":void 0,P=l?d.expand:d.collapse,te=l?"zoom_out_map":"zoom_in_map",ne=k!=null,oe=y!=null;return t.jsxs("div",{...D,ref:p,id:x,role:"region","aria-labelledby":D["aria-labelledby"]??I,"data-dock-panel":"","data-placement":O,"data-size":v,"data-collapsed":l,className:$.default(n.default["tedi-dock-panel"],J),style:m,children:[t.jsxs("div",{className:n.default["tedi-dock-panel__header"],children:[t.jsx(le.Heading,{id:I,element:Z,modifiers:ee,className:n.default["tedi-dock-panel__title"],children:h}),ne&&t.jsx("div",{ref:C,className:n.default["tedi-dock-panel__header-actions"],hidden:l,children:k}),t.jsxs("div",{className:n.default["tedi-dock-panel__controls"],children:[t.jsx(B.Button,{ref:r,className:n.default["tedi-dock-panel__toggle"],type:"button",visualType:"neutral",icon:te,title:P,"aria-expanded":!l,"aria-controls":R,onClick:Y,children:P}),b&&t.jsx(B.Button,{className:n.default["tedi-dock-panel__close"],type:"button",visualType:"neutral",icon:"close",title:d.close,onClick:b,children:d.close})]})]}),t.jsxs("div",{ref:u,id:R,className:n.default["tedi-dock-panel__body"],hidden:l,children:[t.jsx("div",{className:n.default["tedi-dock-panel__content"],children:t.jsx("div",{className:n.default["tedi-dock-panel__content-inner"],children:g})}),oe&&t.jsx("div",{className:n.default["tedi-dock-panel__footer"],children:y})]})]})});z.displayName="DockPanel";const F=s.forwardRef(({children:o,panel:p,className:h,...g},d)=>t.jsxs("div",{...g,ref:d,className:$.default(n.default["tedi-dock-panel-layout"],h),children:[t.jsx("div",{className:n.default["tedi-dock-panel-layout__content"],"data-dock-panel-layout-content":"",children:o}),p]}));F.displayName="DockPanelLayout";exports.DockPanel=z;exports.DockPanelLayout=F;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { HeadingProps } from '../../../tedi/components/base/typography/heading/heading';
|
|
3
|
+
export type DockPanelPlacement = 'left' | 'right' | 'top' | 'bottom';
|
|
4
|
+
export type DockPanelSize = 'default' | 'small';
|
|
5
|
+
export type DockPanelDimensionPreset = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
export type DockPanelWidth = DockPanelDimensionPreset | CSSProperties['width'];
|
|
7
|
+
export type DockPanelHeight = DockPanelDimensionPreset | CSSProperties['height'];
|
|
8
|
+
export interface DockPanelLabels {
|
|
9
|
+
/** Accessible name for the minimize button. Supply translated text. */
|
|
10
|
+
collapse: string;
|
|
11
|
+
/** Accessible name for the restore button. Supply translated text. */
|
|
12
|
+
expand: string;
|
|
13
|
+
/** Accessible name for the optional close button. Supply translated text. */
|
|
14
|
+
close: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DockPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'> {
|
|
17
|
+
/** Required. Visible heading and default accessible name of the panel. */
|
|
18
|
+
title: string;
|
|
19
|
+
/** Required. Application-provided React content. Kept mounted while minimized. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Required. Translated accessible button names: { collapse, expand, close }.
|
|
23
|
+
* All three strings are required by this interface, including close when onClose is omitted.
|
|
24
|
+
* Providing labels.close alone does not display a close button.
|
|
25
|
+
*/
|
|
26
|
+
labels: DockPanelLabels;
|
|
27
|
+
/**
|
|
28
|
+
* Optional. Edge of the containing workspace, not necessarily the browser viewport.
|
|
29
|
+
* Place the panel in DockPanelLayout to overlay when expanded and reserve space when minimized.
|
|
30
|
+
* @default right
|
|
31
|
+
*/
|
|
32
|
+
placement?: DockPanelPlacement;
|
|
33
|
+
/**
|
|
34
|
+
* Optional. Panel density, using TEDI Modal padding tokens for the header, content and footer.
|
|
35
|
+
* The title defaults to h3 for default and h4 for small, including its text size when expanded.
|
|
36
|
+
* Set headingElement to override both. Minimized titles always use compact text.
|
|
37
|
+
* This is independent of width/height: small does not mean a narrower panel.
|
|
38
|
+
* @default default
|
|
39
|
+
*/
|
|
40
|
+
size?: DockPanelSize;
|
|
41
|
+
/**
|
|
42
|
+
* Optional. Controlled minimized state. Supply onCollapsedChange and apply the requested value.
|
|
43
|
+
* When omitted, the component manages its own state, initialized from defaultCollapsed.
|
|
44
|
+
*/
|
|
45
|
+
collapsed?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Optional. Initial minimized state in uncontrolled mode; ignored when collapsed is supplied.
|
|
48
|
+
* Changes after mounting do not reset the state.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
defaultCollapsed?: boolean;
|
|
52
|
+
/** Optional. Requests/notifies a minimize/restore change. Receives the next collapsed value. */
|
|
53
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Optional. Displays the close button and requests dismissal when clicked.
|
|
56
|
+
* The application owns removal, unsaved-change confirmation and focus restoration.
|
|
57
|
+
* Omit this callback to hide the close button. Closing is separate from minimizing.
|
|
58
|
+
*/
|
|
59
|
+
onClose?: () => void;
|
|
60
|
+
/** Optional. React content before the grouped panel controls. Hidden, not unmounted, when minimized. */
|
|
61
|
+
headerActions?: ReactNode;
|
|
62
|
+
/** Optional. React content below the scrolling body. Hidden, not unmounted, when minimized. */
|
|
63
|
+
footer?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Optional. Expanded width for left/right placement; ignored for top/bottom.
|
|
66
|
+
* Presets share the height scale: xs=25%, sm=35%, md=50%, lg=65%, xl=80% of workspace width.
|
|
67
|
+
* Every named preset leaves some workspace visible beside the panel, including xl.
|
|
68
|
+
* Also accepts a CSS length or a number in pixels, limited to the workspace width.
|
|
69
|
+
* Use 100% explicitly to fill the workspace. An omitted width defaults to xs (25%) via CSS.
|
|
70
|
+
* @default xs
|
|
71
|
+
*/
|
|
72
|
+
width?: DockPanelWidth;
|
|
73
|
+
/**
|
|
74
|
+
* Optional. Expanded height for any placement. Numbers mean pixels; CSS lengths and auto work too.
|
|
75
|
+
* Presets share the width scale: xs=25%, sm=35%, md=50%, lg=65%, xl=80% of workspace height.
|
|
76
|
+
* Named presets leave workspace visible; use 100% explicitly for the full available height.
|
|
77
|
+
* Defaults to 100% for left/right and 50% for top/bottom.
|
|
78
|
+
* Use auto for content height, with maxHeight to leave background visible underneath.
|
|
79
|
+
* A minimized side rail keeps an explicit height, or fits its title and controls for auto.
|
|
80
|
+
*/
|
|
81
|
+
height?: DockPanelHeight;
|
|
82
|
+
/**
|
|
83
|
+
* Optional. Maximum height as a CSS length or number in pixels; not a preset.
|
|
84
|
+
* For example, calc(100% - 4rem) reserves space below a side panel.
|
|
85
|
+
* At the limit, the body scrolls while the header and footer remain visible.
|
|
86
|
+
* @default 100%
|
|
87
|
+
*/
|
|
88
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
89
|
+
/**
|
|
90
|
+
* Optional. Overrides the title's HTML heading tag and expanded text size.
|
|
91
|
+
* When omitted, uses h3 for default and h4 for small. Minimized titles always use compact text.
|
|
92
|
+
* @default h3 (h4 when size is small)
|
|
93
|
+
*/
|
|
94
|
+
headingElement?: HeadingProps['element'];
|
|
95
|
+
}
|
|
96
|
+
export declare const DockPanel: import('react').ForwardRefExoticComponent<DockPanelProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
97
|
+
/**
|
|
98
|
+
* Shared layout for one DockPanel and its underlying application content.
|
|
99
|
+
* Expanded panels are out of flow. A minimized panel occupies a separate grid track,
|
|
100
|
+
* so the workspace resizes without being obscured by the rail.
|
|
101
|
+
* Keep the layout mounted when opening/closing the panel to preserve application state.
|
|
102
|
+
*/
|
|
103
|
+
export interface DockPanelLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
104
|
+
/** Required. Underlying application content, such as a map, editor or table. */
|
|
105
|
+
children: ReactNode;
|
|
106
|
+
/** Optional. One DockPanel, or a layout-aware wrapper containing it. Null means closed. */
|
|
107
|
+
panel?: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
export declare const DockPanelLayout: import('react').ForwardRefExoticComponent<DockPanelLayoutProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
110
|
+
export default DockPanel;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import j from "../../../../external/classnames/index.es.js";
|
|
4
|
+
import { forwardRef as M, useId as ae, useState as se, useRef as f, useEffect as z } from "react";
|
|
5
|
+
import { Heading as ce } from "../../../tedi/components/base/typography/heading/heading.es.js";
|
|
6
|
+
import { Button as F } from "../../../tedi/components/buttons/button/button.es.js";
|
|
7
|
+
import t from "./dock-panel.module.scss.es.js";
|
|
8
|
+
const ie = ["xs", "sm", "md", "lg", "xl"], de = {
|
|
9
|
+
xs: "25%",
|
|
10
|
+
sm: "35%",
|
|
11
|
+
md: "50%",
|
|
12
|
+
lg: "65%",
|
|
13
|
+
xl: "80%"
|
|
14
|
+
}, re = (n) => typeof n == "string" && ie.includes(n), O = (n) => re(n) ? de[n] : typeof n == "number" ? `${n}px` : n, ue = M((n, h) => {
|
|
15
|
+
const {
|
|
16
|
+
title: g,
|
|
17
|
+
children: _,
|
|
18
|
+
labels: s,
|
|
19
|
+
placement: G = "right",
|
|
20
|
+
size: b = "default",
|
|
21
|
+
collapsed: x,
|
|
22
|
+
defaultCollapsed: W = !1,
|
|
23
|
+
onCollapsedChange: y,
|
|
24
|
+
onClose: E,
|
|
25
|
+
headerActions: k,
|
|
26
|
+
footer: v,
|
|
27
|
+
width: I,
|
|
28
|
+
height: D,
|
|
29
|
+
maxHeight: d,
|
|
30
|
+
headingElement: q,
|
|
31
|
+
id: J,
|
|
32
|
+
className: K,
|
|
33
|
+
style: Q,
|
|
34
|
+
...C
|
|
35
|
+
} = n, U = ae(), N = J ?? `tedi-dock-panel-${U}`, T = `${N}-title`, R = `${N}-body`, [V, X] = se(W), Y = x !== void 0, o = x ?? V, r = f(null), u = f(null), S = f(null), m = f(!1);
|
|
36
|
+
z(() => {
|
|
37
|
+
var A;
|
|
38
|
+
const e = (A = r.current) == null ? void 0 : A.ownerDocument;
|
|
39
|
+
if (!e) return;
|
|
40
|
+
const c = () => {
|
|
41
|
+
var w, B, $;
|
|
42
|
+
const a = e.activeElement, H = !!(a && ((w = u.current) != null && w.contains(a) || (B = S.current) != null && B.contains(a)));
|
|
43
|
+
(H || a !== e.body || !(($ = u.current) != null && $.hidden)) && (m.current = H);
|
|
44
|
+
}, P = () => {
|
|
45
|
+
var a;
|
|
46
|
+
(a = u.current) != null && a.hidden || (m.current = !1);
|
|
47
|
+
};
|
|
48
|
+
return c(), e.addEventListener("focusin", c), e.addEventListener("focusout", P), () => {
|
|
49
|
+
e.removeEventListener("focusin", c), e.removeEventListener("focusout", P);
|
|
50
|
+
};
|
|
51
|
+
}, []), z(() => {
|
|
52
|
+
var e;
|
|
53
|
+
o && m.current && ((e = r.current) == null || e.focus(), m.current = !1);
|
|
54
|
+
}, [o]);
|
|
55
|
+
const Z = () => {
|
|
56
|
+
var c;
|
|
57
|
+
const e = !o;
|
|
58
|
+
(c = r.current) == null || c.focus(), Y || X(e), y == null || y(e);
|
|
59
|
+
}, p = { ...Q };
|
|
60
|
+
I !== void 0 && (p["--dock-panel-width"] = O(I)), D !== void 0 && (p["--dock-panel-height"] = O(D)), d !== void 0 && (p["--dock-panel-max-height"] = typeof d == "number" ? `${d}px` : d);
|
|
61
|
+
const ee = q ?? (b === "small" ? "h4" : "h3"), te = o ? "small" : void 0, L = o ? s.expand : s.collapse, ne = o ? "zoom_out_map" : "zoom_in_map", oe = k != null, le = v != null;
|
|
62
|
+
return /* @__PURE__ */ i(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
...C,
|
|
66
|
+
ref: h,
|
|
67
|
+
id: N,
|
|
68
|
+
role: "region",
|
|
69
|
+
"aria-labelledby": C["aria-labelledby"] ?? T,
|
|
70
|
+
"data-dock-panel": "",
|
|
71
|
+
"data-placement": G,
|
|
72
|
+
"data-size": b,
|
|
73
|
+
"data-collapsed": o,
|
|
74
|
+
className: j(t["tedi-dock-panel"], K),
|
|
75
|
+
style: p,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ i("div", { className: t["tedi-dock-panel__header"], children: [
|
|
78
|
+
/* @__PURE__ */ l(
|
|
79
|
+
ce,
|
|
80
|
+
{
|
|
81
|
+
id: T,
|
|
82
|
+
element: ee,
|
|
83
|
+
modifiers: te,
|
|
84
|
+
className: t["tedi-dock-panel__title"],
|
|
85
|
+
children: g
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
oe && /* @__PURE__ */ l("div", { ref: S, className: t["tedi-dock-panel__header-actions"], hidden: o, children: k }),
|
|
89
|
+
/* @__PURE__ */ i("div", { className: t["tedi-dock-panel__controls"], children: [
|
|
90
|
+
/* @__PURE__ */ l(
|
|
91
|
+
F,
|
|
92
|
+
{
|
|
93
|
+
ref: r,
|
|
94
|
+
className: t["tedi-dock-panel__toggle"],
|
|
95
|
+
type: "button",
|
|
96
|
+
visualType: "neutral",
|
|
97
|
+
icon: ne,
|
|
98
|
+
title: L,
|
|
99
|
+
"aria-expanded": !o,
|
|
100
|
+
"aria-controls": R,
|
|
101
|
+
onClick: Z,
|
|
102
|
+
children: L
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
E && /* @__PURE__ */ l(
|
|
106
|
+
F,
|
|
107
|
+
{
|
|
108
|
+
className: t["tedi-dock-panel__close"],
|
|
109
|
+
type: "button",
|
|
110
|
+
visualType: "neutral",
|
|
111
|
+
icon: "close",
|
|
112
|
+
title: s.close,
|
|
113
|
+
onClick: E,
|
|
114
|
+
children: s.close
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ i("div", { ref: u, id: R, className: t["tedi-dock-panel__body"], hidden: o, children: [
|
|
120
|
+
/* @__PURE__ */ l("div", { className: t["tedi-dock-panel__content"], children: /* @__PURE__ */ l("div", { className: t["tedi-dock-panel__content-inner"], children: _ }) }),
|
|
121
|
+
le && /* @__PURE__ */ l("div", { className: t["tedi-dock-panel__footer"], children: v })
|
|
122
|
+
] })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
});
|
|
127
|
+
ue.displayName = "DockPanel";
|
|
128
|
+
const me = M(
|
|
129
|
+
({ children: n, panel: h, className: g, ..._ }, s) => /* @__PURE__ */ i("div", { ..._, ref: s, className: j(t["tedi-dock-panel-layout"], g), children: [
|
|
130
|
+
/* @__PURE__ */ l("div", { className: t["tedi-dock-panel-layout__content"], "data-dock-panel-layout-content": "", children: n }),
|
|
131
|
+
h
|
|
132
|
+
] })
|
|
133
|
+
);
|
|
134
|
+
me.displayName = "DockPanelLayout";
|
|
135
|
+
export {
|
|
136
|
+
ue as DockPanel,
|
|
137
|
+
me as DockPanelLayout
|
|
138
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-dock-panel":"tedi-dock-panel-ef8c20a6","tedi-dock-panel-layout":"tedi-dock-panel-layout-cde58073","tedi-dock-panel__header":"tedi-dock-panel__header-b12fda64","tedi-dock-panel__title":"tedi-dock-panel__title-d31ae9ea","tedi-dock-panel__header-actions":"tedi-dock-panel__header-actions-6b6b0022","tedi-dock-panel__controls":"tedi-dock-panel__controls-ec981d75","tedi-dock-panel__toggle":"tedi-dock-panel__toggle-8b710f3d","tedi-dock-panel__close":"tedi-dock-panel__close-d516de11","tedi-dock-panel__body":"tedi-dock-panel__body-06c713da","tedi-dock-panel__content":"tedi-dock-panel__content-417ece1d","tedi-dock-panel__content-inner":"tedi-dock-panel__content-inner-3ea8c932","tedi-dock-panel__footer":"tedi-dock-panel__footer-364577b7","tedi-dock-panel-layout__content":"tedi-dock-panel-layout__content-cff421e0"};exports.default=e;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
"tedi-dock-panel": "tedi-dock-panel-ef8c20a6",
|
|
3
|
+
"tedi-dock-panel-layout": "tedi-dock-panel-layout-cde58073",
|
|
4
|
+
"tedi-dock-panel__header": "tedi-dock-panel__header-b12fda64",
|
|
5
|
+
"tedi-dock-panel__title": "tedi-dock-panel__title-d31ae9ea",
|
|
6
|
+
"tedi-dock-panel__header-actions": "tedi-dock-panel__header-actions-6b6b0022",
|
|
7
|
+
"tedi-dock-panel__controls": "tedi-dock-panel__controls-ec981d75",
|
|
8
|
+
"tedi-dock-panel__toggle": "tedi-dock-panel__toggle-8b710f3d",
|
|
9
|
+
"tedi-dock-panel__close": "tedi-dock-panel__close-d516de11",
|
|
10
|
+
"tedi-dock-panel__body": "tedi-dock-panel__body-06c713da",
|
|
11
|
+
"tedi-dock-panel__content": "tedi-dock-panel__content-417ece1d",
|
|
12
|
+
"tedi-dock-panel__content-inner": "tedi-dock-panel__content-inner-3ea8c932",
|
|
13
|
+
"tedi-dock-panel__footer": "tedi-dock-panel__footer-364577b7",
|
|
14
|
+
"tedi-dock-panel-layout__content": "tedi-dock-panel-layout__content-cff421e0"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
e as default
|
|
18
|
+
};
|
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 e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("../../../../../external/classnames/index.cjs.js"),h=require("react"),I=require("../../../../tedi/components/buttons/button/button.cjs.js"),P=require("../../../../tedi/components/form/field/field.cjs.js"),R=require("../../../../tedi/components/form/input-group/input-group.cjs.js"),k=require("../../../../tedi/components/form/slider/slider.cjs.js"),G=require("../map-button/map-button.cjs.js"),x=require("./base-map-option.cjs.js"),t=require("./base-map-selection.module.scss.cjs.js"),$=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),f=require("../../../../tedi/helpers/hooks/use-breakpoint.cjs.js"),r=require("../../../../tedi/components/overlays/popover/popover.cjs.js"),z=require("../../../../tedi/components/form/input-group/components/input/input.cjs.js"),D=require("../../../../tedi/components/form/input-group/components/suffix/suffix.cjs.js"),o=s=>{const n=Number(s);return Number.isNaN(n)?0:Math.min(100,Math.max(0,n))};function l(s){const{title:n,content:y,children:j,multiple:g=!1,showTransparency:q=!1,transparency:c,defaultTransparency:M,onTransparencyChange:i,id:a}=s,{getLabel:B}=$.useLabels(),S=f.isBreakpointBelow(f.default(),"md"),[v,_]=h.useState(!1),u=B("baseMapSelection.transparency"),d=c!==void 0,[N,L]=h.useState(()=>o(M??0)),p=o(d?c:N),m=w=>{const b=o(w);d||L(b),i==null||i(b)},O=C.default(t.default["tedi-base-map-selection__wrapper"],t.default["tedi-base-map-selection--button"],g&&t.default["tedi-base-map-selection--multiple"]),T=S?e.jsx(G.MapButton,{id:a,icon:"map",showDropdownIndicator:!0,hideLabel:!0,iconSize:24,tooltipContent:null,selected:v,children:n}):e.jsxs(I.Button,{noStyle:!0,id:a,className:O,children:[e.jsx("div",{className:t.default["tedi-base-map-selection__content"],"aria-hidden":!0,children:y}),e.jsx("div",{className:t.default["tedi-base-map-selection__title"],children:n})]});return e.jsxs(r.Popover,{placement:"top-start",onToggle:_,children:[e.jsx(r.Popover.Trigger,{children:T}),e.jsxs(r.Popover.Content,{width:"medium",children:[e.jsx("div",{className:t.default["tedi-base-map-selection__options"],children:j}),q&&e.jsx("div",{className:t.default["tedi-base-map-selection__transparency"],children:e.jsx(k.Slider,{"aria-label":u,min:0,max:100,value:p,onChange:m,minLabel:"0%",maxLabel:"100%",addonRight:e.jsx("div",{className:t.default["tedi-base-map-selection__transparency-field"],children:e.jsxs(R.InputGroupBase,{id:`${a}-transparency`,label:u,hideLabel:!0,children:[e.jsx(z.Input,{children:e.jsx(P.Field,{type:"number",id:`${a}-transparency`,value:String(p),onChange:m})}),e.jsx(D.Suffix,{children:"%"})]})})})})]})]})}l.Option=x.BaseMapOption;l.displayName="BaseMapSelection";exports.BaseMapOption=x.BaseMapOption;exports.BaseMapSelection=l;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import O from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import { useState as h } from "react";
|
|
4
4
|
import { Button as j } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
5
5
|
import { Field as k } from "../../../../tedi/components/form/field/field.es.js";
|
|
6
6
|
import { InputGroupBase as $ } from "../../../../tedi/components/form/input-group/input-group.es.js";
|
|
7
|
-
import { Slider as
|
|
8
|
-
import { MapButton as
|
|
9
|
-
import { BaseMapOption as
|
|
7
|
+
import { Slider as z } from "../../../../tedi/components/form/slider/slider.es.js";
|
|
8
|
+
import { MapButton as D } from "../map-button/map-button.es.js";
|
|
9
|
+
import { BaseMapOption as E } from "./base-map-option.es.js";
|
|
10
10
|
import t from "./base-map-selection.module.scss.es.js";
|
|
11
|
-
import { useLabels as
|
|
12
|
-
import
|
|
11
|
+
import { useLabels as F } from "../../../../tedi/providers/label-provider/use-labels.es.js";
|
|
12
|
+
import G, { isBreakpointBelow as P } from "../../../../tedi/helpers/hooks/use-breakpoint.es.js";
|
|
13
13
|
import { Popover as s } from "../../../../tedi/components/overlays/popover/popover.es.js";
|
|
14
|
-
import { Input as
|
|
15
|
-
import { Suffix as
|
|
14
|
+
import { Input as R } from "../../../../tedi/components/form/input-group/components/input/input.es.js";
|
|
15
|
+
import { Suffix as U } from "../../../../tedi/components/form/input-group/components/suffix/suffix.es.js";
|
|
16
16
|
const l = (i) => {
|
|
17
17
|
const n = Number(i);
|
|
18
18
|
return Number.isNaN(n) ? 0 : Math.min(100, Math.max(0, n));
|
|
@@ -28,25 +28,25 @@ function b(i) {
|
|
|
28
28
|
defaultTransparency: B,
|
|
29
29
|
onTransparencyChange: o,
|
|
30
30
|
id: a
|
|
31
|
-
} = i, { getLabel: v } =
|
|
31
|
+
} = i, { getLabel: v } = F(), x = P(G(), "md"), [M, S] = h(!1), p = v("baseMapSelection.transparency"), m = c !== void 0, [L, T] = h(
|
|
32
32
|
() => l(B ?? 0)
|
|
33
|
-
), d = l(m ? c : L), u = (
|
|
34
|
-
const f = l(
|
|
33
|
+
), d = l(m ? c : L), u = (I) => {
|
|
34
|
+
const f = l(I);
|
|
35
35
|
m || T(f), o == null || o(f);
|
|
36
|
-
},
|
|
36
|
+
}, w = O(
|
|
37
37
|
t["tedi-base-map-selection__wrapper"],
|
|
38
38
|
t["tedi-base-map-selection--button"],
|
|
39
39
|
N && t["tedi-base-map-selection--multiple"]
|
|
40
|
-
),
|
|
40
|
+
), C = x ? /* @__PURE__ */ e(D, { id: a, icon: "map", showDropdownIndicator: !0, hideLabel: !0, iconSize: 24, tooltipContent: null, selected: M, children: n }) : /* @__PURE__ */ r(j, { noStyle: !0, id: a, className: w, children: [
|
|
41
41
|
/* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__content"], "aria-hidden": !0, children: y }),
|
|
42
42
|
/* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__title"], children: n })
|
|
43
43
|
] });
|
|
44
44
|
return /* @__PURE__ */ r(s, { placement: "top-start", onToggle: S, children: [
|
|
45
|
-
/* @__PURE__ */ e(s.Trigger, { children:
|
|
45
|
+
/* @__PURE__ */ e(s.Trigger, { children: C }),
|
|
46
46
|
/* @__PURE__ */ r(s.Content, { width: "medium", children: [
|
|
47
47
|
/* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__options"], children: g }),
|
|
48
48
|
_ && /* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__transparency"], children: /* @__PURE__ */ e(
|
|
49
|
-
|
|
49
|
+
z,
|
|
50
50
|
{
|
|
51
51
|
"aria-label": p,
|
|
52
52
|
min: 0,
|
|
@@ -56,7 +56,7 @@ function b(i) {
|
|
|
56
56
|
minLabel: "0%",
|
|
57
57
|
maxLabel: "100%",
|
|
58
58
|
addonRight: /* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__transparency-field"], children: /* @__PURE__ */ r($, { id: `${a}-transparency`, label: p, hideLabel: !0, children: [
|
|
59
|
-
/* @__PURE__ */ e(
|
|
59
|
+
/* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(
|
|
60
60
|
k,
|
|
61
61
|
{
|
|
62
62
|
type: "number",
|
|
@@ -65,16 +65,16 @@ function b(i) {
|
|
|
65
65
|
onChange: u
|
|
66
66
|
}
|
|
67
67
|
) }),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e(U, { children: "%" })
|
|
69
69
|
] }) })
|
|
70
70
|
}
|
|
71
71
|
) })
|
|
72
72
|
] })
|
|
73
73
|
] });
|
|
74
74
|
}
|
|
75
|
-
b.Option =
|
|
75
|
+
b.Option = E;
|
|
76
76
|
b.displayName = "BaseMapSelection";
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
E as BaseMapOption,
|
|
79
79
|
b as BaseMapSelection
|
|
80
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),b=require("../../../../../external/classnames/index.cjs.js"),h=require("react"),y=require("../../../../tedi/components/base/icon/icon.cjs.js"),O=require("../../../../tedi/components/loaders/spinner/spinner.cjs.js"),A=require("../../../../tedi/components/buttons/button/button.cjs.js"),l=require("../map-dropdown/map-dropdown.cjs.js"),t=require("./map-button.module.scss.cjs.js"),d=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),u=h.forwardRef((x,j)=>{const{size:n="default",icon:c,selected:g=!1,className:w,children:i,hideLabel:p=!1,tooltipContent:m=i,dropdownItems:s,showDropdownIndicator:v=!1,isActive:q,isHovered:D,underline:M,isLoading:a,iconSize:f,..._}=x,[S,B]=h.useState(!1),C=g||S,N=b.default(t.default["tedi-map-button"],t.default[`tedi-map-button--${n}`],C&&t.default["tedi-map-button--selected"],(s||v)&&t.default["tedi-map-button--dropdown"],q&&t.default["tedi-map-button--is-active"],D&&t.default["tedi-map-button--is-hovered"],M&&t.default["tedi-map-button--underline"],a&&t.default["tedi-map-button--loading"],w),T=()=>f||(n==="small"?24:18),z=e.jsxs(e.Fragment,{children:[a?e.jsx(O.Spinner,{size:n==="small"?16:18,className:t.default["tedi-map-button__icon"]}):c&&e.jsx(y.Icon,{name:c,className:t.default["tedi-map-button__icon"],size:T()}),p?e.jsx("span",{className:"sr-only",children:i}):e.jsx("div",{className:b.default(t.default["tedi-map-button__text"]),children:i})]}),r=e.jsx(A.Button,{noStyle:!0,isLoading:a,className:N,size:n,..._,ref:j,children:z}),I=p&&m?e.jsxs(d.Tooltip,{placement:"right",children:[e.jsx(d.Tooltip.Trigger,{children:r}),e.jsx(d.Tooltip.Content,{children:m})]}):r;return s?e.jsxs(l.MapDropdown,{onOpenChange:B,placement:"right-start",children:[e.jsx(l.MapDropdown.Trigger,{children:r}),e.jsx(l.MapDropdown.Content,{items:s.map(o=>({children:o.children,onClick:o.onClick,isActive:o.isActive,isDisabled:o.isDisabled}))})]}):I});u.displayName="MapButton";exports.MapButton=u;exports.default=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonProps } from '../../../../tedi';
|
|
1
|
+
import { ButtonProps, IconSize } from '../../../../tedi';
|
|
2
2
|
import { MapDropdownItem } from '../map-dropdown/map-dropdown';
|
|
3
3
|
/**
|
|
4
4
|
* Button props that don't apply to MapButton because it renders `<Button noStyle>` with its own
|
|
@@ -37,6 +37,15 @@ export interface MapButtonProps extends Omit<ButtonProps, OmittedButtonProps> {
|
|
|
37
37
|
* When provided, the button can toggle a dropdown menu.
|
|
38
38
|
*/
|
|
39
39
|
dropdownItems?: MapDropdownItem[];
|
|
40
|
+
/**
|
|
41
|
+
* Renders the dropdown indicator arrow in the bottom-right corner without wiring up a dropdown.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
showDropdownIndicator?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Size of the icon displayed on the button.
|
|
47
|
+
*/
|
|
48
|
+
iconSize?: IconSize;
|
|
40
49
|
}
|
|
41
50
|
export declare const MapButton: import('react').ForwardRefExoticComponent<Omit<MapButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
42
51
|
export default MapButton;
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsxs as l, Fragment as
|
|
1
|
+
import { jsxs as l, Fragment as A, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import b from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Spinner as
|
|
6
|
-
import { Button as
|
|
3
|
+
import { forwardRef as O, useState as j } from "react";
|
|
4
|
+
import { Icon as k } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import { Spinner as E } from "../../../../tedi/components/loaders/spinner/spinner.es.js";
|
|
6
|
+
import { Button as L } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
7
7
|
import { MapDropdown as d } from "../map-dropdown/map-dropdown.es.js";
|
|
8
8
|
import t from "./map-button.module.scss.es.js";
|
|
9
9
|
import { Tooltip as m } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
10
|
-
const
|
|
10
|
+
const F = O((h, g) => {
|
|
11
11
|
const {
|
|
12
12
|
size: o = "default",
|
|
13
|
-
icon:
|
|
14
|
-
selected:
|
|
15
|
-
className:
|
|
13
|
+
icon: c,
|
|
14
|
+
selected: v = !1,
|
|
15
|
+
className: w,
|
|
16
16
|
children: i,
|
|
17
|
-
hideLabel:
|
|
17
|
+
hideLabel: p = !1,
|
|
18
18
|
tooltipContent: u = i,
|
|
19
19
|
dropdownItems: s,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
showDropdownIndicator: N = !1,
|
|
21
|
+
isActive: C,
|
|
22
|
+
isHovered: D,
|
|
23
|
+
underline: S,
|
|
23
24
|
isLoading: r,
|
|
25
|
+
iconSize: f,
|
|
24
26
|
..._
|
|
25
|
-
} =
|
|
27
|
+
} = h, [z, B] = j(!1), I = v || z, x = b(
|
|
26
28
|
t["tedi-map-button"],
|
|
27
29
|
t[`tedi-map-button--${o}`],
|
|
28
|
-
|
|
29
|
-
s && t["tedi-map-button--dropdown"],
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
I && t["tedi-map-button--selected"],
|
|
31
|
+
(s || N) && t["tedi-map-button--dropdown"],
|
|
32
|
+
C && t["tedi-map-button--is-active"],
|
|
33
|
+
D && t["tedi-map-button--is-hovered"],
|
|
34
|
+
S && t["tedi-map-button--underline"],
|
|
33
35
|
r && t["tedi-map-button--loading"],
|
|
34
|
-
|
|
35
|
-
), M = /* @__PURE__ */ l(
|
|
36
|
-
r ? /* @__PURE__ */ e(
|
|
37
|
-
|
|
38
|
-
] }), a = /* @__PURE__ */ e(
|
|
36
|
+
w
|
|
37
|
+
), y = () => f || (o === "small" ? 24 : 18), M = /* @__PURE__ */ l(A, { children: [
|
|
38
|
+
r ? /* @__PURE__ */ e(E, { size: o === "small" ? 16 : 18, className: t["tedi-map-button__icon"] }) : c && /* @__PURE__ */ e(k, { name: c, className: t["tedi-map-button__icon"], size: y() }),
|
|
39
|
+
p ? /* @__PURE__ */ e("span", { className: "sr-only", children: i }) : /* @__PURE__ */ e("div", { className: b(t["tedi-map-button__text"]), children: i })
|
|
40
|
+
] }), a = /* @__PURE__ */ e(L, { noStyle: !0, isLoading: r, className: x, size: o, ..._, ref: g, children: M }), T = p && u ? /* @__PURE__ */ l(m, { placement: "right", children: [
|
|
39
41
|
/* @__PURE__ */ e(m.Trigger, { children: a }),
|
|
40
42
|
/* @__PURE__ */ e(m.Content, { children: u })
|
|
41
43
|
] }) : a;
|
|
42
|
-
return s ? /* @__PURE__ */ l(d, { onOpenChange:
|
|
44
|
+
return s ? /* @__PURE__ */ l(d, { onOpenChange: B, placement: "right-start", children: [
|
|
43
45
|
/* @__PURE__ */ e(d.Trigger, { children: a }),
|
|
44
46
|
/* @__PURE__ */ e(
|
|
45
47
|
d.Content,
|
|
@@ -52,10 +54,10 @@ const k = z((f, h) => {
|
|
|
52
54
|
}))
|
|
53
55
|
}
|
|
54
56
|
)
|
|
55
|
-
] }) :
|
|
57
|
+
] }) : T;
|
|
56
58
|
});
|
|
57
|
-
|
|
59
|
+
F.displayName = "MapButton";
|
|
58
60
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
F as MapButton,
|
|
62
|
+
F as default
|
|
61
63
|
};
|
package/src/community/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from './components/placeholder/placeholder';
|
|
|
29
29
|
export * from './components/vertical-stepper/vertical-stepper';
|
|
30
30
|
export * from './components/vertical-stepper/step-item/step-item';
|
|
31
31
|
export * from './components/vertical-stepper/sub-item/sub-item';
|
|
32
|
+
export * from './components/dock-panel/dock-panel';
|
|
32
33
|
export * from './helpers';
|
|
33
34
|
export * from './providers/style-provider/style-provider';
|
|
34
35
|
export * from './types/index';
|