@usetrip/react-ui 0.1.0 → 0.2.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 +347 -0
- package/dist/AlertBox.cjs +1 -0
- package/dist/AlertBox.d.ts +15 -0
- package/dist/AlertBox.js +5 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.d.ts +22 -0
- package/dist/Button.js +6 -0
- package/dist/ButtonLink.cjs +1 -0
- package/dist/ButtonLink.d.ts +25 -0
- package/dist/ButtonLink.js +6 -0
- package/dist/CalendarInput.cjs +1 -0
- package/dist/CalendarInput.d.ts +19 -0
- package/dist/CalendarInput.js +5 -0
- package/dist/CustomEditor.cjs +1 -0
- package/dist/CustomEditor.d.ts +16 -0
- package/dist/CustomEditor.js +5 -0
- package/dist/InputCounter.cjs +1 -0
- package/dist/InputCounter.d.ts +18 -0
- package/dist/InputCounter.js +5 -0
- package/dist/RangeDatePicker.cjs +1 -0
- package/dist/RangeDatePicker.d.ts +17 -0
- package/dist/RangeDatePicker.js +5 -0
- package/dist/SearchInput.cjs +1 -0
- package/dist/SearchInput.d.ts +15 -0
- package/dist/SearchInput.js +5 -0
- package/dist/TextField.cjs +1 -0
- package/dist/TextField.d.ts +27 -0
- package/dist/TextField.js +5 -0
- package/dist/Typography.cjs +1 -0
- package/dist/Typography.d.ts +25 -0
- package/dist/Typography.js +5 -0
- package/dist/chunks/AlertBox-TM5iLIH2.js +26 -0
- package/dist/chunks/AlertBox-b6dgMZ5I.cjs +1 -0
- package/dist/chunks/Button-C2ZQLgBk.js +75 -0
- package/dist/chunks/Button-DjizmSRN.cjs +1 -0
- package/dist/chunks/ButtonLink-C1BjiV2m.cjs +1 -0
- package/dist/chunks/ButtonLink-CG6S2pym.js +105 -0
- package/dist/chunks/CalendarInput-CPV0f1Gl.cjs +1 -0
- package/dist/chunks/CalendarInput-CxvAV7hK.js +58 -0
- package/dist/chunks/CustomEditor-BW_Mgv0y.cjs +1 -0
- package/dist/chunks/CustomEditor-q2MqCUUF.js +28 -0
- package/dist/chunks/InputCounter-6ZYoaiaX.js +46 -0
- package/dist/chunks/InputCounter-srYivV6j.cjs +1 -0
- package/dist/chunks/RangeDatePicker-CoEU93mq.cjs +1 -0
- package/dist/chunks/RangeDatePicker-DwccOp_Y.js +458 -0
- package/dist/chunks/SearchInput-5J5H9Yfv.js +55 -0
- package/dist/chunks/SearchInput-Dp1Q72Co.cjs +1 -0
- package/dist/chunks/TextField-DX6eZufy.js +145 -0
- package/dist/chunks/TextField-Dr3vhUtA.cjs +1 -0
- package/dist/chunks/Typography-B892BQsd.js +166 -0
- package/dist/chunks/Typography-CTDehHO_.cjs +1 -0
- package/dist/chunks/utils-D1b-iVvd.cjs +1 -0
- package/dist/chunks/utils-D9fNSpDp.js +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +22 -1110
- package/package.json +52 -1
package/README.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# @usetrip/react-ui
|
|
2
|
+
|
|
3
|
+
> Shared React component library for the UseTrip platform — built with TypeScript, Tailwind CSS v4, and Radix UI.
|
|
4
|
+
|
|
5
|
+
Used across `use-trip-web` and future UseTrip projects to keep the design system consistent and maintainable in a single place.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @usetrip/react-ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Then import the library's CSS in your app's entry stylesheet (required for `CustomEditor` toolbar styles):
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
@import "@usetrip/react-ui/dist/react-ui.css";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
And add the Tailwind `@source` directive so the library's class names are included in your CSS bundle:
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
@source "../node_modules/@usetrip/react-ui/dist";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
### Per-component imports (recommended — best tree shaking)
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import Button from '@usetrip/react-ui/Button'
|
|
35
|
+
import Typography from '@usetrip/react-ui/Typography'
|
|
36
|
+
import TextField from '@usetrip/react-ui/TextField'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Barrel import (convenient for multiple components)
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Button, Typography, TextField } from '@usetrip/react-ui'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Both styles are fully supported. The library ships with `"sideEffects": false` so unused components are always tree-shaken by your bundler.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Components
|
|
50
|
+
|
|
51
|
+
### `Button`
|
|
52
|
+
|
|
53
|
+
A versatile button component with multiple variants, sizes, loading state, and icon support.
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import Button from '@usetrip/react-ui/Button'
|
|
57
|
+
|
|
58
|
+
<Button variant="primary" size="md">Save Trip</Button>
|
|
59
|
+
<Button variant="destructive" isLoading>Deleting...</Button>
|
|
60
|
+
<Button variant="outline" startIcon={<Plus />}>Add Location</Button>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
| Prop | Type | Default | Description |
|
|
64
|
+
|------|------|---------|-------------|
|
|
65
|
+
| `variant` | `primary` \| `secondary` \| `destructive` \| `outline` \| `ghost` \| `link` | `primary` | Visual style |
|
|
66
|
+
| `size` | `sm` \| `md` \| `lg` \| `full` \| `icon` | `md` | Button size |
|
|
67
|
+
| `rounded` | `default` \| `full` \| `none` | `default` | Border radius |
|
|
68
|
+
| `isLoading` | `boolean` | `false` | Shows spinner, disables interaction |
|
|
69
|
+
| `startIcon` | `ReactNode` | — | Icon before label |
|
|
70
|
+
| `endIcon` | `ReactNode` | — | Icon after label |
|
|
71
|
+
| `asChild` | `boolean` | `false` | Renders as child element (Radix Slot) |
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### `ButtonLink`
|
|
76
|
+
|
|
77
|
+
Same variants as `Button`, but renders a `react-router-dom` `<Link>` for client-side navigation.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import ButtonLink from '@usetrip/react-ui/ButtonLink'
|
|
81
|
+
|
|
82
|
+
<ButtonLink to="/trips" variant="outline">View All Trips</ButtonLink>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
| Prop | Type | Description |
|
|
86
|
+
|------|------|-------------|
|
|
87
|
+
| `to` | `To` (react-router-dom) | Navigation target |
|
|
88
|
+
| `variant` / `size` / `rounded` | same as Button | Visual props |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### `TextField`
|
|
93
|
+
|
|
94
|
+
Controlled text input with label, hint text, validation states, and password toggle.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import TextField from '@usetrip/react-ui/TextField'
|
|
98
|
+
|
|
99
|
+
<TextField
|
|
100
|
+
label="Email"
|
|
101
|
+
type="email"
|
|
102
|
+
placeholder="you@example.com"
|
|
103
|
+
value={email}
|
|
104
|
+
onChange={setEmail}
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<TextField
|
|
108
|
+
label="Password"
|
|
109
|
+
type="password"
|
|
110
|
+
state="error"
|
|
111
|
+
hintText="Password must be at least 8 characters"
|
|
112
|
+
value={password}
|
|
113
|
+
onChange={setPassword}
|
|
114
|
+
/>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Prop | Type | Default | Description |
|
|
118
|
+
|------|------|---------|-------------|
|
|
119
|
+
| `label` | `string` | — | Input label |
|
|
120
|
+
| `type` | `text` \| `password` \| `email` \| `number` \| `date` | `text` | Input type |
|
|
121
|
+
| `state` | `default` \| `warning` \| `error` | `default` | Validation state |
|
|
122
|
+
| `hintText` | `string` | — | Helper or error message below input |
|
|
123
|
+
| `value` | `string` | — | Controlled value |
|
|
124
|
+
| `onChange` | `(value: string) => void` | — | Change handler |
|
|
125
|
+
| `disabled` | `boolean` | `false` | Disables the input |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### `Typography`
|
|
130
|
+
|
|
131
|
+
Semantic text component with consistent sizing, weight, and line-height tokens.
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
import Typography from '@usetrip/react-ui/Typography'
|
|
135
|
+
|
|
136
|
+
<Typography variant="h1">Plan your trip</Typography>
|
|
137
|
+
<Typography variant="body2" className="text-gray-500">10 days in Japan</Typography>
|
|
138
|
+
<Typography as="span" variant="caption">Last updated today</Typography>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
| Prop | Type | Default | Description |
|
|
142
|
+
|------|------|---------|-------------|
|
|
143
|
+
| `variant` | `h1` \| `h2` \| `h3` \| `h4` \| `h5` \| `body1` \| `body2` \| `caption` \| `label` \| `button` | `body1` | Typography style |
|
|
144
|
+
| `as` | `ElementType` | inferred from variant | HTML element to render |
|
|
145
|
+
| `className` | `string` | — | Additional classes |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### `AlertBox`
|
|
150
|
+
|
|
151
|
+
Inline feedback banners for success, error, warning, info, or default states.
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import AlertBox from '@usetrip/react-ui/AlertBox'
|
|
155
|
+
|
|
156
|
+
<AlertBox type="success" message="Trip saved successfully!" />
|
|
157
|
+
<AlertBox type="error" message="Something went wrong. Please try again." />
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
| Prop | Type | Description |
|
|
161
|
+
|------|------|-------------|
|
|
162
|
+
| `type` | `default` \| `info` \| `warning` \| `error` \| `success` | Alert style |
|
|
163
|
+
| `message` | `string` | Message text |
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### `SearchInput`
|
|
168
|
+
|
|
169
|
+
Search field with a built-in search icon, available in multiple sizes and variants.
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
import SearchInput from '@usetrip/react-ui/SearchInput'
|
|
173
|
+
|
|
174
|
+
<SearchInput
|
|
175
|
+
size="md"
|
|
176
|
+
placeholder="Search destinations..."
|
|
177
|
+
value={query}
|
|
178
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
179
|
+
/>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
| Prop | Type | Default | Description |
|
|
183
|
+
|------|------|---------|-------------|
|
|
184
|
+
| `size` | `sm` \| `md` \| `lg` \| `full` | `md` | Controls width and height |
|
|
185
|
+
| `variant` | `default` \| `compact` | `default` | Border radius style |
|
|
186
|
+
| `placeholder` | `string` | `"Digite..."` | Placeholder text |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
### `CalendarInput`
|
|
191
|
+
|
|
192
|
+
Read-only date display field that triggers a calendar picker when clicked.
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import CalendarInput from '@usetrip/react-ui/CalendarInput'
|
|
196
|
+
|
|
197
|
+
<CalendarInput
|
|
198
|
+
label="Check-in"
|
|
199
|
+
value={date ? format(date, 'dd/MM/yyyy') : ''}
|
|
200
|
+
onClick={() => setPickerOpen(true)}
|
|
201
|
+
state="error"
|
|
202
|
+
hintText="Required field"
|
|
203
|
+
/>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
| Prop | Type | Default | Description |
|
|
207
|
+
|------|------|---------|-------------|
|
|
208
|
+
| `label` | `string` | — | Input label |
|
|
209
|
+
| `value` | `string` | — | Formatted date string to display |
|
|
210
|
+
| `placeholder` | `string` | `"Selecione uma data"` | Shown when no value |
|
|
211
|
+
| `state` | `default` \| `warning` \| `error` | `default` | Validation state |
|
|
212
|
+
| `hintText` | `string` | — | Helper or error message |
|
|
213
|
+
| `compact` | `boolean` | `false` | Reduces spacing for dense layouts |
|
|
214
|
+
| `onClick` | `() => void` | — | Opens the date picker |
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### `InputCounter`
|
|
219
|
+
|
|
220
|
+
Increment/decrement counter with label, hint text, and minimum value enforcement.
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
import InputCounter from '@usetrip/react-ui/InputCounter'
|
|
224
|
+
|
|
225
|
+
<InputCounter
|
|
226
|
+
label="Adults"
|
|
227
|
+
value={adults}
|
|
228
|
+
onIncrement={() => setAdults(adults + 1)}
|
|
229
|
+
onDecrement={() => setAdults(adults - 1)}
|
|
230
|
+
minValue={1}
|
|
231
|
+
hintText="Ages 18+"
|
|
232
|
+
/>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
| Prop | Type | Default | Description |
|
|
236
|
+
|------|------|---------|-------------|
|
|
237
|
+
| `label` | `string` | — | Counter label |
|
|
238
|
+
| `value` | `number` | — | Current count |
|
|
239
|
+
| `onIncrement` | `() => void` | — | Called when + is pressed |
|
|
240
|
+
| `onDecrement` | `() => void` | — | Called when − is pressed |
|
|
241
|
+
| `minValue` | `number` | `0` | Disables decrement at this value |
|
|
242
|
+
| `hintText` | `string` | — | Helper text below counter |
|
|
243
|
+
| `compact` | `boolean` | `false` | Reduces padding for dense layouts |
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
### `RangeDatePicker`
|
|
248
|
+
|
|
249
|
+
Modal date range picker with dual-month calendar, navigation, and confirm/cancel/reset actions.
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
import RangeDatePicker from '@usetrip/react-ui/RangeDatePicker'
|
|
253
|
+
import type { DateRange } from 'react-day-picker'
|
|
254
|
+
|
|
255
|
+
const [range, setRange] = useState<DateRange | undefined>()
|
|
256
|
+
|
|
257
|
+
<RangeDatePicker
|
|
258
|
+
isOpen={isOpen}
|
|
259
|
+
onClose={() => setIsOpen(false)}
|
|
260
|
+
onSelect={(range) => { setRange(range); setIsOpen(false) }}
|
|
261
|
+
initialRange={range}
|
|
262
|
+
minDate={new Date()}
|
|
263
|
+
/>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
| Prop | Type | Description |
|
|
267
|
+
|------|------|-------------|
|
|
268
|
+
| `isOpen` | `boolean` | Controls dialog visibility |
|
|
269
|
+
| `onClose` | `() => void` | Called when dialog is closed |
|
|
270
|
+
| `onSelect` | `(range: DateRange \| undefined) => void` | Called when selection is confirmed |
|
|
271
|
+
| `initialRange` | `DateRange` | Pre-selected range |
|
|
272
|
+
| `minDate` | `Date` | Disables dates before this date |
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### `CustomEditor`
|
|
277
|
+
|
|
278
|
+
WYSIWYG rich text editor with a fixed toolbar (bold, italic, underline, strikethrough, ordered list, bullet list). Value is stored as an HTML string.
|
|
279
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
import CustomEditor from '@usetrip/react-ui/CustomEditor'
|
|
282
|
+
import type { ContentEditableEvent } from 'react-simple-wysiwyg'
|
|
283
|
+
|
|
284
|
+
<CustomEditor
|
|
285
|
+
value={content}
|
|
286
|
+
onChange={(e: ContentEditableEvent) => setContent(e.target.value)}
|
|
287
|
+
placeholder="Describe your trip..."
|
|
288
|
+
/>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
| Prop | Type | Description |
|
|
292
|
+
|------|------|-------------|
|
|
293
|
+
| `value` | `string` | HTML string content |
|
|
294
|
+
| `onChange` | `(e: ContentEditableEvent) => void` | Change handler |
|
|
295
|
+
| `placeholder` | `string` | Placeholder when empty |
|
|
296
|
+
| `containerProps` | `ComponentProps<"div">` | Props for the outer container |
|
|
297
|
+
|
|
298
|
+
> **Security:** Always sanitize the HTML string with [DOMPurify](https://github.com/cure53/DOMPurify) before rendering it with `dangerouslySetInnerHTML`.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Peer Dependencies
|
|
303
|
+
|
|
304
|
+
The library does not bundle these — your project must have them installed:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
npm install react react-dom react-router-dom
|
|
308
|
+
npm install @radix-ui/react-dialog @radix-ui/react-label @radix-ui/react-popover @radix-ui/react-slot
|
|
309
|
+
npm install tailwindcss class-variance-authority clsx tailwind-merge
|
|
310
|
+
npm install lucide-react react-icons
|
|
311
|
+
npm install date-fns react-day-picker
|
|
312
|
+
npm install react-simple-wysiwyg
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Development
|
|
318
|
+
|
|
319
|
+
Clone the repo and start the playground to develop and test components interactively:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
git clone https://github.com/UseTrip/use-trip-web-ui.git
|
|
323
|
+
cd use-trip-web-ui
|
|
324
|
+
npm install
|
|
325
|
+
npm run dev # starts playground at localhost:5173
|
|
326
|
+
npm run build # bundles library to dist/
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
The playground (`src/playground/`) has a dedicated page for each component with live examples. Changes to component source are hot-reloaded instantly.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Publishing
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
npm run build
|
|
337
|
+
npm publish --access public
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Bump the version in `package.json` before publishing (`0.x.0` for new features, `0.0.x` for patches).
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Repository
|
|
345
|
+
|
|
346
|
+
- **npm**: [@usetrip/react-ui](https://www.npmjs.com/package/@usetrip/react-ui)
|
|
347
|
+
- **GitHub**: [UseTrip/use-trip-web-ui](https://github.com/UseTrip/use-trip-web-ui)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/AlertBox-b6dgMZ5I.cjs");exports.AlertBox=e.AlertBox;exports.default=e.AlertBox;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare function AlertBox({ message, type, className }: Readonly<AlertBoxProps>): JSX.Element;
|
|
4
|
+
export { AlertBox }
|
|
5
|
+
export default AlertBox;
|
|
6
|
+
|
|
7
|
+
declare type AlertBoxProps = {
|
|
8
|
+
message: string;
|
|
9
|
+
type?: AlertType;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare type AlertType = 'default' | 'info' | 'warning' | 'error' | 'success';
|
|
14
|
+
|
|
15
|
+
export { }
|
package/dist/AlertBox.js
ADDED
package/dist/Button.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./chunks/Button-DjizmSRN.cjs");exports.Button=t.Button;exports.buttonVariants=t.buttonVariants;exports.default=t.Button;
|
package/dist/Button.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const Button: React_2.ForwardRefExoticComponent<ButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export { Button }
|
|
7
|
+
export default Button;
|
|
8
|
+
|
|
9
|
+
export declare interface ButtonProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
startIcon?: React_2.ReactNode;
|
|
13
|
+
endIcon?: React_2.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare const buttonVariants: (props?: ({
|
|
17
|
+
variant?: "primary" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
18
|
+
size?: "sm" | "lg" | "md" | "full" | "icon" | null | undefined;
|
|
19
|
+
rounded?: "default" | "none" | "full" | null | undefined;
|
|
20
|
+
} & ClassProp) | undefined) => string;
|
|
21
|
+
|
|
22
|
+
export { }
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./chunks/ButtonLink-C1BjiV2m.cjs");exports.ButtonLink=t.ButtonLink;exports.buttonLinkVariants=t.buttonLinkVariants;exports.default=t.ButtonLink;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
import { To } from 'react-router-dom';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const ButtonLink: React_2.ForwardRefExoticComponent<ButtonLinkProps & React_2.RefAttributes<HTMLAnchorElement>>;
|
|
7
|
+
export { ButtonLink }
|
|
8
|
+
export default ButtonLink;
|
|
9
|
+
|
|
10
|
+
export declare interface ButtonLinkProps extends Omit<React_2.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>, VariantProps<typeof buttonLinkVariants> {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
startIcon?: React_2.ReactNode;
|
|
14
|
+
endIcon?: React_2.ReactNode;
|
|
15
|
+
to: To;
|
|
16
|
+
external?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare const buttonLinkVariants: (props?: ({
|
|
20
|
+
variant?: "primary" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
21
|
+
size?: "sm" | "lg" | "md" | "full" | "icon" | null | undefined;
|
|
22
|
+
rounded?: "default" | "none" | "full" | null | undefined;
|
|
23
|
+
} & ClassProp) | undefined) => string;
|
|
24
|
+
|
|
25
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/CalendarInput-CPV0f1Gl.cjs");exports.CalendarInput=e.CalendarInput;exports.default=e.CalendarInput;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare function CalendarInput({ label, value, placeholder, onClick, onFocus, className, state, hintText, compact, }: CalendarInputProps): JSX.Element;
|
|
4
|
+
export { CalendarInput }
|
|
5
|
+
export default CalendarInput;
|
|
6
|
+
|
|
7
|
+
declare interface CalendarInputProps {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
onFocus?: () => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
state?: 'warning' | 'error' | 'default';
|
|
15
|
+
hintText?: string;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./chunks/CustomEditor-BW_Mgv0y.cjs");exports.CustomEditor=t.CustomEditor;exports.default=t.CustomEditor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { ContentEditableEvent } from 'react-simple-wysiwyg';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
declare function CustomEditor({ value, onChange, placeholder, containerProps }: CustomEditorProps): JSX.Element;
|
|
6
|
+
export { CustomEditor }
|
|
7
|
+
export default CustomEditor;
|
|
8
|
+
|
|
9
|
+
declare type CustomEditorProps = Readonly<{
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (e: ContentEditableEvent) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
containerProps?: ComponentProps<'div'>;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/InputCounter-srYivV6j.cjs");exports.InputCounter=e.InputCounter;exports.default=e.InputCounter;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare function InputCounter({ label, value, onIncrement, onDecrement, minValue, className, hintText, compact, }: InputCounterProps): JSX.Element;
|
|
4
|
+
export { InputCounter }
|
|
5
|
+
export default InputCounter;
|
|
6
|
+
|
|
7
|
+
declare interface InputCounterProps {
|
|
8
|
+
label: string;
|
|
9
|
+
value: number;
|
|
10
|
+
onIncrement: () => void;
|
|
11
|
+
onDecrement: () => void;
|
|
12
|
+
minValue?: number;
|
|
13
|
+
className?: string;
|
|
14
|
+
hintText?: string;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/RangeDatePicker-CoEU93mq.cjs");exports.RangeDatePicker=e.RangeDatePicker;exports.default=e.RangeDatePicker;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DateRange } from 'react-day-picker';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
declare function RangeDatePicker({ isOpen, onClose, onSelect, initialRange, focusedField, minDate, }: RangeDatePickerProps): JSX.Element;
|
|
5
|
+
export { RangeDatePicker }
|
|
6
|
+
export default RangeDatePicker;
|
|
7
|
+
|
|
8
|
+
declare interface RangeDatePickerProps {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onSelect: (range: DateRange | undefined) => void;
|
|
12
|
+
initialRange?: DateRange;
|
|
13
|
+
focusedField?: 'start' | 'end' | null;
|
|
14
|
+
minDate?: Date;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/SearchInput-Dp1Q72Co.cjs");exports.SearchInput=e.SearchInput;exports.default=e.SearchInput;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
2
|
+
import { RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const SearchInput: ForwardRefExoticComponent<SearchInputProps & RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export { SearchInput }
|
|
6
|
+
export default SearchInput;
|
|
7
|
+
|
|
8
|
+
declare interface SearchInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
variant?: 'default' | 'compact';
|
|
11
|
+
size?: 'sm' | 'md' | 'lg' | 'full';
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/TextField-Dr3vhUtA.cjs");exports.TextField=e.TextField;exports.default=e.TextField;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare type AutoCompleteTypes = 'off' | 'on' | 'name' | 'email' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'url' | 'photo';
|
|
4
|
+
|
|
5
|
+
declare function TextField({ label, placeholder, type, state, hintText, value, onChange, required, disabled, id, className, size, autoComplete, autoCapitalize, compact, }: TextFieldProps): JSX.Element;
|
|
6
|
+
export { TextField }
|
|
7
|
+
export default TextField;
|
|
8
|
+
|
|
9
|
+
declare type TextFieldProps = {
|
|
10
|
+
label?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'date';
|
|
13
|
+
state?: 'warning' | 'error' | 'default';
|
|
14
|
+
hintText?: string;
|
|
15
|
+
value?: string;
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
id?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
size?: 'sm' | 'md' | 'lg' | 'full';
|
|
22
|
+
autoComplete?: AutoCompleteTypes | string;
|
|
23
|
+
autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
|
|
24
|
+
compact?: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Typography-CTDehHO_.cjs");exports.Typography=e.Typography;exports.default=e.Typography;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
export declare type ElementType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'label';
|
|
7
|
+
|
|
8
|
+
declare const Typography: ({ className, variant, color, align, transform, weight, size, as, ...props }: TypographyProps) => JSX.Element;
|
|
9
|
+
export { Typography }
|
|
10
|
+
export default Typography;
|
|
11
|
+
|
|
12
|
+
export declare interface TypographyProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>, VariantProps<typeof typographyVariantStyles> {
|
|
13
|
+
as?: ElementType;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const typographyVariantStyles: (props?: ({
|
|
17
|
+
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "body1" | "body2" | "caption" | "label" | "button" | null | undefined;
|
|
18
|
+
color?: "default" | "muted" | "white" | "primary" | "success" | "warning" | "danger" | null | undefined;
|
|
19
|
+
align?: "left" | "center" | "right" | "justify" | null | undefined;
|
|
20
|
+
transform?: "uppercase" | "lowercase" | "capitalize" | "normal" | null | undefined;
|
|
21
|
+
weight?: "normal" | "light" | "medium" | "semibold" | "bold" | "extrabold" | null | undefined;
|
|
22
|
+
size?: "4xl" | "3xl" | "2xl" | "xs" | "sm" | "base" | "lg" | "xl" | "5xl" | null | undefined;
|
|
23
|
+
} & ClassProp) | undefined) => string;
|
|
24
|
+
|
|
25
|
+
export { }
|