@zag-js/popover 0.0.0-dev-20221208131234 → 0.0.0-dev-20221208133609
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 +13 -13
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -797,57 +797,57 @@ declare const anatomy: Omit<{
|
|
|
797
797
|
}>;
|
|
798
798
|
}, "parts">;
|
|
799
799
|
extend: <V_20 extends string>(...parts: V_20[]) => Omit<any, "parts">;
|
|
800
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
800
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18 | V_19, {
|
|
801
801
|
selector: string;
|
|
802
802
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
803
803
|
}>;
|
|
804
804
|
}, "parts">;
|
|
805
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
805
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18, {
|
|
806
806
|
selector: string;
|
|
807
807
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
808
808
|
}>;
|
|
809
809
|
}, "parts">;
|
|
810
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
810
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17, {
|
|
811
811
|
selector: string;
|
|
812
812
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
813
813
|
}>;
|
|
814
814
|
}, "parts">;
|
|
815
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
815
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16, {
|
|
816
816
|
selector: string;
|
|
817
817
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
818
818
|
}>;
|
|
819
819
|
}, "parts">;
|
|
820
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
820
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15, {
|
|
821
821
|
selector: string;
|
|
822
822
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
823
823
|
}>;
|
|
824
824
|
}, "parts">;
|
|
825
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
825
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14, {
|
|
826
826
|
selector: string;
|
|
827
827
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
828
828
|
}>;
|
|
829
829
|
}, "parts">;
|
|
830
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
830
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13, {
|
|
831
831
|
selector: string;
|
|
832
832
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
833
833
|
}>;
|
|
834
834
|
}, "parts">;
|
|
835
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
835
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12, {
|
|
836
836
|
selector: string;
|
|
837
837
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
838
838
|
}>;
|
|
839
839
|
}, "parts">;
|
|
840
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
840
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11, {
|
|
841
841
|
selector: string;
|
|
842
842
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
843
843
|
}>;
|
|
844
844
|
}, "parts">;
|
|
845
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
845
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10, {
|
|
846
846
|
selector: string;
|
|
847
847
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
848
848
|
}>;
|
|
849
849
|
}, "parts">;
|
|
850
|
-
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "
|
|
850
|
+
build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger", {
|
|
851
851
|
selector: string;
|
|
852
852
|
attrs: Record<"data-scope" | "data-part", string>;
|
|
853
853
|
}>;
|
|
@@ -859,7 +859,7 @@ declare type ElementIds = Partial<{
|
|
|
859
859
|
content: string;
|
|
860
860
|
title: string;
|
|
861
861
|
description: string;
|
|
862
|
-
|
|
862
|
+
closeTrigger: string;
|
|
863
863
|
}>;
|
|
864
864
|
declare type PublicContext = DismissableElementHandlers & CommonProperties & {
|
|
865
865
|
/**
|
|
@@ -944,7 +944,7 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
|
|
|
944
944
|
contentProps: T["element"];
|
|
945
945
|
titleProps: T["element"];
|
|
946
946
|
descriptionProps: T["element"];
|
|
947
|
-
|
|
947
|
+
closeTriggerProps: T["button"];
|
|
948
948
|
};
|
|
949
949
|
|
|
950
950
|
declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var anatomy = (0, import_anatomy.createAnatomy)("popover").parts(
|
|
|
37
37
|
"content",
|
|
38
38
|
"title",
|
|
39
39
|
"description",
|
|
40
|
-
"
|
|
40
|
+
"closeTrigger"
|
|
41
41
|
);
|
|
42
42
|
var parts = anatomy.build();
|
|
43
43
|
|
|
@@ -263,9 +263,9 @@ var dom = defineDomHelpers({
|
|
|
263
263
|
var _a, _b;
|
|
264
264
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.description) != null ? _b : `popover:${ctx.id}:desc`;
|
|
265
265
|
},
|
|
266
|
-
|
|
266
|
+
getCloseTriggerId: (ctx) => {
|
|
267
267
|
var _a, _b;
|
|
268
|
-
return (_b = (_a = ctx.ids) == null ? void 0 : _a.
|
|
268
|
+
return (_b = (_a = ctx.ids) == null ? void 0 : _a.closeTrigger) != null ? _b : `popover:${ctx.id}:close`;
|
|
269
269
|
},
|
|
270
270
|
getAnchorEl: (ctx) => dom.getById(ctx, dom.getAnchorId(ctx)),
|
|
271
271
|
getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
|
|
@@ -361,9 +361,9 @@ function connect(state, send, normalize) {
|
|
|
361
361
|
...parts.description.attrs,
|
|
362
362
|
id: dom.getDescriptionId(state.context)
|
|
363
363
|
}),
|
|
364
|
-
|
|
365
|
-
...parts.
|
|
366
|
-
id: dom.
|
|
364
|
+
closeTriggerProps: normalize.button({
|
|
365
|
+
...parts.closeTrigger.attrs,
|
|
366
|
+
id: dom.getCloseTriggerId(state.context),
|
|
367
367
|
type: "button",
|
|
368
368
|
"aria-label": "close",
|
|
369
369
|
onClick() {
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ var anatomy = createAnatomy("popover").parts(
|
|
|
9
9
|
"content",
|
|
10
10
|
"title",
|
|
11
11
|
"description",
|
|
12
|
-
"
|
|
12
|
+
"closeTrigger"
|
|
13
13
|
);
|
|
14
14
|
var parts = anatomy.build();
|
|
15
15
|
|
|
@@ -235,9 +235,9 @@ var dom = defineDomHelpers({
|
|
|
235
235
|
var _a, _b;
|
|
236
236
|
return (_b = (_a = ctx.ids) == null ? void 0 : _a.description) != null ? _b : `popover:${ctx.id}:desc`;
|
|
237
237
|
},
|
|
238
|
-
|
|
238
|
+
getCloseTriggerId: (ctx) => {
|
|
239
239
|
var _a, _b;
|
|
240
|
-
return (_b = (_a = ctx.ids) == null ? void 0 : _a.
|
|
240
|
+
return (_b = (_a = ctx.ids) == null ? void 0 : _a.closeTrigger) != null ? _b : `popover:${ctx.id}:close`;
|
|
241
241
|
},
|
|
242
242
|
getAnchorEl: (ctx) => dom.getById(ctx, dom.getAnchorId(ctx)),
|
|
243
243
|
getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
|
|
@@ -333,9 +333,9 @@ function connect(state, send, normalize) {
|
|
|
333
333
|
...parts.description.attrs,
|
|
334
334
|
id: dom.getDescriptionId(state.context)
|
|
335
335
|
}),
|
|
336
|
-
|
|
337
|
-
...parts.
|
|
338
|
-
id: dom.
|
|
336
|
+
closeTriggerProps: normalize.button({
|
|
337
|
+
...parts.closeTrigger.attrs,
|
|
338
|
+
id: dom.getCloseTriggerId(state.context),
|
|
339
339
|
type: "button",
|
|
340
340
|
"aria-label": "close",
|
|
341
341
|
onClick() {
|
package/package.json
CHANGED