@zag-js/toast 0.0.0-dev-20221208134434 → 0.0.0-dev-20221208141235

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/index.d.ts CHANGED
@@ -967,57 +967,57 @@ declare const anatomy: Omit<{
967
967
  }>;
968
968
  }, "parts">;
969
969
  extend: <V_20 extends string>(...parts: V_20[]) => Omit<any, "parts">;
970
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18 | V_19, {
970
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18 | V_19, {
971
971
  selector: string;
972
972
  attrs: Record<"data-scope" | "data-part", string>;
973
973
  }>;
974
974
  }, "parts">;
975
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18, {
975
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18, {
976
976
  selector: string;
977
977
  attrs: Record<"data-scope" | "data-part", string>;
978
978
  }>;
979
979
  }, "parts">;
980
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17, {
980
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17, {
981
981
  selector: string;
982
982
  attrs: Record<"data-scope" | "data-part", string>;
983
983
  }>;
984
984
  }, "parts">;
985
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16, {
985
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16, {
986
986
  selector: string;
987
987
  attrs: Record<"data-scope" | "data-part", string>;
988
988
  }>;
989
989
  }, "parts">;
990
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15, {
990
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15, {
991
991
  selector: string;
992
992
  attrs: Record<"data-scope" | "data-part", string>;
993
993
  }>;
994
994
  }, "parts">;
995
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12 | V_13 | V_14, {
995
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14, {
996
996
  selector: string;
997
997
  attrs: Record<"data-scope" | "data-part", string>;
998
998
  }>;
999
999
  }, "parts">;
1000
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12 | V_13, {
1000
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12 | V_13, {
1001
1001
  selector: string;
1002
1002
  attrs: Record<"data-scope" | "data-part", string>;
1003
1003
  }>;
1004
1004
  }, "parts">;
1005
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11 | V_12, {
1005
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11 | V_12, {
1006
1006
  selector: string;
1007
1007
  attrs: Record<"data-scope" | "data-part", string>;
1008
1008
  }>;
1009
1009
  }, "parts">;
1010
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10 | V_11, {
1010
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10 | V_11, {
1011
1011
  selector: string;
1012
1012
  attrs: Record<"data-scope" | "data-part", string>;
1013
1013
  }>;
1014
1014
  }, "parts">;
1015
- build: () => Record<"title" | "description" | "root" | "closeButton" | V_10, {
1015
+ build: () => Record<"title" | "description" | "root" | "closeTrigger" | V_10, {
1016
1016
  selector: string;
1017
1017
  attrs: Record<"data-scope" | "data-part", string>;
1018
1018
  }>;
1019
1019
  }, "parts">;
1020
- build: () => Record<"title" | "description" | "root" | "closeButton", {
1020
+ build: () => Record<"title" | "description" | "root" | "closeTrigger", {
1021
1021
  selector: string;
1022
1022
  attrs: Record<"data-scope" | "data-part", string>;
1023
1023
  }>;
@@ -1037,7 +1037,7 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
1037
1037
  rootProps: T["element"];
1038
1038
  titleProps: T["element"];
1039
1039
  descriptionProps: T["element"];
1040
- closeButtonProps: T["button"];
1040
+ closeTriggerProps: T["button"];
1041
1041
  render(): any;
1042
1042
  };
1043
1043
 
package/dist/index.js CHANGED
@@ -142,10 +142,10 @@ var import_core = require("@zag-js/core");
142
142
  // src/toast.dom.ts
