@fuf-stack/uniform 1.10.1 → 1.10.3
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/FieldCard/index.cjs +2 -2
- package/dist/FieldCard/index.d.cts +3 -1
- package/dist/FieldCard/index.d.ts +3 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/Slider/index.cjs +2 -2
- package/dist/Slider/index.js +1 -1
- package/dist/{chunk-XPFJZAG7.cjs → chunk-4HFPBJ3O.cjs} +4 -13
- package/dist/chunk-4HFPBJ3O.cjs.map +1 -0
- package/dist/{chunk-ZIMWVUMQ.js → chunk-4RQJCFM7.js} +7 -2
- package/dist/chunk-4RQJCFM7.js.map +1 -0
- package/dist/{chunk-RHARCEQE.js → chunk-IR75YRIZ.js} +4 -13
- package/dist/chunk-IR75YRIZ.js.map +1 -0
- package/dist/{chunk-NXBYGCPL.cjs → chunk-OT3A4LEE.cjs} +7 -2
- package/dist/chunk-OT3A4LEE.cjs.map +1 -0
- package/dist/hooks/useClientValidation/index.d.cts +2 -2
- package/dist/hooks/useClientValidation/index.d.ts +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-NXBYGCPL.cjs.map +0 -1
- package/dist/chunk-RHARCEQE.js.map +0 -1
- package/dist/chunk-XPFJZAG7.cjs.map +0 -1
- package/dist/chunk-ZIMWVUMQ.js.map +0 -1
package/dist/FieldCard/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkOT3A4LEEcjs = require('../chunk-OT3A4LEE.cjs');
|
|
5
5
|
require('../chunk-V3M7HL26.cjs');
|
|
6
6
|
require('../chunk-OE5BOGGX.cjs');
|
|
7
7
|
require('../chunk-NHEZXA4H.cjs');
|
|
@@ -15,5 +15,5 @@ require('../chunk-555JRYCS.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.FieldCard =
|
|
18
|
+
exports.FieldCard = _chunkOT3A4LEEcjs.FieldCard_default; exports.fieldCardVariants = _chunkOT3A4LEEcjs.fieldCardVariants;
|
|
19
19
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import { TVClassName } from '@fuf-stack/pixel-utils';
|
|
3
4
|
import { ReactNode } from 'react';
|
|
4
5
|
|
|
5
6
|
declare const fieldCardVariants: tailwind_variants.TVReturnType<{
|
|
@@ -69,11 +70,12 @@ declare const fieldCardVariants: tailwind_variants.TVReturnType<{
|
|
|
69
70
|
/** class for the error footer wrapper */
|
|
70
71
|
errorFooter: string[];
|
|
71
72
|
}, undefined, unknown, unknown, undefined>>;
|
|
73
|
+
type ClassName = TVClassName<typeof fieldCardVariants>;
|
|
72
74
|
interface FieldCardProps {
|
|
73
75
|
/** Content to render inside the card */
|
|
74
76
|
children: ReactNode;
|
|
75
77
|
/** CSS class name */
|
|
76
|
-
className?:
|
|
78
|
+
className?: ClassName;
|
|
77
79
|
/** Label content for the card header */
|
|
78
80
|
label: ReactNode;
|
|
79
81
|
/** Field name for validation */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import { TVClassName } from '@fuf-stack/pixel-utils';
|
|
3
4
|
import { ReactNode } from 'react';
|
|
4
5
|
|
|
5
6
|
declare const fieldCardVariants: tailwind_variants.TVReturnType<{
|
|
@@ -69,11 +70,12 @@ declare const fieldCardVariants: tailwind_variants.TVReturnType<{
|
|
|
69
70
|
/** class for the error footer wrapper */
|
|
70
71
|
errorFooter: string[];
|
|
71
72
|
}, undefined, unknown, unknown, undefined>>;
|
|
73
|
+
type ClassName = TVClassName<typeof fieldCardVariants>;
|
|
72
74
|
interface FieldCardProps {
|
|
73
75
|
/** Content to render inside the card */
|
|
74
76
|
children: ReactNode;
|
|
75
77
|
/** CSS class name */
|
|
76
|
-
className?:
|
|
78
|
+
className?: ClassName;
|
|
77
79
|
/** Label content for the card header */
|
|
78
80
|
label: ReactNode;
|
|
79
81
|
/** Field name for validation */
|
package/dist/FieldCard/index.js
CHANGED
package/dist/Slider/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4HFPBJ3Ocjs = require('../chunk-4HFPBJ3O.cjs');
|
|
5
5
|
require('../chunk-V3M7HL26.cjs');
|
|
6
6
|
require('../chunk-OE5BOGGX.cjs');
|
|
7
7
|
require('../chunk-NHEZXA4H.cjs');
|
|
@@ -15,5 +15,5 @@ require('../chunk-555JRYCS.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.Slider =
|
|
18
|
+
exports.Slider = _chunk4HFPBJ3Ocjs.Slider_default; exports.default = _chunk4HFPBJ3Ocjs.Slider_default2;
|
|
19
19
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Slider/index.js
CHANGED
|
@@ -12,7 +12,6 @@ var _react = require('react');
|
|
|
12
12
|
var _slider = require('@heroui/slider');
|
|
13
13
|
var _visuallyhidden = require('@react-aria/visually-hidden');
|
|
14
14
|
var _pixelutils = require('@fuf-stack/pixel-utils');
|
|
15
|
-
var _pixels = require('@fuf-stack/pixels');
|
|
16
15
|
var _jsxruntime = require('react/jsx-runtime');
|
|
17
16
|
var sliderVariants = _pixelutils.tv.call(void 0, {
|
|
18
17
|
slots: {
|
|
@@ -76,15 +75,9 @@ var Slider = (_a) => {
|
|
|
76
75
|
name
|
|
77
76
|
}, uniformFieldProps));
|
|
78
77
|
const visualSliderRef = _react.useRef.call(void 0, null);
|
|
79
|
-
const isInitialRender = _pixels.useIsInitialRenderCycle.call(void 0, );
|
|
80
78
|
const variants = sliderVariants();
|
|
81
79
|
const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
|
|
82
80
|
const currentValue = field.value != null ? Number(field.value) : minValue;
|
|
83
|
-
const handleBlur = () => {
|
|
84
|
-
if (!isInitialRender) {
|
|
85
|
-
onBlur();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
81
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
89
82
|
"div",
|
|
90
83
|
{
|
|
@@ -102,7 +95,7 @@ var Slider = (_a) => {
|
|
|
102
95
|
max: maxValue,
|
|
103
96
|
min: minValue,
|
|
104
97
|
name,
|
|
105
|
-
onBlur
|
|
98
|
+
onBlur,
|
|
106
99
|
step,
|
|
107
100
|
tabIndex: -1,
|
|
108
101
|
type: "range",
|
|
@@ -112,9 +105,7 @@ var Slider = (_a) => {
|
|
|
112
105
|
},
|
|
113
106
|
onFocus: () => {
|
|
114
107
|
var _a3;
|
|
115
|
-
|
|
116
|
-
(_a3 = visualSliderRef.current) == null ? void 0 : _a3.focus();
|
|
117
|
-
}
|
|
108
|
+
(_a3 = visualSliderRef.current) == null ? void 0 : _a3.focus();
|
|
118
109
|
}
|
|
119
110
|
}
|
|
120
111
|
) }),
|
|
@@ -131,7 +122,7 @@ var Slider = (_a) => {
|
|
|
131
122
|
maxValue,
|
|
132
123
|
minValue,
|
|
133
124
|
name: `${name}_slider`,
|
|
134
|
-
onBlur
|
|
125
|
+
onBlur,
|
|
135
126
|
onChange,
|
|
136
127
|
showSteps,
|
|
137
128
|
size,
|
|
@@ -177,4 +168,4 @@ var Slider_default2 = Slider_default;
|
|
|
177
168
|
|
|
178
169
|
|
|
179
170
|
exports.Slider_default = Slider_default; exports.Slider_default2 = Slider_default2;
|
|
180
|
-
//# sourceMappingURL=chunk-
|
|
171
|
+
//# sourceMappingURL=chunk-4HFPBJ3O.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-4HFPBJ3O.cjs","../src/Slider/Slider.tsx","../src/Slider/index.ts"],"names":["_a","Slider_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,8BAAuB;AAEvB,wCAAuC;AACvC,6DAA+B;AAE/B,oDAA6C;AAwHzC,+CAAA;AApHG,IAAM,eAAA,EAAiB,4BAAA;AAAG,EAC/B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,UAAA,EAAY,EAAA;AAAA,IACZ,YAAA,EAAc,WAAA;AAAA,IACd,MAAA,EAAQ,EAAA;AAAA;AAAA;AAAA,IAGR,KAAA,EACE,yNAAA;AAAA,IACF,YAAA,EAAc,EAAA;AAAA,IACd,IAAA,EAAM,EAAA;AAAA,IACN,YAAA,EAAc,EAAA;AAAA,IACd,IAAA,EAAM,EAAA;AAAA,IACN,KAAA,EAAO,EAAA;AAAA,IACP,KAAA,EAAO,EAAA;AAAA,IACP,YAAA,EAAc,EAAA;AAAA,IACd,KAAA,EAAO;AAAA,EACT;AACF,CAAC,CAAA;AAsDD,IAAM,OAAA,EAAS,CAAC,EAAA,EAAA,GAYG;AAZH,EAAA,IAAA,GAAA,EAAA,EAAA,EACd;AAAA,IAAA,UAAA,EAAY,KAAA,CAAA;AAAA,IACZ,WAAA,EAAa,KAAA,CAAA;AAAA,IACb,WAAA,EAAa,KAAA,CAAA;AAAA,IACb,IAAA;AAAA,IACA,UAAA,EAAY,KAAA;AAAA,IACZ,KAAA,EAAO,IAAA;AAAA,IACP,aAAA,EAAe,KAAA,CAAA;AAAA,IACf,KAAA,EAAO,CAAA;AAAA,IACP,SAAA,EAAW,CAAA;AAAA,IACX,SAA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;AAEC,YAAA;AACEA,cAAAA;AAAyB;AAEzB,cAAA;AACF,YAAA;AAEA,YAAA;AAA+C,UAAA;AAE/C,QAAA;AAAA,MAAA;AAAA,IAAA;AACN,EAAA;AAEJ;AAEO;AD7CY;AACA;AE7JZC;AF+JY;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-4HFPBJ3O.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\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 sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={onBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n visualSliderRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={onBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\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 Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"]}
|
|
@@ -83,7 +83,12 @@ var fieldCardVariants = tv({
|
|
|
83
83
|
"rounded-t-small border-b p-3 font-semibold text-medium"
|
|
84
84
|
],
|
|
85
85
|
/** class for the content */
|
|
86
|
-
content: [
|
|
86
|
+
content: [
|
|
87
|
+
// same as p-3 of Card component
|
|
88
|
+
"p-3",
|
|
89
|
+
// default grid for form components (see Grid component)
|
|
90
|
+
"grid gap-4"
|
|
91
|
+
],
|
|
87
92
|
/** class for the error footer wrapper */
|
|
88
93
|
errorFooter: [
|
|
89
94
|
"border-t",
|
|
@@ -146,4 +151,4 @@ export {
|
|
|
146
151
|
fieldCardVariants,
|
|
147
152
|
FieldCard_default
|
|
148
153
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
154
|
+
//# sourceMappingURL=chunk-4RQJCFM7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/FieldCard/FieldCard.tsx","../src/FieldCard/subcomponents/FieldCardValidationError.tsx"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding\n 'block px-3 py-2',\n ],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger',\n label: 'border-danger text-danger',\n errorFooter: 'border-danger',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n // className from slots\n const variants = fieldCardVariants({ invalid: hasErrors });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className.label)}\n role=\"heading\"\n >\n {label}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors */}\n <FieldCardValidationError className={className.errorFooter} name={name} />\n </div>\n );\n};\n\nexport default FieldCard;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n"],"mappings":";;;;;;;;;;;;;AAGA,SAAS,MAAAA,KAAI,IAAI,4BAA4B;;;ACH7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AAwDL;AAtCd,IAAM,2BAA2B,CAAC;AAAA,EAChC,YAAY;AAAA,EACZ;AACF,MAAqC;AA1BrC;AA2BE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,gBAAgB;AAAA,IAClB;AAAA,EACF,CAAC;AAGD,QAAM,mBAAmB,iBAAiB;AAG1C,QAAM,YAAY,YAAW,+BAAO;AAEpC,SACE,oBAAC,mBAAgB,SAAS,CAAC,kBACxB,sBACC;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MAEC,MAAM,mBAAmB,SAAY,EAAE,SAAS,GAAG,QAAQ,EAAE;AAAA,MAC7D,SAAS,mBAAmB,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAAE;AAAA,MAC5D,OAAO,EAAE,UAAU,SAAS;AAAA,MAC5B,YAAY,EAAE,UAAU,KAAK,MAAM,UAAU;AAAA,MAC7C,SACE,mBAAmB,SAAY,EAAE,SAAS,GAAG,QAAQ,OAAO;AAAA,MAG9D;AAAA,QAAC;AAAA,yCACK,sBAAsB,IAD3B;AAAA,UAEC,WAAW,IAAG,2BAAsB,MAAtB,mBAAyB,WAAW,SAAS;AAAA,UAE3D,8BAAC,wCAAQ,qBAAqB,IAA7B,EACC;AAAA,YAAC;AAAA;AAAA,cAEC,OAAO,MAAM;AAAA,cACb;AAAA;AAAA,UACF,IACF;AAAA;AAAA,MACF;AAAA;AAAA,IApBI;AAAA,EAqBN,IACE,MACN;AAEJ;AAEA,IAAO,m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A,QACzD,MAAK;AAAA,QAEJ;AAAA;AAAA,IACH,IACE;AAAA,IAGJ,gBAAAD,KAAC,SAAI,WAAW,UAAU,SAAU,UAAS;AAAA,IAG7C,gBAAAA,KAAC,oCAAyB,WAAW,UAAU,aAAa,MAAY;AAAA,KAC1E;AAEJ;AAEA,IAAO,oBAAQ;","names":["cn","jsx","_a","cn"]}
|
|
@@ -12,7 +12,6 @@ import { useRef } from "react";
|
|
|
12
12
|
import { Slider as HeroUISlider } from "@heroui/slider";
|
|
13
13
|
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
14
14
|
import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
15
|
-
import { useIsInitialRenderCycle } from "@fuf-stack/pixels";
|
|
16
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
16
|
var sliderVariants = tv({
|
|
18
17
|
slots: {
|
|
@@ -76,15 +75,9 @@ var Slider = (_a) => {
|
|
|
76
75
|
name
|
|
77
76
|
}, uniformFieldProps));
|
|
78
77
|
const visualSliderRef = useRef(null);
|
|
79
|
-
const isInitialRender = useIsInitialRenderCycle();
|
|
80
78
|
const variants = sliderVariants();
|
|
81
79
|
const classNames = variantsToClassNames(variants, className, "base");
|
|
82
80
|
const currentValue = field.value != null ? Number(field.value) : minValue;
|
|
83
|
-
const handleBlur = () => {
|
|
84
|
-
if (!isInitialRender) {
|
|
85
|
-
onBlur();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
81
|
return /* @__PURE__ */ jsxs(
|
|
89
82
|
"div",
|
|
90
83
|
{
|
|
@@ -102,7 +95,7 @@ var Slider = (_a) => {
|
|
|
102
95
|
max: maxValue,
|
|
103
96
|
min: minValue,
|
|
104
97
|
name,
|
|
105
|
-
onBlur
|
|
98
|
+
onBlur,
|
|
106
99
|
step,
|
|
107
100
|
tabIndex: -1,
|
|
108
101
|
type: "range",
|
|
@@ -112,9 +105,7 @@ var Slider = (_a) => {
|
|
|
112
105
|
},
|
|
113
106
|
onFocus: () => {
|
|
114
107
|
var _a3;
|
|
115
|
-
|
|
116
|
-
(_a3 = visualSliderRef.current) == null ? void 0 : _a3.focus();
|
|
117
|
-
}
|
|
108
|
+
(_a3 = visualSliderRef.current) == null ? void 0 : _a3.focus();
|
|
118
109
|
}
|
|
119
110
|
}
|
|
120
111
|
) }),
|
|
@@ -131,7 +122,7 @@ var Slider = (_a) => {
|
|
|
131
122
|
maxValue,
|
|
132
123
|
minValue,
|
|
133
124
|
name: `${name}_slider`,
|
|
134
|
-
onBlur
|
|
125
|
+
onBlur,
|
|
135
126
|
onChange,
|
|
136
127
|
showSteps,
|
|
137
128
|
size,
|
|
@@ -177,4 +168,4 @@ export {
|
|
|
177
168
|
Slider_default,
|
|
178
169
|
Slider_default2
|
|
179
170
|
};
|
|
180
|
-
//# sourceMappingURL=chunk-
|
|
171
|
+
//# sourceMappingURL=chunk-IR75YRIZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Slider/Slider.tsx","../src/Slider/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\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 sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={onBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n visualSliderRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={onBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\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 Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"],"mappings":";;;;;;;;;;AAGA,SAAS,cAAc;AAEvB,SAAS,UAAU,oBAAoB;AACvC,SAAS,sBAAsB;AAE/B,SAAS,IAAI,IAAI,4BAA4B;AAwHzC,SAQI,KARJ;AApHG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,YAAY;AAAA,IACZ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
|
83
83
|
"rounded-t-small border-b p-3 font-semibold text-medium"
|
|
84
84
|
],
|
|
85
85
|
/** class for the content */
|
|
86
|
-
content: [
|
|
86
|
+
content: [
|
|
87
|
+
// same as p-3 of Card component
|
|
88
|
+
"p-3",
|
|
89
|
+
// default grid for form components (see Grid component)
|
|
90
|
+
"grid gap-4"
|
|
91
|
+
],
|
|
87
92
|
/** class for the error footer wrapper */
|
|
88
93
|
errorFooter: [
|
|
89
94
|
"border-t",
|
|
@@ -146,4 +151,4 @@ var FieldCard_default = FieldCard;
|
|
|
146
151
|
|
|
147
152
|
|
|
148
153
|
exports.fieldCardVariants = fieldCardVariants; exports.FieldCard_default = FieldCard_default;
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
154
|
+
//# sourceMappingURL=chunk-OT3A4LEE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-OT3A4LEE.cjs","../src/FieldCard/FieldCard.tsx","../src/FieldCard/subcomponents/FieldCardValidationError.tsx"],"names":["_a","jsx","cn"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACTA,oDAA6C;ADW7C;AACA;AEfA;AACE;AACA;AACA;AAAA,sDACK;AACP;AAwDc,+CAAA;AAtCd,IAAM,yBAAA,EAA2B,CAAC;AAAA,EAChC,UAAA,EAAY,KAAA,CAAA;AAAA,EACZ;AACF,CAAA,EAAA,GAAqC;AA1BrC,EAAA,IAAA,EAAA;AA2BE,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,oBAAA;AAAA,IACA,qBAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,EACF,EAAA,EAAI,+CAAA;AAAgB,IAClB;AAAA,EACF,CAAC,CAAA;AAGD,EAAA,MAAM,iBAAA,EAAmB,2CAAA,CAAiB;AAG1C,EAAA,MAAM,U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AA,EAAA,CAC1E,CAAA;AAEJ,CAAA;AAEA,IAAO,kBAAA,EAAQ,SAAA;AD0Bf;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-OT3A4LEE.cjs","sourcesContent":[null,"import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding\n 'block px-3 py-2',\n ],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger',\n label: 'border-danger text-danger',\n errorFooter: 'border-danger',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n // className from slots\n const variants = fieldCardVariants({ invalid: hasErrors });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className.label)}\n role=\"heading\"\n >\n {label}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors */}\n <FieldCardValidationError className={className.errorFooter} name={name} />\n </div>\n );\n};\n\nexport default FieldCard;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _fuf_stack_veto_dist_types_d_CSVd_Qmh from '@fuf-stack/veto/dist/types.d-CSVd_Qmh';
|
|
2
2
|
import { VetoTypeAny } from '@fuf-stack/veto';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -142,6 +142,6 @@ declare const useClientValidation: <TData = unknown>(data: TData | null | undefi
|
|
|
142
142
|
* // => objectLoose({ tags: array(vt.string().refine(...).nullish()).optional() })
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
|
-
declare const clientValidationSchemaByName: <T extends VetoTypeAny>(name: string, fieldSchema: T) =>
|
|
145
|
+
declare const clientValidationSchemaByName: <T extends VetoTypeAny>(name: string, fieldSchema: T) => _fuf_stack_veto_dist_types_d_CSVd_Qmh.Z;
|
|
146
146
|
|
|
147
147
|
export { clientValidationSchemaByName, useClientValidation };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _fuf_stack_veto_dist_types_d_CSVd_Qmh from '@fuf-stack/veto/dist/types.d-CSVd_Qmh';
|
|
2
2
|
import { VetoTypeAny } from '@fuf-stack/veto';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -142,6 +142,6 @@ declare const useClientValidation: <TData = unknown>(data: TData | null | undefi
|
|
|
142
142
|
* // => objectLoose({ tags: array(vt.string().refine(...).nullish()).optional() })
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
|
-
declare const clientValidationSchemaByName: <T extends VetoTypeAny>(name: string, fieldSchema: T) =>
|
|
145
|
+
declare const clientValidationSchemaByName: <T extends VetoTypeAny>(name: string, fieldSchema: T) => _fuf_stack_veto_dist_types_d_CSVd_Qmh.Z;
|
|
146
146
|
|
|
147
147
|
export { clientValidationSchemaByName, useClientValidation };
|
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var _chunk55VJM3KDcjs = require('./chunk-55VJM3KD.cjs');
|
|
|
16
16
|
var _chunkWYM6IAIJcjs = require('./chunk-WYM6IAIJ.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk4HFPBJ3Ocjs = require('./chunk-4HFPBJ3O.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkWXSISX5Ycjs = require('./chunk-WXSISX5Y.cjs');
|
|
@@ -42,7 +42,7 @@ var _chunk7ZE7IZ5Rcjs = require('./chunk-7ZE7IZ5R.cjs');
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var _chunkOT3A4LEEcjs = require('./chunk-OT3A4LEE.cjs');
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
var _chunkLWPZZ2AWcjs = require('./chunk-LWPZZ2AW.cjs');
|
|
@@ -130,5 +130,5 @@ require('./chunk-555JRYCS.cjs');
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
exports.Checkboxes = _chunkYYR23V5Pcjs.Checkboxes_default; exports.FieldArray = _chunkZ6QACVK7cjs.FieldArray_default; exports.FieldCard =
|
|
133
|
+
exports.Checkboxes = _chunkYYR23V5Pcjs.Checkboxes_default; exports.FieldArray = _chunkZ6QACVK7cjs.FieldArray_default; exports.FieldCard = _chunkOT3A4LEEcjs.FieldCard_default; exports.FieldCopyTestIdButton = _chunkOE5BOGGXcjs.FieldCopyTestIdButton_default; exports.FieldValidationError = _chunkNHEZXA4Hcjs.FieldValidationError_default; exports.Form = _chunkLWPZZ2AWcjs.Form_default; exports.Grid = _chunkTTD3KL6Ecjs.Grid_default; exports.Input = _chunkECUVOZGQcjs.Input_default; exports.RadioBoxes = _chunkTHDHNYP7cjs.RadioBoxes_default; exports.RadioTabs = _chunk6GN62PBGcjs.RadioTabs_default; exports.Radios = _chunk55VJM3KDcjs.Radios_default; exports.Select = _chunkWYM6IAIJcjs.Select_default; exports.Slider = _chunk4HFPBJ3Ocjs.Slider_default; exports.SubmitButton = _chunkWXSISX5Ycjs.SubmitButton_default; exports.Switch = _chunkRVBTLB5Gcjs.Switch_default; exports.SwitchBox = _chunkSW3NGBCEcjs.SwitchBox_default; exports.TextArea = _chunkKDNO5YO5cjs.TextArea_default; exports.checkFieldIsRequired = _chunkFYN7ZWLWcjs.checkFieldIsRequired; exports.clientValidationSchemaByName = _chunk2UQCRQEJcjs.clientValidationSchemaByName; exports.fieldCardVariants = _chunkOT3A4LEEcjs.fieldCardVariants; exports.flatArrayKey = _chunkOKJWLH7Tcjs.flatArrayKey; exports.fromNullishString = _chunkOKJWLH7Tcjs.fromNullishString; exports.nameToTestId = _chunkOKJWLH7Tcjs.nameToTestId; exports.radioBoxVariants = _chunkTHDHNYP7cjs.radioBoxVariants; exports.switchBoxVariants = _chunkSW3NGBCEcjs.switchBoxVariants; exports.toFormFormat = _chunkOKJWLH7Tcjs.toFormFormat; exports.toNullishString = _chunkOKJWLH7Tcjs.toNullishString; exports.toValidationFormat = _chunkOKJWLH7Tcjs.toValidationFormat; exports.useClientValidation = _chunk2UQCRQEJcjs.useClientValidation; exports.useController = _chunk6AWHOBNLcjs.useController; exports.useFormContext = _chunkFYN7ZWLWcjs.useFormContext; exports.useInput = _chunkPCTYJUY7cjs.useInput; exports.useInputValueDebounce = _chunk3ZQXSGR2cjs.useInputValueDebounce; exports.useInputValueTransform = _chunk56TQOKG7cjs.useInputValueTransform; exports.useUniformField = _chunkV3M7HL26cjs.useUniformField; exports.useUniformFieldArray = _chunk7ZE7IZ5Rcjs.useUniformFieldArray; exports.useWatchUserChange = _chunkHEPNEBRFcjs.useWatchUserChange;
|
|
134
134
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-4CQWTUQR.js";
|
|
17
17
|
import {
|
|
18
18
|
Slider_default
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IR75YRIZ.js";
|
|
20
20
|
import {
|
|
21
21
|
SubmitButton_default
|
|
22
22
|
} from "./chunk-OORASWXL.js";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
import {
|
|
43
43
|
FieldCard_default,
|
|
44
44
|
fieldCardVariants
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-4RQJCFM7.js";
|
|
46
46
|
import {
|
|
47
47
|
Form_default
|
|
48
48
|
} from "./chunk-UB7CSOZU.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuf-stack/uniform",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3",
|
|
4
4
|
"description": "fuf react form library",
|
|
5
5
|
"author": "Fröhlich ∧ Frei",
|
|
6
6
|
"homepage": "https://github.com/fuf-stack/pixels#readme",
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"@fuf-stack/pixel-motion": "1.0.26",
|
|
184
184
|
"@fuf-stack/pixel-utils": "1.0.6",
|
|
185
185
|
"@fuf-stack/pixels": "1.6.1",
|
|
186
|
-
"@fuf-stack/veto": "0.12.
|
|
186
|
+
"@fuf-stack/veto": "0.12.7",
|
|
187
187
|
"@heroui/button": "2.2.24",
|
|
188
188
|
"@heroui/checkbox": "2.3.24",
|
|
189
189
|
"@heroui/input": "2.4.25",
|
|
@@ -208,5 +208,5 @@
|
|
|
208
208
|
"react": "19.1.1",
|
|
209
209
|
"react-dom": "19.1.1"
|
|
210
210
|
},
|
|
211
|
-
"gitHead": "
|
|
211
|
+
"gitHead": "80d7fb49b7e58adccc74eb604c0e2ef040ae1513"
|
|
212
212
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-NXBYGCPL.cjs","../src/FieldCard/FieldCard.tsx","../src/FieldCard/subcomponents/FieldCardValidationError.tsx"],"names":["_a","jsx","cn"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACVA,oDAA6C;ADY7C;AACA;AEfA;AACE;AACA;AACA;AAAA,sDACK;AACP;AAwDc,+CAAA;AAtCd,IAAM,yBAAA,EAA2B,CAAC;AAAA,EAChC,UAAA,EAAY,KAAA,CAAA;AAAA,EACZ;AACF,CAAA,EAAA,GAAqC;AA1BrC,EAAA,IAAA,EAAA;AA2BE,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,oBAAA;AAAA,IACA,qBAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,EACF,EAAA,EAAI,+CAAA;AAAgB,IAClB;AAAA,EACF,CAAC,CAAA;AAGD,EAAA,MAAM,iBAAA,EAAmB,2CAAA,CAAiB;AAG1C,EAAA,MAAM,UAAA,EAAY,QAAA,GAAA,CAAW,MAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,KAAA,CAAO,OAAA,CAAA;AAEpC,EAAA,uBACE,6BAAA,4BAAC,EAAA,EAAgB,OAAA,EAAS,CAAC,gBAAA,EACxB,QAAA,EAAA,UAAA,kBACC,6BAAA;AAAA,IAAC,mBAAA,CAAO,GAAA;AAAA,IAAP;AAAA,MAEC,IAAA,EAAM,iBAAA,EAAmB,KAAA,EAAA,EAAY,EAAE,OAAA,EAAS,CAAA,EAAG,MAAA,EAAQ,EAAE,CAAA;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A,CAAkB,EAAE,OAAA,EAAS,UAAU,CAAC,CAAA;AACzD,EAAA,MAAM,UAAA,EAAY,8CAAA,QAAqB,EAAU,UAAA,EAAY,MAAM,CAAA;AAEnE,EAAA,uBACE,8BAAA,KAAC,EAAA,EAAI,SAAA,EAAW,SAAA,CAAU,IAAA,EAEvB,QAAA,EAAA;AAAA,IAAA,MAAA,kBACCC,6BAAAA;AAAA,MAAC,KAAA;AAAA,MAAA,6CAAA,8CAAA,CAAA,CAAA,EACK,aAAA,CAAc,CAAA,CAAA,EADnB;AAAA,QAEC,YAAA,EAAY,CAAA;AAAA,QACZ,SAAA,EAAWC,4BAAAA,CAAGF,IAAAA,EAAA,aAAA,CAAc,CAAA,EAAA,GAAd,KAAA,EAAA,KAAA,EAAA,EAAAA,GAAAA,CAAiB,SAAA,EAAW,SAAA,CAAU,KAAK,CAAA;AAAA,QACzD,IAAA,EAAK,SAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,MAAA,CAAA;AAAA,IACH,EAAA,EACE,IAAA;AAAA,oBAGJC,6BAAAA,KAAC,EAAA,EAAI,SAAA,EAAW,SAAA,CAAU,OAAA,EAAU,SAAA,CAAS,CAAA;AAAA,oBAG7CA,6BAAAA,gCAAC,EAAA,EAAyB,SAAA,EAAW,SAAA,CAAU,WAAA,EAAa,KAAA,CAAY;AAAA,EAAA,EAAA,CAC1E,CAAA;AAEJ,CAAA;AAEA,IAAO,kBAAA,EAAQ,SAAA;AD6Bf;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-NXBYGCPL.cjs","sourcesContent":[null,"import type { ReactNode } from 'react';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n ],\n /** class for the content */\n content: ['p-3'],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding\n 'block px-3 py-2',\n ],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger',\n label: 'border-danger text-danger',\n errorFooter: 'border-danger',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n // className from slots\n const variants = fieldCardVariants({ invalid: hasErrors });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className.label)}\n role=\"heading\"\n >\n {label}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors */}\n <FieldCardValidationError className={className.errorFooter} name={name} />\n </div>\n );\n};\n\nexport default FieldCard;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Slider/Slider.tsx","../src/Slider/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport { useIsInitialRenderCycle } from '@fuf-stack/pixels';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // Prevent blur events during initial render to avoid premature touched state in tests\n const isInitialRender = useIsInitialRenderCycle();\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n // Prevent marking as touched during initial render (fixes CI timing issues)\n const handleBlur = () => {\n if (!isInitialRender) {\n onBlur();\n }\n };\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={handleBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n if (!isInitialRender) {\n visualSliderRef.current?.focus();\n }\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={handleBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\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 Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"],"mappings":";;;;;;;;;;AAGA,SAAS,cAAc;AAEvB,SAAS,UAAU,oBAAoB;AACvC,SAAS,sBAAsB;AAE/B,SAAS,IAAI,IAAI,4BAA4B;AAC7C,SAAS,+BAA+B;AAkIpC,SAQI,KARJ;AA9HG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,QAAQ;AAAA;AAAA;AAAA,IAGR,OACE;AAAA,IACF,cAAc;AAAA,IACd,MAAM;AAAA,IACN,cAAc;AAAA,IACd,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,cAAc;AAAA,IACd,OAAO;AAAA,EACT;AACF,CAAC;AAsDD,IAAM,SAAS,CAAC,OAYG;AAZH,eACd;AAAA,gBAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa;AAAA,IACb;AAAA,IACA,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,eAAe;AAAA,IACf,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,EAhGb,IAsFgB,IAWX,8BAXW,IAWX;AAAA,IAVH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;A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Y;AAAA,YACZ;AAAA,YACA;AAAA,YACA;AAAA,YACA,MAAM,GAAG,IAAI;AAAA,YACb,QAAQ;AAAA,YACR;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP,YAAY;AAAA,cACV,YAAY,WAAW;AAAA,cACvB,QAAQ,WAAW;AAAA,cACnB,OAAO,WAAW;AAAA,cAClB,cAAc,WAAW;AAAA,cACzB,MAAM,WAAW;AAAA,cACjB,cAAc,WAAW;AAAA,cACzB,MAAM,WAAW;AAAA,cACjB,OAAO,WAAW;AAAA,cAClB,OAAO,WAAW;AAAA,cAClB,cAAc,WAAW;AAAA,cACzB,OAAO,WAAW;AAAA,YACpB;AAAA;AAAA,QACF;AAAA,QACC,UACC;AAAA,UAAC;AAAA,2CACK,sBAAsB,IAD3B;AAAA,YAEC,WAAW;AAAA,eACTA,MAAA,sBAAsB,MAAtB,gBAAAA,IAAyB;AAAA;AAAA,cAEzB;AAAA,YACF;AAAA,YAEA,8BAAC,wCAAQ,qBAAqB,IAA7B,EAAiC,yBAAa;AAAA;AAAA,QACjD,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AAEA,IAAO,iBAAQ;;;ACtNf,IAAOC,kBAAQ;","names":["_a","Slider_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/chunk-XPFJZAG7.cjs","../src/Slider/Slider.tsx","../src/Slider/index.ts"],"names":["_a","Slider_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACNA,8BAAuB;AAEvB,wCAAuC;AACvC,6DAA+B;AAE/B,oDAA6C;AAC7C,2CAAwC;AAkIpC,+CAAA;AA9HG,IAAM,eAAA,EAAiB,4BAAA;AAAG,EAC/B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,UAAA,EAAY,EAAA;A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FJZAG7.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport { useIsInitialRenderCycle } from '@fuf-stack/pixels';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // Prevent blur events during initial render to avoid premature touched state in tests\n const isInitialRender = useIsInitialRenderCycle();\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n // Prevent marking as touched during initial render (fixes CI timing issues)\n const handleBlur = () => {\n if (!isInitialRender) {\n onBlur();\n }\n };\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={handleBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n if (!isInitialRender) {\n visualSliderRef.current?.focus();\n }\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={handleBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\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 Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/FieldCard/FieldCard.tsx","../src/FieldCard/subcomponents/FieldCardValidationError.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n ],\n /** class for the content */\n content: ['p-3'],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding\n 'block px-3 py-2',\n ],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger',\n label: 'border-danger text-danger',\n errorFooter: 'border-danger',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n // className from slots\n const variants = fieldCardVariants({ invalid: hasErrors });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className.label)}\n role=\"heading\"\n >\n {label}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors */}\n <FieldCardValidationError className={className.errorFooter} name={name} />\n </div>\n );\n};\n\nexport default FieldCard;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAS,MAAAA,KAAI,IAAI,4BAA4B;;;ACF7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AAwDL;AAtCd,IAAM,2BAA2B,CAAC;AAAA,EAChC,YAAY;AAAA,EACZ;AACF,MAAqC;AA1BrC;AA2BE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,gBAAgB;AAAA,IAClB;AAAA,EACF,CAAC;AAGD,QAAM,mBAAmB,iBAAiB;AAG1C,QAAM,YAAY,YAAW,+BAAO;AAEpC,SACE,oBAAC,mBAAgB,SAAS,CAAC,kBACxB,sBACC;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MAEC,MAAM,mBAAmB,SAAY,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