@arkyn/components 3.0.1-beta.143 → 3.0.1-beta.144
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/dist/components/alert/alertContainer/index.d.ts +27 -43
- package/dist/components/alert/alertContainer/index.d.ts.map +1 -1
- package/dist/components/alert/alertContainer/index.js +20 -40
- package/dist/components/alert/alertContent/index.d.ts +11 -36
- package/dist/components/alert/alertContent/index.d.ts.map +1 -1
- package/dist/components/alert/alertContent/index.js +11 -31
- package/dist/components/alert/alertDescription/index.d.ts +10 -38
- package/dist/components/alert/alertDescription/index.d.ts.map +1 -1
- package/dist/components/alert/alertDescription/index.js +10 -33
- package/dist/components/alert/alertIcon/index.d.ts +14 -38
- package/dist/components/alert/alertIcon/index.d.ts.map +1 -1
- package/dist/components/alert/alertIcon/index.js +14 -32
- package/dist/components/alert/alertTitle/index.d.ts +12 -35
- package/dist/components/alert/alertTitle/index.d.ts.map +1 -1
- package/dist/components/alert/alertTitle/index.js +12 -27
- package/dist/components/audioPlayer/index.d.ts +24 -32
- package/dist/components/audioPlayer/index.d.ts.map +1 -1
- package/dist/components/audioPlayer/index.js +15 -18
- package/dist/components/audioUpload/index.d.ts +37 -48
- package/dist/components/audioUpload/index.d.ts.map +1 -1
- package/dist/components/audioUpload/index.js +23 -48
- package/dist/components/badge/index.d.ts +31 -22
- package/dist/components/badge/index.d.ts.map +1 -1
- package/dist/components/badge/index.js +14 -22
- package/dist/components/button/index.d.ts +38 -28
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/button/index.js +18 -28
- package/dist/components/cardTab/cardTabButton/index.d.ts +14 -52
- package/dist/components/cardTab/cardTabButton/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabButton/index.js +12 -52
- package/dist/components/cardTab/cardTabContainer/index.d.ts +16 -58
- package/dist/components/cardTab/cardTabContainer/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabContainer/index.js +12 -58
- package/dist/components/checkbox/index.d.ts +38 -37
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +21 -37
- package/dist/components/clientOnly.d.ts +13 -66
- package/dist/components/clientOnly.d.ts.map +1 -1
- package/dist/components/clientOnly.js +11 -66
- package/dist/components/currencyInput/index.d.ts +67 -50
- package/dist/components/currencyInput/index.d.ts.map +1 -1
- package/dist/components/currencyInput/index.js +28 -50
- package/dist/components/divider/index.d.ts +12 -25
- package/dist/components/divider/index.d.ts.map +1 -1
- package/dist/components/divider/index.js +8 -25
- package/dist/components/drawer/drawerContainer/index.d.ts +16 -50
- package/dist/components/drawer/drawerContainer/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerContainer/index.js +13 -50
- package/dist/components/drawer/drawerHeader/index.d.ts +9 -33
- package/dist/components/drawer/drawerHeader/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerHeader/index.js +8 -33
- package/dist/components/facebookPixel/index.d.ts +47 -0
- package/dist/components/facebookPixel/index.d.ts.map +1 -1
- package/dist/components/facebookPixel/index.js +35 -0
- package/dist/components/fieldError/index.d.ts +4 -11
- package/dist/components/fieldError/index.d.ts.map +1 -1
- package/dist/components/fieldError/index.js +4 -11
- package/dist/components/fieldLabel/index.d.ts +6 -21
- package/dist/components/fieldLabel/index.d.ts.map +1 -1
- package/dist/components/fieldLabel/index.js +5 -21
- package/dist/components/fieldWrapper/index.d.ts +12 -22
- package/dist/components/fieldWrapper/index.d.ts.map +1 -1
- package/dist/components/fieldWrapper/index.js +7 -22
- package/dist/components/fileUpload/index.d.ts +36 -61
- package/dist/components/fileUpload/index.d.ts.map +1 -1
- package/dist/components/fileUpload/index.js +23 -61
- package/dist/components/googleAnalytics/index.d.ts +11 -7
- package/dist/components/googleAnalytics/index.d.ts.map +1 -1
- package/dist/components/googleAnalytics/index.js +9 -7
- package/dist/components/googleTagManager/index.d.ts +27 -21
- package/dist/components/googleTagManager/index.d.ts.map +1 -1
- package/dist/components/googleTagManager/index.js +20 -21
- package/dist/components/iconButton/index.d.ts +31 -15
- package/dist/components/iconButton/index.d.ts.map +1 -1
- package/dist/components/iconButton/index.js +12 -15
- package/dist/components/imageUpload/index.d.ts +47 -75
- package/dist/components/imageUpload/index.d.ts.map +1 -1
- package/dist/components/imageUpload/index.js +27 -75
- package/dist/components/input/index.d.ts +51 -44
- package/dist/components/input/index.d.ts.map +1 -1
- package/dist/components/input/index.js +24 -44
- package/dist/components/mapView/index.d.ts +44 -0
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/mapView/index.js +35 -0
- package/dist/components/maskedInput/index.d.ts +66 -51
- package/dist/components/maskedInput/index.d.ts.map +1 -1
- package/dist/components/maskedInput/index.js +28 -51
- package/dist/components/modal/modalContainer/index.d.ts +17 -57
- package/dist/components/modal/modalContainer/index.d.ts.map +1 -1
- package/dist/components/modal/modalContainer/index.js +15 -57
- package/dist/components/modal/modalFooter/index.d.ts +17 -50
- package/dist/components/modal/modalFooter/index.d.ts.map +1 -1
- package/dist/components/modal/modalFooter/index.js +10 -50
- package/dist/components/modal/modalHeader/index.d.ts +13 -47
- package/dist/components/modal/modalHeader/index.d.ts.map +1 -1
- package/dist/components/modal/modalHeader/index.js +12 -47
- package/dist/components/multiSelect/index.d.ts +67 -62
- package/dist/components/multiSelect/index.d.ts.map +1 -1
- package/dist/components/multiSelect/index.js +28 -62
- package/dist/components/pagination/index.d.ts +18 -9
- package/dist/components/pagination/index.d.ts.map +1 -1
- package/dist/components/pagination/index.js +18 -9
- package/dist/components/phoneInput/index.d.ts +65 -30
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/phoneInput/index.js +35 -30
- package/dist/components/popover/index.d.ts +34 -114
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/popover/index.js +25 -114
- package/dist/components/radio/radioBox/index.d.ts +17 -65
- package/dist/components/radio/radioBox/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.js +14 -65
- package/dist/components/radio/radioGroup/index.d.ts +36 -67
- package/dist/components/radio/radioGroup/index.d.ts.map +1 -1
- package/dist/components/radio/radioGroup/index.js +25 -67
- package/dist/components/richText/index.d.ts +33 -47
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/index.js +30 -44
- package/dist/components/searchPlaces.d.ts +52 -50
- package/dist/components/searchPlaces.d.ts.map +1 -1
- package/dist/components/searchPlaces.js +23 -30
- package/dist/components/select/index.d.ts +68 -63
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +29 -63
- package/dist/components/slider/index.d.ts +20 -34
- package/dist/components/slider/index.d.ts.map +1 -1
- package/dist/components/slider/index.js +15 -33
- package/dist/components/switch/index.d.ts +42 -58
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/switch/index.js +24 -58
- package/dist/components/tab/tabButton/index.d.ts +14 -52
- package/dist/components/tab/tabButton/index.d.ts.map +1 -1
- package/dist/components/tab/tabButton/index.js +12 -52
- package/dist/components/tab/tabContainer/index.d.ts +16 -58
- package/dist/components/tab/tabContainer/index.d.ts.map +1 -1
- package/dist/components/tab/tabContainer/index.js +12 -58
- package/dist/components/table/tableBody/index.d.ts +13 -47
- package/dist/components/table/tableBody/index.d.ts.map +1 -1
- package/dist/components/table/tableBody/index.js +12 -47
- package/dist/components/table/tableCaption/index.d.ts +6 -46
- package/dist/components/table/tableCaption/index.d.ts.map +1 -1
- package/dist/components/table/tableCaption/index.js +6 -46
- package/dist/components/table/tableContainer/index.d.ts +12 -41
- package/dist/components/table/tableContainer/index.d.ts.map +1 -1
- package/dist/components/table/tableContainer/index.js +12 -41
- package/dist/components/table/tableFooter/index.d.ts +5 -29
- package/dist/components/table/tableFooter/index.d.ts.map +1 -1
- package/dist/components/table/tableFooter/index.js +5 -29
- package/dist/components/table/tableHeader/index.d.ts +4 -25
- package/dist/components/table/tableHeader/index.d.ts.map +1 -1
- package/dist/components/table/tableHeader/index.js +4 -25
- package/dist/components/textarea/index.d.ts +32 -64
- package/dist/components/textarea/index.d.ts.map +1 -1
- package/dist/components/textarea/index.js +16 -64
- package/dist/components/tooltip/index.d.ts +27 -55
- package/dist/components/tooltip/index.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +16 -55
- package/dist/hooks/useAutomation.d.ts +18 -26
- package/dist/hooks/useAutomation.d.ts.map +1 -1
- package/dist/hooks/useAutomation.js +18 -26
- package/dist/hooks/useDrawer.d.ts +19 -64
- package/dist/hooks/useDrawer.d.ts.map +1 -1
- package/dist/hooks/useForm.d.ts +12 -29
- package/dist/hooks/useForm.d.ts.map +1 -1
- package/dist/hooks/useForm.js +12 -29
- package/dist/hooks/useHydrated.d.ts +8 -63
- package/dist/hooks/useHydrated.d.ts.map +1 -1
- package/dist/hooks/useHydrated.js +8 -63
- package/dist/hooks/useModal.d.ts +19 -59
- package/dist/hooks/useModal.d.ts.map +1 -1
- package/dist/hooks/useScopedParams.d.ts +17 -69
- package/dist/hooks/useScopedParams.d.ts.map +1 -1
- package/dist/hooks/useScopedParams.js +17 -69
- package/dist/hooks/useScrollLock.d.ts +11 -27
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +11 -33
- package/dist/hooks/useSearchAutomation.d.ts +16 -34
- package/dist/hooks/useSearchAutomation.d.ts.map +1 -1
- package/dist/hooks/useSearchAutomation.js +16 -34
- package/dist/hooks/useSlider.d.ts +5 -19
- package/dist/hooks/useSlider.d.ts.map +1 -1
- package/dist/hooks/useSlider.js +5 -19
- package/dist/hooks/useToast.d.ts +8 -52
- package/dist/hooks/useToast.d.ts.map +1 -1
- package/dist/hooks/useToast.js +8 -52
- package/dist/providers/drawerProvider.d.ts +15 -81
- package/dist/providers/drawerProvider.d.ts.map +1 -1
- package/dist/providers/drawerProvider.js +15 -81
- package/dist/providers/formProvider.d.ts +17 -53
- package/dist/providers/formProvider.d.ts.map +1 -1
- package/dist/providers/formProvider.js +17 -53
- package/dist/providers/modalProvider.d.ts +16 -77
- package/dist/providers/modalProvider.d.ts.map +1 -1
- package/dist/providers/modalProvider.js +16 -77
- package/dist/providers/placesProvider.d.ts +16 -11
- package/dist/providers/placesProvider.d.ts.map +1 -1
- package/dist/providers/placesProvider.js +16 -11
- package/dist/providers/toastProvider.d.ts +10 -21
- package/dist/providers/toastProvider.d.ts.map +1 -1
- package/dist/providers/toastProvider.js +10 -21
- package/dist/services/toHtml.d.ts +11 -10
- package/dist/services/toHtml.d.ts.map +1 -1
- package/dist/services/toHtml.js +11 -10
- package/dist/services/toRichTextValue.d.ts +11 -17
- package/dist/services/toRichTextValue.d.ts.map +1 -1
- package/dist/services/toRichTextValue.js +11 -17
- package/package.json +1 -1
|
@@ -1,84 +1,31 @@
|
|
|
1
1
|
type ClientOnlyProps = {
|
|
2
|
+
/** Render function — called after hydration on the client. Required. */
|
|
2
3
|
children(): React.ReactNode;
|
|
4
|
+
/** Content rendered during SSR or before hydration. @default null */
|
|
3
5
|
fallback?: React.ReactNode;
|
|
4
6
|
};
|
|
5
7
|
/**
|
|
6
|
-
* ClientOnly
|
|
8
|
+
* ClientOnly — renders its children only after client-side hydration.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* or need to render differently on server and client.
|
|
10
|
+
* Prevents React hydration mismatches for components that rely on browser-only APIs
|
|
11
|
+
* (e.g. `window`, `navigator`, `document`). Uses `useHydrated` internally.
|
|
11
12
|
*
|
|
12
|
-
* @param props -
|
|
13
|
-
* @param props.
|
|
14
|
-
* @param props.fallback - Optional React node to render during SSR or before hydration
|
|
13
|
+
* @param props.children - Render function executed after hydration. Required.
|
|
14
|
+
* @param props.fallback - Content shown during SSR / before hydration. Default: null
|
|
15
15
|
*
|
|
16
|
-
* @returns
|
|
16
|
+
* @returns `children()` after hydration, otherwise `fallback`.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```tsx
|
|
20
|
-
* //
|
|
21
|
-
* <ClientOnly fallback={<
|
|
20
|
+
* // With a skeleton fallback
|
|
21
|
+
* <ClientOnly fallback={<Skeleton />}>
|
|
22
22
|
* {() => <InteractiveWidget />}
|
|
23
23
|
* </ClientOnly>
|
|
24
24
|
*
|
|
25
|
-
* //
|
|
26
|
-
* <ClientOnly>
|
|
27
|
-
* {() => (
|
|
28
|
-
* <div>
|
|
29
|
-
* <p>This content only appears on the client</p>
|
|
30
|
-
* <p>Current time: {new Date().toLocaleString()}</p>
|
|
31
|
-
* </div>
|
|
32
|
-
* )}
|
|
25
|
+
* // Using browser APIs safely
|
|
26
|
+
* <ClientOnly fallback={<p>Loading...</p>}>
|
|
27
|
+
* {() => <p>Current time: {new Date().toLocaleString()}</p>}
|
|
33
28
|
* </ClientOnly>
|
|
34
|
-
*
|
|
35
|
-
* // Using with browser APIs
|
|
36
|
-
* <ClientOnly fallback={<div>Preparing location services...</div>}>
|
|
37
|
-
* {() => <GeolocationComponent />}
|
|
38
|
-
* </ClientOnly>
|
|
39
|
-
*
|
|
40
|
-
* // Complex interactive component
|
|
41
|
-
* <ClientOnly fallback={<StaticPlaceholder />}>
|
|
42
|
-
* {() => (
|
|
43
|
-
* <div>
|
|
44
|
-
* <Chart data={chartData} />
|
|
45
|
-
* <InteractiveControls />
|
|
46
|
-
* <RealtimeUpdates />
|
|
47
|
-
* </div>
|
|
48
|
-
* )}
|
|
49
|
-
* </ClientOnly>
|
|
50
|
-
*
|
|
51
|
-
* // Conditional rendering based on client capabilities
|
|
52
|
-
* <ClientOnly fallback={<BasicTable data={data} />}>
|
|
53
|
-
* {() => (
|
|
54
|
-
* <AdvancedDataGrid
|
|
55
|
-
* data={data}
|
|
56
|
-
* features={['sorting', 'filtering', 'virtualization']}
|
|
57
|
-
* />
|
|
58
|
-
* )}
|
|
59
|
-
* </ClientOnly>
|
|
60
|
-
*
|
|
61
|
-
* // Using with dynamic imports
|
|
62
|
-
* <ClientOnly fallback={<div>Loading editor...</div>}>
|
|
63
|
-
* {() => <LazyCodeEditor />}
|
|
64
|
-
* </ClientOnly>
|
|
65
|
-
*
|
|
66
|
-
* // Preventing layout shift
|
|
67
|
-
* <ClientOnly fallback={<div className="skeleton-loader" />}>
|
|
68
|
-
* {() => <UserDashboard />}
|
|
69
|
-
* </ClientOnly>
|
|
70
|
-
*
|
|
71
|
-
* // Multiple client-only sections
|
|
72
|
-
* <div>
|
|
73
|
-
* <Header />
|
|
74
|
-
* <ClientOnly fallback={<div>Loading navigation...</div>}>
|
|
75
|
-
* {() => <InteractiveNavigation />}
|
|
76
|
-
* </ClientOnly>
|
|
77
|
-
* <MainContent />
|
|
78
|
-
* <ClientOnly>
|
|
79
|
-
* {() => <ChatWidget />}
|
|
80
|
-
* </ClientOnly>
|
|
81
|
-
* </div>
|
|
82
29
|
* ```
|
|
83
30
|
*/
|
|
84
31
|
declare function ClientOnly(props: ClientOnlyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientOnly.d.ts","sourceRoot":"","sources":["../../src/components/clientOnly.tsx"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACrB,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"clientOnly.d.ts","sourceRoot":"","sources":["../../src/components/clientOnly.tsx"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACrB,wEAAwE;IACxE,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CAGzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,82 +1,27 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useHydrated } from "../hooks/useHydrated";
|
|
3
3
|
/**
|
|
4
|
-
* ClientOnly
|
|
4
|
+
* ClientOnly — renders its children only after client-side hydration.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* or need to render differently on server and client.
|
|
6
|
+
* Prevents React hydration mismatches for components that rely on browser-only APIs
|
|
7
|
+
* (e.g. `window`, `navigator`, `document`). Uses `useHydrated` internally.
|
|
9
8
|
*
|
|
10
|
-
* @param props -
|
|
11
|
-
* @param props.
|
|
12
|
-
* @param props.fallback - Optional React node to render during SSR or before hydration
|
|
9
|
+
* @param props.children - Render function executed after hydration. Required.
|
|
10
|
+
* @param props.fallback - Content shown during SSR / before hydration. Default: null
|
|
13
11
|
*
|
|
14
|
-
* @returns
|
|
12
|
+
* @returns `children()` after hydration, otherwise `fallback`.
|
|
15
13
|
*
|
|
16
14
|
* @example
|
|
17
15
|
* ```tsx
|
|
18
|
-
* //
|
|
19
|
-
* <ClientOnly fallback={<
|
|
16
|
+
* // With a skeleton fallback
|
|
17
|
+
* <ClientOnly fallback={<Skeleton />}>
|
|
20
18
|
* {() => <InteractiveWidget />}
|
|
21
19
|
* </ClientOnly>
|
|
22
20
|
*
|
|
23
|
-
* //
|
|
24
|
-
* <ClientOnly>
|
|
25
|
-
* {() => (
|
|
26
|
-
* <div>
|
|
27
|
-
* <p>This content only appears on the client</p>
|
|
28
|
-
* <p>Current time: {new Date().toLocaleString()}</p>
|
|
29
|
-
* </div>
|
|
30
|
-
* )}
|
|
21
|
+
* // Using browser APIs safely
|
|
22
|
+
* <ClientOnly fallback={<p>Loading...</p>}>
|
|
23
|
+
* {() => <p>Current time: {new Date().toLocaleString()}</p>}
|
|
31
24
|
* </ClientOnly>
|
|
32
|
-
*
|
|
33
|
-
* // Using with browser APIs
|
|
34
|
-
* <ClientOnly fallback={<div>Preparing location services...</div>}>
|
|
35
|
-
* {() => <GeolocationComponent />}
|
|
36
|
-
* </ClientOnly>
|
|
37
|
-
*
|
|
38
|
-
* // Complex interactive component
|
|
39
|
-
* <ClientOnly fallback={<StaticPlaceholder />}>
|
|
40
|
-
* {() => (
|
|
41
|
-
* <div>
|
|
42
|
-
* <Chart data={chartData} />
|
|
43
|
-
* <InteractiveControls />
|
|
44
|
-
* <RealtimeUpdates />
|
|
45
|
-
* </div>
|
|
46
|
-
* )}
|
|
47
|
-
* </ClientOnly>
|
|
48
|
-
*
|
|
49
|
-
* // Conditional rendering based on client capabilities
|
|
50
|
-
* <ClientOnly fallback={<BasicTable data={data} />}>
|
|
51
|
-
* {() => (
|
|
52
|
-
* <AdvancedDataGrid
|
|
53
|
-
* data={data}
|
|
54
|
-
* features={['sorting', 'filtering', 'virtualization']}
|
|
55
|
-
* />
|
|
56
|
-
* )}
|
|
57
|
-
* </ClientOnly>
|
|
58
|
-
*
|
|
59
|
-
* // Using with dynamic imports
|
|
60
|
-
* <ClientOnly fallback={<div>Loading editor...</div>}>
|
|
61
|
-
* {() => <LazyCodeEditor />}
|
|
62
|
-
* </ClientOnly>
|
|
63
|
-
*
|
|
64
|
-
* // Preventing layout shift
|
|
65
|
-
* <ClientOnly fallback={<div className="skeleton-loader" />}>
|
|
66
|
-
* {() => <UserDashboard />}
|
|
67
|
-
* </ClientOnly>
|
|
68
|
-
*
|
|
69
|
-
* // Multiple client-only sections
|
|
70
|
-
* <div>
|
|
71
|
-
* <Header />
|
|
72
|
-
* <ClientOnly fallback={<div>Loading navigation...</div>}>
|
|
73
|
-
* {() => <InteractiveNavigation />}
|
|
74
|
-
* </ClientOnly>
|
|
75
|
-
* <MainContent />
|
|
76
|
-
* <ClientOnly>
|
|
77
|
-
* {() => <ChatWidget />}
|
|
78
|
-
* </ClientOnly>
|
|
79
|
-
* </div>
|
|
80
25
|
* ```
|
|
81
26
|
*/
|
|
82
27
|
function ClientOnly(props) {
|
|
@@ -3,59 +3,99 @@ import { ChangeEvent, InputHTMLAttributes } from "react";
|
|
|
3
3
|
import "./style.css";
|
|
4
4
|
type Locale = "USD" | "EUR" | "JPY" | "GBP" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "BRL" | "INR" | "RUB" | "ZAR" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "IDR" | "THB";
|
|
5
5
|
type CurrencyInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "name" | "type" | "max" | "defaultValue" | "value" | "onChange" | "placeholder"> & {
|
|
6
|
+
/** Field name for form submission. Required. */
|
|
6
7
|
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Currency locale used to format the displayed value.
|
|
10
|
+
* Supported: `"USD"` | `"EUR"` | `"BRL"` | `"JPY"` | `"GBP"` | … (22 locales).
|
|
11
|
+
* Required.
|
|
12
|
+
*/
|
|
7
13
|
locale: Locale;
|
|
14
|
+
/** Optional label text displayed above the input. */
|
|
8
15
|
label?: string;
|
|
16
|
+
/** Validation error message displayed below the input. */
|
|
9
17
|
errorMessage?: string;
|
|
18
|
+
/** Shows a spinner and disables the input during async operations. @default false */
|
|
10
19
|
isLoading?: boolean;
|
|
20
|
+
/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */
|
|
11
21
|
unShowFieldTemplate?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Input size.
|
|
24
|
+
* @default "md"
|
|
25
|
+
*/
|
|
12
26
|
size?: "md" | "lg";
|
|
27
|
+
/**
|
|
28
|
+
* Visual style variant.
|
|
29
|
+
* - `solid`: filled background.
|
|
30
|
+
* - `outline`: bordered, transparent background.
|
|
31
|
+
* - `underline`: bottom border only.
|
|
32
|
+
* @default "solid"
|
|
33
|
+
*/
|
|
13
34
|
variant?: "solid" | "outline" | "underline";
|
|
35
|
+
/**
|
|
36
|
+
* Layout direction forwarded to `FieldTemplate`.
|
|
37
|
+
* @default "horizontal"
|
|
38
|
+
*/
|
|
14
39
|
orientation?: "horizontal" | "vertical" | "horizontalReverse";
|
|
40
|
+
/** Text or icon rendered at the far left, outside the input area. */
|
|
15
41
|
prefix?: string | LucideIcon;
|
|
42
|
+
/** Text or icon rendered at the far right, outside the input area. */
|
|
16
43
|
suffix?: string | LucideIcon;
|
|
44
|
+
/** Displays an asterisk on the label to signal a required field. */
|
|
17
45
|
showAsterisk?: boolean;
|
|
46
|
+
/** Lucide icon rendered inside the input on the left. */
|
|
18
47
|
leftIcon?: LucideIcon;
|
|
48
|
+
/** Lucide icon rendered inside the input on the right. */
|
|
19
49
|
rightIcon?: LucideIcon;
|
|
50
|
+
/** Maximum numeric value allowed. @default 1_000_000_000 */
|
|
20
51
|
max?: number;
|
|
52
|
+
/** Controlled numeric value. */
|
|
21
53
|
value?: number;
|
|
54
|
+
/** Uncontrolled default numeric value. */
|
|
22
55
|
defaultValue?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Callback fired on value change.
|
|
58
|
+
* @param event - Native change event.
|
|
59
|
+
* @param originalValue - Raw numeric string (e.g. `"1234.56"`).
|
|
60
|
+
* @param maskedValue - Formatted display string (e.g. `"$ 1,234.56"`).
|
|
61
|
+
*/
|
|
23
62
|
onChange?: (event: ChangeEvent<HTMLInputElement>, originalValue: string, maskedValue: string) => void;
|
|
24
63
|
};
|
|
25
64
|
/**
|
|
26
|
-
* CurrencyInput
|
|
65
|
+
* CurrencyInput — numeric input that automatically formats the displayed value according to a currency locale.
|
|
27
66
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @param props.locale - Currency locale for formatting (e.g., "USD", "EUR", "BRL", etc.)
|
|
31
|
-
* @param props.label - Optional label text to display above the input
|
|
32
|
-
* @param props.errorMessage - Error message to display below the input
|
|
33
|
-
* @param props.isLoading - Controls loading state with spinner. Default: false
|
|
34
|
-
* @param props.size - Input size. Default: "md"
|
|
35
|
-
* @param props.variant - Visual variant of the input. Default: "solid"
|
|
36
|
-
* @param props.prefix - Text or icon to display at the beginning of the input
|
|
37
|
-
* @param props.suffix - Text or icon to display at the end of the input
|
|
38
|
-
* @param props.showAsterisk - Whether to show asterisk on label for required fields
|
|
39
|
-
* @param props.leftIcon - Optional icon to display on the left side
|
|
40
|
-
* @param props.rightIcon - Optional icon to display on the right side
|
|
41
|
-
* @param props.max - Maximum allowed value for the currency input
|
|
42
|
-
* @param props.value - Controlled value (number) for the input
|
|
43
|
-
* @param props.defaultValue - Default value (number) for uncontrolled usage
|
|
44
|
-
* @param props.onChange - Callback function called when value changes, receives event, original value and masked value
|
|
45
|
-
* @param props.unShowFieldTemplate - When true, skips `FieldTemplate` structure (wrapper, label and error text) and renders only the checkbox button content.
|
|
46
|
-
* @param props.orientation - Layout direction forwarded to `FieldTemplate`/`FieldWrapper` (`horizontal`, `vertical`, `horizontalReverse`). Default: "horizontalReverse"
|
|
67
|
+
* The raw numeric value is stored in a hidden `<input>` for form submission.
|
|
68
|
+
* Integrates with `useForm` to display validation errors by field name.
|
|
47
69
|
*
|
|
70
|
+
* @param props.name - Field name for form submission. Required.
|
|
71
|
+
* @param props.locale - Currency locale (e.g. `"USD"`, `"BRL"`, `"EUR"`). Required.
|
|
72
|
+
* @param props.label - Label text displayed above the input.
|
|
73
|
+
* @param props.errorMessage - Validation error message.
|
|
74
|
+
* @param props.isLoading - Shows a spinner and disables the input. Default: false
|
|
75
|
+
* @param props.size - Input size (`md` | `lg`). Default: "md"
|
|
76
|
+
* @param props.variant - Visual style variant. Default: "solid"
|
|
77
|
+
* @param props.max - Maximum numeric value allowed. Default: 1_000_000_000
|
|
78
|
+
* @param props.value - Controlled numeric value.
|
|
79
|
+
* @param props.defaultValue - Uncontrolled default numeric value.
|
|
80
|
+
* @param props.onChange - Callback fired on change — receives the event, the raw numeric string, and the formatted string.
|
|
81
|
+
* @param props.prefix - Text or icon at the far left.
|
|
82
|
+
* @param props.suffix - Text or icon at the far right.
|
|
83
|
+
* @param props.leftIcon - Lucide icon inside the input on the left.
|
|
84
|
+
* @param props.rightIcon - Lucide icon inside the input on the right.
|
|
85
|
+
* @param props.showAsterisk - Appends `*` to the label.
|
|
86
|
+
* @param props.orientation - Layout direction. Default: "horizontal"
|
|
87
|
+
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
48
88
|
*
|
|
49
|
-
* **...Other valid HTML properties for input
|
|
89
|
+
* **...Other valid HTML properties for `<input>` (except `type`, `max`, `value`, `defaultValue`, `onChange`, `placeholder`)**
|
|
50
90
|
*
|
|
51
|
-
* @returns CurrencyInput JSX element wrapped in
|
|
91
|
+
* @returns CurrencyInput JSX element wrapped in `FieldTemplate`.
|
|
52
92
|
*
|
|
53
93
|
* @example
|
|
54
94
|
* ```tsx
|
|
55
|
-
* // Basic
|
|
56
|
-
* <CurrencyInput name="price" locale="USD"
|
|
95
|
+
* // Basic
|
|
96
|
+
* <CurrencyInput name="price" locale="USD" />
|
|
57
97
|
*
|
|
58
|
-
* //
|
|
98
|
+
* // With label and validation
|
|
59
99
|
* <CurrencyInput
|
|
60
100
|
* name="salary"
|
|
61
101
|
* locale="BRL"
|
|
@@ -64,37 +104,14 @@ type CurrencyInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "
|
|
|
64
104
|
* errorMessage="Please enter a valid amount"
|
|
65
105
|
* />
|
|
66
106
|
*
|
|
67
|
-
* //
|
|
68
|
-
* <CurrencyInput
|
|
69
|
-
* name="budget"
|
|
70
|
-
* locale="EUR"
|
|
71
|
-
* label="Budget"
|
|
72
|
-
* leftIcon={DollarSignIcon}
|
|
73
|
-
* rightIcon={CalculatorIcon}
|
|
74
|
-
* isLoading
|
|
75
|
-
* />
|
|
76
|
-
*
|
|
77
|
-
* // Currency input with max value and controlled state
|
|
107
|
+
* // With max value and controlled state
|
|
78
108
|
* <CurrencyInput
|
|
79
109
|
* name="limit"
|
|
80
110
|
* locale="USD"
|
|
81
111
|
* label="Credit Limit"
|
|
82
112
|
* max={10000}
|
|
83
113
|
* value={creditLimit}
|
|
84
|
-
* onChange={(e, original
|
|
85
|
-
* variant="outline"
|
|
86
|
-
* />
|
|
87
|
-
*
|
|
88
|
-
* // Large currency input with prefix/suffix
|
|
89
|
-
* <CurrencyInput
|
|
90
|
-
* name="investment"
|
|
91
|
-
* locale="GBP"
|
|
92
|
-
* label="Investment Amount"
|
|
93
|
-
* size="lg"
|
|
94
|
-
* variant="underline"
|
|
95
|
-
* prefix="£"
|
|
96
|
-
* suffix="GBP"
|
|
97
|
-
* placeholder="Enter investment amount"
|
|
114
|
+
* onChange={(e, original) => setCreditLimit(Number(original))}
|
|
98
115
|
* />
|
|
99
116
|
* ```
|
|
100
117
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/currencyInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,WAAW,EACX,mBAAmB,EAMpB,MAAM,OAAO,CAAC;AAUf,OAAO,aAAa,CAAC;AAErB,KAAK,MAAM,GACP,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV,KAAK,kBAAkB,GAAG,IAAI,CAC5B,mBAAmB,CAAC,gBAAgB,CAAC,EACnC,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,GACL,cAAc,GACd,OAAO,GACP,UAAU,GACV,aAAa,CAChB,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/currencyInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,WAAW,EACX,mBAAmB,EAMpB,MAAM,OAAO,CAAC;AAUf,OAAO,aAAa,CAAC;AAErB,KAAK,MAAM,GACP,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV,KAAK,kBAAkB,GAAG,IAAI,CAC5B,mBAAmB,CAAC,gBAAgB,CAAC,EACnC,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,GACL,cAAc,GACd,OAAO,GACP,UAAU,GACV,aAAa,CAChB,GAAG;IACF,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IAC5C;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,mBAAmB,CAAC;IAC9D,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,EACpC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,KAChB,IAAI,CAAC;CACX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAuK/C;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -7,39 +7,40 @@ import { IconRenderer } from "../../services/iconRenderer";
|
|
|
7
7
|
import { maskCurrencyValues, normalizeValue, } from "../../services/maskCurrencyValues";
|
|
8
8
|
import "./style.css";
|
|
9
9
|
/**
|
|
10
|
-
* CurrencyInput
|
|
10
|
+
* CurrencyInput — numeric input that automatically formats the displayed value according to a currency locale.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @param props.locale - Currency locale for formatting (e.g., "USD", "EUR", "BRL", etc.)
|
|
15
|
-
* @param props.label - Optional label text to display above the input
|
|
16
|
-
* @param props.errorMessage - Error message to display below the input
|
|
17
|
-
* @param props.isLoading - Controls loading state with spinner. Default: false
|
|
18
|
-
* @param props.size - Input size. Default: "md"
|
|
19
|
-
* @param props.variant - Visual variant of the input. Default: "solid"
|
|
20
|
-
* @param props.prefix - Text or icon to display at the beginning of the input
|
|
21
|
-
* @param props.suffix - Text or icon to display at the end of the input
|
|
22
|
-
* @param props.showAsterisk - Whether to show asterisk on label for required fields
|
|
23
|
-
* @param props.leftIcon - Optional icon to display on the left side
|
|
24
|
-
* @param props.rightIcon - Optional icon to display on the right side
|
|
25
|
-
* @param props.max - Maximum allowed value for the currency input
|
|
26
|
-
* @param props.value - Controlled value (number) for the input
|
|
27
|
-
* @param props.defaultValue - Default value (number) for uncontrolled usage
|
|
28
|
-
* @param props.onChange - Callback function called when value changes, receives event, original value and masked value
|
|
29
|
-
* @param props.unShowFieldTemplate - When true, skips `FieldTemplate` structure (wrapper, label and error text) and renders only the checkbox button content.
|
|
30
|
-
* @param props.orientation - Layout direction forwarded to `FieldTemplate`/`FieldWrapper` (`horizontal`, `vertical`, `horizontalReverse`). Default: "horizontalReverse"
|
|
12
|
+
* The raw numeric value is stored in a hidden `<input>` for form submission.
|
|
13
|
+
* Integrates with `useForm` to display validation errors by field name.
|
|
31
14
|
*
|
|
15
|
+
* @param props.name - Field name for form submission. Required.
|
|
16
|
+
* @param props.locale - Currency locale (e.g. `"USD"`, `"BRL"`, `"EUR"`). Required.
|
|
17
|
+
* @param props.label - Label text displayed above the input.
|
|
18
|
+
* @param props.errorMessage - Validation error message.
|
|
19
|
+
* @param props.isLoading - Shows a spinner and disables the input. Default: false
|
|
20
|
+
* @param props.size - Input size (`md` | `lg`). Default: "md"
|
|
21
|
+
* @param props.variant - Visual style variant. Default: "solid"
|
|
22
|
+
* @param props.max - Maximum numeric value allowed. Default: 1_000_000_000
|
|
23
|
+
* @param props.value - Controlled numeric value.
|
|
24
|
+
* @param props.defaultValue - Uncontrolled default numeric value.
|
|
25
|
+
* @param props.onChange - Callback fired on change — receives the event, the raw numeric string, and the formatted string.
|
|
26
|
+
* @param props.prefix - Text or icon at the far left.
|
|
27
|
+
* @param props.suffix - Text or icon at the far right.
|
|
28
|
+
* @param props.leftIcon - Lucide icon inside the input on the left.
|
|
29
|
+
* @param props.rightIcon - Lucide icon inside the input on the right.
|
|
30
|
+
* @param props.showAsterisk - Appends `*` to the label.
|
|
31
|
+
* @param props.orientation - Layout direction. Default: "horizontal"
|
|
32
|
+
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
32
33
|
*
|
|
33
|
-
* **...Other valid HTML properties for input
|
|
34
|
+
* **...Other valid HTML properties for `<input>` (except `type`, `max`, `value`, `defaultValue`, `onChange`, `placeholder`)**
|
|
34
35
|
*
|
|
35
|
-
* @returns CurrencyInput JSX element wrapped in
|
|
36
|
+
* @returns CurrencyInput JSX element wrapped in `FieldTemplate`.
|
|
36
37
|
*
|
|
37
38
|
* @example
|
|
38
39
|
* ```tsx
|
|
39
|
-
* // Basic
|
|
40
|
-
* <CurrencyInput name="price" locale="USD"
|
|
40
|
+
* // Basic
|
|
41
|
+
* <CurrencyInput name="price" locale="USD" />
|
|
41
42
|
*
|
|
42
|
-
* //
|
|
43
|
+
* // With label and validation
|
|
43
44
|
* <CurrencyInput
|
|
44
45
|
* name="salary"
|
|
45
46
|
* locale="BRL"
|
|
@@ -48,37 +49,14 @@ import "./style.css";
|
|
|
48
49
|
* errorMessage="Please enter a valid amount"
|
|
49
50
|
* />
|
|
50
51
|
*
|
|
51
|
-
* //
|
|
52
|
-
* <CurrencyInput
|
|
53
|
-
* name="budget"
|
|
54
|
-
* locale="EUR"
|
|
55
|
-
* label="Budget"
|
|
56
|
-
* leftIcon={DollarSignIcon}
|
|
57
|
-
* rightIcon={CalculatorIcon}
|
|
58
|
-
* isLoading
|
|
59
|
-
* />
|
|
60
|
-
*
|
|
61
|
-
* // Currency input with max value and controlled state
|
|
52
|
+
* // With max value and controlled state
|
|
62
53
|
* <CurrencyInput
|
|
63
54
|
* name="limit"
|
|
64
55
|
* locale="USD"
|
|
65
56
|
* label="Credit Limit"
|
|
66
57
|
* max={10000}
|
|
67
58
|
* value={creditLimit}
|
|
68
|
-
* onChange={(e, original
|
|
69
|
-
* variant="outline"
|
|
70
|
-
* />
|
|
71
|
-
*
|
|
72
|
-
* // Large currency input with prefix/suffix
|
|
73
|
-
* <CurrencyInput
|
|
74
|
-
* name="investment"
|
|
75
|
-
* locale="GBP"
|
|
76
|
-
* label="Investment Amount"
|
|
77
|
-
* size="lg"
|
|
78
|
-
* variant="underline"
|
|
79
|
-
* prefix="£"
|
|
80
|
-
* suffix="GBP"
|
|
81
|
-
* placeholder="Enter investment amount"
|
|
59
|
+
* onChange={(e, original) => setCreditLimit(Number(original))}
|
|
82
60
|
* />
|
|
83
61
|
* ```
|
|
84
62
|
*/
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type DividerProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
/**
|
|
5
|
+
* Divider orientation.
|
|
6
|
+
* @default "horizontal"
|
|
7
|
+
*/
|
|
4
8
|
orientation?: "horizontal" | "vertical";
|
|
5
9
|
};
|
|
6
10
|
/**
|
|
7
|
-
* Divider
|
|
11
|
+
* Divider — visually separates content sections.
|
|
8
12
|
*
|
|
9
|
-
* @param props -
|
|
10
|
-
* @param props.orientation - Divider orientation. Default: "horizontal"
|
|
13
|
+
* @param props.orientation - Line direction (`horizontal` | `vertical`). Default: "horizontal"
|
|
11
14
|
*
|
|
12
|
-
* **...Other valid HTML properties for div
|
|
15
|
+
* **...Other valid HTML properties for `<div>`**
|
|
13
16
|
*
|
|
14
|
-
* @returns Divider JSX element
|
|
17
|
+
* @returns Divider JSX element.
|
|
15
18
|
*
|
|
16
19
|
* @example
|
|
17
20
|
* ```tsx
|
|
18
|
-
* //
|
|
21
|
+
* // Between sections
|
|
22
|
+
* <h2>Section 1</h2>
|
|
19
23
|
* <Divider />
|
|
24
|
+
* <h2>Section 2</h2>
|
|
20
25
|
*
|
|
21
|
-
* //
|
|
22
|
-
* <Divider orientation="horizontal" />
|
|
23
|
-
*
|
|
24
|
-
* // Vertical divider
|
|
26
|
+
* // Vertical (e.g. between sidebar and content)
|
|
25
27
|
* <Divider orientation="vertical" />
|
|
26
|
-
*
|
|
27
|
-
* // Custom styled divider
|
|
28
|
-
* <Divider
|
|
29
|
-
* orientation="horizontal"
|
|
30
|
-
* className="my-custom-divider"
|
|
31
|
-
* />
|
|
32
|
-
*
|
|
33
|
-
* // Usage in layout
|
|
34
|
-
* <div>
|
|
35
|
-
* <h2>Section 1</h2>
|
|
36
|
-
* <p>Content for section 1</p>
|
|
37
|
-
* <Divider />
|
|
38
|
-
* <h2>Section 2</h2>
|
|
39
|
-
* <p>Content for section 2</p>
|
|
40
|
-
* </div>
|
|
41
28
|
* ```
|
|
42
29
|
*/
|
|
43
30
|
declare function Divider(props: DividerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/divider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACnD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/divider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACnD;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAUnC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,40 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
/**
|
|
4
|
-
* Divider
|
|
4
|
+
* Divider — visually separates content sections.
|
|
5
5
|
*
|
|
6
|
-
* @param props -
|
|
7
|
-
* @param props.orientation - Divider orientation. Default: "horizontal"
|
|
6
|
+
* @param props.orientation - Line direction (`horizontal` | `vertical`). Default: "horizontal"
|
|
8
7
|
*
|
|
9
|
-
* **...Other valid HTML properties for div
|
|
8
|
+
* **...Other valid HTML properties for `<div>`**
|
|
10
9
|
*
|
|
11
|
-
* @returns Divider JSX element
|
|
10
|
+
* @returns Divider JSX element.
|
|
12
11
|
*
|
|
13
12
|
* @example
|
|
14
13
|
* ```tsx
|
|
15
|
-
* //
|
|
14
|
+
* // Between sections
|
|
15
|
+
* <h2>Section 1</h2>
|
|
16
16
|
* <Divider />
|
|
17
|
+
* <h2>Section 2</h2>
|
|
17
18
|
*
|
|
18
|
-
* //
|
|
19
|
-
* <Divider orientation="horizontal" />
|
|
20
|
-
*
|
|
21
|
-
* // Vertical divider
|
|
19
|
+
* // Vertical (e.g. between sidebar and content)
|
|
22
20
|
* <Divider orientation="vertical" />
|
|
23
|
-
*
|
|
24
|
-
* // Custom styled divider
|
|
25
|
-
* <Divider
|
|
26
|
-
* orientation="horizontal"
|
|
27
|
-
* className="my-custom-divider"
|
|
28
|
-
* />
|
|
29
|
-
*
|
|
30
|
-
* // Usage in layout
|
|
31
|
-
* <div>
|
|
32
|
-
* <h2>Section 1</h2>
|
|
33
|
-
* <p>Content for section 1</p>
|
|
34
|
-
* <Divider />
|
|
35
|
-
* <h2>Section 2</h2>
|
|
36
|
-
* <p>Content for section 2</p>
|
|
37
|
-
* </div>
|
|
38
21
|
* ```
|
|
39
22
|
*/
|
|
40
23
|
function Divider(props) {
|