@xsolla/xui-date-picker 0.96.0 → 0.97.0
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 +46 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @xsolla/xui-date-picker
|
|
2
|
+
|
|
3
|
+
Date and date-range picker with a calendar popover and localised month/year navigation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-date-picker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { DatePicker } from '@xsolla/xui-date-picker';
|
|
15
|
+
|
|
16
|
+
<DatePicker
|
|
17
|
+
selectedDate={new Date()}
|
|
18
|
+
onChange={(date) => console.log(date)}
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
{/* Range mode */}
|
|
22
|
+
<DatePicker
|
|
23
|
+
selectsRange
|
|
24
|
+
startDate={start}
|
|
25
|
+
endDate={end}
|
|
26
|
+
onChange={([start, end]) => setRange([start, end])}
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
### DatePicker
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Default | Description |
|
|
35
|
+
|------|------|---------|-------------|
|
|
36
|
+
| `onChange` | `(date: Date \| DateRangeType) => void` | — | Called when the selected date or range changes |
|
|
37
|
+
| `selectedDate` | `Date \| null` | — | Currently selected date (single mode) |
|
|
38
|
+
| `selectsRange` | `boolean` | `false` | Enables date-range selection mode |
|
|
39
|
+
| `startDate` | `Date \| null` | — | Range start date |
|
|
40
|
+
| `endDate` | `Date \| null` | — | Range end date |
|
|
41
|
+
| `size` | `"xl" \| "lg" \| "md" \| "sm" \| "xs"` | `"md"` | Size of the input |
|
|
42
|
+
| `placeholder` | `string` | `"MM/DD/YYYY"` | Input placeholder text |
|
|
43
|
+
| `disabled` | `boolean` | — | Disables the input |
|
|
44
|
+
| `locale` | `CalendarLocaleType` | `"enUS"` | date-fns locale key for calendar localisation |
|
|
45
|
+
| `minDate` | `Date \| null` | — | Earliest selectable date |
|
|
46
|
+
| `maxDate` | `Date \| null` | — | Latest selectable date |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-date-picker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-button": "0.
|
|
14
|
-
"@xsolla/xui-core": "0.
|
|
15
|
-
"@xsolla/xui-input": "0.
|
|
16
|
-
"@xsolla/xui-primitives-core": "0.
|
|
17
|
-
"@xsolla/xui-select": "0.
|
|
13
|
+
"@xsolla/xui-button": "0.97.0",
|
|
14
|
+
"@xsolla/xui-core": "0.97.0",
|
|
15
|
+
"@xsolla/xui-input": "0.97.0",
|
|
16
|
+
"@xsolla/xui-primitives-core": "0.97.0",
|
|
17
|
+
"@xsolla/xui-select": "0.97.0",
|
|
18
18
|
"date-fns": "^3.0.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|