Skip to content

Commit

Permalink
Update documentation to match API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
necolas committed Mar 21, 2023
1 parent 47671ca commit 550afdc
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ permalink: /docs/style-sheet/index.html
eleventyNavigation:
key: StyleSheet
parent: APIs
label: "Change"
---

{% import "fragments/macros.html" as macro with context %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ eleventyNavigation:
key: Unstable APIs
parent: Appendix
order: 1
label: "Change"
---

:::lead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ permalink: /docs/text-input/index.html
eleventyNavigation:
key: TextInput
parent: Components
label: "Change"
---

{% import "fragments/macros.html" as macro with context %}
Expand All @@ -31,12 +32,16 @@ import { TextInput } from 'react-native-web';
The [accessibility props]({{ '/docs/accessibility' | url }}).
{% endcall %}

{% call macro.prop('...ClickProps') %}
The [click props]({{ '/docs/interactions' | url }}).
{% call macro.prop('...PointerProps') %}
The [PointerEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...FocusProps') %}
The [focus props]({{ '/docs/interactions' | url }}).
The [FocusEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...KeyboardProps') %}
The [KeyboardEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('autoCapitalize', '?string') %}
Expand Down Expand Up @@ -79,11 +84,15 @@ Equivalent to [HTMLElement.dir](https://developer.mozilla.org/en-US/docs/Web/API
Equivalent to [HTMLElement.disabled](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled)
{% endcall %}

{% call macro.prop('editable', '?boolean = true') %}
Equivalent to [HTMLElement.readonly](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly)
{% call macro.prop('enterKeyHint', '?string') %}
Specifies what action label (or icon) to present for the enter key on virtual keyboards. Equivalent to [HTMLElement.enterkeyhint](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-enterkeyhint-attribute)
{% endcall %}

{% call macro.prop('id', '?string') %}
Equivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
{% endcall %}

{% call macro.prop('keyboardType', '?string') %}
{% call macro.prop('inputMode', '?string') %}
Hints at the type of data that might be entered by the user while editing the element or its contents. Equivalent to [HTMLElement.inputMode](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode). Safari iOS requires an ancestral `<form action>` element to display the search keyboard. (Not available when multiline is true.)
{% endcall %}

Expand All @@ -99,14 +108,6 @@ Equivalent to [HTMLElement.maxlength](https://developer.mozilla.org/en-US/docs/W
If `true`, the text input can be multiple lines.
{% endcall %}

{% call macro.prop('nativeID', '?string') %}
Equivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
{% endcall %}

{% call macro.prop('numberOfLines', '?number = 1') %}
Sets the number of lines for a multiline input. (Requires `multiline` to be `true`.)
{% endcall %}

{% call macro.prop('onChange', '?(e: ChangeEvent) => void') %}
Equivalent to the React DOM `ChangeEvent`.
{% endcall %}
Expand Down Expand Up @@ -139,7 +140,6 @@ Callback that is called when the text input's selection changes.
Callback that is called when the keyboard's submit button is pressed. When `multiline={true}`, this is only called if `blurOnSubmit={true}`.
{% endcall %}


{% call macro.prop('placeholder', '?boolean') %}
Text that appears in the form control when it has no value set.
{% endcall %}
Expand All @@ -148,8 +148,12 @@ Text that appears in the form control when it has no value set.
Equivalent to defining `::placeholder { color }` via a CSS property.
{% endcall %}

{% call macro.prop('returnKeyType', '?string') %}
Specifies what action label (or icon) to present for the enter key on virtual keyboards. Equivalent to [HTMLElement.enterkeyhint](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-enterkeyhint-attribute)
{% call macro.prop('readOnly', '?boolean = false') %}
Equivalent to [HTMLElement.readonly](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly)
{% endcall %}

{% call macro.prop('rows', '?number = 1') %}
Sets the number of lines for a multiline input. (Requires `multiline` to be `true`.)
{% endcall %}

{% call macro.prop('secureTextEntry', '?boolean = false') %}
Expand Down
33 changes: 15 additions & 18 deletions packages/react-native-web-docs/src/pages/docs/components/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ permalink: /docs/text/index.html
eleventyNavigation:
key: Text
parent: Components
label: "Change"
---

{% import "fragments/macros.html" as macro with context %}
Expand All @@ -21,7 +22,7 @@ import { Text } from 'react-native';
<Text {...props}>{children}</Text>;
```

::: callout
::: callout
**Did you know?** Text styling in {{ site.name }} has stricter rules than it does on the web. Read the [Styling]({{ '/docs/styling' | url }}) guide to learn more.
:::

Expand All @@ -35,20 +36,20 @@ import { Text } from 'react-native';
The [accessibility props]({{ '/docs/accessibility' | url }}).
{% endcall %}

{% call macro.prop('...ClickProps') %}
The [click props]({{ '/docs/interactions' | url }}).
{% call macro.prop('...PointerProps') %}
The [PointerEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...FocusProps') %}
The [focus props]({{ '/docs/interactions' | url }}).
The [FocusEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...KeyboardProps') %}
The [keyboard props]({{ '/docs/interactions' | url }}).
The [KeyboardEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...ResponderProps') %}
The [responder props]({{ '/docs/interactions' | url }}).
The [ResponderEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('children', 'any') %}
Expand All @@ -63,10 +64,6 @@ Equivalent to [HTMLElement.dataset](https://developer.mozilla.org/en-US/docs/Web
Equivalent to [HTMLElement.dir](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dir). The default value of `"auto"` is not set on *nested* text elements.
{% endcall %}

{% call macro.prop('focusable', '?boolean') %}
Set whether the view can receive keyboard focus.
{% endcall %}

{% call macro.prop('href', '?string') %}
If `href` is defined, the view is rendered as an anchor tag pointing to this URL.
{% endcall %}
Expand All @@ -75,12 +72,12 @@ If `href` is defined, the view is rendered as an anchor tag pointing to this URL
If `href` is defined, this prop defines related attributes to include on the anchor (e.g., `download`, `rel`, `target`) which may modify its behavior.
{% endcall %}

{% call macro.prop('lang', '?string') %}
Equivalent to [HTMLElement.lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). This prop is used to infer writing direction if no `dir` is set.
{% call macro.prop('id', '?string') %}
Equivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
{% endcall %}

{% call macro.prop('nativeID', '?string') %}
Equivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
{% call macro.prop('lang', '?string') %}
Equivalent to [HTMLElement.lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). This prop is used to infer writing direction if no `dir` is set.
{% endcall %}

{% call macro.prop('numberOfLines', '?number') %}
Expand All @@ -91,14 +88,14 @@ Truncates the text with an ellipsis after this many lines.
This is invoked when a component is mounted and when its layout changes. `x` and `y` are the offsets from the parent node.
{% endcall %}

{% call macro.prop('selectable', '?boolean = true') %}
When `false`, the text is not selectable.
{% endcall %}

{% call macro.prop('style', '?Style') %}
Set the styles of the text. `Text` supports typographic styles in addition to those of `View`.
{% endcall %}

{% call macro.prop('tabIndex', '0 | -1') %}
Set whether the view can receive keyboard focus.
{% endcall %}

{% call macro.prop('testID', '?string') %}
Set the test selector label (via `data-testid`).
{% endcall %}
Expand Down
31 changes: 14 additions & 17 deletions packages/react-native-web-docs/src/pages/docs/components/view.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ permalink: /docs/view/index.html
eleventyNavigation:
key: View
parent: Components
label: "Change"
---

{% import "fragments/macros.html" as macro with context %}
Expand Down Expand Up @@ -37,20 +38,20 @@ import { View } from 'react-native';
The [accessibility props]({{ '/docs/accessibility' | url }}).
{% endcall %}

{% call macro.prop('...ClickProps') %}
The [click props]({{ '/docs/interactions' | url }}).
{% call macro.prop('...PointerProps') %}
The [PointerEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...FocusProps') %}
The [focus props]({{ '/docs/interactions' | url }}).
The [FocusEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...KeyboardProps') %}
The [keyboard props]({{ '/docs/interactions' | url }}).
The [KeyboardEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('...ResponderProps') %}
The [responder props]({{ '/docs/interactions' | url }}).
The [ResponderEvent props]({{ '/docs/interactions' | url }}).
{% endcall %}

{% call macro.prop('children', 'any') %}
Expand All @@ -65,10 +66,6 @@ Equivalent to [HTMLElement.dataset](https://developer.mozilla.org/en-US/docs/Web
Equivalent to [HTMLElement.dir](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir).
{% endcall %}

{% call macro.prop('focusable', '?boolean') %}
Set whether the view can receive keyboard focus.
{% endcall %}

{% call macro.prop('href', '?string') %}
If `href` is defined, the view is rendered as an anchor tag pointing to this URL.
{% endcall %}
Expand All @@ -77,26 +74,26 @@ If `href` is defined, the view is rendered as an anchor tag pointing to this URL
If `href` is defined, this prop defines related attributes to include on the anchor (e.g., `download`, `rel`, `target`) which may modify its behavior.
{% endcall %}

{% call macro.prop('lang', '?string') %}
Equivalent to [HTMLElement.lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). This prop is used to infer writing direction if no `dir` is set.
{% call macro.prop('id', '?string') %}
Equivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
{% endcall %}

{% call macro.prop('nativeID', '?string') %}
Equivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
{% call macro.prop('lang', '?string') %}
Equivalent to [HTMLElement.lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). This prop is used to infer writing direction if no `dir` is set.
{% endcall %}

{% call macro.prop('onLayout', '?({ nativeEvent: { layout: { x, y, width, height } } }) => void') %}
This is invoked when a component is mounted and when its layout changes. `x` and `y` are the offsets from the parent node.
{% endcall %}

{% call macro.prop('pointerEvents', '?("all" | "none" | "box-only" | "box-none")') %}
Equivalent to [CSS pointer-events](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events) with 2 additional values. A value of `"box-none"` preserves pointer events on the element's children; `"box-only"` disables pointer events on the element's children.
{% endcall %}

{% call macro.prop('style', '?Style') %}
Set the styles of the view.
{% endcall %}

{% call macro.prop('tabIndex', '0 | -1') %}
Set whether the view can receive keyboard focus.
{% endcall %}

{% call macro.prop('testID', '?string') %}
Set the test selector label (via `data-testid`).
{% endcall %}
Expand Down
Loading

0 comments on commit 550afdc

Please sign in to comment.