@tedi-design-system/react 15.0.0 → 16.0.0-rc.1
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/_virtual/index.cjs10.js +1 -1
- package/_virtual/index.cjs11.js +1 -1
- package/_virtual/index.cjs12.js +1 -1
- package/_virtual/index.cjs13.js +1 -1
- package/_virtual/index.cjs5.js +1 -1
- package/_virtual/index.cjs6.js +1 -1
- package/_virtual/index.cjs7.js +1 -1
- package/_virtual/index.cjs8.js +1 -1
- package/_virtual/index.cjs9.js +1 -1
- package/_virtual/index.es10.js +1 -1
- package/_virtual/index.es11.js +1 -1
- package/_virtual/index.es12.js +1 -1
- package/_virtual/index.es13.js +4 -2
- package/_virtual/index.es5.js +2 -4
- package/_virtual/index.es6.js +1 -1
- package/_virtual/index.es7.js +1 -1
- package/_virtual/index.es8.js +1 -1
- package/_virtual/index.es9.js +1 -1
- package/bundle-stats.html +1 -1
- package/external/@mui/system/colorManipulator.cjs.js +1 -1
- package/external/@mui/system/colorManipulator.es.js +2 -2
- package/external/@mui/system/createStyled.cjs.js +1 -1
- package/external/@mui/system/createStyled.es.js +6 -6
- package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
- package/external/@mui/system/useThemeWithoutDefault.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/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/layout/header/components/header-modal/header-modal.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-modal/header-modal.es.js +7 -7
- package/src/community/components/map-components/directions/direction-item.cjs.js +1 -1
- package/src/community/components/map-components/directions/direction-item.es.js +16 -15
- package/src/community/components/map-components/right-panel/right-panel.cjs.js +1 -1
- package/src/community/components/map-components/right-panel/right-panel.es.js +24 -24
- package/src/community/components/map-components/sheet/sheet.cjs.js +1 -1
- package/src/community/components/map-components/sheet/sheet.es.js +10 -10
- package/src/community/components/modal/modal.cjs.js +1 -1
- package/src/community/components/modal/modal.es.js +5 -5
- package/src/tedi/components/buttons/closing-button/closing-button.cjs.js +1 -1
- package/src/tedi/components/buttons/closing-button/closing-button.d.ts +4 -2
- package/src/tedi/components/buttons/closing-button/closing-button.es.js +15 -15
- package/src/tedi/components/buttons/closing-button/closing-button.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/closing-button/closing-button.module.scss.es.js +2 -2
- package/src/tedi/components/form/file-dropzone/file-dropzone.cjs.js +1 -1
- package/src/tedi/components/form/file-dropzone/file-dropzone.es.js +16 -9
- package/src/tedi/components/form/file-upload/file-upload.cjs.js +1 -1
- package/src/tedi/components/form/file-upload/file-upload.es.js +15 -15
- package/src/tedi/components/form/select/components/select-clear-indicator.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-clear-indicator.es.js +8 -8
- package/src/tedi/components/form/select/components/select-multi-value-remove.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-multi-value-remove.es.js +1 -0
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.es.js +40 -37
- package/src/tedi/components/notifications/alert/alert.cjs.js +1 -1
- package/src/tedi/components/notifications/alert/alert.es.js +14 -14
- package/src/tedi/components/overlays/popover/popover-content.cjs.js +1 -1
- package/src/tedi/components/overlays/popover/popover-content.es.js +9 -9
- package/src/tedi/components/tags/tag/tag.cjs.js +1 -1
- package/src/tedi/components/tags/tag/tag.es.js +13 -13
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("../../../../../../tedi/components/base/typography/text/text.cjs.js"),h=require("../../../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),b=require("../../../../button/button.cjs.js"),x=require("../../header/header.module.scss.cjs.js"),j=require("../../../../modal/modal-provider.cjs.js"),m=require("../../../../modal/modal-trigger.cjs.js"),C=require("../../../../modal/modal.cjs.js"),q=require("../../../../modal/modal-closer.cjs.js"),p=require("../../../../../../tedi/providers/label-provider/use-labels.cjs.js"),r=require("../../../../card/card-content/card-content.cjs.js"),o=require("../../../../card/card.cjs.js"),d=t=>{const{triggerProps:s,defaultOpen:l,open:i,onToggle:n,children:a,ariaLabelledby:u}=t,{getLabel:c}=p.useLabels();return e.jsxs(j.ModalProvider,{defaultOpen:l,open:i,onToggle:n,children:[e.jsx(m.ModalTrigger,{children:e.jsx(b.Button,{...s})}),e.jsx(C.Modal,{"aria-labelledby":u,hideCloseButton:!0,position:"right",children:e.jsxs(r.CardContent,{padding:0,children:[e.jsx(o.Card,{borderless:!0,background:"primary-highlight-subtle",padding:.5,borderRadius:!1,children:e.jsx(r.CardContent,{children:e.jsx(g.Text,{element:"div",modifiers:"right",children:e.jsx(q.ModalCloser,{children:e.jsx(h.ClosingButton,{title:c("modal.close"),size:"
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("../../../../../../tedi/components/base/typography/text/text.cjs.js"),h=require("../../../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),b=require("../../../../button/button.cjs.js"),x=require("../../header/header.module.scss.cjs.js"),j=require("../../../../modal/modal-provider.cjs.js"),m=require("../../../../modal/modal-trigger.cjs.js"),C=require("../../../../modal/modal.cjs.js"),q=require("../../../../modal/modal-closer.cjs.js"),p=require("../../../../../../tedi/providers/label-provider/use-labels.cjs.js"),r=require("../../../../card/card-content/card-content.cjs.js"),o=require("../../../../card/card.cjs.js"),d=t=>{const{triggerProps:s,defaultOpen:l,open:i,onToggle:n,children:a,ariaLabelledby:u}=t,{getLabel:c}=p.useLabels();return e.jsxs(j.ModalProvider,{defaultOpen:l,open:i,onToggle:n,children:[e.jsx(m.ModalTrigger,{children:e.jsx(b.Button,{...s})}),e.jsx(C.Modal,{"aria-labelledby":u,hideCloseButton:!0,position:"right",children:e.jsxs(r.CardContent,{padding:0,children:[e.jsx(o.Card,{borderless:!0,background:"primary-highlight-subtle",padding:.5,borderRadius:!1,children:e.jsx(r.CardContent,{children:e.jsx(g.Text,{element:"div",modifiers:"right",children:e.jsx(q.ModalCloser,{children:e.jsx(h.ClosingButton,{title:c("modal.close"),size:"default",className:x.default["header-modal__close"]})})})})}),e.jsx(o.Card,{border:"top-border-default",borderRadius:!1,padding:0,children:e.jsx(r.CardContent,{children:a})})]})})]})};exports.HeaderModal=d;exports.default=d;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { Text as f } from "../../../../../../tedi/components/base/typography/text/text.es.js";
|
|
3
3
|
import { ClosingButton as c } from "../../../../../../tedi/components/buttons/closing-button/closing-button.es.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import
|
|
4
|
+
import { Button as h } from "../../../../button/button.es.js";
|
|
5
|
+
import g from "../../header/header.module.scss.es.js";
|
|
6
6
|
import { ModalProvider as u } from "../../../../modal/modal-provider.es.js";
|
|
7
7
|
import { ModalTrigger as b } from "../../../../modal/modal-trigger.es.js";
|
|
8
8
|
import { Modal as C } from "../../../../modal/modal.es.js";
|
|
@@ -11,16 +11,16 @@ import { useLabels as x } from "../../../../../../tedi/providers/label-provider/
|
|
|
11
11
|
import { CardContent as e } from "../../../../card/card-content/card-content.es.js";
|
|
12
12
|
import { Card as i } from "../../../../card/card.es.js";
|
|
13
13
|
const N = (d) => {
|
|
14
|
-
const { triggerProps:
|
|
15
|
-
return /* @__PURE__ */ o(u, { defaultOpen:
|
|
16
|
-
/* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
|
|
14
|
+
const { triggerProps: t, defaultOpen: l, open: a, onToggle: m, children: n, ariaLabelledby: s } = d, { getLabel: p } = x();
|
|
15
|
+
return /* @__PURE__ */ o(u, { defaultOpen: l, open: a, onToggle: m, children: [
|
|
16
|
+
/* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(h, { ...t }) }),
|
|
17
17
|
/* @__PURE__ */ r(C, { "aria-labelledby": s, hideCloseButton: !0, position: "right", children: /* @__PURE__ */ o(e, { padding: 0, children: [
|
|
18
18
|
/* @__PURE__ */ r(i, { borderless: !0, background: "primary-highlight-subtle", padding: 0.5, borderRadius: !1, children: /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(f, { element: "div", modifiers: "right", children: /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(
|
|
19
19
|
c,
|
|
20
20
|
{
|
|
21
21
|
title: p("modal.close"),
|
|
22
|
-
size: "
|
|
23
|
-
className:
|
|
22
|
+
size: "default",
|
|
23
|
+
className: g["header-modal__close"]
|
|
24
24
|
}
|
|
25
25
|
) }) }) }) }),
|
|
26
26
|
/* @__PURE__ */ r(i, { border: "top-border-default", borderRadius: !1, padding: 0, children: /* @__PURE__ */ r(e, { children: n }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),v=require("../../../../../external/@dnd-kit/sortable/dist/sortable.esm.cjs.js"),j=require("../../../../../external/@dnd-kit/utilities/dist/utilities.esm.cjs.js"),x=require("../../../../tedi/components/base/icon/icon.cjs.js"),q=require("../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),v=require("../../../../../external/@dnd-kit/sortable/dist/sortable.esm.cjs.js"),j=require("../../../../../external/@dnd-kit/utilities/dist/utilities.esm.cjs.js"),x=require("../../../../tedi/components/base/icon/icon.cjs.js"),q=require("../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),i=require("./directions.module.scss.cjs.js"),N=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),s=r=>{const{id:o,children:n,onDelete:t,isDragging:a=!1,showAboveIndicator:d=!1,showBelowIndicator:c=!1}=r,{getLabel:l}=N.useLabels(),{attributes:u,listeners:m,setNodeRef:_,transform:f,transition:g}=v.useSortable({id:o}),b={transform:j.CSS.Transform.toString(f),transition:g};return e.jsxs("div",{ref:_,className:`${i.default["tedi-directions__item"]} ${a?i.default["tedi-directions__item--dragging"]:""}`,style:b,children:[e.jsxs("div",{className:i.default["tedi-directions__content"],children:[d&&e.jsx("div",{className:i.default["tedi-directions__drop-indicator"]}),n,e.jsx("div",{className:i.default["tedi-directions__drag-icon"],...u,...m,children:e.jsx(x.Icon,{name:"drag_indicator",size:12,background:"brand-secondary"})}),c&&e.jsx("div",{className:i.default["tedi-directions__drop-indicator"]})]}),t&&e.jsx(q.ClosingButton,{className:i.default["tedi-directions__remove"],onClick:t,"aria-label":l("remove"),iconSize:18})]})};exports.DirectionItem=s;exports.default=s;
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useSortable as v } from "../../../../../external/@dnd-kit/sortable/dist/sortable.esm.es.js";
|
|
3
3
|
import { CSS as u } from "../../../../../external/@dnd-kit/utilities/dist/utilities.esm.es.js";
|
|
4
4
|
import { Icon as N } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
5
|
import { ClosingButton as h } from "../../../../tedi/components/buttons/closing-button/closing-button.es.js";
|
|
6
|
-
import
|
|
7
|
-
import { useLabels as
|
|
8
|
-
const k = (
|
|
9
|
-
const { id: s, children: n, onDelete:
|
|
6
|
+
import i from "./directions.module.scss.es.js";
|
|
7
|
+
import { useLabels as S } from "../../../../tedi/providers/label-provider/use-labels.es.js";
|
|
8
|
+
const k = (t) => {
|
|
9
|
+
const { id: s, children: n, onDelete: o, isDragging: a = !1, showAboveIndicator: d = !1, showBelowIndicator: c = !1 } = t, { getLabel: m } = S(), { attributes: l, listeners: f, setNodeRef: _, transform: g, transition: p } = v({ id: s }), b = {
|
|
10
10
|
transform: u.Transform.toString(g),
|
|
11
11
|
transition: p
|
|
12
12
|
};
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ r(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
ref: _,
|
|
17
|
-
className: `${
|
|
17
|
+
className: `${i["tedi-directions__item"]} ${a ? i["tedi-directions__item--dragging"] : ""}`,
|
|
18
18
|
style: b,
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
d && /* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ r("div", { className: i["tedi-directions__content"], children: [
|
|
21
|
+
d && /* @__PURE__ */ e("div", { className: i["tedi-directions__drop-indicator"] }),
|
|
22
22
|
n,
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
c && /* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ e("div", { className: i["tedi-directions__drag-icon"], ...l, ...f, children: /* @__PURE__ */ e(N, { name: "drag_indicator", size: 12, background: "brand-secondary" }) }),
|
|
24
|
+
c && /* @__PURE__ */ e("div", { className: i["tedi-directions__drop-indicator"] })
|
|
25
25
|
] }),
|
|
26
|
-
|
|
26
|
+
o && /* @__PURE__ */ e(
|
|
27
27
|
h,
|
|
28
28
|
{
|
|
29
|
-
className:
|
|
30
|
-
onClick:
|
|
31
|
-
"aria-label": m("remove")
|
|
29
|
+
className: i["tedi-directions__remove"],
|
|
30
|
+
onClick: o,
|
|
31
|
+
"aria-label": m("remove"),
|
|
32
|
+
iconSize: 18
|
|
32
33
|
}
|
|
33
34
|
)
|
|
34
35
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),q=require("../../../../../external/classnames/index.cjs.js"),m=require("react"),S=require("../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),_=require("../map-accordion/map-accordion.cjs.js"),A=require("../map-accordion/map-accordion-item.cjs.js"),M=require("../map-accordion/map-accordion-item-content.cjs.js"),D=require("../map-accordion/map-accordion-item-header.cjs.js"),a=require("./right-panel.module.scss.cjs.js"),f=({id:i,isSingleItem:t,onClose:o})=>n.jsx(S.ClosingButton,{className:a.default["tedi-right-panel__closer"],size:t?"
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),q=require("../../../../../external/classnames/index.cjs.js"),m=require("react"),S=require("../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),_=require("../map-accordion/map-accordion.cjs.js"),A=require("../map-accordion/map-accordion-item.cjs.js"),M=require("../map-accordion/map-accordion-item-content.cjs.js"),D=require("../map-accordion/map-accordion-item-header.cjs.js"),a=require("./right-panel.module.scss.cjs.js"),f=({id:i,isSingleItem:t,onClose:o})=>n.jsx(S.ClosingButton,{className:a.default["tedi-right-panel__closer"],size:t?"default":"small",onClick:()=>o(i),title:"Sulge aken"});f.displayName="DefaultCloseButton";const v=(i,t)=>{const o=d=>n.jsx(f,{id:d,isSingleItem:i,onClose:t});return o.displayName="RightPanelDefaultRenderCloseButton",o},C=i=>{const{items:t,defaultOpenItem:o=[],expanderTitle:d="Toimingu aknad",renderToggleButton:x,renderCloseButton:B,showCloseButton:I=!0,onCloseItem:c}=i,[g,h]=m.useState(new Set);m.useEffect(()=>{h(e=>{const s=new Set,r=new Set(t.map(l=>l.id));return e.forEach(l=>{r.has(l)&&s.add(l)}),s})},[t]);const p=m.useMemo(()=>t.filter(({id:e})=>!g.has(e)),[t,g]),R=e=>{h(s=>{const r=new Set(s);return r.add(e),r}),c==null||c(e)},u=p.length===1,j=I?B??v(u,R):void 0;return n.jsx("div",{className:q.default(a.default["tedi-right-panel"],{[a.default["tedi-right-panel--single"]]:u,[a.default["tedi-right-panel--multi"]]:!u}),children:n.jsx(_.MapAccordion,{defaultOpenItem:o,className:a.default["tedi-right-panel__accordion"],expanderMode:!0,expanderTitle:d,renderCloseButton:j,children:p.map(({id:e,title:s,content:r})=>n.jsxs(A.MapAccordionItem,{id:e,children:[n.jsx(D.MapAccordionItemHeader,{className:a.default["tedi-right-panel__accordion-header"],renderToggleButton:x,title:s}),n.jsx(M.MapAccordionItemContent,{children:r})]},e))})})};exports.DefaultCloseButton=f;exports.RightPanel=C;exports.default=C;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import N from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import u from "react";
|
|
4
4
|
import { ClosingButton as S } from "../../../../tedi/components/buttons/closing-button/closing-button.es.js";
|
|
@@ -6,21 +6,21 @@ import { MapAccordion as D } from "../map-accordion/map-accordion.es.js";
|
|
|
6
6
|
import { MapAccordionItem as M } from "../map-accordion/map-accordion-item.es.js";
|
|
7
7
|
import { MapAccordionItemContent as w } from "../map-accordion/map-accordion-item-content.es.js";
|
|
8
8
|
import { MapAccordionItemHeader as v } from "../map-accordion/map-accordion-item-header.es.js";
|
|
9
|
-
import
|
|
10
|
-
const g = ({ id:
|
|
9
|
+
import r from "./right-panel.module.scss.es.js";
|
|
10
|
+
const g = ({ id: i, isSingleItem: t, onClose: n }) => /* @__PURE__ */ a(
|
|
11
11
|
S,
|
|
12
12
|
{
|
|
13
|
-
className:
|
|
14
|
-
size: t ? "
|
|
15
|
-
onClick: () => n(
|
|
13
|
+
className: r["tedi-right-panel__closer"],
|
|
14
|
+
size: t ? "default" : "small",
|
|
15
|
+
onClick: () => n(i),
|
|
16
16
|
title: "Sulge aken"
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
g.displayName = "DefaultCloseButton";
|
|
20
|
-
const A = (
|
|
21
|
-
const n = (d) => /* @__PURE__ */
|
|
20
|
+
const A = (i, t) => {
|
|
21
|
+
const n = (d) => /* @__PURE__ */ a(g, { id: d, isSingleItem: i, onClose: t });
|
|
22
22
|
return n.displayName = "RightPanelDefaultRenderCloseButton", n;
|
|
23
|
-
}, O = (
|
|
23
|
+
}, O = (i) => {
|
|
24
24
|
const {
|
|
25
25
|
items: t,
|
|
26
26
|
defaultOpenItem: n = [],
|
|
@@ -29,46 +29,46 @@ const A = (a, t) => {
|
|
|
29
29
|
renderCloseButton: B,
|
|
30
30
|
showCloseButton: I = !0,
|
|
31
31
|
onCloseItem: c
|
|
32
|
-
} =
|
|
32
|
+
} = i, [p, f] = u.useState(/* @__PURE__ */ new Set());
|
|
33
33
|
u.useEffect(() => {
|
|
34
34
|
f((e) => {
|
|
35
|
-
const o = /* @__PURE__ */ new Set(),
|
|
35
|
+
const o = /* @__PURE__ */ new Set(), s = new Set(t.map((l) => l.id));
|
|
36
36
|
return e.forEach((l) => {
|
|
37
|
-
|
|
37
|
+
s.has(l) && o.add(l);
|
|
38
38
|
}), o;
|
|
39
39
|
});
|
|
40
40
|
}, [t]);
|
|
41
41
|
const h = u.useMemo(() => t.filter(({ id: e }) => !p.has(e)), [t, p]), R = (e) => {
|
|
42
42
|
f((o) => {
|
|
43
|
-
const
|
|
44
|
-
return
|
|
43
|
+
const s = new Set(o);
|
|
44
|
+
return s.add(e), s;
|
|
45
45
|
}), c == null || c(e);
|
|
46
46
|
}, m = h.length === 1, _ = I ? B ?? A(m, R) : void 0;
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ a(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
|
-
className: N(
|
|
51
|
-
[
|
|
52
|
-
[
|
|
50
|
+
className: N(r["tedi-right-panel"], {
|
|
51
|
+
[r["tedi-right-panel--single"]]: m,
|
|
52
|
+
[r["tedi-right-panel--multi"]]: !m
|
|
53
53
|
}),
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ a(
|
|
55
55
|
D,
|
|
56
56
|
{
|
|
57
57
|
defaultOpenItem: n,
|
|
58
|
-
className:
|
|
58
|
+
className: r["tedi-right-panel__accordion"],
|
|
59
59
|
expanderMode: !0,
|
|
60
60
|
expanderTitle: d,
|
|
61
61
|
renderCloseButton: _,
|
|
62
|
-
children: h.map(({ id: e, title: o, content:
|
|
63
|
-
/* @__PURE__ */
|
|
62
|
+
children: h.map(({ id: e, title: o, content: s }) => /* @__PURE__ */ x(M, { id: e, children: [
|
|
63
|
+
/* @__PURE__ */ a(
|
|
64
64
|
v,
|
|
65
65
|
{
|
|
66
|
-
className:
|
|
66
|
+
className: r["tedi-right-panel__accordion-header"],
|
|
67
67
|
renderToggleButton: C,
|
|
68
68
|
title: o
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ a(w, { children: s })
|
|
72
72
|
] }, e))
|
|
73
73
|
}
|
|
74
74
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),c=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),M=require("../../../../tedi/components/base/typography/heading/heading.cjs.js"),I=require("../../../../tedi/components/base/icon/icon.cjs.js"),O=require("../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),e=require("./sheet.module.scss.cjs.js"),U=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),A=N=>{const{open:t,onClose:p,side:a="bottom",title:S="",actions:x,children:q,footer:y,hasActiveActions:g=!1,isVisible:i=!1}=N,o=r.useRef(null),[d,h]=r.useState(!1),[k,b]=r.useState(!1),[l,_]=r.useState(!1),[H,L]=r.useState(0),[C,D]=r.useState(0),{x:Y,strategy:R,update:j}=w.useFloating({placement:a,middleware:[w.offset(0),w.shift()]});r.useEffect(()=>{if(o.current)return U.autoUpdate(o.current,o.current,j)||void 0},[t,j]),r.useEffect(()=>{if(t){b(!0);const s=setTimeout(()=>h(!0),10);return()=>clearTimeout(s)}else{h(!1);const s=setTimeout(()=>b(!1),300);return()=>clearTimeout(s)}},[t]);const E=s=>{var u;if(!i||t)return;_(!0);const v="touches"in s?s.touches[0].clientY:s.clientY;L(v),D(((u=o.current)==null?void 0:u.offsetHeight)||0),document.body.style.userSelect="none"},f=s=>{if(!l||!o.current||t)return;const v=H-s.clientY,u=Math.min(window.innerHeight*.9,Math.max(100,C+(a==="bottom"?v:-v)));o.current.style.height=`${u}px`,u>window.innerHeight*.3&&(h(!0),o.current.style.height="",_(!1))},m=()=>{l&&(_(!1),document.body.style.userSelect="",!d&&o.current&&(o.current.style.height=""))};r.useEffect(()=>(i&&(window.addEventListener("mousemove",f),window.addEventListener("mouseup",m),window.addEventListener("touchmove",f),window.addEventListener("touchend",m)),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",m),window.removeEventListener("touchmove",f),window.removeEventListener("touchend",m),document.body.style.userSelect=""}),[l,i,t]);const T=s=>{!t&&i&&!l&&h(!d)};return!k&&!i?null:n.jsx("div",{className:c.default(e.default["tedi-sheet-overlay"],{[e.default["is-visible"]]:d,[e.default["tedi-sheet-overlay--peek"]]:i&&!t}),onClick:t?p:void 0,children:n.jsxs("div",{ref:o,className:c.default(e.default["tedi-sheet"],e.default[`tedi-sheet--${a}`],{[e.default["is-visible"]]:d,[e.default["tedi-sheet--peek"]]:i&&!t,[e.default["is-dragging"]]:l}),onClick:s=>s.stopPropagation(),style:{position:R,top:a==="top"?0:void 0,bottom:a==="bottom"?0:void 0,left:Y??0},children:[(S||x)&&n.jsxs("div",{className:c.default(e.default["tedi-sheet__header"],{[e.default["tedi-sheet__header--active"]]:g,[e.default["tedi-sheet__header--peekable"]]:i&&!t}),onMouseDown:E,onTouchStart:E,onClick:T,children:[i&&!t&&n.jsx("div",{className:e.default["tedi-sheet__handle"]}),n.jsxs("div",{className:c.default(e.default["tedi-sheet__header-content"]),children:[n.jsxs(M.Heading,{element:"h6",color:g?"white":"primary",className:e.default["tedi-sheet__heading"],children:[S," ",i&&n.jsx(I.Icon,{color:"white",name:d?"expand_less":"expand_more"})]}),n.jsxs("div",{className:e.default["tedi-sheet__header-actions"],children:[x,n.jsx(O.ClosingButton,{size:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),c=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),M=require("../../../../tedi/components/base/typography/heading/heading.cjs.js"),I=require("../../../../tedi/components/base/icon/icon.cjs.js"),O=require("../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),e=require("./sheet.module.scss.cjs.js"),U=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),A=N=>{const{open:t,onClose:p,side:a="bottom",title:S="",actions:x,children:q,footer:y,hasActiveActions:g=!1,isVisible:i=!1}=N,o=r.useRef(null),[d,h]=r.useState(!1),[k,b]=r.useState(!1),[l,_]=r.useState(!1),[H,L]=r.useState(0),[C,D]=r.useState(0),{x:Y,strategy:R,update:j}=w.useFloating({placement:a,middleware:[w.offset(0),w.shift()]});r.useEffect(()=>{if(o.current)return U.autoUpdate(o.current,o.current,j)||void 0},[t,j]),r.useEffect(()=>{if(t){b(!0);const s=setTimeout(()=>h(!0),10);return()=>clearTimeout(s)}else{h(!1);const s=setTimeout(()=>b(!1),300);return()=>clearTimeout(s)}},[t]);const E=s=>{var u;if(!i||t)return;_(!0);const v="touches"in s?s.touches[0].clientY:s.clientY;L(v),D(((u=o.current)==null?void 0:u.offsetHeight)||0),document.body.style.userSelect="none"},f=s=>{if(!l||!o.current||t)return;const v=H-s.clientY,u=Math.min(window.innerHeight*.9,Math.max(100,C+(a==="bottom"?v:-v)));o.current.style.height=`${u}px`,u>window.innerHeight*.3&&(h(!0),o.current.style.height="",_(!1))},m=()=>{l&&(_(!1),document.body.style.userSelect="",!d&&o.current&&(o.current.style.height=""))};r.useEffect(()=>(i&&(window.addEventListener("mousemove",f),window.addEventListener("mouseup",m),window.addEventListener("touchmove",f),window.addEventListener("touchend",m)),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",m),window.removeEventListener("touchmove",f),window.removeEventListener("touchend",m),document.body.style.userSelect=""}),[l,i,t]);const T=s=>{!t&&i&&!l&&h(!d)};return!k&&!i?null:n.jsx("div",{className:c.default(e.default["tedi-sheet-overlay"],{[e.default["is-visible"]]:d,[e.default["tedi-sheet-overlay--peek"]]:i&&!t}),onClick:t?p:void 0,children:n.jsxs("div",{ref:o,className:c.default(e.default["tedi-sheet"],e.default[`tedi-sheet--${a}`],{[e.default["is-visible"]]:d,[e.default["tedi-sheet--peek"]]:i&&!t,[e.default["is-dragging"]]:l}),onClick:s=>s.stopPropagation(),style:{position:R,top:a==="top"?0:void 0,bottom:a==="bottom"?0:void 0,left:Y??0},children:[(S||x)&&n.jsxs("div",{className:c.default(e.default["tedi-sheet__header"],{[e.default["tedi-sheet__header--active"]]:g,[e.default["tedi-sheet__header--peekable"]]:i&&!t}),onMouseDown:E,onTouchStart:E,onClick:T,children:[i&&!t&&n.jsx("div",{className:e.default["tedi-sheet__handle"]}),n.jsxs("div",{className:c.default(e.default["tedi-sheet__header-content"]),children:[n.jsxs(M.Heading,{element:"h6",color:g?"white":"primary",className:e.default["tedi-sheet__heading"],children:[S," ",i&&n.jsx(I.Icon,{color:"white",name:d?"expand_less":"expand_more"})]}),n.jsxs("div",{className:e.default["tedi-sheet__header-actions"],children:[x,n.jsx(O.ClosingButton,{size:"default",onClick:p,className:c.default({[e.default["tedi-sheet__closer--active"]]:g})})]})]})]}),n.jsx("div",{className:e.default["tedi-sheet__content"],children:q}),y&&n.jsx("div",{className:e.default["tedi-sheet__footer"],children:y})]})})};exports.Sheet=A;
|
|
@@ -18,7 +18,7 @@ const ee = (H) => {
|
|
|
18
18
|
footer: N,
|
|
19
19
|
hasActiveActions: g = !1,
|
|
20
20
|
isVisible: i = !1
|
|
21
|
-
} = H, o = z(null), [
|
|
21
|
+
} = H, o = z(null), [d, u] = m(!1), [C, E] = m(!1), [a, w] = m(!1), [Y, D] = m(0), [T, M] = m(0), { x: R, strategy: I, update: k } = A({
|
|
22
22
|
placement: r,
|
|
23
23
|
middleware: [O(0), $()]
|
|
24
24
|
});
|
|
@@ -43,26 +43,26 @@ const ee = (H) => {
|
|
|
43
43
|
const p = "touches" in s ? s.touches[0].clientY : s.clientY;
|
|
44
44
|
D(p), M(((c = o.current) == null ? void 0 : c.offsetHeight) || 0), document.body.style.userSelect = "none";
|
|
45
45
|
}, f = (s) => {
|
|
46
|
-
if (!
|
|
46
|
+
if (!a || !o.current || t) return;
|
|
47
47
|
const p = Y - s.clientY, c = Math.min(
|
|
48
48
|
window.innerHeight * 0.9,
|
|
49
49
|
Math.max(100, T + (r === "bottom" ? p : -p))
|
|
50
50
|
);
|
|
51
51
|
o.current.style.height = `${c}px`, c > window.innerHeight * 0.3 && (u(!0), o.current.style.height = "", w(!1));
|
|
52
52
|
}, v = () => {
|
|
53
|
-
|
|
53
|
+
a && (w(!1), document.body.style.userSelect = "", !d && o.current && (o.current.style.height = ""));
|
|
54
54
|
};
|
|
55
55
|
_(() => (i && (window.addEventListener("mousemove", f), window.addEventListener("mouseup", v), window.addEventListener("touchmove", f), window.addEventListener("touchend", v)), () => {
|
|
56
56
|
window.removeEventListener("mousemove", f), window.removeEventListener("mouseup", v), window.removeEventListener("touchmove", f), window.removeEventListener("touchend", v), document.body.style.userSelect = "";
|
|
57
|
-
}), [
|
|
57
|
+
}), [a, i, t]);
|
|
58
58
|
const j = (s) => {
|
|
59
|
-
!t && i && !
|
|
59
|
+
!t && i && !a && u(!d);
|
|
60
60
|
};
|
|
61
61
|
return !C && !i ? null : /* @__PURE__ */ n(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
className: h(e["tedi-sheet-overlay"], {
|
|
65
|
-
[e["is-visible"]]:
|
|
65
|
+
[e["is-visible"]]: d,
|
|
66
66
|
[e["tedi-sheet-overlay--peek"]]: i && !t
|
|
67
67
|
}),
|
|
68
68
|
onClick: t ? y : void 0,
|
|
@@ -71,9 +71,9 @@ const ee = (H) => {
|
|
|
71
71
|
{
|
|
72
72
|
ref: o,
|
|
73
73
|
className: h(e["tedi-sheet"], e[`tedi-sheet--${r}`], {
|
|
74
|
-
[e["is-visible"]]:
|
|
74
|
+
[e["is-visible"]]: d,
|
|
75
75
|
[e["tedi-sheet--peek"]]: i && !t,
|
|
76
|
-
[e["is-dragging"]]:
|
|
76
|
+
[e["is-dragging"]]: a
|
|
77
77
|
}),
|
|
78
78
|
onClick: (s) => s.stopPropagation(),
|
|
79
79
|
style: {
|
|
@@ -105,7 +105,7 @@ const ee = (H) => {
|
|
|
105
105
|
children: [
|
|
106
106
|
S,
|
|
107
107
|
" ",
|
|
108
|
-
i && /* @__PURE__ */ n(F, { color: "white", name:
|
|
108
|
+
i && /* @__PURE__ */ n(F, { color: "white", name: d ? "expand_less" : "expand_more" })
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
),
|
|
@@ -114,7 +114,7 @@ const ee = (H) => {
|
|
|
114
114
|
/* @__PURE__ */ n(
|
|
115
115
|
P,
|
|
116
116
|
{
|
|
117
|
-
size: "
|
|
117
|
+
size: "default",
|
|
118
118
|
onClick: y,
|
|
119
119
|
className: h({ [e["tedi-sheet__closer--active"]]: g })
|
|
120
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),d=require("../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),d=require("../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),f=require("../../../../external/classnames/index.cjs.js"),t=require("react"),D=require("../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),B=require("../card/card.cjs.js"),l=require("./modal.module.scss.cjs.js"),H=require("./modal-closer.cjs.js"),L=require("./modal-provider.cjs.js"),P=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),b=s=>{const{children:r,size:g=6,cardProps:o={},hideCloseButton:i,position:x,lockScroll:y=!0,trapFocus:n=!0,returnFocus:C=!0,overlay:p=void 0,visuallyHiddenDismiss:v=!1}=s,{getLabel:u}=P.useLabels(),j=s["aria-labelledby"],q=s["aria-describedby"],{isOpen:F,floating:M,getFloatingProps:_,context:h,isDismissable:N}=t.useContext(L.ModalContext),O=t.useMemo(()=>{let c=!1;const m=e=>e.type.displayName;return i?r:t.Children.map(r,(e,R)=>!c&&t.isValidElement(e)&&(m(e)==="CardHeader"||m(e)==="CardContent")?(c=!0,t.cloneElement(e,{...e.props,children:a.jsxs(a.Fragment,{children:[a.jsx(H.ModalCloser,{children:a.jsx(D.ClosingButton,{size:"default",className:l.default["close-button"]})}),e.props.children]})})):e)},[r,u,i]);return a.jsx(d.FloatingPortal,{"data-name":"modal",children:F&&a.jsx(d.FloatingOverlay,{lockScroll:y,className:f.default(l.default.modal,l.default[`modal--${g}`],l.default[`modal--${x}`],{[l.default["modal--no-overlay"]]:p==="none"}),children:a.jsx(d.FloatingFocusManager,{context:h,closeOnFocusOut:!n&&N,visuallyHiddenDismiss:v?u("modal.close"):void 0,returnFocus:C,modal:n,children:a.jsx("div",{..._({ref:M,className:l.default.modal__inner,"aria-labelledby":j,"aria-describedby":q,"aria-modal":n}),children:a.jsx(B.Card,{...o,className:f.default(l.default.modal__card,o==null?void 0:o.className),children:O})})})})})};exports.Modal=b;exports.default=b;
|
|
@@ -18,15 +18,15 @@ const T = (t) => {
|
|
|
18
18
|
lockScroll: b = !0,
|
|
19
19
|
trapFocus: n = !0,
|
|
20
20
|
returnFocus: y = !0,
|
|
21
|
-
overlay:
|
|
22
|
-
visuallyHiddenDismiss:
|
|
21
|
+
overlay: C = void 0,
|
|
22
|
+
visuallyHiddenDismiss: g = !1
|
|
23
23
|
} = t, { getLabel: d } = $(), F = t["aria-labelledby"], v = t["aria-describedby"], { isOpen: N, floating: h, getFloatingProps: x, context: _, isDismissable: M } = r.useContext(R), D = r.useMemo(() => {
|
|
24
24
|
let m = !1;
|
|
25
25
|
const c = (e) => e.type.displayName;
|
|
26
26
|
return i ? s : r.Children.map(s, (e, k) => !m && r.isValidElement(e) && (c(e) === "CardHeader" || c(e) === "CardContent") ? (m = !0, r.cloneElement(e, {
|
|
27
27
|
...e.props,
|
|
28
28
|
children: /* @__PURE__ */ O(H, { children: [
|
|
29
|
-
/* @__PURE__ */ o(L, { children: /* @__PURE__ */ o(E, { size: "
|
|
29
|
+
/* @__PURE__ */ o(L, { children: /* @__PURE__ */ o(E, { size: "default", className: a["close-button"] }) }),
|
|
30
30
|
e.props.children
|
|
31
31
|
] })
|
|
32
32
|
})) : e);
|
|
@@ -36,14 +36,14 @@ const T = (t) => {
|
|
|
36
36
|
{
|
|
37
37
|
lockScroll: b,
|
|
38
38
|
className: u(a.modal, a[`modal--${p}`], a[`modal--${f}`], {
|
|
39
|
-
[a["modal--no-overlay"]]:
|
|
39
|
+
[a["modal--no-overlay"]]: C === "none"
|
|
40
40
|
}),
|
|
41
41
|
children: /* @__PURE__ */ o(
|
|
42
42
|
B,
|
|
43
43
|
{
|
|
44
44
|
context: _,
|
|
45
45
|
closeOnFocusOut: !n && M,
|
|
46
|
-
visuallyHiddenDismiss:
|
|
46
|
+
visuallyHiddenDismiss: g ? d("modal.close") : void 0,
|
|
47
47
|
returnFocus: y,
|
|
48
48
|
modal: n,
|
|
49
49
|
children: /* @__PURE__ */ o(
|
|
@@ -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 o=require("react/jsx-runtime"),m=require("../../../../../external/classnames/index.cjs.js"),f=require("../../base/icon/icon.cjs.js"),n=require("./closing-button.module.scss.cjs.js"),q=require("../../../providers/label-provider/use-labels.cjs.js"),l=i=>{const{getLabel:u}=q.useLabels(),{title:e=u("close"),onClick:c,size:a="default",iconSize:t=24,className:r,...d}=i,s=t===18?"small":a,b=m.default(n.default["tedi-closing-button"],{[n.default[`tedi-closing-button--${s}`]]:s},r),g=t??24;return o.jsx("button",{"data-name":"closing-button",type:"button",...d,className:b,onClick:c,title:e,"aria-label":e,children:o.jsx(f.Icon,{name:"close",size:g})})};exports.ClosingButton=l;exports.default=l;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MouseEventHandler, ButtonHTMLAttributes } from 'react';
|
|
2
|
-
type ClosingButtonSize = '
|
|
2
|
+
export type ClosingButtonSize = 'default' | 'small';
|
|
3
|
+
export type ClosingButtonIconSize = 18 | 24;
|
|
3
4
|
export interface ClosingButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
/**
|
|
5
6
|
* Additional classes to apply custom styles to the ClosingButton.
|
|
@@ -7,7 +8,7 @@ export interface ClosingButtonProps extends ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
7
8
|
className?: string;
|
|
8
9
|
/**
|
|
9
10
|
* Size of the ClosingButton
|
|
10
|
-
* @default '
|
|
11
|
+
* @default 'default'
|
|
11
12
|
*/
|
|
12
13
|
size?: ClosingButtonSize;
|
|
13
14
|
/**
|
|
@@ -15,6 +16,7 @@ export interface ClosingButtonProps extends ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
15
16
|
*/
|
|
16
17
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
17
18
|
title?: string;
|
|
19
|
+
iconSize?: ClosingButtonIconSize;
|
|
18
20
|
}
|
|
19
21
|
export declare const ClosingButton: (props: ClosingButtonProps) => JSX.Element;
|
|
20
22
|
export default ClosingButton;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
import
|
|
5
|
-
import { useLabels as
|
|
6
|
-
const
|
|
7
|
-
const { getLabel: i } =
|
|
8
|
-
|
|
2
|
+
import b from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { Icon as d } from "../../base/icon/icon.es.js";
|
|
4
|
+
import n from "./closing-button.module.scss.es.js";
|
|
5
|
+
import { useLabels as f } from "../../../providers/label-provider/use-labels.es.js";
|
|
6
|
+
const I = (l) => {
|
|
7
|
+
const { getLabel: i } = f(), { title: o = i("close"), onClick: a, size: c = "default", iconSize: t = 24, className: r, ...m } = l, e = t === 18 ? "small" : c, u = b(
|
|
8
|
+
n["tedi-closing-button"],
|
|
9
9
|
{
|
|
10
|
-
[
|
|
10
|
+
[n[`tedi-closing-button--${e}`]]: e
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
r
|
|
13
13
|
);
|
|
14
14
|
return /* @__PURE__ */ s(
|
|
15
15
|
"button",
|
|
16
16
|
{
|
|
17
17
|
"data-name": "closing-button",
|
|
18
18
|
type: "button",
|
|
19
|
-
...
|
|
20
|
-
className:
|
|
21
|
-
onClick:
|
|
19
|
+
...m,
|
|
20
|
+
className: u,
|
|
21
|
+
onClick: a,
|
|
22
22
|
title: o,
|
|
23
23
|
"aria-label": o,
|
|
24
|
-
children: /* @__PURE__ */ s(
|
|
24
|
+
children: /* @__PURE__ */ s(d, { name: "close", size: t ?? 24 })
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
I as ClosingButton,
|
|
30
|
+
I as default
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-closing-button":"tedi-closing-button-358111e2","tedi-closing-button--
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-closing-button":"tedi-closing-button-358111e2","tedi-closing-button--default":"tedi-closing-button--default-22ed12be","tedi-closing-button--small":"tedi-closing-button--small-0e85c3e2"};exports.default=t;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const t = {
|
|
2
2
|
"tedi-closing-button": "tedi-closing-button-358111e2",
|
|
3
|
-
"tedi-closing-button--
|
|
4
|
-
"tedi-closing-button--
|
|
3
|
+
"tedi-closing-button--default": "tedi-closing-button--default-22ed12be",
|
|
4
|
+
"tedi-closing-button--small": "tedi-closing-button--small-0e85c3e2"
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
7
|
t as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),y=require("../../../../../external/classnames/index.cjs.js"),F=require("../../../../../external/react-dropzone/dist/es/index.cjs.js"),C=require("../../../helpers/hooks/use-file-upload.cjs.js"),u=require("../../base/icon/icon.cjs.js"),N=require("../../buttons/closing-button/closing-button.cjs.js"),f=require("../feedback-text/feedback-text.cjs.js"),D=require("../form-label/form-label.cjs.js"),t=require("./file-dropzone.module.scss.cjs.js"),I=require("../../cards/card/card.cjs.js"),L=require("../../cards/card/card-content/card-content.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),y=require("../../../../../external/classnames/index.cjs.js"),F=require("../../../../../external/react-dropzone/dist/es/index.cjs.js"),C=require("../../../helpers/hooks/use-file-upload.cjs.js"),u=require("../../base/icon/icon.cjs.js"),N=require("../../buttons/closing-button/closing-button.cjs.js"),f=require("../feedback-text/feedback-text.cjs.js"),D=require("../form-label/form-label.cjs.js"),t=require("./file-dropzone.module.scss.cjs.js"),I=require("../../cards/card/card.cjs.js"),L=require("../../cards/card/card-content/card-content.cjs.js"),S=require("../../../providers/label-provider/use-labels.cjs.js"),m=require("../../content/list/list.cjs.js"),k=require("../../layout/grid/row.cjs.js"),x=require("../../layout/grid/col.cjs.js"),p=o=>{const{getLabel:s}=S.useLabels(),{label:z=s("file-dropzone.label"),className:b,disabled:a=!1,helper:i,id:c}=o,{innerFiles:d,uploadErrorHelper:n,onFileChange:j,onFileRemove:g}=C.useFileUpload(o),{getRootProps:v,getInputProps:_,isDragActive:q}=F.useDropzone({disabled:a,accept:o.accept?{"application/*":[o.accept]}:void 0,multiple:o.multiple,maxSize:o.maxSize?o.maxSize*1024**2:void 0,onDrop:l=>{if(a)return;j({target:{files:l}})}}),h=y.default(t.default["tedi-file-dropzone"],{[t.default["tedi-file-dropzone--disabled"]]:a},{[t.default["tedi-file-dropzone--invalid"]]:((n==null?void 0:n.type)||(i==null?void 0:i.type))==="error"},{[t.default["tedi-file-dropzone--valid"]]:((n==null?void 0:n.type)||(i==null?void 0:i.type))==="valid"},{[t.default["tedi-file-dropzone--drop-over"]]:q},b),r=i?(i==null?void 0:i.id)??`${c}-helper`:void 0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{...v({tabIndex:a?-1:0,"aria-disabled":a,"aria-describedby":r}),className:h,children:[e.jsx("input",{..._(),disabled:a}),e.jsxs("div",{className:t.default["tedi-file-dropzone__label-wrapper"],children:[e.jsx(u.Icon,{color:a?"tertiary":"secondary",size:24,name:"attach_file"}),e.jsx(D.FormLabel,{id:c,label:z,className:t.default["tedi-file-dropzone__label"]})]})]}),i?e.jsx(f.FeedbackText,{...i,id:r}):n?e.jsx(f.FeedbackText,{...n,id:r}):null,!!d.length&&e.jsx(m.List,{className:t.default["tedi-file-dropzone__file-list"],style:"none","aria-label":s("file-dropzone.selected-files"),children:d.map(l=>e.jsx(m.List.Item,{className:t.default["tedi-file-dropzone__file-list-item"],children:e.jsx(I.Card,{background:l.isValid===!1?"danger-primary":"tertiary",borderless:!0,className:t.default["tedi-file-dropzone__file-item"],children:e.jsx(L.CardContent,{padding:.5,children:e.jsxs(k.Row,{alignItems:"center",children:[e.jsxs(x.Col,{className:t.default["tedi-file-dropzone__file-name"],children:[l.name," ",l.isValid===!1&&e.jsx(u.Icon,{name:"info",color:"danger",display:"inline",size:18})]}),e.jsx(x.Col,{width:"auto",children:e.jsx(N.ClosingButton,{iconSize:18,title:s("remove")+" "+l.name,onClick:()=>g(l)})})]})})})},l.id||l.name))}),e.jsx("div",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:d.length===0?s("file-dropzone.no-file"):s("file-dropzone.files-selected",d.length)})]})};exports.FileDropzone=p;exports.default=p;
|
|
@@ -5,16 +5,16 @@ import { useFileUpload as D } from "../../../helpers/hooks/use-file-upload.es.js
|
|
|
5
5
|
import { Icon as f } from "../../base/icon/icon.es.js";
|
|
6
6
|
import { ClosingButton as L } from "../../buttons/closing-button/closing-button.es.js";
|
|
7
7
|
import { FeedbackText as p } from "../feedback-text/feedback-text.es.js";
|
|
8
|
-
import { FormLabel as
|
|
8
|
+
import { FormLabel as S } from "../form-label/form-label.es.js";
|
|
9
9
|
import o from "./file-dropzone.module.scss.es.js";
|
|
10
|
-
import { Card as
|
|
11
|
-
import { CardContent as
|
|
12
|
-
import { useLabels as
|
|
10
|
+
import { Card as k } from "../../cards/card/card.es.js";
|
|
11
|
+
import { CardContent as w } from "../../cards/card/card-content/card-content.es.js";
|
|
12
|
+
import { useLabels as R } from "../../../providers/label-provider/use-labels.es.js";
|
|
13
13
|
import { List as z } from "../../content/list/list.es.js";
|
|
14
14
|
import { Row as j } from "../../layout/grid/row.es.js";
|
|
15
15
|
import { Col as b } from "../../layout/grid/col.es.js";
|
|
16
16
|
const Y = (a) => {
|
|
17
|
-
const { getLabel: n } =
|
|
17
|
+
const { getLabel: n } = R(), { label: g = n("file-dropzone.label"), className: v, disabled: r = !1, helper: i, id: c } = a, { innerFiles: s, uploadErrorHelper: l, onFileChange: h, onFileRemove: u } = D(a), { getRootProps: y, getInputProps: _, isDragActive: N } = I({
|
|
18
18
|
disabled: r,
|
|
19
19
|
accept: a.accept ? { "application/*": [a.accept] } : void 0,
|
|
20
20
|
multiple: a.multiple,
|
|
@@ -47,7 +47,7 @@ const Y = (a) => {
|
|
|
47
47
|
/* @__PURE__ */ e("input", { ..._(), disabled: r }),
|
|
48
48
|
/* @__PURE__ */ d("div", { className: o["tedi-file-dropzone__label-wrapper"], children: [
|
|
49
49
|
/* @__PURE__ */ e(f, { color: r ? "tertiary" : "secondary", size: 24, name: "attach_file" }),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
50
|
+
/* @__PURE__ */ e(S, { id: c, label: g, className: o["tedi-file-dropzone__label"] })
|
|
51
51
|
] })
|
|
52
52
|
]
|
|
53
53
|
}
|
|
@@ -60,18 +60,25 @@ const Y = (a) => {
|
|
|
60
60
|
style: "none",
|
|
61
61
|
"aria-label": n("file-dropzone.selected-files"),
|
|
62
62
|
children: s.map((t) => /* @__PURE__ */ e(z.Item, { className: o["tedi-file-dropzone__file-list-item"], children: /* @__PURE__ */ e(
|
|
63
|
-
|
|
63
|
+
k,
|
|
64
64
|
{
|
|
65
65
|
background: t.isValid === !1 ? "danger-primary" : "tertiary",
|
|
66
66
|
borderless: !0,
|
|
67
67
|
className: o["tedi-file-dropzone__file-item"],
|
|
68
|
-
children: /* @__PURE__ */ e(
|
|
68
|
+
children: /* @__PURE__ */ e(w, { padding: 0.5, children: /* @__PURE__ */ d(j, { alignItems: "center", children: [
|
|
69
69
|
/* @__PURE__ */ d(b, { className: o["tedi-file-dropzone__file-name"], children: [
|
|
70
70
|
t.name,
|
|
71
71
|
" ",
|
|
72
72
|
t.isValid === !1 && /* @__PURE__ */ e(f, { name: "info", color: "danger", display: "inline", size: 18 })
|
|
73
73
|
] }),
|
|
74
|
-
/* @__PURE__ */ e(b, { width: "auto", children: /* @__PURE__ */ e(
|
|
74
|
+
/* @__PURE__ */ e(b, { width: "auto", children: /* @__PURE__ */ e(
|
|
75
|
+
L,
|
|
76
|
+
{
|
|
77
|
+
iconSize: 18,
|
|
78
|
+
title: n("remove") + " " + t.name,
|
|
79
|
+
onClick: () => u(t)
|
|
80
|
+
}
|
|
81
|
+
) })
|
|
75
82
|
] }) })
|
|
76
83
|
}
|
|
77
84
|
) }, t.id || t.name))
|
|
@@ -1 +1 @@
|
|
|
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"),P=require("react"),W=require("../../../helpers/hooks/use-file-upload.cjs.js"),A=require("../../base/typography/text/text.cjs.js"),v=require("../../buttons/button/button.cjs.js"),E=require("../../buttons/closing-button/closing-button.cjs.js"),G=require("../form-label/form-label.cjs.js"),J=require("../../misc/separator/separator.cjs.js"),K=require("../../tags/tag/tag.cjs.js"),y=require("../feedback-text/feedback-text.cjs.js"),a=require("./file-upload.module.scss.cjs.js"),Q=require("../../../providers/label-provider/use-labels.cjs.js"),F=require("../../../helpers/hooks/use-breakpoint.cjs.js"),X=require("../../layout/grid/row.cjs.js"),q=require("../../layout/grid/col.cjs.js"),L=B=>{const{getLabel:
|
|
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"),P=require("react"),W=require("../../../helpers/hooks/use-file-upload.cjs.js"),A=require("../../base/typography/text/text.cjs.js"),v=require("../../buttons/button/button.cjs.js"),E=require("../../buttons/closing-button/closing-button.cjs.js"),G=require("../form-label/form-label.cjs.js"),J=require("../../misc/separator/separator.cjs.js"),K=require("../../tags/tag/tag.cjs.js"),y=require("../feedback-text/feedback-text.cjs.js"),a=require("./file-upload.module.scss.cjs.js"),Q=require("../../../providers/label-provider/use-labels.cjs.js"),F=require("../../../helpers/hooks/use-breakpoint.cjs.js"),X=require("../../layout/grid/row.cjs.js"),q=require("../../layout/grid/col.cjs.js"),L=B=>{const{getLabel:n}=Q.useLabels(),{id:r,name:C,accept:g,multiple:_,onChange:p,className:N,defaultFiles:k,onDelete:T,hasClearButton:U=!0,files:u,readOnly:m,disabled:s=!1,maxSize:$,validateIndividually:w=!1,size:c="default",helper:i,...S}=B,{innerFiles:b,uploadErrorHelper:t,onFileChange:M,onFileRemove:R,handleClear:h,announcement:z}=W.useFileUpload({accept:g,maxSize:$,multiple:_,validateIndividually:w,defaultFiles:k,onChange:p,onDelete:T,files:u}),I=F.useBreakpoint(),V=f.default(a.default["tedi-file-upload"],{[a.default["tedi-file-upload--disabled"]]:s},N),x=i?(i==null?void 0:i.id)??`${r}-helper`:void 0,d=P.useMemo(()=>u&&p?u:b,[u,b,p]),O=(l,o)=>{const D=l.isValid===!1?`${l.name} (${n("file-upload.failed")})`:l.name;return e.jsx("li",{children:e.jsx(K.Tag,{color:l.isValid===!1?"danger":"primary",onClose:!l.isLoading&&!s&&!m?()=>R(l):void 0,isLoading:l.isLoading,"aria-label":D,children:l.name})},o)},j=()=>{if(d.length>1)return e.jsx("ul",{className:f.default(a.default["tedi-file-upload__items"],a.default["tedi-file-upload__truncate-list"]),children:d.map((l,o)=>O(l,o))});if(d.length===1){const l=d[0],o=l.isValid===!1?`${l.name} (${n("file-upload.failed")})`:l.name;return e.jsx(A.Text,{"aria-label":o,className:f.default(a.default["tedi-file-upload__items"],a.default["tedi-file-upload__truncate"]),children:l.name})}return null};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default["tedi-file-upload__label-wrapper"],children:e.jsx(G.FormLabel,{id:r,...S,renderWithoutLabel:m,className:a.default["tedi-file-upload__label"],size:c})}),e.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:z}),m?j():e.jsx("div",{className:f.default(a.default["tedi-file-upload__container"],{[a.default["tedi-file-upload--disabled"]]:s,[a.default["tedi-file-upload--error"]]:((t==null?void 0:t.type)||(i==null?void 0:i.type))==="error",[a.default["tedi-file-upload--valid"]]:((t==null?void 0:t.type)||(i==null?void 0:i.type))==="valid"},{[a.default[`tedi-file-upload__container--${c}`]]:c}),children:e.jsx("div",{className:a.default["tedi-file-upload__content"],children:e.jsxs(X.Row,{children:[e.jsx(q.Col,{className:"display-flex",children:j()}),e.jsx(q.Col,{xs:12,md:"auto",children:e.jsxs("div",{className:V,children:[e.jsx("input",{id:r,type:"file",name:C,accept:g,onChange:M,multiple:_,disabled:s,"aria-invalid":!!t&&t.type==="error","aria-describedby":x}),U&&d.length>0&&!s&&e.jsxs(e.Fragment,{children:[F.isBreakpointBelow(I,"md")?e.jsx(v.Button,{visualType:"neutral",iconLeft:"close",disabled:s,onClick:h,className:a.default["tedi-file-upload__button"],children:n("clear")}):e.jsx(E.ClosingButton,{onClick:h,iconSize:18,title:n("clear")}),e.jsx(J.Separator,{axis:"vertical",height:1.5,spacing:.5,color:"primary"})]}),e.jsx(v.Button,{visualType:"neutral",iconLeft:"file_upload",disabled:s,onClick:()=>{var l;return(l=document.getElementById(r))==null?void 0:l.click()},className:a.default["tedi-file-upload__button"],size:c,children:n("file-upload.add")})]})})]})})}),i?e.jsx(y.FeedbackText,{...i,id:x}):t?e.jsx(y.FeedbackText,{...t,id:x}):null]})};exports.FileUpload=L;exports.default=L;
|