@fuf-stack/uniform 1.20.15 → 1.20.17
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/Checkboxes/index.cjs +1 -1
- package/dist/{Checkboxes-CqlbSLHi.cjs → Checkboxes-DHhU9eNR.cjs} +3 -3
- package/dist/{Checkboxes-CqlbSLHi.cjs.map → Checkboxes-DHhU9eNR.cjs.map} +1 -1
- package/dist/FieldArray/index.cjs +1 -1
- package/dist/{FieldArray-DtlFSbHK.cjs → FieldArray-ueGKvwY7.cjs} +4 -4
- package/dist/{FieldArray-DtlFSbHK.cjs.map → FieldArray-ueGKvwY7.cjs.map} +1 -1
- package/dist/FieldCard/index.cjs +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/{FieldCard-BNsMMgh3.cjs → FieldCard-CRAMlsLQ.cjs} +4 -4
- package/dist/{FieldCard-BNsMMgh3.cjs.map → FieldCard-CRAMlsLQ.cjs.map} +1 -1
- package/dist/{FieldCard-BuUT2zKN.js → FieldCard-axA3lKFh.js} +2 -2
- package/dist/{FieldCard-BuUT2zKN.js.map → FieldCard-axA3lKFh.js.map} +1 -1
- package/dist/{FieldCopyTestIdButton-_5kpA4ii.cjs → FieldCopyTestIdButton-Df9sS2Ba.cjs} +2 -2
- package/dist/{FieldCopyTestIdButton-_5kpA4ii.cjs.map → FieldCopyTestIdButton-Df9sS2Ba.cjs.map} +1 -1
- package/dist/{FieldValidationError-D40HtO_l.cjs → FieldValidationError-8XFABn8N.cjs} +2 -2
- package/dist/{FieldValidationError-D40HtO_l.cjs.map → FieldValidationError-8XFABn8N.cjs.map} +1 -1
- package/dist/Form/index.cjs +1 -1
- package/dist/Form/index.js +1 -1
- package/dist/{Form-BQbwyvPX.cjs → Form-B0SxszqY.cjs} +3 -3
- package/dist/{Form-BQbwyvPX.cjs.map → Form-B0SxszqY.cjs.map} +1 -1
- package/dist/{Form-BodvG3wG.js → Form-CEeNi0iG.js} +3 -3
- package/dist/{Form-BodvG3wG.js.map → Form-CEeNi0iG.js.map} +1 -1
- package/dist/{FormContext-DMaTuTAr.js → FormContext-C-CnF8V4.js} +36 -19
- package/dist/FormContext-C-CnF8V4.js.map +1 -0
- package/dist/{FormContext-Djp8wTG8.cjs → FormContext-DwCicmnH.cjs} +36 -19
- package/dist/FormContext-DwCicmnH.cjs.map +1 -0
- package/dist/Grid/index.cjs +1 -1
- package/dist/{Grid-BPOumLUp.cjs → Grid-DIe8WII9.cjs} +2 -2
- package/dist/{Grid-BPOumLUp.cjs.map → Grid-DIe8WII9.cjs.map} +1 -1
- package/dist/Input/index.cjs +1 -1
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/{Input-D64GjrZJ.cjs → Input-Bi75-PA6.cjs} +2 -2
- package/dist/{Input-D64GjrZJ.cjs.map → Input-Bi75-PA6.cjs.map} +1 -1
- package/dist/RadioBoxes/index.cjs +1 -1
- package/dist/{RadioBoxes-DpBv9exN.cjs → RadioBoxes-D9cMQ9hJ.cjs} +2 -2
- package/dist/{RadioBoxes-DpBv9exN.cjs.map → RadioBoxes-D9cMQ9hJ.cjs.map} +1 -1
- package/dist/RadioTabs/index.cjs +1 -1
- package/dist/{RadioTabs-CPsErN1U.cjs → RadioTabs-DLNfmgw-.cjs} +2 -2
- package/dist/{RadioTabs-CPsErN1U.cjs.map → RadioTabs-DLNfmgw-.cjs.map} +1 -1
- package/dist/Radios/index.cjs +1 -1
- package/dist/{Radios-LA38MXVt.cjs → Radios-B7EPCExa.cjs} +2 -2
- package/dist/{Radios-LA38MXVt.cjs.map → Radios-B7EPCExa.cjs.map} +1 -1
- package/dist/Select/index.cjs +1 -1
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/{Select-DR1M-WYr.cjs → Select-CTPYDpU_.cjs} +6 -4
- package/dist/{Select-DR1M-WYr.cjs.map → Select-CTPYDpU_.cjs.map} +1 -1
- package/dist/{Select-DZ9ONLss.js → Select-_4zQsG1p.js} +5 -3
- package/dist/{Select-DZ9ONLss.js.map → Select-_4zQsG1p.js.map} +1 -1
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/{Slider-BXPgYL-o.cjs → Slider-uX0s4Mgc.cjs} +2 -2
- package/dist/{Slider-BXPgYL-o.cjs.map → Slider-uX0s4Mgc.cjs.map} +1 -1
- package/dist/SubmitButton/index.cjs +1 -1
- package/dist/SubmitButton/index.js +1 -1
- package/dist/{SubmitButton-QWpHBvg9.js → SubmitButton-DXD-DnJW.js} +2 -2
- package/dist/{SubmitButton-QWpHBvg9.js.map → SubmitButton-DXD-DnJW.js.map} +1 -1
- package/dist/{SubmitButton-DgEHHy3N.cjs → SubmitButton-DoulRmLh.cjs} +3 -3
- package/dist/{SubmitButton-DgEHHy3N.cjs.map → SubmitButton-DoulRmLh.cjs.map} +1 -1
- package/dist/Switch/index.cjs +1 -1
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/{Switch-B_R9hdxd.cjs → Switch-BrqJcAHX.cjs} +2 -2
- package/dist/{Switch-B_R9hdxd.cjs.map → Switch-BrqJcAHX.cjs.map} +1 -1
- package/dist/SwitchBox/index.cjs +1 -1
- package/dist/{SwitchBox-DZXIJjgl.cjs → SwitchBox-haeHmIyQ.cjs} +2 -2
- package/dist/{SwitchBox-DZXIJjgl.cjs.map → SwitchBox-haeHmIyQ.cjs.map} +1 -1
- package/dist/TextArea/index.cjs +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/{TextArea-CsNyG6DY.cjs → TextArea-C8ENlNiR.cjs} +2 -2
- package/dist/{TextArea-CsNyG6DY.cjs.map → TextArea-C8ENlNiR.cjs.map} +1 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/hooks/useClientValidation/index.cjs +1 -1
- package/dist/hooks/useClientValidation/index.js +1 -1
- package/dist/hooks/useController/index.cjs +1 -1
- package/dist/hooks/useController/index.js +1 -1
- package/dist/hooks/useFormContext/index.cjs +1 -1
- package/dist/hooks/useFormContext/index.js +1 -1
- package/dist/hooks/useInput/index.cjs +1 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +2 -2
- package/dist/hooks/useInputValueDebounce/index.js +1 -1
- package/dist/hooks/useInputValueTransform/index.cjs +1 -1
- package/dist/hooks/useUniformField/index.cjs +6 -6
- package/dist/hooks/useUniformField/index.js +2 -2
- package/dist/hooks/useUniformFieldArray/index.cjs +2 -2
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +1 -1
- package/dist/hooks/useUniformFieldArray/index.js +1 -1
- package/dist/hooks/useWatchUserChange/index.cjs +1 -1
- package/dist/hooks/useWatchUserChange/index.js +1 -1
- package/dist/{index-DQYlskIr.d.ts → index-9wnJP0-_.d.ts} +16 -16
- package/dist/{index-DQYlskIr.d.ts.map → index-9wnJP0-_.d.ts.map} +1 -1
- package/dist/{index-A88y8cpH.d.cts → index-BUYJsYOF.d.cts} +4 -4
- package/dist/{index-A88y8cpH.d.cts.map → index-BUYJsYOF.d.cts.map} +1 -1
- package/dist/{index-Bfeg8Bgn.d.cts → index-BVkXdUIk.d.cts} +10 -10
- package/dist/{index-Bfeg8Bgn.d.cts.map → index-BVkXdUIk.d.cts.map} +1 -1
- package/dist/{index-DrFVTUQ9.d.ts → index-Bf61CKYX.d.ts} +10 -10
- package/dist/{index-DrFVTUQ9.d.ts.map → index-Bf61CKYX.d.ts.map} +1 -1
- package/dist/{index-Cj3P2Pmf.d.ts → index-BmR6MFmN.d.ts} +4 -4
- package/dist/{index-Cj3P2Pmf.d.ts.map → index-BmR6MFmN.d.ts.map} +1 -1
- package/dist/{index-5_7F4o-d.d.ts → index-C4Qex3mx.d.ts} +4 -4
- package/dist/{index-5_7F4o-d.d.ts.map → index-C4Qex3mx.d.ts.map} +1 -1
- package/dist/{index-A8Jhitar.d.cts → index-DxXdHxyY.d.cts} +4 -4
- package/dist/{index-A8Jhitar.d.cts.map → index-DxXdHxyY.d.cts.map} +1 -1
- package/dist/{index-UbDgOiTN.d.cts → index-GedeCgoX.d.cts} +7 -7
- package/dist/{index-UbDgOiTN.d.cts.map → index-GedeCgoX.d.cts.map} +1 -1
- package/dist/{index-Buf0-Uwe.d.cts → index-LwJL1Zry.d.cts} +16 -16
- package/dist/{index-Buf0-Uwe.d.cts.map → index-LwJL1Zry.d.cts.map} +1 -1
- package/dist/{index-DnVL0EF_.d.ts → index-uGStRmJo.d.ts} +7 -7
- package/dist/{index-DnVL0EF_.d.ts.map → index-uGStRmJo.d.ts.map} +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +8 -8
- package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -1
- package/dist/partials/FieldValidationError/index.cjs +1 -1
- package/dist/{useClientValidation-7iy9lEfO.js → useClientValidation-CRiAKKXX.js} +2 -2
- package/dist/{useClientValidation-7iy9lEfO.js.map → useClientValidation-CRiAKKXX.js.map} +1 -1
- package/dist/{useClientValidation-_GEt49og.cjs → useClientValidation-DNJSguNN.cjs} +3 -3
- package/dist/{useClientValidation-_GEt49og.cjs.map → useClientValidation-DNJSguNN.cjs.map} +1 -1
- package/dist/{useController-BQ4LoFBd.js → useController-CKhJx1rF.js} +2 -2
- package/dist/{useController-BQ4LoFBd.js.map → useController-CKhJx1rF.js.map} +1 -1
- package/dist/{useController-lNSzBL-i.cjs → useController-DBLYBDT1.cjs} +2 -2
- package/dist/{useController-lNSzBL-i.cjs.map → useController-DBLYBDT1.cjs.map} +1 -1
- package/dist/{useFormContext-2vyVWpUJ.js → useFormContext-C-THOgmB.js} +2 -2
- package/dist/{useFormContext-2vyVWpUJ.js.map → useFormContext-C-THOgmB.js.map} +1 -1
- package/dist/{useFormContext-CNGE9heQ.cjs → useFormContext-q0hx1SYq.cjs} +2 -2
- package/dist/{useFormContext-CNGE9heQ.cjs.map → useFormContext-q0hx1SYq.cjs.map} +1 -1
- package/dist/{useInputValueTransform-5jjQVowe.cjs → useInputValueTransform-MHvKpD22.cjs} +2 -2
- package/dist/{useInputValueTransform-5jjQVowe.cjs.map → useInputValueTransform-MHvKpD22.cjs.map} +1 -1
- package/dist/{useUniformFieldArray-Bcu3gKxz.d.ts → useUniformFieldArray-C0U3eBr7.d.ts} +2 -2
- package/dist/{useUniformFieldArray-Bcu3gKxz.d.ts.map → useUniformFieldArray-C0U3eBr7.d.ts.map} +1 -1
- package/dist/{useUniformFieldArray-qnnjPpJD.d.cts → useUniformFieldArray-RvOYml8h.d.cts} +2 -2
- package/dist/{useUniformFieldArray-qnnjPpJD.d.cts.map → useUniformFieldArray-RvOYml8h.d.cts.map} +1 -1
- package/dist/{useWatchUserChange-DdmIHIkf.js → useWatchUserChange-C6MCw8ql.js} +2 -2
- package/dist/{useWatchUserChange-DdmIHIkf.js.map → useWatchUserChange-C6MCw8ql.js.map} +1 -1
- package/dist/{useWatchUserChange-BSfuusTZ.cjs → useWatchUserChange-HDuOydMZ.cjs} +3 -3
- package/dist/{useWatchUserChange-BSfuusTZ.cjs.map → useWatchUserChange-HDuOydMZ.cjs.map} +1 -1
- package/package.json +6 -6
- package/dist/FormContext-DMaTuTAr.js.map +0 -1
- package/dist/FormContext-Djp8wTG8.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitButton-
|
|
1
|
+
{"version":3,"file":"SubmitButton-DXD-DnJW.js","names":[],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,KAAA,GACZ,QAAQ,WACR,OAAO,KAAA,GACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACE,eAAe;CAEnB,OACE,oBAAC,QAAD;EACa;EACX,WAAW,GAAG,SAAS;EAChB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,QAAQ,QAAQ,QAAQ,EAAE,aAAa,KAAK,CAAC;EAC7C,MAAK;EAEJ;CACK,CAAA;AAEZ;;;AC1DA,IAAA,uBAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require("./FormContext-
|
|
2
|
-
const require_useFormContext = require("./useFormContext-
|
|
1
|
+
require("./FormContext-DwCicmnH.cjs");
|
|
2
|
+
const require_useFormContext = require("./useFormContext-q0hx1SYq.cjs");
|
|
3
3
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
4
|
let _fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -40,4 +40,4 @@ Object.defineProperty(exports, "SubmitButton_default", {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
//# sourceMappingURL=SubmitButton-
|
|
43
|
+
//# sourceMappingURL=SubmitButton-DoulRmLh.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitButton-
|
|
1
|
+
{"version":3,"file":"SubmitButton-DoulRmLh.cjs","names":["useFormContext","Button"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,KAAA,GACZ,QAAQ,WACR,OAAO,KAAA,GACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACEA,uBAAAA,eAAe;CAEnB,OACE,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,QAAD;EACa;EACX,YAAA,GAAA,uBAAA,IAAc,SAAS;EAChB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,SAAA,GAAA,uBAAA,SAAgB,QAAQ,EAAE,aAAa,KAAK,CAAC;EAC7C,MAAK;EAEJ;CACK,CAAA;AAEZ;;;AC1DA,IAAA,uBAAe"}
|
package/dist/Switch/index.cjs
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_Switch = require("../Switch-
|
|
5
|
+
const require_Switch = require("../Switch-BrqJcAHX.cjs");
|
|
6
6
|
exports.Switch = require_Switch.Switch;
|
|
7
7
|
exports.default = require_Switch.Switch_default;
|
package/dist/Switch/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SwitchProps, t as Switch } from "../index-
|
|
1
|
+
import { n as SwitchProps, t as Switch } from "../index-GedeCgoX.cjs";
|
|
2
2
|
export { Switch, Switch as default, type SwitchProps };
|
package/dist/Switch/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SwitchProps, t as Switch } from "../index-
|
|
1
|
+
import { n as SwitchProps, t as Switch } from "../index-uGStRmJo.js";
|
|
2
2
|
export { Switch, Switch as default, type SwitchProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("./FormContext-
|
|
1
|
+
require("./FormContext-DwCicmnH.cjs");
|
|
2
2
|
const require_hooks_useUniformField_index = require("./hooks/useUniformField/index.cjs");
|
|
3
3
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
4
|
let react = require("react");
|
|
@@ -90,4 +90,4 @@ Object.defineProperty(exports, "Switch_default", {
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
//# sourceMappingURL=Switch-
|
|
93
|
+
//# sourceMappingURL=Switch-BrqJcAHX.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch-
|
|
1
|
+
{"version":3,"file":"Switch-BrqJcAHX.cjs","names":["useUniformField","VisuallyHidden","HeroSwitch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;AAaA,MAAa,kBAAA,GAAA,uBAAA,IAAoB,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;AACX,EACF,CAAC;;;;AA+BD,MAAM,UAAU,EACd,YAAY,KAAA,GACZ,aAAa,KAAA,GACb,MACA,OAAO,KAAA,GACP,eAAe,KAAA,GACf,YAAY,KAAA,GACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACEA,oCAAAA,gBAAgB;EAClB;EACA,GAAG;CACL,CAAC;CAGD,MAAM,mBAAA,GAAA,MAAA,QAA2C,IAAI;CAIrD,MAAM,cAAA,GAAA,uBAAA,sBADW,eAC8B,GAAG,WAAW,cAAc;CAE3E,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAW,WAAW;YAA3B;GAEE,iBAAA,GAAA,kBAAA,KAACC,4BAAAA,gBAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;IACO;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;KACf,SAAS,EAAE,OAAO,OAAO;IAC3B;IACA,eAAe;KAGb,gBAAgB,SAAS,MAAM;IACjC;GACD,CAAA,EACa,CAAA;GAEhB,iBAAA,GAAA,kBAAA,KAACC,eAAAA,QAAD;IACE,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;GACS,CAAA;GACX,UACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;IACE,GAAI,sBAAsB;IAC1B,YAAA,GAAA,uBAAA,IACE,sBAAsB,GAAG,WAEzB,YACF;cAEA,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,GAAI,qBAAqB;eAAI;IAAkB,CAAA;GACjD,CAAA,IACH;EACD;;AAET;;;AChJA,IAAA,iBAAe"}
|
package/dist/SwitchBox/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_SwitchBox = require("../SwitchBox-
|
|
5
|
+
const require_SwitchBox = require("../SwitchBox-haeHmIyQ.cjs");
|
|
6
6
|
exports.SwitchBox = require_SwitchBox.SwitchBox;
|
|
7
7
|
exports.default = require_SwitchBox.SwitchBox_default;
|
|
8
8
|
exports.switchBoxVariants = require_SwitchBox.switchBoxVariants;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("./FormContext-
|
|
1
|
+
require("./FormContext-DwCicmnH.cjs");
|
|
2
2
|
const require_hooks_useUniformField_index = require("./hooks/useUniformField/index.cjs");
|
|
3
3
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
4
|
let react = require("react");
|
|
@@ -168,4 +168,4 @@ Object.defineProperty(exports, "switchBoxVariants", {
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
//# sourceMappingURL=SwitchBox-
|
|
171
|
+
//# sourceMappingURL=SwitchBox-haeHmIyQ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchBox-DZXIJjgl.cjs","names":["useUniformField","VisuallyHidden"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"SwitchBox-haeHmIyQ.cjs","names":["useUniformField","VisuallyHidden"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
|
package/dist/TextArea/index.cjs
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_TextArea = require("../TextArea-
|
|
5
|
+
const require_TextArea = require("../TextArea-C8ENlNiR.cjs");
|
|
6
6
|
exports.TextArea = require_TextArea.TextArea;
|
|
7
7
|
exports.default = require_TextArea.TextArea_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextAreaProps, t as TextArea } from "../index-
|
|
1
|
+
import { n as TextAreaProps, t as TextArea } from "../index-BUYJsYOF.cjs";
|
|
2
2
|
export { TextArea, TextArea as default, type TextAreaProps };
|
package/dist/TextArea/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextAreaProps, t as TextArea } from "../index-
|
|
1
|
+
import { n as TextAreaProps, t as TextArea } from "../index-BmR6MFmN.js";
|
|
2
2
|
export { TextArea, TextArea as default, type TextAreaProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("./FormContext-
|
|
1
|
+
require("./FormContext-DwCicmnH.cjs");
|
|
2
2
|
const require_hooks_useUniformField_index = require("./hooks/useUniformField/index.cjs");
|
|
3
3
|
const require_hooks_useInputValueDebounce_index = require("./hooks/useInputValueDebounce/index.cjs");
|
|
4
4
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
@@ -75,4 +75,4 @@ Object.defineProperty(exports, "TextArea_default", {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
//# sourceMappingURL=TextArea-
|
|
78
|
+
//# sourceMappingURL=TextArea-C8ENlNiR.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea-
|
|
1
|
+
{"version":3,"file":"TextArea-C8ENlNiR.cjs","names":["useUniformField","useInputValueDebounce","HeroTextArea"],"sources":["../src/TextArea/TextArea.tsx","../src/TextArea/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Textarea as HeroTextArea } from '@heroui/input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useInputValueDebounce } from '../hooks/useInputValueDebounce';\nimport { useUniformField } from '../hooks/useUniformField';\n\n// input variants\nexport const textAreaVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof textAreaVariants>;\ntype ClassName = TVClassName<typeof textAreaVariants>;\n\nexport interface TextAreaProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** Child components. The content of the textarea. */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** debounce delay in milliseconds for form state updates (default: 300ms) */\n debounceDelay?: number;\n /** Determines if the TextArea is disabled or not. */\n disabled?: boolean;\n /** Label displayed above the TextArea. */\n label?: ReactNode;\n /** Name the TextArea is registered at in HTML forms (react-hook-form). */\n name: string;\n /** placeholder for the textArea content. */\n placeholder?: string;\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * TextArea component based on [HeroUI TextArea](https://www.heroui.com//docs/components/textarea)\n */\nconst TextArea = ({\n children = null,\n className: _className = undefined,\n debounceDelay = 300,\n name,\n placeholder = ' ',\n ...uniformFieldProps\n}: TextAreaProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: {\n onChange: fieldOnChange,\n onBlur: fieldOnBlur,\n value: fieldValue,\n ref,\n },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // Use debounced handlers for form updates\n const { onChange, onBlur, value } = useInputValueDebounce({\n debounceDelay,\n name,\n onBlur: fieldOnBlur,\n onChange: fieldOnChange,\n value: fieldValue,\n });\n\n // classNames from slots\n const variants = textAreaVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroTextArea\n ref={ref}\n data-testid={testId}\n errorMessage={errorMessage}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n variant=\"bordered\"\n // Only add aria-label if there's no meaningful placeholder (HeroUI uses placeholder as aria-label)\n aria-label={\n !placeholder || placeholder.trim() === '' ? ariaLabel : undefined\n }\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n >\n {children}\n </HeroTextArea>\n );\n};\n\nexport default TextArea;\n","import TextArea from './TextArea';\n\nexport type { TextAreaProps } from './TextArea';\n\nexport { TextArea };\n\nexport default TextArea;\n"],"mappings":";;;;;;;AAWA,MAAa,oBAAA,GAAA,uBAAA,IAAsB,EACjC,OAAO;;CAEL,MAAM;;CAEN,aAAa;;CAEb,OAAO;;CAEP,cAAc;AAChB,EACF,CAAC;;;;AA6BD,MAAM,YAAY,EAChB,WAAW,MACX,WAAW,aAAa,KAAA,GACxB,gBAAgB,KAChB,MACA,cAAc,KACd,GAAG,wBACgB;CACnB,MAAM,EACJ,WACA,UACA,cACA,OAAO,EACL,UAAU,eACV,QAAQ,aACR,OAAO,YACP,OAEF,SACA,OACA,UACA,WACEA,oCAAAA,gBAAgB;EAAE;EAAM,GAAG;CAAkB,CAAC;CAGlD,MAAM,EAAE,UAAU,QAAQ,UAAUC,0CAAAA,sBAAsB;EACxD;EACA;EACA,QAAQ;EACR,UAAU;EACV,OAAO;CACT,CAAC;CAID,MAAM,cAAA,GAAA,uBAAA,sBADW,iBAC8B,GAAG,YAAY,MAAM;CAEpE,OACE,iBAAA,GAAA,kBAAA,KAACC,cAAAA,UAAD;EACO;EACL,eAAa;EACC;EACd,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACT;EACE;EACE;EACG;EACN;EACP,SAAQ;EAER,cACE,CAAC,eAAe,YAAY,KAAK,MAAM,KAAK,YAAY,KAAA;EAE1D,YAAY;GACV,MAAM,WAAW;GACjB,aAAa,WAAW;GAExB,eAAe;GACf,OAAO,WAAW;GAClB,cAAc,WAAW;EAC3B;EAEC;CACW,CAAA;AAElB;;;ACnHA,IAAA,mBAAe"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../FormContext-
|
|
2
|
+
require("../FormContext-DwCicmnH.cjs");
|
|
3
3
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
4
|
//#region src/helpers/createOptionValueConverter/createOptionValueConverter.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_useClientValidation = require("../../useClientValidation-
|
|
2
|
+
const require_useClientValidation = require("../../useClientValidation-DNJSguNN.cjs");
|
|
3
3
|
//#region src/hooks/useClientValidation/index.ts
|
|
4
4
|
/* v8 ignore stop */
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-
|
|
1
|
+
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-CRiAKKXX.js";
|
|
2
2
|
//#region src/hooks/useClientValidation/index.ts
|
|
3
3
|
/* v8 ignore stop */
|
|
4
4
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_useController = require("../../useController-
|
|
2
|
+
const require_useController = require("../../useController-DBLYBDT1.cjs");
|
|
3
3
|
//#region src/hooks/useController/index.ts
|
|
4
4
|
/* v8 ignore stop */
|
|
5
5
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_useFormContext = require("../../useFormContext-
|
|
2
|
+
const require_useFormContext = require("../../useFormContext-q0hx1SYq.cjs");
|
|
3
3
|
//#region src/hooks/useFormContext/index.ts
|
|
4
4
|
/* v8 ignore stop */
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-
|
|
1
|
+
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-C-THOgmB.js";
|
|
2
2
|
//#region src/hooks/useFormContext/index.ts
|
|
3
3
|
/* v8 ignore stop */
|
|
4
4
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../FormContext-
|
|
2
|
+
require("../../FormContext-DwCicmnH.cjs");
|
|
3
3
|
let _heroui_input = require("@heroui/input");
|
|
4
4
|
//#region src/hooks/useInput/index.ts
|
|
5
5
|
/* v8 ignore stop */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../FormContext-
|
|
3
|
-
const require_useFormContext = require("../../useFormContext-
|
|
2
|
+
require("../../FormContext-DwCicmnH.cjs");
|
|
3
|
+
const require_useFormContext = require("../../useFormContext-q0hx1SYq.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
//#region src/hooks/useInputValueDebounce/useInputValueDebounce.ts
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useFormContext } from "../../useFormContext-
|
|
1
|
+
import { n as useFormContext } from "../../useFormContext-C-THOgmB.js";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
//#region src/hooks/useInputValueDebounce/useInputValueDebounce.ts
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_useInputValueTransform = require("../../useInputValueTransform-
|
|
2
|
+
const require_useInputValueTransform = require("../../useInputValueTransform-MHvKpD22.cjs");
|
|
3
3
|
//#region src/hooks/useInputValueTransform/index.ts
|
|
4
4
|
/* v8 ignore stop */
|
|
5
5
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_FormContext = require("../../FormContext-
|
|
2
|
+
const require_FormContext = require("../../FormContext-DwCicmnH.cjs");
|
|
3
3
|
const require_helpers_index = require("../../helpers/index.cjs");
|
|
4
|
-
const require_FieldCopyTestIdButton = require("../../FieldCopyTestIdButton-
|
|
5
|
-
const require_FieldValidationError = require("../../FieldValidationError-
|
|
6
|
-
const require_useController = require("../../useController-
|
|
7
|
-
const require_useFormContext = require("../../useFormContext-
|
|
8
|
-
const require_useInputValueTransform = require("../../useInputValueTransform-
|
|
4
|
+
const require_FieldCopyTestIdButton = require("../../FieldCopyTestIdButton-Df9sS2Ba.cjs");
|
|
5
|
+
const require_FieldValidationError = require("../../FieldValidationError-8XFABn8N.cjs");
|
|
6
|
+
const require_useController = require("../../useController-DBLYBDT1.cjs");
|
|
7
|
+
const require_useFormContext = require("../../useFormContext-q0hx1SYq.cjs");
|
|
8
|
+
const require_useInputValueTransform = require("../../useInputValueTransform-MHvKpD22.cjs");
|
|
9
9
|
let react = require("react");
|
|
10
10
|
react = require_FormContext.__toESM(react);
|
|
11
11
|
let _fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isValueEmpty } from "../../helpers/index.js";
|
|
2
2
|
import { n as FieldCopyTestIdButton } from "../../FieldCopyTestIdButton-Dpmo0uBV.js";
|
|
3
3
|
import { n as FieldValidationError } from "../../FieldValidationError-ktTyyyip.js";
|
|
4
|
-
import { t as useController } from "../../useController-
|
|
5
|
-
import { n as useFormContext } from "../../useFormContext-
|
|
4
|
+
import { t as useController } from "../../useController-CKhJx1rF.js";
|
|
5
|
+
import { n as useFormContext } from "../../useFormContext-C-THOgmB.js";
|
|
6
6
|
import { t as useInput } from "../../useInput-CVm3tP78.js";
|
|
7
7
|
import { t as useInputValueTransform } from "../../useInputValueTransform-CXdmtc0Q.js";
|
|
8
8
|
import "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../FormContext-
|
|
2
|
+
require("../../FormContext-DwCicmnH.cjs");
|
|
3
3
|
const require_helpers_index = require("../../helpers/index.cjs");
|
|
4
|
-
const require_useFormContext = require("../../useFormContext-
|
|
4
|
+
const require_useFormContext = require("../../useFormContext-q0hx1SYq.cjs");
|
|
5
5
|
const require_hooks_useUniformField_index = require("../useUniformField/index.cjs");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let _fuf_stack_pixel_motion = require("@fuf-stack/pixel-motion");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-
|
|
1
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-RvOYml8h.cjs";
|
|
2
2
|
export { UseUniformFieldArrayProps, useUniformFieldArray };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-
|
|
1
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-C0U3eBr7.js";
|
|
2
2
|
export { UseUniformFieldArrayProps, useUniformFieldArray };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flatArrayKey } from "../../helpers/index.js";
|
|
2
|
-
import { n as useFormContext$1 } from "../../useFormContext-
|
|
2
|
+
import { n as useFormContext$1 } from "../../useFormContext-C-THOgmB.js";
|
|
3
3
|
import { useUniformField } from "../useUniformField/index.js";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { useReducedMotion } from "@fuf-stack/pixel-motion";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_useWatchUserChange = require("../../useWatchUserChange-
|
|
2
|
+
const require_useWatchUserChange = require("../../useWatchUserChange-HDuOydMZ.cjs");
|
|
3
3
|
//#region src/hooks/useWatchUserChange/index.ts
|
|
4
4
|
/* v8 ignore stop */
|
|
5
5
|
//#endregion
|
|
@@ -6,15 +6,15 @@ declare const sliderVariants: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
[key: string]: {
|
|
7
7
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
8
8
|
base?: import("tailwind-merge").ClassNameValue;
|
|
9
|
-
errorMessage?: import("tailwind-merge").ClassNameValue;
|
|
10
9
|
label?: import("tailwind-merge").ClassNameValue;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
thumb?: import("tailwind-merge").ClassNameValue;
|
|
10
|
+
value?: import("tailwind-merge").ClassNameValue;
|
|
11
|
+
errorMessage?: import("tailwind-merge").ClassNameValue;
|
|
14
12
|
mark?: import("tailwind-merge").ClassNameValue;
|
|
15
13
|
track?: import("tailwind-merge").ClassNameValue;
|
|
16
14
|
step?: import("tailwind-merge").ClassNameValue;
|
|
17
|
-
|
|
15
|
+
endContent?: import("tailwind-merge").ClassNameValue;
|
|
16
|
+
startContent?: import("tailwind-merge").ClassNameValue;
|
|
17
|
+
thumb?: import("tailwind-merge").ClassNameValue;
|
|
18
18
|
filler?: import("tailwind-merge").ClassNameValue;
|
|
19
19
|
labelWrapper?: import("tailwind-merge").ClassNameValue;
|
|
20
20
|
trackWrapper?: import("tailwind-merge").ClassNameValue;
|
|
@@ -24,15 +24,15 @@ declare const sliderVariants: import("tailwind-variants").TVReturnType<{
|
|
|
24
24
|
[x: string]: {
|
|
25
25
|
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
26
26
|
base?: import("tailwind-merge").ClassNameValue;
|
|
27
|
-
errorMessage?: import("tailwind-merge").ClassNameValue;
|
|
28
27
|
label?: import("tailwind-merge").ClassNameValue;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
thumb?: import("tailwind-merge").ClassNameValue;
|
|
28
|
+
value?: import("tailwind-merge").ClassNameValue;
|
|
29
|
+
errorMessage?: import("tailwind-merge").ClassNameValue;
|
|
32
30
|
mark?: import("tailwind-merge").ClassNameValue;
|
|
33
31
|
track?: import("tailwind-merge").ClassNameValue;
|
|
34
32
|
step?: import("tailwind-merge").ClassNameValue;
|
|
35
|
-
|
|
33
|
+
endContent?: import("tailwind-merge").ClassNameValue;
|
|
34
|
+
startContent?: import("tailwind-merge").ClassNameValue;
|
|
35
|
+
thumb?: import("tailwind-merge").ClassNameValue;
|
|
36
36
|
filler?: import("tailwind-merge").ClassNameValue;
|
|
37
37
|
labelWrapper?: import("tailwind-merge").ClassNameValue;
|
|
38
38
|
trackWrapper?: import("tailwind-merge").ClassNameValue;
|
|
@@ -56,15 +56,15 @@ declare const sliderVariants: import("tailwind-variants").TVReturnType<{
|
|
|
56
56
|
[key: string]: {
|
|
57
57
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
58
58
|
base?: import("tailwind-merge").ClassNameValue;
|
|
59
|
-
errorMessage?: import("tailwind-merge").ClassNameValue;
|
|
60
59
|
label?: import("tailwind-merge").ClassNameValue;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
thumb?: import("tailwind-merge").ClassNameValue;
|
|
60
|
+
value?: import("tailwind-merge").ClassNameValue;
|
|
61
|
+
errorMessage?: import("tailwind-merge").ClassNameValue;
|
|
64
62
|
mark?: import("tailwind-merge").ClassNameValue;
|
|
65
63
|
track?: import("tailwind-merge").ClassNameValue;
|
|
66
64
|
step?: import("tailwind-merge").ClassNameValue;
|
|
67
|
-
|
|
65
|
+
endContent?: import("tailwind-merge").ClassNameValue;
|
|
66
|
+
startContent?: import("tailwind-merge").ClassNameValue;
|
|
67
|
+
thumb?: import("tailwind-merge").ClassNameValue;
|
|
68
68
|
filler?: import("tailwind-merge").ClassNameValue;
|
|
69
69
|
labelWrapper?: import("tailwind-merge").ClassNameValue;
|
|
70
70
|
trackWrapper?: import("tailwind-merge").ClassNameValue;
|
|
@@ -164,4 +164,4 @@ declare const Slider: ({
|
|
|
164
164
|
}: SliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
165
165
|
//#endregion
|
|
166
166
|
export { SliderProps as n, Slider as t };
|
|
167
|
-
//# sourceMappingURL=index-
|
|
167
|
+
//# sourceMappingURL=index-9wnJP0-_.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-9wnJP0-_.d.ts","names":[],"sources":["../src/Slider/Slider.tsx"],"mappings":";;;;cAYa,cAAA,8BAAc,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqBtB,YAAA,GAAe,OAAO,QAAQ,cAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,cAAA;AAAA,UAEnB,WAAA,SAAoB,YAAA;;EAEnC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;EAEA,UAAA,GAAa,SAAA;;EAEb,UAAA;;EAEA,KAAA;;EAEA,IAAA;;;;;EAKA,SAAA;;;;;EAKA,IAAA;;EAEA,YAAA,GAAe,SAAA;;;;;EAKf,IAAA;;EAEA,MAAA;;;;AAtCC;EA2CD,QAAA;;;AAzC+C;AAAA;EA8C/C,QAAA;AAAA;;AA7CgD;AAElD;cAiDM,MAAA;EAAU,SAAA;EAAA,UAAA;EAAA,UAAA;EAAA,IAAA;EAAA,SAAA;EAAA,IAAA;EAAA,YAAA;EAAA,IAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAYb,WAAA,iCAAW,GAAA,CAAA,OAAA"}
|
|
@@ -6,18 +6,18 @@ declare const textAreaVariants: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
[key: string]: {
|
|
7
7
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
8
8
|
base?: import("tailwind-merge").ClassNameValue;
|
|
9
|
+
clearButton?: import("tailwind-merge").ClassNameValue;
|
|
9
10
|
input?: import("tailwind-merge").ClassNameValue;
|
|
10
11
|
inputWrapper?: import("tailwind-merge").ClassNameValue;
|
|
11
|
-
clearButton?: import("tailwind-merge").ClassNameValue;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
} | {
|
|
15
15
|
[x: string]: {
|
|
16
16
|
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
17
17
|
base?: import("tailwind-merge").ClassNameValue;
|
|
18
|
+
clearButton?: import("tailwind-merge").ClassNameValue;
|
|
18
19
|
input?: import("tailwind-merge").ClassNameValue;
|
|
19
20
|
inputWrapper?: import("tailwind-merge").ClassNameValue;
|
|
20
|
-
clearButton?: import("tailwind-merge").ClassNameValue;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
} | {}, {
|
|
@@ -29,9 +29,9 @@ declare const textAreaVariants: import("tailwind-variants").TVReturnType<{
|
|
|
29
29
|
[key: string]: {
|
|
30
30
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
31
31
|
base?: import("tailwind-merge").ClassNameValue;
|
|
32
|
+
clearButton?: import("tailwind-merge").ClassNameValue;
|
|
32
33
|
input?: import("tailwind-merge").ClassNameValue;
|
|
33
34
|
inputWrapper?: import("tailwind-merge").ClassNameValue;
|
|
34
|
-
clearButton?: import("tailwind-merge").ClassNameValue;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
} | {}, {
|
|
@@ -80,4 +80,4 @@ declare const TextArea: ({
|
|
|
80
80
|
}: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
81
81
|
//#endregion
|
|
82
82
|
export { TextAreaProps as n, TextArea as t };
|
|
83
|
-
//# sourceMappingURL=index-
|
|
83
|
+
//# sourceMappingURL=index-BUYJsYOF.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BUYJsYOF.d.cts","names":[],"sources":["../src/TextArea/TextArea.tsx"],"mappings":";;;;cAWa,gBAAA,8BAAgB,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAaxB,YAAA,GAAe,OAAO,QAAQ,gBAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,gBAAA;AAAA,UAEnB,aAAA,SAAsB,YAAA;EAHnB;EAKlB,SAAA;EAJG;EAMH,QAAA,GAAW,SAAA;;EAEX,SAAA,GAAY,SAAA;EARsC;EAUlD,aAAA;EAR6B;EAU7B,QAAA;EANW;EAQX,KAAA,GAAQ,SAAA;EAAA;EAER,IAAA;EAdiD;EAgBjD,WAAA;EAhBqC;EAkBrC,MAAA;AAAA;;;;cAMI,QAAA;EAAY,QAAA;EAAA,SAAA,EAAA,UAAA;EAAA,aAAA;EAAA,IAAA;EAAA,WAAA;EAAA,GAAA;AAAA,GAOf,aAAA,iCAAa,GAAA,CAAA,OAAA"}
|
|
@@ -8,12 +8,12 @@ declare const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
|
8
8
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
9
9
|
base?: import("tailwind-merge").ClassNameValue;
|
|
10
10
|
label?: import("tailwind-merge").ClassNameValue;
|
|
11
|
-
group?: import("tailwind-merge").ClassNameValue;
|
|
12
11
|
input?: import("tailwind-merge").ClassNameValue;
|
|
13
|
-
menu?: import("tailwind-merge").ClassNameValue;
|
|
14
|
-
option?: import("tailwind-merge").ClassNameValue;
|
|
15
12
|
placeholder?: import("tailwind-merge").ClassNameValue;
|
|
16
13
|
control?: import("tailwind-merge").ClassNameValue;
|
|
14
|
+
menu?: import("tailwind-merge").ClassNameValue;
|
|
15
|
+
option?: import("tailwind-merge").ClassNameValue;
|
|
16
|
+
group?: import("tailwind-merge").ClassNameValue;
|
|
17
17
|
clearIndicator?: import("tailwind-merge").ClassNameValue;
|
|
18
18
|
control_focused?: import("tailwind-merge").ClassNameValue;
|
|
19
19
|
crossIcon?: import("tailwind-merge").ClassNameValue;
|
|
@@ -44,12 +44,12 @@ declare const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
|
44
44
|
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
45
45
|
base?: import("tailwind-merge").ClassNameValue;
|
|
46
46
|
label?: import("tailwind-merge").ClassNameValue;
|
|
47
|
-
group?: import("tailwind-merge").ClassNameValue;
|
|
48
47
|
input?: import("tailwind-merge").ClassNameValue;
|
|
49
|
-
menu?: import("tailwind-merge").ClassNameValue;
|
|
50
|
-
option?: import("tailwind-merge").ClassNameValue;
|
|
51
48
|
placeholder?: import("tailwind-merge").ClassNameValue;
|
|
52
49
|
control?: import("tailwind-merge").ClassNameValue;
|
|
50
|
+
menu?: import("tailwind-merge").ClassNameValue;
|
|
51
|
+
option?: import("tailwind-merge").ClassNameValue;
|
|
52
|
+
group?: import("tailwind-merge").ClassNameValue;
|
|
53
53
|
clearIndicator?: import("tailwind-merge").ClassNameValue;
|
|
54
54
|
control_focused?: import("tailwind-merge").ClassNameValue;
|
|
55
55
|
crossIcon?: import("tailwind-merge").ClassNameValue;
|
|
@@ -112,12 +112,12 @@ declare const selectVariants: import("tailwind-variants").TVReturnType<{
|
|
|
112
112
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
113
113
|
base?: import("tailwind-merge").ClassNameValue;
|
|
114
114
|
label?: import("tailwind-merge").ClassNameValue;
|
|
115
|
-
group?: import("tailwind-merge").ClassNameValue;
|
|
116
115
|
input?: import("tailwind-merge").ClassNameValue;
|
|
117
|
-
menu?: import("tailwind-merge").ClassNameValue;
|
|
118
|
-
option?: import("tailwind-merge").ClassNameValue;
|
|
119
116
|
placeholder?: import("tailwind-merge").ClassNameValue;
|
|
120
117
|
control?: import("tailwind-merge").ClassNameValue;
|
|
118
|
+
menu?: import("tailwind-merge").ClassNameValue;
|
|
119
|
+
option?: import("tailwind-merge").ClassNameValue;
|
|
120
|
+
group?: import("tailwind-merge").ClassNameValue;
|
|
121
121
|
clearIndicator?: import("tailwind-merge").ClassNameValue;
|
|
122
122
|
control_focused?: import("tailwind-merge").ClassNameValue;
|
|
123
123
|
crossIcon?: import("tailwind-merge").ClassNameValue;
|
|
@@ -284,4 +284,4 @@ declare const Select: ({
|
|
|
284
284
|
}: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
285
285
|
//#endregion
|
|
286
286
|
export { SelectProps as n, Select as t };
|
|
287
|
-
//# sourceMappingURL=index-
|
|
287
|
+
//# sourceMappingURL=index-BVkXdUIk.d.cts.map
|