@tedi-design-system/react 19.1.0-rc.6 → 19.1.0-rc.8
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/index.css +1 -1
- package/package.json +2 -2
- package/src/community/components/map-components/base-map-selection/base-map-option.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-option.d.ts +8 -5
- package/src/community/components/map-components/base-map-selection/base-map-option.es.js +63 -65
- 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 +1 -4
- package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +55 -55
- 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 +2 -3
- package/src/community/components/map-components/map-button/map-button.es.js +37 -36
- package/src/tedi/components/misc/affix/affix.cjs.js +1 -1
- package/src/tedi/components/misc/affix/affix.es.js +20 -8
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.d.ts +9 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.es.js +78 -39
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-item/table-of-contents-item.d.ts +6 -0
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.es.js +23 -28
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.d.ts +32 -21
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.es.js +58 -55
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.module.scss.es.js +4 -1
- 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
|
@@ -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.8",
|
|
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,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@mui/material": "^5.15.13",
|
|
48
48
|
"@mui/x-date-pickers": "^5.0.20",
|
|
49
49
|
"@tanstack/react-table": "^8.13.2",
|
|
50
|
-
"@tedi-design-system/core": "^6.
|
|
50
|
+
"@tedi-design-system/core": "^6.9.0",
|
|
51
51
|
"classnames": "^2.5.1",
|
|
52
52
|
"draft-js": "^0.11.7",
|
|
53
53
|
"draftjs-md-converter": "^1.5.2",
|
|
@@ -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"),M=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),y=require("../../../../tedi/components/base/icon/icon.cjs.js"),N=require("../../../../tedi/components/buttons/button/button.cjs.js"),t=require("./base-map-selection.module.scss.cjs.js"),B=require("../../../../tedi/helpers/hooks/use-element-size.cjs.js"),d=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),c=h=>{const{title:s,content:x,selected:u,onSelect:a,type:p="selection",className:j,id:_,multiple:T,disabled:n,tooltipText:i,tooltipType:f="info"}=h,o=r.useRef(null),q=B.useElementSize(o),[m,S]=r.useState(!1);r.useEffect(()=>{const l=o.current;l&&S(l.scrollWidth>l.clientWidth)},[q,s]);const g=()=>{n||a==null||a()},v=M.default(t.default["tedi-base-map-selection__wrapper"],u&&t.default["tedi-base-map-selection--selected"],p&&t.default[`tedi-base-map-selection--${p}`],T&&t.default["tedi-base-map-selection--multiple"],n&&t.default["tedi-base-map-selection--disabled"],j),b=e.jsxs(N.Button,{noStyle:!0,disabled:n&&!i,"aria-pressed":!!u,"aria-disabled":n||void 0,onClick:g,className:v,id:_,children:[e.jsx("div",{"aria-hidden":!0,className:t.default["tedi-base-map-selection__content"],children:x}),i&&e.jsx("span",{className:t.default["tedi-base-map-selection__info"],children:e.jsx(y.Icon,{background:"brand-secondary",name:f==="error"?"error":"info",size:16,color:f==="error"?"danger":"brand"})}),e.jsx("div",{ref:o,className:t.default["tedi-base-map-selection__title"],children:s})]});return!i&&!m?b:e.jsxs(d.Tooltip,{ariaHidden:!i,openWith:"hover",children:[e.jsx(d.Tooltip.Trigger,{children:b}),e.jsx(d.Tooltip.Content,{children:i?e.jsxs(e.Fragment,{children:[m&&e.jsx("div",{"aria-hidden":!0,children:s}),i]}):s})]})};c.displayName="BaseMapOption";exports.BaseMapOption=c;exports.default=c;
|
|
@@ -45,14 +45,17 @@ export interface BaseMapOptionProps {
|
|
|
45
45
|
*/
|
|
46
46
|
disabled?: boolean;
|
|
47
47
|
/**
|
|
48
|
-
* Text shown in a tooltip. When set, an info icon is rendered in the middle of
|
|
49
|
-
* the option
|
|
48
|
+
* Text shown in a tooltip. When set, an info icon is rendered in the middle of the
|
|
49
|
+
* option and hovering anywhere on the option reveals this text. A title too long to
|
|
50
|
+
* fit is shown above it in the same tooltip rather than in a second, competing one.
|
|
50
51
|
*/
|
|
51
52
|
tooltipText?: string;
|
|
52
53
|
/**
|
|
53
|
-
*
|
|
54
|
-
* - `'info'`: neutral
|
|
55
|
-
* - `'error'`: error
|
|
54
|
+
* Which icon and colour the tooltip indicator uses.
|
|
55
|
+
* - `'info'`: neutral info icon in the brand colour (default)
|
|
56
|
+
* - `'error'`: error icon in the danger colour, for a layer that is unavailable
|
|
57
|
+
*
|
|
58
|
+
* Only takes effect when `tooltipText` is set, since that is what renders the icon.
|
|
56
59
|
* @default 'info'
|
|
57
60
|
*/
|
|
58
61
|
tooltipType?: BaseMapOptionTooltipType;
|
|
@@ -1,75 +1,73 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsxs as l, jsx as t, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import S from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useRef as z, useState as E, useEffect as M } from "react";
|
|
4
|
+
import { Icon as W } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import { Button as j } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
6
|
+
import e from "./base-map-selection.module.scss.es.js";
|
|
7
|
+
import { useElementSize as k } from "../../../../tedi/helpers/hooks/use-element-size.es.js";
|
|
8
|
+
import { Tooltip as d } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
9
|
+
const C = (h) => {
|
|
9
10
|
const {
|
|
10
|
-
title:
|
|
11
|
-
content:
|
|
12
|
-
selected:
|
|
13
|
-
onSelect:
|
|
14
|
-
type:
|
|
15
|
-
className:
|
|
16
|
-
id:
|
|
17
|
-
multiple:
|
|
18
|
-
disabled:
|
|
19
|
-
tooltipText:
|
|
11
|
+
title: o,
|
|
12
|
+
content: b,
|
|
13
|
+
selected: c,
|
|
14
|
+
onSelect: s,
|
|
15
|
+
type: m = "selection",
|
|
16
|
+
className: _,
|
|
17
|
+
id: N,
|
|
18
|
+
multiple: y,
|
|
19
|
+
disabled: r,
|
|
20
|
+
tooltipText: i,
|
|
20
21
|
tooltipType: p = "info"
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_
|
|
35
|
-
|
|
36
|
-
|
|
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",
|
|
22
|
+
} = h, n = z(null), T = k(n), [f, g] = E(!1);
|
|
23
|
+
M(() => {
|
|
24
|
+
const a = n.current;
|
|
25
|
+
a && g(a.scrollWidth > a.clientWidth);
|
|
26
|
+
}, [T, o]);
|
|
27
|
+
const v = () => {
|
|
28
|
+
r || s == null || s();
|
|
29
|
+
}, x = S(
|
|
30
|
+
e["tedi-base-map-selection__wrapper"],
|
|
31
|
+
c && e["tedi-base-map-selection--selected"],
|
|
32
|
+
m && e[`tedi-base-map-selection--${m}`],
|
|
33
|
+
y && e["tedi-base-map-selection--multiple"],
|
|
34
|
+
r && e["tedi-base-map-selection--disabled"],
|
|
35
|
+
_
|
|
36
|
+
), u = /* @__PURE__ */ l(
|
|
37
|
+
j,
|
|
43
38
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"aria-pressed": !!
|
|
47
|
-
"aria-disabled":
|
|
48
|
-
onClick:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
id: y,
|
|
39
|
+
noStyle: !0,
|
|
40
|
+
disabled: r && !i,
|
|
41
|
+
"aria-pressed": !!c,
|
|
42
|
+
"aria-disabled": r || void 0,
|
|
43
|
+
onClick: v,
|
|
44
|
+
className: x,
|
|
45
|
+
id: N,
|
|
52
46
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ e(s.Content, { children: m })
|
|
65
|
-
] }),
|
|
66
|
-
I
|
|
47
|
+
/* @__PURE__ */ t("div", { "aria-hidden": !0, className: e["tedi-base-map-selection__content"], children: b }),
|
|
48
|
+
i && /* @__PURE__ */ t("span", { className: e["tedi-base-map-selection__info"], children: /* @__PURE__ */ t(
|
|
49
|
+
W,
|
|
50
|
+
{
|
|
51
|
+
background: "brand-secondary",
|
|
52
|
+
name: p === "error" ? "error" : "info",
|
|
53
|
+
size: 16,
|
|
54
|
+
color: p === "error" ? "danger" : "brand"
|
|
55
|
+
}
|
|
56
|
+
) }),
|
|
57
|
+
/* @__PURE__ */ t("div", { ref: n, className: e["tedi-base-map-selection__title"], children: o })
|
|
67
58
|
]
|
|
68
59
|
}
|
|
69
60
|
);
|
|
61
|
+
return !i && !f ? u : /* @__PURE__ */ l(d, { ariaHidden: !i, openWith: "hover", children: [
|
|
62
|
+
/* @__PURE__ */ t(d.Trigger, { children: u }),
|
|
63
|
+
/* @__PURE__ */ t(d.Content, { children: i ? /* @__PURE__ */ l(B, { children: [
|
|
64
|
+
f && /* @__PURE__ */ t("div", { "aria-hidden": !0, children: o }),
|
|
65
|
+
i
|
|
66
|
+
] }) : o })
|
|
67
|
+
] });
|
|
70
68
|
};
|
|
71
|
-
|
|
69
|
+
C.displayName = "BaseMapOption";
|
|
72
70
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
C as BaseMapOption,
|
|
72
|
+
C as default
|
|
75
73
|
};
|
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"),w=require("../../../../../external/classnames/index.cjs.js"),f=require("react"),P=require("../../../../tedi/components/buttons/button/button.cjs.js"),I=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"),h=require("../../../../tedi/helpers/hooks/use-breakpoint.cjs.js"),r=require("../../../../tedi/components/overlays/popover/popover.cjs.js"),E=require("../../../../tedi/components/form/input-group/components/input/input.cjs.js"),F=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(),v=h.isBreakpointBelow(h.default(),"md"),[S,_]=f.useState(!1),u=B("baseMapSelection.transparency"),d=c!==void 0,[N,L]=f.useState(()=>o(M??0)),p=o(d?c:N),m=C=>{const b=o(C);d||L(b),i==null||i(b)},O=w.default(t.default["tedi-base-map-selection__wrapper"],t.default["tedi-base-map-selection--button"],g&&t.default["tedi-base-map-selection--multiple"]),T=v?e.jsx(G.MapButton,{id:a,icon:"map",hideLabel:!0,tooltipContent:null,selected:S,children:n}):e.jsxs(P.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(E.Input,{children:e.jsx(I.Field,{type:"number",id:`${a}-transparency`,value:String(p),onChange:m})}),e.jsx(F.Suffix,{children:"%"})]})})})})]})]})}l.Option=x.BaseMapOption;l.displayName="BaseMapSelection";exports.BaseMapOption=x.BaseMapOption;exports.BaseMapSelection=l;
|
|
@@ -15,6 +15,7 @@ export interface BaseMapSelectionProps {
|
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
/**
|
|
17
17
|
* Renders a "stacked" trigger, indicating that multiple base maps are available.
|
|
18
|
+
* Has no effect below the `md` breakpoint, where the trigger is a `MapButton`.
|
|
18
19
|
* @default false
|
|
19
20
|
*/
|
|
20
21
|
multiple?: boolean;
|
|
@@ -37,10 +38,6 @@ export interface BaseMapSelectionProps {
|
|
|
37
38
|
* Callback fired when the transparency value changes. The reported value is always clamped to 0-100.
|
|
38
39
|
*/
|
|
39
40
|
onTransparencyChange?: (value: number) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Label for the transparency slider.
|
|
42
|
-
*/
|
|
43
|
-
transparencyLabel?: string;
|
|
44
41
|
/**
|
|
45
42
|
* HTML `id` attribute applied to the trigger button.
|
|
46
43
|
*/
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Field as
|
|
6
|
-
import { InputGroupBase as
|
|
7
|
-
import { Slider as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import I from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { Button as j } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
5
|
+
import { Field as k } from "../../../../tedi/components/form/field/field.es.js";
|
|
6
|
+
import { InputGroupBase as $ } from "../../../../tedi/components/form/input-group/input-group.es.js";
|
|
7
|
+
import { Slider as E } from "../../../../tedi/components/form/slider/slider.es.js";
|
|
8
|
+
import { MapButton as F } from "../map-button/map-button.es.js";
|
|
9
|
+
import { BaseMapOption as G } from "./base-map-option.es.js";
|
|
10
|
+
import t from "./base-map-selection.module.scss.es.js";
|
|
11
|
+
import { useLabels as P } from "../../../../tedi/providers/label-provider/use-labels.es.js";
|
|
12
|
+
import R, { isBreakpointBelow as U } from "../../../../tedi/helpers/hooks/use-breakpoint.es.js";
|
|
13
|
+
import { Popover as s } from "../../../../tedi/components/overlays/popover/popover.es.js";
|
|
14
|
+
import { Input as V } from "../../../../tedi/components/form/input-group/components/input/input.es.js";
|
|
15
|
+
import { Suffix as q } from "../../../../tedi/components/form/input-group/components/suffix/suffix.es.js";
|
|
16
|
+
const l = (i) => {
|
|
17
|
+
const n = Number(i);
|
|
15
18
|
return Number.isNaN(n) ? 0 : Math.min(100, Math.max(0, n));
|
|
16
19
|
};
|
|
17
|
-
function
|
|
20
|
+
function b(i) {
|
|
18
21
|
const {
|
|
19
22
|
title: n,
|
|
20
|
-
content:
|
|
21
|
-
children:
|
|
22
|
-
multiple:
|
|
23
|
-
showTransparency:
|
|
24
|
-
transparency:
|
|
25
|
-
defaultTransparency:
|
|
26
|
-
onTransparencyChange:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
N && /* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__transparency"], children: /* @__PURE__ */ e(
|
|
48
|
-
j,
|
|
23
|
+
content: y,
|
|
24
|
+
children: g,
|
|
25
|
+
multiple: N = !1,
|
|
26
|
+
showTransparency: _ = !1,
|
|
27
|
+
transparency: c,
|
|
28
|
+
defaultTransparency: B,
|
|
29
|
+
onTransparencyChange: o,
|
|
30
|
+
id: a
|
|
31
|
+
} = i, { getLabel: v } = P(), x = U(R(), "md"), [M, S] = h(!1), p = v("baseMapSelection.transparency"), m = c !== void 0, [L, T] = h(
|
|
32
|
+
() => l(B ?? 0)
|
|
33
|
+
), d = l(m ? c : L), u = (O) => {
|
|
34
|
+
const f = l(O);
|
|
35
|
+
m || T(f), o == null || o(f);
|
|
36
|
+
}, C = I(
|
|
37
|
+
t["tedi-base-map-selection__wrapper"],
|
|
38
|
+
t["tedi-base-map-selection--button"],
|
|
39
|
+
N && t["tedi-base-map-selection--multiple"]
|
|
40
|
+
), w = x ? /* @__PURE__ */ e(F, { id: a, icon: "map", hideLabel: !0, tooltipContent: null, selected: M, children: n }) : /* @__PURE__ */ r(j, { noStyle: !0, id: a, className: C, children: [
|
|
41
|
+
/* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__content"], "aria-hidden": !0, children: y }),
|
|
42
|
+
/* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__title"], children: n })
|
|
43
|
+
] });
|
|
44
|
+
return /* @__PURE__ */ r(s, { placement: "top-start", onToggle: S, children: [
|
|
45
|
+
/* @__PURE__ */ e(s.Trigger, { children: w }),
|
|
46
|
+
/* @__PURE__ */ r(s.Content, { width: "medium", children: [
|
|
47
|
+
/* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__options"], children: g }),
|
|
48
|
+
_ && /* @__PURE__ */ e("div", { className: t["tedi-base-map-selection__transparency"], children: /* @__PURE__ */ e(
|
|
49
|
+
E,
|
|
49
50
|
{
|
|
50
|
-
label:
|
|
51
|
-
"aria-label": s || "Transparency",
|
|
51
|
+
"aria-label": p,
|
|
52
52
|
min: 0,
|
|
53
53
|
max: 100,
|
|
54
54
|
value: d,
|
|
55
55
|
onChange: u,
|
|
56
56
|
minLabel: "0%",
|
|
57
57
|
maxLabel: "100%",
|
|
58
|
-
addonRight: /* @__PURE__ */ e("div", { className:
|
|
59
|
-
/* @__PURE__ */ e(
|
|
60
|
-
|
|
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(V, { children: /* @__PURE__ */ e(
|
|
60
|
+
k,
|
|
61
61
|
{
|
|
62
62
|
type: "number",
|
|
63
|
-
id: `${
|
|
63
|
+
id: `${a}-transparency`,
|
|
64
64
|
value: String(d),
|
|
65
65
|
onChange: u
|
|
66
66
|
}
|
|
67
67
|
) }),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e(q, { children: "%" })
|
|
69
69
|
] }) })
|
|
70
70
|
}
|
|
71
71
|
) })
|
|
72
72
|
] })
|
|
73
73
|
] });
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
b.Option = G;
|
|
76
|
+
b.displayName = "BaseMapSelection";
|
|
77
77
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
G as BaseMapOption,
|
|
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"),f=require("../../../../../external/classnames/index.cjs.js"),b=require("react"),S=require("../../../../tedi/components/base/icon/icon.cjs.js"),y=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"),r=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),u=b.forwardRef((h,x)=>{const{size:n="default",icon:c,selected:j=!1,className:g,children:s,hideLabel:p=!1,tooltipContent:m=s,dropdownItems:i,isActive:q,isHovered:v,underline:w,isLoading:a,...M}=h,[_,D]=b.useState(!1),B=j||_,C=f.default(t.default["tedi-map-button"],t.default[`tedi-map-button--${n}`],B&&t.default["tedi-map-button--selected"],i&&t.default["tedi-map-button--dropdown"],q&&t.default["tedi-map-button--is-active"],v&&t.default["tedi-map-button--is-hovered"],w&&t.default["tedi-map-button--underline"],a&&t.default["tedi-map-button--loading"],g),N=e.jsxs(e.Fragment,{children:[a?e.jsx(y.Spinner,{size:n==="small"?16:18,className:t.default["tedi-map-button__icon"]}):c&&e.jsx(S.Icon,{name:c,className:t.default["tedi-map-button__icon"],size:n==="small"?24:18}),p?e.jsx("span",{className:"sr-only",children:s}):e.jsx("div",{className:f.default(t.default["tedi-map-button__text"]),children:s})]}),l=e.jsx(O.Button,{noStyle:!0,isLoading:a,className:C,size:n,...M,ref:x,children:N}),T=p&&m?e.jsxs(r.Tooltip,{placement:"right",children:[e.jsx(r.Tooltip.Trigger,{children:l}),e.jsx(r.Tooltip.Content,{children:m})]}):l;return i?e.jsxs(d.MapDropdown,{onOpenChange:D,placement:"right-start",children:[e.jsx(d.MapDropdown.Trigger,{children:l}),e.jsx(d.MapDropdown.Content,{items:i.map(o=>({children:o.children,onClick:o.onClick,isActive:o.isActive,isDisabled:o.isDisabled}))})]}):T});u.displayName="MapButton";exports.MapButton=u;exports.default=u;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
1
|
import { ButtonProps } from '../../../../tedi';
|
|
3
2
|
import { MapDropdownItem } from '../map-dropdown/map-dropdown';
|
|
4
3
|
/**
|
|
@@ -25,7 +24,7 @@ export interface MapButtonProps extends Omit<ButtonProps, OmittedButtonProps> {
|
|
|
25
24
|
selected?: boolean;
|
|
26
25
|
/**
|
|
27
26
|
* If `true`, hides the label visually (icon-only button).
|
|
28
|
-
*
|
|
27
|
+
* The label stays in the accessible name, so `children` is required for the button to be named.
|
|
29
28
|
*/
|
|
30
29
|
hideLabel?: boolean;
|
|
31
30
|
/**
|
|
@@ -39,5 +38,5 @@ export interface MapButtonProps extends Omit<ButtonProps, OmittedButtonProps> {
|
|
|
39
38
|
*/
|
|
40
39
|
dropdownItems?: MapDropdownItem[];
|
|
41
40
|
}
|
|
42
|
-
export declare const MapButton: (
|
|
41
|
+
export declare const MapButton: import('react').ForwardRefExoticComponent<Omit<MapButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
43
42
|
export default MapButton;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, Fragment as T, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import b from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import { useState as A } from "react";
|
|
3
|
+
import { forwardRef as z, useState as A } from "react";
|
|
4
4
|
import { Icon as I } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
-
import { Spinner as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { MapDropdown as
|
|
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";
|
|
7
|
+
import { MapDropdown as d } from "../map-dropdown/map-dropdown.es.js";
|
|
8
8
|
import t from "./map-button.module.scss.es.js";
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
const
|
|
9
|
+
import { Tooltip as m } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
10
|
+
const k = z((f, h) => {
|
|
11
11
|
const {
|
|
12
12
|
size: o = "default",
|
|
13
|
-
icon:
|
|
14
|
-
selected:
|
|
15
|
-
className:
|
|
16
|
-
children:
|
|
17
|
-
hideLabel:
|
|
18
|
-
tooltipContent: u =
|
|
19
|
-
dropdownItems:
|
|
13
|
+
icon: p,
|
|
14
|
+
selected: g = !1,
|
|
15
|
+
className: N,
|
|
16
|
+
children: i,
|
|
17
|
+
hideLabel: c = !1,
|
|
18
|
+
tooltipContent: u = i,
|
|
19
|
+
dropdownItems: s,
|
|
20
20
|
isActive: v,
|
|
21
21
|
isHovered: C,
|
|
22
|
-
underline:
|
|
23
|
-
isLoading:
|
|
22
|
+
underline: w,
|
|
23
|
+
isLoading: r,
|
|
24
24
|
..._
|
|
25
|
-
} =
|
|
25
|
+
} = f, [B, D] = A(!1), x = g || B, y = b(
|
|
26
26
|
t["tedi-map-button"],
|
|
27
27
|
t[`tedi-map-button--${o}`],
|
|
28
28
|
x && t["tedi-map-button--selected"],
|
|
29
|
-
|
|
29
|
+
s && t["tedi-map-button--dropdown"],
|
|
30
30
|
v && t["tedi-map-button--is-active"],
|
|
31
31
|
C && t["tedi-map-button--is-hovered"],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
] }),
|
|
39
|
-
/* @__PURE__ */ e(
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
] }) :
|
|
42
|
-
return
|
|
43
|
-
/* @__PURE__ */ e(
|
|
32
|
+
w && t["tedi-map-button--underline"],
|
|
33
|
+
r && t["tedi-map-button--loading"],
|
|
34
|
+
N
|
|
35
|
+
), M = /* @__PURE__ */ l(T, { children: [
|
|
36
|
+
r ? /* @__PURE__ */ e(O, { size: o === "small" ? 16 : 18, className: t["tedi-map-button__icon"] }) : p && /* @__PURE__ */ e(I, { name: p, className: t["tedi-map-button__icon"], size: o === "small" ? 24 : 18 }),
|
|
37
|
+
c ? /* @__PURE__ */ e("span", { className: "sr-only", children: i }) : /* @__PURE__ */ e("div", { className: b(t["tedi-map-button__text"]), children: i })
|
|
38
|
+
] }), a = /* @__PURE__ */ e(j, { noStyle: !0, isLoading: r, className: y, size: o, ..._, ref: h, children: M }), S = c && u ? /* @__PURE__ */ l(m, { placement: "right", children: [
|
|
39
|
+
/* @__PURE__ */ e(m.Trigger, { children: a }),
|
|
40
|
+
/* @__PURE__ */ e(m.Content, { children: u })
|
|
41
|
+
] }) : a;
|
|
42
|
+
return s ? /* @__PURE__ */ l(d, { onOpenChange: D, placement: "right-start", children: [
|
|
43
|
+
/* @__PURE__ */ e(d.Trigger, { children: a }),
|
|
44
44
|
/* @__PURE__ */ e(
|
|
45
|
-
|
|
45
|
+
d.Content,
|
|
46
46
|
{
|
|
47
|
-
items:
|
|
47
|
+
items: s.map((n) => ({
|
|
48
48
|
children: n.children,
|
|
49
49
|
onClick: n.onClick,
|
|
50
50
|
isActive: n.isActive,
|
|
@@ -52,9 +52,10 @@ const q = (h) => {
|
|
|
52
52
|
}))
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
|
-
] }) :
|
|
56
|
-
};
|
|
55
|
+
] }) : S;
|
|
56
|
+
});
|
|
57
|
+
k.displayName = "MapButton";
|
|
57
58
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
k as MapButton,
|
|
60
|
+
k as default
|
|
60
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),$=require("../../../../../external/classnames/index.cjs.js"),b=require("react"),h=require("../../../../../external/react-sticky-box/dist/index.cjs.js"),e=require("./affix.module.scss.cjs.js"),q=require("../../../../community/components/layout/layout-context.cjs.js"),g=require("../../../helpers/hooks/use-element-size.cjs.js"),j=x=>{const{children:n,relative:p=["header"],className:m,position:i="sticky",top:t=1.5,bottom:f,right:s,left:a}=x,{headerBottomElement:y}=b.useContext(q.LayoutContext),o=g.useElementSize(y),d=$.default(e.default["tedi-affix"],m,e.default[`tedi-affix--${i}`],{[e.default[`tedi-affix--top-${t}`.replace(".","-")]]:typeof t<"u"&&i==="fixed",[e.default[`tedi-affix--bottom-${f}`.replace(".","-")]]:typeof f<"u",[e.default[`tedi-affix--left-${a}`.replace(".","-")]]:typeof a<"u",[e.default[`tedi-affix--right-${s}`.replace(".","-")]]:typeof s<"u"});if(i==="fixed")return l.jsx("div",{className:d,children:n});const r=(typeof t=="number"?t:0)*16,u=p.includes("header")?r+((o==null?void 0:o.height)||0):r,c=(typeof f=="number"?f:0)*16;return l.jsx(h.default,{offsetTop:u,offsetBottom:c,className:d,style:{"--tedi-affix-offset-top":`${u}px`,"--tedi-affix-offset-bottom":`${c}px`},children:n})};exports.Affix=j;
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import h from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import { useContext as $ } from "react";
|
|
4
4
|
import b from "../../../../../external/react-sticky-box/dist/index.es.js";
|
|
5
5
|
import e from "./affix.module.scss.es.js";
|
|
6
6
|
import { LayoutContext as g } from "../../../../community/components/layout/layout-context.es.js";
|
|
7
7
|
import { useElementSize as N } from "../../../helpers/hooks/use-element-size.es.js";
|
|
8
|
-
const L = (
|
|
9
|
-
const { children: r, relative:
|
|
8
|
+
const L = (l) => {
|
|
9
|
+
const { children: r, relative: x = ["header"], className: u, position: f = "sticky", top: t = 1.5, bottom: o, right: s, left: n } = l, { headerBottomElement: y } = $(g), i = N(y), p = h(e["tedi-affix"], u, e[`tedi-affix--${f}`], {
|
|
10
10
|
[e[`tedi-affix--top-${t}`.replace(".", "-")]]: typeof t < "u" && f === "fixed",
|
|
11
11
|
[e[`tedi-affix--bottom-${o}`.replace(".", "-")]]: typeof o < "u",
|
|
12
|
-
[e[`tedi-affix--left-${
|
|
13
|
-
[e[`tedi-affix--right-${
|
|
12
|
+
[e[`tedi-affix--left-${n}`.replace(".", "-")]]: typeof n < "u",
|
|
13
|
+
[e[`tedi-affix--right-${s}`.replace(".", "-")]]: typeof s < "u"
|
|
14
14
|
});
|
|
15
15
|
if (f === "fixed")
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
const a = (typeof t == "number" ? t : 0) * 16,
|
|
18
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ c("div", { className: p, children: r });
|
|
17
|
+
const a = (typeof t == "number" ? t : 0) * 16, m = x.includes("header") ? a + ((i == null ? void 0 : i.height) || 0) : a, d = (typeof o == "number" ? o : 0) * 16;
|
|
18
|
+
return /* @__PURE__ */ c(
|
|
19
|
+
b,
|
|
20
|
+
{
|
|
21
|
+
offsetTop: m,
|
|
22
|
+
offsetBottom: d,
|
|
23
|
+
className: p,
|
|
24
|
+
style: {
|
|
25
|
+
"--tedi-affix-offset-top": `${m}px`,
|
|
26
|
+
"--tedi-affix-offset-bottom": `${d}px`
|
|
27
|
+
},
|
|
28
|
+
children: r
|
|
29
|
+
}
|
|
30
|
+
);
|
|
19
31
|
};
|
|
20
32
|
export {
|
|
21
33
|
L as Affix
|
|
@@ -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"),w=require("../../../../../../../external/classnames/index.cjs.js"),n=require("react"),T=require("../../../../base/typography/text/text.cjs.js"),q=require("../../../../buttons/collapse-button/collapse-button.cjs.js"),H=require("../../../../overlays/sheet/sheet.cjs.js"),b=require("../../table-of-contents.cjs.js"),t=require("../../table-of-contents.module.scss.cjs.js"),Y=require("../table-of-contents-list/table-of-contents-list.cjs.js"),F=require("../../../../../providers/label-provider/use-labels.cjs.js"),N=E=>{const{children:m,heading:h,ariaLabel:S,activeId:o,numbered:v=!1,bordered:y=!1,defaultOpen:p=!0,sticky:c=!0,hideOnScroll:x=!1,className:M}=E,{getLabel:C}=F.useLabels(),[l,i]=n.useState(!1),[k,_]=n.useState(!1),[r,A]=n.useState(null);n.useEffect(()=>{if(!x||!c){_(!1);return}let a=window.scrollY,s=0;const O=()=>{s||(s=window.requestAnimationFrame(()=>{s=0;const f=window.scrollY,j=f-a;Math.abs(j)>4&&(_(j>0&&f>0),a=f)}))};return window.addEventListener("scroll",O,{passive:!0}),()=>{window.removeEventListener("scroll",O),s&&window.cancelAnimationFrame(s)}},[x,c]),n.useEffect(()=>{if(!l||!r)return;const a=s=>{s.target.closest("a, button")&&i(!1)};return r.addEventListener("click",a),()=>r.removeEventListener("click",a)},[l,r]);const d=(h===void 0?C("table-of-contents.title"):h)??C("table-of-contents.title"),g=S||d,u=n.useMemo(()=>b.childrenToNodes(m),[m]),L=n.useMemo(()=>b.buildActiveTrail(u,o),[u,o]),B=n.useMemo(()=>({activeId:o,numbered:v,ariaLabel:g,activeTrail:L,defaultOpen:p}),[o,v,g,L,p]);return e.jsxs(b.TableOfContentsContext.Provider,{value:B,children:[e.jsxs("div",{className:w.default(t.default["tedi-table-of-contents__bar"],{[t.default["tedi-table-of-contents__bar--static"]]:!c,[t.default["tedi-table-of-contents__bar--hidden"]]:k&&!l},M),children:[e.jsx(T.Text,{modifiers:"bold",className:t.default["tedi-table-of-contents__bar-title"],children:d}),e.jsx(q.CollapseButton,{open:l,onOpenChange:i,underline:!1,"aria-haspopup":"dialog"})]}),e.jsx(H.Sheet,{open:l,onToggle:i,ariaLabel:d,className:t.default["tedi-table-of-contents__sheet"],header:e.jsxs("div",{className:t.default["tedi-table-of-contents__sheet-header"],children:[e.jsx(T.Text,{modifiers:"bold",className:t.default["tedi-table-of-contents__bar-title"],children:d}),e.jsx(q.CollapseButton,{open:l,onOpenChange:i,underline:!1})]}),children:e.jsx("div",{ref:A,className:w.default(t.default["tedi-table-of-contents"],{[t.default["tedi-table-of-contents--bordered"]]:y}),children:e.jsx(Y.TableOfContentsList,{nodes:u,heading:null})})})]})};N.displayName="TableOfContentsCollapsible";exports.TableOfContentsCollapsible=N;
|