@tedi-design-system/react 19.1.0-rc.2 → 19.1.0-rc.20
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/community.cjs.js +1 -1
- package/community.es.js +215 -223
- package/component.manifest.json +1234 -0
- package/external/@floating-ui/core/dist/floating-ui.core.es.js +1 -1
- package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +2 -2
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +5 -5
- package/external/@mui/x-date-pickers/DatePicker/shared.es.js +1 -1
- package/external/@mui/x-date-pickers/DateTimePicker/shared.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +3 -3
- package/src/community/components/accordion/accordion.cjs.js +1 -1
- package/src/community/components/accordion/accordion.es.js +14 -9
- package/src/community/components/card/card-notification/card-notification.cjs.js +1 -1
- package/src/community/components/card/card-notification/card-notification.es.js +10 -8
- 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/dropdown/dropdown.cjs.js +1 -1
- package/src/community/components/dropdown/dropdown.es.js +34 -32
- package/src/community/components/form/category-search/category-search.cjs.js +1 -0
- package/src/community/components/form/category-search/category-search.d.ts +9 -0
- package/src/community/components/form/category-search/category-search.es.js +297 -0
- package/src/community/components/form/category-search/category-search.module.scss.cjs.js +1 -0
- package/src/community/components/form/category-search/category-search.module.scss.es.js +21 -0
- package/src/community/components/form/category-search/category-search.types.d.ts +162 -0
- package/src/community/components/form/category-search/define-category-search-category.cjs.js +1 -0
- package/src/community/components/form/category-search/define-category-search-category.d.ts +7 -0
- package/src/community/components/form/category-search/define-category-search-category.es.js +25 -0
- package/src/community/components/form/category-search/index.d.ts +3 -0
- package/src/community/components/form/category-search/use-category-search.cjs.js +1 -0
- package/src/community/components/form/category-search/use-category-search.d.ts +17 -0
- package/src/community/components/form/category-search/use-category-search.es.js +64 -0
- package/src/community/components/form/file-upload/file-upload.cjs.js +1 -1
- package/src/community/components/form/file-upload/file-upload.es.js +43 -41
- package/src/community/components/form/pickers/calendar/calendar.cjs.js +1 -1
- package/src/community/components/form/pickers/calendar/calendar.es.js +41 -39
- package/src/community/components/form/pickers/timepicker/timepicker.cjs.js +1 -1
- package/src/community/components/form/pickers/timepicker/timepicker.es.js +33 -31
- package/src/community/components/form/toggle/toggle.cjs.js +1 -1
- package/src/community/components/form/toggle/toggle.es.js +30 -28
- 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/carousel/carousel.cjs.js +1 -1
- package/src/community/components/map-components/carousel/carousel.es.js +19 -17
- 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 +12 -4
- package/src/community/components/map-components/map-button/map-button.es.js +43 -40
- 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/status/status.cjs.js +1 -1
- package/src/community/components/status/status.es.js +14 -12
- package/src/community/components/stepper/stepper.cjs.js +1 -1
- package/src/community/components/stepper/stepper.es.js +33 -31
- package/src/community/components/table/table.cjs.js +1 -1
- package/src/community/components/table/table.es.js +9 -9
- package/src/community/components/table-of-contents/table-of-contents.cjs.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents.es.js +21 -19
- package/src/community/components/tabs/tabs/tabs.cjs.js +1 -1
- package/src/community/components/tabs/tabs/tabs.es.js +29 -27
- package/src/community/components/vertical-stepper/vertical-stepper.cjs.js +1 -1
- package/src/community/components/vertical-stepper/vertical-stepper.es.js +8 -6
- package/src/community/deprecated-exports.cjs.js +1 -0
- package/src/community/deprecated-exports.d.ts +19 -0
- package/src/community/deprecated-exports.es.js +112 -0
- package/src/community/index.d.ts +3 -0
- package/src/tedi/components/content/card/card.d.ts +4 -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/carousel/carousel.cjs.js +1 -1
- package/src/tedi/components/content/carousel/carousel.d.ts +5 -0
- package/src/tedi/components/content/carousel/carousel.es.js +20 -20
- package/src/tedi/components/content/carousel/use-carousel.cjs.js +1 -1
- package/src/tedi/components/content/carousel/use-carousel.d.ts +1 -1
- package/src/tedi/components/content/carousel/use-carousel.es.js +127 -127
- package/src/tedi/components/content/table-card/index.d.ts +1 -0
- package/src/tedi/components/content/table-card/table-card.cjs.js +1 -0
- package/src/tedi/components/content/table-card/table-card.d.ts +131 -0
- package/src/tedi/components/content/table-card/table-card.es.js +206 -0
- package/src/tedi/components/content/table-card/table-card.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table-card/table-card.module.scss.es.js +18 -0
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.d.ts +42 -0
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.es.js +41 -23
- package/src/tedi/components/content/text-group/text-group.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group.d.ts +10 -0
- package/src/tedi/components/content/text-group/text-group.es.js +14 -13
- package/src/tedi/components/content/text-group/text-group.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group.module.scss.es.js +5 -1
- 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/date-time-field/date-time-field.cjs.js +1 -1
- package/src/tedi/components/form/date-time-field/date-time-field.es.js +181 -176
- package/src/tedi/components/form/search/index.d.ts +1 -0
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.d.ts +92 -1
- package/src/tedi/components/form/search/search.es.js +265 -69
- package/src/tedi/components/form/search/search.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/search/search.module.scss.es.js +9 -1
- package/src/tedi/components/form/slider/slider.cjs.js +1 -1
- package/src/tedi/components/form/slider/slider.es.js +38 -38
- package/src/tedi/components/form/slider/slider.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/slider/slider.module.scss.es.js +0 -1
- 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/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +28 -27
- package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.es.js +124 -92
- package/src/tedi/components/layout/sidenav/sidenav.module.scss.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/sidenav.module.scss.es.js +1 -0
- 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/components/navigation/tabs/tabs-helpers.cjs.js +1 -1
- package/src/tedi/components/navigation/tabs/tabs-helpers.d.ts +5 -0
- package/src/tedi/components/navigation/tabs/tabs-helpers.es.js +7 -4
- package/src/tedi/components/navigation/tabs/tabs-trigger/tabs-trigger.cjs.js +1 -1
- package/src/tedi/components/navigation/tabs/tabs-trigger/tabs-trigger.es.js +17 -17
- 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 -72
- 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/helpers/warn-deprecated/warn-deprecated.cjs.js +1 -0
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.d.ts +12 -0
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.es.js +11 -0
- package/src/tedi/index.d.ts +2 -1
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +44 -2
- package/src/tedi/providers/label-provider/labels-map.es.js +43 -1
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +326 -324
|
@@ -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"),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;
|
|
@@ -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 O 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 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
|
+
import t from "./base-map-selection.module.scss.es.js";
|
|
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
|
+
import { Popover as s } from "../../../../tedi/components/overlays/popover/popover.es.js";
|
|
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
|
+
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 } = F(), x = P(G(), "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 = (I) => {
|
|
34
|
+
const f = l(I);
|
|
35
|
+
m || T(f), o == null || o(f);
|
|
36
|
+
}, w = O(
|
|
37
|
+
t["tedi-base-map-selection__wrapper"],
|
|
38
|
+
t["tedi-base-map-selection--button"],
|
|
39
|
+
N && t["tedi-base-map-selection--multiple"]
|
|
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
|
+
/* @__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: C }),
|
|
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
|
+
z,
|
|
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(R, { 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(U, { children: "%" })
|
|
69
69
|
] }) })
|
|
70
70
|
}
|
|
71
71
|
) })
|
|
72
72
|
] })
|
|
73
73
|
] });
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
b.Option = E;
|
|
76
|
+
b.displayName = "BaseMapSelection";
|
|
77
77
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
E as BaseMapOption,
|
|
79
|
+
b as BaseMapSelection
|
|
80
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),c=require("react"),d=require("../../../../tedi/components/buttons/floating-button/floating-button.cjs.js"),e=require("./carousel.module.scss.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("../../../../../external/classnames/index.cjs.js"),c=require("react"),d=require("../../../../tedi/components/buttons/floating-button/floating-button.cjs.js"),y=require("../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),e=require("./carousel.module.scss.cjs.js"),p=u=>{y.warnDeprecated("Community Carousel","Use `Carousel` from `@tedi-design-system/react/tedi` instead.");const{itemCountShown:l,children:m,className:f}=u,[s,r]=c.useState(0),n=c.Children.toArray(m),o=n.length,_=()=>{s+l<o&&r(a=>a+1)},x=()=>{s>0&&r(a=>a-1)},v=`translateX(-${100/l*s}%)`;return t.jsxs("div",{className:`${e.default["tedi-carousel__wrapper"]} ${f??""}`,children:[t.jsx(d.FloatingButton,{className:i.default(e.default["tedi-carousel__navigation-button"],e.default["tedi-carousel__prev"]),onClick:x,visualType:"secondary",disabled:s===0,icon:"west",children:"Prev"}),t.jsx("div",{className:e.default["tedi-carousel__viewport"],children:t.jsx("div",{className:e.default["tedi-carousel__carousel-track"],style:{transform:v},children:n.map((a,h)=>t.jsx("div",{className:e.default["tedi-carousel__item"],style:{flex:`0 0 ${100/l}%`},children:a},h))})}),t.jsx(d.FloatingButton,{className:i.default(e.default["tedi-carousel__navigation-button"],e.default["tedi-carousel__next"]),onClick:_,visualType:"secondary",disabled:s+l>=o,icon:"east",children:"Next"})]})};exports.Carousel=p;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { FloatingButton as
|
|
1
|
+
import { jsxs as v, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import y, { useState as N } from "react";
|
|
4
|
+
import { FloatingButton as c } from "../../../../tedi/components/buttons/floating-button/floating-button.es.js";
|
|
5
|
+
import { warnDeprecated as x } from "../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
5
6
|
import e from "./carousel.module.scss.es.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const I = (d) => {
|
|
8
|
+
x("Community Carousel", "Use `Carousel` from `@tedi-design-system/react/tedi` instead.");
|
|
9
|
+
const { itemCountShown: r, children: m, className: u } = d, [t, o] = N(0), i = y.Children.toArray(m), l = i.length, _ = () => {
|
|
10
|
+
t + r < l && o((s) => s + 1);
|
|
9
11
|
}, p = () => {
|
|
10
|
-
t > 0 &&
|
|
11
|
-
},
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
t > 0 && o((s) => s - 1);
|
|
13
|
+
}, f = `translateX(-${100 / r * t}%)`;
|
|
14
|
+
return /* @__PURE__ */ v("div", { className: `${e["tedi-carousel__wrapper"]} ${u ?? ""}`, children: [
|
|
13
15
|
/* @__PURE__ */ a(
|
|
14
|
-
|
|
16
|
+
c,
|
|
15
17
|
{
|
|
16
|
-
className:
|
|
18
|
+
className: n(e["tedi-carousel__navigation-button"], e["tedi-carousel__prev"]),
|
|
17
19
|
onClick: p,
|
|
18
20
|
visualType: "secondary",
|
|
19
21
|
disabled: t === 0,
|
|
@@ -21,14 +23,14 @@ const $ = (d) => {
|
|
|
21
23
|
children: "Prev"
|
|
22
24
|
}
|
|
23
25
|
),
|
|
24
|
-
/* @__PURE__ */ a("div", { className: e["tedi-carousel__viewport"], children: /* @__PURE__ */ a("div", { className: e["tedi-carousel__carousel-track"], style: { transform:
|
|
26
|
+
/* @__PURE__ */ a("div", { className: e["tedi-carousel__viewport"], children: /* @__PURE__ */ a("div", { className: e["tedi-carousel__carousel-track"], style: { transform: f }, children: i.map((s, h) => /* @__PURE__ */ a("div", { className: e["tedi-carousel__item"], style: { flex: `0 0 ${100 / r}%` }, children: s }, h)) }) }),
|
|
25
27
|
/* @__PURE__ */ a(
|
|
26
|
-
|
|
28
|
+
c,
|
|
27
29
|
{
|
|
28
|
-
className:
|
|
30
|
+
className: n(e["tedi-carousel__navigation-button"], e["tedi-carousel__next"]),
|
|
29
31
|
onClick: _,
|
|
30
32
|
visualType: "secondary",
|
|
31
|
-
disabled: t +
|
|
33
|
+
disabled: t + r >= l,
|
|
32
34
|
icon: "east",
|
|
33
35
|
children: "Next"
|
|
34
36
|
}
|
|
@@ -36,5 +38,5 @@ const $ = (d) => {
|
|
|
36
38
|
] });
|
|
37
39
|
};
|
|
38
40
|
export {
|
|
39
|
-
|
|
41
|
+
I as Carousel
|
|
40
42
|
};
|
|
@@ -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,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ButtonProps } from '../../../../tedi';
|
|
1
|
+
import { ButtonProps, IconSize } from '../../../../tedi';
|
|
3
2
|
import { MapDropdownItem } from '../map-dropdown/map-dropdown';
|
|
4
3
|
/**
|
|
5
4
|
* Button props that don't apply to MapButton because it renders `<Button noStyle>` with its own
|
|
@@ -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
|
/**
|
|
@@ -38,6 +37,15 @@ export interface MapButtonProps extends Omit<ButtonProps, OmittedButtonProps> {
|
|
|
38
37
|
* When provided, the button can toggle a dropdown menu.
|
|
39
38
|
*/
|
|
40
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;
|
|
41
49
|
}
|
|
42
|
-
export declare const MapButton: (
|
|
50
|
+
export declare const MapButton: import('react').ForwardRefExoticComponent<Omit<MapButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
43
51
|
export default MapButton;
|
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import { jsxs 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 { useState as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Spinner as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { MapDropdown 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
|
+
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 F = O((h, g) => {
|
|
11
11
|
const {
|
|
12
12
|
size: o = "default",
|
|
13
|
-
icon:
|
|
14
|
-
selected:
|
|
15
|
-
className:
|
|
16
|
-
children:
|
|
13
|
+
icon: c,
|
|
14
|
+
selected: v = !1,
|
|
15
|
+
className: w,
|
|
16
|
+
children: i,
|
|
17
17
|
hideLabel: p = !1,
|
|
18
|
-
tooltipContent: u =
|
|
19
|
-
dropdownItems:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
tooltipContent: u = i,
|
|
19
|
+
dropdownItems: s,
|
|
20
|
+
showDropdownIndicator: N = !1,
|
|
21
|
+
isActive: C,
|
|
22
|
+
isHovered: D,
|
|
23
|
+
underline: S,
|
|
24
|
+
isLoading: r,
|
|
25
|
+
iconSize: f,
|
|
24
26
|
..._
|
|
25
|
-
} = h, [
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
] }),
|
|
39
|
-
/* @__PURE__ */ e(
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
] }) :
|
|
42
|
-
return
|
|
43
|
-
/* @__PURE__ */ e(
|
|
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"],
|
|
35
|
+
r && t["tedi-map-button--loading"],
|
|
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: [
|
|
41
|
+
/* @__PURE__ */ e(m.Trigger, { children: a }),
|
|
42
|
+
/* @__PURE__ */ e(m.Content, { children: u })
|
|
43
|
+
] }) : a;
|
|
44
|
+
return s ? /* @__PURE__ */ l(d, { onOpenChange: B, placement: "right-start", children: [
|
|
45
|
+
/* @__PURE__ */ e(d.Trigger, { children: a }),
|
|
44
46
|
/* @__PURE__ */ e(
|
|
45
|
-
|
|
47
|
+
d.Content,
|
|
46
48
|
{
|
|
47
|
-
items:
|
|
49
|
+
items: s.map((n) => ({
|
|
48
50
|
children: n.children,
|
|
49
51
|
onClick: n.onClick,
|
|
50
52
|
isActive: n.isActive,
|
|
@@ -53,8 +55,9 @@ const q = (h) => {
|
|
|
53
55
|
}
|
|
54
56
|
)
|
|
55
57
|
] }) : T;
|
|
56
|
-
};
|
|
58
|
+
});
|
|
59
|
+
F.displayName = "MapButton";
|
|
57
60
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
F as MapButton,
|
|
62
|
+
F as default
|
|
60
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),F=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),ne=require("../../../../tedi/helpers/get-element-ref.cjs.js"),a=require("./map-dropdown.module.scss.cjs.js"),oe=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),se=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),D=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),q=({children:i})=>i,C=({items:i,children:x})=>null,p=i=>{const{children:x,onItemClick:f,closeMenuOnClick:j=!0,onOpenChange:g,placement:N="bottom-start",layout:I="column",isOpen:m,sameWidth:O=!1,className:A}=i,{initialFocus:S=-1,modal:b=!1,...M}=i.focusManager??{},{getLabel:T}=oe.useLabels(),{visuallyHiddenDismiss:L=b?T("close"):!1}=M??{},U=o.useFloatingNodeId(),y=l.useRef([]),[W,w]=l.useState(!1),v=m!==void 0?m:W,[R,K]=l.useState(null);let u=[],_=null,s=null;if(l.Children.forEach(x,e=>{if(l.isValidElement(e)){if(e.type===q)s=e.props.children;else if(e.type===C){const n=e.props,{items:t,children:c}=n;Array.isArray(t)&&t.every(h=>typeof h=="object"&&h!==null&&"children"in h)?u=t:c&&(_=c)}}}),!s)throw new Error("Dropdown must have a Dropdown.Trigger child");const k={name:"sameWidth",fn:({rects:e,elements:n})=>{const t=e.reference.width;return n.floating.style.width=`${t}px`,{data:{width:t}}}},{x:B,y:H,strategy:V,refs:P,placement:$,context:d}=o.useFloating({placement:N,nodeId:U,open:v,onOpenChange:e=>{m===void 0&&w(e),g==null||g(e)},middleware:[...O?[k]:[],D.flip(),D.shift(),D.offset(5)],whileElementsMounted:se.autoUpdate}),z=u.findIndex(e=>e.isActive),{getReferenceProps:G,getFloatingProps:J,getItemProps:Q}=o.useInteractions([o.useClick(d),o.useListNavigation(d,{listRef:y,activeIndex:R,selectedIndex:z,onNavigate:K,loop:!0}),o.useRole(d,{role:"listbox"}),o.useDismiss(d,{outsidePress:e=>!(e.target instanceof Element&&e.target.closest("[data-floating-ui-portal]")),escapeKey:!1,referencePress:!1})]),X=o.useMergeRefs([P.setReference,s?ne.getElementRef(s):null]),Y=()=>v?r.jsx(o.FloatingFocusManager,{context:d,initialFocus:S,visuallyHiddenDismiss:L,modal:b,...M,children:r.jsx("div",{...J({ref:P.setFloating,style:{position:V,left:B??0,top:H??0},className:F.default(a.default["tedi-map-dropdown"],{[a.default["tedi-map-dropdown--row"]]:I==="row",[a.default["tedi-map-dropdown--column"]]:I==="column"},A),onKeyDown(n){n.key==="Tab"&&w(!1)}}),"data-placement":$,children:u.length>0?u.map((n,t)=>ee(n,t)):_})}):null,Z=e=>F.default(a.default["tedi-map-dropdown__item"],{[a.default["tedi-map-dropdown__item--active"]]:e.isActive,[a.default["tedi-map-dropdown__item--disabled"]]:e.isDisabled}),E=(e,n,t)=>{var c;f==null||f(e,n,t),(c=e==null?void 0:e.onClick)==null||c.call(e,t),j&&w(!1)},ee=(e,n)=>r.jsx("button",{...Q({disabled:e.isDisabled,tabIndex:R===n?0:-1,role:"option",className:Z(e),onClick:t=>E(e,n,t),onKeyDown(t){t.key==="Enter"&&E(e,n,t)},ref(t){y.current[n]=t}}),children:e.children},n),te=s?l.cloneElement(s,G({tabIndex:0,...s.props,ref:X})):null;return r.jsxs(r.Fragment,{children:[te,r.jsx(o.FloatingPortal,{children:Y()})]})};p.Trigger=q;p.Content=C;exports.MapDropdown=p;exports.default=p;
|