@alixpartners/ui-components 2.5.0 → 2.5.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 +97 -97
- package/dist/assets/Datepicker.css +1 -0
- package/dist/assets/DragAndDrop.css +1 -1
- package/dist/assets/FilePicker.css +1 -1
- package/dist/components/Creatable/Creatable.js +1 -1
- package/dist/components/Datepicker/Datepicker.d.ts +22 -0
- package/dist/components/Datepicker/Datepicker.js +228 -0
- package/dist/components/Datepicker/Datepicker.test.d.ts +1 -0
- package/dist/components/Datepicker/Datepicker.test.js +40 -0
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +2 -1
- package/dist/components/DragAndDrop/DragAndDrop.js +80 -76
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/NavBar/NavBar.js +1 -1
- package/dist/components/SplitButton/SplitButton.js +1 -1
- package/dist/components/TagsFields/TagsFields.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/{index-C-3_YVJ1.js → index-D34Qo5Qx.js} +478 -473
- package/dist/{index-C4ffg1vf.js → index-DZ4Gof57.js} +1 -1
- package/dist/{index-D_3jWVyV.js → index-DgdVwltD.js} +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +51 -49
- package/dist/web.config +8 -8
- package/package.json +88 -88
package/README.md
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
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
|
-
## ✨ What’s New in 2.0
|
|
8
|
-
|
|
9
|
-
- Completely redesigned architecture with modern build tooling ([Vite](https://vitejs.dev/))
|
|
10
|
-
- Updated design tokens and styles aligned with AlixPartners Design System
|
|
11
|
-
- Improved accessibility (a11y) and semantic HTML usage
|
|
12
|
-
- Streamlined props API for cleaner integration
|
|
13
|
-
- Enhanced Storybook documentation
|
|
14
|
-
- Faster build & development workflows
|
|
15
|
-
|
|
16
|
-
### Version Support
|
|
17
|
-
|
|
18
|
-
- v2.x — Active development (BETA)
|
|
19
|
-
- v1.x — Maintained for legacy projects (no new features, critical fixes only)
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 🚀 Installation
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install @alixpartners/ui-components
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 🔧 Usage
|
|
30
|
-
|
|
31
|
-
```tsx
|
|
32
|
-
import { YourComponent } from '@alixpartners/ui-components'
|
|
33
|
-
|
|
34
|
-
function App() {
|
|
35
|
-
return <YourComponent />
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## 🧱 Components
|
|
40
|
-
|
|
41
|
-
Explore all available components and documentation in Storybook.
|
|
42
|
-
|
|
43
|
-
To run it locally:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm run storybook
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 📦 Build
|
|
52
|
-
|
|
53
|
-
To bundle the library for publishing:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
npm run build
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
The output will be in the `dist/` directory.
|
|
60
|
-
|
|
61
|
-
### Usage in projects while developing
|
|
62
|
-
|
|
63
|
-
When working on the library and testing it in another project:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
# In the component library root:
|
|
67
|
-
npm link
|
|
68
|
-
|
|
69
|
-
# In the consuming project's root:
|
|
70
|
-
npm link alix-partners-react-components-test
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Then import components using the `alix-partners-react-components-test` import.
|
|
74
|
-
|
|
75
|
-
## 🧪 Testing
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
npm run test
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
#### 🧪 Test Coverage
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npm run coverage
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## 📚 Publish
|
|
88
|
-
|
|
89
|
-
To publish to npm:
|
|
90
|
-
|
|
91
|
-
1. Bump the version in `package.json`
|
|
92
|
-
2. Create a pull request in Azure DevOps to the `main` branch
|
|
93
|
-
3. This will automatically publish the library to `npm` once approved
|
|
94
|
-
|
|
95
|
-
## 🤝 Contributing
|
|
96
|
-
|
|
97
|
-
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
|
+
## ✨ What’s New in 2.0
|
|
8
|
+
|
|
9
|
+
- Completely redesigned architecture with modern build tooling ([Vite](https://vitejs.dev/))
|
|
10
|
+
- Updated design tokens and styles aligned with AlixPartners Design System
|
|
11
|
+
- Improved accessibility (a11y) and semantic HTML usage
|
|
12
|
+
- Streamlined props API for cleaner integration
|
|
13
|
+
- Enhanced Storybook documentation
|
|
14
|
+
- Faster build & development workflows
|
|
15
|
+
|
|
16
|
+
### Version Support
|
|
17
|
+
|
|
18
|
+
- v2.x — Active development (BETA)
|
|
19
|
+
- v1.x — Maintained for legacy projects (no new features, critical fixes only)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🚀 Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @alixpartners/ui-components
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 🔧 Usage
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { YourComponent } from '@alixpartners/ui-components'
|
|
33
|
+
|
|
34
|
+
function App() {
|
|
35
|
+
return <YourComponent />
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🧱 Components
|
|
40
|
+
|
|
41
|
+
Explore all available components and documentation in Storybook.
|
|
42
|
+
|
|
43
|
+
To run it locally:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm run storybook
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 📦 Build
|
|
52
|
+
|
|
53
|
+
To bundle the library for publishing:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The output will be in the `dist/` directory.
|
|
60
|
+
|
|
61
|
+
### Usage in projects while developing
|
|
62
|
+
|
|
63
|
+
When working on the library and testing it in another project:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# In the component library root:
|
|
67
|
+
npm link
|
|
68
|
+
|
|
69
|
+
# In the consuming project's root:
|
|
70
|
+
npm link alix-partners-react-components-test
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Then import components using the `alix-partners-react-components-test` import.
|
|
74
|
+
|
|
75
|
+
## 🧪 Testing
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm run test
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### 🧪 Test Coverage
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run coverage
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 📚 Publish
|
|
88
|
+
|
|
89
|
+
To publish to npm:
|
|
90
|
+
|
|
91
|
+
1. Bump the version in `package.json`
|
|
92
|
+
2. Create a pull request in Azure DevOps to the `main` branch
|
|
93
|
+
3. This will automatically publish the library to `npm` once approved
|
|
94
|
+
|
|
95
|
+
## 🤝 Contributing
|
|
96
|
+
|
|
97
|
+
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Datepicker-module__datepicker___SxV3q{display:flex;flex-direction:column;gap:6px;min-width:240px}.Datepicker-module__label___uPuKe{display:flex;align-items:center;gap:4px;color:#4a4a4a;font-size:14px;font-weight:500;line-height:1.2}.Datepicker-module__labelText___BAflA{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Datepicker-module__required___cAVa1{color:#cb282e}.Datepicker-module__labelTooltipIcon___n2IvH{color:#4a4a4a;font-size:16px}.Datepicker-module__inputWrapper___aKtHi{width:100%;height:32px;display:flex;align-items:center;gap:6px;border:1px solid #cccccc;border-radius:4px;background-color:#fff;padding:0 8px;text-align:left;cursor:pointer}.Datepicker-module__inputWrapper___aKtHi:focus{outline:none;border-color:#5cb335}.Datepicker-module__inputIcon___OUb8V{font-size:20px;color:#4a4a4a}.Datepicker-module__inputText___rwYA-{color:#28292c;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.Datepicker-module__placeholder___UVl-W{color:#878787}.Datepicker-module__error___C5WX8{border-color:#bf494e}.Datepicker-module__calendarContainer___Bjfa8{border:1px solid #cccccc;border-radius:4px;background:#fff;box-shadow:0 0 4px #00000029;width:236px;padding:0;z-index:1000}.Datepicker-module__calendarHeader___a7I0V{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 6px}.Datepicker-module__calendarDivider___DRk4M{height:1px;margin:0;background:#ccc}.Datepicker-module__headerActions___AP324{display:flex;align-items:center}.Datepicker-module__headerAction___nyMJF{width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#4a4a4a;cursor:pointer;display:flex;align-items:center;justify-content:center}.Datepicker-module__headerActionIcon___J8RC-{font-size:16px}.Datepicker-module__headerLabel___IPAo-{border:none;background:transparent;color:#28292c;cursor:pointer;font-family:Roboto;font-size:16px;font-style:normal;font-weight:500;line-height:100%;text-align:left}.Datepicker-module__calendarBody___yaLJA{padding:6px 6px 0}.Datepicker-module__weekdays___noAbQ{display:grid;grid-template-columns:repeat(7,32px);column-gap:0;row-gap:0;margin-bottom:8px}.Datepicker-module__weekday___0hrfJ{color:#727272;font-size:12px;text-align:center;line-height:20px}.Datepicker-module__grid___lJEHW{display:grid;grid-template-columns:repeat(7,32px);column-gap:0;row-gap:8px}.Datepicker-module__gridMonths___n1wAM,.Datepicker-module__gridYears___cI0YR{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.Datepicker-module__day___3XU9S{height:32px;border:none;border-radius:4px;background:transparent;color:#4a4a4a;font-size:14px;cursor:pointer}.Datepicker-module__date___G2cRK,.Datepicker-module__month___VKvm3,.Datepicker-module__year___9OzXM{display:flex;align-items:center;justify-content:center}.Datepicker-module__month___VKvm3{height:48px;color:#4a4a4a}.Datepicker-module__month___VKvm3:not(.Datepicker-module__daySelected___DkZ5T):not(:disabled):hover{box-shadow:inset 0 0 0 1px #498e2b;color:#498e2b}.Datepicker-module__year___9OzXM{height:48px;color:#4a4a4a}.Datepicker-module__year___9OzXM:not(.Datepicker-module__daySelected___DkZ5T):not(:disabled):hover{box-shadow:inset 0 0 0 1px #498e2b;color:#498e2b}.Datepicker-module__date___G2cRK{position:relative;width:32px}.Datepicker-module__date___G2cRK:not(.Datepicker-module__daySelected___DkZ5T):not(:disabled):hover{box-shadow:inset 0 0 0 1px #498e2b;color:#498e2b}.Datepicker-module__dayOutside___CXb-b{color:#b2b2b2}.Datepicker-module__daySelected___DkZ5T{background:#498e2b;color:#fff}.Datepicker-module__dayTodayCurrent___ocAqU{color:#498e2b}.Datepicker-module__dayTodayDot___ZyD-l{position:absolute;bottom:3px;left:50%;width:4px;height:4px;border-radius:4px;background:#5cb335;transform:translate(-50%)}.Datepicker-module__calendarFooter___sLvNP{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px;padding:8px 6px}.Datepicker-module__calendarFooterSpacer___3IXgI{flex:1;min-height:32px}.Datepicker-module__todayButton___zl9VO{border:1px solid #498e2b;background:#fff;color:#498e2b;border-radius:2px;height:32px;padding:0 12px;font-size:14px;font-weight:500;cursor:pointer}.Datepicker-module__helperRow___IKmCq{display:flex;align-items:center;height:16px}.Datepicker-module__helpText___g7zEx{color:#727272;font-size:12px}.Datepicker-module__errorText___7o5Rs{color:#bf494e;font-size:12px}.Datepicker-module__disabled___Hlnlo .Datepicker-module__label___uPuKe{color:#b2b2b2}.Datepicker-module__disabled___Hlnlo .Datepicker-module__labelTooltipIcon___n2IvH,.Datepicker-module__disabled___Hlnlo .Datepicker-module__inputIcon___OUb8V{color:#ccc}.Datepicker-module__disabled___Hlnlo .Datepicker-module__inputWrapper___aKtHi{cursor:not-allowed}.Datepicker-module__disabled___Hlnlo .Datepicker-module__inputText___rwYA-,.Datepicker-module__disabled___Hlnlo .Datepicker-module__required___cAVa1{color:#b2b2b2}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.DragAndDrop-module__drag-and-drop-container___WHqGh{display:flex;flex-direction:column;gap:12px}.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do{cursor:not-allowed}.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do label,.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do .DragAndDrop-module__required___z3cHB,.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do .DragAndDrop-module__drag-and-drop-space-text-message___fL-Ac,.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do .DragAndDrop-module__drag-and-drop-space-text-constraints___YrL7J{color:#b2b2b2}label{display:flex;align-items:center;gap:4px;font-size:14px;font-weight:500;color:#4a4a4a}.DragAndDrop-module__required___z3cHB{color:#cb282e;font-size:14px;font-weight:500}.DragAndDrop-module__drag-and-drop-space___09a0I{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 48px;border:2px dashed #cccccc;border-radius:4px;gap:12px}.DragAndDrop-module__drag-and-drop-space___09a0I.DragAndDrop-module__active___ZMuEx{background-color:#f1f6f0;border-color:#5cb335}.DragAndDrop-module__drag-and-drop-space-text___-8rqC{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}.DragAndDrop-module__drag-and-drop-space-text-message___fL-Ac{color:#4a4a4a;font-weight:500;font-size:14px}.DragAndDrop-module__drag-and-drop-space-text-constraints___YrL7J{color:#727272;font-size:14px}ul.DragAndDrop-module__drag-and-drop-files-list___7WNCk{display:flex;flex-direction:column;list-style:none;padding-left:0;margin:0}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M{padding-bottom:12px;padding-top:12px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M:first-child{padding-top:0}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-content___lx7-M{display:flex;align-items:start;gap:8px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-content-data___qQq7-{display:flex;align-items:center;justify-content:space-between;width:100%}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-icon-container___EDvX4{background-color:#f1f1f1;border-radius:4px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-icon___Dx9YE{display:flex;align-items:center;justify-content:center;color:#878787;font-size:20px;height:34px;width:32px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-text___xPCPA{display:flex;flex-direction:column;gap:3px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-name___M7OAd{color:#4a4a4a;font-size:14px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-size___aaovj{color:#727272;font-size:12px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-error___yR0DY{display:flex;align-items:center;gap:3px;color:#cb282e;font-size:12px;font-weight:500}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-icon-error___17EE-{color:#cb282e;font-size:16px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M:not(:last-child){border-bottom:2px solid #cccccc}.DragAndDrop-module__drag-and-drop-files-list-item-icon-delete___Z1l-B{font-size:20px!important}
|
|
1
|
+
.DragAndDrop-module__drag-and-drop-container___WHqGh{display:flex;flex-direction:column;gap:12px}.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do{cursor:not-allowed}.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do label,.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do .DragAndDrop-module__required___z3cHB,.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do .DragAndDrop-module__drag-and-drop-space-text-message___fL-Ac,.DragAndDrop-module__drag-and-drop-container___WHqGh.DragAndDrop-module__disabled___h47do .DragAndDrop-module__drag-and-drop-space-text-constraints___YrL7J{color:#b2b2b2}label{display:flex;align-items:center;gap:4px;font-size:14px;font-weight:500;color:#4a4a4a}.DragAndDrop-module__required___z3cHB{color:#cb282e;font-size:14px;font-weight:500}.DragAndDrop-module__drag-and-drop-space___09a0I{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 48px;border:2px dashed #cccccc;border-radius:4px;gap:12px}.DragAndDrop-module__drag-and-drop-space___09a0I.DragAndDrop-module__active___ZMuEx{background-color:#f1f6f0;border-color:#5cb335}.DragAndDrop-module__drag-and-drop-space___09a0I.DragAndDrop-module__error___zw69d{border-color:#bf494e}.DragAndDrop-module__drag-and-drop-space-text___-8rqC{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}.DragAndDrop-module__drag-and-drop-space-text-message___fL-Ac{color:#4a4a4a;font-weight:500;font-size:14px}.DragAndDrop-module__drag-and-drop-space-text-constraints___YrL7J{color:#727272;font-size:14px}.DragAndDrop-module__error-message___om0Oy{color:#bf494e;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2;font-weight:400}ul.DragAndDrop-module__drag-and-drop-files-list___7WNCk{display:flex;flex-direction:column;list-style:none;padding-left:0;margin:0}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M{padding-bottom:12px;padding-top:12px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M:first-child{padding-top:0}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-content___lx7-M{display:flex;align-items:start;gap:8px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-content-data___qQq7-{display:flex;align-items:center;justify-content:space-between;width:100%}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-icon-container___EDvX4{background-color:#f1f1f1;border-radius:4px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-icon___Dx9YE{display:flex;align-items:center;justify-content:center;color:#878787;font-size:20px;height:34px;width:32px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-text___xPCPA{display:flex;flex-direction:column;gap:3px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-name___M7OAd{color:#4a4a4a;font-size:14px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-size___aaovj{color:#727272;font-size:12px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-error___yR0DY{display:flex;align-items:center;gap:3px;color:#cb282e;font-size:12px;font-weight:500}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M .DragAndDrop-module__drag-and-drop-files-list-item-icon-error___17EE-{color:#cb282e;font-size:16px}.DragAndDrop-module__drag-and-drop-files-list-item___vQO6M:not(:last-child){border-bottom:2px solid #cccccc}.DragAndDrop-module__drag-and-drop-files-list-item-icon-delete___Z1l-B{font-size:20px!important}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.FilePicker-module__container___knCCi{display:flex;flex-direction:column;gap:6px}.FilePicker-module__containerMultiple___Psi5u{gap:12px}.FilePicker-module__label___al7Xe{color:#4a4a4a;font-size:14px;font-weight:500;line-height:1.2;display:flex;align-items:center;gap:4px;min-width:0}.FilePicker-module__required___41Vjd{color:#cb282e}.FilePicker-module__labelTooltipIcon___Cc1QF{color:#4a4a4a;font-size:16px;cursor:pointer}.FilePicker-module__helpers___79-g5{display:flex;justify-content:space-between;align-items:center;min-width:0;height:14px}.FilePicker-module__helperText___ja9Rr{color:#727272;font-size:12px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.FilePicker-module__errorMessage___TvHrL{color:#bf494e;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.FilePicker-module__singleFileHelpLinkContainer___mpjUf{display:flex;align-items:center;gap:6px}.FilePicker-module__singleFileHelpLinkReservedSpace___r8j2b{width:32px;flex-shrink:0}.FilePicker-module__helpLink___uu45D{color:#0369a3;font-size:12px;font-weight:500;text-decoration:none;flex-shrink:0;margin-left:auto;line-height:1.2}.FilePicker-module__helpLink___uu45D:hover{text-decoration:underline}.FilePicker-module__input___cL1Hs{display:none}.FilePicker-module__singleFileContainer___OFSDt{display:flex;align-items:center;gap:8px}.FilePicker-module__singleFileInputContainer___MOkES{display:flex;align-items:center;width:100%;height:32px;border:1px solid #cccccc;border-radius:4px;background-color:#fff}.FilePicker-module__singleFileInputContainer___MOkES:focus,.FilePicker-module__singleFileInputContainer___MOkES:focus-within{border-color:#5cb335;outline:none}.FilePicker-module__inputFileName___sMs7R{display:flex;align-items:center;flex:1;height:100%;font-size:14px;font-weight:400;color:#28292c;border-right:1px solid #cccccc;padding-left:6px}.FilePicker-module__inputFileNamePlaceholder___-mkDD{color:#878787}.FilePicker-module__inputButton___ghLlD{margin-left:6px;margin-right:6px}.FilePicker-module__multipleHelpText___5tnnn{color:#727272;text-align:center;font-family:Roboto;font-size:13px;font-style:normal;font-weight:400;line-height:100%}.FilePicker-module__multipleInputButton___WCJp9{align-self:flex-start}ul.FilePicker-module__multipleFilesList___Kim0I{display:flex;flex-direction:column;list-style:none;padding-left:0;margin:0}.FilePicker-module__multipleFilesListItem___01PDS{padding-bottom:12px;padding-top:12px}.FilePicker-module__multipleFilesListItem___01PDS:first-child{padding-top:0}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemContent___pKbho{display:flex;align-items:start;gap:8px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemContentData___5GC-C{display:flex;align-items:center;justify-content:space-between;width:100%}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemIconContainer___7sUL5{background-color:#f1f1f1;border-radius:4px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemIcon___nfMX9{display:flex;align-items:center;justify-content:center;color:#878787;font-size:20px;height:34px;width:32px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemText___nPqrL{display:flex;flex-direction:column;gap:3px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemName___NjHhX{color:#4a4a4a;font-size:14px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemSize___wc8LJ{color:#727272;font-size:12px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemError___x9qkT{display:flex;align-items:center;gap:3px;color:#
|
|
1
|
+
.FilePicker-module__container___knCCi{display:flex;flex-direction:column;gap:6px}.FilePicker-module__containerMultiple___Psi5u{gap:12px}.FilePicker-module__label___al7Xe{color:#4a4a4a;font-size:14px;font-weight:500;line-height:1.2;display:flex;align-items:center;gap:4px;min-width:0}.FilePicker-module__required___41Vjd{color:#cb282e}.FilePicker-module__labelTooltipIcon___Cc1QF{color:#4a4a4a;font-size:16px;cursor:pointer}.FilePicker-module__helpers___79-g5{display:flex;justify-content:space-between;align-items:center;min-width:0;height:14px}.FilePicker-module__helperText___ja9Rr{color:#727272;font-size:12px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.FilePicker-module__errorMessage___TvHrL{color:#bf494e;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.FilePicker-module__singleFileHelpLinkContainer___mpjUf{display:flex;align-items:center;gap:6px}.FilePicker-module__singleFileHelpLinkReservedSpace___r8j2b{width:32px;flex-shrink:0}.FilePicker-module__helpLink___uu45D{color:#0369a3;font-size:12px;font-weight:500;text-decoration:none;flex-shrink:0;margin-left:auto;line-height:1.2}.FilePicker-module__helpLink___uu45D:hover{text-decoration:underline}.FilePicker-module__input___cL1Hs{display:none}.FilePicker-module__singleFileContainer___OFSDt{display:flex;align-items:center;gap:8px}.FilePicker-module__singleFileInputContainer___MOkES{display:flex;align-items:center;width:100%;height:32px;border:1px solid #cccccc;border-radius:4px;background-color:#fff}.FilePicker-module__singleFileInputContainer___MOkES:focus,.FilePicker-module__singleFileInputContainer___MOkES:focus-within{border-color:#5cb335;outline:none}.FilePicker-module__inputFileName___sMs7R{display:flex;align-items:center;flex:1;height:100%;font-size:14px;font-weight:400;color:#28292c;border-right:1px solid #cccccc;padding-left:6px}.FilePicker-module__inputFileNamePlaceholder___-mkDD{color:#878787}.FilePicker-module__inputButton___ghLlD{margin-left:6px;margin-right:6px}.FilePicker-module__multipleHelpText___5tnnn{color:#727272;text-align:center;font-family:Roboto;font-size:13px;font-style:normal;font-weight:400;line-height:100%}.FilePicker-module__multipleInputButton___WCJp9{align-self:flex-start}ul.FilePicker-module__multipleFilesList___Kim0I{display:flex;flex-direction:column;list-style:none;padding-left:0;margin:0}.FilePicker-module__multipleFilesListItem___01PDS{padding-bottom:12px;padding-top:12px}.FilePicker-module__multipleFilesListItem___01PDS:first-child{padding-top:0}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemContent___pKbho{display:flex;align-items:start;gap:8px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemContentData___5GC-C{display:flex;align-items:center;justify-content:space-between;width:100%}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemIconContainer___7sUL5{background-color:#f1f1f1;border-radius:4px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemIcon___nfMX9{display:flex;align-items:center;justify-content:center;color:#878787;font-size:20px;height:34px;width:32px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemText___nPqrL{display:flex;flex-direction:column;gap:3px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemName___NjHhX{color:#4a4a4a;font-size:14px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemSize___wc8LJ{color:#727272;font-size:12px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemError___x9qkT{display:flex;align-items:center;gap:3px;color:#bf494e;font-size:12px;font-weight:500}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemIconError___0RO46{color:#cb282e;font-size:16px}.FilePicker-module__multipleFilesListItem___01PDS .FilePicker-module__multipleFilesListItemAppendedRow___nzls7{margin-top:8px;min-width:0}.FilePicker-module__multipleFilesListItem___01PDS:not(:last-child){border-bottom:2px solid #cccccc}.FilePicker-module__multipleFilesListItemIconDelete___9Z9Dl{font-size:20px!important}.FilePicker-module__disabled___szMiq .FilePicker-module__label___al7Xe,.FilePicker-module__disabled___szMiq .FilePicker-module__required___41Vjd{color:#b2b2b2}.FilePicker-module__disabled___szMiq .FilePicker-module__labelTooltipIcon___Cc1QF{color:#ccc}.FilePicker-module__disabled___szMiq .FilePicker-module__inputFileName___sMs7R,.FilePicker-module__disabled___szMiq .FilePicker-module__helperText___ja9Rr{color:#b2b2b2}.FilePicker-module__disabled___szMiq .FilePicker-module__helpLink___uu45D{pointer-events:none;color:#878787}.FilePicker-module__disabled___szMiq .FilePicker-module__errorMessage___TvHrL{color:#b2b2b2}.FilePicker-module__disabled___szMiq .FilePicker-module__singleFileInputContainer___MOkES:focus,.FilePicker-module__disabled___szMiq .FilePicker-module__singleFileInputContainer___MOkES:focus-within{border:1px solid #cccccc;border-color:none;outline:none}.FilePicker-module__disabled___szMiq .FilePicker-module__multipleHelpText___5tnnn{color:#b2b2b2}.FilePicker-module__flex___l1rtG{display:flex}
|
|
@@ -5,7 +5,7 @@ import B from "../Icon/Icon.js";
|
|
|
5
5
|
import he from "../Button/Button.js";
|
|
6
6
|
import "../Input/Input.js";
|
|
7
7
|
import Ie from "../Tooltip/Tooltip.js";
|
|
8
|
-
import { R as ve, A as Le, P as Ne, C as ge } from "../../index-
|
|
8
|
+
import { R as ve, A as Le, P as Ne, C as ge } from "../../index-DZ4Gof57.js";
|
|
9
9
|
import '../../assets/Creatable.css';const ye = "Creatable-module__dropdownContainer___y0ptC", De = "Creatable-module__dropdownLabel___RyuSY", ke = "Creatable-module__dropdownLabelDisabled___nhYc0", xe = "Creatable-module__required___g26DB", Oe = "Creatable-module__dropdownWrapper___wu-B3", Ae = "Creatable-module__selectedItemsCreatable___P0mME", Re = "Creatable-module__selectedItem___0LADh", Ve = "Creatable-module__selectedItemLabel___m0LSV", Ee = "Creatable-module__removeButton___tjxwh", Fe = "Creatable-module__removeIcon___KQKbD", Se = "Creatable-module__singleSelectedCreatableItem___tanxX", Me = "Creatable-module__singleSelectedCreatableItemRemoveButton___Qi9Si", Be = "Creatable-module__dropdownActions___FmHZe", Ge = "Creatable-module__dropdownArrow___SJmKg", Ke = "Creatable-module__dropdownArrowOpen___T3E0S", je = "Creatable-module__dropdownMenu___HEhC3", Ue = "Creatable-module__dropdownCreatableSearchContainer___AgXA3", We = "Creatable-module__disabled___ZIdus", $e = "Creatable-module__dropdownCreatableError___FYVla", Je = "Creatable-module__creatableInput___KaKxv", Pe = "Creatable-module__optionsList___VZgJf", Ye = "Creatable-module__categoryGroup___g8f-g", qe = "Creatable-module__categoryDivider___QUgR9", ze = "Creatable-module__categoryLabel___YhGp9", Qe = "Creatable-module__optionItem___Ys808", Ze = "Creatable-module__optionItemDisabled___jvfGz", He = "Creatable-module__optionItemFocused___OfIQd", Te = "Creatable-module__optionContent___9RCsJ", Xe = "Creatable-module__optionLabel___FJfM1", et = "Creatable-module__tickIcon___VjpDN", tt = "Creatable-module__helpers___GmPY4", lt = "Creatable-module__helpText___89mXU", ot = "Creatable-module__helpTextDisabled___shU6E", at = "Creatable-module__helpLink___IdU0g", rt = "Creatable-module__helpLinkDisabled___B8rpy", nt = "Creatable-module__errorMessage___HRKr5", t = {
|
|
10
10
|
dropdownContainer: ye,
|
|
11
11
|
dropdownLabel: De,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TooltipProps } from '../Tooltip/Tooltip';
|
|
2
|
+
export type DatepickerLabelTooltipProps = Omit<TooltipProps, 'children'>;
|
|
3
|
+
type DateFormat = 'MM/DD/YYYY' | 'YYYY/MM/DD' | 'Mon DD, YYYY';
|
|
4
|
+
type DateInput = Date | string | number;
|
|
5
|
+
type DatepickerProps = {
|
|
6
|
+
className?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
value?: DateInput | null;
|
|
10
|
+
defaultValue?: DateInput | null;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
errorMessage?: string;
|
|
14
|
+
helpText?: string;
|
|
15
|
+
minDate?: DateInput;
|
|
16
|
+
maxDate?: DateInput;
|
|
17
|
+
onChange?: (value: Date | null) => void;
|
|
18
|
+
labelTooltip?: DatepickerLabelTooltipProps;
|
|
19
|
+
dateFormat?: DateFormat;
|
|
20
|
+
};
|
|
21
|
+
export default function Datepicker({ className, label, placeholder, value, defaultValue, disabled, required, errorMessage, helpText, minDate, maxDate, onChange, labelTooltip, dateFormat, }: DatepickerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { jsxs as m, jsx as o, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import { c as T } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useState as b, useEffect as ce, useMemo as H } from "react";
|
|
4
|
+
import J from "../Button/Button.js";
|
|
5
|
+
import W from "../Icon/Icon.js";
|
|
6
|
+
import le from "../Tooltip/Tooltip.js";
|
|
7
|
+
import { R as de, T as se, P as ie, C as _e } from "../../index-DZ4Gof57.js";
|
|
8
|
+
import '../../assets/Datepicker.css';const ue = "Datepicker-module__datepicker___SxV3q", pe = "Datepicker-module__label___uPuKe", De = "Datepicker-module__labelText___BAflA", me = "Datepicker-module__required___cAVa1", he = "Datepicker-module__labelTooltipIcon___n2IvH", ye = "Datepicker-module__inputWrapper___aKtHi", ge = "Datepicker-module__inputIcon___OUb8V", fe = "Datepicker-module__inputText___rwYA-", ke = "Datepicker-module__placeholder___UVl-W", Me = "Datepicker-module__error___C5WX8", Ne = "Datepicker-module__calendarContainer___Bjfa8", Se = "Datepicker-module__calendarHeader___a7I0V", Te = "Datepicker-module__calendarDivider___DRk4M", Ae = "Datepicker-module__headerActions___AP324", be = "Datepicker-module__headerAction___nyMJF", Fe = "Datepicker-module__headerActionIcon___J8RC-", Ye = "Datepicker-module__headerLabel___IPAo-", we = "Datepicker-module__calendarBody___yaLJA", Oe = "Datepicker-module__weekdays___noAbQ", Ee = "Datepicker-module__weekday___0hrfJ", Ie = "Datepicker-module__grid___lJEHW", Ce = "Datepicker-module__gridMonths___n1wAM", Re = "Datepicker-module__gridYears___cI0YR", ze = "Datepicker-module__day___3XU9S", ve = "Datepicker-module__date___G2cRK", xe = "Datepicker-module__month___VKvm3", Pe = "Datepicker-module__year___9OzXM", Ve = "Datepicker-module__daySelected___DkZ5T", Be = "Datepicker-module__dayOutside___CXb-b", Le = "Datepicker-module__dayTodayCurrent___ocAqU", $e = "Datepicker-module__dayTodayDot___ZyD-l", He = "Datepicker-module__calendarFooter___sLvNP", Je = "Datepicker-module__calendarFooterSpacer___3IXgI", We = "Datepicker-module__todayButton___zl9VO", Xe = "Datepicker-module__helperRow___IKmCq", Ue = "Datepicker-module__helpText___g7zEx", qe = "Datepicker-module__errorText___7o5Rs", Ke = "Datepicker-module__disabled___Hlnlo", e = {
|
|
9
|
+
datepicker: ue,
|
|
10
|
+
label: pe,
|
|
11
|
+
labelText: De,
|
|
12
|
+
required: me,
|
|
13
|
+
labelTooltipIcon: he,
|
|
14
|
+
inputWrapper: ye,
|
|
15
|
+
inputIcon: ge,
|
|
16
|
+
inputText: fe,
|
|
17
|
+
placeholder: ke,
|
|
18
|
+
error: Me,
|
|
19
|
+
calendarContainer: Ne,
|
|
20
|
+
calendarHeader: Se,
|
|
21
|
+
calendarDivider: Te,
|
|
22
|
+
headerActions: Ae,
|
|
23
|
+
headerAction: be,
|
|
24
|
+
headerActionIcon: Fe,
|
|
25
|
+
headerLabel: Ye,
|
|
26
|
+
calendarBody: we,
|
|
27
|
+
weekdays: Oe,
|
|
28
|
+
weekday: Ee,
|
|
29
|
+
grid: Ie,
|
|
30
|
+
gridMonths: Ce,
|
|
31
|
+
gridYears: Re,
|
|
32
|
+
day: ze,
|
|
33
|
+
date: ve,
|
|
34
|
+
month: xe,
|
|
35
|
+
year: Pe,
|
|
36
|
+
daySelected: Ve,
|
|
37
|
+
dayOutside: Be,
|
|
38
|
+
dayTodayCurrent: Le,
|
|
39
|
+
dayTodayDot: $e,
|
|
40
|
+
calendarFooter: He,
|
|
41
|
+
calendarFooterSpacer: Je,
|
|
42
|
+
todayButton: We,
|
|
43
|
+
helperRow: Xe,
|
|
44
|
+
helpText: Ue,
|
|
45
|
+
errorText: qe,
|
|
46
|
+
disabled: Ke
|
|
47
|
+
}, Ge = 7, je = 6, Ze = Ge * je, g = 12, Qe = 1, et = 1, q = 1, I = 1, tt = 1, at = 1, f = 1, nt = 6, ot = "Label", rt = "Today", ct = "ap-icon-date", lt = "ap-icon-info", dt = "ap-icon-expand-more", st = "ap-icon-expand-less", it = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], v = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], _t = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ut = (t) => {
|
|
48
|
+
if (t instanceof Date)
|
|
49
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
50
|
+
if (typeof t == "string" || typeof t == "number") {
|
|
51
|
+
const a = new Date(t);
|
|
52
|
+
return Number.isNaN(a.getTime()) ? null : a;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}, i = (t) => {
|
|
56
|
+
const a = ut(t);
|
|
57
|
+
return a ? new Date(a.getFullYear(), a.getMonth(), a.getDate()) : null;
|
|
58
|
+
}, X = (t, a) => t.getFullYear() === a.getFullYear() && t.getMonth() === a.getMonth() && t.getDate() === a.getDate(), U = (t) => String(t).padStart(2, "0"), pt = (t, a) => {
|
|
59
|
+
const _ = U(t.getMonth() + 1), r = U(t.getDate()), s = t.getFullYear();
|
|
60
|
+
return a === "Mon DD, YYYY" ? `${v[t.getMonth()]} ${r}, ${s}` : a === "YYYY/MM/DD" ? `${s}/${_}/${r}` : `${_}/${r}/${s}`;
|
|
61
|
+
}, Dt = (t, a) => {
|
|
62
|
+
const r = new Date(t, a, f).getDay(), s = new Date(t, a + I, 0).getDate(), D = new Date(t, a, 0).getDate(), c = [];
|
|
63
|
+
for (let l = r - Qe; l >= 0; l -= 1)
|
|
64
|
+
c.push({
|
|
65
|
+
date: new Date(t, a - q, D - l),
|
|
66
|
+
inCurrentMonth: !1
|
|
67
|
+
});
|
|
68
|
+
for (let l = f; l <= s; l += 1)
|
|
69
|
+
c.push({
|
|
70
|
+
date: new Date(t, a, l),
|
|
71
|
+
inCurrentMonth: !0
|
|
72
|
+
});
|
|
73
|
+
for (; c.length < Ze; ) {
|
|
74
|
+
const l = c.length - (r + s) + et;
|
|
75
|
+
c.push({
|
|
76
|
+
date: new Date(t, a + I, l),
|
|
77
|
+
inCurrentMonth: !1
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return c;
|
|
81
|
+
};
|
|
82
|
+
function mt({
|
|
83
|
+
day: t,
|
|
84
|
+
selectedDate: a,
|
|
85
|
+
currentMonth: _,
|
|
86
|
+
minDate: r,
|
|
87
|
+
maxDate: s,
|
|
88
|
+
onSelect: D
|
|
89
|
+
}) {
|
|
90
|
+
const c = i(t.date);
|
|
91
|
+
if (!c) return null;
|
|
92
|
+
const l = r ? i(r) : null, k = s ? i(s) : null, u = !!(l && c < l || k && c > k), h = i(a), M = h ? X(c, h) : !1, y = i(/* @__PURE__ */ new Date()), F = y ? X(c, y) : !1;
|
|
93
|
+
return /* @__PURE__ */ m("button", { type: "button", className: T(e.day, e.date, !t.inCurrentMonth && e.dayOutside, t.date.getMonth() !== _ && e.dayOutside, u && e.dayOutside, F && !M && e.dayTodayCurrent, M && e.daySelected), onClick: () => D(c), disabled: u, children: [
|
|
94
|
+
t.date.getDate(),
|
|
95
|
+
F && !M && /* @__PURE__ */ o("span", { className: e.dayTodayDot })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
function ht({
|
|
99
|
+
monthIndex: t,
|
|
100
|
+
activeMonth: a,
|
|
101
|
+
year: _,
|
|
102
|
+
minDate: r,
|
|
103
|
+
maxDate: s,
|
|
104
|
+
onSelect: D
|
|
105
|
+
}) {
|
|
106
|
+
const c = r ? i(r) : null, l = s ? i(s) : null, k = new Date(_, t, f), u = new Date(_, t + I, 0), h = !!(c && u < c || l && k > l);
|
|
107
|
+
return /* @__PURE__ */ o("button", { type: "button", className: T(e.day, e.month, h && e.dayOutside, t === a && e.daySelected), onClick: () => D(t), disabled: h, children: v[t] });
|
|
108
|
+
}
|
|
109
|
+
function yt({
|
|
110
|
+
year: t,
|
|
111
|
+
activeYear: a,
|
|
112
|
+
minDate: _,
|
|
113
|
+
maxDate: r,
|
|
114
|
+
onSelect: s
|
|
115
|
+
}) {
|
|
116
|
+
const D = _ ? i(_) : null, c = r ? i(r) : null, l = new Date(t, 0, f), k = new Date(t, 11, 31), u = !!(D && k < D || c && l > c);
|
|
117
|
+
return /* @__PURE__ */ o("button", { type: "button", className: T(e.day, e.year, u && e.dayOutside, t === a && e.daySelected), onClick: () => s(t), disabled: u, children: t });
|
|
118
|
+
}
|
|
119
|
+
function At({
|
|
120
|
+
className: t,
|
|
121
|
+
label: a = ot,
|
|
122
|
+
placeholder: _ = "",
|
|
123
|
+
value: r,
|
|
124
|
+
defaultValue: s = /* @__PURE__ */ new Date(),
|
|
125
|
+
disabled: D = !1,
|
|
126
|
+
required: c = !1,
|
|
127
|
+
errorMessage: l,
|
|
128
|
+
helpText: k,
|
|
129
|
+
minDate: u,
|
|
130
|
+
maxDate: h,
|
|
131
|
+
onChange: M,
|
|
132
|
+
labelTooltip: y,
|
|
133
|
+
dateFormat: F = "MM/DD/YYYY"
|
|
134
|
+
}) {
|
|
135
|
+
const C = r !== void 0 && !!M, R = i(r), z = i(s), x = i(/* @__PURE__ */ new Date()) ?? /* @__PURE__ */ new Date(), [K, P] = b(!1), [Y, V] = b(() => r === null ? null : R ?? z), [p, S] = b("date"), [d, N] = b(() => r === null ? x : R || z || x), [w, O] = b(Math.floor(d.getFullYear() / g) * g);
|
|
136
|
+
ce(() => {
|
|
137
|
+
if (!C) return;
|
|
138
|
+
const n = i(r);
|
|
139
|
+
V(n), n && (N(n), O(Math.floor(n.getFullYear() / g) * g));
|
|
140
|
+
}, [C, r]);
|
|
141
|
+
const G = Y ? pt(Y, F) : _, E = i(/* @__PURE__ */ new Date()) ?? /* @__PURE__ */ new Date(), B = u ? i(u) : null, L = h ? i(h) : null, j = !!(B && E < B || L && E > L), Z = H(() => Dt(d.getFullYear(), d.getMonth()), [d]), Q = H(() => Array.from({
|
|
142
|
+
length: g
|
|
143
|
+
}, (n, A) => w + A), [w]), ee = (n) => {
|
|
144
|
+
C || V(n), M == null || M(n);
|
|
145
|
+
}, te = () => {
|
|
146
|
+
if (p === "date") {
|
|
147
|
+
S("month");
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (p === "month") {
|
|
151
|
+
S("year");
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
}, ae = () => {
|
|
155
|
+
if (p === "date") {
|
|
156
|
+
N(new Date(d.getFullYear(), d.getMonth() - q, f));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (p === "month") {
|
|
160
|
+
N(new Date(d.getFullYear() - tt, d.getMonth(), f));
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
O((n) => n - g);
|
|
164
|
+
}, ne = () => {
|
|
165
|
+
if (p === "date") {
|
|
166
|
+
N(new Date(d.getFullYear(), d.getMonth() + I, f));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (p === "month") {
|
|
170
|
+
N(new Date(d.getFullYear() + at, d.getMonth(), f));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
O((n) => n + g);
|
|
174
|
+
}, $ = (n) => {
|
|
175
|
+
ee(n), N(n), P(!1), S("date");
|
|
176
|
+
};
|
|
177
|
+
return /* @__PURE__ */ m("div", { className: T(e.datepicker, t, D && e.disabled), children: [
|
|
178
|
+
a && /* @__PURE__ */ m("label", { className: e.label, children: [
|
|
179
|
+
/* @__PURE__ */ o("span", { className: e.labelText, children: a }),
|
|
180
|
+
c && /* @__PURE__ */ o("span", { className: e.required, children: "*" }),
|
|
181
|
+
y && /* @__PURE__ */ o(le, { content: y.content, size: y.size, theme: y.theme, tipSide: y.tipSide, tipAlignment: y.tipAlignment, startVisible: y.startVisible, children: /* @__PURE__ */ o(W, { icon: lt, className: e.labelTooltipIcon }) })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ m(de, { open: K, onOpenChange: (n) => {
|
|
184
|
+
D || (P(n), n || S("date"));
|
|
185
|
+
}, children: [
|
|
186
|
+
/* @__PURE__ */ m(se, { className: T(e.inputWrapper, l && e.error), disabled: D, children: [
|
|
187
|
+
/* @__PURE__ */ o(W, { icon: ct, className: e.inputIcon }),
|
|
188
|
+
/* @__PURE__ */ o("span", { className: T(e.inputText, !Y && e.placeholder), children: G })
|
|
189
|
+
] }),
|
|
190
|
+
/* @__PURE__ */ o(ie, { children: /* @__PURE__ */ m(_e, { side: "bottom", align: "start", sideOffset: nt, className: e.calendarContainer, children: [
|
|
191
|
+
/* @__PURE__ */ m("div", { className: e.calendarHeader, children: [
|
|
192
|
+
/* @__PURE__ */ m("button", { type: "button", className: e.headerLabel, onClick: te, disabled: p === "year", children: [
|
|
193
|
+
p === "date" && `${_t[d.getMonth()]} ${d.getFullYear()}`,
|
|
194
|
+
p === "month" && `${d.getFullYear()}`,
|
|
195
|
+
p === "year" && `${w} - ${w + g - 1}`
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ m("div", { className: e.headerActions, children: [
|
|
198
|
+
/* @__PURE__ */ o(J, { size: "md", type: "tertiary", className: e.headerAction, icon: st, iconClassName: e.headerActionIcon, onClick: ae }),
|
|
199
|
+
/* @__PURE__ */ o(J, { size: "md", type: "tertiary", className: e.headerAction, icon: dt, iconClassName: e.headerActionIcon, onClick: ne })
|
|
200
|
+
] })
|
|
201
|
+
] }),
|
|
202
|
+
/* @__PURE__ */ o("div", { className: e.calendarDivider }),
|
|
203
|
+
/* @__PURE__ */ m("div", { className: e.calendarBody, children: [
|
|
204
|
+
p === "date" && /* @__PURE__ */ m(re, { children: [
|
|
205
|
+
/* @__PURE__ */ o("div", { className: e.weekdays, children: it.map((n) => /* @__PURE__ */ o("span", { className: e.weekday, children: n }, n)) }),
|
|
206
|
+
/* @__PURE__ */ o("div", { className: e.grid, children: Z.map((n) => /* @__PURE__ */ o(mt, { day: n, selectedDate: Y, currentMonth: d.getMonth(), minDate: u, maxDate: h, onSelect: $ }, n.date.toISOString())) })
|
|
207
|
+
] }),
|
|
208
|
+
p === "month" && /* @__PURE__ */ o("div", { className: e.gridMonths, children: v.map((n, A) => /* @__PURE__ */ o(ht, { monthIndex: A, activeMonth: d.getMonth(), year: d.getFullYear(), minDate: u, maxDate: h, onSelect: (oe) => {
|
|
209
|
+
N(new Date(d.getFullYear(), oe, f)), S("date");
|
|
210
|
+
} }, n)) }),
|
|
211
|
+
p === "year" && /* @__PURE__ */ o("div", { className: e.gridYears, children: Q.map((n) => /* @__PURE__ */ o(yt, { year: n, activeYear: d.getFullYear(), minDate: u, maxDate: h, onSelect: (A) => {
|
|
212
|
+
N(new Date(A, d.getMonth(), f)), S("month");
|
|
213
|
+
} }, n)) })
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ m("div", { className: e.calendarFooter, children: [
|
|
216
|
+
/* @__PURE__ */ o("div", { className: e.calendarFooterSpacer }),
|
|
217
|
+
/* @__PURE__ */ o("button", { type: "button", className: e.todayButton, disabled: j, onClick: () => {
|
|
218
|
+
$(E), O(Math.floor(E.getFullYear() / g) * g);
|
|
219
|
+
}, children: rt })
|
|
220
|
+
] })
|
|
221
|
+
] }) })
|
|
222
|
+
] }),
|
|
223
|
+
/* @__PURE__ */ o("div", { className: e.helperRow, children: l ? /* @__PURE__ */ o("span", { className: e.errorText, children: l }) : k && /* @__PURE__ */ o("span", { className: e.helpText, children: k }) })
|
|
224
|
+
] });
|
|
225
|
+
}
|
|
226
|
+
export {
|
|
227
|
+
At as default
|
|
228
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { d as u, i as c, r as B, g as e, s as d, f as D, v as m } from "../../vi.bdSIJ99Y-017e_Pkz.js";
|
|
3
|
+
import g from "./Datepicker.js";
|
|
4
|
+
u("Datepicker", () => {
|
|
5
|
+
c("should render datepicker container", () => {
|
|
6
|
+
B(/* @__PURE__ */ l(g, {})), e(d.getByTestId("datepicker")).toBeInTheDocument();
|
|
7
|
+
}), c("should render required marker when required is true", () => {
|
|
8
|
+
B(/* @__PURE__ */ l(g, { label: "Start date", required: !0 })), e(d.getByTestId("datepicker-label")).toHaveTextContent("*");
|
|
9
|
+
}), c("should keep calendar closed and trigger disabled when disabled is true", () => {
|
|
10
|
+
B(/* @__PURE__ */ l(g, { disabled: !0 }));
|
|
11
|
+
const t = d.getByTestId("datepicker-trigger");
|
|
12
|
+
e(t).toBeDisabled(), D.click(t), e(d.queryByTestId("datepicker-calendar")).not.toBeInTheDocument();
|
|
13
|
+
}), c("should disable days outside minDate and maxDate", () => {
|
|
14
|
+
B(/* @__PURE__ */ l(g, { defaultValue: new Date(2025, 0, 15), minDate: new Date(2025, 0, 10), maxDate: new Date(2025, 0, 20) })), D.click(d.getByTestId("datepicker-trigger"));
|
|
15
|
+
const t = d.getAllByTestId("datepicker-day"), r = t.find((i) => {
|
|
16
|
+
var a;
|
|
17
|
+
return ((a = i.textContent) == null ? void 0 : a.trim()) === "9";
|
|
18
|
+
}), n = t.find((i) => {
|
|
19
|
+
var a;
|
|
20
|
+
return ((a = i.textContent) == null ? void 0 : a.trim()) === "10";
|
|
21
|
+
}), o = t.find((i) => {
|
|
22
|
+
var a;
|
|
23
|
+
return ((a = i.textContent) == null ? void 0 : a.trim()) === "20";
|
|
24
|
+
}), s = t.find((i) => {
|
|
25
|
+
var a;
|
|
26
|
+
return ((a = i.textContent) == null ? void 0 : a.trim()) === "21";
|
|
27
|
+
});
|
|
28
|
+
e(r).toBeDefined(), e(n).toBeDefined(), e(o).toBeDefined(), e(s).toBeDefined(), e(r).toBeDisabled(), e(n).not.toBeDisabled(), e(o).not.toBeDisabled(), e(s).toBeDisabled();
|
|
29
|
+
}), c("should call onChange with selected date", () => {
|
|
30
|
+
const t = m.fn();
|
|
31
|
+
B(/* @__PURE__ */ l(g, { defaultValue: new Date(2025, 0, 15), onChange: t })), D.click(d.getByTestId("datepicker-trigger"));
|
|
32
|
+
const r = d.getAllByTestId("datepicker-day").find((o) => {
|
|
33
|
+
var s;
|
|
34
|
+
return !o.className.includes("dayOutside") && ((s = o.textContent) == null ? void 0 : s.trim()) === "16";
|
|
35
|
+
});
|
|
36
|
+
e(r).toBeDefined(), D.click(r), e(t).toHaveBeenCalledTimes(1);
|
|
37
|
+
const n = t.mock.calls[0][0];
|
|
38
|
+
e(n).toBeInstanceOf(Date), e(n.getFullYear()).toBe(2025), e(n.getMonth()).toBe(0), e(n.getDate()).toBe(16);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -38,6 +38,7 @@ type DragAndDropProps = {
|
|
|
38
38
|
disabled?: boolean;
|
|
39
39
|
label?: string;
|
|
40
40
|
required?: boolean;
|
|
41
|
+
errorMessage?: string;
|
|
41
42
|
fileExtensionsAllowed: string[];
|
|
42
43
|
maxSize?: number;
|
|
43
44
|
maxFiles?: number;
|
|
@@ -93,5 +94,5 @@ type DragAndDropProps = {
|
|
|
93
94
|
* @param {boolean} [props.queueFiles] - When true, newly selected files are appended to the existing list
|
|
94
95
|
* @returns {JSX.Element} The rendered DragAndDrop component
|
|
95
96
|
*/
|
|
96
|
-
export default function DragAndDrop({ label, type, disabled, required, fileExtensionsAllowed, maxSize, maxFiles, value, onUpload, onRemoveFile, queueFiles, className, maxSizeErrorMessage, fileExtensionInvalidErrorMessage, texts, fileIcon, errorIcon, deleteIcon, browseButtonIcon, renderFileItem, fileSizeFormatter, browseButtonProps, validator, errors: externalErrors, ...props }: DragAndDropProps): import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
export default function DragAndDrop({ label, type, disabled, required, errorMessage, fileExtensionsAllowed, maxSize, maxFiles, value, onUpload, onRemoveFile, queueFiles, className, maxSizeErrorMessage, fileExtensionInvalidErrorMessage, texts, fileIcon, errorIcon, deleteIcon, browseButtonIcon, renderFileItem, fileSizeFormatter, browseButtonProps, validator, errors: externalErrors, ...props }: DragAndDropProps): import("react/jsx-runtime").JSX.Element;
|
|
97
98
|
export {};
|