Skip to content

Commit cac2899

Browse files
committed
fix(website): correct TypeScript type mismatches in React samples
- Fix number/string mismatches (Input value, StepInput min/step, RatingIndicator value, Table rowKey, TableHeaderCell importance, TabContainer additionalText) - Fix deprecated/renamed props (CardHeader status→additionalText, Tree mode→selectionMode, MultiSelect→Multiple, maxLength→maxlength) - Remove non-existent HTML attributes used as props (timestamp, handler) - Fix boolean string props (preventFocusRestore, nameClickable) - Fix Table/Selection event handler typing - Fix typo tabindsex→tabIndex
1 parent a4c8136 commit cac2899

File tree

20 files changed

+56
-69
lines changed

20 files changed

+56
-69
lines changed

packages/website/docs/_samples/main/AvatarGroup/IndividualWithPopover/sample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function App() {
7474
className="personPopover"
7575
style={{ width: "300px" }}
7676
placement="Bottom"
77-
preventFocusRestore=""
77+
preventFocusRestore={true}
7878
>
7979
<div className="avatar-slot" style={{ display: "inline-block" }}>
8080
<Avatar

packages/website/docs/_samples/main/Card/WithTimeline/sample.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,18 @@ function App() {
2828
<Timeline>
2929
<TimelineItem
3030
titleText="called"
31-
timestamp={1487583000000}
3231
icon="phone"
3332
name="John Smith"
3433
nameClickable={true}
3534
/>
3635
<TimelineItem
3736
titleText="Weekly Sync - BTP Design"
38-
timestamp={1517349600000}
3937
icon="calendar"
4038
>
4139
MR SOF02 2.43
4240
</TimelineItem>
4341
<TimelineItem
4442
titleText="Video Conference Call - UI5"
45-
timestamp={1485813600000}
4643
icon="calendar"
4744
>
4845
Online meeting

packages/website/docs/_samples/main/Carousel/CardsWithHidden/sample.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function App() {
4141
>
4242
<CardHeader
4343
slot="header"
44-
status="Item 1"
44+
additionalText="Item 1"
4545
titleText="Visible Card 1"
4646
subtitleText="This card is visible"
4747
/>
@@ -65,7 +65,7 @@ function App() {
6565
>
6666
<CardHeader
6767
slot="header"
68-
status="Item 2"
68+
additionalText="Item 2"
6969
titleText="Hidden Card 2"
7070
subtitleText="This card is hidden via attribute"
7171
>
@@ -85,7 +85,7 @@ function App() {
8585
>
8686
<CardHeader
8787
slot="header"
88-
status="Item 3"
88+
additionalText="Item 3"
8989
titleText="Visible Card 3"
9090
subtitleText="Visible card after hidden one"
9191
/>
@@ -105,7 +105,7 @@ function App() {
105105
>
106106
<CardHeader
107107
slot="header"
108-
status="Item 4"
108+
additionalText="Item 4"
109109
titleText="Visible Card 4"
110110
subtitleText="Visible item example"
111111
/>
@@ -129,7 +129,7 @@ function App() {
129129
>
130130
<CardHeader
131131
slot="header"
132-
status="Item 5"
132+
additionalText="Item 5"
133133
titleText="Hidden Card 5"
134134
subtitleText="Another hidden example"
135135
>
@@ -147,7 +147,7 @@ function App() {
147147
>
148148
<CardHeader
149149
slot="header"
150-
status="Item 6"
150+
additionalText="Item 6"
151151
titleText="Visible Card 6"
152152
subtitleText="End of visible sequence"
153153
/>

packages/website/docs/_samples/main/Carousel/MultipleItemsPerPage/sample.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,18 @@ function App() {
6060
<TimelineItem
6161
id="test-item"
6262
titleText="called"
63-
timestamp={1487583000000}
6463
icon="phone"
6564
name="John Smith"
66-
nameClickable=""
65+
nameClickable={true}
6766
/>
6867
<TimelineItem
6968
titleText="Weekly Sync - CP Design"
70-
timestamp={1517349600000}
7169
icon="calendar"
7270
>
7371
MR SOF02 2.43
7472
</TimelineItem>
7573
<TimelineItem
7674
titleText="Video Conference Call - UI5"
77-
timestamp={1485813600000}
7875
icon="calendar"
7976
>
8077
Online meeting
@@ -106,7 +103,7 @@ function App() {
106103
slot="header"
107104
titleText="Team Dolphins"
108105
subtitleText="Direct Reports"
109-
status="1 of 2"
106+
additionalText="1 of 2"
110107
>
111108
<Icon name="group" slot="avatar" />
112109
</CardHeader>
@@ -143,7 +140,7 @@ function App() {
143140
titleText="Team Bears"
144141
subtitleText="Direct Reports"
145142
interactive={true}
146-
status="2 of 2"
143+
additionalText="2 of 2"
147144
>
148145
<Icon name="group" slot="avatar" />
149146
</CardHeader>

packages/website/docs/_samples/main/Form/CustomHeader/sample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function App() {
6262
<Label id="cityLbl" for="cityInp" slot="labelContent">
6363
ZIP Code/City:
6464
</Label>
65-
<Input id="cityInp" value={411} accessibleNameRef="cityLbl" />
65+
<Input id="cityInp" value="411" accessibleNameRef="cityLbl" />
6666
<Input value="Maintown" accessibleNameRef="cityLbl" />
6767
</FormItem>
6868

@@ -80,7 +80,7 @@ function App() {
8080
<Input id="streetInp" value="Main St" accessibleNameRef="streetLbl" />
8181
<Input
8282
id="streetNumberInp"
83-
value={1618}
83+
value="1618"
8484
accessibleNameRef="streetLbl"
8585
/>
8686
</FormItem>

packages/website/docs/_samples/main/Form/EmptySpan/sample.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function App() {
7878
<Label id="cityLbl" for="cityInp" slot="labelContent">
7979
ZIP Code/City:
8080
</Label>
81-
<Input id="cityInp" value={411} accessibleNameRef="cityLbl" />
81+
<Input id="cityInp" value="411" accessibleNameRef="cityLbl" />
8282
<Input value="Maintown" accessibleNameRef="cityLbl" />
8383
</FormItem>
8484

@@ -100,7 +100,7 @@ function App() {
100100
/>
101101
<Input
102102
id="streetNumberInp"
103-
value={1618}
103+
value="1618"
104104
accessibleNameRef="streetLbl"
105105
/>
106106
</FormItem>
@@ -143,7 +143,7 @@ function App() {
143143
<Label id="cityLbl" for="cityInp" slot="labelContent">
144144
ZIP Code/City:
145145
</Label>
146-
<Input id="cityInp" value={411} accessibleNameRef="cityLbl" />
146+
<Input id="cityInp" value="411" accessibleNameRef="cityLbl" />
147147
<Input value="Maintown" accessibleNameRef="cityLbl" />
148148
</FormItem>
149149

@@ -165,7 +165,7 @@ function App() {
165165
/>
166166
<Input
167167
id="streetNumberInp"
168-
value={1618}
168+
value="1618"
169169
accessibleNameRef="streetLbl"
170170
/>
171171
</FormItem>

packages/website/docs/_samples/main/Form/FreeStyleForm/sample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function App() {
119119
id="streetInp"
120120
placeholder="Write your message here"
121121
showExceededText={true}
122-
maxLength={10}
122+
maxlength={10}
123123
/>
124124
</FormItem>
125125

packages/website/docs/_samples/main/Form/ItemColumnSpan/sample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function App() {
8989
id="additionalCommentsInp"
9090
placeholder="Write your message here"
9191
showExceededText={true}
92-
maxLength={10}
92+
maxlength={10}
9393
/>
9494
</FormItem>
9595
</Form>

packages/website/docs/_samples/main/Form/LabelsOnTop/sample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function App() {
6666
<Label id="cityLbl" for="cityInp" slot="labelContent">
6767
ZIP Code/City:
6868
</Label>
69-
<Input id="cityInp" value={411} accessibleNameRef="cityLbl" />
69+
<Input id="cityInp" value="411" accessibleNameRef="cityLbl" />
7070
<Input value="Maintown" accessibleNameRef="cityLbl" />
7171
</FormItem>
7272

@@ -81,7 +81,7 @@ function App() {
8181
/>
8282
<Input
8383
id="streetNumberInp"
84-
value={1618}
84+
value="1618"
8585
accessibleNameRef="streetLbl"
8686
/>
8787
</FormItem>

packages/website/docs/_samples/main/RatingIndicator/CustomIcons/sample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function App() {
1616
<RatingIndicator value={4} ratedIcon="thumb-up" unratedIcon="border" />
1717
<br />
1818
<RatingIndicator
19-
value="2.5"
19+
value={2.5}
2020
ratedIcon="circle-task-2"
2121
unratedIcon="border"
2222
readonly={true}

0 commit comments

Comments
 (0)