@pablozaiden/webapp 0.7.0 → 1.0.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/docs/ui-guidelines.md +2 -1
- package/package.json +1 -1
- package/src/web/components/index.tsx +11 -1
- package/src/web/styles.css +5 -0
package/docs/ui-guidelines.md
CHANGED
|
@@ -44,7 +44,8 @@ Use these first:
|
|
|
44
44
|
| `Panel` | Cards/sections; use `actions` for a top-right menu/action area |
|
|
45
45
|
| `ActionMenu` | Three-line action menu for secondary surfaces; entity-level shell menus should usually come from `SidebarNode.actions` so the framework renders them in the sidebar context menu and fixed title bar |
|
|
46
46
|
| `Button` / `IconButton` | Form submission and true inline controls; prefer action menus for entity/app commands |
|
|
47
|
-
| `Badge` |
|
|
47
|
+
| `Badge` | Generic status/count labels; preserves the supplied text casing |
|
|
48
|
+
| `StatusBadge` | Status labels with the shared uppercase and letter-spacing treatment |
|
|
48
49
|
| `EntityHeader` | Main-content entity title/description/actions |
|
|
49
50
|
| `DataList` / `DataListRow` | Lists with title, description, metadata, badge and actions |
|
|
50
51
|
| `TextField`, `TextAreaField`, `SelectField` | Forms |
|
package/package.json
CHANGED
|
@@ -32,17 +32,27 @@ export function IconButton({
|
|
|
32
32
|
|
|
33
33
|
export type BadgeSize = "sm" | "md";
|
|
34
34
|
|
|
35
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
36
|
+
variant?: BadgeVariant;
|
|
37
|
+
size?: BadgeSize;
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
export function Badge({
|
|
36
42
|
variant = "default",
|
|
37
43
|
size = "sm",
|
|
38
44
|
className = "",
|
|
39
45
|
children,
|
|
40
46
|
...props
|
|
41
|
-
}:
|
|
47
|
+
}: BadgeProps) {
|
|
42
48
|
const sizeClass = size === "md" ? "wapp-badge-md" : "";
|
|
43
49
|
return <span {...props} className={["wapp-badge", `wapp-badge-${variant}`, sizeClass, className].filter(Boolean).join(" ")}>{children}</span>;
|
|
44
50
|
}
|
|
45
51
|
|
|
52
|
+
export function StatusBadge({ className = "", ...props }: BadgeProps) {
|
|
53
|
+
return <Badge {...props} className={["wapp-status-badge", className].filter(Boolean).join(" ")} />;
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
export type PageLayout = "padded" | "full";
|
|
47
57
|
|
|
48
58
|
export function Page({
|
package/src/web/styles.css
CHANGED