@temp-spotwork/ui 1.7.5 → 1.7.7
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.stories.d.ts +6 -0
- package/dist/components/atoms/avatar/Avatar.stories.js +70 -12
- package/dist/components/atoms/avatar/avatar.js +30 -30
- package/dist/components/atoms/badge/badge.d.ts +2 -0
- package/dist/components/atoms/badge/badge.js +11 -9
- package/dist/components/atoms/badge/badge.stories.d.ts +1 -0
- package/dist/components/atoms/badge/badge.stories.js +10 -4
- package/dist/components/atoms/form/chips/chips.stories.d.ts +2 -0
- package/dist/components/atoms/form/chips/chips.stories.js +26 -8
- package/dist/components/atoms/form/chips/styles.d.ts +1 -0
- package/dist/components/atoms/form/chips/styles.js +2 -0
- package/dist/components/styles/colors/colormap.d.ts +4 -0
- package/dist/components/styles/colors/colormap.js +17 -13
- package/package.json +1 -1
|
@@ -7,3 +7,9 @@ type Story = StoryObj<typeof meta>;
|
|
|
7
7
|
export declare const Circular: Story;
|
|
8
8
|
export declare const WithFullName: Story;
|
|
9
9
|
export declare const LargeWithFullName: Story;
|
|
10
|
+
export declare const SingleName: Story;
|
|
11
|
+
export declare const WhitespaceName: Story;
|
|
12
|
+
export declare const EmptyName: Story;
|
|
13
|
+
export declare const NoTextView: Story;
|
|
14
|
+
export declare const NullName: Story;
|
|
15
|
+
export declare const EdgeCasesShowcase: Story;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { f as s } from "../../../index-Dpx0xQmQ.js";
|
|
3
|
+
import { Avatar as t } from "./avatar.js";
|
|
4
|
+
const v = {
|
|
4
5
|
title: "@spotwork-ui/Avatar",
|
|
5
|
-
component:
|
|
6
|
+
component: t,
|
|
6
7
|
parameters: {
|
|
7
8
|
layout: "centered"
|
|
8
9
|
},
|
|
@@ -10,19 +11,19 @@ const o = {
|
|
|
10
11
|
argTypes: {
|
|
11
12
|
backgroundColor: { control: "color" }
|
|
12
13
|
},
|
|
13
|
-
args: { onClick:
|
|
14
|
-
},
|
|
14
|
+
args: { onClick: s() }
|
|
15
|
+
}, u = {
|
|
15
16
|
args: {
|
|
16
17
|
id: "circular-avatar",
|
|
17
18
|
variant: "circular"
|
|
18
19
|
}
|
|
19
|
-
},
|
|
20
|
+
}, d = {
|
|
20
21
|
args: {
|
|
21
22
|
id: "full-name-avatar",
|
|
22
23
|
variant: "circular",
|
|
23
24
|
textView: "Steve Bob"
|
|
24
25
|
}
|
|
25
|
-
},
|
|
26
|
+
}, x = {
|
|
26
27
|
args: {
|
|
27
28
|
id: "large-full-name-avatar",
|
|
28
29
|
variant: "circular",
|
|
@@ -30,10 +31,67 @@ const o = {
|
|
|
30
31
|
size: 9,
|
|
31
32
|
isActive: !0
|
|
32
33
|
}
|
|
34
|
+
}, g = {
|
|
35
|
+
args: {
|
|
36
|
+
id: "single-name-avatar",
|
|
37
|
+
variant: "circular",
|
|
38
|
+
textView: "Steve"
|
|
39
|
+
}
|
|
40
|
+
}, p = {
|
|
41
|
+
args: {
|
|
42
|
+
id: "whitespace-name-avatar",
|
|
43
|
+
variant: "circular",
|
|
44
|
+
textView: " "
|
|
45
|
+
}
|
|
46
|
+
}, w = {
|
|
47
|
+
args: {
|
|
48
|
+
id: "empty-name-avatar",
|
|
49
|
+
variant: "circular",
|
|
50
|
+
textView: ""
|
|
51
|
+
}
|
|
52
|
+
}, f = {
|
|
53
|
+
args: {
|
|
54
|
+
id: "no-text-view-avatar",
|
|
55
|
+
variant: "circular"
|
|
56
|
+
}
|
|
57
|
+
}, V = {
|
|
58
|
+
args: {
|
|
59
|
+
id: "null-name-avatar",
|
|
60
|
+
variant: "circular",
|
|
61
|
+
textView: null
|
|
62
|
+
}
|
|
63
|
+
}, c = [
|
|
64
|
+
{ label: "Full name", textView: "Steve Bob" },
|
|
65
|
+
{ label: "Single name", textView: "Steve" },
|
|
66
|
+
{ label: 'Whitespace " "', textView: " " },
|
|
67
|
+
{ label: 'Empty ""', textView: "" },
|
|
68
|
+
{ label: "Undefined", textView: void 0 },
|
|
69
|
+
{ label: "Null", textView: null }
|
|
70
|
+
], N = {
|
|
71
|
+
render: () => /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-6", children: c.map(({ label: r, textView: i }, e) => /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children: [
|
|
72
|
+
/* @__PURE__ */ a(
|
|
73
|
+
t,
|
|
74
|
+
{
|
|
75
|
+
id: `showcase-${e}`,
|
|
76
|
+
variant: "circular",
|
|
77
|
+
textView: i
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ a("span", { className: "text-xs text-gray-600", children: r })
|
|
81
|
+
] }, e)) }),
|
|
82
|
+
parameters: {
|
|
83
|
+
layout: "padded"
|
|
84
|
+
}
|
|
33
85
|
};
|
|
34
86
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
87
|
+
u as Circular,
|
|
88
|
+
N as EdgeCasesShowcase,
|
|
89
|
+
w as EmptyName,
|
|
90
|
+
x as LargeWithFullName,
|
|
91
|
+
f as NoTextView,
|
|
92
|
+
V as NullName,
|
|
93
|
+
g as SingleName,
|
|
94
|
+
p as WhitespaceName,
|
|
95
|
+
d as WithFullName,
|
|
96
|
+
v as default
|
|
39
97
|
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { classesMap as
|
|
4
|
-
import
|
|
5
|
-
import { t as
|
|
6
|
-
function
|
|
7
|
-
id:
|
|
1
|
+
import { jsx as r, Fragment as b, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as I } from "../../styles/typography/typography.js";
|
|
3
|
+
import { classesMap as y } from "./styles.js";
|
|
4
|
+
import D from "./statusIndicatorIcon.js";
|
|
5
|
+
import { t as c } from "../../../bundle-mjs-BjFsLjkg.js";
|
|
6
|
+
function j({
|
|
7
|
+
id: g,
|
|
8
8
|
hasBorder: i = !1,
|
|
9
9
|
variant: d,
|
|
10
10
|
image: m,
|
|
11
|
-
textView:
|
|
11
|
+
textView: E = "NN",
|
|
12
12
|
isActive: n,
|
|
13
13
|
isOnline: v = !1,
|
|
14
14
|
onClick: s,
|
|
15
15
|
size: t
|
|
16
16
|
}) {
|
|
17
17
|
const C = (() => {
|
|
18
|
-
const e =
|
|
19
|
-
return e.length
|
|
20
|
-
})(), a = d === "circular", o = a ? 5 : 5.5,
|
|
21
|
-
s && s(
|
|
22
|
-
},
|
|
18
|
+
const e = (E ?? "").trim().split(/\s+/).filter(Boolean);
|
|
19
|
+
return e.length === 0 ? "NN" : e.length === 1 ? e[0][0].toUpperCase() : (e[0][0] + e[e.length - 1][0]).toUpperCase();
|
|
20
|
+
})(), a = d === "circular", o = a ? 5 : 5.5, l = t ? t / o : 1, u = y[d](i), p = !a && i && n ? "border-bcolor-active" : "border-bcolor-divider", S = t && o > t ? 1 : 7, U = () => {
|
|
21
|
+
s && s(g);
|
|
22
|
+
}, x = m ? /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
|
|
23
23
|
"img",
|
|
24
24
|
{
|
|
25
|
-
className:
|
|
25
|
+
className: c(u.image, p),
|
|
26
26
|
src: m,
|
|
27
27
|
alt: "avatar-image"
|
|
28
28
|
}
|
|
29
|
-
) }) : /* @__PURE__ */ r(
|
|
29
|
+
) }) : /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
"data-testid": "avatar-text-box",
|
|
33
|
-
className:
|
|
33
|
+
className: c(u.textBox, p),
|
|
34
34
|
children: /* @__PURE__ */ r(
|
|
35
|
-
|
|
35
|
+
I,
|
|
36
36
|
{
|
|
37
37
|
swStyle: S,
|
|
38
38
|
children: C,
|
|
@@ -40,20 +40,20 @@ function w({
|
|
|
40
40
|
}
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
|
-
) }), f = 0.25,
|
|
43
|
+
) }), f = 0.25, A = a && v && !n && /* @__PURE__ */ r(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
className: "absolute",
|
|
47
47
|
style: {
|
|
48
|
-
bottom: `${
|
|
49
|
-
right: `${
|
|
48
|
+
bottom: `${l * f}rem`,
|
|
49
|
+
right: `${l * f}rem`
|
|
50
50
|
},
|
|
51
51
|
"data-testid": "avatar-online-status",
|
|
52
|
-
children: /* @__PURE__ */ r(
|
|
52
|
+
children: /* @__PURE__ */ r(D, { scalingFactor: l })
|
|
53
53
|
}
|
|
54
|
-
),
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
|
|
54
|
+
), h = s ? "button" : "div", N = () => a && n ? "border-bcolor-active" : "border-[transparent]";
|
|
55
|
+
return /* @__PURE__ */ _(
|
|
56
|
+
h,
|
|
57
57
|
{
|
|
58
58
|
"data-testid": "avatar-container",
|
|
59
59
|
onClick: U,
|
|
@@ -61,19 +61,19 @@ function w({
|
|
|
61
61
|
width: `${t || o}rem`,
|
|
62
62
|
height: `${t || o}rem`
|
|
63
63
|
},
|
|
64
|
-
className:
|
|
64
|
+
className: c(
|
|
65
65
|
"flex items-center justify-center flex-shrink-0 flex-grow-0 relative",
|
|
66
|
-
|
|
66
|
+
N(),
|
|
67
67
|
"aspect-square"
|
|
68
68
|
),
|
|
69
|
-
...
|
|
69
|
+
...h === "button" ? { type: "button" } : {},
|
|
70
70
|
children: [
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
x,
|
|
72
|
+
A
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
j as Avatar
|
|
79
79
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Typography as
|
|
3
|
-
const
|
|
2
|
+
import { Typography as d } from "../../styles/typography/typography.js";
|
|
3
|
+
const a = {
|
|
4
4
|
active: "active",
|
|
5
5
|
affirmative: "active",
|
|
6
6
|
affirmativeInverted: "activeInverted",
|
|
@@ -10,20 +10,22 @@ const t = {
|
|
|
10
10
|
warningInverted: "warningInverted",
|
|
11
11
|
alert: "alert",
|
|
12
12
|
alertInverted: "alertInverted",
|
|
13
|
+
paidBackup: "paidBackup",
|
|
14
|
+
paidBackupInverted: "paidBackupInverted",
|
|
13
15
|
disabled: "disabled",
|
|
14
16
|
disabledInverted: "disabledInverted"
|
|
15
17
|
};
|
|
16
|
-
function
|
|
17
|
-
const n =
|
|
18
|
+
function s({ text: t, color: r }) {
|
|
19
|
+
const n = a[r];
|
|
18
20
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
19
21
|
"div",
|
|
20
22
|
{
|
|
21
23
|
"data-testid": "Badge-container",
|
|
22
|
-
className: `px-[0.5rem] py-[0.2rem] bg-surface-${
|
|
24
|
+
className: `px-[0.5rem] py-[0.2rem] bg-surface-${a[r]} rounded-[0.9rem] min-w-[1.8rem] max-w-max h-[1.8rem] flex items-center place-content-around m-[0.1rem]`,
|
|
23
25
|
children: /* @__PURE__ */ e(
|
|
24
|
-
|
|
26
|
+
d,
|
|
25
27
|
{
|
|
26
|
-
children: `${
|
|
28
|
+
children: `${t}`.trim().toUpperCase(),
|
|
27
29
|
color: n,
|
|
28
30
|
swStyle: 6,
|
|
29
31
|
lineHeight: 1.4
|
|
@@ -33,6 +35,6 @@ function c({ text: a, color: r }) {
|
|
|
33
35
|
) });
|
|
34
36
|
}
|
|
35
37
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
s as Badge,
|
|
39
|
+
a as badgeColorVariants
|
|
38
40
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { f as o } from "../../../index-Dpx0xQmQ.js";
|
|
2
|
-
import { Badge as
|
|
2
|
+
import { Badge as a } from "./badge.js";
|
|
3
3
|
const e = {
|
|
4
4
|
title: "@spotwork-ui/badge",
|
|
5
|
-
component:
|
|
5
|
+
component: a,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: "centered"
|
|
8
8
|
},
|
|
@@ -11,13 +11,19 @@ const e = {
|
|
|
11
11
|
backgroundColor: { control: "color" }
|
|
12
12
|
},
|
|
13
13
|
args: { onClick: o() }
|
|
14
|
-
},
|
|
14
|
+
}, c = {
|
|
15
15
|
args: {
|
|
16
16
|
text: "badge item",
|
|
17
17
|
color: "affirmative"
|
|
18
18
|
}
|
|
19
|
+
}, s = {
|
|
20
|
+
args: {
|
|
21
|
+
text: "Paid Backup",
|
|
22
|
+
color: "paidBackup"
|
|
23
|
+
}
|
|
19
24
|
};
|
|
20
25
|
export {
|
|
21
|
-
s as
|
|
26
|
+
s as PaidBackup,
|
|
27
|
+
c as Primary,
|
|
22
28
|
e as default
|
|
23
29
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
import { Chips as
|
|
3
|
-
const
|
|
1
|
+
import { f as a } from "../../../../index-Dpx0xQmQ.js";
|
|
2
|
+
import { Chips as o } from "./chips.js";
|
|
3
|
+
const t = {
|
|
4
4
|
title: "@spotwork-ui/chips",
|
|
5
|
-
component:
|
|
5
|
+
component: o,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: "centered"
|
|
8
8
|
},
|
|
@@ -10,15 +10,33 @@ const a = {
|
|
|
10
10
|
argTypes: {
|
|
11
11
|
backgroundColor: { control: "color" }
|
|
12
12
|
},
|
|
13
|
-
args: { onClick:
|
|
14
|
-
},
|
|
13
|
+
args: { onClick: a() }
|
|
14
|
+
}, c = {
|
|
15
15
|
args: {
|
|
16
|
+
id: "primary",
|
|
16
17
|
chipText: "some chips",
|
|
17
18
|
color: "affirmative",
|
|
18
19
|
chipSelected: !1
|
|
19
20
|
}
|
|
21
|
+
}, e = {
|
|
22
|
+
args: {
|
|
23
|
+
id: "paid-backup-readonly",
|
|
24
|
+
chipText: "Ready to Work",
|
|
25
|
+
color: "paidBackup",
|
|
26
|
+
variant: "largeReadOnly",
|
|
27
|
+
infoBubbleContent: "icons:WaitingSmall"
|
|
28
|
+
}
|
|
29
|
+
}, p = {
|
|
30
|
+
args: {
|
|
31
|
+
id: "paid-backup-pill",
|
|
32
|
+
chipText: "Paid Backup",
|
|
33
|
+
color: "paidBackup",
|
|
34
|
+
variant: "pill"
|
|
35
|
+
}
|
|
20
36
|
};
|
|
21
37
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
38
|
+
e as PaidBackupLargeReadOnly,
|
|
39
|
+
p as PaidBackupPill,
|
|
40
|
+
c as Primary,
|
|
41
|
+
t as default
|
|
24
42
|
};
|
|
@@ -34,12 +34,14 @@ const n = (e) => ({
|
|
|
34
34
|
success: "success",
|
|
35
35
|
warning: "warning",
|
|
36
36
|
alert: "alert",
|
|
37
|
+
paidBackup: "paidBackup",
|
|
37
38
|
disabled: "disabled"
|
|
38
39
|
}, i = {
|
|
39
40
|
affirmative: "affirmativeInverted",
|
|
40
41
|
success: "successInverted",
|
|
41
42
|
warning: "warningInverted",
|
|
42
43
|
alert: "alertInverted",
|
|
44
|
+
paidBackup: "paidBackupInverted",
|
|
43
45
|
disabled: "disabledInverted"
|
|
44
46
|
};
|
|
45
47
|
export {
|
|
@@ -93,6 +93,8 @@ export declare const glyph: {
|
|
|
93
93
|
warningInverted: string;
|
|
94
94
|
alert: string;
|
|
95
95
|
alertInverted: string;
|
|
96
|
+
paidBackup: string;
|
|
97
|
+
paidBackupInverted: string;
|
|
96
98
|
disabled: string;
|
|
97
99
|
disabledInverted: string;
|
|
98
100
|
firstPartyMessage: string;
|
|
@@ -123,6 +125,8 @@ export declare const surface: {
|
|
|
123
125
|
warningInverted: string;
|
|
124
126
|
alert: string;
|
|
125
127
|
alertInverted: string;
|
|
128
|
+
paidBackup: string;
|
|
129
|
+
paidBackupInverted: string;
|
|
126
130
|
badge: string;
|
|
127
131
|
disabled: string;
|
|
128
132
|
disabledInverted: string;
|
|
@@ -87,12 +87,14 @@ const f = {
|
|
|
87
87
|
warningInverted: d[100],
|
|
88
88
|
alert: t[700],
|
|
89
89
|
alertInverted: t[200],
|
|
90
|
+
paidBackup: "#8314DB",
|
|
91
|
+
paidBackupInverted: "#F3E6FF",
|
|
90
92
|
disabled: e[500],
|
|
91
93
|
disabledInverted: e[100],
|
|
92
94
|
firstPartyMessage: e[0],
|
|
93
95
|
secondPartyMessage: a[700],
|
|
94
96
|
visualPlaceholderDefault: f[700]
|
|
95
|
-
},
|
|
97
|
+
}, u = Object.keys(n), o = Object.entries(n).reduce((r, [s]) => (r[s] = `text-glyph-${s}`, r), {}), i = {
|
|
96
98
|
default: a[600],
|
|
97
99
|
hover: a[700],
|
|
98
100
|
active: a[800],
|
|
@@ -113,6 +115,8 @@ const f = {
|
|
|
113
115
|
warningInverted: d[800],
|
|
114
116
|
alert: t[200],
|
|
115
117
|
alertInverted: t[700],
|
|
118
|
+
paidBackup: "#F3E6FF",
|
|
119
|
+
paidBackupInverted: "#8314DB",
|
|
116
120
|
badge: t[500],
|
|
117
121
|
disabled: e[100],
|
|
118
122
|
disabledInverted: e[600],
|
|
@@ -120,7 +124,7 @@ const f = {
|
|
|
120
124
|
visualPlaceholderDefault: f[100],
|
|
121
125
|
firstPartyMessage: a[700],
|
|
122
126
|
secondPartyMessage: a[200]
|
|
123
|
-
}, b = Object.keys(n), h = Object.entries(n).reduce((r, [s]) => (r[s] = `bg-surface-${s}`, r), {}),
|
|
127
|
+
}, b = Object.keys(n), h = Object.entries(n).reduce((r, [s]) => (r[s] = `bg-surface-${s}`, r), {}), p = {
|
|
124
128
|
none: "transparent",
|
|
125
129
|
default: e[300],
|
|
126
130
|
active: a[700],
|
|
@@ -133,12 +137,12 @@ const f = {
|
|
|
133
137
|
disabled: e[200],
|
|
134
138
|
outline: e[100],
|
|
135
139
|
success: c[800]
|
|
136
|
-
},
|
|
140
|
+
}, g = {
|
|
137
141
|
active: a[200],
|
|
138
142
|
warning: d[100],
|
|
139
143
|
destructive: t[100],
|
|
140
144
|
alert: t[200]
|
|
141
|
-
},
|
|
145
|
+
}, y = {
|
|
142
146
|
success: c[600],
|
|
143
147
|
warning: d[400],
|
|
144
148
|
caution: f[400],
|
|
@@ -197,7 +201,7 @@ const f = {
|
|
|
197
201
|
default: d[800]
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
|
-
},
|
|
204
|
+
}, F = {
|
|
201
205
|
primary: {
|
|
202
206
|
disabled: e[100],
|
|
203
207
|
affirmative: {
|
|
@@ -243,7 +247,7 @@ const f = {
|
|
|
243
247
|
active: e[800]
|
|
244
248
|
}
|
|
245
249
|
}
|
|
246
|
-
},
|
|
250
|
+
}, w = {
|
|
247
251
|
hue1: "#00BD3F",
|
|
248
252
|
hue2: "#FFCE1B",
|
|
249
253
|
hue3: "#FF7E33",
|
|
@@ -257,20 +261,20 @@ const f = {
|
|
|
257
261
|
export {
|
|
258
262
|
c as apple,
|
|
259
263
|
a as blueRibbon,
|
|
260
|
-
|
|
264
|
+
p as borderColor,
|
|
261
265
|
C as buttonBorder,
|
|
262
266
|
I as buttonGlyph,
|
|
263
|
-
|
|
267
|
+
F as buttonSurface,
|
|
264
268
|
t as cinnabar,
|
|
265
269
|
f as crusta,
|
|
266
|
-
|
|
270
|
+
w as dataVizColors,
|
|
267
271
|
n as glyph,
|
|
268
|
-
|
|
269
|
-
|
|
272
|
+
o as glyphClassesMap,
|
|
273
|
+
u as glyphColorsKeys,
|
|
270
274
|
v as linkColorClassesMap,
|
|
271
275
|
i as linkColors,
|
|
272
|
-
|
|
273
|
-
|
|
276
|
+
y as progressBar,
|
|
277
|
+
g as shadow,
|
|
274
278
|
d as sun,
|
|
275
279
|
l as surface,
|
|
276
280
|
h as surfaceClassesMap,
|