@proyecto-viviana/ui 0.4.0 → 0.5.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.
Files changed (112) hide show
  1. package/dist/styles.css +0 -3
  2. package/dist/vite.d.ts +1 -0
  3. package/dist/vite.d.ts.map +1 -1
  4. package/dist/vite.js +9 -1
  5. package/dist/vite.js.map +1 -1
  6. package/dist/vite.jsx +9 -1
  7. package/dist/vite.jsx.map +1 -1
  8. package/dist/viviana-tokens.css +240 -171
  9. package/package.json +3 -57
  10. package/src/vite.ts +13 -1
  11. package/src/viviana-tokens.css +240 -171
  12. package/dist/CalendarCard.d.ts +0 -2
  13. package/dist/CalendarCard.d.ts.map +0 -1
  14. package/dist/CalendarCard.js +0 -97
  15. package/dist/CalendarCard.js.map +0 -1
  16. package/dist/CalendarCard.jsx +0 -51
  17. package/dist/CalendarCard.jsx.map +0 -1
  18. package/dist/Chip.d.ts +0 -2
  19. package/dist/Chip.d.ts.map +0 -1
  20. package/dist/Chip.js +0 -2
  21. package/dist/Chip.jsx +0 -2
  22. package/dist/Conversation.d.ts +0 -2
  23. package/dist/Conversation.d.ts.map +0 -1
  24. package/dist/Conversation.js +0 -177
  25. package/dist/Conversation.js.map +0 -1
  26. package/dist/Conversation.jsx +0 -107
  27. package/dist/Conversation.jsx.map +0 -1
  28. package/dist/EventCard.d.ts +0 -2
  29. package/dist/EventCard.d.ts.map +0 -1
  30. package/dist/EventCard.js +0 -173
  31. package/dist/EventCard.js.map +0 -1
  32. package/dist/EventCard.jsx +0 -96
  33. package/dist/EventCard.jsx.map +0 -1
  34. package/dist/Logo.d.ts +0 -2
  35. package/dist/Logo.d.ts.map +0 -1
  36. package/dist/Logo.js +0 -116
  37. package/dist/Logo.js.map +0 -1
  38. package/dist/Logo.jsx +0 -101
  39. package/dist/Logo.jsx.map +0 -1
  40. package/dist/PageLayout.d.ts +0 -2
  41. package/dist/PageLayout.d.ts.map +0 -1
  42. package/dist/PageLayout.js +0 -31
  43. package/dist/PageLayout.js.map +0 -1
  44. package/dist/PageLayout.jsx +0 -23
  45. package/dist/PageLayout.jsx.map +0 -1
  46. package/dist/ProfileCard.d.ts +0 -2
  47. package/dist/ProfileCard.d.ts.map +0 -1
  48. package/dist/ProfileCard.js +0 -78
  49. package/dist/ProfileCard.js.map +0 -1
  50. package/dist/ProfileCard.jsx +0 -53
  51. package/dist/ProfileCard.jsx.map +0 -1
  52. package/dist/ProjectCard.d.ts +0 -2
  53. package/dist/ProjectCard.d.ts.map +0 -1
  54. package/dist/ProjectCard.js +0 -164
  55. package/dist/ProjectCard.js.map +0 -1
  56. package/dist/ProjectCard.jsx +0 -133
  57. package/dist/ProjectCard.jsx.map +0 -1
  58. package/dist/TimelineItem.d.ts +0 -2
  59. package/dist/TimelineItem.d.ts.map +0 -1
  60. package/dist/TimelineItem.js +0 -137
  61. package/dist/TimelineItem.js.map +0 -1
  62. package/dist/TimelineItem.jsx +0 -70
  63. package/dist/TimelineItem.jsx.map +0 -1
  64. package/dist/chip2.js +0 -82
  65. package/dist/chip2.js.map +0 -1
  66. package/dist/chip2.jsx +0 -68
  67. package/dist/chip2.jsx.map +0 -1
  68. package/dist/custom/calendar-card/index.d.ts +0 -12
  69. package/dist/custom/calendar-card/index.d.ts.map +0 -1
  70. package/dist/custom/chip/index.d.ts +0 -16
  71. package/dist/custom/chip/index.d.ts.map +0 -1
  72. package/dist/custom/conversation/index.d.ts +0 -32
  73. package/dist/custom/conversation/index.d.ts.map +0 -1
  74. package/dist/custom/event-card/index.d.ts +0 -30
  75. package/dist/custom/event-card/index.d.ts.map +0 -1
  76. package/dist/custom/header/index.d.ts +0 -12
  77. package/dist/custom/header/index.d.ts.map +0 -1
  78. package/dist/custom/lateral-nav/index.d.ts +0 -32
  79. package/dist/custom/lateral-nav/index.d.ts.map +0 -1
  80. package/dist/custom/logo/index.d.ts +0 -11
  81. package/dist/custom/logo/index.d.ts.map +0 -1
  82. package/dist/custom/nav-header/index.d.ts +0 -13
  83. package/dist/custom/nav-header/index.d.ts.map +0 -1
  84. package/dist/custom/page-layout/index.d.ts +0 -7
  85. package/dist/custom/page-layout/index.d.ts.map +0 -1
  86. package/dist/custom/profile-card/index.d.ts +0 -16
  87. package/dist/custom/profile-card/index.d.ts.map +0 -1
  88. package/dist/custom/project-card/index.d.ts +0 -13
  89. package/dist/custom/project-card/index.d.ts.map +0 -1
  90. package/dist/custom/timeline-item/index.d.ts +0 -28
  91. package/dist/custom/timeline-item/index.d.ts.map +0 -1
  92. package/src/CalendarCard.ts +0 -1
  93. package/src/Chip.ts +0 -1
  94. package/src/Conversation.ts +0 -1
  95. package/src/EventCard.ts +0 -1
  96. package/src/Logo.ts +0 -1
  97. package/src/PageLayout.ts +0 -1
  98. package/src/ProfileCard.ts +0 -1
  99. package/src/ProjectCard.ts +0 -1
  100. package/src/TimelineItem.ts +0 -1
  101. package/src/custom/calendar-card/index.tsx +0 -115
  102. package/src/custom/chip/index.tsx +0 -78
  103. package/src/custom/conversation/index.tsx +0 -199
  104. package/src/custom/event-card/index.tsx +0 -232
  105. package/src/custom/header/index.tsx +0 -64
  106. package/src/custom/lateral-nav/index.tsx +0 -134
  107. package/src/custom/logo/index.tsx +0 -53
  108. package/src/custom/nav-header/index.tsx +0 -98
  109. package/src/custom/page-layout/index.tsx +0 -33
  110. package/src/custom/profile-card/index.tsx +0 -114
  111. package/src/custom/project-card/index.tsx +0 -76
  112. package/src/custom/timeline-item/index.tsx +0 -140
