@aleph-alpha/ui-library 2.4.1 → 2.4.2
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/system/lib.js +2 -2
- package/package.json +1 -1
- package/src/components/UiAlertDialog/__tests__/UiAlertDialog.test.ts +17 -0
- package/src/components/UiDialog/__tests__/UiDialog.test.ts +14 -0
- package/src/components/core/alert-dialog/AlertDialogContent.vue +1 -1
- package/src/components/core/dialog/DialogContent.vue +1 -1
package/dist/system/lib.js
CHANGED
|
@@ -44720,7 +44720,7 @@ const OY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
44720
44720
|
$(rO),
|
|
44721
44721
|
$(l(HS), q({ "data-slot": "dialog-content" }, { ...l(r), ...s.$attrs }, {
|
|
44722
44722
|
class: l(D)(
|
|
44723
|
-
"bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border border-border-surface-default p-6 shadow-lg duration-200",
|
|
44723
|
+
"bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 fixed top-[50%] left-[50%] z-50 flex w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border border-border-surface-default p-6 shadow-lg duration-200",
|
|
44724
44724
|
a.maxWidth ?? "max-w-[50vw]"
|
|
44725
44725
|
)
|
|
44726
44726
|
}), {
|
|
@@ -44999,7 +44999,7 @@ const OY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
44999
44999
|
}),
|
|
45000
45000
|
$(l(RF), q({ "data-slot": "alert-dialog-content" }, { ...l(r), ...s.$attrs }, {
|
|
45001
45001
|
class: l(D)(
|
|
45002
|
-
"bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border-surface-default p-6 shadow-lg duration-200",
|
|
45002
|
+
"bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 fixed top-[50%] left-[50%] z-50 grid w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border-surface-default p-6 shadow-lg duration-200",
|
|
45003
45003
|
a.maxWidth ?? "max-w-none"
|
|
45004
45004
|
)
|
|
45005
45005
|
}), {
|
package/package.json
CHANGED
|
@@ -119,6 +119,23 @@ describe('UiAlertDialog', () => {
|
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
+
test('keeps content centered during open and close animations', async () => {
|
|
123
|
+
const { getByRole } = renderAlertDialog({ model: true });
|
|
124
|
+
|
|
125
|
+
await waitFor(() => {
|
|
126
|
+
expect(getByRole('alertdialog')).toBeInTheDocument();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const alertDialog = getByRole('alertdialog');
|
|
130
|
+
|
|
131
|
+
expect(alertDialog).toHaveClass('data-[state=open]:slide-in-from-left-1/2');
|
|
132
|
+
expect(alertDialog).toHaveClass('data-[state=open]:slide-in-from-top-1/2');
|
|
133
|
+
expect(alertDialog).toHaveClass(
|
|
134
|
+
'data-[state=closed]:slide-out-to-left-1/2',
|
|
135
|
+
);
|
|
136
|
+
expect(alertDialog).toHaveClass('data-[state=closed]:slide-out-to-top-1/2');
|
|
137
|
+
});
|
|
138
|
+
|
|
122
139
|
test('closes when Cancel button is clicked', async () => {
|
|
123
140
|
const user = userEvent.setup();
|
|
124
141
|
const { getByRole, queryByText } = renderAlertDialog();
|
|
@@ -117,6 +117,20 @@ describe('UiDialog', () => {
|
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
+
test('keeps content centered during open and close animations', async () => {
|
|
121
|
+
const { getByRole } = renderDialog({ open: true });
|
|
122
|
+
|
|
123
|
+
await waitFor(() => {
|
|
124
|
+
expect(getByRole('dialog')).toBeInTheDocument();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const dialog = getByRole('dialog');
|
|
128
|
+
expect(dialog).toHaveClass('data-[state=open]:slide-in-from-left-1/2');
|
|
129
|
+
expect(dialog).toHaveClass('data-[state=open]:slide-in-from-top-1/2');
|
|
130
|
+
expect(dialog).toHaveClass('data-[state=closed]:slide-out-to-left-1/2');
|
|
131
|
+
expect(dialog).toHaveClass('data-[state=closed]:slide-out-to-top-1/2');
|
|
132
|
+
});
|
|
133
|
+
|
|
120
134
|
test('closes when Cancel is clicked', async () => {
|
|
121
135
|
const user = userEvent.setup();
|
|
122
136
|
const { getByRole, queryByText } = renderDialog();
|
|
@@ -41,7 +41,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
41
41
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
42
42
|
:class="
|
|
43
43
|
cn(
|
|
44
|
-
'bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border-surface-default p-6 shadow-lg duration-200',
|
|
44
|
+
'bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 fixed top-[50%] left-[50%] z-50 grid w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border-surface-default p-6 shadow-lg duration-200',
|
|
45
45
|
props.maxWidth ?? 'max-w-none',
|
|
46
46
|
)
|
|
47
47
|
"
|
|
@@ -37,7 +37,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
37
37
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
38
38
|
:class="
|
|
39
39
|
cn(
|
|
40
|
-
'bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border border-border-surface-default p-6 shadow-lg duration-200',
|
|
40
|
+
'bg-background-surface-modal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 fixed top-[50%] left-[50%] z-50 flex w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border border-border-surface-default p-6 shadow-lg duration-200',
|
|
41
41
|
props.maxWidth ?? 'max-w-[50vw]',
|
|
42
42
|
)
|
|
43
43
|
"
|