@uxf/ui 10.0.0-beta.62 → 10.0.0-beta.67
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/alert-bubble/alert-bubble.d.ts +8 -0
- package/alert-bubble/alert-bubble.js +22 -0
- package/alert-bubble/alert-bubble.spec.d.ts +1 -0
- package/alert-bubble/alert-bubble.spec.js +9 -0
- package/alert-bubble/alert-bubble.stories.d.ts +7 -0
- package/alert-bubble/alert-bubble.stories.js +50 -0
- package/alert-bubble/index.d.ts +3 -0
- package/alert-bubble/index.js +5 -0
- package/alert-bubble/theme.d.ts +16 -0
- package/alert-bubble/theme.js +2 -0
- package/button/theme.d.ts +1 -0
- package/config/icons-config.d.ts +1 -1
- package/config/icons-config.js +1 -1
- package/config/icons.d.ts +13 -3
- package/config/icons.js +3 -1
- package/css/alert-bubble.css +100 -0
- package/css/button.css +46 -0
- package/css/dialog.css +55 -0
- package/css/message.css +91 -0
- package/css/modal.css +10 -54
- package/dialog/dialog.d.ts +9 -0
- package/{modal/modal-dialog.js → dialog/dialog.js} +8 -9
- package/dialog/dialog.spec.d.ts +1 -0
- package/dialog/dialog.spec.js +9 -0
- package/dialog/dialog.stories.d.ts +7 -0
- package/dialog/dialog.stories.js +47 -0
- package/dialog/index.d.ts +2 -0
- package/dialog/index.js +5 -0
- package/file-input/file-input.d.ts +1 -0
- package/file-input/file-input.js +4 -4
- package/message/index.d.ts +3 -0
- package/message/index.js +7 -0
- package/message/message-content.d.ts +17 -0
- package/message/message-content.js +41 -0
- package/message/message-service.d.ts +13 -0
- package/message/message-service.js +29 -0
- package/message/message.d.ts +19 -0
- package/message/message.js +47 -0
- package/message/message.spec.d.ts +1 -0
- package/message/message.spec.js +9 -0
- package/message/message.stories.d.ts +7 -0
- package/message/message.stories.js +82 -0
- package/message/theme.d.ts +12 -0
- package/message/theme.js +2 -0
- package/modal/index.d.ts +2 -1
- package/modal/index.js +3 -3
- package/modal/modal.d.ts +5 -4
- package/modal/modal.js +9 -9
- package/modal/modal.stories.js +12 -0
- package/modal/theme.d.ts +3 -0
- package/multi-combobox/_multi-combobox-base.js +8 -2
- package/multi-combobox/types.d.ts +4 -0
- package/package.json +1 -1
- package/utils/icons-config.js +13 -3
- package/utils/storybook-config.d.ts +11 -1
- package/utils/storybook-config.js +9 -1
- package/utils/tailwind-config.js +8 -0
- package/modal/modal-dialog.d.ts +0 -11
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { AlertBubbleColor, AlertBubbleSize } from "./theme";
|
|
3
|
+
export interface AlertBubbleProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
color?: AlertBubbleColor;
|
|
6
|
+
size?: AlertBubbleSize;
|
|
7
|
+
}
|
|
8
|
+
export declare const AlertBubble: FC<AlertBubbleProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AlertBubble = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const icon_1 = require("../icon");
|
|
9
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
|
+
const ICON = {
|
|
11
|
+
default: "triangle-exclamation",
|
|
12
|
+
error: "xmark",
|
|
13
|
+
warning: "triangle-exclamation",
|
|
14
|
+
success: "check",
|
|
15
|
+
};
|
|
16
|
+
const AlertBubble = (props) => {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
return (react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-alert-bubble", `uxf-alert-bubble--color-${(_a = props.color) !== null && _a !== void 0 ? _a : "default"}`, `uxf-alert-bubble--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.className) },
|
|
19
|
+
react_1.default.createElement(icon_1.Icon, { className: "uxf-alert-bubble__icon", name: ICON[(_c = props.color) !== null && _c !== void 0 ? _c : "default"] })));
|
|
20
|
+
};
|
|
21
|
+
exports.AlertBubble = AlertBubble;
|
|
22
|
+
exports.AlertBubble.displayName = "UxfUiAlertBubble";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const snap_test_1 = require("../utils/snap-test");
|
|
7
|
+
const alert_bubble_stories_1 = require("./alert-bubble.stories");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
(0, snap_test_1.snapTest)("render stories", react_1.default.createElement(alert_bubble_stories_1.Default, null));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Default = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const storybook_config_1 = require("../utils/storybook-config");
|
|
29
|
+
const alert_bubble_1 = require("./alert-bubble");
|
|
30
|
+
exports.default = {
|
|
31
|
+
title: "UI/AlertBubble",
|
|
32
|
+
component: alert_bubble_1.AlertBubble,
|
|
33
|
+
};
|
|
34
|
+
function Default() {
|
|
35
|
+
const config = (0, storybook_config_1.useStorybookConfig)("AlertBubble");
|
|
36
|
+
const storyAlertBubbles = config.colors.map((color) => (react_1.default.createElement(react_1.Fragment, { key: color }, config.sizes.map((size) => (react_1.default.createElement("div", { key: `${size}${color}`, className: "space-y-2 pb-4" },
|
|
37
|
+
react_1.default.createElement("div", { className: "text-sm dark:text-gray-100" },
|
|
38
|
+
"Color: ",
|
|
39
|
+
react_1.default.createElement("span", { className: "font-semibold" }, color),
|
|
40
|
+
", Size:",
|
|
41
|
+
" ",
|
|
42
|
+
react_1.default.createElement("span", { className: "font-semibold" }, size)),
|
|
43
|
+
react_1.default.createElement("div", { className: "flex flex-row items-start gap-2" },
|
|
44
|
+
react_1.default.createElement(alert_bubble_1.AlertBubble, { color: color, size: size })),
|
|
45
|
+
react_1.default.createElement("hr", null)))))));
|
|
46
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
47
|
+
react_1.default.createElement("div", { className: "light space-y-2 p-20" }, storyAlertBubbles),
|
|
48
|
+
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20" }, storyAlertBubbles)));
|
|
49
|
+
}
|
|
50
|
+
exports.Default = Default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertBubble = void 0;
|
|
4
|
+
var alert_bubble_1 = require("./alert-bubble");
|
|
5
|
+
Object.defineProperty(exports, "AlertBubble", { enumerable: true, get: function () { return alert_bubble_1.AlertBubble; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AlertBubbleColors {
|
|
2
|
+
default: true;
|
|
3
|
+
success: true;
|
|
4
|
+
error: true;
|
|
5
|
+
warning: true;
|
|
6
|
+
}
|
|
7
|
+
export type AlertBubbleColor = keyof AlertBubbleColors;
|
|
8
|
+
export interface AlertBubbleSizes {
|
|
9
|
+
xs: true;
|
|
10
|
+
sm: true;
|
|
11
|
+
default: true;
|
|
12
|
+
lg: true;
|
|
13
|
+
xl: true;
|
|
14
|
+
"2xl": true;
|
|
15
|
+
}
|
|
16
|
+
export type AlertBubbleSize = keyof AlertBubbleSizes;
|
package/button/theme.d.ts
CHANGED
package/config/icons-config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ICONS_VERSION = "
|
|
1
|
+
export declare const ICONS_VERSION = "1687765245583";
|
|
2
2
|
export declare const ICON_SPRITE = "/.storybook/static-assets/icons-generated/_icon-sprite.svg";
|
package/config/icons-config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ICON_SPRITE = exports.ICONS_VERSION = void 0;
|
|
4
|
-
exports.ICONS_VERSION = "
|
|
4
|
+
exports.ICONS_VERSION = "1687765245583";
|
|
5
5
|
exports.ICON_SPRITE = "/.storybook/static-assets/icons-generated/_icon-sprite.svg";
|
package/config/icons.d.ts
CHANGED
|
@@ -75,14 +75,22 @@ export declare const ICONS: {
|
|
|
75
75
|
readonly w: 384;
|
|
76
76
|
readonly h: 512;
|
|
77
77
|
};
|
|
78
|
-
readonly
|
|
79
|
-
readonly w:
|
|
78
|
+
readonly "triangle-exclamation": {
|
|
79
|
+
readonly w: 512;
|
|
80
80
|
readonly h: 512;
|
|
81
81
|
};
|
|
82
82
|
readonly user: {
|
|
83
83
|
readonly w: 448;
|
|
84
84
|
readonly h: 512;
|
|
85
85
|
};
|
|
86
|
+
readonly videoFile: {
|
|
87
|
+
readonly w: 384;
|
|
88
|
+
readonly h: 512;
|
|
89
|
+
};
|
|
90
|
+
readonly xmark: {
|
|
91
|
+
readonly w: 384;
|
|
92
|
+
readonly h: 512;
|
|
93
|
+
};
|
|
86
94
|
readonly xmarkLarge: {
|
|
87
95
|
readonly w: 448;
|
|
88
96
|
readonly h: 512;
|
|
@@ -110,8 +118,10 @@ declare module "@uxf/ui/icon/theme" {
|
|
|
110
118
|
"ellipsis-vertical": true;
|
|
111
119
|
"file": true;
|
|
112
120
|
"imageFile": true;
|
|
113
|
-
"
|
|
121
|
+
"triangle-exclamation": true;
|
|
114
122
|
"user": true;
|
|
123
|
+
"videoFile": true;
|
|
124
|
+
"xmark": true;
|
|
115
125
|
"xmarkLarge": true;
|
|
116
126
|
}
|
|
117
127
|
}
|
package/config/icons.js
CHANGED
|
@@ -22,7 +22,9 @@ exports.ICONS = {
|
|
|
22
22
|
"ellipsis-vertical": { w: 128, h: 512 },
|
|
23
23
|
"file": { w: 384, h: 512 },
|
|
24
24
|
"imageFile": { w: 384, h: 512 },
|
|
25
|
-
"
|
|
25
|
+
"triangle-exclamation": { w: 512, h: 512 },
|
|
26
26
|
"user": { w: 448, h: 512 },
|
|
27
|
+
"videoFile": { w: 384, h: 512 },
|
|
28
|
+
"xmark": { w: 384, h: 512 },
|
|
27
29
|
"xmarkLarge": { w: 448, h: 512 },
|
|
28
30
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
.uxf-alert-bubble {
|
|
2
|
+
--bg-color: unset;
|
|
3
|
+
--icon-color: unset;
|
|
4
|
+
--icon-size: unset;
|
|
5
|
+
--size: unset;
|
|
6
|
+
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: var(--bg-color);
|
|
9
|
+
border-radius: 999px;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
height: var(--size);
|
|
13
|
+
justify-content: center;
|
|
14
|
+
width: var(--size);
|
|
15
|
+
|
|
16
|
+
&__icon {
|
|
17
|
+
color: var(--icon-color);
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
height: var(--icon-size);
|
|
20
|
+
width: var(--icon-size);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--color-default {
|
|
24
|
+
:root .light & {
|
|
25
|
+
--bg-color: theme("backgroundColor.primary.100");
|
|
26
|
+
--icon-color: theme("colors.primary.600");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:root .dark & {
|
|
30
|
+
--bg-color: theme("backgroundColor.primary.600");
|
|
31
|
+
--icon-color: theme("colors.primary.100");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--color-warning {
|
|
36
|
+
:root .light & {
|
|
37
|
+
--bg-color: theme("backgroundColor.warning.100");
|
|
38
|
+
--icon-color: theme("colors.warning.600");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:root .dark & {
|
|
42
|
+
--bg-color: theme("backgroundColor.warning.600");
|
|
43
|
+
--icon-color: theme("colors.warning.100");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--color-success {
|
|
48
|
+
:root .light & {
|
|
49
|
+
--bg-color: theme("backgroundColor.success.100");
|
|
50
|
+
--icon-color: theme("colors.success.600");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:root .dark & {
|
|
54
|
+
--bg-color: theme("backgroundColor.success.600");
|
|
55
|
+
--icon-color: theme("colors.success.100");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--color-error {
|
|
60
|
+
:root .light & {
|
|
61
|
+
--bg-color: theme("backgroundColor.error.100");
|
|
62
|
+
--icon-color: theme("colors.error.600");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:root .dark & {
|
|
66
|
+
--bg-color: theme("backgroundColor.error.600");
|
|
67
|
+
--icon-color: theme("colors.error.100");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&--size-xs {
|
|
72
|
+
--size: theme("alertBubbleSize.xs");
|
|
73
|
+
--icon-size: 20px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--size-sm {
|
|
77
|
+
--size: theme("alertBubbleSize.sm");
|
|
78
|
+
--icon-size: 24px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&--size-default {
|
|
82
|
+
--size: theme("alertBubbleSize.default");
|
|
83
|
+
--icon-size: 24px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&--size-lg {
|
|
87
|
+
--size: theme("alertBubbleSize.lg");
|
|
88
|
+
--icon-size: 30px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&--size-xl {
|
|
92
|
+
--size: theme("alertBubbleSize.xl");
|
|
93
|
+
--icon-size: 30px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--size-2xl {
|
|
97
|
+
--size: theme("alertBubbleSize.2xl");
|
|
98
|
+
--icon-size: 40px;
|
|
99
|
+
}
|
|
100
|
+
}
|
package/css/button.css
CHANGED
|
@@ -166,6 +166,18 @@
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
&.uxf-button--color-warning {
|
|
170
|
+
@apply focus-visible:ring-warning;
|
|
171
|
+
|
|
172
|
+
:root .light & {
|
|
173
|
+
@apply border-warning text-warning is-hoverable:border-warning-700 is-hoverable:text-warning-700;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:root .dark & {
|
|
177
|
+
@apply border-warning text-warning is-hoverable:border-warning-300 is-hoverable:text-warning-300;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
169
181
|
&.uxf-button--color-error {
|
|
170
182
|
@apply focus-visible:ring-error;
|
|
171
183
|
|
|
@@ -261,6 +273,28 @@
|
|
|
261
273
|
}
|
|
262
274
|
}
|
|
263
275
|
}
|
|
276
|
+
|
|
277
|
+
&.uxf-button--color-warning {
|
|
278
|
+
@apply focus-visible:ring-warning;
|
|
279
|
+
|
|
280
|
+
:root .light & {
|
|
281
|
+
@apply bg-warning is-hoverable:bg-warning-700;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
:root .dark & {
|
|
285
|
+
@apply bg-warning is-hoverable:bg-warning-400;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&.is-disabled {
|
|
289
|
+
:root .light & {
|
|
290
|
+
@apply bg-gray-300 text-lightLow;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
:root .dark & {
|
|
294
|
+
@apply bg-gray-600 text-gray-400;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
264
298
|
}
|
|
265
299
|
|
|
266
300
|
&--variant-white {
|
|
@@ -322,6 +356,18 @@
|
|
|
322
356
|
}
|
|
323
357
|
}
|
|
324
358
|
|
|
359
|
+
&.uxf-button--color-warning {
|
|
360
|
+
@apply text-warning;
|
|
361
|
+
|
|
362
|
+
:root .light & {
|
|
363
|
+
@apply is-hoverable:text-warning-700;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
:root .dark & {
|
|
367
|
+
@apply is-hoverable:text-warning-300;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
325
371
|
&.is-disabled {
|
|
326
372
|
:root .light & {
|
|
327
373
|
@apply text-lightLow;
|
package/css/dialog.css
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.uxf-dialog {
|
|
2
|
+
--panel-max-w: unset;
|
|
3
|
+
--panel-border-radius: theme("borderRadius.2xl");
|
|
4
|
+
|
|
5
|
+
position: relative;
|
|
6
|
+
z-index: theme("zIndex.modal");
|
|
7
|
+
|
|
8
|
+
&__backdrop {
|
|
9
|
+
background-color: rgb(0 0 0 / 75%);
|
|
10
|
+
inset: 0;
|
|
11
|
+
position: fixed;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__wrapper {
|
|
15
|
+
inset: 0;
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
position: fixed;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&__body {
|
|
21
|
+
align-items: flex-end;
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
min-height: 100%;
|
|
25
|
+
padding-top: theme("spacing.8");
|
|
26
|
+
|
|
27
|
+
@screen sm {
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding: theme("spacing.4");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__panel {
|
|
34
|
+
border-top-left-radius: var(--panel-border-radius);
|
|
35
|
+
border-top-right-radius: var(--panel-border-radius);
|
|
36
|
+
max-width: var(--panel-max-w);
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
position: relative;
|
|
39
|
+
width: 100%;
|
|
40
|
+
|
|
41
|
+
:root .light & {
|
|
42
|
+
background-color: theme("colors.white");
|
|
43
|
+
color: theme("colors.black");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:root .dark & {
|
|
47
|
+
background-color: theme("colors.gray.900");
|
|
48
|
+
color: theme("colors.white");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@screen sm {
|
|
52
|
+
border-radius: var(--panel-border-radius);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
package/css/message.css
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
.uxf-message {
|
|
2
|
+
--color: unset;
|
|
3
|
+
|
|
4
|
+
&__title {
|
|
5
|
+
@apply uxf-typo-h6;
|
|
6
|
+
|
|
7
|
+
:root .dark & {
|
|
8
|
+
color: theme("colors.white");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__description {
|
|
13
|
+
@apply uxf-typo-body2;
|
|
14
|
+
|
|
15
|
+
margin-top: theme("spacing.2");
|
|
16
|
+
|
|
17
|
+
:root .light & {
|
|
18
|
+
color: theme("colors.lightMedium");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:root .dark & {
|
|
22
|
+
color: theme("colors.white");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&--variant-centered {
|
|
27
|
+
--panel-max-w: 360px;
|
|
28
|
+
|
|
29
|
+
.uxf-message__content-wrapper {
|
|
30
|
+
align-items: center;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
padding: theme("spacing.6");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.uxf-message__icon-wrapper {
|
|
37
|
+
margin-bottom: theme("spacing.6");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.uxf-message__text-content {
|
|
41
|
+
text-align: center;
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.uxf-message__buttons-wrapper {
|
|
46
|
+
@apply space-x-2;
|
|
47
|
+
|
|
48
|
+
align-items: center;
|
|
49
|
+
display: flex;
|
|
50
|
+
padding: 0 theme("spacing.6") theme("spacing.6");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&--variant-simple {
|
|
55
|
+
--panel-max-w: 320px;
|
|
56
|
+
|
|
57
|
+
.uxf-message__content-wrapper {
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: flex-start;
|
|
60
|
+
justify-items: center;
|
|
61
|
+
padding: theme("spacing.4");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.uxf-message__icon-wrapper {
|
|
65
|
+
margin-right: theme("spacing.3");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.uxf-message__text-content {
|
|
69
|
+
flex-grow: 1;
|
|
70
|
+
padding-top: theme("spacing.1");
|
|
71
|
+
text-align: left;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.uxf-message__buttons-wrapper {
|
|
75
|
+
@apply space-x-2;
|
|
76
|
+
|
|
77
|
+
align-items: center;
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: flex-end;
|
|
80
|
+
padding: theme("spacing.3") theme("spacing.4");
|
|
81
|
+
|
|
82
|
+
:root .light & {
|
|
83
|
+
background: theme("backgroundColor.gray.50");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:root .dark & {
|
|
87
|
+
background: theme("backgroundColor.lightHigh");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
package/css/modal.css
CHANGED
|
@@ -1,65 +1,21 @@
|
|
|
1
1
|
.uxf-modal {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
&__backdrop {
|
|
6
|
-
@apply inset-0;
|
|
7
|
-
|
|
8
|
-
background-color: rgb(0 0 0 / 75%);
|
|
9
|
-
position: fixed;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&__wrapper {
|
|
13
|
-
@apply inset-0;
|
|
14
|
-
|
|
15
|
-
overflow-y: auto;
|
|
16
|
-
position: fixed;
|
|
2
|
+
&--width-xs {
|
|
3
|
+
--panel-max-w: theme("maxWidth.xs");
|
|
17
4
|
}
|
|
18
5
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
min-height: 100%;
|
|
24
|
-
padding-top: theme("spacing.8");
|
|
25
|
-
|
|
26
|
-
@screen sm {
|
|
27
|
-
align-items: center;
|
|
28
|
-
padding: theme("spacing.4");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&__panel {
|
|
33
|
-
border-top-left-radius: theme("borderRadius.2xl");
|
|
34
|
-
border-top-right-radius: theme("borderRadius.2xl");
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
position: relative;
|
|
37
|
-
width: 100%;
|
|
38
|
-
|
|
39
|
-
:root .light & {
|
|
40
|
-
background-color: theme("colors.white");
|
|
41
|
-
color: theme("colors.black");
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
:root .dark & {
|
|
45
|
-
background-color: theme("colors.gray.900");
|
|
46
|
-
color: theme("colors.white");
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@screen sm {
|
|
50
|
-
border-radius: theme("borderRadius.2xl");
|
|
51
|
-
}
|
|
6
|
+
&--width-sm {
|
|
7
|
+
--panel-max-w: theme("maxWidth.sm");
|
|
52
8
|
}
|
|
53
9
|
|
|
54
|
-
&--width-
|
|
55
|
-
max-
|
|
10
|
+
&--width-default {
|
|
11
|
+
--panel-max-w: theme("maxWidth.lg");
|
|
56
12
|
}
|
|
57
13
|
|
|
58
|
-
&--width-
|
|
59
|
-
max-
|
|
14
|
+
&--width-lg {
|
|
15
|
+
--panel-max-w: theme("maxWidth.3xl");
|
|
60
16
|
}
|
|
61
17
|
|
|
62
|
-
&--width-
|
|
63
|
-
max-
|
|
18
|
+
&--width-xl {
|
|
19
|
+
--panel-max-w: theme("maxWidth.5xl");
|
|
64
20
|
}
|
|
65
21
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface DialogProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
disableBackdropClose?: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
open: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const Dialog: React.NamedExoticComponent<DialogProps>;
|
|
@@ -23,16 +23,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.Dialog = void 0;
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
29
28
|
const react_2 = __importStar(require("react"));
|
|
30
|
-
exports.
|
|
29
|
+
exports.Dialog = (0, react_2.memo)((props) => {
|
|
31
30
|
var _a;
|
|
32
|
-
return (react_2.default.createElement(react_1.Dialog, { className:
|
|
33
|
-
react_2.default.createElement(react_1.Dialog.Overlay, { className: "uxf-
|
|
34
|
-
react_2.default.createElement("div", { className: "uxf-
|
|
35
|
-
react_2.default.createElement("div", { className: "uxf-
|
|
36
|
-
react_2.default.createElement(react_1.Dialog.Panel, { className: "uxf-
|
|
31
|
+
return (react_2.default.createElement(react_1.Dialog, { className: `uxf-dialog ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, open: props.open, onClose: props.disableBackdropClose ? () => null : props.onClose },
|
|
32
|
+
react_2.default.createElement(react_1.Dialog.Overlay, { className: "uxf-dialog__backdrop" }),
|
|
33
|
+
react_2.default.createElement("div", { className: "uxf-dialog__wrapper" },
|
|
34
|
+
react_2.default.createElement("div", { className: "uxf-dialog__body" },
|
|
35
|
+
react_2.default.createElement(react_1.Dialog.Panel, { className: "uxf-dialog__panel" }, props.children)))));
|
|
37
36
|
});
|
|
38
|
-
exports.
|
|
37
|
+
exports.Dialog.displayName = "UxfUiDialog";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const snap_test_1 = require("../utils/snap-test");
|
|
8
|
+
const dialog_stories_1 = require("./dialog.stories");
|
|
9
|
+
(0, snap_test_1.snapTest)("render stories", react_1.default.createElement(dialog_stories_1.Default, null));
|