@koobiq/react-primitives 0.0.1-beta.3 → 0.0.1-beta.31
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/behaviors/index.d.ts +0 -2
- package/dist/behaviors/useButton.d.ts +6 -6
- package/dist/behaviors/useButton.js +10 -21
- package/dist/behaviors/useCheckbox.d.ts +10 -45
- package/dist/behaviors/useCheckbox.js +15 -38
- package/dist/behaviors/useLink.d.ts +5 -9
- package/dist/behaviors/useLink.js +8 -17
- package/dist/behaviors/useNumberField.d.ts +1 -22
- package/dist/behaviors/useNumberField.js +2 -13
- package/dist/behaviors/useToggle.d.ts +309 -37
- package/dist/behaviors/useToggle.js +12 -33
- package/dist/components/Button/Button.js +17 -13
- package/dist/components/Button/ButtonContext.js +1 -0
- package/dist/components/Button/types.d.ts +7 -7
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +36 -19
- package/dist/components/Checkbox/types.d.ts +8 -8
- package/dist/components/Group/Group.js +7 -7
- package/dist/components/Group/GroupContext.js +1 -0
- package/dist/components/Group/types.d.ts +8 -8
- package/dist/components/Input/InputContext.js +1 -0
- package/dist/components/Label/LabelContext.js +1 -0
- package/dist/components/Link/Link.js +30 -9
- package/dist/components/Link/types.d.ts +8 -6
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/NumberField.js +9 -9
- package/dist/components/NumberField/types.d.ts +4 -4
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/Radio/RadioContext.js +1 -0
- package/dist/components/Radio/RadioGroup.d.ts +1 -1
- package/dist/components/Text/TextContext.js +1 -0
- package/dist/components/TextField/TextField.d.ts +2 -1
- package/dist/components/TextField/TextField.js +58 -57
- package/dist/components/TextField/types.d.ts +11 -8
- package/dist/components/Textarea/Textarea.d.ts +2 -4
- package/dist/components/Textarea/Textarea.js +6 -2
- package/dist/components/Textarea/TextareaContext.js +1 -0
- package/dist/components/Textarea/types.d.ts +2 -1
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +14 -14
- package/dist/components/Toggle/types.d.ts +7 -7
- package/dist/index.d.ts +21 -3
- package/dist/index.js +61 -6
- package/dist/types.d.ts +3 -6
- package/package.json +29 -8
- package/dist/behaviors/useNumberFieldState.d.ts +0 -25
- package/dist/behaviors/useNumberFieldState.js +0 -13
- package/dist/behaviors/useTextField.d.ts +0 -19
- package/dist/behaviors/useTextField.js +0 -24
|
@@ -1,44 +1,316 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* If `true`, the component will indicate an error.
|
|
7
|
-
* @default false
|
|
8
|
-
* */
|
|
9
|
-
error?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* If `true`, the component is checked.
|
|
12
|
-
* @default false
|
|
13
|
-
* */
|
|
14
|
-
checked?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* If `true`, the component is disabled.
|
|
17
|
-
* @default false
|
|
18
|
-
* */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* If `true`, the input element is required.
|
|
22
|
-
* @default false
|
|
23
|
-
* */
|
|
24
|
-
required?: boolean;
|
|
25
|
-
/** The default checked state. Use when the component is not controlled. */
|
|
26
|
-
defaultChecked?: boolean;
|
|
27
|
-
/** Callback fired when the state is changed. */
|
|
28
|
-
onChange?: (checked: boolean) => void;
|
|
29
|
-
}, Omit<AriaToggleProps, 'isRequired' | 'isInvalid' | 'isReadOnly' | 'isSelected' | 'isDisabled' | 'defaultSelected' | 'onChange'>>;
|
|
2
|
+
import type { AriaSwitchProps } from '@react-aria/switch';
|
|
3
|
+
export type UseToggleProps = AriaSwitchProps & {
|
|
4
|
+
isInvalid?: boolean;
|
|
5
|
+
};
|
|
30
6
|
export declare function useToggle(props: UseToggleProps, ref: RefObject<HTMLInputElement | null>): {
|
|
7
|
+
isSelected: boolean;
|
|
8
|
+
isPressed: boolean;
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
isReadOnly: boolean;
|
|
31
11
|
labelProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement> & import("react").LabelHTMLAttributes<HTMLLabelElement>;
|
|
32
|
-
inputProps:
|
|
12
|
+
inputProps: {
|
|
13
|
+
'aria-invalid': boolean | undefined;
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
role?: import("react").AriaRole | undefined;
|
|
16
|
+
tabIndex?: number | undefined;
|
|
17
|
+
style?: import("react").CSSProperties | undefined;
|
|
18
|
+
className?: string | undefined;
|
|
19
|
+
"aria-activedescendant"?: string | undefined;
|
|
20
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
21
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
22
|
+
"aria-braillelabel"?: string | undefined;
|
|
23
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
24
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
25
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
26
|
+
"aria-colcount"?: number | undefined;
|
|
27
|
+
"aria-colindex"?: number | undefined;
|
|
28
|
+
"aria-colindextext"?: string | undefined;
|
|
29
|
+
"aria-colspan"?: number | undefined;
|
|
30
|
+
"aria-controls"?: string | undefined;
|
|
31
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
32
|
+
"aria-describedby"?: string | undefined;
|
|
33
|
+
"aria-description"?: string | undefined;
|
|
34
|
+
"aria-details"?: string | undefined;
|
|
35
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
36
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
37
|
+
"aria-errormessage"?: string | undefined;
|
|
38
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
39
|
+
"aria-flowto"?: string | undefined;
|
|
40
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
41
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
42
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
43
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
44
|
+
"aria-label"?: string | undefined;
|
|
45
|
+
"aria-labelledby"?: string | undefined;
|
|
46
|
+
"aria-level"?: number | undefined;
|
|
47
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
48
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
49
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
50
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
51
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
52
|
+
"aria-owns"?: string | undefined;
|
|
53
|
+
"aria-placeholder"?: string | undefined;
|
|
54
|
+
"aria-posinset"?: number | undefined;
|
|
55
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
56
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
57
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
58
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
59
|
+
"aria-roledescription"?: string | undefined;
|
|
60
|
+
"aria-rowcount"?: number | undefined;
|
|
61
|
+
"aria-rowindex"?: number | undefined;
|
|
62
|
+
"aria-rowindextext"?: string | undefined;
|
|
63
|
+
"aria-rowspan"?: number | undefined;
|
|
64
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
65
|
+
"aria-setsize"?: number | undefined;
|
|
66
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
67
|
+
"aria-valuemax"?: number | undefined;
|
|
68
|
+
"aria-valuemin"?: number | undefined;
|
|
69
|
+
"aria-valuenow"?: number | undefined;
|
|
70
|
+
"aria-valuetext"?: string | undefined;
|
|
71
|
+
children?: import("react").ReactNode | undefined;
|
|
72
|
+
dangerouslySetInnerHTML?: {
|
|
73
|
+
__html: string | TrustedHTML;
|
|
74
|
+
} | undefined;
|
|
75
|
+
onCopy?: (import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").ClipboardEventHandler<HTMLInputElement>) | undefined;
|
|
76
|
+
onCopyCapture?: (import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").ClipboardEventHandler<HTMLInputElement>) | undefined;
|
|
77
|
+
onCut?: (import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").ClipboardEventHandler<HTMLInputElement>) | undefined;
|
|
78
|
+
onCutCapture?: (import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").ClipboardEventHandler<HTMLInputElement>) | undefined;
|
|
79
|
+
onPaste?: (import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").ClipboardEventHandler<HTMLInputElement>) | undefined;
|
|
80
|
+
onPasteCapture?: (import("react").ClipboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").ClipboardEventHandler<HTMLInputElement>) | undefined;
|
|
81
|
+
onCompositionEnd?: (import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> & import("react").CompositionEventHandler<HTMLInputElement>) | undefined;
|
|
82
|
+
onCompositionEndCapture?: (import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> & import("react").CompositionEventHandler<HTMLInputElement>) | undefined;
|
|
83
|
+
onCompositionStart?: (import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> & import("react").CompositionEventHandler<HTMLInputElement>) | undefined;
|
|
84
|
+
onCompositionStartCapture?: (import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> & import("react").CompositionEventHandler<HTMLInputElement>) | undefined;
|
|
85
|
+
onCompositionUpdate?: (import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> & import("react").CompositionEventHandler<HTMLInputElement>) | undefined;
|
|
86
|
+
onCompositionUpdateCapture?: (import("react").CompositionEventHandler<import("@react-types/shared").FocusableElement> & import("react").CompositionEventHandler<HTMLInputElement>) | undefined;
|
|
87
|
+
onFocus?: (import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
|
88
|
+
onFocusCapture?: (import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
|
89
|
+
onBlur?: (import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
|
90
|
+
onBlurCapture?: (import("react").FocusEventHandler<import("@react-types/shared").FocusableElement> & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
|
91
|
+
onChange?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").ChangeEventHandler<HTMLInputElement>) | undefined;
|
|
92
|
+
onChangeCapture?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
93
|
+
onBeforeInput?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
94
|
+
onBeforeInputCapture?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
95
|
+
onInput?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
96
|
+
onInputCapture?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
97
|
+
onReset?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
98
|
+
onResetCapture?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
99
|
+
onSubmit?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
100
|
+
onSubmitCapture?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
101
|
+
onInvalid?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
102
|
+
onInvalidCapture?: (import("react").FormEventHandler<import("@react-types/shared").FocusableElement> & import("react").FormEventHandler<HTMLInputElement>) | undefined;
|
|
103
|
+
onLoad?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
104
|
+
onLoadCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
105
|
+
onError?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
106
|
+
onErrorCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
107
|
+
onKeyDown?: (import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").KeyboardEventHandler<HTMLInputElement>) | undefined;
|
|
108
|
+
onKeyDownCapture?: (import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").KeyboardEventHandler<HTMLInputElement>) | undefined;
|
|
109
|
+
onKeyPress?: (import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").KeyboardEventHandler<HTMLInputElement>) | undefined;
|
|
110
|
+
onKeyPressCapture?: (import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").KeyboardEventHandler<HTMLInputElement>) | undefined;
|
|
111
|
+
onKeyUp?: (import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").KeyboardEventHandler<HTMLInputElement>) | undefined;
|
|
112
|
+
onKeyUpCapture?: (import("react").KeyboardEventHandler<import("@react-types/shared").FocusableElement> & import("react").KeyboardEventHandler<HTMLInputElement>) | undefined;
|
|
113
|
+
onAbort?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
114
|
+
onAbortCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
115
|
+
onCanPlay?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
116
|
+
onCanPlayCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
117
|
+
onCanPlayThrough?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
118
|
+
onCanPlayThroughCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
119
|
+
onDurationChange?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
120
|
+
onDurationChangeCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
121
|
+
onEmptied?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
122
|
+
onEmptiedCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
123
|
+
onEncrypted?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
124
|
+
onEncryptedCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
125
|
+
onEnded?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
126
|
+
onEndedCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
127
|
+
onLoadedData?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
128
|
+
onLoadedDataCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
129
|
+
onLoadedMetadata?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
130
|
+
onLoadedMetadataCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
131
|
+
onLoadStart?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
132
|
+
onLoadStartCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
133
|
+
onPause?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
134
|
+
onPauseCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
135
|
+
onPlay?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
136
|
+
onPlayCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
137
|
+
onPlaying?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
138
|
+
onPlayingCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
139
|
+
onProgress?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
140
|
+
onProgressCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
141
|
+
onRateChange?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
142
|
+
onRateChangeCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
143
|
+
onResize?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
144
|
+
onResizeCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
145
|
+
onSeeked?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
146
|
+
onSeekedCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
147
|
+
onSeeking?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
148
|
+
onSeekingCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
149
|
+
onStalled?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
150
|
+
onStalledCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
151
|
+
onSuspend?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
152
|
+
onSuspendCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
153
|
+
onTimeUpdate?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
154
|
+
onTimeUpdateCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
155
|
+
onVolumeChange?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
156
|
+
onVolumeChangeCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
157
|
+
onWaiting?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
158
|
+
onWaitingCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
159
|
+
onAuxClick?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
160
|
+
onAuxClickCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
161
|
+
onClick?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
162
|
+
onClickCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
163
|
+
onContextMenu?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
164
|
+
onContextMenuCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
165
|
+
onDoubleClick?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
166
|
+
onDoubleClickCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
167
|
+
onDrag?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
168
|
+
onDragCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
169
|
+
onDragEnd?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
170
|
+
onDragEndCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
171
|
+
onDragEnter?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
172
|
+
onDragEnterCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
173
|
+
onDragExit?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
174
|
+
onDragExitCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
175
|
+
onDragLeave?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
176
|
+
onDragLeaveCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
177
|
+
onDragOver?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
178
|
+
onDragOverCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
179
|
+
onDragStart?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
180
|
+
onDragStartCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
181
|
+
onDrop?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
182
|
+
onDropCapture?: (import("react").DragEventHandler<import("@react-types/shared").FocusableElement> & import("react").DragEventHandler<HTMLInputElement>) | undefined;
|
|
183
|
+
onMouseDown?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
184
|
+
onMouseDownCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
185
|
+
onMouseEnter?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
186
|
+
onMouseLeave?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
187
|
+
onMouseMove?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
188
|
+
onMouseMoveCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
189
|
+
onMouseOut?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
190
|
+
onMouseOutCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
191
|
+
onMouseOver?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
192
|
+
onMouseOverCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
193
|
+
onMouseUp?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
194
|
+
onMouseUpCapture?: (import("react").MouseEventHandler<import("@react-types/shared").FocusableElement> & import("react").MouseEventHandler<HTMLInputElement>) | undefined;
|
|
195
|
+
onSelect?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
196
|
+
onSelectCapture?: (import("react").ReactEventHandler<import("@react-types/shared").FocusableElement> & import("react").ReactEventHandler<HTMLInputElement>) | undefined;
|
|
197
|
+
onTouchCancel?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
198
|
+
onTouchCancelCapture?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
199
|
+
onTouchEnd?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
200
|
+
onTouchEndCapture?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
201
|
+
onTouchMove?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
202
|
+
onTouchMoveCapture?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
203
|
+
onTouchStart?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
204
|
+
onTouchStartCapture?: (import("react").TouchEventHandler<import("@react-types/shared").FocusableElement> & import("react").TouchEventHandler<HTMLInputElement>) | undefined;
|
|
205
|
+
onPointerDown?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
206
|
+
onPointerDownCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
207
|
+
onPointerMove?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
208
|
+
onPointerMoveCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
209
|
+
onPointerUp?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
210
|
+
onPointerUpCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
211
|
+
onPointerCancel?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
212
|
+
onPointerCancelCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
213
|
+
onPointerEnter?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
214
|
+
onPointerLeave?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
215
|
+
onPointerOver?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
216
|
+
onPointerOverCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
217
|
+
onPointerOut?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
218
|
+
onPointerOutCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
219
|
+
onGotPointerCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
220
|
+
onGotPointerCaptureCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
221
|
+
onLostPointerCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
222
|
+
onLostPointerCaptureCapture?: (import("react").PointerEventHandler<import("@react-types/shared").FocusableElement> & import("react").PointerEventHandler<HTMLInputElement>) | undefined;
|
|
223
|
+
onScroll?: (import("react").UIEventHandler<import("@react-types/shared").FocusableElement> & import("react").UIEventHandler<HTMLInputElement>) | undefined;
|
|
224
|
+
onScrollCapture?: (import("react").UIEventHandler<import("@react-types/shared").FocusableElement> & import("react").UIEventHandler<HTMLInputElement>) | undefined;
|
|
225
|
+
onWheel?: (import("react").WheelEventHandler<import("@react-types/shared").FocusableElement> & import("react").WheelEventHandler<HTMLInputElement>) | undefined;
|
|
226
|
+
onWheelCapture?: (import("react").WheelEventHandler<import("@react-types/shared").FocusableElement> & import("react").WheelEventHandler<HTMLInputElement>) | undefined;
|
|
227
|
+
onAnimationStart?: (import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> & import("react").AnimationEventHandler<HTMLInputElement>) | undefined;
|
|
228
|
+
onAnimationStartCapture?: (import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> & import("react").AnimationEventHandler<HTMLInputElement>) | undefined;
|
|
229
|
+
onAnimationEnd?: (import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> & import("react").AnimationEventHandler<HTMLInputElement>) | undefined;
|
|
230
|
+
onAnimationEndCapture?: (import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> & import("react").AnimationEventHandler<HTMLInputElement>) | undefined;
|
|
231
|
+
onAnimationIteration?: (import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> & import("react").AnimationEventHandler<HTMLInputElement>) | undefined;
|
|
232
|
+
onAnimationIterationCapture?: (import("react").AnimationEventHandler<import("@react-types/shared").FocusableElement> & import("react").AnimationEventHandler<HTMLInputElement>) | undefined;
|
|
233
|
+
onTransitionEnd?: (import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> & import("react").TransitionEventHandler<HTMLInputElement>) | undefined;
|
|
234
|
+
onTransitionEndCapture?: (import("react").TransitionEventHandler<import("@react-types/shared").FocusableElement> & import("react").TransitionEventHandler<HTMLInputElement>) | undefined;
|
|
235
|
+
accept?: string | undefined;
|
|
236
|
+
alt?: string | undefined;
|
|
237
|
+
autoComplete?: import("react").HTMLInputAutoCompleteAttribute | undefined;
|
|
238
|
+
capture?: boolean | "user" | "environment" | undefined;
|
|
239
|
+
checked?: boolean | undefined;
|
|
240
|
+
disabled?: boolean | undefined;
|
|
241
|
+
form?: string | undefined;
|
|
242
|
+
formAction?: string | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
|
|
243
|
+
formEncType?: string | undefined;
|
|
244
|
+
formMethod?: string | undefined;
|
|
245
|
+
formNoValidate?: boolean | undefined;
|
|
246
|
+
formTarget?: string | undefined;
|
|
247
|
+
height?: number | string | undefined;
|
|
248
|
+
list?: string | undefined;
|
|
249
|
+
max?: number | string | undefined;
|
|
250
|
+
maxLength?: number | undefined;
|
|
251
|
+
min?: number | string | undefined;
|
|
252
|
+
minLength?: number | undefined;
|
|
253
|
+
multiple?: boolean | undefined;
|
|
254
|
+
name?: string | undefined;
|
|
255
|
+
pattern?: string | undefined;
|
|
256
|
+
placeholder?: string | undefined;
|
|
257
|
+
readOnly?: boolean | undefined;
|
|
258
|
+
required?: boolean | undefined;
|
|
259
|
+
size?: number | undefined;
|
|
260
|
+
src?: string | undefined;
|
|
261
|
+
step?: number | string | undefined;
|
|
262
|
+
type?: import("react").HTMLInputTypeAttribute | undefined;
|
|
263
|
+
value?: string | readonly string[] | number | undefined;
|
|
264
|
+
width?: number | string | undefined;
|
|
265
|
+
defaultChecked?: boolean | undefined;
|
|
266
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
267
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
268
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
269
|
+
accessKey?: string | undefined;
|
|
270
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
271
|
+
autoFocus?: boolean | undefined;
|
|
272
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
273
|
+
contextMenu?: string | undefined;
|
|
274
|
+
dir?: string | undefined;
|
|
275
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
276
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
277
|
+
hidden?: boolean | undefined;
|
|
278
|
+
lang?: string | undefined;
|
|
279
|
+
nonce?: string | undefined;
|
|
280
|
+
slot?: string | undefined;
|
|
281
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
282
|
+
title?: string | undefined;
|
|
283
|
+
translate?: "yes" | "no" | undefined;
|
|
284
|
+
radioGroup?: string | undefined;
|
|
285
|
+
about?: string | undefined;
|
|
286
|
+
content?: string | undefined;
|
|
287
|
+
datatype?: string | undefined;
|
|
288
|
+
inlist?: any;
|
|
289
|
+
prefix?: string | undefined;
|
|
290
|
+
property?: string | undefined;
|
|
291
|
+
rel?: string | undefined;
|
|
292
|
+
resource?: string | undefined;
|
|
293
|
+
rev?: string | undefined;
|
|
294
|
+
typeof?: string | undefined;
|
|
295
|
+
vocab?: string | undefined;
|
|
296
|
+
autoCorrect?: string | undefined;
|
|
297
|
+
autoSave?: string | undefined;
|
|
298
|
+
color?: string | undefined;
|
|
299
|
+
itemProp?: string | undefined;
|
|
300
|
+
itemScope?: boolean | undefined;
|
|
301
|
+
itemType?: string | undefined;
|
|
302
|
+
itemID?: string | undefined;
|
|
303
|
+
itemRef?: string | undefined;
|
|
304
|
+
results?: number | undefined;
|
|
305
|
+
security?: string | undefined;
|
|
306
|
+
unselectable?: "on" | "off" | undefined;
|
|
307
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
308
|
+
is?: string | undefined;
|
|
33
309
|
ref: RefObject<HTMLInputElement | null>;
|
|
34
310
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
checked: boolean;
|
|
40
|
-
disabled: boolean;
|
|
41
|
-
readonly: boolean;
|
|
42
|
-
focusVisible: boolean;
|
|
311
|
+
isInvalid: boolean | undefined;
|
|
312
|
+
isHovered: boolean;
|
|
313
|
+
isFocused: boolean;
|
|
314
|
+
isFocusVisible: boolean;
|
|
43
315
|
};
|
|
44
316
|
export type UseToggleReturn = ReturnType<typeof useToggle>;
|
|
@@ -1,51 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useHover, useFocusRing, mergeProps } from "@koobiq/react-core";
|
|
3
|
+
import { useSwitch } from "@react-aria/switch";
|
|
4
|
+
import { useToggleState } from "@react-stately/toggle";
|
|
4
5
|
function useToggle(props, ref) {
|
|
5
|
-
const {
|
|
6
|
-
const state = useToggleState(
|
|
7
|
-
isSelected: checked,
|
|
8
|
-
defaultSelected: defaultChecked,
|
|
9
|
-
onChange
|
|
10
|
-
});
|
|
6
|
+
const { isInvalid, isDisabled } = props;
|
|
7
|
+
const state = useToggleState(props);
|
|
11
8
|
const { hoverProps, isHovered } = useHover({
|
|
12
|
-
isDisabled
|
|
9
|
+
isDisabled
|
|
13
10
|
});
|
|
14
11
|
const { focusProps, isFocused, isFocusVisible } = useFocusRing();
|
|
15
12
|
const {
|
|
16
13
|
labelProps: commonLabelProps,
|
|
17
14
|
inputProps: commonInputProps,
|
|
18
|
-
isInvalid,
|
|
19
|
-
isDisabled,
|
|
20
|
-
isSelected,
|
|
21
|
-
isReadOnly,
|
|
22
|
-
isPressed,
|
|
23
15
|
...other
|
|
24
|
-
} =
|
|
25
|
-
{
|
|
26
|
-
...props,
|
|
27
|
-
isInvalid: error,
|
|
28
|
-
isDisabled: disabled,
|
|
29
|
-
isRequired: required
|
|
30
|
-
},
|
|
31
|
-
state,
|
|
32
|
-
ref
|
|
33
|
-
);
|
|
16
|
+
} = useSwitch(props, state, ref);
|
|
34
17
|
const labelProps = mergeProps(hoverProps, commonLabelProps);
|
|
35
18
|
const inputProps = mergeProps(focusProps, commonInputProps, {
|
|
36
19
|
ref
|
|
37
20
|
});
|
|
38
21
|
return {
|
|
39
22
|
labelProps,
|
|
40
|
-
inputProps,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
checked: isSelected,
|
|
46
|
-
disabled: isDisabled,
|
|
47
|
-
readonly: isReadOnly,
|
|
48
|
-
focusVisible: isFocusVisible,
|
|
23
|
+
inputProps: { ...inputProps, "aria-invalid": isInvalid },
|
|
24
|
+
isInvalid,
|
|
25
|
+
isHovered,
|
|
26
|
+
isFocused,
|
|
27
|
+
isFocusVisible,
|
|
49
28
|
...other
|
|
50
29
|
};
|
|
51
30
|
}
|
|
@@ -11,8 +11,8 @@ const Button = polymorphicForwardRef(
|
|
|
11
11
|
const Tag = as || "button";
|
|
12
12
|
const commonProps = useSlottedContext(props, ButtonContext, slot);
|
|
13
13
|
const {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
isLoading,
|
|
15
|
+
isDisabled,
|
|
16
16
|
value,
|
|
17
17
|
name,
|
|
18
18
|
form,
|
|
@@ -23,10 +23,10 @@ const Button = polymorphicForwardRef(
|
|
|
23
23
|
formTarget
|
|
24
24
|
} = commonProps;
|
|
25
25
|
const domRef = useDOMRef(ref);
|
|
26
|
-
const {
|
|
26
|
+
const { isHovered, isPressed, isFocused, isFocusVisible, buttonProps } = useButton(
|
|
27
27
|
{
|
|
28
28
|
...commonProps,
|
|
29
|
-
...
|
|
29
|
+
...(isLoading || isDisabled) && {
|
|
30
30
|
onPress: void 0,
|
|
31
31
|
onPressStart: void 0,
|
|
32
32
|
onPressEnd: void 0,
|
|
@@ -37,18 +37,17 @@ const Button = polymorphicForwardRef(
|
|
|
37
37
|
onClick: void 0,
|
|
38
38
|
href: void 0
|
|
39
39
|
},
|
|
40
|
-
disabled,
|
|
41
40
|
elementType: as
|
|
42
41
|
},
|
|
43
42
|
domRef
|
|
44
43
|
);
|
|
45
44
|
const renderValues = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
isHovered,
|
|
46
|
+
isPressed,
|
|
47
|
+
isFocused,
|
|
48
|
+
isFocusVisible,
|
|
49
|
+
isLoading: isLoading || false,
|
|
50
|
+
isDisabled: isDisabled || false
|
|
52
51
|
};
|
|
53
52
|
const renderProps = useRenderProps({
|
|
54
53
|
...props,
|
|
@@ -69,9 +68,14 @@ const Button = polymorphicForwardRef(
|
|
|
69
68
|
},
|
|
70
69
|
...buttonProps,
|
|
71
70
|
...renderProps,
|
|
71
|
+
"data-hovered": isHovered,
|
|
72
|
+
"data-pressed": isPressed,
|
|
73
|
+
"data-focused": isFocused,
|
|
74
|
+
"data-disabled": isDisabled,
|
|
75
|
+
"data-focus-visible": isFocusVisible,
|
|
72
76
|
tabIndex: tabIndex || buttonProps.tabIndex,
|
|
73
|
-
"aria-disabled":
|
|
74
|
-
"aria-busy":
|
|
77
|
+
"aria-disabled": isLoading ? "true" : buttonProps["aria-disabled"],
|
|
78
|
+
"aria-busy": isLoading,
|
|
75
79
|
ref: domRef,
|
|
76
80
|
children: renderProps.children
|
|
77
81
|
}
|
|
@@ -3,12 +3,12 @@ import type { HoverEvent } from '@react-types/shared';
|
|
|
3
3
|
import type { ButtonOptions } from '../../types';
|
|
4
4
|
import type { RenderProps } from '../../utils';
|
|
5
5
|
export type ButtonRenderProps = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
isHovered: boolean;
|
|
7
|
+
isFocused: boolean;
|
|
8
|
+
isPressed: boolean;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
isDisabled: boolean;
|
|
11
|
+
isFocusVisible: boolean;
|
|
12
12
|
};
|
|
13
13
|
export type ButtonBaseProps = ExtendableProps<RenderProps<ButtonRenderProps>, ButtonOptions & {
|
|
14
14
|
/** Handler that is called when a hover interaction starts. */
|
|
@@ -39,5 +39,5 @@ export type ButtonBaseProps = ExtendableProps<RenderProps<ButtonRenderProps>, Bu
|
|
|
39
39
|
formTarget?: string;
|
|
40
40
|
tabIndex?: number;
|
|
41
41
|
slot?: string;
|
|
42
|
-
|
|
42
|
+
isLoading?: boolean;
|
|
43
43
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<import("
|
|
1
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<import("@react-aria/checkbox").AriaCheckboxProps, keyof import("../..").RenderProps<import("./types").CheckboxRenderProps> | "inputRef"> & import("../..").RenderProps<import("./types").CheckboxRenderProps> & {
|
|
2
2
|
inputRef?: import("react").RefObject<HTMLInputElement | null>;
|
|
3
3
|
} & import("react").RefAttributes<HTMLLabelElement>>;
|
|
@@ -10,13 +10,15 @@ const Checkbox = forwardRef(
|
|
|
10
10
|
const { children, inputRef } = props;
|
|
11
11
|
const domRef = useDOMRef(inputRef);
|
|
12
12
|
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
isHovered,
|
|
14
|
+
isInvalid,
|
|
15
|
+
isSelected,
|
|
16
|
+
isFocused,
|
|
17
|
+
isPressed,
|
|
18
|
+
isReadOnly,
|
|
19
|
+
isDisabled,
|
|
20
|
+
isFocusVisible,
|
|
21
|
+
isIndeterminate,
|
|
20
22
|
labelProps,
|
|
21
23
|
inputProps
|
|
22
24
|
} = useCheckbox(
|
|
@@ -27,14 +29,14 @@ const Checkbox = forwardRef(
|
|
|
27
29
|
domRef
|
|
28
30
|
);
|
|
29
31
|
const renderValues = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
isHovered,
|
|
33
|
+
isInvalid,
|
|
34
|
+
isSelected,
|
|
35
|
+
isFocused,
|
|
36
|
+
isPressed,
|
|
37
|
+
isFocusVisible,
|
|
38
|
+
isIndeterminate,
|
|
39
|
+
isDisabled: props.isDisabled || false
|
|
38
40
|
};
|
|
39
41
|
const renderProps = useRenderProps({
|
|
40
42
|
...props,
|
|
@@ -42,10 +44,25 @@ const Checkbox = forwardRef(
|
|
|
42
44
|
});
|
|
43
45
|
const DOMProps = filterDOMProps(props);
|
|
44
46
|
delete DOMProps.id;
|
|
45
|
-
return /* @__PURE__ */ jsxs(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"label",
|
|
49
|
+
{
|
|
50
|
+
"data-hovered": isHovered,
|
|
51
|
+
"data-pressed": isPressed,
|
|
52
|
+
"data-focused": isFocused,
|
|
53
|
+
"data-invalid": isInvalid,
|
|
54
|
+
"data-selected": isSelected,
|
|
55
|
+
"data-disabled": isDisabled,
|
|
56
|
+
"data-read-only": isReadOnly,
|
|
57
|
+
"data-focus-visible": isFocusVisible,
|
|
58
|
+
...mergeProps(DOMProps, labelProps, renderProps),
|
|
59
|
+
ref,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { elementType: "span", children: /* @__PURE__ */ jsx("input", { ...inputProps, ref: domRef }) }),
|
|
62
|
+
renderProps.children
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
49
66
|
}
|
|
50
67
|
);
|
|
51
68
|
Checkbox.displayName = "Checkbox";
|