@tedi-design-system/react 18.1.0-rc.6 → 18.1.0-rc.7
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/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/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 +13 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.es.js +65 -29
- package/src/community/components/map-components/base-map-selection/base-map-selection.d.ts +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.es.js +2 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),I=require("../../../../tedi/components/base/icon/icon.cjs.js"),t=require("./base-map-selection.module.scss.cjs.js"),S=require("../../../../tedi/helpers/hooks/use-element-size.cjs.js"),s=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),d=b=>{const{title:l,content:x,selected:c,onSelect:n,type:u="selection",className:h,id:j,multiple:T,disabled:o,tooltipText:p,tooltipType:f="info"}=b,a=r.useRef(null),_=S.useElementSize(a),[y,g]=r.useState(!1);r.useEffect(()=>{const i=a.current;i&&g(i.scrollWidth>i.clientWidth)},[_,l]);const q=()=>{o||n==null||n()},v=i=>{o||(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n==null||n())},M=N.default(t.default["tedi-base-map-selection__wrapper"],c&&t.default["tedi-base-map-selection--selected"],u&&t.default[`tedi-base-map-selection--${u}`],T&&t.default["tedi-base-map-selection--multiple"],o&&t.default["tedi-base-map-selection--disabled"],h),m=e.jsx("div",{ref:a,tabIndex:-1,className:t.default["tedi-base-map-selection__title"],children:l}),E=y?e.jsxs(s.Tooltip,{children:[e.jsx(s.Tooltip.Trigger,{children:m}),e.jsx(s.Tooltip.Content,{children:l})]}):m;return e.jsxs("div",{role:"button",tabIndex:o?-1:0,"aria-pressed":!!c,"aria-disabled":o||void 0,onClick:q,onKeyDown:v,className:M,id:j,children:[e.jsx("div",{"aria-hidden":!0,className:t.default["tedi-base-map-selection__content"],children:x}),p&&e.jsxs(s.Tooltip,{children:[e.jsx(s.Tooltip.Trigger,{children:e.jsx("span",{tabIndex:-1,className:t.default["tedi-base-map-selection__info"],children:e.jsx(I.Icon,{background:"brand-secondary",name:f==="error"?"error":"info",size:16,color:f==="error"?"danger":"brand"})})}),e.jsx(s.Tooltip.Content,{children:p})]}),E]})};d.displayName="BaseMapOption";exports.BaseMapOption=d;exports.default=d;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
export type BaseMapOptionType = 'button' | 'historical' | 'selection';
|
|
3
|
+
export type BaseMapOptionTooltipType = 'info' | 'error';
|
|
3
4
|
export interface BaseMapOptionProps {
|
|
4
5
|
/**
|
|
5
6
|
* The title displayed within the option.
|
|
@@ -43,6 +44,18 @@ export interface BaseMapOptionProps {
|
|
|
43
44
|
* Applies disabled style.
|
|
44
45
|
*/
|
|
45
46
|
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Text shown in a tooltip. When set, an info icon is rendered in the middle of
|
|
49
|
+
* the option and reveals this text on hover.
|
|
50
|
+
*/
|
|
51
|
+
tooltipText?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Visual style of the info icon shown when `tooltipText` is set.
|
|
54
|
+
* - `'info'`: neutral informational icon (default)
|
|
55
|
+
* - `'error'`: error/danger styled icon
|
|
56
|
+
* @default 'info'
|
|
57
|
+
*/
|
|
58
|
+
tooltipType?: BaseMapOptionTooltipType;
|
|
46
59
|
}
|
|
47
60
|
export declare const BaseMapOption: {
|
|
48
61
|
(props: BaseMapOptionProps): JSX.Element;
|
|
@@ -1,39 +1,75 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import k from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useRef as C, useState as w, useEffect as z } from "react";
|
|
4
|
+
import { Icon as B } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import t from "./base-map-selection.module.scss.es.js";
|
|
6
|
+
import { useElementSize as D } from "../../../../tedi/helpers/hooks/use-element-size.es.js";
|
|
7
|
+
import { Tooltip as s } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
8
|
+
const M = (b) => {
|
|
9
|
+
const {
|
|
10
|
+
title: r,
|
|
11
|
+
content: u,
|
|
12
|
+
selected: d,
|
|
13
|
+
onSelect: n,
|
|
14
|
+
type: c = "selection",
|
|
15
|
+
className: h,
|
|
16
|
+
id: y,
|
|
17
|
+
multiple: _,
|
|
18
|
+
disabled: o,
|
|
19
|
+
tooltipText: m,
|
|
20
|
+
tooltipType: p = "info"
|
|
21
|
+
} = b, a = C(null), x = D(a), [N, T] = w(!1);
|
|
22
|
+
z(() => {
|
|
23
|
+
const i = a.current;
|
|
24
|
+
i && T(i.scrollWidth > i.clientWidth);
|
|
25
|
+
}, [x, r]);
|
|
26
|
+
const g = () => {
|
|
27
|
+
o || n == null || n();
|
|
28
|
+
}, v = (i) => {
|
|
29
|
+
o || (i.key === "Enter" || i.key === " ") && (i.preventDefault(), n == null || n());
|
|
30
|
+
}, E = k(
|
|
31
|
+
t["tedi-base-map-selection__wrapper"],
|
|
32
|
+
d && t["tedi-base-map-selection--selected"],
|
|
33
|
+
c && t[`tedi-base-map-selection--${c}`],
|
|
34
|
+
_ && t["tedi-base-map-selection--multiple"],
|
|
35
|
+
o && t["tedi-base-map-selection--disabled"],
|
|
36
|
+
h
|
|
37
|
+
), f = /* @__PURE__ */ e("div", { ref: a, tabIndex: -1, className: t["tedi-base-map-selection__title"], children: r }), I = N ? /* @__PURE__ */ l(s, { children: [
|
|
38
|
+
/* @__PURE__ */ e(s.Trigger, { children: f }),
|
|
39
|
+
/* @__PURE__ */ e(s.Content, { children: r })
|
|
40
|
+
] }) : f;
|
|
41
|
+
return /* @__PURE__ */ l(
|
|
18
42
|
"div",
|
|
19
43
|
{
|
|
20
44
|
role: "button",
|
|
21
|
-
tabIndex:
|
|
22
|
-
"aria-pressed": !!
|
|
23
|
-
"aria-disabled":
|
|
24
|
-
onClick:
|
|
25
|
-
onKeyDown:
|
|
26
|
-
className:
|
|
27
|
-
id:
|
|
45
|
+
tabIndex: o ? -1 : 0,
|
|
46
|
+
"aria-pressed": !!d,
|
|
47
|
+
"aria-disabled": o || void 0,
|
|
48
|
+
onClick: g,
|
|
49
|
+
onKeyDown: v,
|
|
50
|
+
className: E,
|
|
51
|
+
id: y,
|
|
28
52
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ l(
|
|
53
|
+
/* @__PURE__ */ e("div", { "aria-hidden": !0, className: t["tedi-base-map-selection__content"], children: u }),
|
|
54
|
+
m && /* @__PURE__ */ l(s, { children: [
|
|
55
|
+
/* @__PURE__ */ e(s.Trigger, { children: /* @__PURE__ */ e("span", { tabIndex: -1, className: t["tedi-base-map-selection__info"], children: /* @__PURE__ */ e(
|
|
56
|
+
B,
|
|
57
|
+
{
|
|
58
|
+
background: "brand-secondary",
|
|
59
|
+
name: p === "error" ? "error" : "info",
|
|
60
|
+
size: 16,
|
|
61
|
+
color: p === "error" ? "danger" : "brand"
|
|
62
|
+
}
|
|
63
|
+
) }) }),
|
|
64
|
+
/* @__PURE__ */ e(s.Content, { children: m })
|
|
65
|
+
] }),
|
|
66
|
+
I
|
|
31
67
|
]
|
|
32
68
|
}
|
|
33
69
|
);
|
|
34
70
|
};
|
|
35
|
-
|
|
71
|
+
M.displayName = "BaseMapOption";
|
|
36
72
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
73
|
+
M as BaseMapOption,
|
|
74
|
+
M as default
|
|
39
75
|
};
|
|
@@ -54,6 +54,6 @@ export declare namespace BaseMapSelection {
|
|
|
54
54
|
};
|
|
55
55
|
var displayName: string;
|
|
56
56
|
}
|
|
57
|
-
export type { BaseMapOptionProps, BaseMapOptionType } from './base-map-option';
|
|
57
|
+
export type { BaseMapOptionProps, BaseMapOptionTooltipType, BaseMapOptionType } from './base-map-option';
|
|
58
58
|
export { BaseMapOption };
|
|
59
59
|
export default BaseMapSelection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-base-map-selection__wrapper":"tedi-base-map-selection__wrapper-aae7464f","tedi-base-map-selection__content":"tedi-base-map-selection__content-3145448d","tedi-base-map-selection__options":"tedi-base-map-selection__options-dce549ce","tedi-base-map-selection__transparency":"tedi-base-map-selection__transparency-d4be551d","tedi-base-map-selection__transparency-field":"tedi-base-map-selection__transparency-field-d8b5a065","tedi-base-map-selection--historical":"tedi-base-map-selection--historical-159d3def","tedi-base-map-selection__title":"tedi-base-map-selection__title-d46b74ec","tedi-base-map-selection--selected":"tedi-base-map-selection--selected-914a0483","tedi-base-map-selection--
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-base-map-selection__wrapper":"tedi-base-map-selection__wrapper-aae7464f","tedi-base-map-selection--disabled":"tedi-base-map-selection--disabled-a957b2c8","tedi-base-map-selection__content":"tedi-base-map-selection__content-3145448d","tedi-base-map-selection__info":"tedi-base-map-selection__info-a5674a2d","tedi-base-map-selection__options":"tedi-base-map-selection__options-dce549ce","tedi-base-map-selection__transparency":"tedi-base-map-selection__transparency-d4be551d","tedi-base-map-selection__transparency-field":"tedi-base-map-selection__transparency-field-d8b5a065","tedi-base-map-selection--historical":"tedi-base-map-selection--historical-159d3def","tedi-base-map-selection__title":"tedi-base-map-selection__title-d46b74ec","tedi-base-map-selection--selected":"tedi-base-map-selection--selected-914a0483","tedi-base-map-selection--button":"tedi-base-map-selection--button-0e9e36f4","tedi-base-map-selection--selection":"tedi-base-map-selection--selection-910cae90","tedi-base-map-selection--multiple":"tedi-base-map-selection--multiple-58cb365c"};exports.default=e;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
const e = {
|
|
2
2
|
"tedi-base-map-selection__wrapper": "tedi-base-map-selection__wrapper-aae7464f",
|
|
3
|
+
"tedi-base-map-selection--disabled": "tedi-base-map-selection--disabled-a957b2c8",
|
|
3
4
|
"tedi-base-map-selection__content": "tedi-base-map-selection__content-3145448d",
|
|
5
|
+
"tedi-base-map-selection__info": "tedi-base-map-selection__info-a5674a2d",
|
|
4
6
|
"tedi-base-map-selection__options": "tedi-base-map-selection__options-dce549ce",
|
|
5
7
|
"tedi-base-map-selection__transparency": "tedi-base-map-selection__transparency-d4be551d",
|
|
6
8
|
"tedi-base-map-selection__transparency-field": "tedi-base-map-selection__transparency-field-d8b5a065",
|
|
7
9
|
"tedi-base-map-selection--historical": "tedi-base-map-selection--historical-159d3def",
|
|
8
10
|
"tedi-base-map-selection__title": "tedi-base-map-selection__title-d46b74ec",
|
|
9
11
|
"tedi-base-map-selection--selected": "tedi-base-map-selection--selected-914a0483",
|
|
10
|
-
"tedi-base-map-selection--disabled": "tedi-base-map-selection--disabled-a957b2c8",
|
|
11
12
|
"tedi-base-map-selection--button": "tedi-base-map-selection--button-0e9e36f4",
|
|
12
13
|
"tedi-base-map-selection--selection": "tedi-base-map-selection--selection-910cae90",
|
|
13
14
|
"tedi-base-map-selection--multiple": "tedi-base-map-selection--multiple-58cb365c"
|