@temp-spotwork/ui 1.7.3 → 1.7.4
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/dist/components/atoms/avatar/avatar.js +17 -17
- package/dist/components/atoms/small-large-text/SmallLargeText.stories.d.ts +11 -0
- package/dist/components/atoms/small-large-text/SmallLargeText.stories.js +60 -0
- package/dist/components/atoms/small-large-text/small-large-text.js +18 -9
- package/dist/components/molecules/alert/alert.js +3 -2
- package/dist/components/molecules/dialog/dialog.js +3 -2
- package/dist/components/molecules/drawer/drawer.js +3 -2
- package/dist/components/molecules/snackbar/Snackbar.stories.js +1 -1
- package/dist/components/molecules/snackbar/index.js +1 -1
- package/dist/components/molecules/snackbar/snackbar.js +3 -2
- package/dist/main.js +1 -1
- package/dist/{snackbar-BUPlWHWk.js → snackbar-CHpPc7Hi.js} +5 -4
- package/package.json +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
1
|
+
import { jsx as r, Fragment as g, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import { Typography as y } from "../../styles/typography/typography.js";
|
|
3
3
|
import { classesMap as D } from "./styles.js";
|
|
4
4
|
import F from "./statusIndicatorIcon.js";
|
|
5
5
|
import { t as l } from "../../../bundle-mjs-BjFsLjkg.js";
|
|
6
6
|
function w({
|
|
7
|
-
id:
|
|
7
|
+
id: E,
|
|
8
8
|
hasBorder: i = !1,
|
|
9
9
|
variant: d,
|
|
10
10
|
image: m,
|
|
@@ -14,19 +14,19 @@ function w({
|
|
|
14
14
|
onClick: s,
|
|
15
15
|
size: t
|
|
16
16
|
}) {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
})(),
|
|
21
|
-
s && s(
|
|
22
|
-
},
|
|
17
|
+
const C = (() => {
|
|
18
|
+
const e = u.trim().split(/\s+/);
|
|
19
|
+
return e.length > 1 ? (e[0][0] + e[e.length - 1][0]).toUpperCase() : e.length === 1 ? e[0][0].toUpperCase() : u;
|
|
20
|
+
})(), a = d === "circular", o = a ? 5 : 5.5, c = t ? t / o : 1, p = D[d](i), h = !a && i && n ? "border-bcolor-active" : "border-bcolor-divider", S = t && o > t ? 1 : 7, U = () => {
|
|
21
|
+
s && s(E);
|
|
22
|
+
}, A = m ? /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(
|
|
23
23
|
"img",
|
|
24
24
|
{
|
|
25
25
|
className: l(p.image, h),
|
|
26
26
|
src: m,
|
|
27
27
|
alt: "avatar-image"
|
|
28
28
|
}
|
|
29
|
-
) }) : /* @__PURE__ */ r(
|
|
29
|
+
) }) : /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
"data-testid": "avatar-text-box",
|
|
@@ -34,13 +34,13 @@ function w({
|
|
|
34
34
|
children: /* @__PURE__ */ r(
|
|
35
35
|
y,
|
|
36
36
|
{
|
|
37
|
-
swStyle:
|
|
38
|
-
children:
|
|
37
|
+
swStyle: S,
|
|
38
|
+
children: C,
|
|
39
39
|
color: "visualPlaceholderDefault"
|
|
40
40
|
}
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
|
-
) }), f = 0.25, x =
|
|
43
|
+
) }), f = 0.25, x = a && v && !n && /* @__PURE__ */ r(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
className: "absolute",
|
|
@@ -51,15 +51,15 @@ function w({
|
|
|
51
51
|
"data-testid": "avatar-online-status",
|
|
52
52
|
children: /* @__PURE__ */ r(F, { scalingFactor: c })
|
|
53
53
|
}
|
|
54
|
-
), b = s ? "button" : "div", _ = () =>
|
|
54
|
+
), b = s ? "button" : "div", _ = () => a && n ? "border-bcolor-active" : "border-[transparent]";
|
|
55
55
|
return /* @__PURE__ */ I(
|
|
56
56
|
b,
|
|
57
57
|
{
|
|
58
58
|
"data-testid": "avatar-container",
|
|
59
|
-
onClick:
|
|
59
|
+
onClick: U,
|
|
60
60
|
style: {
|
|
61
|
-
width: `${t ||
|
|
62
|
-
height: `${t ||
|
|
61
|
+
width: `${t || o}rem`,
|
|
62
|
+
height: `${t || o}rem`
|
|
63
63
|
},
|
|
64
64
|
className: l(
|
|
65
65
|
"flex items-center justify-center flex-shrink-0 flex-grow-0 relative",
|
|
@@ -68,7 +68,7 @@ function w({
|
|
|
68
68
|
),
|
|
69
69
|
...b === "button" ? { type: "button" } : {},
|
|
70
70
|
children: [
|
|
71
|
-
|
|
71
|
+
A,
|
|
72
72
|
x
|
|
73
73
|
]
|
|
74
74
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SmallLargeText } from './small-large-text';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof SmallLargeText>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof meta>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const TruncatedText: Story;
|
|
9
|
+
export declare const CustomSize: Story;
|
|
10
|
+
export declare const InitiallyExpanded: Story;
|
|
11
|
+
export declare const WithHtmlContent: Story;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { SmallLargeText as e } from "./small-large-text.js";
|
|
2
|
+
const a = {
|
|
3
|
+
title: "@spotwork-ui/atoms/SmallLargeText",
|
|
4
|
+
component: e,
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: "padded"
|
|
7
|
+
},
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
text: {
|
|
11
|
+
control: "text",
|
|
12
|
+
description: "The text content to display"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
control: "number",
|
|
16
|
+
description: "Maximum number of characters to show when truncated (default: 300)"
|
|
17
|
+
},
|
|
18
|
+
isSmall: {
|
|
19
|
+
control: "boolean",
|
|
20
|
+
description: "Whether the text should initially be truncated (default: true)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}, t = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida.", o = {
|
|
24
|
+
args: {
|
|
25
|
+
text: "This is a short piece of text that does not need to be truncated."
|
|
26
|
+
}
|
|
27
|
+
}, n = {
|
|
28
|
+
args: {
|
|
29
|
+
text: t
|
|
30
|
+
}
|
|
31
|
+
}, s = {
|
|
32
|
+
args: {
|
|
33
|
+
text: t,
|
|
34
|
+
size: 100
|
|
35
|
+
}
|
|
36
|
+
}, r = {
|
|
37
|
+
args: {
|
|
38
|
+
text: t,
|
|
39
|
+
isSmall: !1
|
|
40
|
+
}
|
|
41
|
+
}, l = {
|
|
42
|
+
args: {
|
|
43
|
+
text: `This text contains <strong>HTML tags</strong> and a list:
|
|
44
|
+
<ul>
|
|
45
|
+
<li>First item</li>
|
|
46
|
+
<li>Second item</li>
|
|
47
|
+
</ul>
|
|
48
|
+
This shows how the component sanitizes and renders HTML content properly.
|
|
49
|
+
` + t,
|
|
50
|
+
size: 200
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
s as CustomSize,
|
|
55
|
+
o as Default,
|
|
56
|
+
r as InitiallyExpanded,
|
|
57
|
+
n as TruncatedText,
|
|
58
|
+
l as WithHtmlContent,
|
|
59
|
+
a as default
|
|
60
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as n, jsx as
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "../../styles/tailwind-config/index.js";
|
|
3
|
-
import { Typography as
|
|
3
|
+
import { Typography as a } from "../../styles/typography/typography.js";
|
|
4
4
|
import "../../styles/colors/colors.js";
|
|
5
5
|
import "../../styles/colors/colormap.js";
|
|
6
6
|
import "../icons/iconsSVGs/Large/Profile.js";
|
|
7
7
|
import "../icons/iconsSVGs/Small/Profile.js";
|
|
8
8
|
import "../../../index-fN7hCOo3.js";
|
|
9
|
-
import { Link as
|
|
10
|
-
import { useState as
|
|
9
|
+
import { Link as c } from "../../molecules/link/link.js";
|
|
10
|
+
import { useState as d } from "react";
|
|
11
11
|
import "../form/dateselect/dateselect.js";
|
|
12
12
|
import "../form/time-picker/time-picker.js";
|
|
13
13
|
import "../form/dropdown/dropdown.js";
|
|
@@ -24,13 +24,22 @@ import "../../molecules/dataviz/donut-chart/donut-chart.js";
|
|
|
24
24
|
import "../../../react-spring_web.modern-BzbxCya-.js";
|
|
25
25
|
import "../../molecules/form/radiogroup/radiogroup.js";
|
|
26
26
|
import "../../../card-Cc2Qkiqr.js";
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
import { p as u } from "../../../purify.es-CcKdJiNO.js";
|
|
28
|
+
function J({ text: o, size: r = 300, isSmall: m = !0 }) {
|
|
29
|
+
const [i, p] = d(m), e = i ? `${o.slice(0, r)}${o.length > r ? "..." : ""}` : o, l = i ? "Show More" : "Show Less";
|
|
29
30
|
return /* @__PURE__ */ n("div", { children: [
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
31
|
+
/* @__PURE__ */ t(a, { swStyle: 3, color: "default", children: /* @__PURE__ */ t(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: "prose max-w-none [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6",
|
|
35
|
+
dangerouslySetInnerHTML: {
|
|
36
|
+
__html: u.sanitize(e)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
) }),
|
|
40
|
+
o.length > r && /* @__PURE__ */ t(c, { text: l, onClick: () => p((s) => !s) })
|
|
32
41
|
] });
|
|
33
42
|
}
|
|
34
43
|
export {
|
|
35
|
-
|
|
44
|
+
J as SmallLargeText
|
|
36
45
|
};
|
|
@@ -26,8 +26,9 @@ import "../datatables/cell/cell.js";
|
|
|
26
26
|
import "../dataviz/donut-chart/donut-chart.js";
|
|
27
27
|
import "../../../react-spring_web.modern-BzbxCya-.js";
|
|
28
28
|
import "../form/radiogroup/radiogroup.js";
|
|
29
|
+
import "../../../purify.es-CcKdJiNO.js";
|
|
29
30
|
import "../../../card-Cc2Qkiqr.js";
|
|
30
|
-
function
|
|
31
|
+
function or({
|
|
31
32
|
children: p,
|
|
32
33
|
width: c,
|
|
33
34
|
open: d,
|
|
@@ -75,5 +76,5 @@ function er({
|
|
|
75
76
|
] }) });
|
|
76
77
|
}
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
or as Alert
|
|
79
80
|
};
|
|
@@ -26,9 +26,10 @@ import "../datatables/cell/cell.js";
|
|
|
26
26
|
import "../dataviz/donut-chart/donut-chart.js";
|
|
27
27
|
import "../../../react-spring_web.modern-BzbxCya-.js";
|
|
28
28
|
import "../form/radiogroup/radiogroup.js";
|
|
29
|
+
import "../../../purify.es-CcKdJiNO.js";
|
|
29
30
|
import "../../../card-Cc2Qkiqr.js";
|
|
30
31
|
import { useUIElementSize as n } from "./use-ui-element-size.js";
|
|
31
|
-
function
|
|
32
|
+
function cr({
|
|
32
33
|
children: f,
|
|
33
34
|
width: h,
|
|
34
35
|
open: x,
|
|
@@ -100,5 +101,5 @@ function sr({
|
|
|
100
101
|
] }) });
|
|
101
102
|
}
|
|
102
103
|
export {
|
|
103
|
-
|
|
104
|
+
cr as Dialog
|
|
104
105
|
};
|
|
@@ -25,8 +25,9 @@ import { Button as L } from "../button/button.js";
|
|
|
25
25
|
import "../datatables/cell/cell.js";
|
|
26
26
|
import "../dataviz/donut-chart/donut-chart.js";
|
|
27
27
|
import "../form/radiogroup/radiogroup.js";
|
|
28
|
+
import "../../../purify.es-CcKdJiNO.js";
|
|
28
29
|
import "../../../card-Cc2Qkiqr.js";
|
|
29
|
-
function
|
|
30
|
+
function wr({
|
|
30
31
|
children: N,
|
|
31
32
|
actionBox: b,
|
|
32
33
|
title: l,
|
|
@@ -123,5 +124,5 @@ function gr({
|
|
|
123
124
|
) }) });
|
|
124
125
|
}
|
|
125
126
|
export {
|
|
126
|
-
|
|
127
|
+
wr as Drawer
|
|
127
128
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as l } from "react";
|
|
3
|
-
import { S as r, P as c, V as d } from "../../../snackbar-
|
|
3
|
+
import { S as r, P as c, V as d } from "../../../snackbar-CHpPc7Hi.js";
|
|
4
4
|
import { Button as h } from "../button/button.js";
|
|
5
5
|
const w = {
|
|
6
6
|
title: "@spotwork-ui/Snackbar",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { S as
|
|
2
|
+
import { S as E } from "../../../snackbar-CHpPc7Hi.js";
|
|
3
3
|
import "../../styles/tailwind-config/index.js";
|
|
4
4
|
import "../../styles/typography/typography.js";
|
|
5
5
|
import "../../styles/colors/colors.js";
|
|
@@ -25,8 +25,9 @@ import "../datatables/cell/cell.js";
|
|
|
25
25
|
import "../dataviz/donut-chart/donut-chart.js";
|
|
26
26
|
import "../../../react-spring_web.modern-BzbxCya-.js";
|
|
27
27
|
import "../form/radiogroup/radiogroup.js";
|
|
28
|
+
import "../../../purify.es-CcKdJiNO.js";
|
|
28
29
|
import "../../../card-Cc2Qkiqr.js";
|
|
29
30
|
import "./styles.js";
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
E as Snackbar
|
|
32
33
|
};
|
package/dist/main.js
CHANGED
|
@@ -58,7 +58,7 @@ import { Link as pr } from "./components/molecules/link/link.js";
|
|
|
58
58
|
import { Header as ar } from "./components/molecules/navigation/header/header.js";
|
|
59
59
|
import { Sidebar as fr } from "./components/molecules/navigation/sidebar/sidebar.js";
|
|
60
60
|
import { Content as nr } from "./components/molecules/notifications/content/content.js";
|
|
61
|
-
import { S as sr, i as dr } from "./snackbar-
|
|
61
|
+
import { S as sr, i as dr } from "./snackbar-CHpPc7Hi.js";
|
|
62
62
|
import { Tooltip as br } from "./components/atoms/tooltip/tooltip.js";
|
|
63
63
|
import { TabGroup as ur } from "./components/molecules/tab-group/tab-group.js";
|
|
64
64
|
import { Menubar as hr } from "./components/molecules/navigation/menubar/menubar.js";
|
|
@@ -27,6 +27,7 @@ import "./components/molecules/datatables/cell/cell.js";
|
|
|
27
27
|
import "./components/molecules/dataviz/donut-chart/donut-chart.js";
|
|
28
28
|
import "./react-spring_web.modern-BzbxCya-.js";
|
|
29
29
|
import "./components/molecules/form/radiogroup/radiogroup.js";
|
|
30
|
+
import "./purify.es-CcKdJiNO.js";
|
|
30
31
|
import "./card-Cc2Qkiqr.js";
|
|
31
32
|
import { getClasses as Le } from "./components/molecules/snackbar/styles.js";
|
|
32
33
|
var Z = "ToastProvider", [ee, Me, ke] = Fe("Toast"), [pe, Oe] = Re("Toast", [ke]), [Ve, X] = pe(Z), te = (t) => {
|
|
@@ -444,7 +445,7 @@ function z(t) {
|
|
|
444
445
|
return t.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
|
|
445
446
|
}
|
|
446
447
|
var Ze = te, et = oe, ye = re, tt = ne, ot = se, rt = ae, nt = $;
|
|
447
|
-
const
|
|
448
|
+
const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
448
449
|
__proto__: null,
|
|
449
450
|
Action: rt,
|
|
450
451
|
Close: nt,
|
|
@@ -462,7 +463,7 @@ const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
462
463
|
Viewport: et,
|
|
463
464
|
createToastScope: Oe
|
|
464
465
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
465
|
-
function
|
|
466
|
+
function Ot({
|
|
466
467
|
title: t,
|
|
467
468
|
open: r = !0,
|
|
468
469
|
setOpen: o,
|
|
@@ -495,7 +496,7 @@ function kt({
|
|
|
495
496
|
}
|
|
496
497
|
export {
|
|
497
498
|
Ze as P,
|
|
498
|
-
|
|
499
|
+
Ot as S,
|
|
499
500
|
et as V,
|
|
500
|
-
|
|
501
|
+
kt as i
|
|
501
502
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temp-spotwork/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"dev": "vite",
|
|
16
16
|
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
17
|
+
"build:watch": "vite build --watch",
|
|
17
18
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
18
19
|
"preview": "vite preview",
|
|
19
20
|
"prepublishOnly": "npm run build",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"chart.js": "^4.4.2",
|
|
30
31
|
"classnames": "^2.5.1",
|
|
31
32
|
"date-fns": "^3.6.0",
|
|
32
|
-
"dompurify": "^3.
|
|
33
|
+
"dompurify": "^3.4.2",
|
|
33
34
|
"moment-timezone": "^0.6.0",
|
|
34
35
|
"react": "18.2.0",
|
|
35
36
|
"react-chartjs-2": "^5.2.0",
|