@reykjavik/hanna-react 0.10.156 → 0.10.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -6
- package/FormField.d.ts +24 -3
- package/Multiselect.js +11 -0
- package/Selectbox.d.ts +1 -1
- package/esm/FormField.d.ts +24 -3
- package/esm/Multiselect.js +11 -0
- package/esm/Selectbox.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,18 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
- ... <!-- Add new lines here. -->
|
|
6
6
|
|
|
7
|
-
## 0.10.
|
|
7
|
+
## 0.10.157
|
|
8
8
|
|
|
9
|
-
_2025-
|
|
9
|
+
_2025-09-16_
|
|
10
10
|
|
|
11
|
-
-
|
|
11
|
+
- `Multiselect`
|
|
12
|
+
- fix: Sync `.checked` prop of keyboard-toggled `input`s with visual state
|
|
13
|
+
- `Selectbox`:
|
|
14
|
+
- fix: Remove stray `modifier` prop from `SelectboxProps`
|
|
15
|
+
- docs: Add JSDoc comments for `FormfieldProps.renderInput` parameters
|
|
12
16
|
|
|
13
|
-
## 0.10.155
|
|
17
|
+
## 0.10.155 – 0.10.156
|
|
14
18
|
|
|
15
19
|
_2025-06-23_
|
|
16
20
|
|
|
17
|
-
- feat: Allow `MainMenu2` items to be `undefined`
|
|
18
|
-
array population
|
|
21
|
+
- feat: Allow `MainMenu2` items to be `undefined`, `null` or `false` for
|
|
22
|
+
easier conditional item array population
|
|
19
23
|
|
|
20
24
|
## 0.10.154
|
|
21
25
|
|
package/FormField.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
|
5
5
|
type InputClassNames = {
|
|
6
6
|
/** Basic/raw FormField BEM name */
|
|
7
7
|
bem: string;
|
|
8
|
-
/** Standard name for "<input/>"-styled controls */
|
|
8
|
+
/** Standard name for "<input/>"-styled controls or container elements */
|
|
9
9
|
input: string;
|
|
10
10
|
/** Standard name for radio/checkbox group conotrols */
|
|
11
11
|
options: string;
|
|
@@ -77,9 +77,30 @@ type FormFieldProps = FormFieldGroupWrappingProps & {
|
|
|
77
77
|
group?: boolean | 'inputlike';
|
|
78
78
|
empty?: boolean;
|
|
79
79
|
filled?: boolean;
|
|
80
|
-
renderInput(
|
|
80
|
+
renderInput(
|
|
81
|
+
/**
|
|
82
|
+
* Object with standard classNames for various input-related elements
|
|
83
|
+
*/
|
|
84
|
+
className: InputClassNames,
|
|
85
|
+
/**
|
|
86
|
+
* The input's managed props, including `id`, a bunch of `aria-*` attributes,
|
|
87
|
+
* `disabled`, `readOnly`, and `required`.
|
|
88
|
+
*/
|
|
89
|
+
inputProps: FormFieldInputProps & {
|
|
81
90
|
id: string;
|
|
82
|
-
},
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Function that generates `onFocus` and `onBlur` event handlers for the
|
|
94
|
+
* `___input` element, capturing bubbled `FocusEvent`s and emulating
|
|
95
|
+
* `onFocusOut` and `onFocusIn` behavior. This is useful for multi-input
|
|
96
|
+
* controls.
|
|
97
|
+
*/
|
|
98
|
+
addFocusProps: FocusPropMaker,
|
|
99
|
+
/**
|
|
100
|
+
* Sugar flag indicating whether the component is being rendered in a browser
|
|
101
|
+
* environment or not.
|
|
102
|
+
*/
|
|
103
|
+
isBrowser?: boolean): JSX.Element;
|
|
83
104
|
};
|
|
84
105
|
export declare const FormField: (props: FormFieldProps) => JSX.Element;
|
|
85
106
|
export default FormField;
|
package/Multiselect.js
CHANGED
|
@@ -163,6 +163,17 @@ const Multiselect = (props) => {
|
|
|
163
163
|
e.preventDefault();
|
|
164
164
|
const selItem = filteredOptions[activeItemIndex];
|
|
165
165
|
if (selItem) {
|
|
166
|
+
// Manually toggle the checkbox, to ensure that uncontrolled
|
|
167
|
+
// components (e.g. screen readers) are in sync with the visual state.
|
|
168
|
+
let input;
|
|
169
|
+
inputWrapperRef
|
|
170
|
+
.current.querySelectorAll(`input[type="checkbox"]`)
|
|
171
|
+
.forEach((elm) => {
|
|
172
|
+
if (elm.value === selItem.value) {
|
|
173
|
+
input = elm;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
input.checked = !input.checked;
|
|
166
177
|
handleCheckboxSelection(selItem);
|
|
167
178
|
}
|
|
168
179
|
}
|
package/Selectbox.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { FormFieldWrappingProps } from './FormField.js';
|
|
|
3
3
|
export { type SelectboxOption, type SelectboxOptions as SelectboxOptionList, } from '@hugsmidjan/react/Selectbox';
|
|
4
4
|
/** @deprecated Use `SelectboxOptionList` instead (Will be removed in v0.11) */
|
|
5
5
|
export type SelectboxOptions = _SelectboxOptions;
|
|
6
|
-
export type SelectboxProps<O extends OptionOrValue = OptionOrValue> = FormFieldWrappingProps & Omit<_SelectboxProps<O>, 'bem'> & {
|
|
6
|
+
export type SelectboxProps<O extends OptionOrValue = OptionOrValue> = FormFieldWrappingProps & Omit<_SelectboxProps<O>, 'bem' | 'modifier'> & {
|
|
7
7
|
small?: boolean;
|
|
8
8
|
};
|
|
9
9
|
export declare const Selectbox: <O extends OptionOrValue>(props: SelectboxProps<O>) => JSX.Element;
|
package/esm/FormField.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { SSRSupportProps, WrapperElmProps } from './utils.js';
|
|
|
5
5
|
type InputClassNames = {
|
|
6
6
|
/** Basic/raw FormField BEM name */
|
|
7
7
|
bem: string;
|
|
8
|
-
/** Standard name for "<input/>"-styled controls */
|
|
8
|
+
/** Standard name for "<input/>"-styled controls or container elements */
|
|
9
9
|
input: string;
|
|
10
10
|
/** Standard name for radio/checkbox group conotrols */
|
|
11
11
|
options: string;
|
|
@@ -77,9 +77,30 @@ type FormFieldProps = FormFieldGroupWrappingProps & {
|
|
|
77
77
|
group?: boolean | 'inputlike';
|
|
78
78
|
empty?: boolean;
|
|
79
79
|
filled?: boolean;
|
|
80
|
-
renderInput(
|
|
80
|
+
renderInput(
|
|
81
|
+
/**
|
|
82
|
+
* Object with standard classNames for various input-related elements
|
|
83
|
+
*/
|
|
84
|
+
className: InputClassNames,
|
|
85
|
+
/**
|
|
86
|
+
* The input's managed props, including `id`, a bunch of `aria-*` attributes,
|
|
87
|
+
* `disabled`, `readOnly`, and `required`.
|
|
88
|
+
*/
|
|
89
|
+
inputProps: FormFieldInputProps & {
|
|
81
90
|
id: string;
|
|
82
|
-
},
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Function that generates `onFocus` and `onBlur` event handlers for the
|
|
94
|
+
* `___input` element, capturing bubbled `FocusEvent`s and emulating
|
|
95
|
+
* `onFocusOut` and `onFocusIn` behavior. This is useful for multi-input
|
|
96
|
+
* controls.
|
|
97
|
+
*/
|
|
98
|
+
addFocusProps: FocusPropMaker,
|
|
99
|
+
/**
|
|
100
|
+
* Sugar flag indicating whether the component is being rendered in a browser
|
|
101
|
+
* environment or not.
|
|
102
|
+
*/
|
|
103
|
+
isBrowser?: boolean): JSX.Element;
|
|
83
104
|
};
|
|
84
105
|
export declare const FormField: (props: FormFieldProps) => JSX.Element;
|
|
85
106
|
export default FormField;
|
package/esm/Multiselect.js
CHANGED
|
@@ -159,6 +159,17 @@ export const Multiselect = (props) => {
|
|
|
159
159
|
e.preventDefault();
|
|
160
160
|
const selItem = filteredOptions[activeItemIndex];
|
|
161
161
|
if (selItem) {
|
|
162
|
+
// Manually toggle the checkbox, to ensure that uncontrolled
|
|
163
|
+
// components (e.g. screen readers) are in sync with the visual state.
|
|
164
|
+
let input;
|
|
165
|
+
inputWrapperRef
|
|
166
|
+
.current.querySelectorAll(`input[type="checkbox"]`)
|
|
167
|
+
.forEach((elm) => {
|
|
168
|
+
if (elm.value === selItem.value) {
|
|
169
|
+
input = elm;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
input.checked = !input.checked;
|
|
162
173
|
handleCheckboxSelection(selItem);
|
|
163
174
|
}
|
|
164
175
|
}
|
package/esm/Selectbox.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { FormFieldWrappingProps } from './FormField.js';
|
|
|
3
3
|
export { type SelectboxOption, type SelectboxOptions as SelectboxOptionList, } from '@hugsmidjan/react/Selectbox';
|
|
4
4
|
/** @deprecated Use `SelectboxOptionList` instead (Will be removed in v0.11) */
|
|
5
5
|
export type SelectboxOptions = _SelectboxOptions;
|
|
6
|
-
export type SelectboxProps<O extends OptionOrValue = OptionOrValue> = FormFieldWrappingProps & Omit<_SelectboxProps<O>, 'bem'> & {
|
|
6
|
+
export type SelectboxProps<O extends OptionOrValue = OptionOrValue> = FormFieldWrappingProps & Omit<_SelectboxProps<O>, 'bem' | 'modifier'> & {
|
|
7
7
|
small?: boolean;
|
|
8
8
|
};
|
|
9
9
|
export declare const Selectbox: <O extends OptionOrValue>(props: SelectboxProps<O>) => JSX.Element;
|