@hjmds/react 0.8.2

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 (135) hide show
  1. package/README.md +146 -0
  2. package/dist/actions.d.ts +61 -0
  3. package/dist/actions.d.ts.map +1 -0
  4. package/dist/actions.js +54 -0
  5. package/dist/actions.js.map +1 -0
  6. package/dist/advanced-display.d.ts +133 -0
  7. package/dist/advanced-display.d.ts.map +1 -0
  8. package/dist/advanced-display.js +201 -0
  9. package/dist/advanced-display.js.map +1 -0
  10. package/dist/advanced-forms.d.ts +116 -0
  11. package/dist/advanced-forms.d.ts.map +1 -0
  12. package/dist/advanced-forms.js +234 -0
  13. package/dist/advanced-forms.js.map +1 -0
  14. package/dist/advanced-navigation.d.ts +24 -0
  15. package/dist/advanced-navigation.d.ts.map +1 -0
  16. package/dist/advanced-navigation.js +25 -0
  17. package/dist/advanced-navigation.js.map +1 -0
  18. package/dist/bottom-navigation.d.ts +37 -0
  19. package/dist/bottom-navigation.d.ts.map +1 -0
  20. package/dist/bottom-navigation.js +132 -0
  21. package/dist/bottom-navigation.js.map +1 -0
  22. package/dist/date-picker.d.ts +24 -0
  23. package/dist/date-picker.d.ts.map +1 -0
  24. package/dist/date-picker.js +81 -0
  25. package/dist/date-picker.js.map +1 -0
  26. package/dist/display-public.d.ts +5 -0
  27. package/dist/display-public.d.ts.map +1 -0
  28. package/dist/display-public.js +5 -0
  29. package/dist/display-public.js.map +1 -0
  30. package/dist/display.d.ts +77 -0
  31. package/dist/display.d.ts.map +1 -0
  32. package/dist/display.js +51 -0
  33. package/dist/display.js.map +1 -0
  34. package/dist/evidence.d.ts +940 -0
  35. package/dist/evidence.d.ts.map +1 -0
  36. package/dist/evidence.js +98 -0
  37. package/dist/evidence.js.map +1 -0
  38. package/dist/feedback.d.ts +89 -0
  39. package/dist/feedback.d.ts.map +1 -0
  40. package/dist/feedback.js +41 -0
  41. package/dist/feedback.js.map +1 -0
  42. package/dist/file-picker.d.ts +30 -0
  43. package/dist/file-picker.d.ts.map +1 -0
  44. package/dist/file-picker.js +40 -0
  45. package/dist/file-picker.js.map +1 -0
  46. package/dist/forms-public.d.ts +8 -0
  47. package/dist/forms-public.d.ts.map +1 -0
  48. package/dist/forms-public.js +8 -0
  49. package/dist/forms-public.js.map +1 -0
  50. package/dist/forms.d.ts +160 -0
  51. package/dist/forms.d.ts.map +1 -0
  52. package/dist/forms.js +178 -0
  53. package/dist/forms.js.map +1 -0
  54. package/dist/index.d.ts +24 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +24 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/internal.d.ts +17 -0
  59. package/dist/internal.d.ts.map +1 -0
  60. package/dist/internal.js +68 -0
  61. package/dist/internal.js.map +1 -0
  62. package/dist/layout.d.ts +134 -0
  63. package/dist/layout.d.ts.map +1 -0
  64. package/dist/layout.js +167 -0
  65. package/dist/layout.js.map +1 -0
  66. package/dist/navigation-public.d.ts +6 -0
  67. package/dist/navigation-public.d.ts.map +1 -0
  68. package/dist/navigation-public.js +6 -0
  69. package/dist/navigation-public.js.map +1 -0
  70. package/dist/navigation.d.ts +65 -0
  71. package/dist/navigation.d.ts.map +1 -0
  72. package/dist/navigation.js +196 -0
  73. package/dist/navigation.js.map +1 -0
  74. package/dist/number-field.d.ts +55 -0
  75. package/dist/number-field.d.ts.map +1 -0
  76. package/dist/number-field.js +107 -0
  77. package/dist/number-field.js.map +1 -0
  78. package/dist/otp-field.d.ts +2 -0
  79. package/dist/otp-field.d.ts.map +1 -0
  80. package/dist/otp-field.js +2 -0
  81. package/dist/otp-field.js.map +1 -0
  82. package/dist/overlays.d.ts +192 -0
  83. package/dist/overlays.d.ts.map +1 -0
  84. package/dist/overlays.js +949 -0
  85. package/dist/overlays.js.map +1 -0
  86. package/dist/password-field.d.ts +2 -0
  87. package/dist/password-field.d.ts.map +1 -0
  88. package/dist/password-field.js +2 -0
  89. package/dist/password-field.js.map +1 -0
  90. package/dist/portal.d.ts +32 -0
  91. package/dist/portal.d.ts.map +1 -0
  92. package/dist/portal.js +264 -0
  93. package/dist/portal.js.map +1 -0
  94. package/dist/provider.d.ts +38 -0
  95. package/dist/provider.d.ts.map +1 -0
  96. package/dist/provider.js +87 -0
  97. package/dist/provider.js.map +1 -0
  98. package/dist/select.d.ts +72 -0
  99. package/dist/select.d.ts.map +1 -0
  100. package/dist/select.js +353 -0
  101. package/dist/select.js.map +1 -0
  102. package/dist/selection.d.ts +160 -0
  103. package/dist/selection.d.ts.map +1 -0
  104. package/dist/selection.js +225 -0
  105. package/dist/selection.js.map +1 -0
  106. package/dist/slider.d.ts +35 -0
  107. package/dist/slider.d.ts.map +1 -0
  108. package/dist/slider.js +150 -0
  109. package/dist/slider.js.map +1 -0
  110. package/dist/steps.d.ts +29 -0
  111. package/dist/steps.d.ts.map +1 -0
  112. package/dist/steps.js +10 -0
  113. package/dist/steps.js.map +1 -0
  114. package/dist/styles.css +1349 -0
  115. package/dist/supplemental-display.d.ts +59 -0
  116. package/dist/supplemental-display.d.ts.map +1 -0
  117. package/dist/supplemental-display.js +136 -0
  118. package/dist/supplemental-display.js.map +1 -0
  119. package/dist/supplemental-navigation.d.ts +28 -0
  120. package/dist/supplemental-navigation.d.ts.map +1 -0
  121. package/dist/supplemental-navigation.js +106 -0
  122. package/dist/supplemental-navigation.js.map +1 -0
  123. package/dist/theme.d.ts +5 -0
  124. package/dist/theme.d.ts.map +1 -0
  125. package/dist/theme.js +55 -0
  126. package/dist/theme.js.map +1 -0
  127. package/dist/toast.d.ts +41 -0
  128. package/dist/toast.d.ts.map +1 -0
  129. package/dist/toast.js +250 -0
  130. package/dist/toast.js.map +1 -0
  131. package/dist/upload-item.d.ts +18 -0
  132. package/dist/upload-item.d.ts.map +1 -0
  133. package/dist/upload-item.js +19 -0
  134. package/dist/upload-item.js.map +1 -0
  135. package/package.json +151 -0