@@ -1,98 +0,0 @@
1
- import type { JSX } from "solid-js";
2
- import { Show } from "solid-js";
3
- import { Button as HeadlessButton } from "@proyecto-viviana/solidaria-components";
4
- // Styled via the S2 style() macro through viviana's own seam (../../style →
5
- // src/style.ts). A nav bar with an accent bottom rule, a logo/wordmark slot,
6
- // and trailing actions, on the S2 ramps in Silapse colors.
7
- import { style } from "../../style" with { type: "macro" };
8
-
9
- export interface NavHeaderProps {
10
- logo?: string;
11
- logoAlt?: string;
12
- logoText?: string;
13
- children?: JSX.Element;
14
- menuIcon?: JSX.Element;
15
- onMenuClick?: () => void;
16
- menuAriaLabel?: string;
17
- class?: string;
18
- }
19
-
20
- const bar = style({
21
- display: "flex",
22
- alignItems: "center",
23
- height: 70,
24
- backgroundColor: "[var(--color-bg-400)]",
25
- borderBottomWidth: 4,
26
- borderStyle: "solid",
27
- borderColor: "[var(--color-accent)]",
28
- });
29
-
30
- const lead = style({
31
- display: "flex",
32
- alignItems: "center",
33
- paddingStart: 32,
34
- });
35
-
36
- const logoText = style({
37
- display: "flex",
38
- alignItems: "center",
39
- font: "title-xl",
40
- fontWeight: "normal",
41
- color: "[var(--color-primary-700)]",
42
- });
43
-
44
- const logoImage = style({
45
- height: 42,
46
- width: "auto",
47
- });
48
-
49
- const trail = style({
50
- display: "flex",
51
- alignItems: "center",
52
- justifyContent: "end",
53
- flexGrow: 1,
54
- gap: 12,
55
- paddingEnd: 32,
56
- });
57
-
58
- const menuButton = style({
59
- display: "flex",
60
- alignItems: "center",
61
- justifyContent: "center",
62
- cursor: "pointer",
63
- backgroundColor: "transparent",
64
- borderStyle: "none",
65
- color: "[var(--color-primary-200)]",
66
- });
67
-
68
- export function NavHeader(props: NavHeaderProps) {
69
- return (
70
- <nav class={`${bar} ${props.class ?? ""}`}>
71
- <div class={lead}>
72
- <Show
73
- when={props.logo}
74
- fallback={
75
- <Show when={props.logoText}>
76
- <span class={logoText}>{props.logoText}</span>
77
- </Show>
78
- }
79
- >
80
- <img class={logoImage} src={props.logo} alt={props.logoAlt ?? "Logo"} />
81
- </Show>
82
- </div>
83
-
84
- <div class={trail}>
85
- {props.children}
86
- <Show when={props.menuIcon}>
87
- <HeadlessButton
88
- class={menuButton}
89
- onPress={() => props.onMenuClick?.()}
90
- aria-label={props.menuAriaLabel ?? "Open menu"}
91
- >
92
- {props.menuIcon}
93
- </HeadlessButton>
94
- </Show>
95
- </div>
96
- </nav>
97
- );
98
- }
@@ -1,33 +0,0 @@
1
- import { type JSX, splitProps } from "solid-js";
2
- // Styled via the S2 style() macro through viviana's own seam (../../style →
3
- // src/style.ts). A full-height page shell painted in Silapse surface/text
4
- // colors; `withHeader` reserves top space so a fixed header doesn't overlap.
5
- import { style } from "../../style" with { type: "macro" };
6
-
7
- export interface PageLayoutProps extends JSX.HTMLAttributes<HTMLDivElement> {
8
- children: JSX.Element;
9
- withHeader?: boolean;
10
- }
11
-
12
- const page = style<{ isWithHeader: boolean }>({
13
- display: "flex",
14
- flexDirection: "column",
15
- minHeight: "screen",
16
- width: "full",
17
- backgroundColor: "[var(--color-background)]",
18
- color: "[var(--color-text)]",
19
- paddingTop: { isWithHeader: 64 },
20
- });
21
-
22
- export function PageLayout(props: PageLayoutProps) {
23
- const [local, rest] = splitProps(props, ["class", "withHeader"]);
24
-
25
- return (
26
- <div
27
- class={`${page({ isWithHeader: local.withHeader ?? false })} ${local.class ?? ""}`}
28
- {...rest}
29
- >
30
- {props.children}
31
- </div>
32
- );
33
- }
@@ -1,114 +0,0 @@
1
- import type { JSX } from "solid-js";
2
- import { Show } from "solid-js";
3
- import { Avatar } from "@proyecto-viviana/solid-spectrum";
4
- // Styled via the S2 style() macro through viviana's own seam (../../style →
5
- // src/style.ts). Mirrors S2's UserCard shape (avatar + title/description +
6
- // footer actions) on the S2 spacing/radius/elevation ramps, in Silapse colors.
7
- import { style } from "../../style" with { type: "macro" };
8
-
9
- export interface ProfileCardProps {
10
- username: string;
11
- avatar?: string;
12
- bio?: string;
13
- followers?: number;
14
- following?: number;
15
- /**
16
- * Actions to display below the profile.
17
- * Use a function returning JSX for SSR compatibility: `actions={() => <Button>...</Button>}`
18
- */
19
- actions?: JSX.Element | (() => JSX.Element);
20
- class?: string;
21
- }
22
-
23
- const card = style({
24
- display: "flex",
25
- flexDirection: "column",
26
- gap: 16,
27
- padding: 16,
28
- borderRadius: "lg",
29
- backgroundColor: "[var(--color-bg-200)]",
30
- boxShadow: "elevated",
31
- });
32
-
33
- const head = style({
34
- display: "flex",
35
- alignItems: "start",
36
- gap: 16,
37
- });
38
-
39
- const info = style({
40
- display: "flex",
41
- flexDirection: "column",
42
- gap: 4,
43
- flexGrow: 1,
44
- minWidth: 0,
45
- });
46
-
47
- const name = style({
48
- font: "heading-sm",
49
- color: "[var(--color-primary-100)]",
50
- overflow: "hidden",
51
- textOverflow: "ellipsis",
52
- whiteSpace: "nowrap",
53
- });
54
-
55
- const bio = style({
56
- font: "ui-sm",
57
- color: "[var(--color-text-secondary)]",
58
- });
59
-
60
- const stats = style({
61
- display: "flex",
62
- gap: 16,
63
- font: "ui-sm",
64
- color: "[var(--color-text-secondary)]",
65
- });
66
-
67
- const statValue = style({
68
- fontWeight: "bold",
69
- color: "[var(--color-primary-100)]",
70
- });
71
-
72
- const actionRow = style({
73
- display: "flex",
74
- gap: 8,
75
- });
76
-
77
- export function ProfileCard(props: ProfileCardProps) {
78
- const formatNumber = (num: number) => {
79
- if (num >= 1000000) return `${(num / 1000000).toFixed(1)}M`;
80
- if (num >= 1000) return `${(num / 1000).toFixed(1)}K`;
81
- return num.toString();
82
- };
83
-
84
- return (
85
- <div class={`${card} ${props.class ?? ""}`}>
86
- <div class={head}>
87
- <Avatar src={props.avatar} alt={props.username} size="lg" />
88
- <div class={info}>
89
- <h3 class={name}>{props.username}</h3>
90
- <Show when={props.bio}>
91
- <p class={bio}>{props.bio}</p>
92
- </Show>
93
- <div class={stats}>
94
- <Show when={props.followers !== undefined}>
95
- <span>
96
- <span class={statValue}>{formatNumber(props.followers!)}</span> seguidores
97
- </span>
98
- </Show>
99
- <Show when={props.following !== undefined}>
100
- <span>
101
- <span class={statValue}>{formatNumber(props.following!)}</span> siguiendo
102
- </span>
103
- </Show>
104
- </div>
105
- </div>
106
- </div>
107
- <Show when={props.actions}>
108
- <div class={actionRow}>
109
- {typeof props.actions === "function" ? props.actions() : props.actions}
110
- </div>
111
- </Show>
112
- </div>
113
- );
114
- }
@@ -1,76 +0,0 @@
1
- import type { JSX } from "solid-js";
2
- // Styled via the S2 style() macro through viviana's own seam (../../style →
3
- // src/style.ts). A square logo/preview tile with a caption, sized by the S2
4
- // spacing + type ramps and painted in Silapse colors. `inactive` dims it;
5
- // `href` turns the whole card into a link.
6
- import { style } from "../../style" with { type: "macro" };
7
-
8
- export type ProjectCardSize = "sm" | "md" | "lg";
9
-
10
- export interface ProjectCardProps {
11
- name: string;
12
- imageSrc: string;
13
- imageAlt?: string;
14
- href?: string;
15
- size?: ProjectCardSize;
16
- inactive?: boolean;
17
- class?: string;
18
- }
19
-
20
- const card = style<{ size: ProjectCardSize; isInactive: boolean }>({
21
- display: "flex",
22
- flexDirection: "column",
23
- alignItems: "center",
24
- gap: 8,
25
- width: "full",
26
- borderRadius: "lg",
27
- borderWidth: 1,
28
- borderStyle: "solid",
29
- borderColor: "[var(--color-border)]",
30
- backgroundColor: "[var(--color-bg-200)]",
31
- color: "[var(--color-primary-100)]",
32
- textDecoration: "none",
33
- padding: { size: { sm: 12, md: 16, lg: 20 } },
34
- opacity: { default: 1, isInactive: 0.5 },
35
- });
36
-
37
- const image = style({
38
- width: "full",
39
- aspectRatio: "square",
40
- objectFit: "contain",
41
- borderRadius: "sm",
42
- });
43
-
44
- const caption = style<{ size: ProjectCardSize }>({
45
- width: "full",
46
- textAlign: "center",
47
- overflow: "hidden",
48
- textOverflow: "ellipsis",
49
- whiteSpace: "nowrap",
50
- color: "[var(--color-primary-200)]",
51
- font: { size: { sm: "ui-sm", md: "ui", lg: "ui-lg" } },
52
- });
53
-
54
- export function ProjectCard(props: ProjectCardProps): JSX.Element {
55
- const size = () => props.size ?? "sm";
56
- const inactive = () => props.inactive ?? false;
57
-
58
- const cardContent = () => (
59
- <>
60
- <img class={image} src={props.imageSrc} alt={props.imageAlt ?? props.name} />
61
- <span class={caption({ size: size() })}>{props.name}</span>
62
- </>
63
- );
64
-
65
- const classes = () => `${card({ size: size(), isInactive: inactive() })} ${props.class ?? ""}`;
66
-
67
- if (props.href) {
68
- return (
69
- <a href={props.href} target="_blank" rel="noopener noreferrer" class={classes()}>
70
- {cardContent()}
71
- </a>
72
- );
73
- }
74
-
75
- return <div class={classes()}>{cardContent()}</div>;
76
- }
@@ -1,140 +0,0 @@
1
- import type { JSX } from "solid-js";
2
- import { Show } from "solid-js";
3
- import { Avatar } from "@proyecto-viviana/solid-spectrum";
4
- // Styled via the S2 style() macro through viviana's own seam (../../style →
5
- // src/style.ts). A social timeline event card (two avatars + icon + message)
6
- // on the S2 spacing/radius ramps in Silapse colors.
7
- import { style } from "../../style" with { type: "macro" };
8
-
9
- export type TimelineEventType = "follow" | "like" | "comment" | "event" | "custom";
10
-
11
- export interface TimelineItemProps {
12
- type?: TimelineEventType;
13
- /**
14
- * Icon to display between the two avatars.
15
- * Use a function returning JSX for SSR compatibility: `icon={() => <MyIcon />}`
16
- * Or pass a simple string for text-based icons: `icon="👋"`
17
- */
18
- icon?: string | (() => JSX.Element);
19
- leftUser?: {
20
- name: string;
21
- avatar?: string;
22
- };
23
- rightUser?: {
24
- name: string;
25
- avatar?: string;
26
- };
27
- /**
28
- * Custom message content.
29
- * Use a function returning JSX for SSR compatibility: `message={() => <span>...</span>}`
30
- * Or pass a simple string.
31
- */
32
- message?: string | (() => JSX.Element);
33
- class?: string;
34
- }
35
-
36
- const nameEmph = style({
37
- fontWeight: "bold",
38
- color: "[var(--color-accent)]",
39
- });
40
-
41
- const eventMessages: Record<TimelineEventType, (left: string, right: string) => JSX.Element> = {
42
- follow: (left, right) => (
43
- <>
44
- <span class={nameEmph}>{left}</span>
45
- {" ha empezado a seguir a "}
46
- <span class={nameEmph}>{right}</span>
47
- </>
48
- ),
49
- like: (left, right) => (
50
- <>
51
- <span class={nameEmph}>{left}</span>
52
- {" le ha dado like a "}
53
- <span class={nameEmph}>{right}</span>
54
- </>
55
- ),
56
- comment: (left, right) => (
57
- <>
58
- <span class={nameEmph}>{left}</span>
59
- {" ha comentado en "}
60
- <span class={nameEmph}>{right}</span>
61
- </>
62
- ),
63
- event: (left, right) => (
64
- <>
65
- <span class={nameEmph}>{left}</span>
66
- {" asistirá al evento de "}
67
- <span class={nameEmph}>{right}</span>
68
- </>
69
- ),
70
- custom: () => null,
71
- };
72
-
73
- const card = style({
74
- display: "inline-flex",
75
- flexDirection: "column",
76
- gap: 20,
77
- padding: 20,
78
- borderRadius: "xl",
79
- borderWidth: 1,
80
- borderStyle: "solid",
81
- borderColor: "[var(--color-primary-700)]",
82
- backgroundColor: "[var(--color-bg-200)]",
83
- });
84
-
85
- const avatarsRow = style({
86
- display: "flex",
87
- alignItems: "center",
88
- justifyContent: "center",
89
- gap: 12,
90
- });
91
-
92
- const messageRow = style({
93
- display: "flex",
94
- alignItems: "center",
95
- justifyContent: "center",
96
- textAlign: "center",
97
- font: "ui",
98
- color: "[var(--color-text-secondary)]",
99
- });
100
-
101
- export function TimelineItem(props: TimelineItemProps) {
102
- const type = () => props.type ?? "follow";
103
- const leftName = () => props.leftUser?.name ?? "";
104
- const rightName = () => props.rightUser?.name ?? "";
105
-
106
- const renderIcon = () => {
107
- const icon = props.icon;
108
- if (!icon) return null;
109
- if (typeof icon === "string") return icon;
110
- return icon();
111
- };
112
-
113
- const renderMessage = () => {
114
- const message = props.message;
115
- if (!message) return null;
116
- if (typeof message === "string") return message;
117
- return message();
118
- };
119
-
120
- return (
121
- <div class={`${card} ${props.class ?? ""}`}>
122
- <div class={avatarsRow}>
123
- <Show when={props.leftUser}>
124
- <Avatar src={props.leftUser!.avatar} alt={props.leftUser!.name} />
125
- </Show>
126
- <Show when={props.icon}>{renderIcon()}</Show>
127
- <Show when={props.rightUser}>
128
- <Avatar src={props.rightUser!.avatar} alt={props.rightUser!.name} />
129
- </Show>
130
- </div>
131
- <div class={messageRow}>
132
- <span>
133
- <Show when={props.message} fallback={eventMessages[type()](leftName(), rightName())}>
134
- {renderMessage()}
135
- </Show>
136
- </span>
137
- </div>
138
- </div>
139
- );
140
- }