Skip to content

Commit c091292

Browse files
committed
chore: add fake components
1 parent 91a12b9 commit c091292

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"./chat-bubble": "./chat-bubble/index.js",
4444
"./loading-bar": "./loading-bar/index.js",
4545
"./support-prompt-group": "./support-prompt-group/index.js",
46+
"./robot": "./robot/index.js",
47+
"./star": "./star/index.js",
4648
"./test-utils/dom": "./test-utils/dom/index.js",
4749
"./test-utils/selectors": "./test-utils/selectors/index.js",
4850
"./internal/api-docs/*.js": "./internal/api-docs/*.js"

src/__tests__/__snapshots__/documenter.test.ts.snap

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,67 @@ with rounded corners.",
197197
}
198198
`;
199199
200+
exports[`definition for robot matches the snapshot > robot 1`] = `
201+
{
202+
"dashCaseName": "robot",
203+
"events": [],
204+
"functions": [],
205+
"name": "Robot",
206+
"properties": [
207+
{
208+
"inlineType": {
209+
"name": ""small" | "large"",
210+
"type": "union",
211+
"values": [
212+
"small",
213+
"large",
214+
],
215+
},
216+
"name": "size",
217+
"optional": false,
218+
"type": "string",
219+
},
220+
],
221+
"regions": [],
222+
"releaseStatus": "stable",
223+
"systemTags": [
224+
"core",
225+
],
226+
}
227+
`;
228+
229+
exports[`definition for star matches the snapshot > star 1`] = `
230+
{
231+
"dashCaseName": "star",
232+
"events": [],
233+
"functions": [],
234+
"name": "Star",
235+
"properties": [
236+
{
237+
"inlineType": {
238+
"name": "{ width: number; }",
239+
"properties": [
240+
{
241+
"name": "width",
242+
"optional": false,
243+
"type": "number",
244+
},
245+
],
246+
"type": "object",
247+
},
248+
"name": "style",
249+
"optional": false,
250+
"systemTags": [
251+
"core",
252+
],
253+
"type": "{ width: number; }",
254+
},
255+
],
256+
"regions": [],
257+
"releaseStatus": "stable",
258+
}
259+
`;
260+
200261
exports[`definition for support-prompt-group matches the snapshot > support-prompt-group 1`] = `
201262
{
202263
"dashCaseName": "support-prompt-group",

src/robot/index.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import { getDataAttributes } from "../internal/base-component/get-data-attributes";
4+
import useBaseComponent from "../internal/base-component/use-base-component";
5+
import { applyDisplayName } from "../internal/utils/apply-display-name";
6+
7+
export interface RobotProps {
8+
size: "small" | "large";
9+
}
10+
11+
/**
12+
* @awsuiSystem core
13+
*/
14+
export default function Robot({ size, ...rest }: RobotProps) {
15+
const { __internalRootRef } = useBaseComponent("Robot", { props: { size } });
16+
return (
17+
<span ref={__internalRootRef} {...getDataAttributes(rest)}>
18+
🤖
19+
</span>
20+
);
21+
}
22+
23+
applyDisplayName(Robot, "Robot");

src/star/index.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import { getDataAttributes } from "../internal/base-component/get-data-attributes";
4+
import useBaseComponent from "../internal/base-component/use-base-component";
5+
import { applyDisplayName } from "../internal/utils/apply-display-name";
6+
7+
export interface StarProps {
8+
/**
9+
* @awsuiSystem core
10+
*/
11+
style: { width: number };
12+
}
13+
14+
export default function Star({ style, ...rest }: StarProps) {
15+
const { __internalRootRef } = useBaseComponent("Star", { props: {} });
16+
return (
17+
<span ref={__internalRootRef} style={style} {...getDataAttributes(rest)}>
18+
🤖
19+
</span>
20+
);
21+
}
22+
23+
applyDisplayName(Star, "Star");

0 commit comments

Comments
 (0)