@alixpartners/ui-components 2.3.0 → 2.3.1
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 +99 -99
- package/dist/components/FilePicker/FilePicker.d.ts +3 -1
- package/dist/components/FilePicker/FilePicker.js +115 -113
- package/dist/web.config +8 -8
- package/package.json +87 -87
package/README.md
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
# AlixPartners UI Component Library
|
|
2
|
-
|
|
3
|
-
A modern, reusable component library built with **[ReactJS](https://react.dev/)**.
|
|
4
|
-
|
|
5
|
-
Version **2.0** has been **rebuilt from the ground up** to align with the latest **AlixPartners Design System** and deliver improved developer experience, accessibility, and performance.
|
|
6
|
-
|
|
7
|
-
‼️ **BETA Notice**: This release is **not yet production-ready**. While stable for development and testing, expect ongoing refinements, new components, and breaking changes before the full release.
|
|
8
|
-
|
|
9
|
-
## ✨ What’s New in 2.0
|
|
10
|
-
|
|
11
|
-
- Completely redesigned architecture with modern build tooling ([Vite](https://vitejs.dev/))
|
|
12
|
-
- Updated design tokens and styles aligned with AlixPartners Design System
|
|
13
|
-
- Improved accessibility (a11y) and semantic HTML usage
|
|
14
|
-
- Streamlined props API for cleaner integration
|
|
15
|
-
- Enhanced Storybook documentation
|
|
16
|
-
- Faster build & development workflows
|
|
17
|
-
|
|
18
|
-
### Version Support
|
|
19
|
-
|
|
20
|
-
- v2.x — Active development (BETA)
|
|
21
|
-
- v1.x — Maintained for legacy projects (no new features, critical fixes only)
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 🚀 Installation
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install @alixpartners/ui-components
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 🔧 Usage
|
|
32
|
-
|
|
33
|
-
```tsx
|
|
34
|
-
import { YourComponent } from '@alixpartners/ui-components'
|
|
35
|
-
|
|
36
|
-
function App() {
|
|
37
|
-
return <YourComponent />
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## 🧱 Components
|
|
42
|
-
|
|
43
|
-
Explore all available components and documentation in Storybook.
|
|
44
|
-
|
|
45
|
-
To run it locally:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm run storybook
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## 📦 Build
|
|
54
|
-
|
|
55
|
-
To bundle the library for publishing:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm run build
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
The output will be in the `dist/` directory.
|
|
62
|
-
|
|
63
|
-
### Usage in projects while developing
|
|
64
|
-
|
|
65
|
-
When working on the library and testing it in another project:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
# In the component library root:
|
|
69
|
-
npm link
|
|
70
|
-
|
|
71
|
-
# In the consuming project's root:
|
|
72
|
-
npm link alix-partners-react-components-test
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Then import components using the `alix-partners-react-components-test` import.
|
|
76
|
-
|
|
77
|
-
## 🧪 Testing
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
npm run test
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
#### 🧪 Test Coverage
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npm run coverage
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## 📚 Publish
|
|
90
|
-
|
|
91
|
-
To publish to npm:
|
|
92
|
-
|
|
93
|
-
1. Bump the version in `package.json`
|
|
94
|
-
2. Create a pull request in Azure DevOps to the `main` branch
|
|
95
|
-
3. This will automatically publish the library to `npm` once approved
|
|
96
|
-
|
|
97
|
-
## 🤝 Contributing
|
|
98
|
-
|
|
99
|
-
The **AlixPartners UI Component Library** is a collaborative, community-driven project where contributions from all team members are encouraged and valued. If you’d like to add new components or improve existing ones, please see the CONTRIBUTING.md file.
|
|
1
|
+
# AlixPartners UI Component Library
|
|
2
|
+
|
|
3
|
+
A modern, reusable component library built with **[ReactJS](https://react.dev/)**.
|
|
4
|
+
|
|
5
|
+
Version **2.0** has been **rebuilt from the ground up** to align with the latest **AlixPartners Design System** and deliver improved developer experience, accessibility, and performance.
|
|
6
|
+
|
|
7
|
+
‼️ **BETA Notice**: This release is **not yet production-ready**. While stable for development and testing, expect ongoing refinements, new components, and breaking changes before the full release.
|
|
8
|
+
|
|
9
|
+
## ✨ What’s New in 2.0
|
|
10
|
+
|
|
11
|
+
- Completely redesigned architecture with modern build tooling ([Vite](https://vitejs.dev/))
|
|
12
|
+
- Updated design tokens and styles aligned with AlixPartners Design System
|
|
13
|
+
- Improved accessibility (a11y) and semantic HTML usage
|
|
14
|
+
- Streamlined props API for cleaner integration
|
|
15
|
+
- Enhanced Storybook documentation
|
|
16
|
+
- Faster build & development workflows
|
|
17
|
+
|
|
18
|
+
### Version Support
|
|
19
|
+
|
|
20
|
+
- v2.x — Active development (BETA)
|
|
21
|
+
- v1.x — Maintained for legacy projects (no new features, critical fixes only)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🚀 Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @alixpartners/ui-components
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 🔧 Usage
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { YourComponent } from '@alixpartners/ui-components'
|
|
35
|
+
|
|
36
|
+
function App() {
|
|
37
|
+
return <YourComponent />
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 🧱 Components
|
|
42
|
+
|
|
43
|
+
Explore all available components and documentation in Storybook.
|
|
44
|
+
|
|
45
|
+
To run it locally:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm run storybook
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 📦 Build
|
|
54
|
+
|
|
55
|
+
To bundle the library for publishing:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm run build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The output will be in the `dist/` directory.
|
|
62
|
+
|
|
63
|
+
### Usage in projects while developing
|
|
64
|
+
|
|
65
|
+
When working on the library and testing it in another project:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# In the component library root:
|
|
69
|
+
npm link
|
|
70
|
+
|
|
71
|
+
# In the consuming project's root:
|
|
72
|
+
npm link alix-partners-react-components-test
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then import components using the `alix-partners-react-components-test` import.
|
|
76
|
+
|
|
77
|
+
## 🧪 Testing
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm run test
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### 🧪 Test Coverage
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm run coverage
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 📚 Publish
|
|
90
|
+
|
|
91
|
+
To publish to npm:
|
|
92
|
+
|
|
93
|
+
1. Bump the version in `package.json`
|
|
94
|
+
2. Create a pull request in Azure DevOps to the `main` branch
|
|
95
|
+
3. This will automatically publish the library to `npm` once approved
|
|
96
|
+
|
|
97
|
+
## 🤝 Contributing
|
|
98
|
+
|
|
99
|
+
The **AlixPartners UI Component Library** is a collaborative, community-driven project where contributions from all team members are encouraged and valued. If you’d like to add new components or improve existing ones, please see the CONTRIBUTING.md file.
|
|
@@ -20,6 +20,8 @@ type FilePickerProps = {
|
|
|
20
20
|
helpLink?: string;
|
|
21
21
|
helpLinkText?: string;
|
|
22
22
|
labelTooltip?: InputLabelTooltipProps;
|
|
23
|
+
onUpload?: (files: UploadFile[]) => void;
|
|
24
|
+
onRemoveFile?: (fileName: string) => void;
|
|
23
25
|
} & InteractiveEventHandlers;
|
|
24
26
|
/**
|
|
25
27
|
* FilePicker component for uploading files.
|
|
@@ -42,5 +44,5 @@ type FilePickerProps = {
|
|
|
42
44
|
* @param {InputLabelTooltipProps} props.labelTooltip - The label tooltip of the component
|
|
43
45
|
* @returns {JSX.Element} The rendered FilePicker component
|
|
44
46
|
*/
|
|
45
|
-
export default function FilePicker({ type, maxFiles, fileExtensionsAllowed, maxSize, queueFiles, disabled, value, label, required, placeholder, errorMessage, helpText, helpLink, helpLinkText, labelTooltip, }: FilePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export default function FilePicker({ type, maxFiles, fileExtensionsAllowed, maxSize, queueFiles, disabled, value, label, required, placeholder, errorMessage, helpText, helpLink, helpLinkText, labelTooltip, onUpload, onRemoveFile, }: FilePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
46
48
|
export {};
|
|
@@ -1,153 +1,155 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { c as
|
|
7
|
-
import '../../assets/FilePicker.css';const
|
|
8
|
-
container:
|
|
9
|
-
label:
|
|
10
|
-
required:
|
|
11
|
-
labelTooltipIcon:
|
|
12
|
-
helpers:
|
|
13
|
-
helperText:
|
|
14
|
-
errorMessage:
|
|
15
|
-
singleFileHelpLinkContainer:
|
|
16
|
-
singleFileHelpLinkReservedSpace:
|
|
17
|
-
helpLink:
|
|
18
|
-
input:
|
|
19
|
-
singleFileContainer:
|
|
20
|
-
singleFileInputContainer:
|
|
21
|
-
inputFileName:
|
|
22
|
-
inputFileNamePlaceholder:
|
|
23
|
-
inputButton:
|
|
24
|
-
multipleHelpText:
|
|
25
|
-
multipleInputButton:
|
|
26
|
-
multipleFilesList:
|
|
27
|
-
multipleFilesListItem:
|
|
28
|
-
multipleFilesListItemContent:
|
|
29
|
-
multipleFilesListItemContentData:
|
|
30
|
-
multipleFilesListItemIconContainer:
|
|
31
|
-
multipleFilesListItemIcon:
|
|
32
|
-
multipleFilesListItemText:
|
|
33
|
-
multipleFilesListItemName:
|
|
34
|
-
multipleFilesListItemSize:
|
|
35
|
-
multipleFilesListItemError:
|
|
36
|
-
multipleFilesListItemIconError:
|
|
37
|
-
multipleFilesListItemIconDelete:
|
|
38
|
-
disabled:
|
|
2
|
+
import { useId as Q, useRef as W, useState as q, useEffect as Z } from "react";
|
|
3
|
+
import U from "../Tooltip/Tooltip.js";
|
|
4
|
+
import P from "../Icon/Icon.js";
|
|
5
|
+
import h from "../Button/Button.js";
|
|
6
|
+
import { c as ee } from "../../clsx-OuTLNxxd.js";
|
|
7
|
+
import '../../assets/FilePicker.css';const ie = "FilePicker-module__container___knCCi", le = "FilePicker-module__label___al7Xe", te = "FilePicker-module__required___41Vjd", ne = "FilePicker-module__labelTooltipIcon___Cc1QF", se = "FilePicker-module__helpers___79-g5", ce = "FilePicker-module__helperText___ja9Rr", re = "FilePicker-module__errorMessage___TvHrL", me = "FilePicker-module__singleFileHelpLinkContainer___mpjUf", oe = "FilePicker-module__singleFileHelpLinkReservedSpace___r8j2b", ae = "FilePicker-module__helpLink___uu45D", ue = "FilePicker-module__input___cL1Hs", pe = "FilePicker-module__singleFileContainer___OFSDt", _e = "FilePicker-module__singleFileInputContainer___MOkES", Fe = "FilePicker-module__inputFileName___sMs7R", de = "FilePicker-module__inputFileNamePlaceholder___-mkDD", Ie = "FilePicker-module__inputButton___ghLlD", he = "FilePicker-module__multipleHelpText___5tnnn", Le = "FilePicker-module__multipleInputButton___WCJp9", ke = "FilePicker-module__multipleFilesList___Kim0I", fe = "FilePicker-module__multipleFilesListItem___01PDS", Ne = "FilePicker-module__multipleFilesListItemContent___pKbho", ge = "FilePicker-module__multipleFilesListItemContentData___5GC-C", Ce = "FilePicker-module__multipleFilesListItemIconContainer___7sUL5", Pe = "FilePicker-module__multipleFilesListItemIcon___nfMX9", xe = "FilePicker-module__multipleFilesListItemText___nPqrL", De = "FilePicker-module__multipleFilesListItemName___NjHhX", ve = "FilePicker-module__multipleFilesListItemSize___wc8LJ", Ee = "FilePicker-module__multipleFilesListItemError___x9qkT", Te = "FilePicker-module__multipleFilesListItemIconError___0RO46", Be = "FilePicker-module__multipleFilesListItemIconDelete___9Z9Dl", He = "FilePicker-module__disabled___szMiq", e = {
|
|
8
|
+
container: ie,
|
|
9
|
+
label: le,
|
|
10
|
+
required: te,
|
|
11
|
+
labelTooltipIcon: ne,
|
|
12
|
+
helpers: se,
|
|
13
|
+
helperText: ce,
|
|
14
|
+
errorMessage: re,
|
|
15
|
+
singleFileHelpLinkContainer: me,
|
|
16
|
+
singleFileHelpLinkReservedSpace: oe,
|
|
17
|
+
helpLink: ae,
|
|
18
|
+
input: ue,
|
|
19
|
+
singleFileContainer: pe,
|
|
20
|
+
singleFileInputContainer: _e,
|
|
21
|
+
inputFileName: Fe,
|
|
22
|
+
inputFileNamePlaceholder: de,
|
|
23
|
+
inputButton: Ie,
|
|
24
|
+
multipleHelpText: he,
|
|
25
|
+
multipleInputButton: Le,
|
|
26
|
+
multipleFilesList: ke,
|
|
27
|
+
multipleFilesListItem: fe,
|
|
28
|
+
multipleFilesListItemContent: Ne,
|
|
29
|
+
multipleFilesListItemContentData: ge,
|
|
30
|
+
multipleFilesListItemIconContainer: Ce,
|
|
31
|
+
multipleFilesListItemIcon: Pe,
|
|
32
|
+
multipleFilesListItemText: xe,
|
|
33
|
+
multipleFilesListItemName: De,
|
|
34
|
+
multipleFilesListItemSize: ve,
|
|
35
|
+
multipleFilesListItemError: Ee,
|
|
36
|
+
multipleFilesListItemIconError: Te,
|
|
37
|
+
multipleFilesListItemIconDelete: Be,
|
|
38
|
+
disabled: He
|
|
39
39
|
};
|
|
40
|
-
function
|
|
41
|
-
type:
|
|
42
|
-
maxFiles:
|
|
43
|
-
fileExtensionsAllowed:
|
|
44
|
-
maxSize:
|
|
45
|
-
queueFiles:
|
|
40
|
+
function qe({
|
|
41
|
+
type: r = "single",
|
|
42
|
+
maxFiles: F = 1,
|
|
43
|
+
fileExtensionsAllowed: L,
|
|
44
|
+
maxSize: p,
|
|
45
|
+
queueFiles: R = !1,
|
|
46
46
|
disabled: s = !1,
|
|
47
|
-
value:
|
|
48
|
-
label:
|
|
49
|
-
required:
|
|
50
|
-
placeholder:
|
|
51
|
-
errorMessage:
|
|
52
|
-
helpText:
|
|
53
|
-
helpLink:
|
|
54
|
-
helpLinkText:
|
|
55
|
-
labelTooltip:
|
|
47
|
+
value: d,
|
|
48
|
+
label: x,
|
|
49
|
+
required: K = !1,
|
|
50
|
+
placeholder: V,
|
|
51
|
+
errorMessage: a,
|
|
52
|
+
helpText: k,
|
|
53
|
+
helpLink: D,
|
|
54
|
+
helpLinkText: v,
|
|
55
|
+
labelTooltip: o,
|
|
56
|
+
onUpload: u,
|
|
57
|
+
onRemoveFile: f
|
|
56
58
|
}) {
|
|
57
|
-
var
|
|
58
|
-
const
|
|
59
|
+
var M, j;
|
|
60
|
+
const E = Q(), N = W(null), [l, I] = q(d ? d.map((i) => ({
|
|
59
61
|
file: i
|
|
60
|
-
})) : []), [
|
|
61
|
-
|
|
62
|
-
const i =
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
return
|
|
68
|
-
},
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
return i.map((
|
|
73
|
-
const
|
|
74
|
-
let
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
file:
|
|
78
|
-
error:
|
|
62
|
+
})) : []), [T, B] = q(!1);
|
|
63
|
+
Z(() => {
|
|
64
|
+
const i = S(d ?? []);
|
|
65
|
+
I(i);
|
|
66
|
+
}, [d]);
|
|
67
|
+
const O = L.map((i) => `.${i.replace(/^\./, "")}`).join(","), H = L.join(", "), $ = (i) => {
|
|
68
|
+
const c = i.name.toLowerCase();
|
|
69
|
+
return c.includes(".") ? c.split(".").pop() ?? "" : "";
|
|
70
|
+
}, S = (i) => {
|
|
71
|
+
const m = l.length + i.length > F;
|
|
72
|
+
B(m);
|
|
73
|
+
const g = p ? p * 1024 * 1024 : Number.POSITIVE_INFINITY, b = new Set(L.map((_) => _.toLowerCase().replace(/^\./, "")));
|
|
74
|
+
return i.map((_) => {
|
|
75
|
+
const J = _.size <= g, Y = b.size === 0 || b.has($(_));
|
|
76
|
+
let C;
|
|
77
|
+
const G = p ? `up to ${p}MB` : "";
|
|
78
|
+
return J || (C = `File size is too large. Must be ${G}.`), Y || (C = `The file format is incorrect. Please make sure it is one of the extensions: ${H}.`), {
|
|
79
|
+
file: _,
|
|
80
|
+
error: C
|
|
79
81
|
};
|
|
80
82
|
});
|
|
81
|
-
},
|
|
83
|
+
}, X = (i) => (i / 1024).toFixed(2) + " KB", z = () => {
|
|
82
84
|
var i;
|
|
83
|
-
s || (i =
|
|
84
|
-
},
|
|
85
|
-
var
|
|
86
|
-
s || i.key === "Enter" && ((
|
|
87
|
-
},
|
|
85
|
+
s || (i = N.current) == null || i.click();
|
|
86
|
+
}, w = (i) => {
|
|
87
|
+
var c;
|
|
88
|
+
s || i.key === "Enter" && ((c = N.current) == null || c.click());
|
|
89
|
+
}, A = (i) => {
|
|
88
90
|
if (s) return;
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
},
|
|
91
|
+
const c = i.target.files, m = S(Array.from(c ?? []));
|
|
92
|
+
r === "multiple" && R ? (I([...l, ...m]), u == null || u(m)) : (I(m), u == null || u(m)), i.target.value = "";
|
|
93
|
+
}, y = (i) => {
|
|
92
94
|
if (s || !l) return;
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
+
const m = l.length - 1 > F;
|
|
96
|
+
B(m), I(l == null ? void 0 : l.filter((g) => g.file.name !== i)), f == null || f(i);
|
|
95
97
|
};
|
|
96
|
-
return /* @__PURE__ */ n("div", { className:
|
|
97
|
-
/* @__PURE__ */ n("label", { htmlFor:
|
|
98
|
-
/* @__PURE__ */ t("span", { title:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
return /* @__PURE__ */ n("div", { className: ee(e.container, s && e.disabled), children: [
|
|
99
|
+
/* @__PURE__ */ n("label", { htmlFor: E, onClick: (i) => i.preventDefault(), className: e.label, children: [
|
|
100
|
+
/* @__PURE__ */ t("span", { title: x, className: e.labelText, children: x }),
|
|
101
|
+
K && /* @__PURE__ */ t("span", { "aria-hidden": "true", className: e.required, children: "*" }),
|
|
102
|
+
o && /* @__PURE__ */ t(U, { content: o.content, size: o.size, theme: o.theme, tipSide: o.tipSide, tipAlignment: o.tipAlignment, startVisible: o.startVisible, children: /* @__PURE__ */ t(P, { icon: "ap-icon-info", className: e.labelTooltipIcon }) }),
|
|
103
|
+
r === "multiple" && /* @__PURE__ */ n("span", { className: e.multipleHelpText, children: [
|
|
102
104
|
"Only ",
|
|
103
|
-
|
|
105
|
+
H,
|
|
104
106
|
" files with max size of ",
|
|
105
|
-
|
|
107
|
+
p,
|
|
106
108
|
"MB"
|
|
107
109
|
] })
|
|
108
110
|
] }),
|
|
109
|
-
/* @__PURE__ */ t("input", { accept:
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */ n("div", { tabIndex: s ? -1 : 0, onClick:
|
|
111
|
+
/* @__PURE__ */ t("input", { accept: O, multiple: r === "multiple", ref: N, type: "file", id: E, className: e.input, onChange: A }),
|
|
112
|
+
r === "single" && /* @__PURE__ */ n("div", { className: e.singleFileContainer, children: [
|
|
113
|
+
/* @__PURE__ */ n("div", { tabIndex: s ? -1 : 0, onClick: z, onKeyDown: w, className: e.singleFileInputContainer, children: [
|
|
112
114
|
/* @__PURE__ */ n("span", { className: e.inputFileName, children: [
|
|
113
115
|
l && l.length > 0 && /* @__PURE__ */ t("span", { className: e.inputFileNameText, children: l[0].file.name }),
|
|
114
|
-
l && l.length === 0 && /* @__PURE__ */ t("span", { className: e.inputFileNamePlaceholder, children:
|
|
116
|
+
l && l.length === 0 && /* @__PURE__ */ t("span", { className: e.inputFileNamePlaceholder, children: V })
|
|
115
117
|
] }),
|
|
116
|
-
/* @__PURE__ */ t(
|
|
118
|
+
/* @__PURE__ */ t(h, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-upload", className: e.inputButton, tabIndex: -1, disabled: s, children: /* @__PURE__ */ t("span", { children: "Browse file" }) })
|
|
117
119
|
] }),
|
|
118
|
-
/* @__PURE__ */ t("span", { className: e.singleFileHelpLinkReservedSpace, children: l && l.length > 0 && /* @__PURE__ */ t(
|
|
120
|
+
/* @__PURE__ */ t("span", { className: e.singleFileHelpLinkReservedSpace, children: l && l.length > 0 && /* @__PURE__ */ t(h, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-delete", className: e.singleFileDeleteButton, onClick: () => y(l[0].file.name), disabled: s }) })
|
|
119
121
|
] }),
|
|
120
|
-
|
|
122
|
+
r === "multiple" && /* @__PURE__ */ t(h, { type: "secondary", variant: "default", size: "md", icon: "ap-icon-upload", className: e.multipleInputButton, onClick: z, onKeyDown: w, disabled: s, children: /* @__PURE__ */ n("span", { children: [
|
|
121
123
|
"Browse files (max ",
|
|
122
|
-
|
|
124
|
+
F,
|
|
123
125
|
" files)"
|
|
124
126
|
] }) }),
|
|
125
127
|
/* @__PURE__ */ n("div", { className: e.helpers, children: [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
] }) :
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */ t("a", { href:
|
|
128
|
+
a || T || (M = l[0]) != null && M.error ? /* @__PURE__ */ n("span", { title: a, className: e.errorMessage, children: [
|
|
129
|
+
r === "single" && (a || ((j = l[0]) == null ? void 0 : j.error)),
|
|
130
|
+
r === "multiple" && (a || (T ? `You can only upload up to ${F} files.` : ""))
|
|
131
|
+
] }) : k && r === "single" && /* @__PURE__ */ t("span", { title: k, className: e.helperText, children: k }),
|
|
132
|
+
r === "single" && D && v && /* @__PURE__ */ n("span", { className: e.singleFileHelpLinkContainer, children: [
|
|
133
|
+
/* @__PURE__ */ t("a", { href: D, className: e.helpLink, target: "_blank", rel: "noopener noreferrer", tabIndex: s ? -1 : 0, children: v }),
|
|
132
134
|
/* @__PURE__ */ t("span", { className: e.singleFileHelpLinkReservedSpace })
|
|
133
135
|
] })
|
|
134
136
|
] }),
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */ t("span", { className: e.multipleFilesListItemIconContainer, children: /* @__PURE__ */ t(
|
|
137
|
+
r === "multiple" && l && (l == null ? void 0 : l.length) > 0 && /* @__PURE__ */ t("ul", { className: e.multipleFilesList, children: l == null ? void 0 : l.map((i, c) => /* @__PURE__ */ t("li", { className: e.multipleFilesListItem, children: /* @__PURE__ */ n("div", { className: e.multipleFilesListItemContent, children: [
|
|
138
|
+
/* @__PURE__ */ t("span", { className: e.multipleFilesListItemIconContainer, children: /* @__PURE__ */ t(P, { icon: "ap-icon-document", className: e.multipleFilesListItemIcon }) }),
|
|
137
139
|
/* @__PURE__ */ n("div", { className: e.multipleFilesListItemContentData, children: [
|
|
138
140
|
/* @__PURE__ */ n("div", { className: e.multipleFilesListItemText, children: [
|
|
139
141
|
/* @__PURE__ */ t("span", { className: e.multipleFilesListItemName, children: i.file.name }),
|
|
140
|
-
/* @__PURE__ */ t("span", { className: e.multipleFilesListItemSize, children:
|
|
142
|
+
/* @__PURE__ */ t("span", { className: e.multipleFilesListItemSize, children: X(i.file.size) }),
|
|
141
143
|
i.error && /* @__PURE__ */ n("span", { className: e.multipleFilesListItemError, children: [
|
|
142
|
-
/* @__PURE__ */ t(
|
|
144
|
+
/* @__PURE__ */ t(P, { icon: "ap-icon-alert", className: e.multipleFilesListItemIconError }),
|
|
143
145
|
i.error
|
|
144
146
|
] })
|
|
145
147
|
] }),
|
|
146
|
-
/* @__PURE__ */ t(
|
|
148
|
+
/* @__PURE__ */ t(h, { type: "tertiary", variant: "default", size: "sm", onClick: () => y(i.file.name), icon: "ap-icon-delete", iconClassName: e.multipleFilesListItemIconDelete, disabled: s })
|
|
147
149
|
] })
|
|
148
|
-
] }) },
|
|
150
|
+
] }) }, c)) })
|
|
149
151
|
] });
|
|
150
152
|
}
|
|
151
153
|
export {
|
|
152
|
-
|
|
154
|
+
qe as default
|
|
153
155
|
};
|
package/dist/web.config
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<configuration>
|
|
3
|
-
<system.webServer>
|
|
4
|
-
<staticContent>
|
|
5
|
-
<remove fileExtension=".json"/>
|
|
6
|
-
<mimeMap fileExtension=".json" mimeType="application/json"/>
|
|
7
|
-
</staticContent>
|
|
8
|
-
</system.webServer>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<configuration>
|
|
3
|
+
<system.webServer>
|
|
4
|
+
<staticContent>
|
|
5
|
+
<remove fileExtension=".json"/>
|
|
6
|
+
<mimeMap fileExtension=".json" mimeType="application/json"/>
|
|
7
|
+
</staticContent>
|
|
8
|
+
</system.webServer>
|
|
9
9
|
</configuration>
|
package/package.json
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@alixpartners/ui-components",
|
|
3
|
-
"version": "2.3.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist"
|
|
7
|
-
],
|
|
8
|
-
"exports": "./dist/main.js",
|
|
9
|
-
"module": "./dist/main.js",
|
|
10
|
-
"types": "./dist/main.d.ts",
|
|
11
|
-
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
|
-
"repository": "https://alixpartners-dev.visualstudio.com/_git/AP.UIComponents",
|
|
13
|
-
"main": "./dist/umd/index.js",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsc -b && vite build",
|
|
16
|
-
"lint": "eslint . --ext ts,tsx",
|
|
17
|
-
"lint:fix": "eslint . --ext ts,tsx --fix",
|
|
18
|
-
"format": "prettier --check .",
|
|
19
|
-
"format:fix": "prettier --write .",
|
|
20
|
-
"stylelint": "stylelint **/*.css",
|
|
21
|
-
"stylelint:fix": "stylelint **/*.css --fix",
|
|
22
|
-
"storybook": "storybook dev -p 6006",
|
|
23
|
-
"build-storybook": "storybook build",
|
|
24
|
-
"test": "vitest",
|
|
25
|
-
"test:unit": "vitest --project unit",
|
|
26
|
-
"test:storybook": "vitest --project storybook",
|
|
27
|
-
"test:ui": "vitest --ui",
|
|
28
|
-
"coverage": "vitest run --coverage",
|
|
29
|
-
"generate-icons": "node ./src/assets/generateIconsHelperFiles.js"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"clsx": "^2.1.1"
|
|
33
|
-
},
|
|
34
|
-
"peerDependencies": {
|
|
35
|
-
"react": "^18.3.1",
|
|
36
|
-
"react-dom": "^18.3.1",
|
|
37
|
-
"radix-ui": "^1.4.2",
|
|
38
|
-
"notistack": "^3.0.1"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@chromatic-com/storybook": "^4.0.1",
|
|
42
|
-
"@eslint/js": "^9.25.0",
|
|
43
|
-
"@storybook/addon-designs": "^10.0.2",
|
|
44
|
-
"@storybook/addon-onboarding": "^9.0.18",
|
|
45
|
-
"@storybook/react-vite": "^9.0.18",
|
|
46
|
-
"@testing-library/react": "^16.3.0",
|
|
47
|
-
"@types/node": "^22.15.21",
|
|
48
|
-
"@types/react": "^19.1.2",
|
|
49
|
-
"@types/react-dom": "^19.1.2",
|
|
50
|
-
"@vitejs/plugin-react": "^4.4.1",
|
|
51
|
-
"@vitest/browser": "^3.1.4",
|
|
52
|
-
"@vitest/coverage-v8": "^3.1.4",
|
|
53
|
-
"@vitest/ui": "^3.1.4",
|
|
54
|
-
"babel-plugin-react-remove-properties": "^0.3.0",
|
|
55
|
-
"eslint": "^9.25.0",
|
|
56
|
-
"eslint-config-prettier": "^10.1.5",
|
|
57
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
58
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
59
|
-
"eslint-plugin-storybook": "^9.0.18",
|
|
60
|
-
"globals": "^16.0.0",
|
|
61
|
-
"happy-dom": "^15.11.6",
|
|
62
|
-
"jsdom": "^26.1.0",
|
|
63
|
-
"notistack": "^3.0.1",
|
|
64
|
-
"playwright": "^1.52.0",
|
|
65
|
-
"postcss-scss": "^4.0.9",
|
|
66
|
-
"prettier": "^3.5.3",
|
|
67
|
-
"sass": "^1.89.0",
|
|
68
|
-
"storybook": "^9.0.18",
|
|
69
|
-
"stylelint": "^16.19.1",
|
|
70
|
-
"stylelint-config-standard": "^38.0.0",
|
|
71
|
-
"stylelint-scss": "^6.12.0",
|
|
72
|
-
"typescript": "~5.8.3",
|
|
73
|
-
"typescript-eslint": "^8.30.1",
|
|
74
|
-
"vite": "^6.3.5",
|
|
75
|
-
"vite-plugin-dts": "^4.5.4",
|
|
76
|
-
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
77
|
-
"vitest": "^3.1.4",
|
|
78
|
-
"@storybook/addon-vitest": "9.0.18",
|
|
79
|
-
"@storybook/addon-docs": "^9.0.18",
|
|
80
|
-
"glob": "^11.0.2"
|
|
81
|
-
},
|
|
82
|
-
"eslintConfig": {
|
|
83
|
-
"extends": [
|
|
84
|
-
"plugin:storybook/recommended"
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@alixpartners/ui-components",
|
|
3
|
+
"version": "2.3.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"exports": "./dist/main.js",
|
|
9
|
+
"module": "./dist/main.js",
|
|
10
|
+
"types": "./dist/main.d.ts",
|
|
11
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
|
+
"repository": "https://alixpartners-dev.visualstudio.com/_git/AP.UIComponents",
|
|
13
|
+
"main": "./dist/umd/index.js",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -b && vite build",
|
|
16
|
+
"lint": "eslint . --ext ts,tsx",
|
|
17
|
+
"lint:fix": "eslint . --ext ts,tsx --fix",
|
|
18
|
+
"format": "prettier --check .",
|
|
19
|
+
"format:fix": "prettier --write .",
|
|
20
|
+
"stylelint": "stylelint **/*.css",
|
|
21
|
+
"stylelint:fix": "stylelint **/*.css --fix",
|
|
22
|
+
"storybook": "storybook dev -p 6006",
|
|
23
|
+
"build-storybook": "storybook build",
|
|
24
|
+
"test": "vitest",
|
|
25
|
+
"test:unit": "vitest --project unit",
|
|
26
|
+
"test:storybook": "vitest --project storybook",
|
|
27
|
+
"test:ui": "vitest --ui",
|
|
28
|
+
"coverage": "vitest run --coverage",
|
|
29
|
+
"generate-icons": "node ./src/assets/generateIconsHelperFiles.js"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"clsx": "^2.1.1"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.3.1",
|
|
36
|
+
"react-dom": "^18.3.1",
|
|
37
|
+
"radix-ui": "^1.4.2",
|
|
38
|
+
"notistack": "^3.0.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@chromatic-com/storybook": "^4.0.1",
|
|
42
|
+
"@eslint/js": "^9.25.0",
|
|
43
|
+
"@storybook/addon-designs": "^10.0.2",
|
|
44
|
+
"@storybook/addon-onboarding": "^9.0.18",
|
|
45
|
+
"@storybook/react-vite": "^9.0.18",
|
|
46
|
+
"@testing-library/react": "^16.3.0",
|
|
47
|
+
"@types/node": "^22.15.21",
|
|
48
|
+
"@types/react": "^19.1.2",
|
|
49
|
+
"@types/react-dom": "^19.1.2",
|
|
50
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
51
|
+
"@vitest/browser": "^3.1.4",
|
|
52
|
+
"@vitest/coverage-v8": "^3.1.4",
|
|
53
|
+
"@vitest/ui": "^3.1.4",
|
|
54
|
+
"babel-plugin-react-remove-properties": "^0.3.0",
|
|
55
|
+
"eslint": "^9.25.0",
|
|
56
|
+
"eslint-config-prettier": "^10.1.5",
|
|
57
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
58
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
59
|
+
"eslint-plugin-storybook": "^9.0.18",
|
|
60
|
+
"globals": "^16.0.0",
|
|
61
|
+
"happy-dom": "^15.11.6",
|
|
62
|
+
"jsdom": "^26.1.0",
|
|
63
|
+
"notistack": "^3.0.1",
|
|
64
|
+
"playwright": "^1.52.0",
|
|
65
|
+
"postcss-scss": "^4.0.9",
|
|
66
|
+
"prettier": "^3.5.3",
|
|
67
|
+
"sass": "^1.89.0",
|
|
68
|
+
"storybook": "^9.0.18",
|
|
69
|
+
"stylelint": "^16.19.1",
|
|
70
|
+
"stylelint-config-standard": "^38.0.0",
|
|
71
|
+
"stylelint-scss": "^6.12.0",
|
|
72
|
+
"typescript": "~5.8.3",
|
|
73
|
+
"typescript-eslint": "^8.30.1",
|
|
74
|
+
"vite": "^6.3.5",
|
|
75
|
+
"vite-plugin-dts": "^4.5.4",
|
|
76
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
77
|
+
"vitest": "^3.1.4",
|
|
78
|
+
"@storybook/addon-vitest": "9.0.18",
|
|
79
|
+
"@storybook/addon-docs": "^9.0.18",
|
|
80
|
+
"glob": "^11.0.2"
|
|
81
|
+
},
|
|
82
|
+
"eslintConfig": {
|
|
83
|
+
"extends": [
|
|
84
|
+
"plugin:storybook/recommended"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|