143
143
  var dom = defineDomHelpers({
144
144
  getGroupId: (placement) => `toast-group:${placement}`,
145
- getContainerId: (ctx) => `toast:${ctx.id}`,
146
- getTitleId: (ctx) => `toast-title:${ctx.id}`,
147
- getDescriptionId: (ctx) => `toast-description:${ctx.id}`,
148
- getCloseButtonId: (ctx) => `toast-close-button:${ctx.id}`,
145
+ getRootId: (ctx) => `toast:${ctx.id}`,
146
+ getTitleId: (ctx) => `toast:${ctx.id}:title`,
147
+ getDescriptionId: (ctx) => `toast:${ctx.id}:description`,
148
+ getCloseTriggerId: (ctx) => `toast${ctx.id}:close`,
149
149
  getPortalId: (ctx) => `toast-portal:${ctx.id}`,
150
150
  getPortalEl: (ctx) => dom.getDoc(ctx).getElementById(dom.getPortalId(ctx)),
151
151
  createPortalEl: (ctx) => {
@@ -588,7 +588,7 @@ function groupMachine(userContext) {
588
588
 
589
589
  // src/toast.anatomy.ts
590
590
  var import_anatomy = require("@zag-js/anatomy");
591
- var anatomy = (0, import_anatomy.createAnatomy)("toast").parts("root", "title", "description", "closeButton");
591
+ var anatomy = (0, import_anatomy.createAnatomy)("toast").parts("root", "title", "description", "closeTrigger");
592
592
  var parts = anatomy.build();
593
593
 
594
594
  // src/toast.connect.ts
@@ -617,7 +617,7 @@ function connect(state, send, normalize) {
617
617
  rootProps: normalize.element({
618
618
  ...parts.root.attrs,
619
619
  dir: state.context.dir,
620
- id: dom.getContainerId(state.context),
620
+ id: dom.getRootId(state.context),
621
621
  "data-open": dataAttr(isVisible),
622
622
  "data-type": state.context.type,
623
623
  "data-placement": placement,
@@ -666,9 +666,9 @@ function connect(state, send, normalize) {
666
666
  ...parts.description.attrs,
667
667
  id: dom.getDescriptionId(state.context)
668
668
  }),
669
- closeButtonProps: normalize.button({
670
- id: dom.getCloseButtonId(state.context),
671
- ...parts.closeButton.attrs,
669
+ closeTriggerProps: normalize.button({
670
+ id: dom.getCloseTriggerId(state.context),
671
+ ...parts.closeTrigger.attrs,
672
672
  type: "button",
673
673
  "aria-label": "Dismiss notification",
674
674
  onClick() {
package/dist/index.mjs CHANGED
@@ -112,10 +112,10 @@ import { subscribe } from "@zag-js/core";
112
112
  // src/toast.dom.ts
113
113
  var dom = defineDomHelpers({
114
114
  getGroupId: (placement) => `toast-group:${placement}`,
115
- getContainerId: (ctx) => `toast:${ctx.id}`,
116
- getTitleId: (ctx) => `toast-title:${ctx.id}`,
117
- getDescriptionId: (ctx) => `toast-description:${ctx.id}`,
118
- getCloseButtonId: (ctx) => `toast-close-button:${ctx.id}`,
115
+ getRootId: (ctx) => `toast:${ctx.id}`,
116
+ getTitleId: (ctx) => `toast:${ctx.id}:title`,
117
+ getDescriptionId: (ctx) => `toast:${ctx.id}:description`,
118
+ getCloseTriggerId: (ctx) => `toast${ctx.id}:close`,
119
119
  getPortalId: (ctx) => `toast-portal:${ctx.id}`,
120
120
  getPortalEl: (ctx) => dom.getDoc(ctx).getElementById(dom.getPortalId(ctx)),
121
121
  createPortalEl: (ctx) => {
@@ -558,7 +558,7 @@ function groupMachine(userContext) {
558
558
 
559
559
  // src/toast.anatomy.ts
560
560
  import { createAnatomy } from "@zag-js/anatomy";
561
- var anatomy = createAnatomy("toast").parts("root", "title", "description", "closeButton");
561
+ var anatomy = createAnatomy("toast").parts("root", "title", "description", "closeTrigger");
562
562
  var parts = anatomy.build();
563
563
 
564
564
  // src/toast.connect.ts
@@ -587,7 +587,7 @@ function connect(state, send, normalize) {
587
587
  rootProps: normalize.element({
588
588
  ...parts.root.attrs,
589
589
  dir: state.context.dir,
590
- id: dom.getContainerId(state.context),
590
+ id: dom.getRootId(state.context),
591
591
  "data-open": dataAttr(isVisible),
592
592
  "data-type": state.context.type,
593
593
  "data-placement": placement,
@@ -636,9 +636,9 @@ function connect(state, send, normalize) {
636
636
  ...parts.description.attrs,
637
637
  id: dom.getDescriptionId(state.context)
638
638
  }),
639
- closeButtonProps: normalize.button({
640
- id: dom.getCloseButtonId(state.context),
641
- ...parts.closeButton.attrs,
639
+ closeTriggerProps: normalize.button({
640
+ id: dom.getCloseTriggerId(state.context),
641
+ ...parts.closeTrigger.attrs,
642
642
  type: "button",
643
643
  "aria-label": "Dismiss notification",
644
644
  onClick() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/toast",
3
- "version": "0.0.0-dev-20221208134434",
3
+ "version": "0.0.0-dev-20221208141235",
4
4
  "description": "Core logic for the toast widget implemented as a state machine",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",