@arkyn/components 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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/index.d.ts +1 -1
- 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 +13 -4
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/insertLink/index.d.ts +5 -0
- package/dist/components/richText/insertLink/index.d.ts.map +1 -0
- package/dist/components/richText/insertVideo/index.d.ts.map +1 -1
- package/dist/components/richText/leaf/index.d.ts +1 -0
- package/dist/components/richText/leaf/index.d.ts.map +1 -1
- 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.js +710 -633
- 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/index.js.map +1 -1
- 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 +59 -59
- 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 +58 -56
- package/dist/modules/components/richText/index.js.map +1 -1
- package/dist/modules/components/richText/insertLink/index.js +68 -0
- package/dist/modules/components/richText/insertLink/index.js.map +1 -0
- package/dist/modules/components/richText/insertLink/styles.css +1 -0
- package/dist/modules/components/richText/insertVideo/index.js +45 -41
- package/dist/modules/components/richText/insertVideo/index.js.map +1 -1
- package/dist/modules/components/richText/leaf/index.js +6 -1
- package/dist/modules/components/richText/leaf/index.js.map +1 -1
- package/dist/modules/components/richText/leaf/styles.css +1 -0
- package/dist/modules/components/richText/styles.css +4 -0
- 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.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/isValidHttpsUrl.js +12 -0
- package/dist/modules/services/isValidHttpsUrl.js.map +1 -0
- package/dist/modules/services/toHtml.js.map +1 -1
- package/dist/modules/services/toRichTextValue.js.map +1 -1
- package/dist/modules/utils/richTextUtilities.js +24 -17
- package/dist/modules/utils/richTextUtilities.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/placesProvider.d.ts +1 -1
- package/dist/providers/toastProvider.d.ts +1 -1
- package/dist/services/isValidHttpsUrl.d.ts +3 -0
- package/dist/services/isValidHttpsUrl.d.ts.map +1 -0
- package/dist/services/toHtml.d.ts +1 -1
- package/dist/services/toRichTextValue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/types/richTextTypes.d.ts +13 -2
- package/dist/types/richTextTypes.d.ts.map +1 -1
- package/dist/utils/richTextUtilities.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAGjD,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAClB,YAAY,GACZ,aAAa,GACb,SAAS,GACT,UAAU,GACV,KAAK,GACL,MAAM,GACN,QAAQ,GACR,OAAO,CAAC;AAEX,KAAK,YAAY,GAAG;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAGjD,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAClB,YAAY,GACZ,aAAa,GACb,SAAS,GACT,UAAU,GACV,KAAK,GACL,MAAM,GACN,QAAQ,GACR,OAAO,CAAC;AAEX,KAAK,YAAY,GAAG;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB,gEAAgE;IAChE,MAAM,EAAE,SAAS,CAAC;IAClB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,+BAoCnC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -9,7 +9,7 @@ type RadioBoxProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
9
9
|
size?: "sm" | "md" | "lg";
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* RadioBox
|
|
12
|
+
* RadioBox, individual option inside a `RadioGroup`. Renders as a `<label>` + hidden `<button>` pair.
|
|
13
13
|
*
|
|
14
14
|
* Reads active value, size, error state, and disabled state from `RadioGroup` context.
|
|
15
15
|
* Must be used as a direct child of `RadioGroup`.
|
|
@@ -26,9 +26,9 @@ type RadioBoxProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
26
26
|
* @example
|
|
27
27
|
* ```tsx
|
|
28
28
|
* <RadioGroup name="plan" label="Choose a plan" onChange={setPlan}>
|
|
29
|
-
* <RadioBox value="basic">Basic
|
|
30
|
-
* <RadioBox value="pro">Pro
|
|
31
|
-
* <RadioBox value="enterprise" disabled>Enterprise
|
|
29
|
+
* <RadioBox value="basic">Basic, $9/mo</RadioBox>
|
|
30
|
+
* <RadioBox value="pro">Pro, $29/mo</RadioBox>
|
|
31
|
+
* <RadioBox value="enterprise" disabled>Enterprise, contact us</RadioBox>
|
|
32
32
|
* </RadioGroup>
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
@@ -25,7 +25,7 @@ type RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
|
25
25
|
orientation?: "horizontal" | "vertical" | "horizontalReverse";
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
|
-
* RadioGroup
|
|
28
|
+
* RadioGroup, managed group of `RadioBox` options with form integration.
|
|
29
29
|
*
|
|
30
30
|
* Renders a hidden `<input>` for native form submission. Reads `fieldErrors[name]` from
|
|
31
31
|
* the nearest `FormProvider` when no `errorMessage` is explicitly provided.
|
|
@@ -56,8 +56,8 @@ type RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
|
56
56
|
*
|
|
57
57
|
* // Controlled with change handler
|
|
58
58
|
* <RadioGroup name="plan" label="Subscription plan" value={plan} onChange={setPlan}>
|
|
59
|
-
* <RadioBox value="basic">Basic
|
|
60
|
-
* <RadioBox value="pro">Pro
|
|
59
|
+
* <RadioBox value="basic">Basic, $9/mo</RadioBox>
|
|
60
|
+
* <RadioBox value="pro">Pro, $29/mo</RadioBox>
|
|
61
61
|
* </RadioGroup>
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { RichTextProps } from "../../types/richTextTypes";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
/**
|
|
4
|
-
* RichText
|
|
4
|
+
* RichText, WYSIWYG rich-text editor built on Slate.js with a configurable toolbar.
|
|
5
5
|
*
|
|
6
|
-
* **Toolbar features:** bold, italic, underline, code, H1/H2, block quote, alignment (left/center/right/justify), image and
|
|
6
|
+
* **Toolbar features:** bold, italic, underline, code, H1/H2, block quote, alignment (left/center/right/justify), image, video, and link insertion.
|
|
7
7
|
*
|
|
8
8
|
* Editor content is stored as a Slate JSON string in a hidden `<input>` for form submission.
|
|
9
9
|
* Integrates with `useForm` to display validation errors by field name.
|
|
@@ -12,11 +12,13 @@ import "./styles.css";
|
|
|
12
12
|
* @param props.label - Label text displayed above the editor.
|
|
13
13
|
* @param props.hiddenButtons - Toolbar button keys to hide (e.g. `["image", "code"]`).
|
|
14
14
|
* @param props.imageConfig - Enables image insertion; contains the upload endpoint and modal labels.
|
|
15
|
+
* @param props.videoConfig - Customizes the video insertion modal labels.
|
|
16
|
+
* @param props.linkConfig - Customizes the link insertion modal labels.
|
|
15
17
|
* @param props.defaultValue - Initial editor content as a Slate JSON string. Default: "[]"
|
|
16
18
|
* @param props.maxLimit - Maximum character count. Default: 10000
|
|
17
19
|
* @param props.enforceCharacterLimit - Prevents typing past `maxLimit`. Default: false
|
|
18
|
-
* @param props.onChangeCharactersCount - Callback fired on every keystroke
|
|
19
|
-
* @param props.onChange - Callback fired when editor content changes
|
|
20
|
+
* @param props.onChangeCharactersCount - Callback fired on every keystroke, receives the current character count.
|
|
21
|
+
* @param props.onChange - Callback fired when editor content changes, receives the Slate `Descendant[]`.
|
|
20
22
|
* @param props.baseErrorMessage - Custom error message (overrides `useForm` context error).
|
|
21
23
|
* @param props.isError - Forces the error visual state.
|
|
22
24
|
* @param props.id - Custom id for the editable area element.
|
|
@@ -47,6 +49,13 @@ import "./styles.css";
|
|
|
47
49
|
* label="Article Body"
|
|
48
50
|
* imageConfig={{ action: "/api/upload" }}
|
|
49
51
|
* />
|
|
52
|
+
*
|
|
53
|
+
* // With custom link insertion modal labels
|
|
54
|
+
* <RichText
|
|
55
|
+
* name="article"
|
|
56
|
+
* label="Article Body"
|
|
57
|
+
* linkConfig={{ modalTitle: "Add a link" }}
|
|
58
|
+
* />
|
|
50
59
|
* ```
|
|
51
60
|
*/
|
|
52
61
|
declare function RichText(props: RichTextProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/richText/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAEX,aAAa,EACb,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/richText/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAEX,aAAa,EACb,MAAM,2BAA2B,CAAC;AASnC,OAAO,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,+BA0MrC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/richText/insertLink/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAQ5E,OAAO,cAAc,CAAC;AAEtB,iBAAS,UAAU,CAAC,KAAK,EAAE,uBAAuB,+BAgGjD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/richText/insertVideo/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/richText/insertVideo/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAQ7E,OAAO,cAAc,CAAC;AAEtB,iBAAS,WAAW,CAAC,KAAK,EAAE,wBAAwB,+BAiHnD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/richText/leaf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/richText/leaf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,cAAc,CAAC;AAEtB,iBAAS,IAAI,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,eAAe,+BAc5D;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -35,14 +35,14 @@ type SearchPlacesProps = {
|
|
|
35
35
|
onPlaceChanged?: (e: PlaceData) => void;
|
|
36
36
|
} & Omit<InputProps, "onLoad" | "onChange" | "type">;
|
|
37
37
|
/**
|
|
38
|
-
* SearchPlaces
|
|
38
|
+
* SearchPlaces, text input with Google Places autocomplete that returns structured address data.
|
|
39
39
|
*
|
|
40
40
|
* Requires the Google Maps JavaScript API with the Places library to be loaded.
|
|
41
41
|
* Built on `@react-google-maps/api`'s `StandaloneSearchBox`.
|
|
42
42
|
*
|
|
43
43
|
* @param props.options - Google Maps search box options (e.g. restrict by country).
|
|
44
|
-
* @param props.onChange - Fires on every keystroke
|
|
45
|
-
* @param props.onPlaceChanged - Fires when the user selects a suggestion
|
|
44
|
+
* @param props.onChange - Fires on every keystroke, receives the current text value.
|
|
45
|
+
* @param props.onPlaceChanged - Fires when the user selects a suggestion, receives structured address data.
|
|
46
46
|
*
|
|
47
47
|
* **...Other valid `Input` properties (except `onLoad`, `onChange`, `type`)**
|
|
48
48
|
*
|
|
@@ -72,7 +72,7 @@ type SelectProps = {
|
|
|
72
72
|
orientation?: "horizontal" | "vertical" | "horizontalReverse";
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
|
-
* Select
|
|
75
|
+
* Select, single-option dropdown with optional search, label, validation, and form integration.
|
|
76
76
|
*
|
|
77
77
|
* Integrates with `useForm` to display validation errors by field name.
|
|
78
78
|
*
|
|
@@ -11,7 +11,7 @@ type SliderProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
|
11
11
|
onDragging?: (isDragging: boolean) => void;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* Slider
|
|
14
|
+
* Slider, interactive track for selecting a numeric value between 0 and 100.
|
|
15
15
|
*
|
|
16
16
|
* Pair with `useSlider` for managed state.
|
|
17
17
|
*
|
|
@@ -18,7 +18,7 @@ type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "o
|
|
|
18
18
|
unCheckedValue?: string;
|
|
19
19
|
/** Field name for form submission. Required. */
|
|
20
20
|
name: string;
|
|
21
|
-
/** Callback fired on toggle
|
|
21
|
+
/** Callback fired on toggle, receives the current value string. */
|
|
22
22
|
onCheck?: (value: string) => void;
|
|
23
23
|
/**
|
|
24
24
|
* Layout direction forwarded to `FieldTemplate`.
|
|
@@ -33,7 +33,7 @@ type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "o
|
|
|
33
33
|
errorMessage?: string;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
|
-
* Switch
|
|
36
|
+
* Switch, toggle input for binary on/off states.
|
|
37
37
|
*
|
|
38
38
|
* Stores value in a hidden `<input>` for native form submission.
|
|
39
39
|
* Integrates with `useForm` to display validation errors by field name.
|
|
@@ -45,7 +45,7 @@ type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "o
|
|
|
45
45
|
* @param props.checked - Controlled checked state.
|
|
46
46
|
* @param props.value - Value emitted when on. Default: "checked"
|
|
47
47
|
* @param props.unCheckedValue - Value emitted when off. Default: ""
|
|
48
|
-
* @param props.onCheck - Callback fired on toggle
|
|
48
|
+
* @param props.onCheck - Callback fired on toggle, receives the current value string.
|
|
49
49
|
* @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: "horizontalReverse"
|
|
50
50
|
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
51
51
|
* @param props.showAsterisk - Appends `*` to the label.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,cAAc,CAAC;AAEtB,KAAK,WAAW,GAAG,IAAI,CACtB,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAC9D,GAAG;IACH,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,cAAc,CAAC;AAEtB,KAAK,WAAW,GAAG,IAAI,CACtB,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAC9D,GAAG;IACH,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,mBAAmB,CAAC;IAC9D,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,+BAgEjC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -7,7 +7,7 @@ type TabButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" |
|
|
|
7
7
|
value: string;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* TabButton
|
|
10
|
+
* TabButton, individual tab button inside a `TabContainer`.
|
|
11
11
|
*
|
|
12
12
|
* Reads active state and disabled state from `TabContainer` context.
|
|
13
13
|
* The button's own `disabled` prop is ORed with the container's `disabled`.
|
|
@@ -11,7 +11,7 @@ type TabContainerProps = Omit<HTMLAttributes<HTMLElement>, "onChange" | "childre
|
|
|
11
11
|
onChange?: (index: string) => void;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* TabContainer
|
|
14
|
+
* TabContainer, wrapper that manages active state for a group of `TabButton` components.
|
|
15
15
|
*
|
|
16
16
|
* Renders as a `<nav>` element. Provides context consumed by each `TabButton`.
|
|
17
17
|
*
|
|
@@ -5,7 +5,7 @@ type TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
|
5
5
|
emptyMessage?: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* TableBody
|
|
8
|
+
* TableBody, `<tbody>` section with built-in empty state handling.
|
|
9
9
|
*
|
|
10
10
|
* When `children` is empty, renders a full-width row with `emptyMessage`.
|
|
11
11
|
* Accepts all standard HTML `<tbody>` attributes.
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type TableCaptionProps = HTMLAttributes<HTMLElement>;
|
|
4
4
|
/**
|
|
5
|
-
* TableCaption
|
|
5
|
+
* TableCaption, title / description placed above a table. Renders as a `<caption>` element.
|
|
6
6
|
*
|
|
7
7
|
* Accepts all standard HTML element attributes.
|
|
8
8
|
*
|
|
@@ -11,7 +11,7 @@ type TableCaptionProps = HTMLAttributes<HTMLElement>;
|
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
13
13
|
* <TableContainer>
|
|
14
|
-
* <TableCaption>Orders
|
|
14
|
+
* <TableCaption>Orders, Q2 2025</TableCaption>
|
|
15
15
|
* <TableHeader>...</TableHeader>
|
|
16
16
|
* <TableBody>...</TableBody>
|
|
17
17
|
* </TableContainer>
|
|
@@ -2,7 +2,7 @@ import type { TableHTMLAttributes } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type TableContainerProps = TableHTMLAttributes<HTMLTableElement>;
|
|
4
4
|
/**
|
|
5
|
-
* TableContainer
|
|
5
|
+
* TableContainer, root wrapper for the Table component set. Renders a responsive scrollable container around a `<table>`.
|
|
6
6
|
*
|
|
7
7
|
* Accepts all standard HTML `<table>` attributes.
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;
|
|
4
4
|
/**
|
|
5
|
-
* TableFooter
|
|
5
|
+
* TableFooter, `<tfoot>` section with an automatic spacing row above the content.
|
|
6
6
|
*
|
|
7
7
|
* Children span all columns via `colSpan={100}`. Commonly used for `Pagination`.
|
|
8
8
|
* Accepts all standard HTML `<tfoot>` attributes.
|
|
@@ -2,9 +2,9 @@ import type { HTMLAttributes } from "react";
|
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;
|
|
4
4
|
/**
|
|
5
|
-
* TableHeader
|
|
5
|
+
* TableHeader, `<thead>` section with an automatic spacing row below the header row.
|
|
6
6
|
*
|
|
7
|
-
* Pass `<th>` elements as children
|
|
7
|
+
* Pass `<th>` elements as children, they are wrapped in a `<tr>` automatically.
|
|
8
8
|
* Accepts all standard HTML `<thead>` attributes.
|
|
9
9
|
*
|
|
10
10
|
* @returns TableHeader JSX element.
|
|
@@ -27,7 +27,7 @@ type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "name" |
|
|
|
27
27
|
defaultValue?: string;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
-
* Textarea
|
|
30
|
+
* Textarea, multi-line text input with label, validation, and form integration.
|
|
31
31
|
*
|
|
32
32
|
* Integrates with `useForm` to display validation errors by field name.
|
|
33
33
|
*
|
|
@@ -18,7 +18,7 @@ type TooltipProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
18
18
|
size?: "md" | "lg";
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
|
-
* Tooltip
|
|
21
|
+
* Tooltip, shows a contextual text bubble on hover with smart viewport-aware positioning.
|
|
22
22
|
*
|
|
23
23
|
* The tooltip automatically flips to the opposite side when it would overflow the viewport.
|
|
24
24
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* useAutomation
|
|
2
|
+
* useAutomation, runs UI side-effects (close modals, scroll, toast) in response to a server action payload.
|
|
3
3
|
*
|
|
4
4
|
* Pass the raw response from a form submission. On every change the hook:
|
|
5
5
|
* 1. Closes all open modals if `closeModal` is `true`.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type DrawerContextProps } from "../providers/drawerProvider";
|
|
2
2
|
type OpenDrawerProps<T = any> = (data?: T) => void;
|
|
3
3
|
/**
|
|
4
|
-
* useDrawer
|
|
4
|
+
* useDrawer, accesses the nearest `DrawerProvider` context.
|
|
5
5
|
*
|
|
6
6
|
* Two call signatures:
|
|
7
|
-
* - **Without `key
|
|
8
|
-
* - **With `key
|
|
7
|
+
* - **Without `key`**, returns the raw context object (manage any drawer by name).
|
|
8
|
+
* - **With `key`**, returns a scoped object bound to one named drawer.
|
|
9
9
|
*
|
|
10
10
|
* @param key - Drawer identifier registered in `DrawerProvider`.
|
|
11
11
|
*
|
|
@@ -15,7 +15,7 @@ type OpenDrawerProps<T = any> = (data?: T) => void;
|
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```tsx
|
|
18
|
-
* // Scoped to one drawer
|
|
18
|
+
* // Scoped to one drawer, the most common pattern
|
|
19
19
|
* const { drawerIsOpen, drawerData, openDrawer, closeDrawer } = useDrawer<{ section: string }>('navigation');
|
|
20
20
|
*
|
|
21
21
|
* openDrawer({ section: 'products' });
|
|
@@ -23,7 +23,7 @@ type OpenDrawerProps<T = any> = (data?: T) => void;
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```tsx
|
|
26
|
-
* // Full context
|
|
26
|
+
* // Full context, useful when triggering multiple different drawers from one place
|
|
27
27
|
* const { openDrawer } = useDrawer();
|
|
28
28
|
*
|
|
29
29
|
* openDrawer('navigation', { section: 'main' });
|
package/dist/hooks/useForm.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* useForm
|
|
2
|
+
* useForm, reads the nearest `FormProvider` context to access field-level validation errors.
|
|
3
3
|
*
|
|
4
4
|
* All form inputs (`Input`, `Select`, `Checkbox`, etc.) call this hook internally,
|
|
5
5
|
* so you rarely need it directly. Use it when you want to read errors outside of
|
|
6
6
|
* an input component, or build a custom input.
|
|
7
7
|
*
|
|
8
8
|
* @returns Form context containing:
|
|
9
|
-
* - `fieldErrors
|
|
9
|
+
* - `fieldErrors`, `Record<string, string>` mapping field names to error messages.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* useHydrated
|
|
2
|
+
* useHydrated, returns `true` once the component has hydrated on the client, `false` during SSR.
|
|
3
3
|
*
|
|
4
4
|
* Built on `useSyncExternalStore` so it is safe with React 18 concurrent rendering.
|
|
5
5
|
* Use this when you need to defer client-only rendering (e.g. browser APIs, `window`, `navigator`)
|
package/dist/hooks/useModal.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ModalContextProps } from "../providers/modalProvider";
|
|
2
2
|
type OpenModalProps<T = any> = (data?: T) => void;
|
|
3
3
|
/**
|
|
4
|
-
* useModal
|
|
4
|
+
* useModal, accesses the nearest `ModalProvider` context.
|
|
5
5
|
*
|
|
6
6
|
* Two call signatures:
|
|
7
|
-
* - **Without `key
|
|
8
|
-
* - **With `key
|
|
7
|
+
* - **Without `key`**, returns the raw context object (manage any modal by name).
|
|
8
|
+
* - **With `key`**, returns a scoped object bound to one named modal.
|
|
9
9
|
*
|
|
10
10
|
* @param key - Modal identifier registered in `ModalProvider`.
|
|
11
11
|
*
|
|
@@ -15,7 +15,7 @@ type OpenModalProps<T = any> = (data?: T) => void;
|
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```tsx
|
|
18
|
-
* // Scoped to one modal
|
|
18
|
+
* // Scoped to one modal, the most common pattern
|
|
19
19
|
* const { modalIsOpen, modalData, openModal, closeModal } = useModal<{ id: number }>('confirm-delete');
|
|
20
20
|
*
|
|
21
21
|
* openModal({ id: user.id });
|
|
@@ -23,7 +23,7 @@ type OpenModalProps<T = any> = (data?: T) => void;
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```tsx
|
|
26
|
-
* // Full context
|
|
26
|
+
* // Full context, useful when triggering multiple different modals from one place
|
|
27
27
|
* const { openModal } = useModal();
|
|
28
28
|
*
|
|
29
29
|
* openModal('confirm-delete', { id: user.id });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type ParamsType = Record<string, string | number | boolean | undefined>;
|
|
2
2
|
/**
|
|
3
|
-
* useScopedParams
|
|
3
|
+
* useScopedParams, reads and writes URL search parameters with an optional namespace prefix.
|
|
4
4
|
*
|
|
5
5
|
* When `scope` is provided, every key is namespaced as `scope:key`, so multiple features
|
|
6
6
|
* can share the same URL without collisions (e.g. `filters:status` and `table:page`).
|
|
@@ -9,13 +9,13 @@ type ParamsType = Record<string, string | number | boolean | undefined>;
|
|
|
9
9
|
* @param scope - Namespace prefix. Default: `""` (no prefix).
|
|
10
10
|
*
|
|
11
11
|
* @returns
|
|
12
|
-
* - `getParam(key)
|
|
13
|
-
* - `getScopedSearch(params)
|
|
12
|
+
* - `getParam(key)`, returns the (scoped) param value, or `null` if absent.
|
|
13
|
+
* - `getScopedSearch(params)`, merges `params` into the existing search string and returns the result.
|
|
14
14
|
* Pass `undefined` as a value to delete that param.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```tsx
|
|
18
|
-
* // Without scope
|
|
18
|
+
* // Without scope, plain key/value params
|
|
19
19
|
* const { getParam, getScopedSearch } = useScopedParams(location.search);
|
|
20
20
|
* getParam('page'); // "1"
|
|
21
21
|
* getScopedSearch({ page: 2, sort: 'name' }); // "?page=2&sort=name"
|
|
@@ -23,7 +23,7 @@ type ParamsType = Record<string, string | number | boolean | undefined>;
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```tsx
|
|
26
|
-
* // With scope
|
|
26
|
+
* // With scope, all keys prefixed as "filters:key"
|
|
27
27
|
* const { getParam, getScopedSearch } = useScopedParams(location.search, 'filters');
|
|
28
28
|
* getParam('status'); // reads "filters:status"
|
|
29
29
|
* getScopedSearch({ status: 'active', category: undefined }); // removes "filters:category"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* useScrollLock
|
|
2
|
+
* useScrollLock, locks `document.body` scroll while an overlay is open.
|
|
3
3
|
*
|
|
4
4
|
* Compensates for the scrollbar width by adding equivalent `paddingRight`,
|
|
5
5
|
* preventing layout shift when the scrollbar disappears.
|
|
6
6
|
* Restores the original `overflow` and `paddingRight` when `isLocked` becomes `false`.
|
|
7
7
|
*
|
|
8
|
-
* Used internally by `Modal` and `Drawer
|
|
8
|
+
* Used internally by `Modal` and `Drawer`, you usually don't need this directly
|
|
9
9
|
* unless building a custom overlay.
|
|
10
10
|
*
|
|
11
11
|
* @param isLocked - When `true`, body scroll is disabled.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* useSearchAutomation
|
|
2
|
+
* useSearchAutomation, URL-driven version of `useAutomation`. Reads automation params from a
|
|
3
3
|
* URL search string and executes the same side-effects (close modals, toast) on every change.
|
|
4
4
|
*
|
|
5
5
|
* Reads the following params (optionally prefixed by `scope:`):
|
|
6
|
-
* - `closeModal=true
|
|
7
|
-
* - `message
|
|
8
|
-
* - `type
|
|
9
|
-
* - `name
|
|
6
|
+
* - `closeModal=true`, closes all open modals.
|
|
7
|
+
* - `message`, text for the toast notification.
|
|
8
|
+
* - `type`, `"success"` or `"danger"` toast style.
|
|
9
|
+
* - `name`, response identifier matched against `successResponses`/`badResponses` lists.
|
|
10
10
|
*
|
|
11
11
|
* @param searchString - Raw URL search string (e.g. `location.search`).
|
|
12
12
|
* @param scope - Optional prefix for all params. Default: `""` (no prefix).
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```tsx
|
|
24
|
-
* // Scoped params
|
|
24
|
+
* // Scoped params, avoids collisions when multiple features share the URL
|
|
25
25
|
* // redirect("?filters:closeModal=true&filters:message=Applied!&filters:type=success")
|
|
26
26
|
* useSearchAutomation(location.search, "filters");
|
|
27
27
|
* ```
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type UseSliderReturnProps = [number, (number: number) => void];
|
|
2
2
|
/**
|
|
3
|
-
* useSlider
|
|
3
|
+
* useSlider, state manager for the `Slider` component. Clamps values to `[0, 100]`.
|
|
4
4
|
*
|
|
5
5
|
* @param defaultValue - Initial percentage value (0–100). Default: 0
|
|
6
6
|
*
|
|
7
|
-
* @returns `[value, setValue]
|
|
7
|
+
* @returns `[value, setValue]`, current percentage and a setter that clamps at the boundaries.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```tsx
|
package/dist/hooks/useToast.d.ts
CHANGED