@photoroom/ui 0.1.527 → 0.1.528

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,7 +1,14 @@
1
1
  import { ExternalToast } from "sonner";
2
2
  import { Notification, NotificationProps } from "./Notification";
3
3
  type AddNotificationProps = Omit<NotificationProps, "closeLabel">;
4
- export type DefaultNotificationProps = Omit<Partial<NotificationProps>, "closeLabel"> & Pick<NotificationProps, "closeLabel">;
4
+ /**
5
+ * `closeLabel` may be a thunk, resolved once per notification rather than when the store is built.
6
+ * Consumers that construct this store during app startup can otherwise capture a translation before
7
+ * their i18n bundle has loaded, pinning an empty accessible name on the close button for good.
8
+ */
9
+ export type DefaultNotificationProps = Omit<Partial<NotificationProps>, "closeLabel"> & {
10
+ closeLabel: NotificationProps["closeLabel"] | (() => NotificationProps["closeLabel"]);
11
+ };
5
12
  export type NotificationStoreDependencies = {
6
13
  defaultNotificationProps: DefaultNotificationProps;
7
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsStore.d.ts","sourceRoot":"","sources":["../../../../src/components/status/Notification/NotificationsStore.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAS,MAAM,QAAQ,CAAC;AAK9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,KAAK,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AAElE,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,GACnF,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AAExC,MAAM,MAAM,6BAA6B,GAAG;IAC1C,wBAAwB,EAAE,wBAAwB,CAAC;CACpD,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,YAAY,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACrD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,qBAAa,kBAAkB;;gBAGjB,YAAY,EAAE,6BAA6B;IAIvD,eAAe,GAAI,cAAc,oBAAoB,KAAG,YAAY,CAUlE;IACF,qBAAqB,8FAAgB;IACrC,mBAAmB,4CAAiB;IA0BpC,OAAO,GAAI,SAAS;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;QACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KAAG,OAAO,CAAC,OAAO,CAAC,CA4BlB;CACH"}
1
+ {"version":3,"file":"NotificationsStore.d.ts","sourceRoot":"","sources":["../../../../src/components/status/Notification/NotificationsStore.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAS,MAAM,QAAQ,CAAC;AAK9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,KAAK,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,GAAG;IACtF,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC;CACvF,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,wBAAwB,EAAE,wBAAwB,CAAC;CACpD,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,YAAY,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACrD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,qBAAa,kBAAkB;;gBAGjB,YAAY,EAAE,6BAA6B;IAIvD,eAAe,GAAI,cAAc,oBAAoB,KAAG,YAAY,CAUlE;IACF,qBAAqB,8FAAgB;IACrC,mBAAmB,4CAAiB;IA4BpC,OAAO,GAAI,SAAS;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;QACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KAAG,OAAO,CAAC,OAAO,CAAC,CA4BlB;CACH"}
package/index.mjs CHANGED
@@ -51382,11 +51382,15 @@ var Ege = /*#__PURE__*/ z.forwardRef(function(e, t) {
51382
51382
  r?.(), this.dismissNotification(e);
51383
51383
  }
51384
51384
  }), n);
51385
- }, this.#n = (e) => ({
51386
- ...this.#e.defaultNotificationProps,
51387
- ...e,
51388
- className: U(this.#e.defaultNotificationProps.className, e.className)
51389
- }), this.confirm = (e) => new Promise((n) => {
51385
+ }, this.#n = (e) => {
51386
+ let { closeLabel: t, ...n } = this.#e.defaultNotificationProps;
51387
+ return {
51388
+ ...n,
51389
+ closeLabel: typeof t == "function" ? t() : t,
51390
+ ...e,
51391
+ className: U(this.#e.defaultNotificationProps.className, e.className)
51392
+ };
51393
+ }, this.confirm = (e) => new Promise((n) => {
51390
51394
  let r = this.#t({
51391
51395
  label: e.label,
51392
51396
  className: "w-[480px]",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photoroom/ui",
3
- "version": "0.1.527",
3
+ "version": "0.1.528",
4
4
  "private": false,
5
5
  "description": "Photoroom design system components",
6
6
  "sideEffects": [