@@ -0,0 +1,160 @@
1
+ import { type FieldShape, type FieldVariant } from "@hjmds/design-contracts/recipes/base";
2
+ import { type SearchFieldSize } from "@hjmds/design-contracts/recipes";
3
+ import { type PasswordFieldAutofillHint, type PasswordFieldSize } from "@hjmds/design-contracts/components/password-field";
4
+ import { type OtpFieldSize } from "@hjmds/design-contracts/components/otp-field";
5
+ import { type HTMLAttributes, type InputHTMLAttributes, type ReactNode, type TextareaHTMLAttributes } from "react";
6
+ type FieldCopyProps = Readonly<{
7
+ label?: ReactNode;
8
+ description?: ReactNode;
9
+ error?: ReactNode;
10
+ required?: boolean;
11
+ }>;
12
+ type FieldFrameProps = HTMLAttributes<HTMLDivElement> & FieldCopyProps & Readonly<{
13
+ controlId: string;
14
+ descriptionId?: string;
15
+ errorId?: string;
16
+ disabled?: boolean;
17
+ focused?: boolean;
18
+ variant?: FieldVariant;
19
+ shape?: FieldShape;
20
+ children: ReactNode;
21
+ }>;
22
+ export type FieldControlProps = Readonly<{
23
+ id: string;
24
+ required: boolean;
25
+ disabled: boolean;
26
+ "aria-invalid"?: true;
27
+ "aria-describedby"?: string;
28
+ }>;
29
+ export type FieldProps = Omit<FieldFrameProps, "children" | "descriptionId" | "errorId"> & Readonly<{
30
+ label: ReactNode;
31
+ children: ReactNode | ((props: FieldControlProps) => ReactNode);
32
+ }>;
33
+ /** Generic frame for custom native controls; `controlId` keeps the label explicit. */
34
+ export declare function Field({ controlId, description, error, required, disabled, children, ...props }: FieldProps): import("react").JSX.Element;
35
+ type SharedInputProps = FieldCopyProps & Readonly<{
36
+ variant?: FieldVariant;
37
+ shape?: FieldShape;
38
+ leading?: ReactNode;
39
+ trailing?: ReactNode;
40
+ fieldClassName?: string;
41
+ }>;
42
+ export type TextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & SharedInputProps;
43
+ export declare const TextField: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & Readonly<{
44
+ label?: ReactNode;
45
+ description?: ReactNode;
46
+ error?: ReactNode;
47
+ required?: boolean;
48
+ }> & Readonly<{
49
+ variant?: FieldVariant;
50
+ shape?: FieldShape;
51
+ leading?: ReactNode;
52
+ trailing?: ReactNode;
53
+ fieldClassName?: string;
54
+ }> & import("react").RefAttributes<HTMLInputElement>>;
55
+ export type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & Omit<SharedInputProps, "leading" | "trailing">;
56
+ export declare const TextArea: import("react").ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & Omit<SharedInputProps, "leading" | "trailing"> & import("react").RefAttributes<HTMLTextAreaElement>>;
57
+ export type SearchFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "defaultValue"> & SharedInputProps & Readonly<{
58
+ value?: string;
59
+ defaultValue?: string;
60
+ onValueChange?: (value: string) => void;
61
+ size?: SearchFieldSize;
62
+ /** Localized accessible name for the clear action. */
63
+ clearLabel: string;
64
+ onClear?: () => void;
65
+ /** Keeps the input mounted and named while replacing trailing actions with progress. */
66
+ loading?: boolean;
67
+ /** Product icon adapter; the renderer owns size and inherited color. */
68
+ renderSearchIcon?: (props: SearchFieldIconRenderProps) => ReactNode;
69
+ /** Product icon adapter for the clear action. */
70
+ renderClearIcon?: (props: SearchFieldIconRenderProps) => ReactNode;
71
+ /** Optional progress adapter. The default is the canonical CSS spinner. */
72
+ renderLoadingIndicator?: (props: SearchFieldIconRenderProps) => ReactNode;
73
+ }>;
74
+ export type SearchFieldIconRenderProps = Readonly<{
75
+ color: "currentColor";
76
+ size: number;
77
+ }>;
78
+ export declare const SearchField: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "type" | "size"> & Readonly<{
79
+ label?: ReactNode;
80
+ description?: ReactNode;
81
+ error?: ReactNode;
82
+ required?: boolean;
83
+ }> & Readonly<{
84
+ variant?: FieldVariant;
85
+ shape?: FieldShape;
86
+ leading?: ReactNode;
87
+ trailing?: ReactNode;
88
+ fieldClassName?: string;
89
+ }> & Readonly<{
90
+ value?: string;
91
+ defaultValue?: string;
92
+ onValueChange?: (value: string) => void;
93
+ size?: SearchFieldSize;
94
+ /** Localized accessible name for the clear action. */
95
+ clearLabel: string;
96
+ onClear?: () => void;
97
+ /** Keeps the input mounted and named while replacing trailing actions with progress. */
98
+ loading?: boolean;
99
+ /** Product icon adapter; the renderer owns size and inherited color. */
100
+ renderSearchIcon?: (props: SearchFieldIconRenderProps) => ReactNode;
101
+ /** Product icon adapter for the clear action. */
102
+ renderClearIcon?: (props: SearchFieldIconRenderProps) => ReactNode;
103
+ /** Optional progress adapter. The default is the canonical CSS spinner. */
104
+ renderLoadingIndicator?: (props: SearchFieldIconRenderProps) => ReactNode;
105
+ }> & import("react").RefAttributes<HTMLInputElement>>;
106
+ export type PasswordFieldToggleRenderProps = Readonly<{
107
+ name: "visibility" | "visibilityOff";
108
+ color: "currentColor";
109
+ size: number;
110
+ revealed: boolean;
111
+ disabled: boolean;
112
+ }>;
113
+ export type PasswordFieldProps = Omit<TextFieldProps, "autoComplete" | "defaultValue" | "size" | "trailing" | "type" | "value"> & Readonly<{
114
+ value?: string;
115
+ defaultValue?: string;
116
+ onValueChange?: (value: string) => void;
117
+ revealed?: boolean;
118
+ defaultRevealed?: boolean;
119
+ onRevealedChange?: (revealed: boolean) => void;
120
+ autofillHint: PasswordFieldAutofillHint;
121
+ revealLabel: string;
122
+ concealLabel: string;
123
+ size?: PasswordFieldSize;
124
+ renderToggleIcon?: (props: PasswordFieldToggleRenderProps) => ReactNode;
125
+ }>;
126
+ /** Password input with an independently controlled, selection-safe reveal action. */
127
+ export declare const PasswordField: import("react").ForwardRefExoticComponent<Omit<TextFieldProps, "value" | "defaultValue" | "type" | "size" | "trailing" | "autoComplete"> & Readonly<{
128
+ value?: string;
129
+ defaultValue?: string;
130
+ onValueChange?: (value: string) => void;
131
+ revealed?: boolean;
132
+ defaultRevealed?: boolean;
133
+ onRevealedChange?: (revealed: boolean) => void;
134
+ autofillHint: PasswordFieldAutofillHint;
135
+ revealLabel: string;
136
+ concealLabel: string;
137
+ size?: PasswordFieldSize;
138
+ renderToggleIcon?: (props: PasswordFieldToggleRenderProps) => ReactNode;
139
+ }> & import("react").RefAttributes<HTMLInputElement>>;
140
+ export type OtpFieldProps = Omit<TextFieldProps, "autoComplete" | "defaultValue" | "leading" | "maxLength" | "shape" | "size" | "trailing" | "type" | "value" | "variant"> & Readonly<{
141
+ length: number;
142
+ value?: string;
143
+ defaultValue?: string;
144
+ onValueChange?: (value: string) => void;
145
+ onComplete?: (value: string) => void;
146
+ size?: OtpFieldSize;
147
+ busy?: boolean;
148
+ }>;
149
+ /** One accessible numeric input rendered as decorative OTP slots. */
150
+ export declare const OtpField: import("react").ForwardRefExoticComponent<Omit<TextFieldProps, "value" | "defaultValue" | "type" | "variant" | "size" | "leading" | "trailing" | "shape" | "autoComplete" | "maxLength"> & Readonly<{
151
+ length: number;
152
+ value?: string;
153
+ defaultValue?: string;
154
+ onValueChange?: (value: string) => void;
155
+ onComplete?: (value: string) => void;
156
+ size?: OtpFieldSize;
157
+ busy?: boolean;
158
+ }> & import("react").RefAttributes<HTMLInputElement>>;
159
+ export {};
160
+ //# sourceMappingURL=forms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../src/forms.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AAGf,KAAK,cAAc,GAAG,QAAQ,CAAC;IAC7B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;oBACL,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;iBAC1B,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;WAC7B,YAAY;WACZ,OAAO;qDA+HjB,CAAC"}
package/dist/forms.js ADDED
@@ -0,0 +1,178 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { fieldRecipe, } from "@hjmds/design-contracts/recipes/base";
3
+ import { iconRecipe, searchFieldRecipe, } from "@hjmds/design-contracts/recipes";
4
+ import { passwordFieldRecipe, resolvePasswordFieldDescriptor, } from "@hjmds/design-contracts/components/password-field";
5
+ import { getOtpFieldSlotValues, otpFieldRecipe, resolveOtpFieldValue, } from "@hjmds/design-contracts/components/otp-field";
6
+ import { forwardRef, useEffect, useId, useLayoutEffect, useRef, useState, } from "react";
7
+ import { composeRefs, classNames, useControllableState } from "./internal.js";
8
+ function FieldFrame({ controlId, label, description, error, descriptionId, errorId, required = false, disabled = false, focused = false, variant = fieldRecipe.defaults.variant, shape = fieldRecipe.defaults.shape, className, children, ...props }) {
9
+ const state = disabled ? "disabled" : error ? "invalid" : focused ? "focused" : "idle";
10
+ return (_jsxs("div", { ...props, className: classNames("hjm-field", className), "data-state": state, "data-variant": variant, "data-shape": shape, children: [label !== undefined && label !== null ? (_jsxs("label", { className: "hjm-field__label", htmlFor: controlId, children: [label, required ? _jsx("span", { "aria-hidden": "true", children: " *" }) : null] })) : null, children, description && !error ? (_jsx("div", { id: descriptionId, className: "hjm-field__description", children: description })) : null, error ? (_jsx("div", { id: errorId, className: "hjm-field__error", children: error })) : null] }));
11
+ }
12
+ /** Generic frame for custom native controls; `controlId` keeps the label explicit. */
13
+ export function Field({ controlId, description, error, required = false, disabled = false, children, ...props }) {
14
+ const descriptionId = `${controlId}-description`;
15
+ const errorId = `${controlId}-error`;
16
+ const controlProps = {
17
+ id: controlId,
18
+ required,
19
+ disabled,
20
+ ...(error ? { "aria-invalid": true } : {}),
21
+ ...(error
22
+ ? { "aria-describedby": errorId }
23
+ : description
24
+ ? { "aria-describedby": descriptionId }
25
+ : {}),
26
+ };
27
+ return (_jsx(FieldFrame, { ...props, controlId: controlId, description: description, error: error, required: required, disabled: disabled, ...(description ? { descriptionId } : {}), ...(error ? { errorId } : {}), children: typeof children === "function" ? children(controlProps) : children }));
28
+ }
29
+ function useFieldIds(id) {
30
+ const generatedId = useId();
31
+ const controlId = id ?? `hjm-${generatedId.replaceAll(":", "")}`;
32
+ return {
33
+ controlId,
34
+ descriptionId: `${controlId}-description`,
35
+ errorId: `${controlId}-error`,
36
+ };
37
+ }
38
+ function describedBy(own, description, error, descriptionId, errorId) {
39
+ return [own, error ? errorId : description ? descriptionId : undefined]
40
+ .filter(Boolean)
41
+ .join(" ") || undefined;
42
+ }
43
+ function requireFieldAccessibleName(label, ariaLabel) {
44
+ if ((label === undefined || label === null) && !ariaLabel?.trim()) {
45
+ throw new TypeError("Field controls require either label or aria-label");
46
+ }
47
+ }
48
+ export const TextField = forwardRef(function TextField({ id, label, description, error, required, disabled, variant, shape, leading, trailing, fieldClassName, className, onFocus, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, ...props }, ref) {
49
+ const ids = useFieldIds(id);
50
+ const [focused, setFocused] = useState(false);
51
+ requireFieldAccessibleName(label, ariaLabel);
52
+ const handleFocus = (event) => {
53
+ setFocused(true);
54
+ onFocus?.(event);
55
+ };
56
+ const handleBlur = (event) => {
57
+ setFocused(false);
58
+ onBlur?.(event);
59
+ };
60
+ return (_jsx(FieldFrame, { controlId: ids.controlId, label: label, description: description, error: error, required: required ?? false, disabled: disabled ?? false, focused: focused, variant: variant ?? fieldRecipe.defaults.variant, shape: shape ?? fieldRecipe.defaults.shape, className: fieldClassName, ...(description ? { descriptionId: ids.descriptionId } : {}), ...(error ? { errorId: ids.errorId } : {}), children: _jsxs("div", { className: "hjm-field__control", children: [leading ? _jsx("span", { className: "hjm-field__affix", children: leading }) : null, _jsx("input", { ...props, ref: ref, id: ids.controlId, className: classNames("hjm-field__input", className), required: required, disabled: disabled, "aria-invalid": error ? true : ariaInvalid, "aria-label": ariaLabel, "aria-describedby": describedBy(ariaDescribedBy, description, error, ids.descriptionId, ids.errorId), onFocus: handleFocus, onBlur: handleBlur }), trailing ? _jsx("span", { className: "hjm-field__affix", children: trailing }) : null] }) }));
61
+ });
62
+ export const TextArea = forwardRef(function TextArea({ id, label, description, error, required, disabled, variant, shape, fieldClassName, className, onFocus, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, ...props }, ref) {
63
+ const ids = useFieldIds(id);
64
+ const [focused, setFocused] = useState(false);
65
+ requireFieldAccessibleName(label, ariaLabel);
66
+ return (_jsx(FieldFrame, { controlId: ids.controlId, label: label, description: description, error: error, required: required ?? false, disabled: disabled ?? false, focused: focused, variant: variant ?? fieldRecipe.defaults.variant, shape: shape ?? fieldRecipe.defaults.shape, className: fieldClassName, ...(description ? { descriptionId: ids.descriptionId } : {}), ...(error ? { errorId: ids.errorId } : {}), children: _jsx("div", { className: "hjm-field__control hjm-field__control--multiline", children: _jsx("textarea", { ...props, ref: ref, id: ids.controlId, className: classNames("hjm-field__input", className), required: required, disabled: disabled, "aria-invalid": error ? true : ariaInvalid, "aria-label": ariaLabel, "aria-describedby": describedBy(ariaDescribedBy, description, error, ids.descriptionId, ids.errorId), onFocus: (event) => {
67
+ setFocused(true);
68
+ onFocus?.(event);
69
+ }, onBlur: (event) => {
70
+ setFocused(false);
71
+ onBlur?.(event);
72
+ } }) }) }));
73
+ });
74
+ export const SearchField = forwardRef(function SearchField({ value: valueProp, defaultValue = "", onValueChange, onChange, size = searchFieldRecipe.defaults.size, clearLabel, onClear, loading = false, renderSearchIcon, renderClearIcon, renderLoadingIndicator, leading, trailing, fieldClassName, disabled, "aria-busy": ariaBusy, ...props }, forwardedRef) {
75
+ const [value, setValue] = useControllableState({
76
+ ...(valueProp === undefined ? {} : { value: valueProp }),
77
+ defaultValue,
78
+ ...(onValueChange === undefined ? {} : { onChange: onValueChange }),
79
+ });
80
+ const inputRef = useRef(null);
81
+ const iconAppearance = {
82
+ color: "currentColor",
83
+ size: iconRecipe.sizes[searchFieldRecipe.sizes[size].glyph],
84
+ };
85
+ const canClear = value.length > 0 && !disabled;
86
+ return (_jsx(TextField, { ...props, ref: composeRefs(inputRef, forwardedRef), type: "search", value: value, "data-size": size, "data-loading": loading || undefined, disabled: disabled, "aria-busy": loading || ariaBusy || undefined, fieldClassName: classNames("hjm-search-field", fieldClassName), leading: leading ?? (renderSearchIcon ? renderSearchIcon(iconAppearance) : undefined), onChange: (event) => {
87
+ setValue(event.currentTarget.value);
88
+ onChange?.(event);
89
+ }, trailing: loading ? (_jsx("span", { className: "hjm-search-field__spinner", "aria-hidden": "true", children: renderLoadingIndicator?.(iconAppearance) })) : canClear ? (_jsx("button", { type: "button", className: "hjm-search-field__clear", "aria-label": clearLabel, onMouseDown: (event) => event.preventDefault(), onClick: () => {
90
+ setValue("");
91
+ onClear?.();
92
+ inputRef.current?.focus();
93
+ }, children: renderClearIcon?.(iconAppearance) ?? "×" })) : trailing }));
94
+ });
95
+ /** Password input with an independently controlled, selection-safe reveal action. */
96
+ export const PasswordField = forwardRef(function PasswordField({ value: valueProp, defaultValue = "", onValueChange, onChange, revealed: revealedProp, defaultRevealed = false, onRevealedChange, autofillHint, revealLabel, concealLabel, size = passwordFieldRecipe.defaults.size, renderToggleIcon, fieldClassName, className, disabled, readOnly, ...props }, forwardedRef) {
97
+ const [value, setValue] = useControllableState({
98
+ ...(valueProp === undefined ? {} : { value: valueProp }),
99
+ defaultValue,
100
+ ...(onValueChange === undefined ? {} : { onChange: onValueChange }),
101
+ });
102
+ const [revealed, setRevealed] = useControllableState({
103
+ ...(revealedProp === undefined ? {} : { value: revealedProp }),
104
+ defaultValue: defaultRevealed,
105
+ ...(onRevealedChange === undefined ? {} : { onChange: onRevealedChange }),
106
+ });
107
+ const resolved = resolvePasswordFieldDescriptor({ revealed, autofillHint }, {
108
+ composeToggleAccessibleName: ({ willReveal }) => willReveal ? revealLabel : concealLabel,
109
+ });
110
+ const inputRef = useRef(null);
111
+ const selectionRef = useRef(null);
112
+ useLayoutEffect(() => {
113
+ const selection = selectionRef.current;
114
+ if (!selection || !inputRef.current)
115
+ return;
116
+ inputRef.current.setSelectionRange(selection.start, selection.end);
117
+ selectionRef.current = null;
118
+ }, [revealed]);
119
+ const toggleAppearance = {
120
+ name: revealed
121
+ ? passwordFieldRecipe.toggle.icons.revealed
122
+ : passwordFieldRecipe.toggle.icons.concealed,
123
+ color: "currentColor",
124
+ size: iconRecipe.sizes.sm,
125
+ revealed,
126
+ disabled: disabled ?? false,
127
+ };
128
+ return (_jsx(TextField, { ...props, ref: composeRefs(inputRef, forwardedRef), autoComplete: autofillHint === "current" ? "current-password" : "new-password", className: classNames("hjm-password-field__input", className), disabled: disabled, fieldClassName: classNames("hjm-password-field", `hjm-password-field--${size}`, fieldClassName), onChange: (event) => {
129
+ setValue(event.currentTarget.value);
130
+ onChange?.(event);
131
+ }, readOnly: readOnly, trailing: (_jsx("button", { "aria-label": resolved.toggleAccessibleName, "aria-pressed": revealed, className: "hjm-password-field__toggle", "data-revealed": revealed || undefined, disabled: disabled, onClick: () => {
132
+ const input = inputRef.current;
133
+ if (input && input.selectionStart !== null && input.selectionEnd !== null) {
134
+ selectionRef.current = {
135
+ start: input.selectionStart,
136
+ end: input.selectionEnd,
137
+ };
138
+ }
139
+ setRevealed(!revealed);
140
+ }, type: "button", children: renderToggleIcon?.(toggleAppearance) ?? _jsx("span", { "aria-hidden": "true" }) })), type: resolved.webInputType, value: value }));
141
+ });
142
+ /** One accessible numeric input rendered as decorative OTP slots. */
143
+ export const OtpField = forwardRef(function OtpField({ id, label, description, error, required, disabled, readOnly, busy = false, length, value: valueProp, defaultValue = "", onValueChange, onComplete, onChange, size = otpFieldRecipe.defaults.size, fieldClassName, className, onFocus, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, ...props }, ref) {
144
+ const ids = useFieldIds(id);
145
+ const [focused, setFocused] = useState(false);
146
+ requireFieldAccessibleName(label, ariaLabel);
147
+ const [value, setValue] = useControllableState({
148
+ ...(valueProp === undefined ? {} : { value: valueProp }),
149
+ defaultValue: resolveOtpFieldValue(length, defaultValue),
150
+ ...(onValueChange === undefined ? {} : { onChange: onValueChange }),
151
+ });
152
+ const slots = getOtpFieldSlotValues({ length, value });
153
+ const complete = value.length === length;
154
+ const wasCompleteRef = useRef(complete);
155
+ useEffect(() => {
156
+ if (complete && !wasCompleteRef.current)
157
+ onComplete?.(value);
158
+ wasCompleteRef.current = complete;
159
+ }, [complete, onComplete, value]);
160
+ const activeIndex = Math.min(value.length, length - 1);
161
+ return (_jsx(FieldFrame, { className: classNames("hjm-otp-field", fieldClassName), controlId: ids.controlId, description: description, disabled: (disabled ?? false) || busy, error: error, focused: focused, label: label, required: required ?? false, ...(description ? { descriptionId: ids.descriptionId } : {}), ...(error ? { errorId: ids.errorId } : {}), children: _jsxs("div", { className: "hjm-otp-field__control", "data-complete": complete || undefined, "data-size": size, style: { "--hjm-otp-length": length }, children: [_jsx("input", { ...props, ref: ref, "aria-busy": busy || undefined, "aria-describedby": describedBy(ariaDescribedBy, description, error, ids.descriptionId, ids.errorId), "aria-invalid": error ? true : ariaInvalid, "aria-label": ariaLabel, autoComplete: "one-time-code", className: classNames("hjm-otp-field__input", className), disabled: disabled || busy, id: ids.controlId, inputMode: "numeric", maxLength: length, onBlur: (event) => {
162
+ setFocused(false);
163
+ onBlur?.(event);
164
+ }, onChange: (event) => {
165
+ setValue(resolveOtpFieldValue(length, event.currentTarget.value));
166
+ onChange?.(event);
167
+ }, onFocus: (event) => {
168
+ setFocused(true);
169
+ onFocus?.(event);
170
+ }, pattern: "[0-9]*", readOnly: readOnly, required: required, type: "text", value: value }), _jsx("div", { "aria-hidden": "true", className: "hjm-otp-field__slots", children: slots.map((digit, index) => (_jsx("span", { className: "hjm-otp-field__slot", "data-state": error
171
+ ? "invalid"
172
+ : focused && index === activeIndex
173
+ ? "focused"
174
+ : digit
175
+ ? "filled"
176
+ : "idle", children: digit }, index))) })] }) }));
177
+ });
178
+ //# sourceMappingURL=forms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.js","sourceRoot":"","sources":["../src/forms.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,GAGZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,iBAAiB,GAElB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,8BAA8B,GAG/B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,oBAAoB,GAErB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,UAAU,EACV,SAAS,EACT,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,GAOT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAsB9E,SAAS,UAAU,CAAC,EAClB,SAAS,EACT,KAAK,EACL,WAAW,EACX,KAAK,EACL,aAAa,EACb,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,OAAO,EACtC,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAK,EAClC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACQ;IAChB,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACvF,OAAO,CACL,kBACM,KAAK,EACT,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,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,KAAK,EAAE,EAAE;wBAClB,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;wBAClE,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;oBACpB,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wBACjB,UAAU,CAAC,IAAI,CAAC,CAAC;wBACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;oBACnB,CAAC,EACD,OAAO,EAAC,QAAQ,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,GACZ,EACF,6BAAiB,MAAM,EAAC,SAAS,EAAC,sBAAsB,YACrD,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3B,eACE,SAAS,EAAC,qBAAqB,gBACnB,KAAK;4BACf,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,OAAO,IAAI,KAAK,KAAK,WAAW;gCAChC,CAAC,CAAC,SAAS;gCACX,CAAC,CAAC,KAAK;oCACL,CAAC,CAAC,QAAQ;oCACV,CAAC,CAAC,MAAM,YAGb,KAAK,IAFD,KAAK,CAGL,CACR,CAAC,GACE,IACF,GACK,CACd,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n fieldRecipe,\n type FieldShape,\n type FieldVariant,\n} from \"@hjmds/design-contracts/recipes/base\";\nimport {\n iconRecipe,\n searchFieldRecipe,\n type SearchFieldSize,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n passwordFieldRecipe,\n resolvePasswordFieldDescriptor,\n type PasswordFieldAutofillHint,\n type PasswordFieldSize,\n} from \"@hjmds/design-contracts/components/password-field\";\nimport {\n getOtpFieldSlotValues,\n otpFieldRecipe,\n resolveOtpFieldValue,\n type OtpFieldSize,\n} from \"@hjmds/design-contracts/components/otp-field\";\nimport {\n forwardRef,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type ReactNode,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport { composeRefs, classNames, useControllableState } from \"./internal.js\";\n\ntype FieldCopyProps = Readonly<{\n label?: ReactNode;\n description?: ReactNode;\n error?: ReactNode;\n required?: boolean;\n}>;\n\ntype FieldFrameProps = HTMLAttributes<HTMLDivElement> &\n FieldCopyProps &\n Readonly<{\n controlId: string;\n descriptionId?: string;\n errorId?: string;\n disabled?: boolean;\n focused?: boolean;\n variant?: FieldVariant;\n shape?: FieldShape;\n children: ReactNode;\n }>;\n\nfunction FieldFrame({\n controlId,\n label,\n description,\n error,\n descriptionId,\n errorId,\n required = false,\n disabled = false,\n focused = false,\n variant = fieldRecipe.defaults.variant,\n shape = fieldRecipe.defaults.shape,\n className,\n children,\n ...props\n}: FieldFrameProps) {\n const state = disabled ? \"disabled\" : error ? \"invalid\" : focused ? \"focused\" : \"idle\";\n return (\n <div\n {...props}\n className={classNames(\"hjm-field\", className)}\n data-state={state}\n data-variant={variant}\n data-shape={shape}\n >\n {label !== undefined && label !== null ? (\n <label className=\"hjm-field__label\" htmlFor={controlId}>\n {label}\n {required ? <span aria-hidden=\"true\"> *</span> : null}\n </label>\n ) : null}\n {children}\n {description && !error ? (\n <div id={descriptionId} className=\"hjm-field__description\">\n {description}\n </div>\n ) : null}\n {error ? (\n <div id={errorId} className=\"hjm-field__error\">\n {error}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport type FieldControlProps = Readonly<{\n id: string;\n required: boolean;\n disabled: boolean;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n}>;\n\nexport type FieldProps = Omit<\n FieldFrameProps,\n \"children\" | \"descriptionId\" | \"errorId\"\n> &\n Readonly<{\n label: ReactNode;\n children: ReactNode | ((props: FieldControlProps) => ReactNode);\n }>;\n\n/** Generic frame for custom native controls; `controlId` keeps the label explicit. */\nexport function Field({\n controlId,\n description,\n error,\n required = false,\n disabled = false,\n children,\n ...props\n}: FieldProps) {\n const descriptionId = `${controlId}-description`;\n const errorId = `${controlId}-error`;\n const controlProps: FieldControlProps = {\n id: controlId,\n required,\n disabled,\n ...(error ? { \"aria-invalid\": true as const } : {}),\n ...(error\n ? { \"aria-describedby\": errorId }\n : description\n ? { \"aria-describedby\": descriptionId }\n : {}),\n };\n return (\n <FieldFrame\n {...props}\n controlId={controlId}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n {...(description ? { descriptionId } : {})}\n {...(error ? { errorId } : {})}\n >\n {typeof children === \"function\" ? children(controlProps) : children}\n </FieldFrame>\n );\n}\n\nfunction useFieldIds(id: string | undefined) {\n const generatedId = useId();\n const controlId = id ?? `hjm-${generatedId.replaceAll(\":\", \"\")}`;\n return {\n controlId,\n descriptionId: `${controlId}-description`,\n errorId: `${controlId}-error`,\n } as const;\n}\n\nfunction describedBy(\n own: string | undefined,\n description: ReactNode | undefined,\n error: ReactNode | undefined,\n descriptionId: string,\n errorId: string,\n): string | undefined {\n return [own, error ? errorId : description ? descriptionId : undefined]\n .filter(Boolean)\n .join(\" \") || undefined;\n}\n\nfunction requireFieldAccessibleName(label: ReactNode | undefined, ariaLabel: string | undefined) {\n if ((label === undefined || label === null) && !ariaLabel?.trim()) {\n throw new TypeError(\"Field controls require either label or aria-label\");\n }\n}\n\ntype SharedInputProps = FieldCopyProps &\n Readonly<{\n variant?: FieldVariant;\n shape?: FieldShape;\n leading?: ReactNode;\n trailing?: ReactNode;\n fieldClassName?: string;\n }>;\n\nexport type TextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> &\n SharedInputProps;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n variant,\n shape,\n leading,\n trailing,\n fieldClassName,\n className,\n onFocus,\n onBlur,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n return (\n <FieldFrame\n controlId={ids.controlId}\n label={label}\n description={description}\n error={error}\n required={required ?? false}\n disabled={disabled ?? false}\n focused={focused}\n variant={variant ?? fieldRecipe.defaults.variant}\n shape={shape ?? fieldRecipe.defaults.shape}\n className={fieldClassName}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div className=\"hjm-field__control\">\n {leading ? <span className=\"hjm-field__affix\">{leading}</span> : null}\n <input\n {...props}\n ref={ref}\n id={ids.controlId}\n className={classNames(\"hjm-field__input\", className)}\n required={required}\n disabled={disabled}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n {trailing ? <span className=\"hjm-field__affix\">{trailing}</span> : null}\n </div>\n </FieldFrame>\n );\n },\n);\n\nexport type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> &\n Omit<SharedInputProps, \"leading\" | \"trailing\">;\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n variant,\n shape,\n fieldClassName,\n className,\n onFocus,\n onBlur,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n return (\n <FieldFrame\n controlId={ids.controlId}\n label={label}\n description={description}\n error={error}\n required={required ?? false}\n disabled={disabled ?? false}\n focused={focused}\n variant={variant ?? fieldRecipe.defaults.variant}\n shape={shape ?? fieldRecipe.defaults.shape}\n className={fieldClassName}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div className=\"hjm-field__control hjm-field__control--multiline\">\n <textarea\n {...props}\n ref={ref}\n id={ids.controlId}\n className={classNames(\"hjm-field__input\", className)}\n required={required}\n disabled={disabled}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n />\n </div>\n </FieldFrame>\n );\n },\n);\n\nexport type SearchFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"value\" | \"defaultValue\"\n> &\n SharedInputProps &\n Readonly<{\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n size?: SearchFieldSize;\n /** Localized accessible name for the clear action. */\n clearLabel: string;\n onClear?: () => void;\n /** Keeps the input mounted and named while replacing trailing actions with progress. */\n loading?: boolean;\n /** Product icon adapter; the renderer owns size and inherited color. */\n renderSearchIcon?: (props: SearchFieldIconRenderProps) => ReactNode;\n /** Product icon adapter for the clear action. */\n renderClearIcon?: (props: SearchFieldIconRenderProps) => ReactNode;\n /** Optional progress adapter. The default is the canonical CSS spinner. */\n renderLoadingIndicator?: (props: SearchFieldIconRenderProps) => ReactNode;\n }>;\n\nexport type SearchFieldIconRenderProps = Readonly<{\n color: \"currentColor\";\n size: number;\n}>;\n\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n function SearchField(\n {\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onChange,\n size = searchFieldRecipe.defaults.size,\n clearLabel,\n onClear,\n loading = false,\n renderSearchIcon,\n renderClearIcon,\n renderLoadingIndicator,\n leading,\n trailing,\n fieldClassName,\n disabled,\n \"aria-busy\": ariaBusy,\n ...props\n },\n forwardedRef,\n ) {\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const inputRef = useRef<HTMLInputElement>(null);\n const iconAppearance: SearchFieldIconRenderProps = {\n color: \"currentColor\",\n size: iconRecipe.sizes[searchFieldRecipe.sizes[size].glyph],\n };\n const canClear = value.length > 0 && !disabled;\n return (\n <TextField\n {...props}\n ref={composeRefs(inputRef, forwardedRef)}\n type=\"search\"\n value={value}\n data-size={size}\n data-loading={loading || undefined}\n disabled={disabled}\n aria-busy={loading || ariaBusy || undefined}\n fieldClassName={classNames(\"hjm-search-field\", fieldClassName)!}\n leading={\n leading ?? (renderSearchIcon ? renderSearchIcon(iconAppearance) : undefined)\n }\n onChange={(event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n }}\n trailing={\n loading ? (\n <span className=\"hjm-search-field__spinner\" aria-hidden=\"true\">\n {renderLoadingIndicator?.(iconAppearance)}\n </span>\n ) : canClear ? (\n <button\n type=\"button\"\n className=\"hjm-search-field__clear\"\n aria-label={clearLabel}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n setValue(\"\");\n onClear?.();\n inputRef.current?.focus();\n }}\n >\n {renderClearIcon?.(iconAppearance) ?? \"×\"}\n </button>\n ) : trailing\n }\n />\n );\n },\n);\n\nexport type PasswordFieldToggleRenderProps = Readonly<{\n name: \"visibility\" | \"visibilityOff\";\n color: \"currentColor\";\n size: number;\n revealed: boolean;\n disabled: boolean;\n}>;\n\nexport type PasswordFieldProps = Omit<\n TextFieldProps,\n \"autoComplete\" | \"defaultValue\" | \"size\" | \"trailing\" | \"type\" | \"value\"\n> &\n Readonly<{\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n revealed?: boolean;\n defaultRevealed?: boolean;\n onRevealedChange?: (revealed: boolean) => void;\n autofillHint: PasswordFieldAutofillHint;\n revealLabel: string;\n concealLabel: string;\n size?: PasswordFieldSize;\n renderToggleIcon?: (props: PasswordFieldToggleRenderProps) => ReactNode;\n }>;\n\n/** Password input with an independently controlled, selection-safe reveal action. */\nexport const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n function PasswordField(\n {\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onChange,\n revealed: revealedProp,\n defaultRevealed = false,\n onRevealedChange,\n autofillHint,\n revealLabel,\n concealLabel,\n size = passwordFieldRecipe.defaults.size,\n renderToggleIcon,\n fieldClassName,\n className,\n disabled,\n readOnly,\n ...props\n },\n forwardedRef,\n ) {\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const [revealed, setRevealed] = useControllableState({\n ...(revealedProp === undefined ? {} : { value: revealedProp }),\n defaultValue: defaultRevealed,\n ...(onRevealedChange === undefined ? {} : { onChange: onRevealedChange }),\n });\n const resolved = resolvePasswordFieldDescriptor(\n { revealed, autofillHint },\n {\n composeToggleAccessibleName: ({ willReveal }) =>\n willReveal ? revealLabel : concealLabel,\n },\n );\n const inputRef = useRef<HTMLInputElement>(null);\n const selectionRef = useRef<Readonly<{ start: number; end: number }> | null>(null);\n\n useLayoutEffect(() => {\n const selection = selectionRef.current;\n if (!selection || !inputRef.current) return;\n inputRef.current.setSelectionRange(selection.start, selection.end);\n selectionRef.current = null;\n }, [revealed]);\n\n const toggleAppearance: PasswordFieldToggleRenderProps = {\n name: revealed\n ? passwordFieldRecipe.toggle.icons.revealed\n : passwordFieldRecipe.toggle.icons.concealed,\n color: \"currentColor\",\n size: iconRecipe.sizes.sm,\n revealed,\n disabled: disabled ?? false,\n };\n\n return (\n <TextField\n {...props}\n ref={composeRefs(inputRef, forwardedRef)}\n autoComplete={autofillHint === \"current\" ? \"current-password\" : \"new-password\"}\n className={classNames(\"hjm-password-field__input\", className)}\n disabled={disabled}\n fieldClassName={classNames(\n \"hjm-password-field\",\n `hjm-password-field--${size}`,\n fieldClassName,\n )!}\n onChange={(event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n }}\n readOnly={readOnly}\n trailing={(\n <button\n aria-label={resolved.toggleAccessibleName}\n aria-pressed={revealed}\n className=\"hjm-password-field__toggle\"\n data-revealed={revealed || undefined}\n disabled={disabled}\n onClick={() => {\n const input = inputRef.current;\n if (input && input.selectionStart !== null && input.selectionEnd !== null) {\n selectionRef.current = {\n start: input.selectionStart,\n end: input.selectionEnd,\n };\n }\n setRevealed(!revealed);\n }}\n type=\"button\"\n >\n {renderToggleIcon?.(toggleAppearance) ?? <span aria-hidden=\"true\" />}\n </button>\n )}\n type={resolved.webInputType}\n value={value}\n />\n );\n },\n);\n\nexport type OtpFieldProps = Omit<\n TextFieldProps,\n | \"autoComplete\"\n | \"defaultValue\"\n | \"leading\"\n | \"maxLength\"\n | \"shape\"\n | \"size\"\n | \"trailing\"\n | \"type\"\n | \"value\"\n | \"variant\"\n> &\n Readonly<{\n length: number;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n size?: OtpFieldSize;\n busy?: boolean;\n }>;\n\n/** One accessible numeric input rendered as decorative OTP slots. */\nexport const OtpField = forwardRef<HTMLInputElement, OtpFieldProps>(\n function OtpField(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n readOnly,\n busy = false,\n length,\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onComplete,\n onChange,\n size = otpFieldRecipe.defaults.size,\n fieldClassName,\n className,\n onFocus,\n onBlur,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue: resolveOtpFieldValue(length, defaultValue),\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const slots = getOtpFieldSlotValues({ length, value });\n const complete = value.length === length;\n const wasCompleteRef = useRef(complete);\n useEffect(() => {\n if (complete && !wasCompleteRef.current) onComplete?.(value);\n wasCompleteRef.current = complete;\n }, [complete, onComplete, value]);\n const activeIndex = Math.min(value.length, length - 1);\n\n return (\n <FieldFrame\n className={classNames(\"hjm-otp-field\", fieldClassName)}\n controlId={ids.controlId}\n description={description}\n disabled={(disabled ?? false) || busy}\n error={error}\n focused={focused}\n label={label}\n required={required ?? false}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div\n className=\"hjm-otp-field__control\"\n data-complete={complete || undefined}\n data-size={size}\n style={{ \"--hjm-otp-length\": length } as CSSProperties}\n >\n <input\n {...props}\n ref={ref}\n aria-busy={busy || undefined}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n autoComplete=\"one-time-code\"\n className={classNames(\"hjm-otp-field__input\", className)}\n disabled={disabled || busy}\n id={ids.controlId}\n inputMode=\"numeric\"\n maxLength={length}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n onChange={(event) => {\n setValue(resolveOtpFieldValue(length, event.currentTarget.value));\n onChange?.(event);\n }}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n pattern=\"[0-9]*\"\n readOnly={readOnly}\n required={required}\n type=\"text\"\n value={value}\n />\n <div aria-hidden=\"true\" className=\"hjm-otp-field__slots\">\n {slots.map((digit, index) => (\n <span\n className=\"hjm-otp-field__slot\"\n data-state={error\n ? \"invalid\"\n : focused && index === activeIndex\n ? \"focused\"\n : digit\n ? \"filled\"\n : \"idle\"}\n key={index}\n >\n {digit}\n </span>\n ))}\n </div>\n </div>\n </FieldFrame>\n );\n },\n);\n"]}
@@ -0,0 +1,24 @@
1
+ export { HjmProvider, useHjmTheme, type HjmProviderProps, } from "./provider.js";
2
+ export { Grid, Layout, Section, Stack, Surface, Text, type GridGap, type GridProps, type LayoutProps, type LayoutSidebar, type SectionProps, type StackAlign, type StackAxis, type StackGap, type StackJustify, type StackProps, type SurfacePadding, type SurfaceProps, type SurfaceRadius, type SurfaceTone, type TextEmphasis, type TextProps, type TextTone, } from "./layout.js";
3
+ export { Button, IconButton, Link, type ButtonProps, type ButtonSize, type ButtonTone, type IconButtonProps, type IconButtonShape, type IconButtonSize, type IconButtonTone, type LinkRenderProps, type LinkProps, } from "./actions.js";
4
+ export { Field, OtpField, PasswordField, SearchField, TextArea, TextField, type FieldControlProps, type FieldProps, type OtpFieldProps, type PasswordFieldProps, type PasswordFieldToggleRenderProps, type SearchFieldProps, type SearchFieldIconRenderProps, type TextAreaProps, type TextFieldProps, } from "./forms.js";
5
+ export { Combobox, Form, type ComboboxItem, type ComboboxOpenChangeReason, type ComboboxProps, type FormProps, type FormSubmitHandler, NativeSelect, type NativeSelectProps, type SelectOption, } from "./advanced-forms.js";
6
+ export { Select, type SelectItem, type SelectLeadingRenderProps, type SelectOptionLeadingRenderProps, type SelectProps, type SelectSection, } from "./select.js";
7
+ export { NumberField, type NumberFieldProps, } from "./number-field.js";
8
+ export { Slider, type SliderProps, } from "./slider.js";
9
+ export { DatePicker, type DatePickerMonthAction, type DatePickerProps, } from "./date-picker.js";
10
+ export { FilePicker, type FilePickerProps, } from "./file-picker.js";
11
+ export { Checkbox, CheckboxGroup, Chip, Radio, RadioGroup, SegmentedControl, Switch, type CheckboxProps, type CheckboxGroupItem, type CheckboxGroupProps, type ChipProps, type ChoiceLeadingRenderProps, type RadioProps, type RadioGroupItem, type RadioGroupProps, type SegmentedControlItem, type SegmentedControlProps, type SwitchProps, } from "./selection.js";
12
+ export { TabPanel, Tabs, getDynamicTabPanelId, getTabId, getTabPanelId, type TabLeadingRenderProps, type TabItem, type TabPanelProps, type TabsProps, } from "./navigation.js";
13
+ export { Breadcrumb, Pagination, type BreadcrumbProps, type PaginationProps, } from "./advanced-navigation.js";
14
+ export { LoadMore, type LoadMoreProps, } from "./supplemental-navigation.js";
15
+ export { Steps, type StepsProps, } from "./steps.js";
16
+ export { BottomNavigation, getBottomNavigationGridColumn, isUnmodifiedPrimaryBottomNavigationClick, shouldHideBottomNavigationForKeyboard, type BottomNavigationIconRenderProps, type BottomNavigationLinkRenderProps, type BottomNavigationProps, } from "./bottom-navigation.js";
17
+ export { Badge, Card, ListRow, Tag, type BadgeProps, type BadgeVariant, type CardHeadingLevel, type CardProps, type ListRowProps, type TagProps, type TagTone, } from "./display.js";
18
+ export { CounterBadge, Icon, Image, type CounterBadgeProps, type IconProps, type ImageAdapterProps, type ImageProps, } from "./supplemental-display.js";
19
+ export { Accordion, Avatar, DescriptionList, Divider, List, Statistic, StatisticGroup, Table, Timeline, type AccordionItem, type AccordionProps, type AvatarProps, type DescriptionListProps, type DividerInset, type DividerOrientation, type DividerProps, type ListAppearance, type ListProps, type StatisticProps, type StatisticGroupProps, type StatisticTrendMarkRenderProps, type ComposeStatisticAccessibilityLabel, type TableColumn, type TableProps, type TableSortDirection, type TimelineProps, } from "./advanced-display.js";
20
+ export { UploadItem, type UploadItemProps, } from "./upload-item.js";
21
+ export { EmptyState, Notice, Progress, Result, Skeleton, Spinner, type EmptyStateProps, type NoticeProps, type ProgressProps, type ResultProps, type SkeletonProps, type SpinnerProps, } from "./feedback.js";
22
+ export { Toast, ToastProvider, useToast, type ToastApi, type ToastProps, type ToastProviderProps, } from "./toast.js";
23
+ export { AlertDialog, Dialog, Menu, Sheet, Tooltip, type AlertDialogProps, type DialogOpenChangeReason, type DialogProps, type MenuItem, type MenuAsyncState, type MenuOpenChangeReason, type MenuProps, type MenuSection, type OverlayTrigger, type SheetPlacement, type SheetProps, type TooltipProps, } from "./overlays.js";
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,SAAS,EACT,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,aAA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,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,EACL,aAAa,EACb,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ export { HjmProvider, useHjmTheme, } from "./provider.js";
2
+ export { Grid, Layout, Section, Stack, Surface, Text, } from "./layout.js";
3
+ export { Button, IconButton, Link, } from "./actions.js";
4
+ export { Field, OtpField, PasswordField, SearchField, TextArea, TextField, } from "./forms.js";
5
+ export { Combobox, Form, NativeSelect, } from "./advanced-forms.js";
6
+ export { Select, } from "./select.js";
7
+ export { NumberField, } from "./number-field.js";
8
+ export { Slider, } from "./slider.js";
9
+ export { DatePicker, } from "./date-picker.js";
10
+ export { FilePicker, } from "./file-picker.js";
11
+ export { Checkbox, CheckboxGroup, Chip, Radio, RadioGroup, SegmentedControl, Switch, } from "./selection.js";
12
+ export { TabPanel, Tabs, getDynamicTabPanelId, getTabId, getTabPanelId, } from "./navigation.js";
13
+ export { Breadcrumb, Pagination, } from "./advanced-navigation.js";
14
+ export { LoadMore, } from "./supplemental-navigation.js";
15
+ export { Steps, } from "./steps.js";
16
+ export { BottomNavigation, getBottomNavigationGridColumn, isUnmodifiedPrimaryBottomNavigationClick, shouldHideBottomNavigationForKeyboard, } from "./bottom-navigation.js";
17
+ export { Badge, Card, ListRow, Tag, } from "./display.js";
18
+ export { CounterBadge, Icon, Image, } from "./supplemental-display.js";
19
+ export { Accordion, Avatar, DescriptionList, Divider, List, Statistic, StatisticGroup, Table, Timeline, } from "./advanced-display.js";
20
+ export { UploadItem, } from "./upload-item.js";
21
+ export { EmptyState, Notice, Progress, Result, Skeleton, Spinner, } from "./feedback.js";
22
+ export { Toast, ToastProvider, useToast, } from "./toast.js";
23
+ export { AlertDialog, Dialog, Menu, Sheet, Tooltip, } from "./overlays.js";
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,GAEZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,GAkBL,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,GAUL,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,SAAS,GAUV,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,IAAI,EAMJ,YAAY,GAGb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,MAAM,GAMP,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,MAAM,GAEP,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,UAAU,GAGX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,UAAU,GAEX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,MAAM,GAYP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,oBAAoB,EACpB,QAAQ,EACR,aAAa,GAKd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,UAAU,EACV,UAAU,GAGX,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,QAAQ,GAET,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,KAAK,GAEN,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,wCAAwC,EACxC,qCAAqC,GAItC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,GAAG,GAQJ,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,KAAK,GAKN,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,SAAS,EACT,MAAM,EACN,eAAe,EACf,OAAO,EACP,IAAI,EACJ,SAAS,EACT,cAAc,EACd,KAAK,EACL,QAAQ,GAkBT,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,GAEX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,UAAU,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,GAOR,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,EACL,aAAa,EACb,QAAQ,GAIT,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,GAaR,MAAM,eAAe,CAAC","sourcesContent":["export {\n HjmProvider,\n useHjmTheme,\n type HjmProviderProps,\n} from \"./provider.js\";\n\nexport {\n Grid,\n Layout,\n Section,\n Stack,\n Surface,\n Text,\n type GridGap,\n type GridProps,\n type LayoutProps,\n type LayoutSidebar,\n type SectionProps,\n type StackAlign,\n type StackAxis,\n type StackGap,\n type StackJustify,\n type StackProps,\n type SurfacePadding,\n type SurfaceProps,\n type SurfaceRadius,\n type SurfaceTone,\n type TextEmphasis,\n type TextProps,\n type TextTone,\n} from \"./layout.js\";\n\nexport {\n Button,\n IconButton,\n Link,\n type ButtonProps,\n type ButtonSize,\n type ButtonTone,\n type IconButtonProps,\n type IconButtonShape,\n type IconButtonSize,\n type IconButtonTone,\n type LinkRenderProps,\n type LinkProps,\n} from \"./actions.js\";\n\nexport {\n Field,\n OtpField,\n PasswordField,\n SearchField,\n TextArea,\n TextField,\n type FieldControlProps,\n type FieldProps,\n type OtpFieldProps,\n type PasswordFieldProps,\n type PasswordFieldToggleRenderProps,\n type SearchFieldProps,\n type SearchFieldIconRenderProps,\n type TextAreaProps,\n type TextFieldProps,\n} from \"./forms.js\";\n\nexport {\n Combobox,\n Form,\n type ComboboxItem,\n type ComboboxOpenChangeReason,\n type ComboboxProps,\n type FormProps,\n type FormSubmitHandler,\n NativeSelect,\n type NativeSelectProps,\n type SelectOption,\n} from \"./advanced-forms.js\";\n\nexport {\n Select,\n type SelectItem,\n type SelectLeadingRenderProps,\n type SelectOptionLeadingRenderProps,\n type SelectProps,\n type SelectSection,\n} from \"./select.js\";\n\nexport {\n NumberField,\n type NumberFieldProps,\n} from \"./number-field.js\";\n\nexport {\n Slider,\n type SliderProps,\n} from \"./slider.js\";\n\nexport {\n DatePicker,\n type DatePickerMonthAction,\n type DatePickerProps,\n} from \"./date-picker.js\";\n\nexport {\n FilePicker,\n type FilePickerProps,\n} from \"./file-picker.js\";\n\nexport {\n Checkbox,\n CheckboxGroup,\n Chip,\n Radio,\n RadioGroup,\n SegmentedControl,\n Switch,\n type CheckboxProps,\n type CheckboxGroupItem,\n type CheckboxGroupProps,\n type ChipProps,\n type ChoiceLeadingRenderProps,\n type RadioProps,\n type RadioGroupItem,\n type RadioGroupProps,\n type SegmentedControlItem,\n type SegmentedControlProps,\n type SwitchProps,\n} from \"./selection.js\";\n\nexport {\n TabPanel,\n Tabs,\n getDynamicTabPanelId,\n getTabId,\n getTabPanelId,\n type TabLeadingRenderProps,\n type TabItem,\n type TabPanelProps,\n type TabsProps,\n} from \"./navigation.js\";\n\nexport {\n Breadcrumb,\n Pagination,\n type BreadcrumbProps,\n type PaginationProps,\n} from \"./advanced-navigation.js\";\n\nexport {\n LoadMore,\n type LoadMoreProps,\n} from \"./supplemental-navigation.js\";\n\nexport {\n Steps,\n type StepsProps,\n} from \"./steps.js\";\n\nexport {\n BottomNavigation,\n getBottomNavigationGridColumn,\n isUnmodifiedPrimaryBottomNavigationClick,\n shouldHideBottomNavigationForKeyboard,\n type BottomNavigationIconRenderProps,\n type BottomNavigationLinkRenderProps,\n type BottomNavigationProps,\n} from \"./bottom-navigation.js\";\n\nexport {\n Badge,\n Card,\n ListRow,\n Tag,\n type BadgeProps,\n type BadgeVariant,\n type CardHeadingLevel,\n type CardProps,\n type ListRowProps,\n type TagProps,\n type TagTone,\n} from \"./display.js\";\n\nexport {\n CounterBadge,\n Icon,\n Image,\n type CounterBadgeProps,\n type IconProps,\n type ImageAdapterProps,\n type ImageProps,\n} from \"./supplemental-display.js\";\n\nexport {\n Accordion,\n Avatar,\n DescriptionList,\n Divider,\n List,\n Statistic,\n StatisticGroup,\n Table,\n Timeline,\n type AccordionItem,\n type AccordionProps,\n type AvatarProps,\n type DescriptionListProps,\n type DividerInset,\n type DividerOrientation,\n type DividerProps,\n type ListAppearance,\n type ListProps,\n type StatisticProps,\n type StatisticGroupProps,\n type StatisticTrendMarkRenderProps,\n type ComposeStatisticAccessibilityLabel,\n type TableColumn,\n type TableProps,\n type TableSortDirection,\n type TimelineProps,\n} from \"./advanced-display.js\";\n\nexport {\n UploadItem,\n type UploadItemProps,\n} from \"./upload-item.js\";\n\nexport {\n EmptyState,\n Notice,\n Progress,\n Result,\n Skeleton,\n Spinner,\n type EmptyStateProps,\n type NoticeProps,\n type ProgressProps,\n type ResultProps,\n type SkeletonProps,\n type SpinnerProps,\n} from \"./feedback.js\";\n\nexport {\n Toast,\n ToastProvider,\n useToast,\n type ToastApi,\n type ToastProps,\n type ToastProviderProps,\n} from \"./toast.js\";\n\nexport {\n AlertDialog,\n Dialog,\n Menu,\n Sheet,\n Tooltip,\n type AlertDialogProps,\n type DialogOpenChangeReason,\n type DialogProps,\n type MenuItem,\n type MenuAsyncState,\n type MenuOpenChangeReason,\n type MenuProps,\n type MenuSection,\n type OverlayTrigger,\n type SheetPlacement,\n type SheetProps,\n type TooltipProps,\n} from \"./overlays.js\";\n"]}
@@ -0,0 +1,17 @@
1
+ import { type Dispatch, type Ref, type SetStateAction } from "react";
2
+ export declare function classNames(...values: readonly (string | false | null | undefined)[]): string | undefined;
3
+ export declare function assignRef<Element>(ref: Ref<Element> | undefined, value: Element | null): void;
4
+ export declare function composeRefs<Element>(...refs: readonly (Ref<Element> | undefined)[]): (value: Element | null) => void;
5
+ type ControllableStateOptions<Value> = Readonly<{
6
+ value?: Value;
7
+ defaultValue: Value;
8
+ onChange?: (value: Value) => void;
9
+ }>;
10
+ export declare function useControllableState<Value>({ value, defaultValue, onChange, }: ControllableStateOptions<Value>): readonly [
11
+ Value,
12
+ Dispatch<SetStateAction<Value>>
13
+ ];
14
+ export declare function useWindowWidth(): number;
15
+ export declare function useElementWidth<Element extends HTMLElement>(externalRef?: Ref<Element>): readonly [number | undefined, (node: Element | null) => void];
16
+ export {};
17
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,wBAAgB,UAAU,CACxB,GAAG,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GACxD,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAG7F;AAED,wBAAgB,WAAW,CAAC,OAAO,EACjC,GAAG,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,EAAE,GAC7C,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAIjC;AAED,KAAK,wBAAwB,CAAC,KAAK,IAAI,QAAQ,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,YAAY,EAAE,KAAK,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACnC,CAAC,CAAC;AAEH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,EAC1C,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAG,SAAS;IAC5C,KAAK;IACL,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CAChC,CAiBA;AAeD,wBAAgB,cAAc,IAAI,MAAM,CAMvC;AAED,wBAAgB,eAAe,CAAC,OAAO,SAAS,WAAW,EACzD,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GACzB,SAAS,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC,CAyB/D"}
@@ -0,0 +1,68 @@
1
+ import { useCallback, useEffect, useState, useSyncExternalStore, } from "react";
2
+ export function classNames(...values) {
3
+ const result = values.filter(Boolean).join(" ");
4
+ return result.length > 0 ? result : undefined;
5
+ }
6
+ export function assignRef(ref, value) {
7
+ if (typeof ref === "function")
8
+ ref(value);
9
+ else if (ref)
10
+ ref.current = value;
11
+ }
12
+ export function composeRefs(...refs) {
13
+ return (value) => {
14
+ for (const ref of refs)
15
+ assignRef(ref, value);
16
+ };
17
+ }
18
+ export function useControllableState({ value, defaultValue, onChange, }) {
19
+ const [internalValue, setInternalValue] = useState(defaultValue);
20
+ const controlled = value !== undefined;
21
+ const currentValue = controlled ? value : internalValue;
22
+ const setValue = useCallback((next) => {
23
+ const resolved = typeof next === "function"
24
+ ? next(currentValue)
25
+ : next;
26
+ if (!controlled)
27
+ setInternalValue(resolved);
28
+ if (!Object.is(resolved, currentValue))
29
+ onChange?.(resolved);
30
+ }, [controlled, currentValue, onChange]);
31
+ return [currentValue, setValue];
32
+ }
33
+ function subscribeWindowResize(callback) {
34
+ window.addEventListener("resize", callback);
35
+ return () => window.removeEventListener("resize", callback);
36
+ }
37
+ function getWindowWidth() {
38
+ return window.innerWidth;
39
+ }
40
+ function getServerWindowWidth() {
41
+ return 0;
42
+ }
43
+ export function useWindowWidth() {
44
+ return useSyncExternalStore(subscribeWindowResize, getWindowWidth, getServerWindowWidth);
45
+ }
46
+ export function useElementWidth(externalRef) {
47
+ const [node, setNode] = useState(null);
48
+ const [width, setWidth] = useState();
49
+ const ref = useCallback((nextNode) => {
50
+ setNode(nextNode);
51
+ assignRef(externalRef, nextNode);
52
+ }, [externalRef]);
53
+ useEffect(() => {
54
+ if (!node)
55
+ return;
56
+ const update = () => setWidth(node.getBoundingClientRect().width);
57
+ update();
58
+ if (typeof ResizeObserver === "undefined") {
59
+ window.addEventListener("resize", update);
60
+ return () => window.removeEventListener("resize", update);
61
+ }
62
+ const observer = new ResizeObserver(update);
63
+ observer.observe(node);
64
+ return () => observer.disconnect();
65
+ }, [node]);
66
+ return [width, ref];
67
+ }
68
+ //# sourceMappingURL=internal.js.map