@lerianstudio/sindarian-ui 2.0.0-beta.1 → 2.0.0-beta.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.
Files changed (42) hide show
  1. package/dist/components/form/file-upload-field/index.d.ts +11 -2
  2. package/dist/components/form/file-upload-field/index.d.ts.map +1 -1
  3. package/dist/components/form/file-upload-field/index.js +8 -3
  4. package/dist/components/form/input-field/index.d.ts +41 -2
  5. package/dist/components/form/input-field/index.d.ts.map +1 -1
  6. package/dist/components/form/input-field/index.js +73 -15
  7. package/dist/components/form/select-field/index.d.ts +9 -1
  8. package/dist/components/form/select-field/index.d.ts.map +1 -1
  9. package/dist/components/form/select-field/index.js +2 -2
  10. package/dist/components/ui/button/styles.css +31 -1
  11. package/dist/components/ui/calendar/index.d.ts.map +1 -1
  12. package/dist/components/ui/calendar/index.js +7 -1
  13. package/dist/components/ui/file-upload/index.d.ts +235 -9
  14. package/dist/components/ui/file-upload/index.d.ts.map +1 -1
  15. package/dist/components/ui/file-upload/index.js +328 -13
  16. package/dist/components/ui/form.d.ts +4 -0
  17. package/dist/components/ui/form.d.ts.map +1 -1
  18. package/dist/components/ui/form.js +48 -6
  19. package/dist/components/ui/toggle-group/index.d.ts +1 -1
  20. package/dist/components/ui/toggle-group/index.d.ts.map +1 -1
  21. package/dist/components/ui/toggle-group/index.js +73 -4
  22. package/dist/esm/components/form/file-upload-field/index.d.ts +11 -2
  23. package/dist/esm/components/form/file-upload-field/index.d.ts.map +1 -1
  24. package/dist/esm/components/form/file-upload-field/index.js +8 -3
  25. package/dist/esm/components/form/input-field/index.d.ts +41 -2
  26. package/dist/esm/components/form/input-field/index.d.ts.map +1 -1
  27. package/dist/esm/components/form/input-field/index.js +73 -15
  28. package/dist/esm/components/form/select-field/index.d.ts +9 -1
  29. package/dist/esm/components/form/select-field/index.d.ts.map +1 -1
  30. package/dist/esm/components/form/select-field/index.js +2 -2
  31. package/dist/esm/components/ui/calendar/index.d.ts.map +1 -1
  32. package/dist/esm/components/ui/calendar/index.js +8 -2
  33. package/dist/esm/components/ui/file-upload/index.d.ts +235 -9
  34. package/dist/esm/components/ui/file-upload/index.d.ts.map +1 -1
  35. package/dist/esm/components/ui/file-upload/index.js +327 -13
  36. package/dist/esm/components/ui/form.d.ts +4 -0
  37. package/dist/esm/components/ui/form.d.ts.map +1 -1
  38. package/dist/esm/components/ui/form.js +48 -6
  39. package/dist/esm/components/ui/toggle-group/index.d.ts +1 -1
  40. package/dist/esm/components/ui/toggle-group/index.d.ts.map +1 -1
  41. package/dist/esm/components/ui/toggle-group/index.js +73 -4
  42. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Control, FieldPathByValue, FieldValues } from 'react-hook-form';
3
- import { type FileUploadResult } from '../../../components/ui/file-upload';
3
+ import { type FileUploadError, type FileUploadLabels, type FileUploadResult } from '../../../components/ui/file-upload';
4
4
  import { type RenderableLabel } from '../../../components/form/renderable-label';
