@react-types/shared 3.18.0 → 3.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/shared",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "9d1ba9bd8ebcd63bf3495ade16d349bcb71795ce"
17
+ "gitHead": "d4dfe4bb842a914f10045ee63fc6b92f034c5b30"
18
18
  }
package/src/dom.d.ts CHANGED
@@ -121,9 +121,16 @@ export interface TextInputDOMEvents {
121
121
  onInput?: FormEventHandler<HTMLInputElement>
122
122
  }
123
123
 
124
+ export interface InputDOMProps {
125
+ /**
126
+ * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
127
+ */
128
+ name?: string
129
+ }
130
+
124
131
  // DOM props that apply to all text inputs
125
132
  // Ensure this is synced with useTextField
126
- export interface TextInputDOMProps extends DOMProps, TextInputDOMEvents {
133
+ export interface TextInputDOMProps extends DOMProps, InputDOMProps, TextInputDOMEvents {
127
134
  /**
128
135
  * Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).
129
136
  */
@@ -139,11 +146,6 @@ export interface TextInputDOMProps extends DOMProps, TextInputDOMEvents {
139
146
  */
140
147
  minLength?: number,
141
148
 
142
- /**
143
- * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
144
- */
145
- name?: string,
146
-
147
149
  /**
148
150
  * Regex pattern that the value of the input must match to be valid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern).
149
151
  */
package/src/events.d.ts CHANGED
@@ -44,10 +44,16 @@ export interface PressEvent {
44
44
  /** Whether the meta keyboard modifier was held during the press event. */
45
45
  metaKey: boolean,
46
46
  /** Whether the alt keyboard modifier was held during the press event. */
47
- altKey: boolean
47
+ altKey: boolean,
48
+ /**
49
+ * By default, press events stop propagation to parent elements.
50
+ * In cases where a handler decides not to handle a specific event,
51
+ * it can call `continuePropagation()` to allow a parent to handle it.
52
+ */
53
+ continuePropagation(): void
48
54
  }
49
55
 
50
- export interface LongPressEvent extends Omit<PressEvent, 'type'> {
56
+ export interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
51
57
  /** The type of long press event being fired. */
52
58
  type: 'longpressstart' | 'longpressend' | 'longpress'
53
59
  }
package/src/style.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface StyleProps {
26
26
  // For backward compatibility!
27
27
  /** Sets the CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. Only use as a **last resort**. Use style props instead. */
28
28
  UNSAFE_className?: string,
29
- /** Sets inline [style](https://developer.mozilla.org/en-US/docs/Web/API/Element/style) for the element. Only use as a **last resort**. Use style props instead. */
29
+ /** Sets inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. Only use as a **last resort**. Use style props instead. */
30
30
  UNSAFE_style?: CSSProperties,
31
31
 
32
32
  /** The margin for all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin). */