@mond-design-system/react 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -773,6 +773,12 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
773
773
|
bar with an avatar and a menu, where the medium step is the tallest
|
|
774
774
|
thing up there. */
|
|
775
775
|
size?: SegmentedControlSize;
|
|
776
|
+
/** Report the segment already chosen being picked again. Off by default:
|
|
777
|
+
a radio only fires when its checked state changes, and for most choices
|
|
778
|
+
that is the whole story. Turn it on where confirming the value on screen
|
|
779
|
+
is itself an act — pinning a language that until now was inferred from
|
|
780
|
+
the browser, so it stops following it. */
|
|
781
|
+
repick?: boolean;
|
|
776
782
|
/** Drop the frame: no tray, no padding around the segments. The tray is
|
|
777
783
|
what makes the group read as a form field, and in a header bar a field
|
|
778
784
|
is what it is not. The chosen segment still carries its own surface. */
|
|
@@ -795,7 +801,7 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
795
801
|
* />
|
|
796
802
|
* ```
|
|
797
803
|
*/
|
|
798
|
-
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, className, }: SegmentedControlProps<T>): ReactElement;
|
|
804
|
+
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, repick, className, }: SegmentedControlProps<T>): ReactElement;
|
|
799
805
|
|
|
800
806
|
interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "onChange"> {
|
|
801
807
|
/** Accessible name. */
|
package/dist/index.d.ts
CHANGED
|
@@ -773,6 +773,12 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
773
773
|
bar with an avatar and a menu, where the medium step is the tallest
|
|
774
774
|
thing up there. */
|
|
775
775
|
size?: SegmentedControlSize;
|
|
776
|
+
/** Report the segment already chosen being picked again. Off by default:
|
|
777
|
+
a radio only fires when its checked state changes, and for most choices
|
|
778
|
+
that is the whole story. Turn it on where confirming the value on screen
|
|
779
|
+
is itself an act — pinning a language that until now was inferred from
|
|
780
|
+
the browser, so it stops following it. */
|
|
781
|
+
repick?: boolean;
|
|
776
782
|
/** Drop the frame: no tray, no padding around the segments. The tray is
|
|
777
783
|
what makes the group read as a form field, and in a header bar a field
|
|
778
784
|
is what it is not. The chosen segment still carries its own surface. */
|
|
@@ -795,7 +801,7 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
795
801
|
* />
|
|
796
802
|
* ```
|
|
797
803
|
*/
|
|
798
|
-
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, className, }: SegmentedControlProps<T>): ReactElement;
|
|
804
|
+
declare function SegmentedControl<T extends string = string>({ label, options, value, onChange, disabled, fullWidth, size, bare, repick, className, }: SegmentedControlProps<T>): ReactElement;
|
|
799
805
|
|
|
800
806
|
interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "onChange"> {
|
|
801
807
|
/** Accessible name. */
|
package/dist/index.js
CHANGED
|
@@ -1237,6 +1237,7 @@ function SegmentedControl({
|
|
|
1237
1237
|
fullWidth = false,
|
|
1238
1238
|
size = "md",
|
|
1239
1239
|
bare = false,
|
|
1240
|
+
repick = false,
|
|
1240
1241
|
className
|
|
1241
1242
|
}) {
|
|
1242
1243
|
const name = useId();
|
|
@@ -1261,6 +1262,7 @@ function SegmentedControl({
|
|
|
1261
1262
|
value: option.value,
|
|
1262
1263
|
checked: option.value === value,
|
|
1263
1264
|
onChange: () => onChange(option.value),
|
|
1265
|
+
onClick: repick && option.value === value ? () => onChange(option.value) : void 0,
|
|
1264
1266
|
disabled,
|
|
1265
1267
|
className: SegmentedControl_module_default.input
|
|
1266
1268
|
}
|