@planningcenter/organization-avatars 1.6.3 → 1.8.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/README.md +32 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +239 -184
- package/dist/organization_avatar.d.ts +1 -1
- package/dist/style.css +56 -35
- package/dist/types.d.ts +1 -0
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -2,15 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
This package provides an `OrganizationAvatars` React component which encapsulates displaying and updating an organization's avatar.
|
|
4
4
|
|
|
5
|
-
See [the component's type signature](https://github.com/planningcenter/organization-avatars/blob/main/src/types.ts) for up-to-date props.
|
|
6
|
-
|
|
7
5
|
## Usage
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
```tsx
|
|
8
|
+
import { OrganizationAvatars } from "@planningcenter/organization-avatars"
|
|
9
|
+
import "@planningcenter/organization-avatars/style.css"
|
|
10
|
+
|
|
11
|
+
<OrganizationAvatars
|
|
12
|
+
orgName="Demo Church"
|
|
13
|
+
avatarUrl="https://example.com/avatar.png"
|
|
14
|
+
darkModeAvatarUrl="https://example.com/avatar-dark.png"
|
|
15
|
+
showDarkModeAvatar
|
|
16
|
+
onAvatarUpdate={(mode, newUrl) => console.log(mode, newUrl)}
|
|
17
|
+
/>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
To see a working example, see the [`/organization` page in Accounts](https://accounts.planningcenteronline.com/organization). The `OrganizationAvatars` component is mounted in [the `_church_information` partial](https://github.com/planningcenter/accounts/blob/main/app/views/organization/show/_church_information.html.erb).
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| `orgName` | `string` | **required** | The organization name, used for avatar alt text. |
|
|
27
|
+
| `avatarUrl` | `string` | `undefined` | URL of the current light mode avatar. When no `darkModeAvatarUrl` is provided, this is also used for the dark mode slot. |
|
|
28
|
+
| `darkModeAvatarUrl` | `string` | `undefined` | URL of the current dark mode avatar. Falls back to `avatarUrl` if not set. |
|
|
29
|
+
| `showDarkModeAvatar` | `boolean` | `false` | Whether to render the dark mode avatar UI alongside the light mode avatar. Intended to be controlled by a feature flag. |
|
|
30
|
+
| `onAvatarUpdate` | `(mode: AvatarMode, newUrl: string) => void` | `undefined` | Callback fired after a successful upload or delete. `mode` is `"avatar"` or `"dark_mode_avatar"`. `newUrl` is the new URL (or `""` on delete). |
|
|
31
|
+
| `pcoEnv` | `Environment` | `undefined` | Planning Center environment override (`"production"`, `"staging"`, `"development"`, `"test"`, `"prototype"`). When omitted, the environment is inferred automatically. |
|
|
32
|
+
| `readOnly` | `boolean` | `false` | Disables the edit button, preventing uploads and deletes. |
|
|
33
|
+
|
|
34
|
+
### Types
|
|
10
35
|
|
|
11
|
-
|
|
36
|
+
```ts
|
|
37
|
+
type AvatarMode = "avatar" | "dark_mode_avatar"
|
|
12
38
|
|
|
13
|
-
|
|
39
|
+
type Environment = "production" | "staging" | "development" | "test" | "prototype"
|
|
40
|
+
```
|
|
14
41
|
|
|
15
42
|
## Development
|
|
16
43
|
|
package/dist/index.cjs
CHANGED
|
@@ -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"),c=require("react"),P=require("react-dom"),$=require("@planningcenter/url"),y=require("@planningcenter/tapestry"),I=require("@planningcenter/sweetest-alert"),x=require("@planningcenter/icons/paths/general"),L=require("@planningcenter/icons/paths/services"),E=require("react-dropzone");function B(a){var r,t,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var d=a.length;for(r=0;r<d;r++)a[r]&&(t=B(a[r]))&&(o&&(o+=" "),o+=t)}else for(t in a)a[t]&&(o&&(o+=" "),o+=t);return o}function W(){for(var a,r,t=0,o="",d=arguments.length;t<d;t++)(a=arguments[t])&&(r=B(a))&&(o&&(o+=" "),o+=r);return o}function G(){const a=document.querySelector('meta[name="csrf-token"]');if(!a||!a.content)throw new Error('CSRF token not found. Ensure your Rails application includes <meta name="csrf-token" content="..."> in the document head.');return a.content}function J(a){const r=a.split("");return[r.shift()?.toUpperCase(),r.join("")].join("")}const X=a=>a==="dark_mode_avatar"?"dark":"light",U=({open:a})=>e.jsxs("h2",{className:"pco-org-avatar__instructions",children:["Drag & drop your logo file to upload, or"," ",e.jsx(y.Button,{label:"browse",kind:"inline-text",onClick:r=>{r.stopPropagation(),a()}})]});function z({avatarUrl:a,organization:r,mode:t,pcoEnv:o,readOnly:d,onAvatarUpdate:f,fallbackAvatarUrl:b}){const[n,_]=c.useState(null),[l,w]=c.useState(!1),[i,p]=c.useState(!1),[g,k]=c.useState(""),q=c.useId(),m=c.useRef(null),u=X(t),v=a||b,T=h=>{const[s]=h;s&&_(Object.assign(s,{preview:URL.createObjectURL(s)}))};c.useEffect(()=>()=>{n?.preview&&(URL.revokeObjectURL(n.preview),k(""))},[n]);const R=async h=>{const s=await fetch($.pcoApiUrl("accounts",{env:o}),{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRF-Token":G(),Accept:"application/json"},body:JSON.stringify({data:{attributes:h}})}),j=await s.json();if(!s.ok)throw j;return j},D=async h=>{if(h.preventDefault(),!(!n||l||i)){w(!0);try{const s=new FileReader,j=await new Promise((C,N)=>{s.onloadend=()=>C(s.result),s.onerror=N,s.readAsDataURL(n)}),A=await R({[t]:j,[`${t}_cache`]:""});_(null),f(t,A.data.attributes[t].url),m.current?.close()}catch{k("We were unable to save your avatar.")}finally{w(!1)}}},S=async()=>{l||i||(p(!0),I.SweetestAlert({type:"danger",title:"Remove this logo?",content:u==="light"?"Removing this logo means no logo will appear in light mode. This cannot be undone.":b?"Removing this logo means your light mode logo will appear in dark mode. This cannot be undone.":"Removing this logo means no logo will appear in dark mode. This cannot be undone.",confirmButton:"Remove logo",onConfirm:async()=>{try{await R({[`remove_${t}`]:"1"}),f(t,""),m.current?.close()}catch{k("We were unable to delete your avatar.")}finally{p(!1)}},onCancel:()=>{p(!1)}}))},M=()=>{_(null),k("")};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pco-org-avatar",children:[e.jsx("button",{type:"button",onClick:()=>m.current?.showModal(),disabled:d,className:`pco-org-avatar__button pco-org-avatar__button--${u}`,children:v?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:v,alt:`Church logo for ${r}`}),e.jsx("div",{className:"tds-btn tds-btn--interaction tds-btn--icononly",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:x.pencil})})})]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{width:"48",height:"48",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:L.image})}),e.jsx("div",{className:"tds-btn tds-btn--interaction tds-btn--icononly",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:x.pencil})})})]})}),e.jsxs("div",{className:"pco-org-avatar__label",children:[J(u)," mode"]})]}),P.createPortal(e.jsx("dialog",{id:q,ref:m,className:"pco-org-avatar__dialog",onClose:M,children:e.jsxs("form",{onSubmit:D,children:[e.jsxs("div",{className:"pco-org-avatar__dialog-header",children:[e.jsxs("h1",{className:"pco-org-avatar__dialog-title",children:["Church logo — ",u," mode"]}),e.jsx("button",{type:"button",onClick:()=>m.current?.close(),className:"pco-org-avatar__dialog-close","aria-label":"Close modal",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:x.smallX})})})]}),e.jsxs("div",{className:"pco-org-avatar__dialog-body",children:[g&&e.jsxs("div",{role:"alert",className:"pco-org-avatar-alert pco-org-avatar__dialog-alert",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",className:"symbol","aria-hidden":"true",children:e.jsx("path",{d:x.exclamationTriangle})}),e.jsx("p",{children:g})]}),e.jsx(E,{accept:{"image/*":[".jpg",".jpeg",".png"]},multiple:!1,onDropAccepted:T,children:({getRootProps:h,getInputProps:s,isFocused:j,isDragAccept:A,isDragReject:C,isDragActive:N,open:F})=>{const O=W("pco-org-avatar__dialog-dropzone",`pco-org-avatar__dialog-dropzone--${u}`,{"pco-org-avatar__dialog-dropzone--image":n||v,"pco-org-avatar__dialog-dropzone--focused":j,"pco-org-avatar__dialog-dropzone--accepted":A,"pco-org-avatar__dialog-dropzone--rejected":N&&C});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{...h({className:O}),children:[e.jsx("input",{...s()}),n?e.jsx("img",{src:n.preview,alt:`Church logo for ${r}`}):v?e.jsx("img",{src:v,alt:`Church logo for ${r}`}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{width:"64",height:"64",viewBox:"0 0 16 16","aria-hidden":"true",children:e.jsx("path",{d:x.toCloudArrow})}),N&&C?e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Wrong file type"}),e.jsx("p",{children:"Please upload a PNG or JPG file."})]}):e.jsxs(e.Fragment,{children:[e.jsx(U,{open:F}),e.jsx("p",{className:"pco-org-avatar__instructions-sub",children:"Use a high-quality image (up to 20mb) with a transparent background."})]})]})]}),(n||v)&&e.jsx(U,{open:F})]})}})]}),e.jsxs("div",{className:"pco-org-avatar__dialog-actions",children:[a&&u==="light"&&e.jsx(y.Button,{label:"Remove logo",kind:"secondary-delete",onClick:S,loading:i,disabled:i||l,className:"pco-org-avatar__dialog-delete"}),a&&u==="dark"&&e.jsx(y.Button,{label:"Use light mode logo",kind:"secondary",onClick:S,loading:i,disabled:i||l,className:"pco-org-avatar__dialog-delete"}),e.jsx(y.Button,{type:"button",label:"Cancel",onClick:()=>m.current?.close(),disabled:l||i}),e.jsx(y.Button,{type:"submit",label:"Update logo",kind:"primary",loading:l,disabled:!n||l||i})]})]})}),document.body)]})}function H({avatarUrl:a,darkModeAvatarUrl:r,orgName:t,onAvatarUpdate:o,pcoEnv:d,readOnly:f,showDarkModeAvatar:b=!1}){const[n,_]=c.useState(a),[l,w]=c.useState(r),i=(p,g)=>{p==="avatar"?(_(g),o?.("avatar",g)):p==="dark_mode_avatar"&&(w(g),o?.("dark_mode_avatar",g))};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pco-org-avatars",children:[e.jsx(z,{avatarUrl:n,organization:t,mode:"avatar",pcoEnv:d,readOnly:f,onAvatarUpdate:i}),b&&e.jsx(z,{avatarUrl:l,organization:t,mode:"dark_mode_avatar",pcoEnv:d,readOnly:f,onAvatarUpdate:i,fallbackAvatarUrl:n})]}),b&&n&&!l&&e.jsxs("div",{className:"pco-org-avatar-alert",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",className:"symbol","aria-hidden":"true",children:e.jsx("path",{d:x.infoCircle})}),e.jsx("p",{children:"The same logo is being used for both light and dark modes."})]})]})}exports.OrganizationAvatars=H;
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as _, useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { pcoApiUrl as
|
|
5
|
-
import { Button as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as r, Fragment as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useId as L, useRef as E, useEffect as W } from "react";
|
|
3
|
+
import { createPortal as q } from "react-dom";
|
|
4
|
+
import { pcoApiUrl as G } from "@planningcenter/url";
|
|
5
|
+
import { Button as C } from "@planningcenter/tapestry";
|
|
6
|
+
import { SweetestAlert as J } from "@planningcenter/sweetest-alert";
|
|
7
|
+
import { pencil as T, smallX as X, exclamationTriangle as H, toCloudArrow as K, infoCircle as Q } from "@planningcenter/icons/paths/general";
|
|
8
|
+
import { image as V } from "@planningcenter/icons/paths/services";
|
|
9
|
+
import Y from "react-dropzone";
|
|
10
|
+
function D(a) {
|
|
11
|
+
var t, o, n = "";
|
|
12
|
+
if (typeof a == "string" || typeof a == "number") n += a;
|
|
12
13
|
else if (typeof a == "object") if (Array.isArray(a)) {
|
|
13
|
-
var
|
|
14
|
-
for (
|
|
15
|
-
} else for (
|
|
16
|
-
return
|
|
14
|
+
var s = a.length;
|
|
15
|
+
for (t = 0; t < s; t++) a[t] && (o = D(a[t])) && (n && (n += " "), n += o);
|
|
16
|
+
} else for (o in a) a[o] && (n && (n += " "), n += o);
|
|
17
|
+
return n;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
for (var a,
|
|
20
|
-
return
|
|
19
|
+
function Z() {
|
|
20
|
+
for (var a, t, o = 0, n = "", s = arguments.length; o < s; o++) (a = arguments[o]) && (t = D(a)) && (n && (n += " "), n += t);
|
|
21
|
+
return n;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function ee() {
|
|
23
24
|
const a = document.querySelector('meta[name="csrf-token"]');
|
|
24
25
|
if (!a || !a.content)
|
|
25
26
|
throw new Error(
|
|
@@ -27,36 +28,50 @@ function H() {
|
|
|
27
28
|
);
|
|
28
29
|
return a.content;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return [
|
|
31
|
+
function ae(a) {
|
|
32
|
+
const t = a.split("");
|
|
33
|
+
return [t.shift()?.toUpperCase(), t.join("")].join("");
|
|
33
34
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
35
|
+
const oe = (a) => a === "dark_mode_avatar" ? "dark" : "light", B = ({ open: a }) => /* @__PURE__ */ r("h2", { className: "pco-org-avatar__instructions", children: [
|
|
36
|
+
"Drag & drop your logo file to upload, or",
|
|
37
|
+
" ",
|
|
38
|
+
/* @__PURE__ */ e(
|
|
39
|
+
C,
|
|
40
|
+
{
|
|
41
|
+
label: "browse",
|
|
42
|
+
kind: "inline-text",
|
|
43
|
+
onClick: (t) => {
|
|
44
|
+
t.stopPropagation(), a();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] });
|
|
49
|
+
function F({
|
|
36
50
|
avatarUrl: a,
|
|
37
|
-
organization:
|
|
38
|
-
mode:
|
|
39
|
-
pcoEnv:
|
|
40
|
-
readOnly:
|
|
41
|
-
onAvatarUpdate:
|
|
51
|
+
organization: t,
|
|
52
|
+
mode: o,
|
|
53
|
+
pcoEnv: n,
|
|
54
|
+
readOnly: s,
|
|
55
|
+
onAvatarUpdate: y,
|
|
56
|
+
fallbackAvatarUrl: w
|
|
42
57
|
}) {
|
|
43
|
-
const [
|
|
44
|
-
const [
|
|
45
|
-
|
|
46
|
-
Object.assign(
|
|
47
|
-
preview: URL.createObjectURL(
|
|
58
|
+
const [i, k] = _(null), [d, N] = _(!1), [c, m] = _(!1), [g, A] = _(""), M = L(), v = E(null), p = oe(o), f = a || w, P = (u) => {
|
|
59
|
+
const [l] = u;
|
|
60
|
+
l && k(
|
|
61
|
+
Object.assign(l, {
|
|
62
|
+
preview: URL.createObjectURL(l)
|
|
48
63
|
})
|
|
49
64
|
);
|
|
50
65
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
const
|
|
55
|
-
const
|
|
66
|
+
W(() => () => {
|
|
67
|
+
i?.preview && (URL.revokeObjectURL(i.preview), A(""));
|
|
68
|
+
}, [i]);
|
|
69
|
+
const x = async (u) => {
|
|
70
|
+
const l = await fetch(G("accounts", { env: n }), {
|
|
56
71
|
method: "PATCH",
|
|
57
72
|
headers: {
|
|
58
73
|
"Content-Type": "application/json",
|
|
59
|
-
"X-CSRF-Token":
|
|
74
|
+
"X-CSRF-Token": ee(),
|
|
60
75
|
Accept: "application/json"
|
|
61
76
|
},
|
|
62
77
|
body: JSON.stringify({
|
|
@@ -64,53 +79,61 @@ function D({
|
|
|
64
79
|
attributes: u
|
|
65
80
|
}
|
|
66
81
|
})
|
|
67
|
-
}),
|
|
68
|
-
if (!
|
|
69
|
-
return
|
|
70
|
-
},
|
|
71
|
-
if (u.preventDefault(), !(!
|
|
72
|
-
|
|
82
|
+
}), b = await l.json();
|
|
83
|
+
if (!l.ok) throw b;
|
|
84
|
+
return b;
|
|
85
|
+
}, $ = async (u) => {
|
|
86
|
+
if (u.preventDefault(), !(!i || d || c)) {
|
|
87
|
+
N(!0);
|
|
73
88
|
try {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
}), j = await
|
|
77
|
-
[
|
|
78
|
-
[`${
|
|
89
|
+
const l = new FileReader(), b = await new Promise((R, U) => {
|
|
90
|
+
l.onloadend = () => R(l.result), l.onerror = U, l.readAsDataURL(i);
|
|
91
|
+
}), j = await x({
|
|
92
|
+
[o]: b,
|
|
93
|
+
[`${o}_cache`]: ""
|
|
79
94
|
});
|
|
80
|
-
|
|
95
|
+
k(null), y(o, j.data.attributes[o].url), v.current?.close();
|
|
81
96
|
} catch {
|
|
82
|
-
|
|
97
|
+
A("We were unable to save your avatar.");
|
|
83
98
|
} finally {
|
|
84
|
-
|
|
99
|
+
N(!1);
|
|
85
100
|
}
|
|
86
101
|
}
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
}, z = async () => {
|
|
103
|
+
d || c || (m(!0), J({
|
|
104
|
+
type: "danger",
|
|
105
|
+
title: "Remove this logo?",
|
|
106
|
+
content: p === "light" ? "Removing this logo means no logo will appear in light mode. This cannot be undone." : w ? "Removing this logo means your light mode logo will appear in dark mode. This cannot be undone." : "Removing this logo means no logo will appear in dark mode. This cannot be undone.",
|
|
107
|
+
confirmButton: "Remove logo",
|
|
108
|
+
onConfirm: async () => {
|
|
109
|
+
try {
|
|
110
|
+
await x({
|
|
111
|
+
[`remove_${o}`]: "1"
|
|
112
|
+
}), y(o, ""), v.current?.close();
|
|
113
|
+
} catch {
|
|
114
|
+
A("We were unable to delete your avatar.");
|
|
115
|
+
} finally {
|
|
116
|
+
m(!1);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
onCancel: () => {
|
|
120
|
+
m(!1);
|
|
98
121
|
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
|
|
122
|
+
}));
|
|
123
|
+
}, O = () => {
|
|
124
|
+
k(null), A("");
|
|
102
125
|
};
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ r(h, { children: [
|
|
127
|
+
/* @__PURE__ */ r("div", { className: "pco-org-avatar", children: [
|
|
105
128
|
/* @__PURE__ */ e(
|
|
106
129
|
"button",
|
|
107
130
|
{
|
|
108
131
|
type: "button",
|
|
109
|
-
onClick: () =>
|
|
110
|
-
disabled:
|
|
111
|
-
className: `pco-org-avatar__button pco-org-avatar__button--${
|
|
112
|
-
children:
|
|
113
|
-
/* @__PURE__ */ e("img", { src:
|
|
132
|
+
onClick: () => v.current?.showModal(),
|
|
133
|
+
disabled: s,
|
|
134
|
+
className: `pco-org-avatar__button pco-org-avatar__button--${p}`,
|
|
135
|
+
children: f ? /* @__PURE__ */ r(h, { children: [
|
|
136
|
+
/* @__PURE__ */ e("img", { src: f, alt: `Church logo for ${t}` }),
|
|
114
137
|
/* @__PURE__ */ e("div", { className: "tds-btn tds-btn--interaction tds-btn--icononly", children: /* @__PURE__ */ e(
|
|
115
138
|
"svg",
|
|
116
139
|
{
|
|
@@ -119,10 +142,10 @@ function D({
|
|
|
119
142
|
viewBox: "0 0 16 16",
|
|
120
143
|
fill: "currentColor",
|
|
121
144
|
"aria-hidden": "true",
|
|
122
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
145
|
+
children: /* @__PURE__ */ e("path", { d: T })
|
|
123
146
|
}
|
|
124
147
|
) })
|
|
125
|
-
] }) : /* @__PURE__ */
|
|
148
|
+
] }) : /* @__PURE__ */ r(h, { children: [
|
|
126
149
|
/* @__PURE__ */ e(
|
|
127
150
|
"svg",
|
|
128
151
|
{
|
|
@@ -131,7 +154,7 @@ function D({
|
|
|
131
154
|
viewBox: "0 0 16 16",
|
|
132
155
|
fill: "currentColor",
|
|
133
156
|
"aria-hidden": "true",
|
|
134
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
157
|
+
children: /* @__PURE__ */ e("path", { d: V })
|
|
135
158
|
}
|
|
136
159
|
),
|
|
137
160
|
/* @__PURE__ */ e("div", { className: "tds-btn tds-btn--interaction tds-btn--icononly", children: /* @__PURE__ */ e(
|
|
@@ -142,37 +165,37 @@ function D({
|
|
|
142
165
|
viewBox: "0 0 16 16",
|
|
143
166
|
fill: "currentColor",
|
|
144
167
|
"aria-hidden": "true",
|
|
145
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
168
|
+
children: /* @__PURE__ */ e("path", { d: T })
|
|
146
169
|
}
|
|
147
170
|
) })
|
|
148
171
|
] })
|
|
149
172
|
}
|
|
150
173
|
),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
|
|
174
|
+
/* @__PURE__ */ r("div", { className: "pco-org-avatar__label", children: [
|
|
175
|
+
ae(p),
|
|
153
176
|
" mode"
|
|
154
177
|
] })
|
|
155
178
|
] }),
|
|
156
|
-
|
|
179
|
+
q(
|
|
157
180
|
/* @__PURE__ */ e(
|
|
158
181
|
"dialog",
|
|
159
182
|
{
|
|
160
|
-
id:
|
|
161
|
-
ref:
|
|
183
|
+
id: M,
|
|
184
|
+
ref: v,
|
|
162
185
|
className: "pco-org-avatar__dialog",
|
|
163
|
-
onClose:
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
186
|
+
onClose: O,
|
|
187
|
+
children: /* @__PURE__ */ r("form", { onSubmit: $, children: [
|
|
188
|
+
/* @__PURE__ */ r("div", { className: "pco-org-avatar__dialog-header", children: [
|
|
189
|
+
/* @__PURE__ */ r("h1", { className: "pco-org-avatar__dialog-title", children: [
|
|
167
190
|
"Church logo — ",
|
|
168
|
-
|
|
191
|
+
p,
|
|
169
192
|
" mode"
|
|
170
193
|
] }),
|
|
171
194
|
/* @__PURE__ */ e(
|
|
172
195
|
"button",
|
|
173
196
|
{
|
|
174
197
|
type: "button",
|
|
175
|
-
onClick: () =>
|
|
198
|
+
onClick: () => v.current?.close(),
|
|
176
199
|
className: "pco-org-avatar__dialog-close",
|
|
177
200
|
"aria-label": "Close modal",
|
|
178
201
|
children: /* @__PURE__ */ e(
|
|
@@ -183,14 +206,14 @@ function D({
|
|
|
183
206
|
viewBox: "0 0 16 16",
|
|
184
207
|
fill: "currentColor",
|
|
185
208
|
"aria-hidden": "true",
|
|
186
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
209
|
+
children: /* @__PURE__ */ e("path", { d: X })
|
|
187
210
|
}
|
|
188
211
|
)
|
|
189
212
|
}
|
|
190
213
|
)
|
|
191
214
|
] }),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
215
|
+
/* @__PURE__ */ r("div", { className: "pco-org-avatar__dialog-body", children: [
|
|
216
|
+
g && /* @__PURE__ */ r("div", { role: "alert", className: "pco-org-avatar-alert pco-org-avatar__dialog-alert", children: [
|
|
194
217
|
/* @__PURE__ */ e(
|
|
195
218
|
"svg",
|
|
196
219
|
{
|
|
@@ -199,102 +222,117 @@ function D({
|
|
|
199
222
|
viewBox: "0 0 16 16",
|
|
200
223
|
className: "symbol",
|
|
201
224
|
"aria-hidden": "true",
|
|
202
|
-
children: /* @__PURE__ */ e("path", { d:
|
|
225
|
+
children: /* @__PURE__ */ e("path", { d: H })
|
|
203
226
|
}
|
|
204
227
|
),
|
|
205
|
-
/* @__PURE__ */ e("p", { children:
|
|
228
|
+
/* @__PURE__ */ e("p", { children: g })
|
|
206
229
|
] }),
|
|
207
230
|
/* @__PURE__ */ e(
|
|
208
|
-
|
|
231
|
+
Y,
|
|
209
232
|
{
|
|
210
233
|
accept: { "image/*": [".jpg", ".jpeg", ".png"] },
|
|
211
234
|
multiple: !1,
|
|
212
|
-
onDropAccepted:
|
|
235
|
+
onDropAccepted: P,
|
|
213
236
|
children: ({
|
|
214
237
|
getRootProps: u,
|
|
215
|
-
getInputProps:
|
|
216
|
-
isFocused:
|
|
238
|
+
getInputProps: l,
|
|
239
|
+
isFocused: b,
|
|
217
240
|
isDragAccept: j,
|
|
218
|
-
isDragReject:
|
|
219
|
-
isDragActive:
|
|
241
|
+
isDragReject: R,
|
|
242
|
+
isDragActive: U,
|
|
243
|
+
open: S
|
|
220
244
|
}) => {
|
|
221
|
-
const
|
|
245
|
+
const I = Z(
|
|
222
246
|
"pco-org-avatar__dialog-dropzone",
|
|
223
|
-
`pco-org-avatar__dialog-dropzone--${
|
|
247
|
+
`pco-org-avatar__dialog-dropzone--${p}`,
|
|
224
248
|
{
|
|
225
|
-
"pco-org-avatar__dialog-dropzone--image":
|
|
226
|
-
"pco-org-avatar__dialog-dropzone--focused":
|
|
249
|
+
"pco-org-avatar__dialog-dropzone--image": i || f,
|
|
250
|
+
"pco-org-avatar__dialog-dropzone--focused": b,
|
|
227
251
|
"pco-org-avatar__dialog-dropzone--accepted": j,
|
|
228
|
-
"pco-org-avatar__dialog-dropzone--rejected":
|
|
252
|
+
"pco-org-avatar__dialog-dropzone--rejected": U && R
|
|
229
253
|
}
|
|
230
254
|
);
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
src: a,
|
|
243
|
-
alt: `Church logo for ${o}`
|
|
244
|
-
}
|
|
245
|
-
) : /* @__PURE__ */ n(f, { children: [
|
|
246
|
-
/* @__PURE__ */ e(
|
|
247
|
-
"svg",
|
|
255
|
+
return /* @__PURE__ */ r(h, { children: [
|
|
256
|
+
/* @__PURE__ */ r("div", { ...u({ className: I }), children: [
|
|
257
|
+
/* @__PURE__ */ e("input", { ...l() }),
|
|
258
|
+
i ? /* @__PURE__ */ e(
|
|
259
|
+
"img",
|
|
260
|
+
{
|
|
261
|
+
src: i.preview,
|
|
262
|
+
alt: `Church logo for ${t}`
|
|
263
|
+
}
|
|
264
|
+
) : f ? /* @__PURE__ */ e(
|
|
265
|
+
"img",
|
|
248
266
|
{
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
viewBox: "0 0 16 16",
|
|
252
|
-
"aria-hidden": "true",
|
|
253
|
-
children: /* @__PURE__ */ e("path", { d: q })
|
|
267
|
+
src: f,
|
|
268
|
+
alt: `Church logo for ${t}`
|
|
254
269
|
}
|
|
255
|
-
),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
270
|
+
) : /* @__PURE__ */ r(h, { children: [
|
|
271
|
+
/* @__PURE__ */ e(
|
|
272
|
+
"svg",
|
|
273
|
+
{
|
|
274
|
+
width: "64",
|
|
275
|
+
height: "64",
|
|
276
|
+
viewBox: "0 0 16 16",
|
|
277
|
+
"aria-hidden": "true",
|
|
278
|
+
children: /* @__PURE__ */ e("path", { d: K })
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
U && R ? /* @__PURE__ */ r(h, { children: [
|
|
282
|
+
/* @__PURE__ */ e("h2", { children: "Wrong file type" }),
|
|
283
|
+
/* @__PURE__ */ e("p", { children: "Please upload a PNG or JPG file." })
|
|
284
|
+
] }) : /* @__PURE__ */ r(h, { children: [
|
|
285
|
+
/* @__PURE__ */ e(B, { open: S }),
|
|
286
|
+
/* @__PURE__ */ e("p", { className: "pco-org-avatar__instructions-sub", children: "Use a high-quality image (up to 20mb) with a transparent background." })
|
|
287
|
+
] })
|
|
262
288
|
] })
|
|
263
|
-
] })
|
|
289
|
+
] }),
|
|
290
|
+
(i || f) && /* @__PURE__ */ e(B, { open: S })
|
|
264
291
|
] });
|
|
265
292
|
}
|
|
266
293
|
}
|
|
267
294
|
)
|
|
268
295
|
] }),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
a && /* @__PURE__ */ e(
|
|
271
|
-
|
|
296
|
+
/* @__PURE__ */ r("div", { className: "pco-org-avatar__dialog-actions", children: [
|
|
297
|
+
a && p === "light" && /* @__PURE__ */ e(
|
|
298
|
+
C,
|
|
299
|
+
{
|
|
300
|
+
label: "Remove logo",
|
|
301
|
+
kind: "secondary-delete",
|
|
302
|
+
onClick: z,
|
|
303
|
+
loading: c,
|
|
304
|
+
disabled: c || d,
|
|
305
|
+
className: "pco-org-avatar__dialog-delete"
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
a && p === "dark" && /* @__PURE__ */ e(
|
|
309
|
+
C,
|
|
272
310
|
{
|
|
273
|
-
label: "
|
|
274
|
-
kind: "
|
|
275
|
-
onClick:
|
|
276
|
-
loading:
|
|
277
|
-
disabled:
|
|
311
|
+
label: "Use light mode logo",
|
|
312
|
+
kind: "secondary",
|
|
313
|
+
onClick: z,
|
|
314
|
+
loading: c,
|
|
315
|
+
disabled: c || d,
|
|
278
316
|
className: "pco-org-avatar__dialog-delete"
|
|
279
317
|
}
|
|
280
318
|
),
|
|
281
319
|
/* @__PURE__ */ e(
|
|
282
|
-
|
|
320
|
+
C,
|
|
283
321
|
{
|
|
284
322
|
type: "button",
|
|
285
323
|
label: "Cancel",
|
|
286
|
-
onClick: () =>
|
|
287
|
-
disabled: d ||
|
|
324
|
+
onClick: () => v.current?.close(),
|
|
325
|
+
disabled: d || c
|
|
288
326
|
}
|
|
289
327
|
),
|
|
290
328
|
/* @__PURE__ */ e(
|
|
291
|
-
|
|
329
|
+
C,
|
|
292
330
|
{
|
|
293
331
|
type: "submit",
|
|
294
332
|
label: "Update logo",
|
|
295
333
|
kind: "primary",
|
|
296
334
|
loading: d,
|
|
297
|
-
disabled: !
|
|
335
|
+
disabled: !i || d || c
|
|
298
336
|
}
|
|
299
337
|
)
|
|
300
338
|
] })
|
|
@@ -305,45 +343,62 @@ function D({
|
|
|
305
343
|
)
|
|
306
344
|
] });
|
|
307
345
|
}
|
|
308
|
-
function
|
|
346
|
+
function ge({
|
|
309
347
|
avatarUrl: a,
|
|
310
|
-
darkModeAvatarUrl:
|
|
311
|
-
orgName:
|
|
312
|
-
onAvatarUpdate:
|
|
313
|
-
pcoEnv:
|
|
314
|
-
readOnly:
|
|
315
|
-
showDarkModeAvatar:
|
|
348
|
+
darkModeAvatarUrl: t,
|
|
349
|
+
orgName: o,
|
|
350
|
+
onAvatarUpdate: n,
|
|
351
|
+
pcoEnv: s,
|
|
352
|
+
readOnly: y,
|
|
353
|
+
showDarkModeAvatar: w = !1
|
|
316
354
|
}) {
|
|
317
|
-
const [
|
|
318
|
-
|
|
319
|
-
),
|
|
320
|
-
|
|
355
|
+
const [i, k] = _(a), [d, N] = _(
|
|
356
|
+
t
|
|
357
|
+
), c = (m, g) => {
|
|
358
|
+
m === "avatar" ? (k(g), n?.("avatar", g)) : m === "dark_mode_avatar" && (N(g), n?.("dark_mode_avatar", g));
|
|
321
359
|
};
|
|
322
|
-
return /* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
360
|
+
return /* @__PURE__ */ r(h, { children: [
|
|
361
|
+
/* @__PURE__ */ r("div", { className: "pco-org-avatars", children: [
|
|
362
|
+
/* @__PURE__ */ e(
|
|
363
|
+
F,
|
|
364
|
+
{
|
|
365
|
+
avatarUrl: i,
|
|
366
|
+
organization: o,
|
|
367
|
+
mode: "avatar",
|
|
368
|
+
pcoEnv: s,
|
|
369
|
+
readOnly: y,
|
|
370
|
+
onAvatarUpdate: c
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
w && /* @__PURE__ */ e(
|
|
374
|
+
F,
|
|
375
|
+
{
|
|
376
|
+
avatarUrl: d,
|
|
377
|
+
organization: o,
|
|
378
|
+
mode: "dark_mode_avatar",
|
|
379
|
+
pcoEnv: s,
|
|
380
|
+
readOnly: y,
|
|
381
|
+
onAvatarUpdate: c,
|
|
382
|
+
fallbackAvatarUrl: i
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
] }),
|
|
386
|
+
w && i && !d && /* @__PURE__ */ r("div", { className: "pco-org-avatar-alert", children: [
|
|
387
|
+
/* @__PURE__ */ e(
|
|
388
|
+
"svg",
|
|
389
|
+
{
|
|
390
|
+
width: "16",
|
|
391
|
+
height: "16",
|
|
392
|
+
viewBox: "0 0 16 16",
|
|
393
|
+
className: "symbol",
|
|
394
|
+
"aria-hidden": "true",
|
|
395
|
+
children: /* @__PURE__ */ e("path", { d: Q })
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ e("p", { children: "The same logo is being used for both light and dark modes." })
|
|
399
|
+
] })
|
|
345
400
|
] });
|
|
346
401
|
}
|
|
347
402
|
export {
|
|
348
|
-
|
|
403
|
+
ge as OrganizationAvatars
|
|
349
404
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { OrganizationAvatarProps } from "./types";
|
|
2
|
-
export declare function OrganizationAvatar({ avatarUrl, organization, mode, pcoEnv, readOnly, onAvatarUpdate, }: OrganizationAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function OrganizationAvatar({ avatarUrl, organization, mode, pcoEnv, readOnly, onAvatarUpdate, fallbackAvatarUrl, }: OrganizationAvatarProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/style.css
CHANGED
|
@@ -3,23 +3,51 @@
|
|
|
3
3
|
gap: var(--t-spacing-1);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.pco-org-avatar-alert {
|
|
7
|
+
background: var(--t-fill-color-status-info-ghost);
|
|
8
|
+
border-radius: var(--t-border-radius-lg);
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: var(--t-spacing-2);
|
|
11
|
+
margin-top: var(--t-spacing-2);
|
|
12
|
+
padding: var(--t-spacing-2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.pco-org-avatar-alert svg {
|
|
16
|
+
fill: var(--t-icon-color-status-info);
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
height: var(--t-element-size-md);
|
|
19
|
+
position: relative;
|
|
20
|
+
top: 1px;
|
|
21
|
+
width: var(--t-element-size-md);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.pco-org-avatar-alert p {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: var(--t-spacing-half);
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
6
31
|
.pco-org-avatar {
|
|
7
32
|
align-items: center;
|
|
8
|
-
display:
|
|
33
|
+
display: flex;
|
|
9
34
|
flex-direction: column;
|
|
10
35
|
gap: var(--t-spacing-1);
|
|
36
|
+
flex: 1;
|
|
37
|
+
max-width: 175px;
|
|
38
|
+
min-width: 0;
|
|
11
39
|
}
|
|
12
40
|
|
|
13
41
|
.pco-org-avatar__button {
|
|
42
|
+
aspect-ratio: 175 / 100;
|
|
14
43
|
background: var(--t-surface-color-canvas);
|
|
15
44
|
border: var(--t-border-width) dashed var(--t-border-color);
|
|
16
45
|
border-radius: var(--t-border-radius-lg);
|
|
17
46
|
color: var(--t-icon-color-dim);
|
|
18
47
|
cursor: pointer;
|
|
19
|
-
height: 100px;
|
|
20
48
|
padding: var(--t-spacing-1);
|
|
21
49
|
position: relative;
|
|
22
|
-
width:
|
|
50
|
+
width: 100%;
|
|
23
51
|
}
|
|
24
52
|
|
|
25
53
|
.pco-org-avatar__button img {
|
|
@@ -136,27 +164,11 @@
|
|
|
136
164
|
|
|
137
165
|
.pco-org-avatar__dialog-alert {
|
|
138
166
|
background: var(--t-fill-color-status-error-ghost);
|
|
139
|
-
|
|
140
|
-
display: flex;
|
|
141
|
-
gap: var(--t-spacing-2);
|
|
142
|
-
margin-bottom: var(--t-spacing-2);
|
|
143
|
-
padding: var(--t-spacing-2);
|
|
167
|
+
margin-block: 0 var(--t-spacing-2);
|
|
144
168
|
}
|
|
145
169
|
|
|
146
170
|
.pco-org-avatar__dialog-alert svg {
|
|
147
171
|
fill: var(--t-icon-color-status-error);
|
|
148
|
-
flex-shrink: 0;
|
|
149
|
-
height: var(--t-element-size-md);
|
|
150
|
-
position: relative;
|
|
151
|
-
top: 1px;
|
|
152
|
-
width: var(--t-element-size-md);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.pco-org-avatar__dialog-alert p {
|
|
156
|
-
display: flex;
|
|
157
|
-
flex-direction: column;
|
|
158
|
-
gap: var(--t-spacing-half);
|
|
159
|
-
margin: 0;
|
|
160
172
|
}
|
|
161
173
|
|
|
162
174
|
.pco-org-avatar__dialog-dropzone {
|
|
@@ -178,19 +190,6 @@
|
|
|
178
190
|
fill: var(--t-icon-color-status-info);
|
|
179
191
|
}
|
|
180
192
|
|
|
181
|
-
.pco-org-avatar__dialog-dropzone h2 {
|
|
182
|
-
color: var(--t-text-color-headline);
|
|
183
|
-
font-size: var(--t-font-size-md);
|
|
184
|
-
font-weight: var(--t-font-weight-normal);
|
|
185
|
-
margin: 0;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.pco-org-avatar__dialog-dropzone p {
|
|
189
|
-
color: var(--t-text-color-placeholder);
|
|
190
|
-
font-size: var(--t-font-size-sm);
|
|
191
|
-
margin: 0;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
193
|
.pco-org-avatar__dialog-dropzone img {
|
|
195
194
|
max-height: 100%;
|
|
196
195
|
max-width: 100%;
|
|
@@ -222,11 +221,25 @@
|
|
|
222
221
|
fill: var(--t-fill-color-status-error);
|
|
223
222
|
}
|
|
224
223
|
|
|
225
|
-
|
|
224
|
+
.pco-org-avatar__instructions {
|
|
225
|
+
font-size: var(--t-font-size-md);
|
|
226
|
+
font-weight: var(--t-font-weight-normal);
|
|
227
|
+
margin: var(--t-spacing-2) 0 0;
|
|
228
|
+
text-align: center;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.pco-org-avatar__instructions-sub {
|
|
232
|
+
color: var(--t-text-color-secondary);
|
|
233
|
+
font-size: var(--t-font-size-sm);
|
|
234
|
+
margin: 0;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Light/dark colors/backgrounds are hardcoded to match the avatar preview context,
|
|
226
238
|
regardless of the UI theme or whether an avatar is uploaded */
|
|
239
|
+
|
|
227
240
|
.pco-org-avatar__button--light,
|
|
228
241
|
.pco-org-avatar__dialog-dropzone--light {
|
|
229
|
-
background: hsl(0, 0%,
|
|
242
|
+
background: hsl(0, 0%, 97%);
|
|
230
243
|
}
|
|
231
244
|
|
|
232
245
|
.pco-org-avatar__button--light:has(img),
|
|
@@ -243,3 +256,11 @@
|
|
|
243
256
|
.pco-org-avatar__dialog-dropzone--dark:has(img) {
|
|
244
257
|
border-color: transparent;
|
|
245
258
|
}
|
|
259
|
+
|
|
260
|
+
.pco-org-avatar__dialog-dropzone--light .pco-org-avatar__instructions {
|
|
261
|
+
color: hsl(0, 0%, 12%);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.pco-org-avatar__dialog-dropzone--dark .pco-org-avatar__instructions {
|
|
265
|
+
color: hsl(0, 0%, 94%);
|
|
266
|
+
}
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/organization-avatars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Organization avatar upload components for Planning Center apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "yarn@1.22.22",
|
|
@@ -31,14 +31,19 @@
|
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@planningcenter/icons": "^15.29.1",
|
|
34
|
+
"@planningcenter/sweetest-alert": "^1.0.1",
|
|
34
35
|
"@planningcenter/tapestry": "^2.10.1",
|
|
35
36
|
"@planningcenter/url": "^3.2.0",
|
|
36
37
|
"react": "^18.3.0",
|
|
37
38
|
"react-dom": "^18.3.0",
|
|
38
39
|
"react-dropzone": "^14.0.0"
|
|
39
40
|
},
|
|
41
|
+
"prettier": {
|
|
42
|
+
"semi": false
|
|
43
|
+
},
|
|
40
44
|
"devDependencies": {
|
|
41
45
|
"@planningcenter/icons": "^15.29.1",
|
|
46
|
+
"@planningcenter/sweetest-alert": "^1.0.1",
|
|
42
47
|
"@planningcenter/tapestry": "^2.10.1",
|
|
43
48
|
"@planningcenter/url": "^3.2.0",
|
|
44
49
|
"@types/react": "^18.3.0",
|