mcr-design-systems 1.0.45 → 1.0.48
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/README.md +127 -0
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.js +32 -34
- package/dist/components/InputBase/index.d.ts +1 -0
- package/dist/components/InputBase/index.js +22 -20
- package/dist/components/InputBase/variants.d.ts +12 -0
- package/dist/components/InputBase/variants.js +15 -0
- package/dist/components/Modal/index.js +32 -30
- package/dist/components/Sidebar/helper/variants.js +1 -1
- package/dist/components/TextField/HelperText.js +27 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,6 +93,133 @@ To check for code quality issues:
|
|
|
93
93
|
yarn lint
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
## Publishing to NPM
|
|
97
|
+
|
|
98
|
+
This project includes an automated publishing script that handles version management, building, and publishing to npm.
|
|
99
|
+
|
|
100
|
+
### Prerequisites for Publishing
|
|
101
|
+
|
|
102
|
+
Before using the publishing script, ensure you have:
|
|
103
|
+
|
|
104
|
+
1. **NPM Authentication**: You must be logged into npm with publishing rights
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm login
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
2. **Clean Working Directory**: All changes must be committed to git
|
|
111
|
+
|
|
112
|
+
3. **Correct Branch**: Should be on `main` or `master` branch (script will warn if not)
|
|
113
|
+
|
|
114
|
+
4. **Node.js and npm**: Must be installed and working
|
|
115
|
+
|
|
116
|
+
5. **Git Repository**: Must be initialized and connected to a remote
|
|
117
|
+
|
|
118
|
+
### Using the Publishing Script
|
|
119
|
+
|
|
120
|
+
The `publish.sh` script automates the entire publishing process:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Increment patch version (1.0.0 → 1.0.1) - Default
|
|
124
|
+
./publish.sh
|
|
125
|
+
|
|
126
|
+
# Increment minor version (1.0.0 → 1.1.0)
|
|
127
|
+
./publish.sh minor
|
|
128
|
+
|
|
129
|
+
# Increment major version (1.0.0 → 2.0.0)
|
|
130
|
+
./publish.sh major
|
|
131
|
+
|
|
132
|
+
# Set specific version
|
|
133
|
+
./publish.sh 1.5.0
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### What the Script Does
|
|
137
|
+
|
|
138
|
+
The publishing script performs these steps automatically:
|
|
139
|
+
|
|
140
|
+
1. **Safety Checks**:
|
|
141
|
+
- Verifies npm authentication
|
|
142
|
+
- Checks for clean working directory
|
|
143
|
+
- Confirms you're on the correct branch
|
|
144
|
+
- Validates all dependencies are installed
|
|
145
|
+
|
|
146
|
+
2. **Quality Assurance**:
|
|
147
|
+
- Runs linting (if available)
|
|
148
|
+
- Builds the library (`yarn build-lib`)
|
|
149
|
+
- Ensures build completes successfully
|
|
150
|
+
|
|
151
|
+
3. **Version Management**:
|
|
152
|
+
- Increments version in `package.json`
|
|
153
|
+
- Shows current → new version for confirmation
|
|
154
|
+
|
|
155
|
+
4. **Git Operations**:
|
|
156
|
+
- Commits version changes with standard message
|
|
157
|
+
- Creates git tag with new version
|
|
158
|
+
- Pushes changes and tags to remote repository
|
|
159
|
+
|
|
160
|
+
5. **NPM Publishing**:
|
|
161
|
+
- Publishes package to npm registry
|
|
162
|
+
- Shows success confirmation with package URL
|
|
163
|
+
|
|
164
|
+
### Manual Publishing (Alternative)
|
|
165
|
+
|
|
166
|
+
If you prefer to publish manually:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# 1. Build the library
|
|
170
|
+
yarn build-lib
|
|
171
|
+
|
|
172
|
+
# 2. Increment version
|
|
173
|
+
npm version patch # or minor/major
|
|
174
|
+
|
|
175
|
+
# 3. Commit and tag (if not done by npm version)
|
|
176
|
+
git push origin main --tags
|
|
177
|
+
|
|
178
|
+
# 4. Publish to npm
|
|
179
|
+
npm publish
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Publishing Best Practices
|
|
183
|
+
|
|
184
|
+
- **Test thoroughly** before publishing
|
|
185
|
+
- **Use semantic versioning**:
|
|
186
|
+
- `patch`: Bug fixes (1.0.0 → 1.0.1)
|
|
187
|
+
- `minor`: New features, backward compatible (1.0.0 → 1.1.0)
|
|
188
|
+
- `major`: Breaking changes (1.0.0 → 2.0.0)
|
|
189
|
+
- **Write clear commit messages**
|
|
190
|
+
- **Update documentation** when adding new features
|
|
191
|
+
- **Announce releases** to your team
|
|
192
|
+
|
|
193
|
+
### Troubleshooting Publishing
|
|
194
|
+
|
|
195
|
+
**"Not logged into npm"**:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
npm login
|
|
199
|
+
npm whoami # Verify login
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**"Working directory not clean"**:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
git status # Check what files are modified
|
|
206
|
+
git add . # Stage changes
|
|
207
|
+
git commit -m "..." # Commit changes
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**"Publishing failed"**:
|
|
211
|
+
|
|
212
|
+
- Check if version already exists on npm
|
|
213
|
+
- Verify package name is available
|
|
214
|
+
- Ensure you have publishing rights
|
|
215
|
+
- Check npm registry status
|
|
216
|
+
|
|
217
|
+
**Script permission denied**:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
chmod +x publish.sh
|
|
221
|
+
```
|
|
222
|
+
|
|
96
223
|
## Library Usage
|
|
97
224
|
|
|
98
225
|
### Installation
|
|
@@ -74,4 +74,4 @@ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, Variant
|
|
|
74
74
|
* </Card>
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
|
-
export default function Card({ variant, title, titleIcon, actionButton, actionIcon, children, className, showHeader, headerGap, contentPadding, contentGap, width,
|
|
77
|
+
export default function Card({ variant, title, titleIcon, actionButton, actionIcon, children, className, showHeader, headerGap, contentPadding, contentGap, width, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cardHeaderTitleVariants as
|
|
3
|
+
import { cardHeaderTitleVariants as v, cardHeaderActionVariants as u, cardHeaderVariants as N, cardContentVariants as y, cardVariants as V } from "./helper/variants.js";
|
|
4
4
|
import { cn as n } from "../../shared/utils/cn.js";
|
|
5
|
-
import { dataTestId as
|
|
6
|
-
import { Typography as
|
|
7
|
-
function
|
|
8
|
-
variant:
|
|
5
|
+
import { dataTestId as k } from "../../shared/utils/dataTestId.js";
|
|
6
|
+
import { Typography as b } from "../Typography/index.js";
|
|
7
|
+
function z({
|
|
8
|
+
variant: f = "default",
|
|
9
9
|
title: a,
|
|
10
10
|
titleIcon: e,
|
|
11
|
-
actionButton:
|
|
11
|
+
actionButton: m,
|
|
12
12
|
actionIcon: s,
|
|
13
|
-
children:
|
|
14
|
-
className:
|
|
15
|
-
showHeader:
|
|
16
|
-
headerGap:
|
|
17
|
-
contentPadding:
|
|
18
|
-
contentGap:
|
|
13
|
+
children: l,
|
|
14
|
+
className: t,
|
|
15
|
+
showHeader: p = !0,
|
|
16
|
+
headerGap: c = "xs",
|
|
17
|
+
contentPadding: x = "md",
|
|
18
|
+
contentGap: o = "md",
|
|
19
19
|
width: d,
|
|
20
|
-
|
|
21
|
-
...v
|
|
20
|
+
...g
|
|
22
21
|
}) {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
22
|
+
const h = d ? { width: typeof d == "number" ? `${d}px` : d } : {};
|
|
23
|
+
return /* @__PURE__ */ i(
|
|
25
24
|
"div",
|
|
26
25
|
{
|
|
27
|
-
className: n(
|
|
28
|
-
style:
|
|
29
|
-
...
|
|
30
|
-
...
|
|
26
|
+
className: n(V({ variant: f }), t),
|
|
27
|
+
style: h,
|
|
28
|
+
...k("Card"),
|
|
29
|
+
...g,
|
|
31
30
|
children: [
|
|
32
|
-
|
|
31
|
+
p && (a || e || m || s) && /* @__PURE__ */ i(
|
|
33
32
|
"div",
|
|
34
33
|
{
|
|
35
|
-
className: n(
|
|
36
|
-
style: h,
|
|
34
|
+
className: n(N({ gap: c }), t),
|
|
37
35
|
children: [
|
|
38
|
-
(a || e) && /* @__PURE__ */ r("div", { className:
|
|
36
|
+
(a || e) && /* @__PURE__ */ r("div", { className: v(), children: /* @__PURE__ */ i("div", { className: "flex items-center gap-xs", children: [
|
|
39
37
|
e && /* @__PURE__ */ r("div", { className: "flex-shrink-0 text-fg-neutral-main", children: e }),
|
|
40
38
|
a && /* @__PURE__ */ r(
|
|
41
|
-
|
|
39
|
+
b,
|
|
42
40
|
{
|
|
43
41
|
variants: "heading-xs",
|
|
44
42
|
size: "xs",
|
|
@@ -47,22 +45,22 @@ function A({
|
|
|
47
45
|
}
|
|
48
46
|
)
|
|
49
47
|
] }) }),
|
|
50
|
-
(
|
|
51
|
-
|
|
48
|
+
(m || s) && /* @__PURE__ */ i("div", { className: u({ gap: "xs" }), children: [
|
|
49
|
+
m,
|
|
52
50
|
s && /* @__PURE__ */ r("div", { className: "flex-shrink-0 text-fg-neutral-main", children: s })
|
|
53
51
|
] })
|
|
54
52
|
]
|
|
55
53
|
}
|
|
56
54
|
),
|
|
57
|
-
|
|
55
|
+
l && /* @__PURE__ */ r(
|
|
58
56
|
"div",
|
|
59
57
|
{
|
|
60
|
-
className:
|
|
61
|
-
padding:
|
|
62
|
-
gap:
|
|
58
|
+
className: y({
|
|
59
|
+
padding: x,
|
|
60
|
+
gap: o
|
|
63
61
|
}),
|
|
64
62
|
style: { wordWrap: "break-word", overflowWrap: "break-word" },
|
|
65
|
-
children:
|
|
63
|
+
children: l
|
|
66
64
|
}
|
|
67
65
|
)
|
|
68
66
|
]
|
|
@@ -70,5 +68,5 @@ function A({
|
|
|
70
68
|
);
|
|
71
69
|
}
|
|
72
70
|
export {
|
|
73
|
-
|
|
71
|
+
z as default
|
|
74
72
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as I, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import c, { forwardRef as
|
|
3
|
-
import { inputBaseVariants as
|
|
4
|
-
import
|
|
2
|
+
import c, { forwardRef as H, useState as R, useMemo as B, useEffect as _, memo as F } from "react";
|
|
3
|
+
import { inputBaseVariants as K, textAreaVariants as W } from "./variants.js";
|
|
4
|
+
import q from "../Icon/Icon.js";
|
|
5
5
|
import { cn as f } from "../../shared/utils/cn.js";
|
|
6
|
-
import { dataTestId as
|
|
7
|
-
const
|
|
6
|
+
import { dataTestId as A } from "../../shared/utils/dataTestId.js";
|
|
7
|
+
const G = (t) => {
|
|
8
8
|
switch (t) {
|
|
9
9
|
case "sm":
|
|
10
10
|
return 16;
|
|
@@ -15,7 +15,7 @@ const A = (t) => {
|
|
|
15
15
|
default:
|
|
16
16
|
return 20;
|
|
17
17
|
}
|
|
18
|
-
}, N =
|
|
18
|
+
}, N = H(
|
|
19
19
|
({
|
|
20
20
|
disabled: t,
|
|
21
21
|
readOnly: s,
|
|
@@ -32,17 +32,18 @@ const A = (t) => {
|
|
|
32
32
|
error: j,
|
|
33
33
|
clearText: D,
|
|
34
34
|
optionalProps: h,
|
|
35
|
+
focus: M,
|
|
35
36
|
// inputSize,
|
|
36
37
|
...e
|
|
37
|
-
},
|
|
38
|
-
const [
|
|
38
|
+
}, k) => {
|
|
39
|
+
const [L, g] = R(!1), m = S || G(v), p = B(
|
|
39
40
|
() => `inputbase-input-${Math.random().toString(36).substring(2, 9)}`,
|
|
40
41
|
[]
|
|
41
42
|
), d = B(
|
|
42
43
|
() => `inputbase-textarea-${Math.random().toString(36).substring(2, 9)}`,
|
|
43
44
|
[]
|
|
44
45
|
);
|
|
45
|
-
|
|
46
|
+
_(() => {
|
|
46
47
|
const n = e.value;
|
|
47
48
|
if (n !== void 0) {
|
|
48
49
|
g(String(n).length > 0);
|
|
@@ -67,8 +68,8 @@ const A = (t) => {
|
|
|
67
68
|
}
|
|
68
69
|
return l;
|
|
69
70
|
}, [e.type, e.value, p, d]);
|
|
70
|
-
const E = D &&
|
|
71
|
-
|
|
71
|
+
const E = D && L ? /* @__PURE__ */ o(
|
|
72
|
+
q,
|
|
72
73
|
{
|
|
73
74
|
name: "x-circle",
|
|
74
75
|
variant: "solid",
|
|
@@ -105,7 +106,7 @@ const A = (t) => {
|
|
|
105
106
|
size: m
|
|
106
107
|
}
|
|
107
108
|
) : u
|
|
108
|
-
] }) : E || u,
|
|
109
|
+
] }) : E || u, $ = {
|
|
109
110
|
sm: "h-4",
|
|
110
111
|
md: "h-5",
|
|
111
112
|
lg: "h-6"
|
|
@@ -113,16 +114,17 @@ const A = (t) => {
|
|
|
113
114
|
return /* @__PURE__ */ o("div", { className: "relative justify-center items-center", children: /* @__PURE__ */ I(
|
|
114
115
|
"div",
|
|
115
116
|
{
|
|
116
|
-
...
|
|
117
|
+
...A("InputBase"),
|
|
117
118
|
ref: z,
|
|
118
119
|
...V,
|
|
119
|
-
className:
|
|
120
|
+
className: K({
|
|
120
121
|
disabled: !!t,
|
|
121
122
|
className: w,
|
|
122
123
|
color: T,
|
|
123
124
|
size: e?.type === "textarea" ? void 0 : v,
|
|
124
125
|
readOnly: !!s,
|
|
125
|
-
error: !!j
|
|
126
|
+
error: !!j,
|
|
127
|
+
focus: !!M
|
|
126
128
|
}),
|
|
127
129
|
style: { minWidth: C ?? "100%" },
|
|
128
130
|
children: [
|
|
@@ -144,7 +146,7 @@ const A = (t) => {
|
|
|
144
146
|
{
|
|
145
147
|
id: e?.type === "textarea" ? d : void 0,
|
|
146
148
|
className: f(
|
|
147
|
-
e?.type === "textarea" ?
|
|
149
|
+
e?.type === "textarea" ? W({
|
|
148
150
|
size: h?.sizeTextArea,
|
|
149
151
|
disabled: !!t,
|
|
150
152
|
readOnly: !!s
|
|
@@ -162,9 +164,9 @@ const A = (t) => {
|
|
|
162
164
|
id: e.type === "textarea" ? void 0 : p,
|
|
163
165
|
className: f(
|
|
164
166
|
"w-full appearance-none bg-transparent font-sans outline-none text-fg-neutral-main",
|
|
165
|
-
|
|
167
|
+
$[v || "md"]
|
|
166
168
|
),
|
|
167
|
-
ref:
|
|
169
|
+
ref: k,
|
|
168
170
|
disabled: t || s,
|
|
169
171
|
...e,
|
|
170
172
|
onKeyDown: (n) => {
|
|
@@ -194,7 +196,7 @@ const A = (t) => {
|
|
|
194
196
|
}
|
|
195
197
|
);
|
|
196
198
|
N.displayName = "InputBase";
|
|
197
|
-
const
|
|
199
|
+
const O = F(N);
|
|
198
200
|
export {
|
|
199
|
-
|
|
201
|
+
O as default
|
|
200
202
|
};
|
|
@@ -17,6 +17,10 @@ export declare const inputBaseVariants: import('tailwind-variants').TVReturnType
|
|
|
17
17
|
primary: string;
|
|
18
18
|
error: string;
|
|
19
19
|
};
|
|
20
|
+
focus: {
|
|
21
|
+
true: string;
|
|
22
|
+
false: string;
|
|
23
|
+
};
|
|
20
24
|
}, undefined, "text-fg-neutral-main placeholder:text-fg-neutral-subtlest flex items-center gap-1 rounded-lg tracking-p-medium outline-1 focus-within:border-input-active focus-within:outline-2 font-primary", {
|
|
21
25
|
size: {
|
|
22
26
|
sm: string;
|
|
@@ -36,6 +40,10 @@ export declare const inputBaseVariants: import('tailwind-variants').TVReturnType
|
|
|
36
40
|
primary: string;
|
|
37
41
|
error: string;
|
|
38
42
|
};
|
|
43
|
+
focus: {
|
|
44
|
+
true: string;
|
|
45
|
+
false: string;
|
|
46
|
+
};
|
|
39
47
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
40
48
|
size: {
|
|
41
49
|
sm: string;
|
|
@@ -55,6 +63,10 @@ export declare const inputBaseVariants: import('tailwind-variants').TVReturnType
|
|
|
55
63
|
primary: string;
|
|
56
64
|
error: string;
|
|
57
65
|
};
|
|
66
|
+
focus: {
|
|
67
|
+
true: string;
|
|
68
|
+
false: string;
|
|
69
|
+
};
|
|
58
70
|
}, undefined, "text-fg-neutral-main placeholder:text-fg-neutral-subtlest flex items-center gap-1 rounded-lg tracking-p-medium outline-1 focus-within:border-input-active focus-within:outline-2 font-primary", unknown, unknown, undefined>>;
|
|
59
71
|
export declare const textAreaVariants: import('tailwind-variants').TVReturnType<{
|
|
60
72
|
size: {
|
|
@@ -19,6 +19,10 @@ const a = e({
|
|
|
19
19
|
color: {
|
|
20
20
|
primary: "",
|
|
21
21
|
error: ""
|
|
22
|
+
},
|
|
23
|
+
focus: {
|
|
24
|
+
true: "outline-2 outline-fg-brand-rest",
|
|
25
|
+
false: ""
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
defaultVariants: {
|
|
@@ -48,6 +52,17 @@ const a = e({
|
|
|
48
52
|
disabled: !1,
|
|
49
53
|
readOnly: !1,
|
|
50
54
|
className: "outline-fg-accent-error focus-within:outline-fg-accent-error hover:outline-fg-accent-error"
|
|
55
|
+
},
|
|
56
|
+
// Focus state - override all other states when focus is true
|
|
57
|
+
{
|
|
58
|
+
focus: !0,
|
|
59
|
+
error: !1,
|
|
60
|
+
className: "outline-2 outline-fg-brand-rest"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
focus: !0,
|
|
64
|
+
error: !0,
|
|
65
|
+
className: "outline-2 outline-fg-accent-error"
|
|
51
66
|
}
|
|
52
67
|
]
|
|
53
68
|
}), r = e({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as s, useEffect as m } from "react";
|
|
3
3
|
import { modal as F } from "./helper/variants.js";
|
|
4
4
|
import { cn as n } from "../../shared/utils/cn.js";
|
|
@@ -26,40 +26,40 @@ function _({
|
|
|
26
26
|
footer: v,
|
|
27
27
|
...R
|
|
28
28
|
}) {
|
|
29
|
-
const
|
|
29
|
+
const p = s(null), j = s(null), c = s(null), {
|
|
30
30
|
overlay: L,
|
|
31
|
-
content:
|
|
32
|
-
header:
|
|
33
|
-
titleContainer:
|
|
34
|
-
title:
|
|
31
|
+
content: P,
|
|
32
|
+
header: T,
|
|
33
|
+
titleContainer: z,
|
|
34
|
+
title: D,
|
|
35
35
|
closeButton: S,
|
|
36
36
|
body: I,
|
|
37
|
-
footer:
|
|
37
|
+
footer: y,
|
|
38
38
|
actionsContainer: M,
|
|
39
39
|
loadingContainer: V
|
|
40
40
|
} = F();
|
|
41
41
|
m(() => {
|
|
42
42
|
if (!i || !u) return;
|
|
43
|
-
const
|
|
43
|
+
const e = (A) => {
|
|
44
44
|
A.key === "Escape" && o();
|
|
45
45
|
};
|
|
46
|
-
return document.addEventListener("keydown",
|
|
46
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
47
47
|
}, [i, u, o]), m(() => {
|
|
48
48
|
if (!i) return;
|
|
49
|
-
const
|
|
49
|
+
const e = window.getComputedStyle(document.body).overflow;
|
|
50
50
|
return document.body.style.overflow = "hidden", () => {
|
|
51
|
-
document.body.style.overflow =
|
|
51
|
+
document.body.style.overflow = e;
|
|
52
52
|
};
|
|
53
53
|
}, [i]), m(() => {
|
|
54
54
|
t && i && c.current?.scrollTo({ top: 0, behavior: "instant" });
|
|
55
55
|
}, [t, i, c]);
|
|
56
|
-
const q = (
|
|
57
|
-
w &&
|
|
56
|
+
const q = (e) => {
|
|
57
|
+
w && e.target === p.current && !a && o();
|
|
58
58
|
};
|
|
59
|
-
return i ? /* @__PURE__ */
|
|
59
|
+
return i ? /* @__PURE__ */ r(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
|
-
ref:
|
|
62
|
+
ref: p,
|
|
63
63
|
className: n(L(), B),
|
|
64
64
|
onClick: q,
|
|
65
65
|
...G("modal"),
|
|
@@ -68,24 +68,24 @@ function _({
|
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
70
|
ref: j,
|
|
71
|
-
className: n(
|
|
71
|
+
className: n(P({ size: x }), g),
|
|
72
72
|
role: "dialog",
|
|
73
73
|
"aria-modal": "true",
|
|
74
74
|
"aria-labelledby": "modal-title",
|
|
75
75
|
"aria-describedby": k ? "modal-subtitle" : void 0,
|
|
76
76
|
children: [
|
|
77
|
-
/* @__PURE__ */ d("div", { className:
|
|
78
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ d("div", { className: T(), children: [
|
|
78
|
+
/* @__PURE__ */ r("div", { className: z(), children: /* @__PURE__ */ r(
|
|
79
79
|
J,
|
|
80
80
|
{
|
|
81
81
|
id: "modal-title",
|
|
82
82
|
variants: "heading-xs",
|
|
83
83
|
size: "xs",
|
|
84
|
-
className:
|
|
84
|
+
className: D(),
|
|
85
85
|
children: b
|
|
86
86
|
}
|
|
87
87
|
) }),
|
|
88
|
-
N && /* @__PURE__ */
|
|
88
|
+
N && /* @__PURE__ */ r(
|
|
89
89
|
f,
|
|
90
90
|
{
|
|
91
91
|
variant: "outline",
|
|
@@ -93,7 +93,9 @@ function _({
|
|
|
93
93
|
iconOnly: !0,
|
|
94
94
|
icon: "x-close",
|
|
95
95
|
type: "button",
|
|
96
|
-
onClick:
|
|
96
|
+
onClick: (e) => {
|
|
97
|
+
e.stopPropagation(), o();
|
|
98
|
+
},
|
|
97
99
|
disabled: a,
|
|
98
100
|
className: S(),
|
|
99
101
|
"aria-label": "Close modal"
|
|
@@ -108,37 +110,37 @@ function _({
|
|
|
108
110
|
"overflow-hidden": t
|
|
109
111
|
}),
|
|
110
112
|
children: [
|
|
111
|
-
t && /* @__PURE__ */
|
|
113
|
+
t && /* @__PURE__ */ r("div", { className: V(), children: /* @__PURE__ */ r("div", { className: "w-[44px] h-[44px] p-sm-2 bg-neutral-700 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ r(H, { width: 20, thickness: 3 }) }) }),
|
|
112
114
|
C
|
|
113
115
|
]
|
|
114
116
|
}
|
|
115
117
|
),
|
|
116
|
-
l && /* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
+
l && /* @__PURE__ */ r("div", { className: n(y(), h), children: /* @__PURE__ */ r("div", { className: M(), children: /* @__PURE__ */ d("div", { className: "flex gap-3", children: [
|
|
119
|
+
/* @__PURE__ */ r(
|
|
118
120
|
f,
|
|
119
121
|
{
|
|
120
122
|
disabled: l.cancelBtn?.isDisabled || a,
|
|
121
123
|
variant: "outline",
|
|
122
|
-
onClick: (
|
|
123
|
-
|
|
124
|
+
onClick: (e) => {
|
|
125
|
+
e.stopPropagation(), l.cancelBtn?.onClick?.();
|
|
124
126
|
},
|
|
125
127
|
children: l.cancelBtn?.label || "Cancel"
|
|
126
128
|
}
|
|
127
129
|
),
|
|
128
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ r(
|
|
129
131
|
f,
|
|
130
132
|
{
|
|
131
133
|
loading: a,
|
|
132
134
|
disabled: l.confirmBtn?.isDisabled || t || a,
|
|
133
135
|
variant: l?.confirmBtn?.isConfirm ? "danger" : "primary",
|
|
134
|
-
onClick: (
|
|
135
|
-
|
|
136
|
+
onClick: (e) => {
|
|
137
|
+
e.stopPropagation(), l.confirmBtn?.onClick?.();
|
|
136
138
|
},
|
|
137
139
|
children: l.confirmBtn?.label || "Confirm"
|
|
138
140
|
}
|
|
139
141
|
)
|
|
140
142
|
] }) }) }),
|
|
141
|
-
v && /* @__PURE__ */
|
|
143
|
+
v && /* @__PURE__ */ r("div", { className: n(y(), h), children: v })
|
|
142
144
|
]
|
|
143
145
|
}
|
|
144
146
|
)
|
|
@@ -47,7 +47,7 @@ const t = e({
|
|
|
47
47
|
true: [
|
|
48
48
|
"bg-bg-selected-rest text-fg-selected-rest",
|
|
49
49
|
"before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2",
|
|
50
|
-
"before:w-[2px] before:h-[16px] before:bg-fg-
|
|
50
|
+
"before:w-[2px] before:h-[16px] before:bg-fg-brand-rest",
|
|
51
51
|
"before:rounded-tr-xs before:rounded-br-xs"
|
|
52
52
|
],
|
|
53
53
|
false: "text-fg-neutral-subtle hover:bg-bg-neutral-subtle"
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Typography as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
text:
|
|
3
|
+
import { Typography as n } from "../Typography/index.js";
|
|
4
|
+
import f from "../Icon/Icon.js";
|
|
5
|
+
import g from "clsx";
|
|
6
|
+
const T = ({
|
|
7
|
+
text: m,
|
|
8
8
|
error: l = !1,
|
|
9
|
-
haveIcon:
|
|
10
|
-
iconsCustom:
|
|
9
|
+
haveIcon: h = !0,
|
|
10
|
+
iconsCustom: o,
|
|
11
11
|
className: r,
|
|
12
12
|
iconsSize: t = 16,
|
|
13
|
-
customContent:
|
|
13
|
+
customContent: d,
|
|
14
14
|
requirementsList: a
|
|
15
15
|
}) => {
|
|
16
|
-
if (
|
|
16
|
+
if (d)
|
|
17
17
|
return /* @__PURE__ */ e(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
20
|
className: `self-stretch inline-flex flex-col justify-start items-start ${r || ""}`,
|
|
21
|
-
children:
|
|
21
|
+
children: d
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
if (a) {
|
|
25
|
-
const { items: x } = a,
|
|
25
|
+
const { items: x } = a, u = a.showTitle !== !1, p = a.title || "Requirements:", c = x.every((s) => s.isValid);
|
|
26
26
|
return /* @__PURE__ */ i("div", { className: `mt-1 space-y-1 ${r || ""}`, children: [
|
|
27
|
-
|
|
27
|
+
u && /* @__PURE__ */ i("div", { className: "self-stretch inline-flex justify-start items-start gap-1", children: [
|
|
28
28
|
/* @__PURE__ */ e(
|
|
29
|
-
|
|
29
|
+
f,
|
|
30
30
|
{
|
|
31
|
-
name: "alert-octagon",
|
|
32
|
-
className: "text-fg-accent-error",
|
|
31
|
+
name: c ? "check-circle" : "alert-octagon",
|
|
32
|
+
className: c ? "text-fg-accent-success" : "text-fg-accent-error",
|
|
33
33
|
variant: "solid",
|
|
34
34
|
size: typeof t == "number" ? t : 16
|
|
35
35
|
}
|
|
36
36
|
),
|
|
37
37
|
/* @__PURE__ */ e(
|
|
38
|
-
|
|
38
|
+
n,
|
|
39
39
|
{
|
|
40
40
|
variants: "body",
|
|
41
41
|
size: "sm",
|
|
42
|
-
color: "fg-accent-error",
|
|
42
|
+
color: c ? "fg-accent-success" : "fg-accent-error",
|
|
43
43
|
className: "font-medium",
|
|
44
44
|
children: p
|
|
45
45
|
}
|
|
@@ -48,23 +48,23 @@ const j = ({
|
|
|
48
48
|
/* @__PURE__ */ e("ul", { className: "list-disc ml-9", children: x.map((s) => /* @__PURE__ */ e(
|
|
49
49
|
"li",
|
|
50
50
|
{
|
|
51
|
-
className:
|
|
51
|
+
className: g("", {
|
|
52
52
|
"marker:text-fg-accent-success text-fg-accent-success": s.isValid,
|
|
53
53
|
"marker:text-fg-accent-error text-fg-accent-error": !s.isValid
|
|
54
54
|
}),
|
|
55
|
-
children: /* @__PURE__ */ e(
|
|
55
|
+
children: /* @__PURE__ */ e(n, { variants: "body", size: "sm", className: "text-inherit", children: s.text })
|
|
56
56
|
},
|
|
57
57
|
s.id
|
|
58
58
|
)) })
|
|
59
59
|
] });
|
|
60
60
|
}
|
|
61
|
-
return
|
|
61
|
+
return m ? /* @__PURE__ */ e(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
className: `self-stretch inline-flex flex-col justify-start items-start ${r || ""}`,
|
|
65
65
|
children: /* @__PURE__ */ i("div", { className: "self-stretch inline-flex justify-start items-start gap-1", children: [
|
|
66
|
-
l && (
|
|
67
|
-
|
|
66
|
+
l && (o || /* @__PURE__ */ e(
|
|
67
|
+
f,
|
|
68
68
|
{
|
|
69
69
|
name: "alert-octagon",
|
|
70
70
|
className: "text-fg-accent-error",
|
|
@@ -72,8 +72,8 @@ const j = ({
|
|
|
72
72
|
size: typeof t == "number" ? t : 16
|
|
73
73
|
}
|
|
74
74
|
)),
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
h && !l && /* @__PURE__ */ e(
|
|
76
|
+
f,
|
|
77
77
|
{
|
|
78
78
|
name: "help-circle",
|
|
79
79
|
variant: "line",
|
|
@@ -82,13 +82,13 @@ const j = ({
|
|
|
82
82
|
}
|
|
83
83
|
),
|
|
84
84
|
/* @__PURE__ */ e("div", { className: "flex-1 justify-start text-left flex flex-wrap items-center gap-0", children: /* @__PURE__ */ e(
|
|
85
|
-
|
|
85
|
+
n,
|
|
86
86
|
{
|
|
87
87
|
variants: "body",
|
|
88
88
|
size: "sm",
|
|
89
89
|
color: l ? "fg-accent-error" : "fg-neutral-subtle",
|
|
90
90
|
className: "inline",
|
|
91
|
-
children:
|
|
91
|
+
children: m
|
|
92
92
|
}
|
|
93
93
|
) })
|
|
94
94
|
] })
|
|
@@ -96,5 +96,5 @@ const j = ({
|
|
|
96
96
|
) : null;
|
|
97
97
|
};
|
|
98
98
|
export {
|
|
99
|
-
|
|
99
|
+
T as default
|
|
100
100
|
};
|