@caseparts-org/caseblocks 0.0.111 → 0.0.112

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.
@@ -1 +1 @@
1
- ._loggedIn_w7zna_1{flex-shrink:0;gap:var(--spacing-spacing-2xs);cursor:pointer;transition:all .3s linear;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:var(--spacing-spacing-3xs)}._customer_w7zna_12>a,._customer_w7zna_12>a:hover{text-decoration:none}._loggedIn_w7zna_1:hover{background-color:#f3f3f3;border-radius:var(--border-radius-md)}._placeholder_w7zna_21{height:30px;width:120px}@media (max-width:1280px){._placeholder_w7zna_21{width:30px;height:30px}}
1
+ ._loggedIn_1sipy_1{flex-shrink:0;gap:var(--spacing-spacing-2xs);cursor:pointer;transition:all .3s linear;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:var(--spacing-spacing-3xs)}._customer_1sipy_12>a,._customer_1sipy_12>a:hover{text-decoration:none}._loggedIn_1sipy_1:hover{background-color:#f3f3f3;border-radius:var(--border-radius-md)}._placeholder_1sipy_21{width:32px;width:120px}@media (max-width:1280px){._placeholder_1sipy_21{width:32px;height:32px;background-color:#f3f3f3;border-radius:100%}}
@@ -7,8 +7,10 @@ export interface AccountProps extends React.HTMLAttributes<HTMLDivElement>, Hide
7
7
  number: string;
8
8
  /** The account user's name. */
9
9
  name: string;
10
- /** The account user's initials. */
11
- initials: string;
10
+ /** The account user's initials. Used when no custom avatar JSX is provided. */
11
+ initials?: string;
12
+ /** Optional custom avatar content. If provided, it will be rendered instead of the default Avatar. */
13
+ avatar?: React.ReactNode;
12
14
  };
13
15
  onLoginClick: () => void;
14
16
  /** Optional content to show when clicking the authenticated container */
@@ -1,40 +1,40 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
- import { getHideAtStyles as a } from "../../atoms/HideAt.js";
1
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { getHideAtStyles as m } from "../../atoms/HideAt.js";
3
3
  import { Icon as f } from "../../atoms/Icon/Icon.js";
4
4
  import { Text as c } from "../../atoms/Text/Text.js";
5
- import { Avatar as h } from "../Avatar/Avatar.js";
5
+ import { Avatar as u } from "../Avatar/Avatar.js";
6
6
  import { Flex as d } from "../../atoms/Flex/Flex.js";
7
7
  import { Button as p } from "../../atoms/Button/Button.js";
8
8
  import { Popover as A } from "../../atoms/Popover/Popover.js";
9
9
  import { c as g } from "../../clsx-OuTLNxxd.js";
10
- import '../../assets/Account.css';const x = "_loggedIn_w7zna_1", v = "_customer_w7zna_12", I = "_placeholder_w7zna_21", t = {
10
+ import '../../assets/Account.css';const x = "_loggedIn_1sipy_1", v = "_customer_1sipy_12", I = "_placeholder_1sipy_21", o = {
11
11
  loggedIn: x,
12
12
  customer: v,
13
13
  placeholder: I
14
14
  };
15
- function z(i) {
15
+ function y(i) {
16
16
  return i.account !== void 0;
17
17
  }
18
- function T(i) {
19
- return i.isAccountLoading ? /* @__PURE__ */ o("div", { className: t.placeholder }) : z(i) ? /* @__PURE__ */ o(_, { ...i }) : /* @__PURE__ */ o(N, { ...i });
18
+ function j(i) {
19
+ return i.isAccountLoading ? /* @__PURE__ */ t("div", { className: o.placeholder }) : y(i) ? /* @__PURE__ */ t(_, { ...i }) : /* @__PURE__ */ t(N, { ...i });
20
20
  }
21
21
  function _(i) {
22
22
  const {
23
23
  account: e,
24
24
  className: r,
25
25
  hideAt: s,
26
- popoverContent: m,
27
- isAccountLoading: u,
26
+ popoverContent: a,
27
+ isAccountLoading: h,
28
28
  ...l
29
29
  } = i;
30
- return m ? /* @__PURE__ */ o(
30
+ return a ? /* @__PURE__ */ t(
31
31
  A,
32
32
  {
33
33
  position: "bottom right",
34
34
  trigger: /* @__PURE__ */ n(
35
35
  "div",
36
36
  {
37
- className: g(t.loggedIn, a(s), r),
37
+ className: g(o.loggedIn, m(s), r),
38
38
  ...l,
39
39
  children: [
40
40
  /* @__PURE__ */ n(
@@ -43,7 +43,7 @@ function _(i) {
43
43
  flexDirection: "column",
44
44
  alignItems: "flex-end",
45
45
  hideAt: ["sm", "md"],
46
- className: t.customer,
46
+ className: o.customer,
47
47
  children: [
48
48
  /* @__PURE__ */ n(c, { size: "xxs", children: [
49
49
  "Acct: ",
@@ -56,16 +56,16 @@ function _(i) {
56
56
  ]
57
57
  }
58
58
  ),
59
- /* @__PURE__ */ o(h, { initials: e.initials })
59
+ e.avatar ?? (e.initials ? /* @__PURE__ */ t(u, { initials: e.initials }) : null)
60
60
  ]
61
61
  }
62
62
  ),
63
- children: m
63
+ children: a
64
64
  }
65
65
  ) : /* @__PURE__ */ n(
66
66
  "div",
67
67
  {
68
- className: g(t.loggedIn, a(s), r),
68
+ className: g(o.loggedIn, m(s), r),
69
69
  ...l,
70
70
  children: [
71
71
  /* @__PURE__ */ n(
@@ -74,7 +74,7 @@ function _(i) {
74
74
  flexDirection: "column",
75
75
  alignItems: "flex-end",
76
76
  hideAt: ["sm", "md"],
77
- className: t.customer,
77
+ className: o.customer,
78
78
  children: [
79
79
  /* @__PURE__ */ n(c, { size: "xxs", children: [
80
80
  "Acct: ",
@@ -87,7 +87,7 @@ function _(i) {
87
87
  ]
88
88
  }
89
89
  ),
90
- /* @__PURE__ */ o(h, { initials: e.initials })
90
+ e.avatar ?? (e.initials ? /* @__PURE__ */ t(u, { initials: e.initials }) : null)
91
91
  ]
92
92
  }
93
93
  );
@@ -97,8 +97,8 @@ function N(i) {
97
97
  onLoginClick: e,
98
98
  className: r,
99
99
  hideAt: s,
100
- popoverContent: m,
101
- isAccountLoading: u,
100
+ popoverContent: a,
101
+ isAccountLoading: h,
102
102
  ...l
103
103
  } = i;
104
104
  return /* @__PURE__ */ n(
@@ -108,12 +108,12 @@ function N(i) {
108
108
  alignItems: "center",
109
109
  ...l,
110
110
  className: g(
111
- t.unauthenticated,
112
- a(s),
111
+ o.unauthenticated,
112
+ m(s),
113
113
  r
114
114
  ),
115
115
  children: [
116
- /* @__PURE__ */ o(
116
+ /* @__PURE__ */ t(
117
117
  p,
118
118
  {
119
119
  onClick: e,
@@ -123,11 +123,11 @@ function N(i) {
123
123
  children: "Sign In / Register"
124
124
  }
125
125
  ),
126
- /* @__PURE__ */ o(f, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
126
+ /* @__PURE__ */ t(f, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
127
127
  ]
128
128
  }
129
129
  );
130
130
  }
131
131
  export {
132
- T as Account
132
+ j as Account
133
133
  };
@@ -12,3 +12,4 @@ export default meta;
12
12
  type Story = StoryObj<typeof meta>;
13
13
  export declare const Unauthenticated: Story;
14
14
  export declare const Authenticated: Story;
15
+ export declare const AuthenticatedWithCustomAvatar: Story;
@@ -1,19 +1,20 @@
1
- import { Account as t } from "./Account.js";
2
- const o = {
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Account as a } from "./Account.js";
3
+ const e = {
3
4
  title: "Case Parts/Molecules/Account",
4
- component: t,
5
+ component: a,
5
6
  parameters: {
6
7
  // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
7
8
  layout: "centered"
8
9
  },
9
10
  // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
10
11
  tags: ["autodocs"]
11
- }, e = {
12
+ }, c = {
12
13
  args: {
13
14
  onLoginClick: () => {
14
15
  }
15
16
  }
16
- }, a = {
17
+ }, s = {
17
18
  args: {
18
19
  account: {
19
20
  name: "Ringo",
@@ -23,9 +24,27 @@ const o = {
23
24
  onLoginClick: () => {
24
25
  }
25
26
  }
27
+ }, i = {
28
+ args: {
29
+ account: {
30
+ name: "Ringo",
31
+ number: "123456789012",
32
+ avatar: /* @__PURE__ */ t(
33
+ "img",
34
+ {
35
+ src: "https://avatars.githubusercontent.com/u/9919?s=80&v=4",
36
+ alt: "Custom Avatar",
37
+ style: { width: 32, height: 32, borderRadius: 9999 }
38
+ }
39
+ )
40
+ },
41
+ onLoginClick: () => {
42
+ }
43
+ }
26
44
  };
27
45
  export {
28
- a as Authenticated,
29
- e as Unauthenticated,
30
- o as default
46
+ s as Authenticated,
47
+ i as AuthenticatedWithCustomAvatar,
48
+ c as Unauthenticated,
49
+ e as default
31
50
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.111",
4
+ "version": "0.0.112",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",