@umami/shiso 1.13.0 → 1.15.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.
@@ -1,48 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { Badge } from './Badge';
3
- import { styles } from './styles';
4
- import { decodeHtmlEntities } from './utils';
5
-
6
- type FieldValue = string | number | boolean | null | undefined;
7
-
8
- export interface ResponseFieldProps {
9
- name: string;
10
- type?: FieldValue;
11
- default?: FieldValue;
12
- required?: boolean;
13
- deprecated?: boolean;
14
- children?: ReactNode;
15
- }
16
-
17
- export function ResponseField({ name, type, required, deprecated, children }: ResponseFieldProps) {
18
- const normalizedType =
19
- typeof type === 'string'
20
- ? decodeHtmlEntities(type)
21
- : type === undefined || type === null
22
- ? undefined
23
- : String(type);
24
-
25
- return (
26
- <div className={styles.field} data-slot="field-group-item">
27
- <div className={styles.fieldHeader}>
28
- <span className={styles.fieldName}>{name}</span>
29
- {normalizedType ? (
30
- <span className={styles.fieldType} data-slot="field-group-type">
31
- {normalizedType}
32
- </span>
33
- ) : null}
34
- {required ? (
35
- <Badge size="sm" tone="primary">
36
- required
37
- </Badge>
38
- ) : null}
39
- {deprecated ? <Badge size="sm">deprecated</Badge> : null}
40
- </div>
41
- {children ? (
42
- <div className={styles.fieldBody} data-slot="field-group-body">
43
- {children}
44
- </div>
45
- ) : null}
46
- </div>
47
- );
48
- }