@tedi-design-system/react 18.0.0-rc.23 → 18.0.0-rc.24
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.es14.js +2 -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/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/misc/ellipsis/ellipsis.cjs.js +1 -1
- package/src/tedi/components/misc/ellipsis/ellipsis.d.ts +11 -1
- package/src/tedi/components/misc/ellipsis/ellipsis.es.js +28 -21
- package/src/tedi/components/misc/ellipsis/ellipsis.module.scss.cjs.js +1 -1
- package/src/tedi/components/misc/ellipsis/ellipsis.module.scss.es.js +6 -3
- package/src/tedi/components/tags/tag/tag.cjs.js +1 -1
- package/src/tedi/components/tags/tag/tag.d.ts +10 -0
- package/src/tedi/components/tags/tag/tag.es.js +24 -21
- package/src/tedi/components/tags/tag/tag.module.scss.cjs.js +1 -1
- package/src/tedi/components/tags/tag/tag.module.scss.es.js +1 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("../../../../../external/classnames/index.cjs.js"),o=require("react"),a=require("../../overlays/popover/popover.cjs.js"),i=require("./ellipsis.module.scss.cjs.js"),x=require("../../../helpers/hooks/use-element-size.cjs.js"),g=d=>{const{children:l,lineClamp:r=2,position:s="end",popover:p=!0,className:u,...m}=d,n=o.useRef(null),[f,h]=o.useState(!1),v=x.useElementSize(n);o.useEffect(()=>{const t=n.current;t&&h(s==="start"?t.scrollWidth>t.clientWidth:t.scrollHeight>t.clientHeight)},[v,s,r]);const c=e.jsx("div",{"data-name":"ellipsis",...m,ref:n,className:j.default(i.default["tedi-ellipsis"],{[i.default["tedi-ellipsis--start"]]:s==="start"},u),style:s==="end"?{lineClamp:r,WebkitLineClamp:r}:void 0,children:s==="start"?e.jsx("span",{className:i.default["tedi-ellipsis__inner"],children:l}):l});return f&&p?e.jsxs(a.Popover,{openWith:"hover",focusManager:{modal:!1},children:[e.jsx(a.Popover.Trigger,{children:c}),e.jsx(a.Popover.Content,{children:e.jsx("span",{className:i.default["tedi-ellipsis__overlay"],children:l})})]}):c};exports.Ellipsis=g;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
export type EllipsisPosition = 'start' | 'end';
|
|
2
3
|
export interface EllipsisProps {
|
|
3
4
|
/**
|
|
4
5
|
* The content to be displayed inside the ellipsis container.
|
|
@@ -6,10 +7,19 @@ export interface EllipsisProps {
|
|
|
6
7
|
children: React.ReactNode;
|
|
7
8
|
/**
|
|
8
9
|
* The maximum number of lines before truncating the text with an ellipsis.
|
|
9
|
-
* If the content exceeds this limit, it will be truncated.
|
|
10
|
+
* If the content exceeds this limit, it will be truncated. Applies to the
|
|
11
|
+
* `end` (multi-line) position only.
|
|
10
12
|
* @default 2
|
|
11
13
|
*/
|
|
12
14
|
lineClamp?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Where the ellipsis is placed.
|
|
17
|
+
* - `end` — trailing ellipsis, multi-line (clamped by `lineClamp`).
|
|
18
|
+
* - `start` — leading ellipsis, single-line (keeps the end of the text visible,
|
|
19
|
+
* e.g. for file paths or IDs).
|
|
20
|
+
* @default end
|
|
21
|
+
*/
|
|
22
|
+
position?: EllipsisPosition;
|
|
13
23
|
/**
|
|
14
24
|
* Determines whether a popover should be displayed when the text is truncated.
|
|
15
25
|
* If `true`, hovering over the truncated text will show the full content in a popover.
|
|
@@ -1,30 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Popover as
|
|
5
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import g from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import o from "react";
|
|
4
|
+
import { Popover as a } from "../../overlays/popover/popover.es.js";
|
|
5
|
+
import i from "./ellipsis.module.scss.es.js";
|
|
6
6
|
import { useElementSize as E } from "../../../helpers/hooks/use-element-size.es.js";
|
|
7
|
-
const
|
|
8
|
-
const { children:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const S = (m) => {
|
|
8
|
+
const { children: l, lineClamp: r = 2, position: e = "end", popover: p = !0, className: d, ...f } = m, n = o.useRef(null), [h, u] = o.useState(!1), v = E(n);
|
|
9
|
+
o.useEffect(() => {
|
|
10
|
+
const s = n.current;
|
|
11
|
+
s && u(
|
|
12
|
+
e === "start" ? s.scrollWidth > s.clientWidth : s.scrollHeight > s.clientHeight
|
|
13
|
+
);
|
|
14
|
+
}, [v, e, r]);
|
|
15
|
+
const c = /* @__PURE__ */ t(
|
|
13
16
|
"div",
|
|
14
17
|
{
|
|
15
18
|
"data-name": "ellipsis",
|
|
16
|
-
...
|
|
17
|
-
ref:
|
|
18
|
-
className:
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
...f,
|
|
20
|
+
ref: n,
|
|
21
|
+
className: g(
|
|
22
|
+
i["tedi-ellipsis"],
|
|
23
|
+
{ [i["tedi-ellipsis--start"]]: e === "start" },
|
|
24
|
+
d
|
|
25
|
+
),
|
|
26
|
+
style: e === "end" ? { lineClamp: r, WebkitLineClamp: r } : void 0,
|
|
27
|
+
children: e === "start" ? /* @__PURE__ */ t("span", { className: i["tedi-ellipsis__inner"], children: l }) : l
|
|
21
28
|
}
|
|
22
29
|
);
|
|
23
|
-
return
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
] }) :
|
|
30
|
+
return h && p ? /* @__PURE__ */ _(a, { openWith: "hover", focusManager: { modal: !1 }, children: [
|
|
31
|
+
/* @__PURE__ */ t(a.Trigger, { children: c }),
|
|
32
|
+
/* @__PURE__ */ t(a.Content, { children: /* @__PURE__ */ t("span", { className: i["tedi-ellipsis__overlay"], children: l }) })
|
|
33
|
+
] }) : c;
|
|
27
34
|
};
|
|
28
35
|
export {
|
|
29
|
-
|
|
36
|
+
S as Ellipsis
|
|
30
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-ellipsis":"tedi-ellipsis-d1aa2d79"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-ellipsis":"tedi-ellipsis-d1aa2d79","tedi-ellipsis--start":"tedi-ellipsis--start-550aca21","tedi-ellipsis__inner":"tedi-ellipsis__inner-47eb4adf","tedi-ellipsis__overlay":"tedi-ellipsis__overlay-7426462d"};exports.default=e;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
"tedi-ellipsis": "tedi-ellipsis-d1aa2d79"
|
|
1
|
+
const i = {
|
|
2
|
+
"tedi-ellipsis": "tedi-ellipsis-d1aa2d79",
|
|
3
|
+
"tedi-ellipsis--start": "tedi-ellipsis--start-550aca21",
|
|
4
|
+
"tedi-ellipsis__inner": "tedi-ellipsis__inner-47eb4adf",
|
|
5
|
+
"tedi-ellipsis__overlay": "tedi-ellipsis__overlay-7426462d"
|
|
3
6
|
};
|
|
4
7
|
export {
|
|
5
|
-
|
|
8
|
+
i as default
|
|
6
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("../../../../../external/classnames/index.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("../../../../../external/classnames/index.cjs.js"),f=require("../../base/icon/icon.cjs.js"),m=require("../../buttons/closing-button/closing-button.cjs.js"),_=require("../../loaders/spinner/spinner.cjs.js"),j=require("../../misc/ellipsis/ellipsis.cjs.js"),e=require("./tag.module.scss.cjs.js"),x=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),q=l=>{const{getCurrentBreakpointProps:n}=x.useBreakpointProps(l.defaultServerBreakpoint),{children:o,className:c,onClose:s,closeButtonProps:d,isLoading:i=!1,color:a="primary",ellipsis:r=!1,...u}=n(l),p=g.default(e.default["tedi-tag"],a&&e.default[`tedi-tag--color-${a}`],s&&!i&&e.default["tedi-tag__close"],r!==!1&&e.default["tedi-tag--ellipsis"],c);return t.jsxs("div",{className:p,role:"status","aria-live":i?"polite":void 0,...u,children:[a==="danger"&&t.jsx("div",{className:e.default["tedi-tag__icon-wrapper"],children:t.jsx(f.Icon,{name:"info",color:"danger",size:16,className:e.default["tedi-tag__icon--error"]})}),t.jsx("div",{className:e.default["tedi-tag__content"],children:r!==!1?t.jsx(j.Ellipsis,{position:r==="start"?"start":"end",lineClamp:1,children:o}):o}),i&&!s&&t.jsx("div",{className:e.default["tedi-tag__icon-wrapper"],children:t.jsx(_.Spinner,{className:e.default["tedi-tag__loader"]})}),!i&&s&&t.jsx(m.ClosingButton,{iconSize:18,...d,onClick:s})]})};exports.Tag=q;
|
|
@@ -2,6 +2,7 @@ import { MouseEventHandler } from 'react';
|
|
|
2
2
|
import { BreakpointSupport } from '../../../helpers';
|
|
3
3
|
import { ClosingButtonProps } from '../../buttons/closing-button/closing-button';
|
|
4
4
|
type TagColor = 'primary' | 'secondary' | 'danger';
|
|
5
|
+
export type TagEllipsis = 'start' | 'end' | false;
|
|
5
6
|
type TagBreakpointProps = {
|
|
6
7
|
/**
|
|
7
8
|
* Determines Tag color
|
|
@@ -9,6 +10,15 @@ type TagBreakpointProps = {
|
|
|
9
10
|
* @default 'primary'
|
|
10
11
|
*/
|
|
11
12
|
color?: TagColor;
|
|
13
|
+
/**
|
|
14
|
+
* Truncates the label when the Tag is width-constrained, revealing the full text
|
|
15
|
+
* in a popover on hover/focus. `end` shows a trailing ellipsis (`Long label…`);
|
|
16
|
+
* `start` shows a leading one (`…label`), keeping the most significant tail
|
|
17
|
+
* (e.g. dates, IDs) visible. `false` never truncates — the label wraps and the
|
|
18
|
+
* Tag keeps its full width.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
ellipsis?: TagEllipsis;
|
|
12
22
|
/**
|
|
13
23
|
* Additional classes to apply custom styles to the Tag.
|
|
14
24
|
*/
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import f from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import { Icon as _ } from "../../base/icon/icon.es.js";
|
|
4
|
-
import { ClosingButton as
|
|
5
|
-
import { Spinner as
|
|
4
|
+
import { ClosingButton as N } from "../../buttons/closing-button/closing-button.es.js";
|
|
5
|
+
import { Spinner as u } from "../../loaders/spinner/spinner.es.js";
|
|
6
|
+
import { Ellipsis as v } from "../../misc/ellipsis/ellipsis.es.js";
|
|
6
7
|
import e from "./tag.module.scss.es.js";
|
|
7
|
-
import { useBreakpointProps as
|
|
8
|
-
const
|
|
9
|
-
const { getCurrentBreakpointProps:
|
|
10
|
-
children:
|
|
8
|
+
import { useBreakpointProps as B } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
9
|
+
const y = (a) => {
|
|
10
|
+
const { getCurrentBreakpointProps: n } = B(a.defaultServerBreakpoint), {
|
|
11
|
+
children: l,
|
|
11
12
|
className: c,
|
|
12
|
-
onClose:
|
|
13
|
-
closeButtonProps:
|
|
13
|
+
onClose: o,
|
|
14
|
+
closeButtonProps: m,
|
|
14
15
|
isLoading: t = !1,
|
|
15
|
-
color:
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
color: r = "primary",
|
|
17
|
+
ellipsis: s = !1,
|
|
18
|
+
...d
|
|
19
|
+
} = n(a), p = f(
|
|
18
20
|
e["tedi-tag"],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
r && e[`tedi-tag--color-${r}`],
|
|
22
|
+
o && !t && e["tedi-tag__close"],
|
|
23
|
+
s !== !1 && e["tedi-tag--ellipsis"],
|
|
21
24
|
c
|
|
22
25
|
);
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
t && !
|
|
27
|
-
!t &&
|
|
26
|
+
return /* @__PURE__ */ g("div", { className: p, role: "status", "aria-live": t ? "polite" : void 0, ...d, children: [
|
|
27
|
+
r === "danger" && /* @__PURE__ */ i("div", { className: e["tedi-tag__icon-wrapper"], children: /* @__PURE__ */ i(_, { name: "info", color: "danger", size: 16, className: e["tedi-tag__icon--error"] }) }),
|
|
28
|
+
/* @__PURE__ */ i("div", { className: e["tedi-tag__content"], children: s !== !1 ? /* @__PURE__ */ i(v, { position: s === "start" ? "start" : "end", lineClamp: 1, children: l }) : l }),
|
|
29
|
+
t && !o && /* @__PURE__ */ i("div", { className: e["tedi-tag__icon-wrapper"], children: /* @__PURE__ */ i(u, { className: e["tedi-tag__loader"] }) }),
|
|
30
|
+
!t && o && /* @__PURE__ */ i(N, { iconSize: 18, ...m, onClick: o })
|
|
28
31
|
] });
|
|
29
32
|
};
|
|
30
33
|
export {
|
|
31
|
-
|
|
34
|
+
y as Tag
|
|
32
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-tag":"tedi-tag-f6a58785","tedi-tag--color-primary":"tedi-tag--color-primary-a7b92fc1","tedi-tag--color-secondary":"tedi-tag--color-secondary-9ff6c8ce","tedi-tag--color-danger":"tedi-tag--color-danger-83bf0f2f","tedi-tag__content":"tedi-tag__content-b8cbfd6c","tedi-tag--ellipsis":"tedi-tag--ellipsis-75548e81","tedi-tag__icon-wrapper":"tedi-tag__icon-wrapper-f3c4be0a","tedi-tag__loader":"tedi-tag__loader-41807639","tedi-tag__close":"tedi-tag__close-81b1ded6"};exports.default=e;
|
|
@@ -4,6 +4,7 @@ const t = {
|
|
|
4
4
|
"tedi-tag--color-secondary": "tedi-tag--color-secondary-9ff6c8ce",
|
|
5
5
|
"tedi-tag--color-danger": "tedi-tag--color-danger-83bf0f2f",
|
|
6
6
|
"tedi-tag__content": "tedi-tag__content-b8cbfd6c",
|
|
7
|
+
"tedi-tag--ellipsis": "tedi-tag--ellipsis-75548e81",
|
|
7
8
|
"tedi-tag__icon-wrapper": "tedi-tag__icon-wrapper-f3c4be0a",
|
|
8
9
|
"tedi-tag__loader": "tedi-tag__loader-41807639",
|
|
9
10
|
"tedi-tag__close": "tedi-tag__close-81b1ded6"
|