@arkyn/components 3.0.2 → 3.0.4
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 +24 -24
- package/dist/components/alert/alertContainer/index.d.ts +7 -7
- package/dist/components/alert/alertContent/index.d.ts +1 -1
- package/dist/components/alert/alertDescription/index.d.ts +1 -1
- package/dist/components/alert/alertIcon/index.d.ts +1 -1
- package/dist/components/alert/alertTitle/index.d.ts +1 -1
- package/dist/components/audioPlayer/index.d.ts +1 -1
- package/dist/components/audioUpload/index.d.ts +2 -2
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/cardTab/cardTabButton/index.d.ts +1 -1
- package/dist/components/cardTab/cardTabContainer/index.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +3 -3
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/clientOnly.d.ts +2 -2
- package/dist/components/clientOnly.d.ts.map +1 -1
- package/dist/components/currencyInput/index.d.ts +2 -2
- package/dist/components/datePicker/datePickerCalendarContainer/index.d.ts +9 -0
- package/dist/components/datePicker/datePickerCalendarContainer/index.d.ts.map +1 -0
- package/dist/components/datePicker/datePickerChevron/index.d.ts +11 -0
- package/dist/components/datePicker/datePickerChevron/index.d.ts.map +1 -0
- package/dist/components/datePicker/datePickerContainer/index.d.ts +19 -0
- package/dist/components/datePicker/datePickerContainer/index.d.ts.map +1 -0
- package/dist/components/datePicker/datePickerContent/index.d.ts +9 -0
- package/dist/components/datePicker/datePickerContent/index.d.ts.map +1 -0
- package/dist/components/datePicker/datePickerOverlay/index.d.ts +8 -0
- package/dist/components/datePicker/datePickerOverlay/index.d.ts.map +1 -0
- package/dist/components/datePicker/datePickerSpinner/index.d.ts +8 -0
- package/dist/components/datePicker/datePickerSpinner/index.d.ts.map +1 -0
- package/dist/components/datePicker/index.d.ts +155 -0
- package/dist/components/datePicker/index.d.ts.map +1 -0
- package/dist/components/divider/index.d.ts +1 -1
- package/dist/components/drawer/drawerContainer/index.d.ts +1 -1
- package/dist/components/drawer/drawerHeader/index.d.ts +1 -1
- package/dist/components/facebookPixel/index.d.ts +1 -1
- package/dist/components/fieldError/index.d.ts +1 -1
- package/dist/components/fieldLabel/index.d.ts +1 -1
- package/dist/components/fieldWrapper/index.d.ts +1 -1
- package/dist/components/fileUpload/index.d.ts +2 -2
- package/dist/components/googleAnalytics/index.d.ts +1 -1
- package/dist/components/googleTagManager/index.d.ts +1 -1
- package/dist/components/iconButton/index.d.ts +1 -1
- package/dist/components/imageUpload/index.d.ts +2 -2
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/mapView/index.d.ts +2 -2
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/maskedInput/index.d.ts +3 -3
- package/dist/components/modal/modalContainer/index.d.ts +1 -1
- package/dist/components/modal/modalFooter/index.d.ts +1 -1
- package/dist/components/modal/modalHeader/index.d.ts +1 -1
- package/dist/components/multiSelect/index.d.ts +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/phoneInput/index.d.ts +2 -2
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.d.ts +4 -4
- package/dist/components/radio/radioGroup/index.d.ts +3 -3
- package/dist/components/richText/index.d.ts +3 -3
- package/dist/components/searchPlaces.d.ts +3 -3
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/switch/index.d.ts +3 -3
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/tab/tabButton/index.d.ts +1 -1
- package/dist/components/tab/tabContainer/index.d.ts +1 -1
- package/dist/components/table/tableBody/index.d.ts +1 -1
- package/dist/components/table/tableCaption/index.d.ts +2 -2
- package/dist/components/table/tableContainer/index.d.ts +1 -1
- package/dist/components/table/tableFooter/index.d.ts +1 -1
- package/dist/components/table/tableHeader/index.d.ts +2 -2
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/hooks/useAutomation.d.ts +1 -1
- package/dist/hooks/useDrawer.d.ts +5 -5
- package/dist/hooks/useForm.d.ts +2 -2
- package/dist/hooks/useHydrated.d.ts +1 -1
- package/dist/hooks/useModal.d.ts +5 -5
- package/dist/hooks/useScopedParams.d.ts +5 -5
- package/dist/hooks/useScrollLock.d.ts +2 -2
- package/dist/hooks/useSearchAutomation.d.ts +6 -6
- package/dist/hooks/useSlider.d.ts +2 -2
- package/dist/hooks/useToast.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +642 -389
- package/dist/index.js.map +1 -1
- package/dist/modules/components/alert/alertContainer/index.js.map +1 -1
- package/dist/modules/components/alert/alertContent/index.js.map +1 -1
- package/dist/modules/components/alert/alertDescription/index.js.map +1 -1
- package/dist/modules/components/alert/alertIcon/index.js.map +1 -1
- package/dist/modules/components/alert/alertTitle/index.js.map +1 -1
- package/dist/modules/components/audioPlayer/index.js.map +1 -1
- package/dist/modules/components/audioUpload/index.js.map +1 -1
- package/dist/modules/components/badge/index.js.map +1 -1
- package/dist/modules/components/button/index.js.map +1 -1
- package/dist/modules/components/cardTab/cardTabButton/index.js.map +1 -1
- package/dist/modules/components/cardTab/cardTabContainer/index.js.map +1 -1
- package/dist/modules/components/checkbox/index.js.map +1 -1
- package/dist/modules/components/clientOnly.js.map +1 -1
- package/dist/modules/components/currencyInput/index.js.map +1 -1
- package/dist/modules/components/datePicker/datePickerCalendarContainer/index.js +25 -0
- package/dist/modules/components/datePicker/datePickerCalendarContainer/index.js.map +1 -0
- package/dist/modules/components/datePicker/datePickerCalendarContainer/styles.css +1 -0
- package/dist/modules/components/datePicker/datePickerChevron/index.js +21 -0
- package/dist/modules/components/datePicker/datePickerChevron/index.js.map +1 -0
- package/dist/modules/components/datePicker/datePickerChevron/styles.css +1 -0
- package/dist/modules/components/datePicker/datePickerContainer/index.js +16 -0
- package/dist/modules/components/datePicker/datePickerContainer/index.js.map +1 -0
- package/dist/modules/components/datePicker/datePickerContainer/styles.css +1 -0
- package/dist/modules/components/datePicker/datePickerContent/index.js +14 -0
- package/dist/modules/components/datePicker/datePickerContent/index.js.map +1 -0
- package/dist/modules/components/datePicker/datePickerContent/styles.css +1 -0
- package/dist/modules/components/datePicker/datePickerOverlay/index.js +14 -0
- package/dist/modules/components/datePicker/datePickerOverlay/index.js.map +1 -0
- package/dist/modules/components/datePicker/datePickerOverlay/styles.css +1 -0
- package/dist/modules/components/datePicker/datePickerSpinner/index.js +16 -0
- package/dist/modules/components/datePicker/datePickerSpinner/index.js.map +1 -0
- package/dist/modules/components/datePicker/datePickerSpinner/styles.css +1 -0
- package/dist/modules/components/datePicker/index.js +194 -0
- package/dist/modules/components/datePicker/index.js.map +1 -0
- package/dist/modules/components/datePicker/styles.css +79 -0
- package/dist/modules/components/divider/index.js.map +1 -1
- package/dist/modules/components/drawer/drawerContainer/index.js.map +1 -1
- package/dist/modules/components/drawer/drawerHeader/index.js.map +1 -1
- package/dist/modules/components/facebookPixel/index.js.map +1 -1
- package/dist/modules/components/fieldError/index.js.map +1 -1
- package/dist/modules/components/fieldLabel/index.js.map +1 -1
- package/dist/modules/components/fieldWrapper/index.js.map +1 -1
- package/dist/modules/components/fileUpload/index.js.map +1 -1
- package/dist/modules/components/googleAnalytics/index.js.map +1 -1
- package/dist/modules/components/googleTagManager/index.js.map +1 -1
- package/dist/modules/components/iconButton/index.js.map +1 -1
- package/dist/modules/components/imageUpload/index.js.map +1 -1
- package/dist/modules/components/input/index.js.map +1 -1
- package/dist/modules/components/mapView/index.js.map +1 -1
- package/dist/modules/components/maskedInput/index.js.map +1 -1
- package/dist/modules/components/modal/modalContainer/index.js.map +1 -1
- package/dist/modules/components/modal/modalFooter/index.js.map +1 -1
- package/dist/modules/components/modal/modalHeader/index.js.map +1 -1
- package/dist/modules/components/multiSelect/index.js.map +1 -1
- package/dist/modules/components/pagination/index.js.map +1 -1
- package/dist/modules/components/phoneInput/index.js +68 -63
- package/dist/modules/components/phoneInput/index.js.map +1 -1
- package/dist/modules/components/popover/index.js.map +1 -1
- package/dist/modules/components/radio/radioBox/index.js.map +1 -1
- package/dist/modules/components/radio/radioGroup/index.js.map +1 -1
- package/dist/modules/components/richText/index.js.map +1 -1
- package/dist/modules/components/searchPlaces.js.map +1 -1
- package/dist/modules/components/select/index.js.map +1 -1
- package/dist/modules/components/slider/index.js.map +1 -1
- package/dist/modules/components/switch/index.js.map +1 -1
- package/dist/modules/components/tab/tabButton/index.js.map +1 -1
- package/dist/modules/components/tab/tabContainer/index.js.map +1 -1
- package/dist/modules/components/table/tableBody/index.js.map +1 -1
- package/dist/modules/components/table/tableCaption/index.js.map +1 -1
- package/dist/modules/components/table/tableContainer/index.js.map +1 -1
- package/dist/modules/components/table/tableFooter/index.js.map +1 -1
- package/dist/modules/components/table/tableHeader/index.js.map +1 -1
- package/dist/modules/components/textarea/index.js.map +1 -1
- package/dist/modules/components/tooltip/index.js.map +1 -1
- package/dist/modules/hooks/useAutomation.js.map +1 -1
- package/dist/modules/hooks/useDrawer.js.map +1 -1
- package/dist/modules/hooks/useForm.js.map +1 -1
- package/dist/modules/hooks/useHydrated.js.map +1 -1
- package/dist/modules/hooks/useModal.js.map +1 -1
- package/dist/modules/hooks/useScopedParams.js.map +1 -1
- package/dist/modules/hooks/useScrollLock.js.map +1 -1
- package/dist/modules/hooks/useSearchAutomation.js.map +1 -1
- package/dist/modules/hooks/useSlider.js.map +1 -1
- package/dist/modules/hooks/useToast.js.map +1 -1
- package/dist/modules/providers/drawerProvider.js.map +1 -1
- package/dist/modules/providers/formProvider.js.map +1 -1
- package/dist/modules/providers/modalProvider.js +27 -33
- package/dist/modules/providers/modalProvider.js.map +1 -1
- package/dist/modules/providers/placesProvider.js.map +1 -1
- package/dist/modules/providers/toastProvider.js.map +1 -1
- package/dist/modules/services/fieldTemplate.js +1 -0
- package/dist/modules/services/fieldTemplate.js.map +1 -1
- package/dist/modules/services/toHtml.js.map +1 -1
- package/dist/modules/services/toRichTextValue.js.map +1 -1
- package/dist/modules/utils/phoneInputUtilities.js +5 -5
- package/dist/modules/utils/phoneInputUtilities.js.map +1 -1
- package/dist/providers/drawerProvider.d.ts +1 -1
- package/dist/providers/formProvider.d.ts +1 -1
- package/dist/providers/modalProvider.d.ts +1 -1
- package/dist/providers/modalProvider.d.ts.map +1 -1
- package/dist/providers/placesProvider.d.ts +1 -1
- package/dist/providers/toastProvider.d.ts +1 -1
- package/dist/services/fieldTemplate.d.ts.map +1 -1
- package/dist/services/toHtml.d.ts +1 -1
- package/dist/services/toRichTextValue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/phoneInputUtilities.d.ts +1 -1
- package/dist/utils/phoneInputUtilities.d.ts.map +1 -1
- package/package.json +17 -1
package/README.md
CHANGED
|
@@ -8,22 +8,22 @@ A modern React component library featuring 40+ UI components, smooth animations,
|
|
|
8
8
|
|
|
9
9
|
## ✨ What it solves
|
|
10
10
|
|
|
11
|
-
Every React/Remix/React Router/Next app ends up rebuilding the same UI primitives
|
|
11
|
+
Every React/Remix/React Router/Next app ends up rebuilding the same UI primitives, buttons, inputs, modals, drawers, tables, tabs, alerts, with slightly different accessibility, validation, and animation behavior each time. `@arkyn/components` packages a complete, accessible, TypeScript-first set of these primitives (40+ components, plus supporting hooks and providers) so teams can compose screens instead of rebuilding foundations. Components integrate with a shared form-validation context (`FormProvider`/`useForm`), share consistent styling and motion, and cover everything from basic inputs to rich text editing, calendars, maps, and third-party tracking scripts.
|
|
12
12
|
|
|
13
13
|
## 🧩 Features
|
|
14
14
|
|
|
15
|
-
- 🧱 **Forms & inputs
|
|
16
|
-
- 📁 **Uploads
|
|
17
|
-
- 🧭 **Layout & navigation
|
|
18
|
-
- 🪟 **Overlays
|
|
19
|
-
- 🔔 **Feedback
|
|
20
|
-
- 📊 **Data display
|
|
21
|
-
- 📅 **Calendars & media
|
|
22
|
-
- 🗺️ **Google Places & Maps
|
|
23
|
-
- 📈 **Tracking integrations
|
|
24
|
-
- ✍️ **Rich text editing
|
|
25
|
-
- 🪝 **Hooks
|
|
26
|
-
- 🧑💻 **SSR-safe
|
|
15
|
+
- 🧱 **Forms & inputs**, `Input`, `Textarea`, `Checkbox`, `Switch`, `Select`, `MultiSelect`, `RadioGroup`/`RadioBox`, `CurrencyInput`, `MaskedInput`, `PhoneInput`, `Slider`, `FieldWrapper`/`FieldLabel`/`FieldError` for labeled, validated fields with consistent layout
|
|
16
|
+
- 📁 **Uploads**, `FileUpload`, `ImageUpload`, and `AudioUpload` with drag-and-drop, server upload, and preview built in
|
|
17
|
+
- 🧭 **Layout & navigation**, `TabContainer`/`TabButton`, `CardTabContainer`/`CardTabButton`, `Pagination`, `Divider`, `Badge`
|
|
18
|
+
- 🪟 **Overlays**, `ModalContainer`/`ModalHeader`/`ModalFooter` + `ModalProvider`/`useModal`, `DrawerContainer`/`DrawerHeader` + `DrawerProvider`/`useDrawer`, `Popover`, `Tooltip`
|
|
19
|
+
- 🔔 **Feedback**, `AlertContainer`/`AlertTitle`/`AlertDescription`/`AlertIcon`/`AlertContent`, `ToastProvider`/`useToast`
|
|
20
|
+
- 📊 **Data display**, `TableContainer`/`TableHeader`/`TableBody`/`TableFooter`/`TableCaption`
|
|
21
|
+
- 📅 **Calendars & media**, `Calendar` (single/range date picking), `FullCalendar` (day/week/month views with events), `AudioPlayer`
|
|
22
|
+
- 🗺️ **Google Places & Maps**, `SearchPlaces`, `PlacesProvider`, and Mapbox-powered `MapView`
|
|
23
|
+
- 📈 **Tracking integrations**, `GoogleAnalytics`, `GoogleTagManager`, `FacebookPixel`, all dev-mode aware
|
|
24
|
+
- ✍️ **Rich text editing**, `RichText` (Slate.js-based WYSIWYG editor) with `toHtml`/`toRichTextValue` conversion services
|
|
25
|
+
- 🪝 **Hooks**, `useForm`, `useModal`, `useDrawer`, `useToast`, `useSlider`, `useHydrated`, `useScopedParams`, `useScrollLock`, `useAutomation`, `useSearchAutomation`
|
|
26
|
+
- 🧑💻 **SSR-safe**, `ClientOnly` and `useHydrated` guard against hydration mismatches for browser-only UI
|
|
27
27
|
|
|
28
28
|
## 📋 Prerequisites
|
|
29
29
|
|
|
@@ -31,24 +31,24 @@ Every React/Remix/React Router/Next app ends up rebuilding the same UI primitive
|
|
|
31
31
|
- Always-required peer dependencies:
|
|
32
32
|
- `react >=18.0.0`
|
|
33
33
|
- `react-dom >=18.0.0`
|
|
34
|
-
- `lucide-react >=1.14.0
|
|
34
|
+
- `lucide-react >=1.14.0`, used for icons across most components
|
|
35
35
|
|
|
36
36
|
### Optional peer dependencies
|
|
37
37
|
|
|
38
38
|
Only install these if you use the specific component/hook that needs them:
|
|
39
39
|
|
|
40
|
-
- `mapbox-gl >=3.0.0
|
|
41
|
-
- `is-hotkey >=0.2.0
|
|
42
|
-
- `slate >=0.100.0`, `slate-history >=0.100.0`, `slate-react >=0.100.0
|
|
43
|
-
- `@react-google-maps/api >=2.0.0
|
|
44
|
-
- `react-scroll >=1.8.0
|
|
45
|
-
- `@react-input/mask >=2.0.0
|
|
46
|
-
- `html-react-parser >=5.0.0
|
|
47
|
-
- `react-hot-toast >=2.0.0
|
|
40
|
+
- `mapbox-gl >=3.0.0`, required by `MapView`
|
|
41
|
+
- `is-hotkey >=0.2.0`, required by `RichText`
|
|
42
|
+
- `slate >=0.100.0`, `slate-history >=0.100.0`, `slate-react >=0.100.0`, required by `RichText`
|
|
43
|
+
- `@react-google-maps/api >=2.0.0`, required by `PlacesProvider` and `SearchPlaces`
|
|
44
|
+
- `react-scroll >=1.8.0`, required by `useAutomation`
|
|
45
|
+
- `@react-input/mask >=2.0.0`, required by `MaskedInput` and `PhoneInput`
|
|
46
|
+
- `html-react-parser >=5.0.0`, required by the `toRichTextValue` service
|
|
47
|
+
- `react-hot-toast >=2.0.0`, required by `ToastProvider` / `useToast`
|
|
48
48
|
|
|
49
49
|
## 📦 Installation
|
|
50
50
|
|
|
51
|
-
> **ESM only.** This package ships as native ES modules with no CommonJS build
|
|
51
|
+
> **ESM only.** This package ships as native ES modules with no CommonJS build, use `import`, not `require()`.
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
npm install @arkyn/components react react-dom lucide-react
|
|
@@ -84,7 +84,7 @@ import { Button } from "@arkyn/components/button";
|
|
|
84
84
|
import "@arkyn/components/button.css";
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Each `<name>.css` file is self-contained
|
|
87
|
+
Each `<name>.css` file is self-contained, safe to import on its own without the aggregate `@arkyn/components/styles`. If you use several components, importing the aggregate stylesheet once is usually simpler and avoids any duplicate CSS between per-component files that share internals (e.g. `FileUpload` and `Button`).
|
|
88
88
|
|
|
89
89
|
## 🚀 Quick Start
|
|
90
90
|
|
|
@@ -3,17 +3,17 @@ import "./styles.css";
|
|
|
3
3
|
type AlertContainerProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Visual style and semantic meaning.
|
|
6
|
-
* - `success`: green
|
|
7
|
-
* - `danger`: red
|
|
8
|
-
* - `warning`: yellow
|
|
9
|
-
* - `info`: blue
|
|
6
|
+
* - `success`: green, operation completed.
|
|
7
|
+
* - `danger`: red, error or destructive action.
|
|
8
|
+
* - `warning`: yellow, caution required.
|
|
9
|
+
* - `info`: blue, informational message.
|
|
10
10
|
*/
|
|
11
11
|
scheme: "success" | "danger" | "warning" | "info";
|
|
12
12
|
} & HTMLAttributes<HTMLDivElement>;
|
|
13
13
|
/** @internal Accesses the schema and HTML props of the enclosing `AlertContainer`. */
|
|
14
14
|
declare function useAlertContainer(): AlertContainerProps;
|
|
15
15
|
/**
|
|
16
|
-
* AlertContainer
|
|
16
|
+
* AlertContainer, root wrapper for the Alert component set. Provides schema context to child components.
|
|
17
17
|
*
|
|
18
18
|
* Automatically detects whether an `AlertTitle` is present among children and adjusts layout:
|
|
19
19
|
* centered when no title, left-aligned when a title is present.
|
|
@@ -27,13 +27,13 @@ declare function useAlertContainer(): AlertContainerProps;
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```tsx
|
|
30
|
-
* // Inline alert
|
|
30
|
+
* // Inline alert, no title, centered layout
|
|
31
31
|
* <AlertContainer scheme="success">
|
|
32
32
|
* <AlertIcon />
|
|
33
33
|
* <AlertContent>Your subscription has been activated.</AlertContent>
|
|
34
34
|
* </AlertContainer>
|
|
35
35
|
*
|
|
36
|
-
* // Full alert with title and description
|
|
36
|
+
* // Full alert with title and description, left-aligned layout
|
|
37
37
|
* <AlertContainer scheme="danger">
|
|
38
38
|
* <AlertIcon />
|
|
39
39
|
* <AlertContent>
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes, JSX } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type AlertContentProps = HTMLAttributes<HTMLDivElement>;
|
|
4
4
|
/**
|
|
5
|
-
* AlertContent
|
|
5
|
+
* AlertContent, text/content area inside an `AlertContainer`. Wraps `AlertTitle` and `AlertDescription`.
|
|
6
6
|
*
|
|
7
7
|
* Accepts all standard `<div>` HTML attributes.
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes, JSX } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type AlertDescriptionProps = HTMLAttributes<HTMLDivElement>;
|
|
4
4
|
/**
|
|
5
|
-
* AlertDescription
|
|
5
|
+
* AlertDescription, body text for an alert. Place inside `AlertContent`.
|
|
6
6
|
*
|
|
7
7
|
* Accepts all standard `<div>` HTML attributes.
|
|
8
8
|
*
|
|
@@ -3,7 +3,7 @@ import type { JSX } from "react";
|
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
type AlertIconProps = LucideProps;
|
|
5
5
|
/**
|
|
6
|
-
* AlertIcon
|
|
6
|
+
* AlertIcon, renders a scheme-appropriate icon from `AlertContainer` context.
|
|
7
7
|
*
|
|
8
8
|
* - `success` → `CheckCircle2`
|
|
9
9
|
* - `danger` → `XCircle`
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes, JSX } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type AlertTitleProps = HTMLAttributes<HTMLDivElement>;
|
|
4
4
|
/**
|
|
5
|
-
* AlertTitle
|
|
5
|
+
* AlertTitle, bold heading for an alert. Place inside `AlertContent`.
|
|
6
6
|
*
|
|
7
7
|
* Its presence is detected by `AlertContainer` to switch the layout from centered to left-aligned.
|
|
8
8
|
* Accepts all standard `<div>` HTML attributes.
|
|
@@ -22,7 +22,7 @@ type AudioPlayerProps = Omit<AudioHTMLAttributes<HTMLAudioElement>, "onEnded" |
|
|
|
22
22
|
onPauseAudio?: (props: AudioInformationProps) => void;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* AudioPlayer
|
|
25
|
+
* AudioPlayer, play/pause controls, a scrubable progress bar, and elapsed/total time display.
|
|
26
26
|
*
|
|
27
27
|
* @param props.src - Audio file URL. Required.
|
|
28
28
|
* @param props.disabled - Disables controls. Default: false
|
|
@@ -30,7 +30,7 @@ type AudioUploadProps = {
|
|
|
30
30
|
defaultValue?: string;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* AudioUpload
|
|
33
|
+
* AudioUpload, drag-and-drop audio file uploader with server upload and playback preview.
|
|
34
34
|
*
|
|
35
35
|
* Sends the file via `fetch` as `multipart/form-data` and stores the returned URL
|
|
36
36
|
* in a hidden `<input>` for form submission.
|
|
@@ -41,7 +41,7 @@ type AudioUploadProps = {
|
|
|
41
41
|
* @param props.fileName - Form-data field name for the file. Default: "file"
|
|
42
42
|
* @param props.method - HTTP method. Default: "POST"
|
|
43
43
|
* @param props.acceptAudio - Accepted MIME types / extensions. Default: "audio/*"
|
|
44
|
-
* @param props.onChange - Callback fired after a successful upload
|
|
44
|
+
* @param props.onChange - Callback fired after a successful upload, receives the audio URL.
|
|
45
45
|
* @param props.fileResponseName - Server response property containing the URL. Default: "url"
|
|
46
46
|
* @param props.label - Label text displayed above the upload area.
|
|
47
47
|
* @param props.showAsterisk - Appends `*` to the label. Default: false
|
|
@@ -26,7 +26,7 @@ type BadgeProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
26
26
|
rightIcon?: LucideIcon;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* Badge
|
|
29
|
+
* Badge, displays labels, statuses, and categorization tags.
|
|
30
30
|
*
|
|
31
31
|
* @param props.size - Badge size (`md` | `lg`). Default: "lg"
|
|
32
32
|
* @param props.variant - Visual style variant. Default: "ghost"
|
|
@@ -31,7 +31,7 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
31
31
|
rightIcon?: LucideIcon;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
* Button
|
|
34
|
+
* Button, used for user interactions and form submissions.
|
|
35
35
|
*
|
|
36
36
|
* @param props.isLoading - Shows a spinner and disables the button. Default: false
|
|
37
37
|
* @param props.loadingText - Text displayed beside the spinner when loading.
|
|
@@ -7,7 +7,7 @@ type CardTabButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "childre
|
|
|
7
7
|
value: string;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* CardTabButton
|
|
10
|
+
* CardTabButton, individual tab button inside a `CardTabContainer`.
|
|
11
11
|
*
|
|
12
12
|
* Reads active state and disabled state from `CardTabContainer` context.
|
|
13
13
|
* The button's own `disabled` prop is ORed with the container's `disabled`.
|
|
@@ -11,7 +11,7 @@ type CardTabContainerProps = Omit<HTMLAttributes<HTMLElement>, "onClick" | "chil
|
|
|
11
11
|
onChange?: (index: string) => void;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* CardTabContainer
|
|
14
|
+
* CardTabContainer, wrapper that manages active state for a group of `CardTabButton` components.
|
|
15
15
|
*
|
|
16
16
|
* Renders as a `<nav>` element. Provides context consumed by each `CardTabButton`.
|
|
17
17
|
*
|
|
@@ -22,7 +22,7 @@ type CheckboxProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size" | "pre
|
|
|
22
22
|
checked?: boolean;
|
|
23
23
|
/** Uncontrolled initial checked state. @default false */
|
|
24
24
|
defaultChecked?: boolean;
|
|
25
|
-
/** Callback fired on toggle
|
|
25
|
+
/** Callback fired on toggle, receives the value string (or `""` when unchecked). */
|
|
26
26
|
onCheck?: (value: string) => void;
|
|
27
27
|
/**
|
|
28
28
|
* Layout direction forwarded to `FieldTemplate`.
|
|
@@ -31,7 +31,7 @@ type CheckboxProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size" | "pre
|
|
|
31
31
|
orientation?: "horizontal" | "vertical" | "horizontalReverse";
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
* Checkbox
|
|
34
|
+
* Checkbox, interactive checkbox input with label, validation, and form integration.
|
|
35
35
|
*
|
|
36
36
|
* Stores value in a hidden `<input>` for native form submission.
|
|
37
37
|
* Integrates with `useForm` to display validation errors by field name.
|
|
@@ -42,7 +42,7 @@ type CheckboxProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size" | "pre
|
|
|
42
42
|
* @param props.value - Value stored when checked. Default: "checked"
|
|
43
43
|
* @param props.checked - Controlled checked state.
|
|
44
44
|
* @param props.defaultChecked - Uncontrolled initial checked state. Default: false
|
|
45
|
-
* @param props.onCheck - Callback fired on toggle
|
|
45
|
+
* @param props.onCheck - Callback fired on toggle, receives value or `""` when unchecked.
|
|
46
46
|
* @param props.errorMessage - Validation error message.
|
|
47
47
|
* @param props.showAsterisk - Appends `*` to the label.
|
|
48
48
|
* @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: "horizontalReverse"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAA2B,MAAM,OAAO,CAAC;AAK3E,OAAO,cAAc,CAAC;AAEtB,KAAK,aAAa,GAAG,IAAI,CACxB,oBAAoB,CAAC,iBAAiB,CAAC,EACrC,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,cAAc,GACd,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,CACX,GAAG;IACH,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAA2B,MAAM,OAAO,CAAC;AAK3E,OAAO,cAAc,CAAC;AAEtB,KAAK,aAAa,GAAG,IAAI,CACxB,oBAAoB,CAAC,iBAAiB,CAAC,EACrC,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,cAAc,GACd,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,CACX,GAAG;IACH,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oFAAoF;IACpF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,mBAAmB,CAAC;CAC9D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAuErC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
type ClientOnlyProps = {
|
|
2
|
-
/** Render function
|
|
2
|
+
/** Render function, called after hydration on the client. Required. */
|
|
3
3
|
children(): React.ReactNode;
|
|
4
4
|
/** Content rendered during SSR or before hydration. @default null */
|
|
5
5
|
fallback?: React.ReactNode;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* ClientOnly
|
|
8
|
+
* ClientOnly, renders its children only after client-side hydration.
|
|
9
9
|
*
|
|
10
10
|
* Prevents React hydration mismatches for components that rely on browser-only APIs
|
|
11
11
|
* (e.g. `window`, `navigator`, `document`). Uses `useHydrated` internally.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientOnly.d.ts","sourceRoot":"","sources":["../../src/components/clientOnly.tsx"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACtB,
|
|
1
|
+
{"version":3,"file":"clientOnly.d.ts","sourceRoot":"","sources":["../../src/components/clientOnly.tsx"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACtB,uEAAuE;IACvE,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,6BAGzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -62,7 +62,7 @@ type CurrencyInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "
|
|
|
62
62
|
onChange?: (event: ChangeEvent<HTMLInputElement>, originalValue: string, maskedValue: string) => void;
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
|
-
* CurrencyInput
|
|
65
|
+
* CurrencyInput, numeric input that automatically formats the displayed value according to a currency locale.
|
|
66
66
|
*
|
|
67
67
|
* The raw numeric value is stored in a hidden `<input>` for form submission.
|
|
68
68
|
* Integrates with `useForm` to display validation errors by field name.
|
|
@@ -77,7 +77,7 @@ type CurrencyInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "
|
|
|
77
77
|
* @param props.max - Maximum numeric value allowed. Default: 1_000_000_000
|
|
78
78
|
* @param props.value - Controlled numeric value.
|
|
79
79
|
* @param props.defaultValue - Uncontrolled default numeric value.
|
|
80
|
-
* @param props.onChange - Callback fired on change
|
|
80
|
+
* @param props.onChange - Callback fired on change, receives the event, the raw numeric string, and the formatted string.
|
|
81
81
|
* @param props.prefix - Text or icon at the far left.
|
|
82
82
|
* @param props.suffix - Text or icon at the far right.
|
|
83
83
|
* @param props.leftIcon - Lucide icon inside the input on the left.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
type DatePickerCalendarContainerProps = {
|
|
4
|
+
isFocused: boolean;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare function DatePickerCalendarContainer(props: DatePickerCalendarContainerProps): import("react").JSX.Element | null;
|
|
8
|
+
export { DatePickerCalendarContainer };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/datePicker/datePickerCalendarContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAIpE,OAAO,cAAc,CAAC;AAEtB,KAAK,gCAAgC,GAAG;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,iBAAS,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,sCA8C3E;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
type DatePickerChevronProps = {
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
iconSize: number;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
isFocused: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function DatePickerChevron(props: DatePickerChevronProps): import("react").JSX.Element | null;
|
|
10
|
+
export { DatePickerChevron };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/datePicker/datePickerChevron/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,sBAAsB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,sCAqBvD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
type DatePickerContainerProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
handleContainerFocus: () => void;
|
|
6
|
+
prefixExists: boolean;
|
|
7
|
+
isError: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
readOnly: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
isFocused: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
id: string;
|
|
14
|
+
variant: "solid" | "outline" | "underline";
|
|
15
|
+
size: "md" | "lg";
|
|
16
|
+
};
|
|
17
|
+
declare function DatePickerContainer(props: DatePickerContainerProps): import("react").JSX.Element;
|
|
18
|
+
export { DatePickerContainer };
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/datePicker/datePickerContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,wBAAwB,GAAG;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IAC3C,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CAClB,CAAC;AAEF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,+BA8B3D;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
type DatePickerContentProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
size: "md" | "lg";
|
|
6
|
+
};
|
|
7
|
+
declare function DatePickerContent(props: DatePickerContentProps): import("react").JSX.Element;
|
|
8
|
+
export { DatePickerContent };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/datePicker/datePickerContent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,sBAAsB,GAAG;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CAClB,CAAC;AAEF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAIvD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
type DatePickerOverlayProps = {
|
|
3
|
+
isFocused: boolean;
|
|
4
|
+
handleBlur: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare function DatePickerOverlay(props: DatePickerOverlayProps): import("react").JSX.Element | null;
|
|
7
|
+
export { DatePickerOverlay };
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/datePicker/datePickerOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,KAAK,sBAAsB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,sCAIvD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
type DatePickerSpinnerProps = {
|
|
3
|
+
iconSize: number;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare function DatePickerSpinner(props: DatePickerSpinnerProps): import("react").JSX.Element | null;
|
|
7
|
+
export { DatePickerSpinner };
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/datePicker/datePickerSpinner/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,sBAAsB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,sCAWvD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
import { type FocusEvent } from "react";
|
|
3
|
+
type BaseDatePickerProps = {
|
|
4
|
+
/** Field name for form submission. Required. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Optional HTML id for the underlying hidden input. */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** Displays an asterisk on the label to signal a required field. */
|
|
9
|
+
showAsterisk?: boolean;
|
|
10
|
+
/** Optional label text displayed above the date picker. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Validation error message displayed below the date picker. */
|
|
13
|
+
errorMessage?: string;
|
|
14
|
+
/** Placeholder text shown when no date is selected. @default "Selecione uma data..." */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Additional CSS class applied to the wrapper element. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Disables all interactions. @default false */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Prevents value changes while keeping the current value visible. @default false */
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
/** Shows a loading spinner and disables interactions. @default false */
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Closes the calendar after a date is picked.
|
|
26
|
+
* @default true for `single`, `false` for `range`.
|
|
27
|
+
*/
|
|
28
|
+
closeOnSelect?: boolean;
|
|
29
|
+
/** Callback fired when the date picker gains focus. */
|
|
30
|
+
onFocus?: () => void;
|
|
31
|
+
/** Callback fired when the date picker loses focus. */
|
|
32
|
+
onBlur?: (e: FocusEvent<HTMLDivElement>) => void;
|
|
33
|
+
/**
|
|
34
|
+
* DatePicker size.
|
|
35
|
+
* @default "md"
|
|
36
|
+
*/
|
|
37
|
+
size?: "md" | "lg";
|
|
38
|
+
/**
|
|
39
|
+
* Visual style variant.
|
|
40
|
+
* - `solid`: filled background.
|
|
41
|
+
* - `outline`: bordered, transparent background.
|
|
42
|
+
* - `underline`: bottom border only.
|
|
43
|
+
* @default "solid"
|
|
44
|
+
*/
|
|
45
|
+
variant?: "solid" | "outline" | "underline";
|
|
46
|
+
/** Text or icon rendered at the far left, outside the date picker area. */
|
|
47
|
+
prefix?: string | LucideIcon;
|
|
48
|
+
/** Lucide icon rendered inside the date picker on the left. */
|
|
49
|
+
leftIcon?: LucideIcon;
|
|
50
|
+
/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */
|
|
51
|
+
unShowFieldTemplate?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Layout direction forwarded to `FieldTemplate`.
|
|
54
|
+
* @default "vertical"
|
|
55
|
+
*/
|
|
56
|
+
orientation?: "horizontal" | "vertical" | "horizontalReverse";
|
|
57
|
+
/**
|
|
58
|
+
* Visual/behavioral variant forwarded to the internal `Calendar`.
|
|
59
|
+
* @default "complete"
|
|
60
|
+
*/
|
|
61
|
+
calendarVariant?: "basic" | "complete";
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Props for DatePicker single-date selection mode.
|
|
65
|
+
*/
|
|
66
|
+
type SingleDatePickerProps = BaseDatePickerProps & {
|
|
67
|
+
/** Sets single-date selection mode. */
|
|
68
|
+
type: "single";
|
|
69
|
+
/** Controlled selected date. */
|
|
70
|
+
value?: Date;
|
|
71
|
+
/** Uncontrolled default selected date. */
|
|
72
|
+
defaultValue?: Date;
|
|
73
|
+
/** Callback fired when the selected date changes. */
|
|
74
|
+
onChange?: (date: Date) => void;
|
|
75
|
+
/** Currently focused calendar view date. */
|
|
76
|
+
viewValue?: Date;
|
|
77
|
+
/** Initial focused calendar view date. */
|
|
78
|
+
defaultViewValue?: Date;
|
|
79
|
+
/** Callback fired when the calendar view (month/year) changes. */
|
|
80
|
+
onChangeView?: (date: Date) => void;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Props for DatePicker range selection mode.
|
|
84
|
+
*/
|
|
85
|
+
type RangeDatePickerProps = BaseDatePickerProps & {
|
|
86
|
+
/** Sets range selection mode. */
|
|
87
|
+
type: "range";
|
|
88
|
+
/** Controlled selected range in `[start, end]` format. */
|
|
89
|
+
value?: [Date, Date];
|
|
90
|
+
/** Uncontrolled default range in `[start, end]` format. */
|
|
91
|
+
defaultValue?: [Date, Date];
|
|
92
|
+
/** Callback fired when the selected range changes. */
|
|
93
|
+
onChange?: (date: [Date, Date]) => void;
|
|
94
|
+
/** Currently focused calendar view date. */
|
|
95
|
+
viewValue?: Date;
|
|
96
|
+
/** Initial focused calendar view date. */
|
|
97
|
+
defaultViewValue?: Date;
|
|
98
|
+
/** Callback fired when the calendar view (month/year) changes. */
|
|
99
|
+
onChangeView?: (date: Date) => void;
|
|
100
|
+
/** Text placed between the start and end dates. @default " até " */
|
|
101
|
+
rangeSeparator?: string;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Discriminated union of DatePicker props.
|
|
105
|
+
*/
|
|
106
|
+
type DatePickerProps = SingleDatePickerProps | RangeDatePickerProps;
|
|
107
|
+
/**
|
|
108
|
+
* DatePicker, date input field with a popover `Calendar`, supporting single-date
|
|
109
|
+
* (`single`) and range (`range`) selection modes.
|
|
110
|
+
*
|
|
111
|
+
* Opens the calendar on click, the same way `Select` opens its options list, flipping
|
|
112
|
+
* upward or downward depending on the available viewport space so it never renders
|
|
113
|
+
* off-screen. Integrates with `useForm` to display validation errors by field name.
|
|
114
|
+
*
|
|
115
|
+
* @param props.name - Field name for form submission. Required.
|
|
116
|
+
* @param props.type - Selection mode (`single` | `range`). Required.
|
|
117
|
+
* @param props.value - Controlled selected date (`single`) or range (`range`).
|
|
118
|
+
* @param props.defaultValue - Uncontrolled default date or range.
|
|
119
|
+
* @param props.label - Label text displayed above the date picker.
|
|
120
|
+
* @param props.placeholder - Placeholder shown when nothing is selected. Default: "Selecione uma data..."
|
|
121
|
+
* @param props.errorMessage - Validation error message.
|
|
122
|
+
* @param props.isLoading - Shows a loading spinner and disables interactions. Default: false
|
|
123
|
+
* @param props.closeOnSelect - Closes the calendar after picking. Default: `true` for `single`, `false` for `range`.
|
|
124
|
+
* @param props.onChange - Callback fired when the selected date/range changes.
|
|
125
|
+
* @param props.calendarVariant - Visual/behavioral variant of the internal `Calendar`. Default: "complete"
|
|
126
|
+
* @param props.size - DatePicker size (`md` | `lg`). Default: "md"
|
|
127
|
+
* @param props.variant - Visual style variant. Default: "solid"
|
|
128
|
+
* @param props.orientation - Layout direction. Default: "vertical"
|
|
129
|
+
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
130
|
+
*
|
|
131
|
+
* @returns DatePicker JSX element wrapped in `FieldTemplate`.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```tsx
|
|
135
|
+
* // Single date
|
|
136
|
+
* <DatePicker
|
|
137
|
+
* type="single"
|
|
138
|
+
* name="birthDate"
|
|
139
|
+
* label="Data de nascimento"
|
|
140
|
+
* onChange={(date) => console.log("Selected date:", date)}
|
|
141
|
+
* />
|
|
142
|
+
*
|
|
143
|
+
* // Range
|
|
144
|
+
* <DatePicker
|
|
145
|
+
* type="range"
|
|
146
|
+
* name="stay"
|
|
147
|
+
* label="Período da estadia"
|
|
148
|
+
* calendarVariant="basic"
|
|
149
|
+
* onChange={([start, end]) => console.log("Range:", start, end)}
|
|
150
|
+
* />
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
declare function DatePicker(props: DatePickerProps): import("react").JSX.Element;
|
|
154
|
+
export { DatePicker };
|
|
155
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/datePicker/index.tsx"],"names":[],"mappings":"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"}
|
|
@@ -8,7 +8,7 @@ type DividerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
8
8
|
orientation?: "horizontal" | "vertical";
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
* Divider
|
|
11
|
+
* Divider, visually separates content sections.
|
|
12
12
|
*
|
|
13
13
|
* @param props.orientation - Line direction (`horizontal` | `vertical`). Default: "horizontal"
|
|
14
14
|
*
|
|
@@ -9,7 +9,7 @@ type DrawerContainerProps = HTMLAttributes<HTMLElement> & {
|
|
|
9
9
|
orientation?: "left" | "right";
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* DrawerContainer
|
|
12
|
+
* DrawerContainer, animated slide-in panel rendered over an overlay backdrop.
|
|
13
13
|
*
|
|
14
14
|
* Locks body scroll while open. Closes when the overlay is clicked.
|
|
15
15
|
* Provides context consumed by `DrawerHeader` (close button).
|
|
@@ -5,7 +5,7 @@ type DrawerHeaderProps = HTMLAttributes<HTMLElement> & {
|
|
|
5
5
|
showCloseButton?: boolean;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* DrawerHeader
|
|
8
|
+
* DrawerHeader, header section for a `DrawerContainer`, with an optional close button.
|
|
9
9
|
*
|
|
10
10
|
* The close button calls `makeInvisible` from the nearest `DrawerContainer` context.
|
|
11
11
|
* Must be rendered inside a `DrawerContainer`.
|
|
@@ -26,7 +26,7 @@ type FacebookPixelProps = {
|
|
|
26
26
|
trackSingleCustom?: [string, any?];
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* FacebookPixel
|
|
29
|
+
* FacebookPixel, injects the Facebook Pixel tracking script client-side.
|
|
30
30
|
*
|
|
31
31
|
* Renders nothing in development mode unless `showInDevMode` is `true`.
|
|
32
32
|
* Wrapped in `ClientOnly` to avoid SSR errors.
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type FieldErrorProps = HTMLAttributes<HTMLElement>;
|
|
4
4
|
/**
|
|
5
|
-
* FieldError
|
|
5
|
+
* FieldError, displays a validation error message below a form field.
|
|
6
6
|
*
|
|
7
7
|
* Renders nothing when `children` is empty or falsy.
|
|
8
8
|
*
|