@sia-ui/cli 0.7.0 → 0.8.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/CHANGELOG.md +12 -0
- package/README.md +12 -0
- package/dist/registry/package/components/AccountMenu/index.tsx +107 -0
- package/dist/registry/package/components/AccountMenu/styles.css +30 -0
- package/dist/registry/package/components/ActivityLog/index.tsx +96 -25
- package/dist/registry/package/components/AmountDisplay/index.tsx +5 -2
- package/dist/registry/package/components/AppShell/index.tsx +44 -8
- package/dist/registry/package/components/AppShell/tab-bar.tsx +6 -3
- package/dist/registry/package/components/AsyncState/index.tsx +29 -7
- package/dist/registry/package/components/AuditMeta/index.tsx +12 -2
- package/dist/registry/package/components/Avatar/index.tsx +4 -9
- package/dist/registry/package/components/Badge/index.tsx +3 -2
- package/dist/registry/package/components/Badge/styles.css +4 -4
- package/dist/registry/package/components/BrandIcon/index.tsx +100 -0
- package/dist/registry/package/components/BrandIcon/styles.css +31 -0
- package/dist/registry/package/components/Breadcrumb/index.tsx +14 -2
- package/dist/registry/package/components/Button/index.tsx +3 -2
- package/dist/registry/package/components/Button/styles.css +4 -4
- package/dist/registry/package/components/Calendar/index.tsx +7 -3
- package/dist/registry/package/components/Card/index.tsx +14 -4
- package/dist/registry/package/components/ColorModeToggle/index.tsx +44 -0
- package/dist/registry/package/components/CommandPalette/index.tsx +3 -2
- package/dist/registry/package/components/ConfirmDialog/index.tsx +24 -4
- package/dist/registry/package/components/CrudPage/dialogs.tsx +53 -8
- package/dist/registry/package/components/CrudPage/index.tsx +99 -25
- package/dist/registry/package/components/CurrencyInput/index.tsx +5 -2
- package/dist/registry/package/components/DataTable/index.tsx +53 -18
- package/dist/registry/package/components/DataTable/row-actions.tsx +20 -8
- package/dist/registry/package/components/DataTable/types.ts +100 -0
- package/dist/registry/package/components/DatePicker/index.tsx +14 -6
- package/dist/registry/package/components/DateRangeFilter/index.tsx +12 -3
- package/dist/registry/package/components/DateRangePicker/index.tsx +13 -4
- package/dist/registry/package/components/DateTimePicker/index.tsx +3 -1
- package/dist/registry/package/components/Drawer/index.tsx +16 -6
- package/dist/registry/package/components/DropdownMenu/index.tsx +37 -4
- package/dist/registry/package/components/DropdownMenu/styles.css +10 -0
- package/dist/registry/package/components/DurationDisplay/index.tsx +20 -2
- package/dist/registry/package/components/EntityMeta/index.tsx +14 -9
- package/dist/registry/package/components/ErrorState/index.tsx +9 -3
- package/dist/registry/package/components/ErrorState/styles.css +1 -1
- package/dist/registry/package/components/EventCalendar/index.tsx +657 -9
- package/dist/registry/package/components/EventCalendar/styles.css +360 -8
- package/dist/registry/package/components/EventManager/index.tsx +456 -0
- package/dist/registry/package/components/EventManager/styles.css +12 -0
- package/dist/registry/package/components/Field/index.tsx +74 -27
- package/dist/registry/package/components/FileUpload/index.tsx +13 -3
- package/dist/registry/package/components/FiltersBar/index.tsx +8 -3
- package/dist/registry/package/components/FiltersBar/styles.css +7 -0
- package/dist/registry/package/components/Form/index.tsx +118 -14
- package/dist/registry/package/components/Form/styles.css +3 -0
- package/dist/registry/package/components/HoverCard/index.tsx +8 -4
- package/dist/registry/package/components/Icons/index.tsx +18 -0
- package/dist/registry/package/components/ImageUpload/index.tsx +17 -2
- package/dist/registry/package/components/Input/index.tsx +3 -2
- package/dist/registry/package/components/JobProgress/index.tsx +289 -0
- package/dist/registry/package/components/JobProgress/styles.css +58 -0
- package/dist/registry/package/components/JsonEditor/index.tsx +18 -3
- package/dist/registry/package/components/JsonView/index.tsx +282 -0
- package/dist/registry/package/components/JsonView/styles.css +99 -0
- package/dist/registry/package/components/LiveIndicator/index.tsx +43 -0
- package/dist/registry/package/components/LiveIndicator/styles.css +41 -0
- package/dist/registry/package/components/LogStream/index.tsx +545 -0
- package/dist/registry/package/components/LogStream/styles.css +152 -0
- package/dist/registry/package/components/MarkdownEditor/index.tsx +14 -3
- package/dist/registry/package/components/Modal/index.tsx +7 -1
- package/dist/registry/package/components/MultiSelect/index.tsx +14 -3
- package/dist/registry/package/components/OtpInput/index.tsx +2 -1
- package/dist/registry/package/components/Pagination/index.tsx +13 -2
- package/dist/registry/package/components/PasswordInput/index.tsx +23 -9
- package/dist/registry/package/components/PhoneInput/index.tsx +66 -30
- package/dist/registry/package/components/Popover/index.tsx +19 -4
- package/dist/registry/package/components/QrCode/index.tsx +3 -2
- package/dist/registry/package/components/RadioGroup/styles.css +3 -0
- package/dist/registry/package/components/Rating/index.tsx +6 -2
- package/dist/registry/package/components/ReferenceSelect/index.tsx +8 -1
- package/dist/registry/package/components/RelativeTime/index.tsx +5 -1
- package/dist/registry/package/components/RequireSession/index.tsx +10 -4
- package/dist/registry/package/components/Resource/index.tsx +70 -17
- package/dist/registry/package/components/RichTextEditor/index.tsx +2 -1
- package/dist/registry/package/components/SearchInput/index.tsx +4 -1
- package/dist/registry/package/components/SecretFields/index.tsx +70 -17
- package/dist/registry/package/components/Select/index.tsx +44 -12
- package/dist/registry/package/components/Select/styles.css +6 -3
- package/dist/registry/package/components/Sidebar/index.tsx +22 -6
- package/dist/registry/package/components/Slider/index.tsx +26 -5
- package/dist/registry/package/components/Spinner/index.tsx +3 -2
- package/dist/registry/package/components/StatCard/index.tsx +11 -3
- package/dist/registry/package/components/Statistic/index.tsx +5 -1
- package/dist/registry/package/components/Steps/styles.css +2 -2
- package/dist/registry/package/components/TagsInput/index.tsx +2 -1
- package/dist/registry/package/components/TimePicker/index.tsx +10 -4
- package/dist/registry/package/components/Toast/index.tsx +20 -5
- package/dist/registry/package/components/Tour/index.tsx +2 -1
- package/dist/registry/package/components/Transfer/index.tsx +2 -1
- package/dist/registry/package/components/Tree/index.tsx +3 -2
- package/dist/registry/package/components/TreeSelect/index.tsx +17 -4
- package/dist/registry/package/components/UnsavedChangesGuard/index.tsx +34 -3
- package/dist/registry/registry.json +257 -75
- package/dist/registry/styles/sia-ui.css +23 -4
- package/package.json +5 -5
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* Des lignes d'une hauteur de texte : un JSON se lit en masse, et chaque
|
|
2
|
+
pixel de marge se multiplie par le nombre de clés. */
|
|
3
|
+
.sia-json-view {
|
|
4
|
+
display: grid;
|
|
5
|
+
gap: .5rem;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.sia-json-view__frame {
|
|
10
|
+
position: relative;
|
|
11
|
+
min-width: 0;
|
|
12
|
+
border: 1px solid var(--sia-border);
|
|
13
|
+
border-radius: var(--sia-radius);
|
|
14
|
+
color: var(--sia-foreground);
|
|
15
|
+
background: var(--sia-surface);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* En haut à droite, hors du flux : il ne décale aucune ligne. */
|
|
19
|
+
.sia-json-view__copy.sia-json-view__copy {
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: .375rem;
|
|
22
|
+
right: .375rem;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sia-json-view__tree,
|
|
27
|
+
.sia-json-view__children,
|
|
28
|
+
.sia-json-view__raw {
|
|
29
|
+
margin: 0;
|
|
30
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
31
|
+
font-size: .8rem;
|
|
32
|
+
line-height: 1.5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sia-json-view__tree { padding: .5rem; list-style: none; }
|
|
36
|
+
.sia-json-view__children { padding: 0 0 0 1.25rem; list-style: none; }
|
|
37
|
+
|
|
38
|
+
.sia-json-view__raw {
|
|
39
|
+
padding: .5rem .75rem;
|
|
40
|
+
white-space: pre-wrap;
|
|
41
|
+
overflow-wrap: anywhere;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* La place du bouton de copie, réservée à droite de la première ligne. */
|
|
45
|
+
.sia-json-view--copyable .sia-json-view__tree,
|
|
46
|
+
.sia-json-view--copyable .sia-json-view__raw { padding-inline-end: 5.5rem; }
|
|
47
|
+
/* Une seule ligne ne doit pas laisser le bouton déborder du cadre. */
|
|
48
|
+
.sia-json-view--copyable .sia-json-view__frame { min-height: 2.75rem; }
|
|
49
|
+
|
|
50
|
+
/* Du texte qui coule, pas une rangée flexible : une valeur longue passe à la
|
|
51
|
+
ligne sous elle-même au lieu de découper clé et valeur en colonnes. La
|
|
52
|
+
bascule, sortie du flux, reste dans la marge. */
|
|
53
|
+
.sia-json-view__row {
|
|
54
|
+
position: relative;
|
|
55
|
+
min-width: 0;
|
|
56
|
+
padding-inline-start: 1.25rem;
|
|
57
|
+
overflow-wrap: anywhere;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.sia-json-view--static .sia-json-view__row { padding-inline-start: 0; }
|
|
61
|
+
|
|
62
|
+
.sia-json-view__toggle {
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: .1rem;
|
|
65
|
+
left: 0;
|
|
66
|
+
width: 1.125rem;
|
|
67
|
+
height: 1.125rem;
|
|
68
|
+
display: inline-grid;
|
|
69
|
+
place-items: center;
|
|
70
|
+
padding: 0;
|
|
71
|
+
border: 0;
|
|
72
|
+
border-radius: calc(var(--sia-radius) * .5);
|
|
73
|
+
color: var(--sia-muted);
|
|
74
|
+
background: transparent;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transition: background-color var(--sia-duration-fast) var(--sia-easing-standard);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.sia-json-view__toggle svg { width: .875rem; height: .875rem; }
|
|
80
|
+
.sia-json-view__toggle:hover { color: var(--sia-foreground); background: color-mix(in srgb, var(--sia-foreground) 8%, transparent); }
|
|
81
|
+
.sia-json-view__toggle:focus-visible { outline: 2px solid color-mix(in srgb, var(--sia-primary) 45%, transparent); outline-offset: 1px; }
|
|
82
|
+
|
|
83
|
+
.sia-json-view__key { color: var(--sia-primary); }
|
|
84
|
+
.sia-json-view__index { color: var(--sia-muted); }
|
|
85
|
+
.sia-json-view__punct { color: var(--sia-muted); white-space: pre; }
|
|
86
|
+
.sia-json-view__string { color: var(--sia-success); }
|
|
87
|
+
.sia-json-view__number { color: var(--sia-info); }
|
|
88
|
+
.sia-json-view__boolean { color: var(--sia-warning); }
|
|
89
|
+
.sia-json-view__null { color: var(--sia-muted); font-style: italic; }
|
|
90
|
+
|
|
91
|
+
.sia-json-view__summary {
|
|
92
|
+
margin-inline-start: .75ch;
|
|
93
|
+
color: var(--sia-muted);
|
|
94
|
+
font-size: .75rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@media (prefers-reduced-motion: reduce) {
|
|
98
|
+
.sia-json-view__toggle { transition: none; }
|
|
99
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import { cn } from "@sia-ui/utils";
|
|
3
|
+
import { useSiaLocale } from "@sia-ui/headless";
|
|
4
|
+
import "./styles.css";
|
|
5
|
+
|
|
6
|
+
export type LiveStatus = "connecting" | "open" | "closed";
|
|
7
|
+
|
|
8
|
+
export interface LiveIndicatorProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
9
|
+
/** L'état de la connexion — `useRealtimeStatus(source)` le fournit. */
|
|
10
|
+
status: LiveStatus;
|
|
11
|
+
/** Les libellés de chaque état. Par défaut, ceux de la locale. */
|
|
12
|
+
labels?: Partial<Record<LiveStatus, string>>;
|
|
13
|
+
/** Le point seul, le libellé restant pour les lecteurs d'écran. */
|
|
14
|
+
compact?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Dit si l'écran se met à jour tout seul.
|
|
19
|
+
*
|
|
20
|
+
* Sans lui, une liste qui ne bouge plus après une coupure réseau ressemble à
|
|
21
|
+
* une liste à jour. Le point pulse en direct, clignote en connexion, s'éteint
|
|
22
|
+
* hors ligne ; le libellé est annoncé quand il change.
|
|
23
|
+
*/
|
|
24
|
+
export function LiveIndicator({
|
|
25
|
+
status,
|
|
26
|
+
labels,
|
|
27
|
+
compact = false,
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: LiveIndicatorProps) {
|
|
31
|
+
const locale = useSiaLocale();
|
|
32
|
+
const libelle = labels?.[status] ?? locale.liveIndicator[status];
|
|
33
|
+
return (
|
|
34
|
+
<span
|
|
35
|
+
role="status"
|
|
36
|
+
className={cn("sia-live", `sia-live--${status}`, compact && "sia-live--compact", className)}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
<span className="sia-live__dot" aria-hidden="true" />
|
|
40
|
+
<span className={compact ? "sia-visually-hidden" : "sia-live__label"}>{libelle}</span>
|
|
41
|
+
</span>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.sia-live {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: .45rem;
|
|
5
|
+
color: var(--sia-muted);
|
|
6
|
+
font-size: .8rem;
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
}
|
|
10
|
+
.sia-live__dot {
|
|
11
|
+
position: relative;
|
|
12
|
+
width: .5rem;
|
|
13
|
+
height: .5rem;
|
|
14
|
+
border-radius: 9999px;
|
|
15
|
+
background: var(--sia-border-strong);
|
|
16
|
+
}
|
|
17
|
+
.sia-live--open { color: var(--sia-success); }
|
|
18
|
+
.sia-live--open .sia-live__dot { background: var(--sia-success); }
|
|
19
|
+
/* Un halo qui s'étend et s'efface : vivant sans être agité. */
|
|
20
|
+
.sia-live--open .sia-live__dot::after {
|
|
21
|
+
content: "";
|
|
22
|
+
position: absolute;
|
|
23
|
+
inset: 0;
|
|
24
|
+
border-radius: inherit;
|
|
25
|
+
background: inherit;
|
|
26
|
+
animation: sia-live-halo 1.8s var(--sia-easing-standard) infinite;
|
|
27
|
+
}
|
|
28
|
+
.sia-live--connecting .sia-live__dot {
|
|
29
|
+
background: var(--sia-warning);
|
|
30
|
+
animation: sia-live-blink 1s steps(2, jump-none) infinite;
|
|
31
|
+
}
|
|
32
|
+
@keyframes sia-live-halo {
|
|
33
|
+
from { opacity: .6; transform: scale(1); }
|
|
34
|
+
to { opacity: 0; transform: scale(2.6); }
|
|
35
|
+
}
|
|
36
|
+
@keyframes sia-live-blink {
|
|
37
|
+
50% { opacity: .35; }
|
|
38
|
+
}
|
|
39
|
+
@media (prefers-reduced-motion: reduce) {
|
|
40
|
+
.sia-live__dot, .sia-live__dot::after { animation: none; }
|
|
41
|
+
}
|