@balby/booking-search 1.0.3 → 1.0.5
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 +28 -3
- package/package.json +16 -2
package/README.md
CHANGED
|
@@ -40,15 +40,39 @@ This component requires React 19 and Tailwind CSS. Make sure they are installed:
|
|
|
40
40
|
npm install react react-dom tailwindcss
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
### Importing Styles
|
|
44
|
+
|
|
45
|
+
This package requires you to import the CSS file. Choose one of the following methods:
|
|
46
|
+
|
|
47
|
+
**Option 1: Import in your JavaScript/TypeScript (Recommended)**
|
|
48
|
+
```tsx
|
|
49
|
+
import '@balby/booking-search/styles'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Option 2: Import in your global CSS file**
|
|
53
|
+
```css
|
|
54
|
+
@import '@balby/booking-search/styles';
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Option 3: Direct path import**
|
|
58
|
+
```tsx
|
|
59
|
+
import '@balby/booking-search/dist/index.css'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
> **Note:** All import methods are supported. Choose the one that best fits your build setup.
|
|
63
|
+
|
|
43
64
|
## 🎯 Quick Start
|
|
44
65
|
|
|
45
66
|
### Basic Usage
|
|
46
67
|
|
|
68
|
+
**Important:** You must import the CSS file for the component to display correctly.
|
|
69
|
+
|
|
47
70
|
```tsx
|
|
48
71
|
import { BookingSearch } from '@balby/booking-search'
|
|
49
|
-
import
|
|
72
|
+
import '@balby/booking-search/styles'
|
|
73
|
+
import type { BookingSearchPayload, SearchLocation, AvailabilityDay } from '@balby/booking-search'
|
|
50
74
|
|
|
51
|
-
const locations:
|
|
75
|
+
const locations: SearchLocation[] = [
|
|
52
76
|
{ id: '1', name: 'Rome, Italy', type: 'City', countryCode: 'IT' },
|
|
53
77
|
{ id: '2', name: 'Florence, Italy', type: 'City', countryCode: 'IT' },
|
|
54
78
|
]
|
|
@@ -152,7 +176,8 @@ export default {
|
|
|
152
176
|
You can also use individual sub-components:
|
|
153
177
|
|
|
154
178
|
```tsx
|
|
155
|
-
import { LocationCombobox, DateRangePicker, GuestSelector } from '@booking-search
|
|
179
|
+
import { LocationCombobox, DateRangePicker, GuestSelector } from '@balby/booking-search'
|
|
180
|
+
import '@balby/booking-search/styles'
|
|
156
181
|
|
|
157
182
|
// LocationCombobox
|
|
158
183
|
<LocationCombobox
|
package/package.json
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balby/booking-search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Framework-agnostic React component for booking search, inspired by Booking.com",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"module": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"type": "module",
|
|
12
|
+
"style": "./dist/index.css",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles": {
|
|
20
|
+
"import": "./dist/index.css",
|
|
21
|
+
"require": "./dist/index.css",
|
|
22
|
+
"default": "./dist/index.css"
|
|
23
|
+
},
|
|
24
|
+
"./dist/index.css": "./dist/index.css"
|
|
25
|
+
},
|
|
12
26
|
"files": [
|
|
13
27
|
"dist",
|
|
14
28
|
"src",
|