5
5
  type FileUploadFieldOwnProps<T extends FieldValues = FieldValues> = {
6
6
  control: Control<T>;
@@ -17,6 +17,15 @@ type FileUploadFieldOwnProps<T extends FieldValues = FieldValues> = {
17
17
  maxSizeBytes?: number;
18
18
  disabled?: boolean;
19
19
  className?: string;
20
+ /**
21
+ * Override the picker's user-visible copy. Threaded straight to FileUpload;
22
+ * omitted fields keep the English defaults. Note `labels.error` governs the
23
+ * PICKER's own size/type/read refusal only — resolver messages still come
24
+ * from the schema through FormMessage.
25
+ */
26
+ labels?: FileUploadLabels;
27
+ /** Observe size, type, and read failures after the form value is cleared. */
28
+ onError?: (error: FileUploadError) => void;
20
29
  /** Optional escape hatch to also observe the picked File/clear alongside the form's text value. */
21
30
  onSelect?: (result: FileUploadResult | null) => void;
22
31
  };
@@ -47,6 +56,6 @@ export type FileUploadFieldProps<T extends FieldValues = FieldValues> = FileUplo
47
56
  * rejection; on resolver failure the FormMessage announces. Both surfaces are
48
57
  * wired.
49
58
  */
50
- export declare const FileUploadField: <T extends FieldValues = FieldValues>({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, onSelect, "aria-label": ariaLabelProp }: FileUploadFieldProps<T>) => import("react").JSX.Element;
59
+ export declare const FileUploadField: <T extends FieldValues = FieldValues>({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, labels, onError, onSelect, "aria-label": ariaLabelProp }: FileUploadFieldProps<T>) => import("react").JSX.Element;
51
60
  export {};
52
61
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/file-upload-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAWxE,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,oCAAoC,CAAA;AAE3C,KAAK,uBAAuB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IAClE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IACnB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC7C,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAA;CACrD,CAAA;AAED;;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AM,CAAA;IAClB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAC1C,mGAAmG;IACnG,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAA;CACrD,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAClE,uBAAuB,CAAC,CAAC,CAAC,GACxB,CACI;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAC1C,CAAA;AAEL;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,6JAelE,oBAAoB,CAAC,CAAC,CAAC,gCAoFzB,CAAA"}
@@ -22,7 +22,7 @@ const renderable_label_1 = require("../../../components/form/renderable-label");
22
22
  * rejection; on resolver failure the FormMessage announces. Both surfaces are
23
23
  * wired.
24
24
  */
25
- const FileUploadField = ({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, onSelect, 'aria-label': ariaLabelProp }) => {
25
+ const FileUploadField = ({ control, name, label, description, tooltip, required, accept, maxSizeBytes, disabled, className, labels, onError, onSelect, 'aria-label': ariaLabelProp }) => {
26
26
  const [localValue, setLocalValue] = (0, react_1.useState)(null);
27
27
  const showLabel = (0, renderable_label_1.hasRenderableLabel)(label);
28
28
  // An empty or whitespace-only aria-label is worse than none: it names the
@@ -54,11 +54,16 @@ const FileUploadField = ({ control, name, label, description, tooltip, required,
54
54
  // value carries nothing else to tell them apart. Fix needs a reset epoch
55
55
  // from react-hook-form, or a form value richer than the file text.
56
56
  const shown = localValue && field.value === localValue.text ? localValue : null;
57
- return ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [showLabel && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : undefined, children: label })), (0, jsx_runtime_1.jsx)(form_1.FormControl, { children: (0, jsx_runtime_1.jsx)(file_upload_1.FileUpload, { ref: field.ref, name: field.name, onBlur: field.onBlur, "aria-label": ariaLabel, accept: accept, maxSizeBytes: maxSizeBytes, disabled: disabled, className: className, value: shown, onSelect: (result) => {
57
+ return ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [showLabel && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : undefined, children: label })), (0, jsx_runtime_1.jsx)(form_1.FormControl, { children: (0, jsx_runtime_1.jsx)(file_upload_1.FileUpload, { ref: field.ref, name: field.name, onBlur: field.onBlur, "aria-label": ariaLabel, labels: labels, accept: accept, maxSizeBytes: maxSizeBytes, disabled: disabled, className: className, value: shown, onSelect: (result) => {
58
58
  setLocalValue(result);
59
59
  field.onChange(result?.text ?? '');
60
60
  onSelect?.(result);
61
- }, onError: () => field.onChange('') }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
61
+ }, onError: (error) => {
62
+ setLocalValue(null);
63
+ field.onChange('');
64
+ onSelect?.(null);
65
+ onError?.(error);
66
+ } }) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
62
67
  } }));
63
68
  };
64
69
  exports.FileUploadField = FileUploadField;
@@ -1,9 +1,48 @@
1
- import { HTMLInputTypeAttribute, ReactNode } from 'react';
1
+ import { type InputRef } from '../../../components/ui/input';
2
+ import { HTMLInputTypeAttribute, ReactNode, Ref } from 'react';
2
3
  import { Control, FieldValues } from 'react-hook-form';
3
4
  export type InputFieldProps<T extends FieldValues = FieldValues> = {
4
5
  className?: string;
5
6
  name: string;
6
7
  type?: HTMLInputTypeAttribute;
8
+ /**
9
+ * Announce the field's own invalidity. Reaches the rendered control on BOTH
10
+ * branches, so a field with no `control` — and therefore no react-hook-form
11
+ * error state — can still tell a screen reader it is invalid.
12
+ *
13
+ * ORed with the form's error, never overriding it: `false` here cannot
14
+ * suppress a live resolver error. Nobody asked to mute a real validation
15
+ * failure, and on a financial console a muted one is a wrong number reaching
16
+ * a money path.
17
+ *
18
+ * TypeScript exempts hyphenated JSX attributes from excess-property
19
+ * checking, so passing this used to compile and then vanish.
20
+ */
21
+ 'aria-invalid'?: boolean;
22
+ /** Lower bound, forwarded to the single-line control on both branches. */
23
+ min?: number | string;
24
+ /** Upper bound, forwarded to the single-line control on both branches. */
25
+ max?: number | string;
26
+ /** Increment, forwarded to the single-line control on both branches. */
27
+ step?: number | string;
28
+ /** Character ceiling, forwarded on both branches (single-line and textarea). */
29
+ maxLength?: number;
30
+ /** Browser autofill hint. `"off"` is the one a money field usually wants. */
31
+ autoComplete?: React.HTMLInputAutoCompleteAttribute;
32
+ /** Virtual-keyboard hint, e.g. `"numeric"` or `"decimal"`. Both branches. */
33
+ inputMode?: React.HTMLAttributes<HTMLElement>['inputMode'];
34
+ /** Native validation regex. Single-line only — a textarea has no `pattern`. */
35
+ pattern?: string;
36
+ /** Focus the control on mount. React focuses the node rather than emitting an attribute. */
37
+ autoFocus?: boolean;
38
+ /**
39
+ * Imperative handle on the rendered control: `focus()`/`blur()` on the
40
+ * single-line branch, the textarea node on the `textArea` branch (which
41
+ * satisfies the same shape). COMPOSED with react-hook-form's own ref when
42
+ * `control` is present, never replacing it — the form keeps the node it
43
+ * needs for `shouldFocusError`.
44
+ */
45
+ ref?: Ref<InputRef>;
7
46
  label?: ReactNode;
8
47
  tooltip?: string;
9
48
  labelExtra?: ReactNode;
@@ -32,5 +71,5 @@ export type InputFieldProps<T extends FieldValues = FieldValues> = {
32
71
  'data-testid'?: string;
33
72
  onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
34
73
  };
35
- export declare const InputField: <T extends FieldValues = FieldValues>({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, ...others }: InputFieldProps<T>) => import("react").JSX.Element;
74
+ export declare const InputField: <T extends FieldValues = FieldValues>({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, min, max, step, maxLength, autoComplete, inputMode, pattern, autoFocus, ref, "aria-invalid": ariaInvalid, ...others }: InputFieldProps<T>) => import("react").JSX.Element;
36
75
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/input-field/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,OAAO,EAAkB,WAAW,EAAQ,MAAM,iBAAiB,CAAA;AAE5E,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,sBAAsB,CAAA;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;oDACgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,C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AAG,mBAAmB,CAAC,KACzD,IAAI,CAAA;CACV,CAAA;AA4CD,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,iTA6B7D,eAAe,CAAC,CAAC,CAAC,gCAyHpB,CAAA"}
@@ -5,8 +5,59 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const autosize_textarea_1 = require("../../../components/ui/autosize-textarea");
6
6
  const form_1 = require("../../../components/ui/form");
7
7
  const input_1 = require("../../../components/ui/input");
8
- const InputField = ({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, ...others }) => {
9
- const renderItem = (binding) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [label && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : labelExtra, children: label })), (0, jsx_runtime_1.jsx)(form_1.FormControl, { children: textArea ? ((0, jsx_runtime_1.jsx)(autosize_textarea_1.AutosizeTextarea, { className: className, placeholder: placeholder, readOnly: readOnly, minHeight: minHeight, maxHeight: maxHeight, "data-testid": others['data-testid'], ...binding })) : ((0, jsx_runtime_1.jsx)(input_1.Input, { className: className, type: type, placeholder: placeholder, readOnly: readOnly, startAdornment: startAdornment, endAdornment: endAdornment, "data-testid": others['data-testid'], ...binding })) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
8
+ const react_1 = require("react");
9
+ /**
10
+ * Fan one node out to several refs. React hands a node to ONE ref, so a
11
+ * consumer ref and react-hook-form's `field.ref` cannot both be passed
12
+ * directly — one silently wins. Only used when the consumer actually supplied
13
+ * a ref, so a field without one keeps `field.ref`'s own identity and React
14
+ * never re-attaches it.
15
+ */
16
+ function fanOutRef(...refs) {
17
+ return (node) => {
18
+ const cleanups = [];
19
+ for (const ref of refs) {
20
+ if (typeof ref === 'function') {
21
+ const cleanup = ref(node);
22
+ cleanups.push(typeof cleanup === 'function' ? cleanup : () => ref(null));
23
+ }
24
+ else if (ref) {
25
+ ;
26
+ ref.current = node;
27
+ cleanups.push(() => {
28
+ ;
29
+ ref.current = null;
30
+ });
31
+ }
32
+ }
33
+ return () => cleanups.forEach((cleanup) => cleanup());
34
+ };
35
+ }
36
+ const InputField = ({ className, type, label, tooltip, labelExtra, placeholder, description, startAdornment, endAdornment, required, readOnly, minHeight, maxHeight, textArea, defaultValue, value, onChange, min, max, step, maxLength, autoComplete, inputMode, pattern, autoFocus, ref, 'aria-invalid': ariaInvalid, ...others }) => {
37
+ // OR with the form's error, expressed through the Slot merge rather than by
38
+ // reading the form: FormControl already injects `aria-invalid={!!error}`, and
39
+ // a child prop only wins that merge when the KEY is present. So emit the key
40
+ // only for an explicit `true`, and let FormControl answer for every other
41
+ // case. `true || error` is true; `false || error` is whatever the form says,
42
+ // which is the whole point — an explicit `false` cannot mute a live error.
43
+ // With no `control` there is no error to OR against, so FormControl injects
44
+ // `false` and today's behaviour is unchanged.
45
+ const ariaInvalidProp = ariaInvalid ? { 'aria-invalid': true } : undefined;
46
+ const formRef = (0, react_1.useRef)(undefined);
47
+ const composedRef = (0, react_1.useMemo)(() => ref ? fanOutRef((node) => formRef.current?.(node), ref) : ref,
48
+ // `others.name` belongs here, and leaving it out is not a lint nit.
49
+ // react-hook-form hands a fresh `field.ref` for every name, and that ref
50
+ // only receives the element when React reattaches, which it does only when
51
+ // this callback's identity changes. Memoised on `ref` alone, one identity
52
+ // survived a name change, the new field never got its element, and
53
+ // `form.setFocus(newName)` then found nothing to focus and said nothing.
54
+ [ref, others.name]);
55
+ const renderItem = (binding) => ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [label && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : labelExtra, children: label })), (0, jsx_runtime_1.jsx)(form_1.FormControl, { children: textArea ? ((0, jsx_runtime_1.jsx)(autosize_textarea_1.AutosizeTextarea, { className: className, placeholder: placeholder, readOnly: readOnly, minHeight: minHeight, maxHeight: maxHeight, maxLength: maxLength, autoComplete: autoComplete, inputMode: inputMode, autoFocus: autoFocus, "data-testid": others['data-testid'], ...ariaInvalidProp, ...binding })) : ((0, jsx_runtime_1.jsx)(input_1.Input, { className: className, type: type, placeholder: placeholder, readOnly: readOnly, startAdornment: startAdornment, endAdornment: endAdornment,
56
+ // Bounds belong to the single-line control only: `min`/`max`/`step`
57
+ // mean nothing on a textarea and would render as invalid markup.
58
+ min: min, max: max, step: step, maxLength: maxLength, autoComplete: autoComplete, inputMode: inputMode,
59
+ // Single-line only: `<textarea pattern>` is not a thing.
60
+ pattern: pattern, autoFocus: autoFocus, "data-testid": others['data-testid'], ...ariaInvalidProp, ...binding })) }), (0, jsx_runtime_1.jsx)(form_1.FormMessage, {}), description && (0, jsx_runtime_1.jsx)(form_1.FormDescription, { children: description })] }));
10
61
  if (!others.control) {
11
62
  return renderItem({
12
63
  name: others.name,
@@ -14,7 +65,10 @@ const InputField = ({ className, type, label, tooltip, labelExtra, placeholder,
14
65
  // Controlled when the caller holds the value, uncontrolled when it only
15
66
  // seeds one — supplying both is what React warns about.
16
67
  ...(value !== undefined ? { value } : { defaultValue }),
17
- onChange: (e) => onChange?.(e)
68
+ onChange: (e) => onChange?.(e),
69
+ // Nothing else claims the node on this branch, so the consumer ref goes
70
+ // straight through. Without it there was no node to focus at all.
71
+ ref: ref
18
72
  });
19
73
  }
20
74
  return ((0, jsx_runtime_1.jsx)(form_1.FormField, { ...others, name: others.name,
@@ -22,17 +76,21 @@ const InputField = ({ className, type, label, tooltip, labelExtra, placeholder,
22
76
  // value painted on the box only makes the field LOOK filled while the
23
77
  // form still submits nothing for that name. Controller seeds its own
24
78
  // state from this, so `field.value` carries the seed on both branches.
25
- defaultValue: defaultValue, render: ({ field }) => renderItem({
26
- ...field,
27
- // Controlled from mount. react-hook-form hands `undefined` for any
28
- // name the form declares no default for; React then mounts the box
29
- // uncontrolled and flips it on the first keystroke, losing that
30
- // character.
31
- value: field.value ?? '',
32
- onChange: (e) => {
33
- field.onChange(e);
34
- onChange?.(e);
35
- }
36
- }) }));
79
+ defaultValue: defaultValue, render: ({ field }) => {
80
+ formRef.current = field.ref;
81
+ return renderItem({
82
+ ...field,
83
+ // Controlled from mount. react-hook-form hands `undefined` for any
84
+ // name the form declares no default for; React then mounts the box
85
+ // uncontrolled and flips it on the first keystroke, losing that
86
+ // character.
87
+ value: field.value ?? '',
88
+ onChange: (e) => {
89
+ field.onChange(e);
90
+ onChange?.(e);
91
+ },
92
+ ref: (ref ? composedRef : field.ref)
93
+ });
94
+ } }));
37
95
  };
