@tedi-design-system/react 19.1.0-rc.9 → 19.1.0
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/community.cjs.js +1 -1
- package/community.es.js +215 -223
- package/component.manifest.json +63 -20
- 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/index.css +1 -1
- package/package.json +2 -2
- 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-selection.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +19 -19
- 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 +10 -1
- package/src/community/components/map-components/map-button/map-button.es.js +31 -29
- 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/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/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/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/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.es.js +8 -6
- 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 +30 -2
- package/src/tedi/providers/label-provider/labels-map.es.js +29 -1
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +326 -324
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { ButtonProps } from '../../../../tedi';
|
|
1
|
+
import { ButtonProps, IconSize } from '../../../../tedi';
|
|
2
2
|
import { MapDropdownItem } from '../map-dropdown/map-dropdown';
|
|
3
3
|
/**
|
|
4
4
|
* Button props that don't apply to MapButton because it renders `<Button noStyle>` with its own
|
|
@@ -37,6 +37,15 @@ export interface MapButtonProps extends Omit<ButtonProps, OmittedButtonProps> {
|
|
|
37
37
|
* When provided, the button can toggle a dropdown menu.
|
|
38
38
|
*/
|
|
39
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;
|
|
40
49
|
}
|
|
41
50
|
export declare const MapButton: import('react').ForwardRefExoticComponent<Omit<MapButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
42
51
|
export default MapButton;
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsxs as l, Fragment 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 { forwardRef as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Spinner as
|
|
6
|
-
import { Button 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
7
|
import { MapDropdown as d } from "../map-dropdown/map-dropdown.es.js";
|
|
8
8
|
import t from "./map-button.module.scss.es.js";
|
|
9
9
|
import { Tooltip as m } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
10
|
-
const
|
|
10
|
+
const F = O((h, g) => {
|
|
11
11
|
const {
|
|
12
12
|
size: o = "default",
|
|
13
|
-
icon:
|
|
14
|
-
selected:
|
|
15
|
-
className:
|
|
13
|
+
icon: c,
|
|
14
|
+
selected: v = !1,
|
|
15
|
+
className: w,
|
|
16
16
|
children: i,
|
|
17
|
-
hideLabel:
|
|
17
|
+
hideLabel: p = !1,
|
|
18
18
|
tooltipContent: u = i,
|
|
19
19
|
dropdownItems: s,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
showDropdownIndicator: N = !1,
|
|
21
|
+
isActive: C,
|
|
22
|
+
isHovered: D,
|
|
23
|
+
underline: S,
|
|
23
24
|
isLoading: r,
|
|
25
|
+
iconSize: f,
|
|
24
26
|
..._
|
|
25
|
-
} =
|
|
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
|
-
s && t["tedi-map-button--dropdown"],
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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"],
|
|
33
35
|
r && t["tedi-map-button--loading"],
|
|
34
|
-
|
|
35
|
-
), M = /* @__PURE__ */ l(
|
|
36
|
-
r ? /* @__PURE__ */ e(
|
|
37
|
-
|
|
38
|
-
] }), a = /* @__PURE__ */ e(
|
|
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: [
|
|
39
41
|
/* @__PURE__ */ e(m.Trigger, { children: a }),
|
|
40
42
|
/* @__PURE__ */ e(m.Content, { children: u })
|
|
41
43
|
] }) : a;
|
|
42
|
-
return s ? /* @__PURE__ */ l(d, { onOpenChange:
|
|
44
|
+
return s ? /* @__PURE__ */ l(d, { onOpenChange: B, placement: "right-start", children: [
|
|
43
45
|
/* @__PURE__ */ e(d.Trigger, { children: a }),
|
|
44
46
|
/* @__PURE__ */ e(
|
|
45
47
|
d.Content,
|
|
@@ -52,10 +54,10 @@ const k = z((f, h) => {
|
|
|
52
54
|
}))
|
|
53
55
|
}
|
|
54
56
|
)
|
|
55
|
-
] }) :
|
|
57
|
+
] }) : T;
|
|
56
58
|
});
|
|
57
|
-
|
|
59
|
+
F.displayName = "MapButton";
|
|
58
60
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
F as MapButton,
|
|
62
|
+
F as default
|
|
61
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("../../../../external/classnames/index.cjs.js"),d=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),e=require("./status.module.scss.cjs.js"),l=require("../tooltip/tooltip-provider.cjs.js"),m=require("../tooltip/tooltip-trigger.cjs.js"),p=require("../tooltip/tooltip.cjs.js"),j=r=>{d.warnDeprecated("Community Status","Use `StatusIndicator` from `@tedi-design-system/react/tedi` instead.");const{children:a,type:i,className:o,tooltipContent:s,...u}=r,c=n.default(e.default.status,o,e.default[`status--${i}`]);return t.jsxs("div",{"data-name":"status",...u,className:c,children:[s?t.jsxs(l.TooltipProvider,{children:[t.jsx(m.TooltipTrigger,{children:t.jsx("div",{className:e.default.status__circle})}),t.jsx(p.Tooltip,{children:s})]}):t.jsx("div",{className:e.default.status__circle}),t.jsx("div",{className:e.default.status__content,children:a})]})};exports.Status=j;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../../../external/classnames/index.es.js";
|
|
3
|
+
import { warnDeprecated as d } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
3
4
|
import s from "./status.module.scss.es.js";
|
|
4
5
|
import { TooltipProvider as p } from "../tooltip/tooltip-provider.es.js";
|
|
5
|
-
import { TooltipTrigger as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */ t(u, { children:
|
|
6
|
+
import { TooltipTrigger as u } from "../tooltip/tooltip-trigger.es.js";
|
|
7
|
+
import { Tooltip as f } from "../tooltip/tooltip.es.js";
|
|
8
|
+
const g = (o) => {
|
|
9
|
+
d("Community Status", "Use `StatusIndicator` from `@tedi-design-system/react/tedi` instead.");
|
|
10
|
+
const { children: a, type: i, className: m, tooltipContent: r, ...c } = o, n = l(s.status, m, s[`status--${i}`]);
|
|
11
|
+
return /* @__PURE__ */ e("div", { "data-name": "status", ...c, className: n, children: [
|
|
12
|
+
r ? /* @__PURE__ */ e(p, { children: [
|
|
13
|
+
/* @__PURE__ */ t(u, { children: /* @__PURE__ */ t("div", { className: s.status__circle }) }),
|
|
14
|
+
/* @__PURE__ */ t(f, { children: r })
|
|
13
15
|
] }) : /* @__PURE__ */ t("div", { className: s.status__circle }),
|
|
14
|
-
/* @__PURE__ */ t("div", { className: s.status__content, children:
|
|
16
|
+
/* @__PURE__ */ t("div", { className: s.status__content, children: a })
|
|
15
17
|
] });
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
g as Status
|
|
19
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),P=require("../../../../external/classnames/index.cjs.js"),t=require("react"),V=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),b=require("./step.cjs.js"),g=require("./stepper.module.scss.cjs.js"),D=require("./stepper-context.cjs.js"),j=require("./stepper-nav.cjs.js"),I=require("../card/card.cjs.js"),R=require("../card/card-header/card-header.cjs.js"),z=require("../card/card-content/card-content.cjs.js"),B=a=>{V.warnDeprecated("Community Stepper","Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.");const{activeStep:n,defaultActiveStep:h,onActiveStepChange:s,allowStepLabelClick:d=!0,children:y,className:l,ariaLabel:u,completedLabel:m,notCompletedLabel:S,card:c}=a,[C,N]=t.useState(h||0),o=t.useCallback((e=a.activeStep)=>typeof e<"u",[a.activeStep]),v=t.useCallback(e=>{s==null||s(e),o(n)||N(e)},[n,o,s]),f=t.useMemo(()=>o(n)?n:C,[n,C,o]),p=t.Children.map(y,e=>t.isValidElement(e)&&e.type===b.Step?e:null),q=p==null?void 0:p.map((e,i)=>t.cloneElement(e,{key:i,index:i,...e.props})),x=()=>t.Children.toArray(a.children).filter(e=>t.isValidElement(e)&&e.type===b.Step).map((e,i)=>{const{label:E,completed:L,id:M,showCompletedIcon:H}=e.props;return{label:E,completed:!!L,index:i,id:M,showCompletedIcon:H}}),k=t.useMemo(()=>({activeStep:f,handleActiveStepChange:v,allowStepLabelClick:d}),[d,f,v]),w=P.default(g.default.stepper,l,{[g.default["stepper--card"]]:!!c}),A=()=>{if(c){const e=c===!0?{}:c;return r.jsxs(I.Card,{padding:1.5,...e,"data-name":"stepper",className:w,children:[r.jsx(R.CardHeader,{padding:0,background:"white",children:r.jsx(j.StepperNav,{items:x(),ariaLabel:u,completedLabel:m,notCompletedLabel:S})}),r.jsx(z.CardContent,{children:q})]})}return r.jsxs("div",{"data-name":"stepper",className:l,children:[r.jsx(j.StepperNav,{items:x(),ariaLabel:u,completedLabel:m,notCompletedLabel:S}),q]})};return r.jsx(D.StepperContext.Provider,{value:k,children:A()})};exports.Stepper=B;
|
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import I from "../../../../external/classnames/index.es.js";
|
|
3
3
|
import t from "react";
|
|
4
|
-
import {
|
|
5
|
-
import y from "./
|
|
6
|
-
import
|
|
4
|
+
import { warnDeprecated as _ } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
5
|
+
import { Step as y } from "./step.es.js";
|
|
6
|
+
import k from "./stepper.module.scss.es.js";
|
|
7
|
+
import { StepperContext as z } from "./stepper-context.es.js";
|
|
7
8
|
import { StepperNav as N } from "./stepper-nav.es.js";
|
|
8
|
-
import { Card as
|
|
9
|
-
import { CardHeader as
|
|
10
|
-
import { CardContent as
|
|
11
|
-
const
|
|
9
|
+
import { Card as B } from "../card/card.es.js";
|
|
10
|
+
import { CardHeader as D } from "../card/card-header/card-header.es.js";
|
|
11
|
+
import { CardContent as R } from "../card/card-content/card-content.es.js";
|
|
12
|
+
const Y = (a) => {
|
|
13
|
+
_("Community Stepper", "Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.");
|
|
12
14
|
const {
|
|
13
15
|
activeStep: r,
|
|
14
16
|
defaultActiveStep: x,
|
|
15
17
|
onActiveStepChange: n,
|
|
16
|
-
allowStepLabelClick:
|
|
18
|
+
allowStepLabelClick: c = !0,
|
|
17
19
|
children: A,
|
|
18
|
-
className:
|
|
20
|
+
className: l,
|
|
19
21
|
ariaLabel: d,
|
|
20
22
|
completedLabel: u,
|
|
21
23
|
notCompletedLabel: f,
|
|
22
24
|
card: p
|
|
23
|
-
} = a, [C, E] = t.useState(x || 0),
|
|
25
|
+
} = a, [C, E] = t.useState(x || 0), i = t.useCallback(
|
|
24
26
|
(e = a.activeStep) => typeof e < "u",
|
|
25
27
|
[a.activeStep]
|
|
26
28
|
), S = t.useCallback(
|
|
27
29
|
(e) => {
|
|
28
|
-
n == null || n(e),
|
|
30
|
+
n == null || n(e), i(r) || E(e);
|
|
29
31
|
},
|
|
30
|
-
[r,
|
|
32
|
+
[r, i, n]
|
|
31
33
|
), v = t.useMemo(
|
|
32
|
-
() =>
|
|
33
|
-
[r, C,
|
|
34
|
-
),
|
|
35
|
-
key:
|
|
36
|
-
index:
|
|
34
|
+
() => i(r) ? r : C,
|
|
35
|
+
[r, C, i]
|
|
36
|
+
), m = t.Children.map(A, (e) => t.isValidElement(e) && e.type === y ? e : null), b = m == null ? void 0 : m.map((e, s) => t.cloneElement(e, {
|
|
37
|
+
key: s,
|
|
38
|
+
index: s,
|
|
37
39
|
...e.props
|
|
38
|
-
})), h = () => t.Children.toArray(a.children).filter((e) => t.isValidElement(e) && e.type ===
|
|
39
|
-
const { label:
|
|
40
|
-
return { label:
|
|
40
|
+
})), h = () => t.Children.toArray(a.children).filter((e) => t.isValidElement(e) && e.type === y).map((e, s) => {
|
|
41
|
+
const { label: P, completed: V, id: j, showCompletedIcon: H } = e.props;
|
|
42
|
+
return { label: P, completed: !!V, index: s, id: j, showCompletedIcon: H };
|
|
41
43
|
}), L = t.useMemo(
|
|
42
|
-
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick:
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
[
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ o(
|
|
44
|
+
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick: c }),
|
|
45
|
+
[c, v, S]
|
|
46
|
+
), w = I(k.stepper, l, {
|
|
47
|
+
[k["stepper--card"]]: !!p
|
|
48
|
+
}), M = () => p ? /* @__PURE__ */ g(B, { padding: 1.5, ...p === !0 ? {} : p, "data-name": "stepper", className: w, children: [
|
|
49
|
+
/* @__PURE__ */ o(D, { padding: 0, background: "white", children: /* @__PURE__ */ o(
|
|
48
50
|
N,
|
|
49
51
|
{
|
|
50
52
|
items: h(),
|
|
@@ -53,8 +55,8 @@ const W = (a) => {
|
|
|
53
55
|
notCompletedLabel: f
|
|
54
56
|
}
|
|
55
57
|
) }),
|
|
56
|
-
/* @__PURE__ */ o(
|
|
57
|
-
] }) : /* @__PURE__ */ g("div", { "data-name": "stepper", className:
|
|
58
|
+
/* @__PURE__ */ o(R, { children: b })
|
|
59
|
+
] }) : /* @__PURE__ */ g("div", { "data-name": "stepper", className: l, children: [
|
|
58
60
|
/* @__PURE__ */ o(
|
|
59
61
|
N,
|
|
60
62
|
{
|
|
@@ -66,8 +68,8 @@ const W = (a) => {
|
|
|
66
68
|
),
|
|
67
69
|
b
|
|
68
70
|
] });
|
|
69
|
-
return /* @__PURE__ */ o(
|
|
71
|
+
return /* @__PURE__ */ o(z.Provider, { value: L, children: M() });
|
|
70
72
|
};
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
Y as Stepper
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),We=require("../../../../external/@tanstack/react-table/build/lib/index.cjs.js"),Ze=require("../../../../external/classnames/index.cjs.js"),o=require("react"),Je=require("./components/pagination/pagination.cjs.js"),i=require("./components/table-filter/filter-fn.cjs.js"),Qe=require("./components/table-layout/table-layout.cjs.js"),u=require("./table.module.scss.cjs.js"),Xe=require("./table-context.cjs.js"),Ye=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),en=require("../../../tedi/providers/printing-provider/printing-provider.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),We=require("../../../../external/@tanstack/react-table/build/lib/index.cjs.js"),Ze=require("../../../../external/classnames/index.cjs.js"),o=require("react"),Je=require("./components/pagination/pagination.cjs.js"),i=require("./components/table-filter/filter-fn.cjs.js"),Qe=require("./components/table-layout/table-layout.cjs.js"),u=require("./table.module.scss.cjs.js"),Xe=require("./table-context.cjs.js"),Ye=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),en=require("../../../tedi/providers/printing-provider/printing-provider.cjs.js"),d=require("../../../../external/@tanstack/table-core/build/lib/index.cjs.js"),nn=require("../card/card.cjs.js"),tn=require("../card/card-content/card-content.cjs.js"),J=1e4,Z=[];function on(c){const{getLabel:y}=Ye.useLabels(),{id:Q,data:l,columns:X,caption:Y,columnFilters:h,onColumnFiltersChange:R,cardProps:{padding:ee=0,...ne}={},hidePagination:g,defaultPagination:te={pageIndex:0,pageSize:g?J:10},pagination:a,manualPagination:oe=!!c.pagination,manualSorting:ie=!!c.sorting,manualFiltering:re=!!c.columnFilters,sorting:C,defaultSorting:le=[],defaultExpanded:ae={},autoResetPageIndex:se,onPaginationChange:x,onSortingChange:M,rowSelection:f,onRowSelectionChange:q,enableRowSelection:ue,defaultColumnVisibility:de={},columnVisibility:w,onColumnVisibilityChange:G,columnPinning:b,onColumnPinningChange:I,getRowId:ce,onRowClick:ge,defaultRowSelection:me,totalRows:P,renderSubComponent:pe,getRowCanExpand:he,groupRowsBy:s,renderGroupHeading:Ce,isLoading:fe=!1,isError:we=!1,placeholder:be,errorPlaceholder:Pe,loadingLabel:Fe=y("table.loading"),verticalAlign:Se="middle",enableFilters:ye=!1,enableSorting:Re=!0,hideRowBorder:E=!1,size:T="medium",hideCardBorder:V,...xe}=c,m=o.useMemo(()=>(l!=null&&l.length?l:Z)??Z,[l]),O=en.usePrint(),[{pageIndex:v,pageSize:j},Me]=o.useState(te),[D,qe]=o.useState(le),[K,Ge]=o.useState(ae),[N,Ie]=o.useState(me||{}),[A,Ee]=o.useState([]),[B,Te]=o.useState(de),[L,Ve]=o.useState({left:[],right:[]}),Oe=o.useMemo(()=>O?!0:K,[K,O]),_=o.useMemo(()=>a||{pageIndex:v,pageSize:j},[v,j,a]),$=o.useMemo(()=>C||D,[D,C]),k=o.useMemo(()=>h||A,[A,h]),z=o.useMemo(()=>f||N,[N,f]),H=o.useMemo(()=>w||B,[B,w]),U=o.useMemo(()=>b||L,[L,b]),ve=n=>{if(typeof n!="function")return;const e=n(_);a&&x?x(e):Me(e)},je=n=>{if(typeof n!="function")return;const e=n($);C&&M?M(e):qe(e)},De=n=>{if(typeof n!="function")return;const e=n(z);f&&q?q(e):Ie(e)},Ke=n=>{if(typeof n!="function")return;const e=n(k);h&&R?R(e):Ee(e)},Ne=n=>{if(typeof n!="function")return;const e=n(H);w&&G?G(e):Te(e)},Ae=n=>{if(typeof n!="function")return;const e=n(U);b&&I?I(e):Ve(e)},Be=o.useMemo(()=>{const n=(m==null?void 0:m.map(e=>typeof s=="string"?{...e,rowGroupKey:e[s]}:s?{...e,rowGroupKey:s(e)}:e))??[];return n.reduce((e,t)=>(t.rowGroupKey&&e.keys.includes(t.rowGroupKey)||(t.rowGroupKey?(e.keys=[...e.keys,t.rowGroupKey],e.list=[...e.list,...n.filter(S=>S.rowGroupKey===t.rowGroupKey)]):e.list=[...e.list,t]),e),{keys:[],list:[]}).list},[m,s]),p=We.useReactTable({data:Be,columns:X,state:{rowSelection:z,columnFilters:k,pagination:_,sorting:$,expanded:Oe,columnVisibility:H,columnPinning:U},manualSorting:ie,manualFiltering:re,pageCount:a&&P?Math.ceil(P/a.pageSize):void 0,autoResetPageIndex:se,onRowSelectionChange:De,enableRowSelection:ue,onExpandedChange:Ge,onPaginationChange:ve,onSortingChange:je,onColumnFiltersChange:Ke,onColumnVisibilityChange:Ne,onColumnPinningChange:Ae,getCoreRowModel:d.getCoreRowModel(),getSortedRowModel:d.getSortedRowModel(),getPaginationRowModel:d.getPaginationRowModel(),getFilteredRowModel:d.getFilteredRowModel(),getExpandedRowModel:d.getExpandedRowModel(),getRowCanExpand:he,getSubRows:n=>n.subRows,manualPagination:oe,enableFilters:ye,enableSorting:Re,getRowId:ce,filterFns:{text:(n,e,t)=>i.mapFilterFn(n,e,t,i.textFilterFn),select:(n,e,t)=>i.mapFilterFn(n,e,t,i.selectFilterFn),"multi-select":(n,e,t)=>i.mapFilterFn(n,e,t,i.multiSelectFilterFn),"date-range":(n,e,t)=>i.mapFilterFn(n,e,t,i.dateRangeFilterFn),"date-range-period":(n,e,t)=>i.mapFilterFn(n,e,t,i.dateRangePeriodFilterFn)}}),F=!!p.getFooterGroups().find(n=>!!n.headers.find(e=>e.column.columnDef.footer)),Le=!!(!V&&g&&!F),_e=!E&&F&&!g,$e=Ze.default(u.default.table,u.default[`table--vertical-align-${Se}`],u.default[`table--${T}`],{[u.default["table--hidden-bottom-border"]]:Le,[u.default["table--footer-bottom-border"]]:_e}),W=(n,e)=>{const{children:t=y(`table.${n}`),isNested:S=!0,icon:ke=n==="error"?"error":void 0,cardProps:{padding:ze=1,...He}={},...Ue}=e||{cardProps:{}};return{children:t,isNested:S,icon:ke,cardProps:{padding:ze,...He},...Ue}};return r.jsx(Xe.TableContext.Provider,{value:{table:p,id:Q,caption:Y,onRowClick:ge,renderSubComponent:pe,isFooterVisible:F,renderGroupHeading:Ce,placeholder:W("empty",be),errorPlaceholder:W("error",Pe),loadingLabel:Fe,isLoading:fe,isError:we,hideRowBorder:E,size:T},children:r.jsx(nn.Card,{"data-name":"table",...xe,borderless:V,padding:ee,...ne,children:r.jsxs(tn.CardContent,{children:[r.jsx("div",{className:$e,children:r.jsx(Qe.default,{})}),!g&&p&&r.jsx(Je.default,{totalRows:P||p.getFilteredRowModel().rows.length})]})})})}exports.PAGE_SIZE_WITHOUT_PAGINATION=J;exports.Table=on;
|
|
@@ -9,9 +9,9 @@ import d from "./table.module.scss.es.js";
|
|
|
9
9
|
import { TableContext as no } from "./table-context.es.js";
|
|
10
10
|
import { useLabels as to } from "../../../tedi/providers/label-provider/use-labels.es.js";
|
|
11
11
|
import { usePrint as io } from "../../../tedi/providers/printing-provider/printing-provider.es.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { getExpandedRowModel as ro, getFilteredRowModel as lo, getPaginationRowModel as ao, getSortedRowModel as so, getCoreRowModel as uo } from "../../../../external/@tanstack/table-core/build/lib/index.es.js";
|
|
13
|
+
import { Card as go } from "../card/card.es.js";
|
|
14
|
+
import { CardContent as co } from "../card/card-content/card-content.es.js";
|
|
15
15
|
const mo = 1e4, Z = [];
|
|
16
16
|
function Eo(u) {
|
|
17
17
|
const { getLabel: y } = to(), {
|
|
@@ -123,11 +123,11 @@ function Eo(u) {
|
|
|
123
123
|
onColumnFiltersChange: Ne,
|
|
124
124
|
onColumnVisibilityChange: Oe,
|
|
125
125
|
onColumnPinningChange: Te,
|
|
126
|
-
getCoreRowModel:
|
|
127
|
-
getSortedRowModel:
|
|
128
|
-
getPaginationRowModel:
|
|
129
|
-
getFilteredRowModel:
|
|
130
|
-
getExpandedRowModel:
|
|
126
|
+
getCoreRowModel: uo(),
|
|
127
|
+
getSortedRowModel: so(),
|
|
128
|
+
getPaginationRowModel: ao(),
|
|
129
|
+
getFilteredRowModel: lo(),
|
|
130
|
+
getExpandedRowModel: ro(),
|
|
131
131
|
getRowCanExpand: me,
|
|
132
132
|
getSubRows: (o) => o.subRows,
|
|
133
133
|
manualPagination: oe,
|
|
@@ -181,7 +181,7 @@ function Eo(u) {
|
|
|
181
181
|
hideRowBorder: V,
|
|
182
182
|
size: I
|
|
183
183
|
},
|
|
184
|
-
children: /* @__PURE__ */ a(
|
|
184
|
+
children: /* @__PURE__ */ a(go, { "data-name": "table", ...Re, borderless: D, padding: X, ...Y, children: /* @__PURE__ */ Ue(co, { children: [
|
|
185
185
|
/* @__PURE__ */ a("div", { className: ze, children: /* @__PURE__ */ a(oo, {}) }),
|
|
186
186
|
!g && m && /* @__PURE__ */ a(qe, { totalRows: P || m.getFilteredRowModel().rows.length })
|
|
187
187
|
] }) })
|
|
@@ -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"),u=require("react"),b=require("../../../tedi/components/misc/affix/affix.cjs.js"),f=require("../../../tedi/components/misc/scroll-visibility/scroll-visibility.cjs.js"),C=require("../../../tedi/components/misc/stretch-content/stretch-content.cjs.js"),x=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),h=require("./table-of-contents-items.cjs.js"),m=require("./table-of-contents-modal.cjs.js"),q=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),O=require("../../helpers/hooks/use-layout.cjs.js"),j=require("../card/card.cjs.js"),T=require("../card/card-content/card-content.cjs.js"),r=u.createContext({openItems:void 0,showIcons:void 0}),y=n=>{x.warnDeprecated("Community TableOfContents","Use TableOfContents from `@tedi-design-system/react/tedi` instead.");const{getLabel:i}=q.useLabels(),{breakToMobile:c=["mobile"],heading:o=i("table-of-contents.title"),hideOnScroll:l=!0}=n,t=O.default(c),{showIcons:a,openItems:d,...s}=n;return e.jsx(r.Provider,{value:{openItems:d,showIcons:a},children:e.jsx(b.Affix,{right:0,left:0,bottom:t?0:1.5,top:t?"unset":1.5,position:t?"fixed":"sticky",children:e.jsx(C.StretchContent,{children:t?e.jsx(f.ScrollVisibility,{animationDirection:"down",enabled:l,children:e.jsx(m.TableOfContentsModal,{...s,heading:o})}):e.jsx(j.Card,{children:e.jsx(T.CardContent,{children:e.jsx(h.TableOfContentsItems,{...s,heading:o})})})})})})};exports.TableOfContents=y;exports.TableOfContentsContext=r;
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Affix as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import { Affix as c } from "../../../tedi/components/misc/affix/affix.es.js";
|
|
4
4
|
import { ScrollVisibility as d } from "../../../tedi/components/misc/scroll-visibility/scroll-visibility.es.js";
|
|
5
5
|
import { StretchContent as b } from "../../../tedi/components/misc/stretch-content/stretch-content.es.js";
|
|
6
|
-
import {
|
|
6
|
+
import { warnDeprecated as p } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
7
|
+
import { TableOfContentsItems as C } from "./table-of-contents-items.es.js";
|
|
7
8
|
import { TableOfContentsModal as h } from "./table-of-contents-modal.es.js";
|
|
8
|
-
import { useLabels as
|
|
9
|
-
import
|
|
10
|
-
import { Card as
|
|
11
|
-
import { CardContent as
|
|
12
|
-
const
|
|
9
|
+
import { useLabels as u } from "../../../tedi/providers/label-provider/use-labels.es.js";
|
|
10
|
+
import O from "../../helpers/hooks/use-layout.es.js";
|
|
11
|
+
import { Card as T } from "../card/card.es.js";
|
|
12
|
+
import { CardContent as x } from "../card/card-content/card-content.es.js";
|
|
13
|
+
const y = f.createContext({
|
|
13
14
|
openItems: void 0,
|
|
14
15
|
showIcons: void 0
|
|
15
|
-
}),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
}), P = (e) => {
|
|
17
|
+
p("Community TableOfContents", "Use TableOfContents from `@tedi-design-system/react/tedi` instead.");
|
|
18
|
+
const { getLabel: i } = u(), { breakToMobile: m = ["mobile"], heading: n = i("table-of-contents.title"), hideOnScroll: s = !0 } = e, o = O(m), { showIcons: l, openItems: a, ...r } = e;
|
|
19
|
+
return /* @__PURE__ */ t(y.Provider, { value: { openItems: a, showIcons: l }, children: /* @__PURE__ */ t(
|
|
20
|
+
c,
|
|
19
21
|
{
|
|
20
22
|
right: 0,
|
|
21
23
|
left: 0,
|
|
22
|
-
bottom:
|
|
23
|
-
top:
|
|
24
|
-
position:
|
|
25
|
-
children: /* @__PURE__ */
|
|
24
|
+
bottom: o ? 0 : 1.5,
|
|
25
|
+
top: o ? "unset" : 1.5,
|
|
26
|
+
position: o ? "fixed" : "sticky",
|
|
27
|
+
children: /* @__PURE__ */ t(b, { children: o ? /* @__PURE__ */ t(d, { animationDirection: "down", enabled: s, children: /* @__PURE__ */ t(h, { ...r, heading: n }) }) : /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(C, { ...r, heading: n }) }) }) })
|
|
26
28
|
}
|
|
27
29
|
) });
|
|
28
30
|
};
|
|
29
31
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
P as TableOfContents,
|
|
33
|
+
y as TableOfContentsContext
|
|
32
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),k=require("../../../../../external/classnames/index.cjs.js"),m=require("react"),D=require("../../../../tedi/components/misc/print/print.cjs.js"),N=require("../../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),P=require("../tabs-context.cjs.js"),A=require("../tabs-item/tabs-item.cjs.js"),p=require("../tabs-nav/tabs-nav.cjs.js"),x=require("./tabs.module.scss.cjs.js"),E=require("../../../../tedi/providers/printing-provider/printing-provider.cjs.js"),R=n=>{N.warnDeprecated("Community Tabs","Use Tabs from `@tedi-design-system/react/tedi` instead.");const y=E.usePrint(),{defaultCurrentTab:I,onTabChange:o,className:f,children:g,hideNavOnPrint:h="show"}=n,[C,q]=m.useState(I||""),v=(e=n.currentTab)=>!!n.onTabChange&&typeof e<"u",a=v(n.currentTab)?n.currentTab:C,u=e=>{a!==e&&(v()||q(e),o==null||o(e))},s=m.Children.toArray(n.children).filter(e=>m.isValidElement(e)&&e.type===A.TabsItem).map(e=>e.props),w=e=>{var r,d;const l=s.findIndex(b=>{var T;return b.id===((T=e.currentTarget)==null?void 0:T.id)}),i=l!==-1?l:0;let t=-1;switch(e.key){case" ":e.preventDefault(),u((r=e.currentTarget)==null?void 0:r.id);break;case"ArrowLeft":i===0?t=s.length-1:t=i-1;break;case"ArrowRight":i===s.length-1?t=0:t=i+1;break;case"Home":t=0;break;case"End":t=s.length-1;break}t!==-1&&(e.preventDefault(),(d=document.getElementById(s[t].id))==null||d.focus())},j=s.map((e,l)=>{const{children:i,label:t,id:r,...d}=e;return{...d,id:r,isActive:a===r,onClick:b=>{b.preventDefault(),u(r)},onKeyDown:w,children:t,href:`#${r}`,role:"tab",tabIndex:!a&&l===0||a===r?void 0:-1,"aria-controls":`${r}-panel`,"aria-label":t,"aria-selected":a===r}});return c.jsx(P.TabsContext.Provider,{value:{currentTab:a,setCurrentTab:u},children:c.jsxs("div",{"data-name":"tabs",className:y&&h==="hide"?f:k.default(x.default.tabs,f),children:[c.jsx(D.Print,{visibility:h,children:c.jsx(p.TabsNav,{items:j,"aria-labelledby":n["aria-labelledby"]})}),c.jsx("div",{className:x.default.tabs__content,children:g})]})})};exports.Tabs=R;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Print as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
1
|
+
import { jsx as l, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import D from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import f from "react";
|
|
4
|
+
import { Print as A } from "../../../../tedi/components/misc/print/print.es.js";
|
|
5
|
+
import { warnDeprecated as P } from "../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
6
|
+
import { TabsContext as _ } from "../tabs-context.es.js";
|
|
7
|
+
import { TabsItem as E } from "../tabs-item/tabs-item.es.js";
|
|
8
|
+
import { TabsNav as j } from "../tabs-nav/tabs-nav.es.js";
|
|
9
|
+
import y from "./tabs.module.scss.es.js";
|
|
10
|
+
import { usePrint as K } from "../../../../tedi/providers/printing-provider/printing-provider.es.js";
|
|
11
|
+
const z = (n) => {
|
|
12
|
+
P("Community Tabs", "Use Tabs from `@tedi-design-system/react/tedi` instead.");
|
|
13
|
+
const I = K(), { defaultCurrentTab: p, onTabChange: d, className: u, children: C, hideNavOnPrint: h = "show" } = n, [g, x] = f.useState(p || ""), T = (e = n.currentTab) => !!n.onTabChange && typeof e < "u", a = T(n.currentTab) ? n.currentTab : g, m = (e) => {
|
|
14
|
+
a !== e && (T() || x(e), d == null || d(e));
|
|
15
|
+
}, i = f.Children.toArray(n.children).filter((e) => f.isValidElement(e) && e.type === E).map((e) => e.props), w = (e) => {
|
|
16
|
+
var r, c;
|
|
15
17
|
const o = i.findIndex((b) => {
|
|
16
|
-
var
|
|
17
|
-
return b.id === ((
|
|
18
|
+
var v;
|
|
19
|
+
return b.id === ((v = e.currentTarget) == null ? void 0 : v.id);
|
|
18
20
|
}), s = o !== -1 ? o : 0;
|
|
19
21
|
let t = -1;
|
|
20
22
|
switch (e.key) {
|
|
@@ -34,17 +36,17 @@ const q = (n) => {
|
|
|
34
36
|
t = i.length - 1;
|
|
35
37
|
break;
|
|
36
38
|
}
|
|
37
|
-
t !== -1 && (e.preventDefault(), (
|
|
38
|
-
},
|
|
39
|
-
const { children: s, label: t, id: r, ...
|
|
39
|
+
t !== -1 && (e.preventDefault(), (c = document.getElementById(i[t].id)) == null || c.focus());
|
|
40
|
+
}, k = i.map((e, o) => {
|
|
41
|
+
const { children: s, label: t, id: r, ...c } = e;
|
|
40
42
|
return {
|
|
41
|
-
...
|
|
43
|
+
...c,
|
|
42
44
|
id: r,
|
|
43
45
|
isActive: a === r,
|
|
44
46
|
onClick: (b) => {
|
|
45
47
|
b.preventDefault(), m(r);
|
|
46
48
|
},
|
|
47
|
-
onKeyDown:
|
|
49
|
+
onKeyDown: w,
|
|
48
50
|
children: t,
|
|
49
51
|
href: `#${r}`,
|
|
50
52
|
role: "tab",
|
|
@@ -54,8 +56,8 @@ const q = (n) => {
|
|
|
54
56
|
"aria-selected": a === r
|
|
55
57
|
};
|
|
56
58
|
});
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
59
|
+
return /* @__PURE__ */ l(
|
|
60
|
+
_.Provider,
|
|
59
61
|
{
|
|
60
62
|
value: {
|
|
61
63
|
currentTab: a,
|
|
@@ -65,10 +67,10 @@ const q = (n) => {
|
|
|
65
67
|
"div",
|
|
66
68
|
{
|
|
67
69
|
"data-name": "tabs",
|
|
68
|
-
className:
|
|
70
|
+
className: I && h === "hide" ? u : D(y.tabs, u),
|
|
69
71
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ l(A, { visibility: h, children: /* @__PURE__ */ l(j, { items: k, "aria-labelledby": n["aria-labelledby"] }) }),
|
|
73
|
+
/* @__PURE__ */ l("div", { className: y.tabs__content, children: C })
|
|
72
74
|
]
|
|
73
75
|
}
|
|
74
76
|
)
|
|
@@ -76,5 +78,5 @@ const q = (n) => {
|
|
|
76
78
|
);
|
|
77
79
|
};
|
|
78
80
|
export {
|
|
79
|
-
|
|
81
|
+
z as Tabs
|
|
80
82
|
};
|