pejay-ui 1.4.3 → 1.5.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 +26 -0
- package/bin/cli.js +45 -15
- package/package.json +2 -1
- package/registry/buttons.json +3 -2
- package/registry/dropdowns.json +3 -1
- package/registry/forms.json +51 -23
- package/registry/hotkeys.json +12 -0
- package/registry/overlays.json +18 -2
- package/registry/panels.json +21 -0
- package/registry/skeleton.json +20 -0
- package/registry/spinner.json +13 -0
- package/templates/button/Button.tsx +8 -7
- package/templates/button/README.md +81 -0
- package/templates/button/index.ts +1 -2
- package/templates/form/{checkbox-group.tsx → choices/checkbox-group.tsx} +1 -1
- package/templates/form/{checkbox.tsx → choices/checkbox.tsx} +1 -1
- package/templates/form/{radio-group.tsx → choices/radio-group.tsx} +1 -1
- package/templates/form/{radio.tsx → choices/radio.tsx} +1 -1
- package/templates/form/choices/readme.checkbox-group.md +27 -0
- package/templates/form/choices/readme.checkbox.md +26 -0
- package/templates/form/choices/readme.radio-group.md +26 -0
- package/templates/form/choices/readme.radio.md +24 -0
- package/templates/form/choices/readme.switch.md +26 -0
- package/templates/form/{switch.tsx → choices/switch.tsx} +1 -1
- package/templates/form/{file-input.tsx → file/file-input.tsx} +2 -2
- package/templates/form/file/readme.file-input.md +26 -0
- package/templates/form/index.ts +19 -22
- package/templates/form/{amount-input.tsx → numeric/amount-input.tsx} +2 -2
- package/templates/form/{number-input.tsx → numeric/number-input.tsx} +2 -2
- package/templates/form/{range-slider.tsx → numeric/range-slider.tsx} +1 -1
- package/templates/form/numeric/readme.amount-input.md +27 -0
- package/templates/form/numeric/readme.number-input.md +26 -0
- package/templates/form/numeric/readme.range-slider.md +27 -0
- package/templates/form/{date-picker.tsx → pickers/date-picker.tsx} +2 -2
- package/templates/form/{date-range-picker.tsx → pickers/date-range-picker.tsx} +2 -2
- package/templates/form/pickers/readme.date-picker.md +26 -0
- package/templates/form/pickers/readme.date-range-picker.md +25 -0
- package/templates/form/pickers/readme.time-picker.md +25 -0
- package/templates/form/pickers/readme.time-range-picker.md +25 -0
- package/templates/form/{time-picker.tsx → pickers/time-picker.tsx} +1 -1
- package/templates/form/{time-range-picker.tsx → pickers/time-range-picker.tsx} +1 -1
- package/templates/form/{input.tsx → text-inputs/input.tsx} +1 -1
- package/templates/form/{password-input.tsx → text-inputs/password-input.tsx} +1 -1
- package/templates/form/text-inputs/readme.email-input.md +24 -0
- package/templates/form/text-inputs/readme.input.md +28 -0
- package/templates/form/text-inputs/readme.password-input.md +24 -0
- package/templates/form/text-inputs/readme.phone-input.md +24 -0
- package/templates/form/text-inputs/readme.textarea.md +24 -0
- package/templates/form/text-inputs/readme.url-input.md +23 -0
- package/templates/form/{textarea.tsx → text-inputs/textarea.tsx} +1 -1
- package/templates/hotkeys/README.md +134 -0
- package/templates/hotkeys/components/HotkeyProvider.tsx +78 -0
- package/templates/hotkeys/components/HotkeysHelpModal.tsx +102 -0
- package/templates/hotkeys/core/key-matcher.ts +106 -0
- package/templates/hotkeys/core/registry.ts +39 -0
- package/templates/hotkeys/core/types.ts +15 -0
- package/templates/hotkeys/hooks/useHotkey.ts +43 -0
- package/templates/hotkeys/index.ts +6 -0
- package/templates/layouts/lv1/app-layout.tsx +1 -1
- package/templates/layouts/lv1/sidebar-menu.tsx +1 -1
- package/templates/notes/app-provider/app-provider-side-panel-modals-roadmap.md +606 -0
- package/templates/notes/app-provider/manual-open-close-side-panel-and-modal.md +913 -0
- package/templates/notes/app-provider/side-panel-card-hooks-and-complexity.md +578 -0
- package/templates/notes/under-dev/AppProvider.tsx +92 -0
- package/templates/notes/under-dev/app-context.ts +14 -0
- package/templates/notes/under-dev/card/base-card.tsx +35 -0
- package/templates/notes/under-dev/card/index.ts +4 -0
- package/templates/notes/under-dev/card/modal-card.tsx +88 -0
- package/templates/notes/under-dev/card/side-panel-card.tsx +127 -0
- package/templates/notes/under-dev/form-overlay-registry.ts +42 -0
- package/templates/notes/under-dev/keyboard-shortcuts-help.tsx +79 -0
- package/templates/notes/under-dev/keyboard-utils.ts +22 -0
- package/templates/notes/under-dev/overlay/backdrop.tsx +95 -0
- package/templates/notes/under-dev/overlay/index.ts +4 -0
- package/templates/notes/under-dev/overlay/modal.tsx +43 -0
- package/templates/notes/under-dev/overlay/side-panel.tsx +126 -0
- package/templates/notes/under-dev/overlay-close.ts +50 -0
- package/templates/notes/under-dev/page-shortcut-registry.ts +9 -0
- package/templates/notes/under-dev/unsaved-changes-notify.ts +11 -0
- package/templates/notes/under-dev/use-keyboard-shortcuts.tsx +110 -0
- package/templates/notes/under-dev/useFormDirty.ts +6 -0
- package/templates/notes/under-dev/useFormOverlayRegistration.ts +47 -0
- package/templates/notes/under-dev/useFormPanel.tsx +18 -0
- package/templates/notes/under-dev/useFormTabHandler.ts +22 -0
- package/templates/notes/under-dev/useHorizontalWheelScroll.ts +27 -0
- package/templates/notes/under-dev/useOverlay.ts +41 -0
- package/templates/overlays/index.ts +2 -1
- package/templates/overlays/portal/portal.tsx +26 -0
- package/templates/overlays/tooltip/readme.tooltip.md +26 -0
- package/templates/{button → overlays/tooltip}/tooltip.tsx +1 -1
- package/templates/panels/COMPONENTS.md +103 -0
- package/templates/panels/README.md +702 -0
- package/templates/panels/components/base-card.tsx +33 -0
- package/templates/panels/components/index.ts +8 -0
- package/templates/panels/components/modal/backdrop.tsx +88 -0
- package/templates/panels/components/modal/modal-card.tsx +139 -0
- package/templates/panels/components/modal/modal-raw.tsx +36 -0
- package/templates/panels/components/modal/modal.tsx +49 -0
- package/templates/panels/components/side-panel/side-panel-card.tsx +123 -0
- package/templates/panels/components/side-panel/side-panel-raw.tsx +25 -0
- package/templates/panels/components/side-panel/side-panel.tsx +135 -0
- package/templates/panels/core/PanelProvider.tsx +145 -0
- package/templates/panels/core/constants.ts +9 -0
- package/templates/panels/core/form-overlay-registry.ts +35 -0
- package/templates/panels/core/index.ts +6 -0
- package/templates/panels/core/overlay-close.ts +11 -0
- package/templates/panels/core/panel-context.ts +41 -0
- package/templates/panels/core/types.ts +41 -0
- package/templates/panels/hooks/index.ts +7 -0
- package/templates/panels/hooks/useFormDirty.ts +6 -0
- package/templates/panels/hooks/useFormOverlayRegistration.ts +92 -0
- package/templates/panels/hooks/useFormPanel.tsx +18 -0
- package/templates/panels/hooks/useFormTabHandler.ts +25 -0
- package/templates/panels/hooks/useHorizontalWheelScroll.ts +31 -0
- package/templates/panels/hooks/useModalForm.tsx +22 -0
- package/templates/panels/hooks/useOverlay.ts +65 -0
- package/templates/panels/index.ts +3 -0
- package/templates/panels/vendor-example/by-using-modal/VendorModalPage.tsx +47 -0
- package/templates/panels/vendor-example/by-using-modal/useVendorModalForm.tsx +19 -0
- package/templates/panels/vendor-example/by-using-modal/vendor-modal-form.tsx +112 -0
- package/templates/panels/vendor-example/by-using-modal/vendor-types.ts +29 -0
- package/templates/panels/vendor-example/by-using-sidepanel/VendorsPage.tsx +47 -0
- package/templates/panels/vendor-example/by-using-sidepanel/useVendorFormPanel.tsx +15 -0
- package/templates/panels/vendor-example/by-using-sidepanel/vendor-form.tsx +108 -0
- package/templates/panels/vendor-example/by-using-sidepanel/vendor-types.ts +29 -0
- package/templates/select-dropdown/README.md +62 -0
- package/templates/select-dropdown/multiselect-input.tsx +2 -2
- package/templates/select-dropdown/select-input.tsx +2 -2
- package/templates/skeleton/README.md +53 -0
- package/templates/skeleton/index.ts +2 -0
- package/templates/skeleton/skeleton.css +36 -0
- package/templates/skeleton/skeleton.tsx +40 -0
- package/templates/skeleton/types.ts +12 -0
- package/templates/spinner/README.md +51 -0
- package/templates/spinner/index.ts +1 -0
- package/templates/spinner/spinner.css +58 -0
- package/templates/spinner/spinner.tsx +263 -0
- package/templates/toast/container.tsx +2 -2
- package/templates/utilities/formater.dateTime.md +74 -0
- package/templates/utilities/formater.dateTime.ts +310 -0
- package/templates/utilities/formater.phoneNumber.md +32 -0
- package/templates/utilities/formater.phoneNumber.ts +143 -0
- package/templates/utilities/sanitize.md +23 -0
- package/templates/utilities/sanitize.ts +148 -0
- /package/templates/form/{email-input.tsx → text-inputs/email-input.tsx} +0 -0
- /package/templates/form/{phone-input.tsx → text-inputs/phone-input.tsx} +0 -0
- /package/templates/form/{url-input.tsx → text-inputs/url-input.tsx} +0 -0
- /package/templates/{overlays → notes/under-dev/overlay}/portal.tsx +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# CheckboxGroup Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { CheckboxGroup } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<CheckboxGroup
|
|
13
|
+
label="Hobbies"
|
|
14
|
+
options={[{ label: "Sports", value: "sports" }, { label: "Music", value: "music" }]}
|
|
15
|
+
value={hobbies}
|
|
16
|
+
onChange={setHobbies}
|
|
17
|
+
/>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| :--- | :--- | :--- | :--- |
|
|
26
|
+
| `options` | `Array<{ label: string, value: string }>` | — | Option items list. |
|
|
27
|
+
| `value` | `string[]` | — | Selected values list. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Checkbox Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Checkbox } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<Checkbox
|
|
13
|
+
label="I agree to terms"
|
|
14
|
+
checked={agreed}
|
|
15
|
+
onChange={(e) => setAgreed(e.target.checked)}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `label` | `string` | — | Description text displayed next to the checkbox box. |
|
|
26
|
+
| `checked` | `boolean` | `false` | Checked state. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# RadioGroup Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { RadioGroup } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<RadioGroup
|
|
13
|
+
label="Preferred Mode"
|
|
14
|
+
options={[{ label: "Dark", value: "dark" }, { label: "Light", value: "light" }]}
|
|
15
|
+
value={theme}
|
|
16
|
+
onChange={setTheme}
|
|
17
|
+
/>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| :--- | :--- | :--- | :--- |
|
|
26
|
+
| `options` | `Array<{ label: string, value: string }>` | — | Group items lists. |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Radio Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Radio } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<Radio
|
|
13
|
+
label="Option Item"
|
|
14
|
+
name="group-1"
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| :--- | :--- | :--- | :--- |
|
|
24
|
+
| `label` | `string` | — | Option description text. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Switch Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Switch } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<Switch
|
|
13
|
+
label="Enable Notifications"
|
|
14
|
+
checked={isEnabled}
|
|
15
|
+
onChange={setIsEnabled}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `label` | `string` | — | Helper label text. |
|
|
26
|
+
| `checked` | `boolean` | `false` | Toggles checkbox status on/off. |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useRef } from "react";
|
|
2
2
|
import { Upload, X, FileText, Image as ImageIcon } from "lucide-react";
|
|
3
|
-
import { cn } from "@/utils/cn";
|
|
4
|
-
import { Input } from "
|
|
3
|
+
import { cn } from "@/pejay-ui/utils/cn";
|
|
4
|
+
import { Input } from "../text-inputs/input";
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* ============================================================================
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# FileInput Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { FileInput } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<FileInput
|
|
13
|
+
label="Upload Resume"
|
|
14
|
+
accept=".pdf,.docx"
|
|
15
|
+
onChange={(files) => console.log(files)}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `multiple` | `boolean` | `false` | Allows multiple file select upload. |
|
|
26
|
+
| `accept` | `string` | — | Accepted file formats. |
|
package/templates/form/index.ts
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
export * from "./input";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./range-
|
|
9
|
-
export * from "./
|
|
10
|
-
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./
|
|
18
|
-
export * from "./
|
|
19
|
-
export * from "./
|
|
20
|
-
|
|
21
|
-
export * from "./email-input";
|
|
22
|
-
export * from "./file-input";
|
|
1
|
+
export * from "./text-inputs/input";
|
|
2
|
+
export * from "./text-inputs/textarea";
|
|
3
|
+
export * from "./text-inputs/email-input";
|
|
4
|
+
export * from "./text-inputs/password-input";
|
|
5
|
+
export * from "./text-inputs/phone-input";
|
|
6
|
+
export * from "./text-inputs/url-input";
|
|
7
|
+
export * from "./pickers/date-picker";
|
|
8
|
+
export * from "./pickers/date-range-picker";
|
|
9
|
+
export * from "./pickers/time-picker";
|
|
10
|
+
export * from "./pickers/time-range-picker";
|
|
11
|
+
export * from "./numeric/number-input";
|
|
12
|
+
export * from "./numeric/amount-input";
|
|
13
|
+
export * from "./numeric/range-slider";
|
|
14
|
+
export * from "./choices/checkbox";
|
|
15
|
+
export * from "./choices/checkbox-group";
|
|
16
|
+
export * from "./choices/radio";
|
|
17
|
+
export * from "./choices/radio-group";
|
|
18
|
+
export * from "./choices/switch";
|
|
19
|
+
export * from "./file/file-input";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
|
-
import { Input } from "
|
|
2
|
+
import { Input } from "../text-inputs/input";
|
|
3
3
|
import { Plus, Minus } from "lucide-react";
|
|
4
|
-
import { cn } from "@/utils/cn";
|
|
4
|
+
import { cn } from "@/pejay-ui/utils/cn";
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* ============================================================================
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
|
-
import { Input } from "
|
|
2
|
+
import { Input } from "../text-inputs/input";
|
|
3
3
|
import { Plus, Minus } from "lucide-react";
|
|
4
|
-
import { cn } from "@/utils/cn";
|
|
4
|
+
import { cn } from "@/pejay-ui/utils/cn";
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* ============================================================================
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# AmountInput Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { AmountInput } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<AmountInput
|
|
13
|
+
label="Price Value"
|
|
14
|
+
currency="USD"
|
|
15
|
+
value={amount}
|
|
16
|
+
onChange={setAmount}
|
|
17
|
+
/>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| :--- | :--- | :--- | :--- |
|
|
26
|
+
| `currency` | `string` | `"$"` | Currency prefix symbol. |
|
|
27
|
+
| `allowDecimals` | `boolean` | `true` | Allows float decimals. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# NumberInput Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { NumberInput } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<NumberInput
|
|
13
|
+
label="Age"
|
|
14
|
+
min={18}
|
|
15
|
+
max={99}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `min` | `number` | — | Minimum value allowed. |
|
|
26
|
+
| `max` | `number` | — | Maximum value allowed. |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# RangeSlider Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { RangeSlider } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<RangeSlider
|
|
13
|
+
min={0}
|
|
14
|
+
max={100}
|
|
15
|
+
value={val}
|
|
16
|
+
onChange={setVal}
|
|
17
|
+
/>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| :--- | :--- | :--- | :--- |
|
|
26
|
+
| `min` | `number` | `0` | Minimum range. |
|
|
27
|
+
| `max` | `number` | `100` | Maximum range. |
|
|
@@ -5,14 +5,14 @@ import React, {
|
|
|
5
5
|
useEffect,
|
|
6
6
|
useLayoutEffect,
|
|
7
7
|
} from "react";
|
|
8
|
-
import { cn } from "@/utils/cn";
|
|
8
|
+
import { cn } from "@/pejay-ui/utils/cn";
|
|
9
9
|
import {
|
|
10
10
|
Calendar as CalendarIcon,
|
|
11
11
|
ChevronLeft,
|
|
12
12
|
ChevronRight,
|
|
13
13
|
ChevronDown,
|
|
14
14
|
} from "lucide-react";
|
|
15
|
-
import { SelectInput } from "
|
|
15
|
+
import { SelectInput } from "../../select-dropdown/select-input";
|
|
16
16
|
const DateUtils = {};
|
|
17
17
|
import {
|
|
18
18
|
useFloating,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useMemo } from "react";
|
|
2
|
-
import { cn } from "@/utils/cn";
|
|
2
|
+
import { cn } from "@/pejay-ui/utils/cn";
|
|
3
3
|
import {
|
|
4
4
|
Calendar as CalendarIcon,
|
|
5
5
|
ChevronLeft,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
PanelLeftClose,
|
|
9
9
|
PanelLeft,
|
|
10
10
|
} from "lucide-react";
|
|
11
|
-
import { SelectInput } from "
|
|
11
|
+
import { SelectInput } from "../../select-dropdown/select-input";
|
|
12
12
|
const DateUtils = {};
|
|
13
13
|
import {
|
|
14
14
|
useFloating,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# DatePicker Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { DatePicker } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<DatePicker
|
|
13
|
+
label="Date of Birth"
|
|
14
|
+
value={birthDate}
|
|
15
|
+
onChange={setBirthDate}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `value` | `Date` | — | Selected date object. |
|
|
26
|
+
| `onChange` | `(date: Date) => void` | — | Callback when date is selected. |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# DateRangePicker Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { DateRangePicker } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<DateRangePicker
|
|
13
|
+
label="Booking Duration"
|
|
14
|
+
value={range}
|
|
15
|
+
onChange={setRange}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `value` | `{ start: Date, end: Date }` | — | Date range values. |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# TimePicker Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { TimePicker } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<TimePicker
|
|
13
|
+
label="Start Time"
|
|
14
|
+
value={time}
|
|
15
|
+
onChange={setTime}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `value` | `string` | — | Time string value (e.g. "12:00 AM"). |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# TimeRangePicker Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { TimeRangePicker } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<TimeRangePicker
|
|
13
|
+
label="Shift Duration"
|
|
14
|
+
value={range}
|
|
15
|
+
onChange={setRange}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `value` | `{ start: string, end: string }` | — | Time range selector values. |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { Input } from "./input";
|
|
3
3
|
import { Check, Eye, EyeOff, AlertTriangle } from "lucide-react";
|
|
4
|
-
import { cn } from "@/utils/cn";
|
|
4
|
+
import { cn } from "@/pejay-ui/utils/cn";
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* ============================================================================
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# EmailInput Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { EmailInput } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<EmailInput
|
|
13
|
+
value={email}
|
|
14
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| :--- | :--- | :--- | :--- |
|
|
24
|
+
| `label` | `string` | `"Email"` | Field label text. |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Input (Text) Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Input } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<Input
|
|
13
|
+
label="User Name"
|
|
14
|
+
placeholder="Enter your user name"
|
|
15
|
+
prefix={<UserIcon size={16} />}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `label` | `string` | — | Label text displayed above the input. |
|
|
26
|
+
| `error` | `string` | — | Validation error text that highlights borders red. |
|
|
27
|
+
| `prefix` | `ReactNode` | — | Component to render on the left side of the input field. |
|
|
28
|
+
| `suffix` | `ReactNode` | — | Component to render on the right side of the input field. |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# PasswordInput Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { PasswordInput } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<PasswordInput
|
|
13
|
+
label="Password"
|
|
14
|
+
placeholder="Enter secret pass"
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| :--- | :--- | :--- | :--- |
|
|
24
|
+
| `strengthBar` | `boolean` | `false` | Toggles password strength progress indicator. |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# PhoneInput Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { PhoneInput } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<PhoneInput
|
|
13
|
+
value={phone}
|
|
14
|
+
onChange={(val) => setPhone(val)}
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| :--- | :--- | :--- | :--- |
|
|
24
|
+
| `label` | `string` | `"Phone Number"` | Input field label. |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Textarea Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Textarea } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<Textarea
|
|
13
|
+
label="Remarks"
|
|
14
|
+
rows={6}
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| :--- | :--- | :--- | :--- |
|
|
24
|
+
| `rows` | `number` | `4` | Default display rows. |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# UrlInput Component
|
|
2
|
+
|
|
3
|
+
A styled form input component optimized for Tailwind.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { UrlInput } from "@/pejay-ui/components/form";
|
|
11
|
+
|
|
12
|
+
<UrlInput
|
|
13
|
+
placeholder="https://example.com"
|
|
14
|
+
/>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
| :--- | :--- | :--- | :--- |
|
|
23
|
+
| `label` | `string` | `"URL"` | Input field label. |
|