@tedi-design-system/react 19.0.1-rc.2 → 19.1.0-rc.10
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/DESIGN.md +308 -0
- package/README.md +28 -0
- package/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/component.manifest.json +1191 -0
- 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 +2 -2
- package/src/community/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/community/components/layout/sidenav/sidenav.es.js +38 -40
- 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/community/components/map-components/map-dropdown/map-dropdown.cjs.js +1 -1
- package/src/community/components/map-components/map-dropdown/map-dropdown.es.js +51 -49
- package/src/community/components/vertical-stepper/step-item/step-item.d.ts +6 -0
- package/src/community/components/vertical-stepper/sub-item/sub-item.d.ts +6 -0
- package/src/community/components/vertical-stepper/vertical-stepper.d.ts +6 -0
- package/src/tedi/components/content/card/card.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/card/card.module.scss.es.js +3 -2
- package/src/tedi/components/content/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/content/collapse/collapse.d.ts +9 -0
- package/src/tedi/components/content/collapse/collapse.es.js +44 -35
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.d.ts +5 -0
- package/src/tedi/components/filter/filter/filter.es.js +154 -144
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.module.scss.es.js +2 -1
- package/src/tedi/components/form/date-field/date-field-helpers.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field-helpers.d.ts +12 -19
- package/src/tedi/components/form/date-field/date-field-helpers.es.js +27 -21
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +1 -1
- package/src/tedi/components/form/date-field/date-field.es.js +169 -164
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.es.js +21 -21
- package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
- package/src/tedi/components/form/time-field/time-field.es.js +126 -124
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.es.js +82 -85
- package/src/tedi/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/sidenav.es.js +16 -16
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/components/top-nav-item/top-nav-item.es.js +6 -7
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/components/top-nav-separator/top-nav-separator.es.js +2 -2
- package/src/tedi/components/layout/top-nav/top-nav.cjs.js +1 -1
- package/src/tedi/components/layout/top-nav/top-nav.es.js +9 -8
- 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/card-stepper/card-stepper-step.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.d.ts +86 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper-step.es.js +5 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.d.ts +130 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.es.js +200 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/card-stepper/card-stepper.module.scss.es.js +26 -0
- package/src/tedi/components/navigation/card-stepper/index.d.ts +2 -0
- 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 +82 -65
- 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/components/navigation/vertical-stepper/index.d.ts +3 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.d.ts +10 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-context.es.js +8 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.d.ts +74 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-item.es.js +109 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.d.ts +47 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper-sub-item.es.js +65 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.d.ts +28 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.es.js +32 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.cjs.js +1 -0
- package/src/tedi/components/navigation/vertical-stepper/vertical-stepper.module.scss.es.js +34 -0
- package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +82 -74
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.es.js +1 -0
- package/src/tedi/components/overlays/overlay/overlay-trigger.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-trigger.es.js +22 -21
- package/src/tedi/components/overlays/sheet/sheet.cjs.js +1 -0
- package/src/tedi/components/overlays/sheet/sheet.d.ts +65 -0
- package/src/tedi/components/overlays/sheet/sheet.es.js +41 -0
- package/src/tedi/components/overlays/sheet/sheet.module.scss.cjs.js +1 -0
- package/src/tedi/components/overlays/sheet/sheet.module.scss.es.js +8 -0
- package/src/tedi/helpers/hooks/use-safe-id.cjs.js +1 -0
- package/src/tedi/helpers/hooks/use-safe-id.d.ts +16 -0
- package/src/tedi/helpers/hooks/use-safe-id.es.js +5 -0
- package/src/tedi/helpers/index.d.ts +1 -0
- package/src/tedi/index.d.ts +2 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +56 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +127 -71
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +284 -272
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "19.0
|
|
3
|
+
"version": "19.1.0-rc.10",
|
|
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 t=require("react/jsx-runtime"),d=require("react"),S=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),h=require("../../../../../external/classnames/index.cjs.js"),T=require("../../../../tedi/components/base/icon/icon.cjs.js"),L=require("../../../../tedi/components/content/collapse/collapse.cjs.js"),P=require("../../../../tedi/components/misc/print/print.cjs.js"),q=require("../../../helpers/hooks/use-layout.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),S=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),h=require("../../../../../external/classnames/index.cjs.js"),T=require("../../../../tedi/components/base/icon/icon.cjs.js"),L=require("../../../../tedi/components/content/collapse/collapse.cjs.js"),P=require("../../../../tedi/components/misc/print/print.cjs.js"),q=require("../../../helpers/hooks/use-layout.cjs.js"),A=require("../../anchor/anchor.cjs.js"),C=require("../layout-context.cjs.js"),a=require("./sidenav.module.scss.cjs.js"),B=require("./utility.cjs.js"),F=n=>requestAnimationFrame(n),I=n=>{const{navItems:l,ariaLabel:r,linkAs:i,breakToBottomContent:c,breakToHeader:x,showDividers:u=!0,hideSubItemIcons:m=!1,className:v,..._}=n,p=q.default(["mobile","tablet"]),{menuOpen:g,context:y,getFloatingProps:f,floating:N,headerType:e,y:s}=d.useContext(C.LayoutContext),{hasSidenav:o}=B.useSidenavRendered(e,n);if(!o)return null;const b=h.default(a.default.sidenav,v,{[a.default["sidenav--has-dividers"]]:u,[a.default["sidenav--hide-subitem-icons"]]:m}),j=t.jsx(P.Print,{visibility:"hide",children:t.jsx("nav",{"data-name":"sidenav",..._,className:b,"aria-label":r,children:t.jsx("ul",{className:a.default.sidenav__list,children:l.map((E,M)=>d.createElement(k,{as:i,...E,key:M}))})})});return p?g?t.jsx(S.FloatingOverlay,{lockScroll:!0,className:a.default.sidenav__overlay,children:t.jsx(S.FloatingFocusManager,{context:y,order:["reference","content"],children:t.jsx("div",{...f({style:{paddingTop:s??0},className:a.default.sidenav,"aria-label":r}),ref:N,children:j})})}):null:j},k=n=>{const{icon:l,children:r,isActive:i,onClick:c,subItems:x,as:u,...m}=n,{toggleMenu:v,onHeaderSidenavToggle:_}=d.useContext(C.LayoutContext),p=q.default(["mobile","tablet"]),g=h.default(a.default.sidenav__item,{[a.default["sidenav__item--current"]]:i}),y=d.useId(),f=e=>{const o={className:h.default(a.default.sidenav__icon)},b=typeof e=="string"?{...o,name:e,color:"inherit"}:{...o,...e,className:h.default(o.className,e==null?void 0:e.className),background:void 0};return t.jsx(T.Icon,{...b})},N=e=>{c==null||c(e),e.stopPropagation(),typeof _=="function"||(p?F(()=>v()):v())};return t.jsx("li",{"data-name":"sidenav-item",className:g,children:x?t.jsx(L.Collapse,{id:y,hideCollapseText:!0,contentAsRegion:!1,open:i,title:t.jsxs("span",{...(({_href:e,...s})=>s)(m),className:a.default.sidenav__link,"aria-current":i?"page":void 0,children:[l&&f(l),t.jsx("span",{className:a.default.sidenav__title,children:r})]}),children:t.jsx("ul",{className:a.default.sidenav__list,children:x.map((e,s)=>d.createElement(k,{as:u,...e,key:s}))})}):t.jsxs(A.Anchor,{...m,as:u,onClick:N,className:a.default.sidenav__link,noStyle:!0,"aria-current":i?"page":void 0,children:[l&&f(l),t.jsx("span",{className:a.default.sidenav__title,children:r})]})})};exports.SideNav=I;exports.default=I;
|
|
@@ -1,98 +1,96 @@
|
|
|
1
1
|
import { jsx as t, jsxs as x } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { FloatingOverlay as
|
|
4
|
-
import
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Collapse as
|
|
7
|
-
import { Print as
|
|
2
|
+
import b, { createElement as C } from "react";
|
|
3
|
+
import { FloatingOverlay as B, FloatingFocusManager as F } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
4
|
+
import p from "../../../../../external/classnames/index.es.js";
|
|
5
|
+
import { Icon as L } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
6
|
+
import { Collapse as P } from "../../../../tedi/components/content/collapse/collapse.es.js";
|
|
7
|
+
import { Print as R } from "../../../../tedi/components/misc/print/print.es.js";
|
|
8
8
|
import k from "../../../helpers/hooks/use-layout.es.js";
|
|
9
|
-
import { Anchor as
|
|
9
|
+
import { Anchor as j } from "../../anchor/anchor.es.js";
|
|
10
10
|
import { LayoutContext as E } from "../layout-context.es.js";
|
|
11
11
|
import a from "./sidenav.module.scss.es.js";
|
|
12
|
-
import { useSidenavRendered as
|
|
13
|
-
const
|
|
12
|
+
import { useSidenavRendered as H } from "./utility.es.js";
|
|
13
|
+
const O = (n) => requestAnimationFrame(n), Y = (n) => {
|
|
14
14
|
const {
|
|
15
15
|
navItems: i,
|
|
16
|
-
ariaLabel:
|
|
17
|
-
linkAs:
|
|
16
|
+
ariaLabel: r,
|
|
17
|
+
linkAs: o,
|
|
18
18
|
breakToBottomContent: c,
|
|
19
19
|
breakToHeader: f,
|
|
20
20
|
showDividers: d = !0,
|
|
21
21
|
hideSubItemIcons: m = !1,
|
|
22
22
|
className: u,
|
|
23
23
|
...h
|
|
24
|
-
} =
|
|
24
|
+
} = n, _ = k(["mobile", "tablet"]), { menuOpen: N, context: g, getFloatingProps: v, floating: S, headerType: e, y: s } = b.useContext(E), { hasSidenav: l } = H(e, n);
|
|
25
25
|
if (!l)
|
|
26
26
|
return null;
|
|
27
|
-
const
|
|
27
|
+
const y = p(a.sidenav, u, {
|
|
28
28
|
[a["sidenav--has-dividers"]]: d,
|
|
29
29
|
[a["sidenav--hide-subitem-icons"]]: m
|
|
30
|
-
}), I = /* @__PURE__ */ t(
|
|
31
|
-
return _ ? N ? /* @__PURE__ */ t(
|
|
30
|
+
}), I = /* @__PURE__ */ t(R, { visibility: "hide", children: /* @__PURE__ */ t("nav", { "data-name": "sidenav", ...h, className: y, "aria-label": r, children: /* @__PURE__ */ t("ul", { className: a.sidenav__list, children: i.map((T, A) => /* @__PURE__ */ C(M, { as: o, ...T, key: A })) }) }) });
|
|
31
|
+
return _ ? N ? /* @__PURE__ */ t(B, { lockScroll: !0, className: a.sidenav__overlay, children: /* @__PURE__ */ t(F, { context: g, order: ["reference", "content"], children: /* @__PURE__ */ t(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
...
|
|
34
|
+
...v({
|
|
35
35
|
style: {
|
|
36
|
-
paddingTop:
|
|
36
|
+
paddingTop: s ?? 0
|
|
37
37
|
},
|
|
38
38
|
className: a.sidenav,
|
|
39
|
-
"aria-label":
|
|
39
|
+
"aria-label": r
|
|
40
40
|
}),
|
|
41
41
|
ref: S,
|
|
42
42
|
children: I
|
|
43
43
|
}
|
|
44
44
|
) }) }) : null : I;
|
|
45
|
-
}, M = (
|
|
46
|
-
const { icon: i, children:
|
|
47
|
-
const l = { className:
|
|
45
|
+
}, M = (n) => {
|
|
46
|
+
const { icon: i, children: r, isActive: o, onClick: c, subItems: f, as: d, ...m } = n, { toggleMenu: u, onHeaderSidenavToggle: h } = b.useContext(E), _ = k(["mobile", "tablet"]), N = p(a.sidenav__item, { [a["sidenav__item--current"]]: o }), g = b.useId(), v = (e) => {
|
|
47
|
+
const l = { className: p(a.sidenav__icon) }, y = typeof e == "string" ? { ...l, name: e, color: "inherit" } : {
|
|
48
48
|
...l,
|
|
49
49
|
...e,
|
|
50
|
-
className:
|
|
50
|
+
className: p(l.className, e == null ? void 0 : e.className),
|
|
51
51
|
background: void 0
|
|
52
52
|
};
|
|
53
|
-
return /* @__PURE__ */ t(
|
|
53
|
+
return /* @__PURE__ */ t(L, { ...y });
|
|
54
54
|
};
|
|
55
|
-
return /* @__PURE__ */ t("li", { "data-name": "sidenav-item", className: N,
|
|
56
|
-
|
|
55
|
+
return /* @__PURE__ */ t("li", { "data-name": "sidenav-item", className: N, children: f ? /* @__PURE__ */ t(
|
|
56
|
+
P,
|
|
57
57
|
{
|
|
58
|
-
id:
|
|
58
|
+
id: g,
|
|
59
59
|
hideCollapseText: !0,
|
|
60
|
-
|
|
60
|
+
contentAsRegion: !1,
|
|
61
|
+
open: o,
|
|
61
62
|
title: /* @__PURE__ */ x(
|
|
62
63
|
"span",
|
|
63
64
|
{
|
|
64
|
-
...(({ _href: e, ...
|
|
65
|
+
...(({ _href: e, ...s }) => s)(m),
|
|
65
66
|
className: a.sidenav__link,
|
|
66
|
-
|
|
67
|
-
role: "menuitem",
|
|
68
|
-
"aria-current": r ? "page" : void 0,
|
|
67
|
+
"aria-current": o ? "page" : void 0,
|
|
69
68
|
children: [
|
|
70
|
-
i &&
|
|
71
|
-
/* @__PURE__ */ t("span", { className: a.sidenav__title, children:
|
|
69
|
+
i && v(i),
|
|
70
|
+
/* @__PURE__ */ t("span", { className: a.sidenav__title, children: r })
|
|
72
71
|
]
|
|
73
72
|
}
|
|
74
73
|
),
|
|
75
|
-
children: /* @__PURE__ */ t("ul", { className: a.sidenav__list,
|
|
74
|
+
children: /* @__PURE__ */ t("ul", { className: a.sidenav__list, children: f.map((e, s) => /* @__PURE__ */ C(M, { as: d, ...e, key: s })) })
|
|
76
75
|
}
|
|
77
76
|
) : (
|
|
78
77
|
// // TODO: Remove ts-ignore
|
|
79
78
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
80
79
|
// @ts-ignore
|
|
81
80
|
/* @__PURE__ */ x(
|
|
82
|
-
|
|
81
|
+
j,
|
|
83
82
|
{
|
|
84
83
|
...m,
|
|
85
84
|
as: d,
|
|
86
85
|
onClick: (e) => {
|
|
87
|
-
c == null || c(e), e.stopPropagation(), typeof h == "function" || (_ ?
|
|
86
|
+
c == null || c(e), e.stopPropagation(), typeof h == "function" || (_ ? O(() => u()) : u());
|
|
88
87
|
},
|
|
89
88
|
className: a.sidenav__link,
|
|
90
89
|
noStyle: !0,
|
|
91
|
-
|
|
92
|
-
"aria-current": r ? "page" : void 0,
|
|
90
|
+
"aria-current": o ? "page" : void 0,
|
|
93
91
|
children: [
|
|
94
|
-
i &&
|
|
95
|
-
/* @__PURE__ */ t("span", { className: a.sidenav__title, children:
|
|
92
|
+
i && v(i),
|
|
93
|
+
/* @__PURE__ */ t("span", { className: a.sidenav__title, children: r })
|
|
96
94
|
]
|
|
97
95
|
}
|
|
98
96
|
)
|
|
@@ -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;
|