@tedi-design-system/react 19.1.0-rc.8 → 19.1.0-rc.9
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/package.json +1 -1
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs3.js"),r=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");process.env.NODE_ENV==="production"?e.__module.exports=r.__require():e.__module.exports=o.__require();var t=e.__module.exports;exports.reactIsExports=t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as r } from "../../../../_virtual/index.es3.js";
|
|
2
2
|
import { __require as e } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as o } from "./cjs/react-is.development.es.js";
|
|
4
4
|
process.env.NODE_ENV === "production" ? r.exports = e() : r.exports = o();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs4.js"),t=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");var r;function u(){return r||(r=1,process.env.NODE_ENV==="production"?e.__module.exports=t.__require():e.__module.exports=o.__require()),e.__module.exports}exports.__require=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index.es4.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.es.js";
|
|
4
4
|
var r;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "19.1.0-rc.
|
|
3
|
+
"version": "19.1.0-rc.9",
|
|
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,
|
|
@@ -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;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useFloatingNodeId as
|
|
1
|
+
import { jsxs as ee, Fragment as te, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useFloatingNodeId as ne, useFloating as oe, useInteractions as se, useClick as re, useListNavigation as le, useRole as ie, useDismiss as ae, useMergeRefs as de, FloatingPortal as ce, FloatingFocusManager as pe } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
3
|
import P from "../../../../../external/classnames/index.es.js";
|
|
4
|
-
import a, { cloneElement as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
4
|
+
import a, { cloneElement as fe } from "react";
|
|
5
|
+
import { getElementRef as ue } from "../../../../tedi/helpers/get-element-ref.es.js";
|
|
6
|
+
import s from "./map-dropdown.module.scss.es.js";
|
|
7
|
+
import { useLabels as me } from "../../../../tedi/providers/label-provider/use-labels.es.js";
|
|
8
|
+
import { autoUpdate as ge } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
9
|
+
import { flip as we, shift as he, offset as Ie } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
10
|
+
const R = ({ children: r }) => r, C = ({ items: r, children: w }) => null, E = (r) => {
|
|
10
11
|
const {
|
|
11
12
|
children: w,
|
|
12
13
|
onItemClick: p,
|
|
13
|
-
closeMenuOnClick:
|
|
14
|
+
closeMenuOnClick: N = !0,
|
|
14
15
|
onOpenChange: f,
|
|
15
|
-
placement:
|
|
16
|
+
placement: _ = "bottom-start",
|
|
16
17
|
layout: h = "column",
|
|
17
18
|
isOpen: u,
|
|
18
19
|
sameWidth: O = !1,
|
|
19
20
|
className: A
|
|
20
|
-
} =
|
|
21
|
-
let d = [],
|
|
21
|
+
} = r, { initialFocus: T = -1, modal: I = !1, ...D } = r.focusManager ?? {}, { getLabel: W } = me(), { visuallyHiddenDismiss: j = I ? W("close") : !1 } = D ?? {}, K = ne(), x = a.useRef([]), [L, m] = a.useState(!1), y = u !== void 0 ? u : L, [b, S] = a.useState(null);
|
|
22
|
+
let d = [], M = null, o = null;
|
|
22
23
|
if (a.Children.forEach(w, (e) => {
|
|
23
24
|
if (a.isValidElement(e)) {
|
|
24
|
-
if (e.type ===
|
|
25
|
-
|
|
26
|
-
else if (e.type ===
|
|
25
|
+
if (e.type === R)
|
|
26
|
+
o = e.props.children;
|
|
27
|
+
else if (e.type === C) {
|
|
27
28
|
const n = e.props, { items: t, children: i } = n;
|
|
28
29
|
Array.isArray(t) && t.every(
|
|
29
30
|
(g) => typeof g == "object" && g !== null && "children" in g
|
|
30
|
-
) ? d = t : i && (
|
|
31
|
+
) ? d = t : i && (M = i);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
}), !
|
|
34
|
+
}), !o)
|
|
34
35
|
throw new Error("Dropdown must have a Dropdown.Trigger child");
|
|
35
36
|
const k = {
|
|
36
37
|
name: "sameWidth",
|
|
@@ -40,32 +41,32 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
40
41
|
data: { width: t }
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
}, { x: B, y: H, strategy: U, refs:
|
|
44
|
-
placement:
|
|
44
|
+
}, { x: B, y: H, strategy: U, refs: v, placement: V, context: l } = oe({
|
|
45
|
+
placement: _,
|
|
45
46
|
nodeId: K,
|
|
46
47
|
open: y,
|
|
47
48
|
onOpenChange: (e) => {
|
|
48
49
|
u === void 0 && m(e), f == null || f(e);
|
|
49
50
|
},
|
|
50
|
-
middleware: [...O ? [k] : [],
|
|
51
|
-
whileElementsMounted:
|
|
52
|
-
}), $ = d.findIndex((e) => e.isActive), { getReferenceProps: q, getFloatingProps: z, getItemProps: G } =
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
middleware: [...O ? [k] : [], we(), he(), Ie(5)],
|
|
52
|
+
whileElementsMounted: ge
|
|
53
|
+
}), $ = d.findIndex((e) => e.isActive), { getReferenceProps: q, getFloatingProps: z, getItemProps: G } = se([
|
|
54
|
+
re(l),
|
|
55
|
+
le(l, {
|
|
55
56
|
listRef: x,
|
|
56
57
|
activeIndex: b,
|
|
57
58
|
selectedIndex: $,
|
|
58
59
|
onNavigate: S,
|
|
59
60
|
loop: !0
|
|
60
61
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
ie(l, { role: "listbox" }),
|
|
63
|
+
ae(l, {
|
|
63
64
|
outsidePress: (e) => !(e.target instanceof Element && e.target.closest("[data-floating-ui-portal]")),
|
|
64
65
|
escapeKey: !1,
|
|
65
66
|
referencePress: !1
|
|
66
67
|
})
|
|
67
|
-
]), J = () => y ? /* @__PURE__ */ c(
|
|
68
|
-
|
|
68
|
+
]), J = de([v.setReference, o ? ue(o) : null]), Q = () => y ? /* @__PURE__ */ c(
|
|
69
|
+
pe,
|
|
69
70
|
{
|
|
70
71
|
context: l,
|
|
71
72
|
initialFocus: T,
|
|
@@ -76,17 +77,17 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
76
77
|
"div",
|
|
77
78
|
{
|
|
78
79
|
...z({
|
|
79
|
-
ref:
|
|
80
|
+
ref: v.setFloating,
|
|
80
81
|
style: {
|
|
81
82
|
position: U,
|
|
82
83
|
left: B ?? 0,
|
|
83
84
|
top: H ?? 0
|
|
84
85
|
},
|
|
85
86
|
className: P(
|
|
86
|
-
|
|
87
|
+
s["tedi-map-dropdown"],
|
|
87
88
|
{
|
|
88
|
-
[
|
|
89
|
-
[
|
|
89
|
+
[s["tedi-map-dropdown--row"]]: h === "row",
|
|
90
|
+
[s["tedi-map-dropdown--column"]]: h === "column"
|
|
90
91
|
},
|
|
91
92
|
A
|
|
92
93
|
),
|
|
@@ -95,24 +96,24 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
95
96
|
}
|
|
96
97
|
}),
|
|
97
98
|
"data-placement": V,
|
|
98
|
-
children: d.length > 0 ? d.map((n, t) =>
|
|
99
|
+
children: d.length > 0 ? d.map((n, t) => Y(n, t)) : M
|
|
99
100
|
}
|
|
100
101
|
)
|
|
101
102
|
}
|
|
102
|
-
) : null,
|
|
103
|
-
[
|
|
104
|
-
[
|
|
103
|
+
) : null, X = (e) => P(s["tedi-map-dropdown__item"], {
|
|
104
|
+
[s["tedi-map-dropdown__item--active"]]: e.isActive,
|
|
105
|
+
[s["tedi-map-dropdown__item--disabled"]]: e.isDisabled
|
|
105
106
|
}), F = (e, n, t) => {
|
|
106
107
|
var i;
|
|
107
|
-
p == null || p(e, n, t), (i = e == null ? void 0 : e.onClick) == null || i.call(e, t),
|
|
108
|
-
},
|
|
108
|
+
p == null || p(e, n, t), (i = e == null ? void 0 : e.onClick) == null || i.call(e, t), N && m(!1);
|
|
109
|
+
}, Y = (e, n) => /* @__PURE__ */ c(
|
|
109
110
|
"button",
|
|
110
111
|
{
|
|
111
112
|
...G({
|
|
112
113
|
disabled: e.isDisabled,
|
|
113
114
|
tabIndex: b === n ? 0 : -1,
|
|
114
115
|
role: "option",
|
|
115
|
-
className:
|
|
116
|
+
className: X(e),
|
|
116
117
|
onClick: (t) => F(e, n, t),
|
|
117
118
|
onKeyDown(t) {
|
|
118
119
|
t.key === "Enter" && F(e, n, t);
|
|
@@ -124,21 +125,22 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
124
125
|
children: e.children
|
|
125
126
|
},
|
|
126
127
|
n
|
|
127
|
-
),
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
), Z = o ? fe(
|
|
129
|
+
o,
|
|
130
|
+
q({
|
|
130
131
|
tabIndex: 0,
|
|
131
132
|
// @ts-expect-error: 'rest' props do not fully match Anchor's expected props, but they are validated elsewhere
|
|
132
|
-
...
|
|
133
|
+
...o.props,
|
|
134
|
+
ref: J
|
|
133
135
|
})
|
|
134
|
-
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
/* @__PURE__ */ c(
|
|
136
|
+
) : null;
|
|
137
|
+
return /* @__PURE__ */ ee(te, { children: [
|
|
138
|
+
Z,
|
|
139
|
+
/* @__PURE__ */ c(ce, { children: Q() })
|
|
138
140
|
] });
|
|
139
141
|
};
|
|
140
|
-
E.Trigger =
|
|
141
|
-
E.Content =
|
|
142
|
+
E.Trigger = R;
|
|
143
|
+
E.Content = C;
|
|
142
144
|
export {
|
|
143
145
|
E as MapDropdown,
|
|
144
146
|
E as default
|