38
96
  exports.InputField = InputField;
@@ -13,7 +13,15 @@ type SelectFieldSharedProps<T extends FieldValues = FieldValues> = PropsWithChil
13
13
  * with `value` + `onChange`. */
14
14
  control?: Control<T>;
15
15
  required?: boolean;
16
+ /** Copy for the "nothing to pick" row. Defaults to "No options found." */
16
17
  emptyMessage?: string;
18
+ /**
19
+ * Placed on the field's own root box, merged with its spacing rather than
20
+ * replacing it. The root is the element a parent grid positions, so
21
+ * without this a consumer had to wrap the field in a spare div just to
22
+ * span a column.
23
+ */
24
+ className?: string;
17
25
  'data-testid'?: string;
18
26
  };
19
27
  /**
@@ -39,6 +47,6 @@ type SelectFieldModeProps = {
39
47
  onChange?: (value: string) => void;
40
48
  };
41
49
  export type SelectFieldProps<T extends FieldValues = FieldValues> = SelectFieldSharedProps<T> & SelectFieldModeProps;
42
- export declare const SelectField: <T extends FieldValues = FieldValues>({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage, onChange, ...others }: SelectFieldProps<T>) => React.JSX.Element;
50
+ export declare const SelectField: <T extends FieldValues = FieldValues>({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage, className, onChange, ...others }: SelectFieldProps<T>) => React.JSX.Element;
43
51
  export {};
44
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/select-field/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EACL,OAAO,EAEP,WAAW,EAEZ,MAAM,iBAAiB,CAAA;AAExB,KAAK,sBAAsB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAC7D,iBAAiB,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;qCACiC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAEH;;;;;;;;GAQG;AACH,KAAK,oBAAoB,GACrB;IACE,KAAK,EAAE,IAAI,CAAA;IACX;yEACqE;IACrE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACrC,GACD;IACE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb;yEACqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,C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AA;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACrC,GACD;IACE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb;yEACqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC,CAAA;AAEL,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAC9D,sBAAsB,CAAC,CAAC,CAAC,GAAG,oBAAoB,CAAA;AAWlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,6KAkB9D,gBAAgB,CAAC,CAAC,CAAC,sBA6FrB,CAAA"}
@@ -6,14 +6,14 @@ const form_1 = require("../../../components/ui/form");
6
6
  const multiple_select_1 = require("../../../components/ui/multiple-select");
7
7
  const select_1 = require("../../../components/ui/select");
8
8
  const utils_1 = require("../../../lib/utils");
9
- const SelectField = ({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage = 'No options found.', onChange, ...others }) => {
9
+ const SelectField = ({ name, label, tooltip, labelExtra, required, placeholder, description, disabled, readOnly, multi, control, value, children, emptyMessage = 'No options found.', className, onChange, ...others }) => {
10
10
  // The props union already pairs `multi` with the callback shape that branch
11
11
  // emits, but destructuring an intersection loses that correlation — TS sees
12
12
  // two unrelated callbacks. Both branches report through this one seam, each
13
13
  // with the payload its own union member declared.
14
14
  const emitChange = onChange;
15
15
  const renderItem = (field) => {
16
- return ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, children: [label && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : labelExtra, children: label })), multi ? ((0, jsx_runtime_1.jsxs)(multiple_select_1.MultipleSelect, { onValueChange: (value) => {
16
+ return ((0, jsx_runtime_1.jsxs)(form_1.FormItem, { required: required, className: className, children: [label && ((0, jsx_runtime_1.jsx)(form_1.FormLabel, { extra: tooltip ? (0, jsx_runtime_1.jsx)(form_1.FormTooltip, { children: tooltip }) : labelExtra, children: label })), multi ? ((0, jsx_runtime_1.jsxs)(multiple_select_1.MultipleSelect, { onValueChange: (value) => {
17
17
  field.onChange(value);
18
18
  emitChange?.(value);
19
19
  }, disabled: disabled, ...field, children: [(0, jsx_runtime_1.jsx)(multiple_select_1.MultipleSelectTrigger, { readOnly: readOnly, children: (0, jsx_runtime_1.jsx)(multiple_select_1.MultipleSelectValue, { placeholder: placeholder }) }), (0, jsx_runtime_1.jsx)(multiple_select_1.MultipleSelectContent, { children: children })] })) : ((0, jsx_runtime_1.jsxs)(select_1.Select, { onValueChange: (value) => {
@@ -34,7 +34,12 @@
34
34
  }
35
35
 
36
36
  .button-plain {
37
- @apply bg-transparent text-inherit shadow-none hover:bg-black/5;
37
+ /* The dark counterpart is not optional: black/5 over a dark ground is
38
+ invisible, so the hover affordance simply vanished in dark mode. Same
39
+ /5-light, /10-dark pairing the kit already uses for translucent state
40
+ fills (`ui/field`: `has-data-checked:bg-primary/5
41
+ dark:has-data-checked:bg-primary/10`). */
42
+ @apply bg-transparent text-inherit shadow-none hover:bg-black/5 dark:hover:bg-white/10;
38
43
  }
39
44
 
40
45
  .button-primary {
@@ -63,6 +68,31 @@
63
68
  @apply !text-button-link !h-4 !p-0 !px-0 !py-0 underline shadow-none;
64
69
  }
65
70
 
71
+ /*
72
+ WCAG 2.5.8 (AA) asks a pointer target for 24 by 24 CSS px. This variant pins
73
+ its box at 16, and pins it with `!important` on the height and all three
74
+ padding axes — so unlike an ordinary too-small target, no consumer can
75
+ correct it at the call site. That is what makes it a library defect rather
76
+ than a call-site one; the 16px itself is not new.
77
+
78
+ The hit area grows instead of the box. `.button-base` is already
79
+ `position: relative`, so an inset pseudo-element takes the target to 24px
80
+ tall at zero layout cost: the element's own box, and every line box around
81
+ it, stay at 16. Growing the box was the alternative and it was rejected —
82
+ link buttons sit inside running text, where a taller box reflows the
83
+ sentence, and in table cells and filter bars, where it shifts the row.
84
+
85
+ Horizontal size is left to the label. SC 2.5.8 exempts a target whose size
86
+ is constrained by the line-height of the text around it, and stealing
87
+ horizontal space from adjacent words would take clicks that belong to them.
88
+
89
+ Overridable: Tailwind's `utilities` layer wins over `components`, so a
90
+ consumer that needs the band gone writes `before:inset-y-0`.
91
+ */
92
+ .button-link::before {
93
+ @apply absolute inset-x-0 -inset-y-1 content-[''];
94
+ }
95
+
66
96
  .button-disabled {
67
97
  @apply disabled:pointer-events-none disabled:border-transparent disabled:opacity-50 disabled:shadow-none;
68
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/calendar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,SAAS,EAET,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAE,MAAM,EAAkB,MAAM,wBAAwB,CAAA;AAO/D,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,UAAU,EACV,eAAsB,EACtB,aAAuB,EACvB,aAAuB,EACvB,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1C,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;CAC/D,qBA0JA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,qBAqCxC;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/calendar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,SAAS,EAGT,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAE,MAAM,EAAkB,MAAM,wBAAwB,CAAA;AAO/D,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,UAAU,EACV,eAAsB,EACtB,aAAuB,EACvB,aAAuB,EACvB,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1C,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;CAC/D,qBAgKA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,qBAqCxC;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAA"}
@@ -45,7 +45,13 @@ const lucide_react_1 = require("lucide-react");
45
45
  function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'plain', formatters, components, ...props }) {
46
46
  const defaultClassNames = (0, react_day_picker_1.getDefaultClassNames)();
47
47
  return ((0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { showOutsideDays: showOutsideDays, className: (0, utils_1.cn)('bg-background group/calendar p-2 [--cell-radius:var(--radius-md)] [--cell-size:34px] [--nav-size:28px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
48
- formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
48
+ // react-day-picker's own default is dateLib.format(month, 'LLLL'), the
49
+ // full month name in the locale it was given. Shortening it has to go
50
+ // through the same dateLib: Date.toLocaleString('default') reads the
51
+ // runtime locale instead, so the dropdown fell back to English while
52
+ // the weekdays and the caption around it stayed in the consumer's
53
+ // language. 'LLL' is the abbreviated form of the same standalone month.
54
+ formatMonthDropdown: (month, dateLib = react_day_picker_1.defaultDateLib) => dateLib.format(month, 'LLL'),
49
55
  ...formatters
50
56
  }, classNames: {
51
57
  root: (0, utils_1.cn)('w-fit', defaultClassNames.root),