@proyecto-viviana/ui 0.3.5 → 0.4.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/LICENSE +21 -0
- package/README.md +80 -157
- package/dist/ActionButton.d.ts +2 -0
- package/dist/ActionButton.d.ts.map +1 -0
- package/dist/ActionButton.js +1 -0
- package/dist/ActionButton.jsx +1 -0
- package/dist/ActionMenu.d.ts +2 -0
- package/dist/ActionMenu.d.ts.map +1 -0
- package/dist/ActionMenu.js +1 -0
- package/dist/ActionMenu.jsx +1 -0
- package/dist/Breadcrumbs.d.ts +2 -0
- package/dist/Breadcrumbs.d.ts.map +1 -0
- package/dist/Breadcrumbs.js +1 -0
- package/dist/Breadcrumbs.jsx +1 -0
- package/dist/Button.d.ts +2 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +1 -0
- package/dist/Button.jsx +1 -0
- package/dist/Calendar.d.ts +2 -0
- package/dist/Calendar.d.ts.map +1 -0
- package/dist/Calendar.js +1 -0
- package/dist/Calendar.jsx +1 -0
- package/dist/CalendarCard.d.ts +2 -0
- package/dist/CalendarCard.d.ts.map +1 -0
- package/dist/CalendarCard.js +97 -0
- package/dist/CalendarCard.js.map +1 -0
- package/dist/CalendarCard.jsx +51 -0
- package/dist/CalendarCard.jsx.map +1 -0
- package/dist/Card.d.ts +2 -0
- package/dist/Card.d.ts.map +1 -0
- package/dist/Card.js +1 -0
- package/dist/Card.jsx +1 -0
- package/dist/CardView.d.ts +2 -0
- package/dist/CardView.d.ts.map +1 -0
- package/dist/CardView.js +1 -0
- package/dist/CardView.jsx +1 -0
- package/dist/CenterBaseline.d.ts +2 -0
- package/dist/CenterBaseline.d.ts.map +1 -0
- package/dist/CenterBaseline.js +1 -0
- package/dist/CenterBaseline.jsx +1 -0
- package/dist/Chip.d.ts +2 -0
- package/dist/Chip.d.ts.map +1 -0
- package/dist/Chip.js +2 -0
- package/dist/Chip.jsx +2 -0
- package/dist/ColorArea.d.ts +2 -0
- package/dist/ColorArea.d.ts.map +1 -0
- package/dist/ColorArea.js +1 -0
- package/dist/ColorArea.jsx +1 -0
- package/dist/ColorField.d.ts +2 -0
- package/dist/ColorField.d.ts.map +1 -0
- package/dist/ColorField.js +1 -0
- package/dist/ColorField.jsx +1 -0
- package/dist/ColorSlider.d.ts +2 -0
- package/dist/ColorSlider.d.ts.map +1 -0
- package/dist/ColorSlider.js +1 -0
- package/dist/ColorSlider.jsx +1 -0
- package/dist/ColorSwatch.d.ts +2 -0
- package/dist/ColorSwatch.d.ts.map +1 -0
- package/dist/ColorSwatch.js +1 -0
- package/dist/ColorSwatch.jsx +1 -0
- package/dist/ColorSwatchPicker.d.ts +2 -0
- package/dist/ColorSwatchPicker.d.ts.map +1 -0
- package/dist/ColorSwatchPicker.js +1 -0
- package/dist/ColorSwatchPicker.jsx +1 -0
- package/dist/ColorWheel.d.ts +2 -0
- package/dist/ColorWheel.d.ts.map +1 -0
- package/dist/ColorWheel.js +1 -0
- package/dist/ColorWheel.jsx +1 -0
- package/dist/ContrastIcon.d.ts +3 -0
- package/dist/ContrastIcon.d.ts.map +1 -0
- package/dist/ContrastIcon.js +3 -0
- package/dist/ContrastIcon.jsx +3 -0
- package/dist/Conversation.d.ts +2 -0
- package/dist/Conversation.d.ts.map +1 -0
- package/dist/Conversation.js +177 -0
- package/dist/Conversation.js.map +1 -0
- package/dist/Conversation.jsx +107 -0
- package/dist/Conversation.jsx.map +1 -0
- package/dist/Disclosure.d.ts +2 -0
- package/dist/Disclosure.d.ts.map +1 -0
- package/dist/Disclosure.js +1 -0
- package/dist/Disclosure.jsx +1 -0
- package/dist/EventCard.d.ts +2 -0
- package/dist/EventCard.d.ts.map +1 -0
- package/dist/EventCard.js +173 -0
- package/dist/EventCard.js.map +1 -0
- package/dist/EventCard.jsx +96 -0
- package/dist/EventCard.jsx.map +1 -0
- package/dist/FileTrigger.d.ts +2 -0
- package/dist/FileTrigger.d.ts.map +1 -0
- package/dist/FileTrigger.js +1 -0
- package/dist/FileTrigger.jsx +1 -0
- package/dist/GitHubIcon.d.ts +2 -0
- package/dist/GitHubIcon.d.ts.map +1 -0
- package/dist/GitHubIcon.js +1 -0
- package/dist/GitHubIcon.jsx +1 -0
- package/dist/LightenIcon.d.ts +3 -0
- package/dist/LightenIcon.d.ts.map +1 -0
- package/dist/LightenIcon.js +3 -0
- package/dist/LightenIcon.jsx +3 -0
- package/dist/LinkButton.d.ts +2 -0
- package/dist/LinkButton.d.ts.map +1 -0
- package/dist/LinkButton.js +1 -0
- package/dist/LinkButton.jsx +1 -0
- package/dist/ListView.d.ts +2 -0
- package/dist/ListView.d.ts.map +1 -0
- package/dist/ListView.js +1 -0
- package/dist/ListView.jsx +1 -0
- package/dist/Logo.d.ts +2 -0
- package/dist/Logo.d.ts.map +1 -0
- package/dist/Logo.js +116 -0
- package/dist/Logo.js.map +1 -0
- package/dist/Logo.jsx +101 -0
- package/dist/Logo.jsx.map +1 -0
- package/dist/Menu.d.ts +2 -0
- package/dist/Menu.d.ts.map +1 -0
- package/dist/Menu.js +1 -0
- package/dist/Menu.jsx +1 -0
- package/dist/PageLayout.d.ts +2 -0
- package/dist/PageLayout.d.ts.map +1 -0
- package/dist/PageLayout.js +31 -0
- package/dist/PageLayout.js.map +1 -0
- package/dist/PageLayout.jsx +23 -0
- package/dist/PageLayout.jsx.map +1 -0
- package/dist/Picker.d.ts +2 -0
- package/dist/Picker.d.ts.map +1 -0
- package/dist/Picker.js +1 -0
- package/dist/Picker.jsx +1 -0
- package/dist/ProfileCard.d.ts +2 -0
- package/dist/ProfileCard.d.ts.map +1 -0
- package/dist/ProfileCard.js +78 -0
- package/dist/ProfileCard.js.map +1 -0
- package/dist/ProfileCard.jsx +53 -0
- package/dist/ProfileCard.jsx.map +1 -0
- package/dist/ProjectCard.d.ts +2 -0
- package/dist/ProjectCard.d.ts.map +1 -0
- package/dist/ProjectCard.js +164 -0
- package/dist/ProjectCard.js.map +1 -0
- package/dist/ProjectCard.jsx +133 -0
- package/dist/ProjectCard.jsx.map +1 -0
- package/dist/Provider.d.ts +2 -0
- package/dist/Provider.d.ts.map +1 -0
- package/dist/Provider.js +1 -0
- package/dist/Provider.jsx +1 -0
- package/dist/RangeCalendar.d.ts +2 -0
- package/dist/RangeCalendar.d.ts.map +1 -0
- package/dist/RangeCalendar.js +1 -0
- package/dist/RangeCalendar.jsx +1 -0
- package/dist/SearchField.d.ts +2 -0
- package/dist/SearchField.d.ts.map +1 -0
- package/dist/SearchField.js +1 -0
- package/dist/SearchField.jsx +1 -0
- package/dist/SegmentedControl.d.ts +2 -0
- package/dist/SegmentedControl.d.ts.map +1 -0
- package/dist/SegmentedControl.js +1 -0
- package/dist/SegmentedControl.jsx +1 -0
- package/dist/Switch.d.ts +2 -0
- package/dist/Switch.d.ts.map +1 -0
- package/dist/Switch.js +1 -0
- package/dist/Switch.jsx +1 -0
- package/dist/Tabs.d.ts +2 -0
- package/dist/Tabs.d.ts.map +1 -0
- package/dist/Tabs.js +1 -0
- package/dist/Tabs.jsx +1 -0
- package/dist/TextArea.d.ts +2 -0
- package/dist/TextArea.d.ts.map +1 -0
- package/dist/TextArea.js +1 -0
- package/dist/TextArea.jsx +1 -0
- package/dist/TextField.d.ts +2 -0
- package/dist/TextField.d.ts.map +1 -0
- package/dist/TextField.js +1 -0
- package/dist/TextField.jsx +1 -0
- package/dist/TimelineItem.d.ts +2 -0
- package/dist/TimelineItem.d.ts.map +1 -0
- package/dist/TimelineItem.js +137 -0
- package/dist/TimelineItem.js.map +1 -0
- package/dist/TimelineItem.jsx +70 -0
- package/dist/TimelineItem.jsx.map +1 -0
- package/dist/TreeView.d.ts +2 -0
- package/dist/TreeView.d.ts.map +1 -0
- package/dist/TreeView.js +1 -0
- package/dist/TreeView.jsx +1 -0
- package/dist/chip2.js +82 -0
- package/dist/chip2.js.map +1 -0
- package/dist/chip2.jsx +68 -0
- package/dist/chip2.jsx.map +1 -0
- package/dist/components.css +2 -1077
- package/dist/custom/calendar-card/index.d.ts.map +1 -1
- package/dist/custom/chip/index.d.ts +2 -2
- package/dist/custom/chip/index.d.ts.map +1 -1
- package/dist/custom/conversation/index.d.ts +2 -2
- package/dist/custom/conversation/index.d.ts.map +1 -1
- package/dist/custom/event-card/index.d.ts +1 -1
- package/dist/custom/event-card/index.d.ts.map +1 -1
- package/dist/custom/header/index.d.ts +2 -6
- package/dist/custom/header/index.d.ts.map +1 -1
- package/dist/custom/lateral-nav/index.d.ts +1 -1
- package/dist/custom/lateral-nav/index.d.ts.map +1 -1
- package/dist/custom/logo/index.d.ts +1 -18
- package/dist/custom/logo/index.d.ts.map +1 -1
- package/dist/custom/nav-header/index.d.ts +2 -1
- package/dist/custom/nav-header/index.d.ts.map +1 -1
- package/dist/custom/page-layout/index.d.ts +1 -7
- package/dist/custom/page-layout/index.d.ts.map +1 -1
- package/dist/custom/profile-card/index.d.ts +1 -1
- package/dist/custom/profile-card/index.d.ts.map +1 -1
- package/dist/custom/project-card/index.d.ts +2 -13
- package/dist/custom/project-card/index.d.ts.map +1 -1
- package/dist/custom/timeline-item/index.d.ts +2 -2
- package/dist/custom/timeline-item/index.d.ts.map +1 -1
- package/dist/font-faces.css +1 -0
- package/dist/index.d.ts +1 -104
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -8222
- package/dist/index.jsx +1 -0
- package/dist/style/runtime.d.ts +2 -0
- package/dist/style/runtime.d.ts.map +1 -0
- package/dist/style/runtime.js +1 -0
- package/dist/style/runtime.jsx +1 -0
- package/dist/style.d.ts +2 -0
- package/dist/style.d.ts.map +1 -0
- package/dist/style.js +1 -0
- package/dist/style.jsx +1 -0
- package/dist/styles.css +9 -450
- package/dist/theme.css +2 -101
- package/dist/vite.d.ts +15 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +74 -0
- package/dist/vite.js.map +1 -0
- package/dist/vite.jsx +74 -0
- package/dist/vite.jsx.map +1 -0
- package/dist/viviana-tokens.css +318 -0
- package/package.json +300 -44
- package/src/ActionButton.ts +1 -0
- package/src/ActionMenu.ts +1 -0
- package/src/Breadcrumbs.ts +1 -0
- package/src/Button.ts +1 -0
- package/src/Calendar.ts +1 -0
- package/src/CalendarCard.ts +1 -0
- package/src/Card.ts +1 -0
- package/src/CardView.ts +1 -0
- package/src/CenterBaseline.ts +1 -0
- package/src/Chip.ts +1 -0
- package/src/ColorArea.ts +1 -0
- package/src/ColorField.ts +1 -0
- package/src/ColorSlider.ts +1 -0
- package/src/ColorSwatch.ts +1 -0
- package/src/ColorSwatchPicker.ts +1 -0
- package/src/ColorWheel.ts +1 -0
- package/src/ContrastIcon.ts +2 -0
- package/src/Conversation.ts +1 -0
- package/src/Disclosure.ts +1 -0
- package/src/EventCard.ts +1 -0
- package/src/FileTrigger.ts +1 -0
- package/src/GitHubIcon.ts +1 -0
- package/src/LightenIcon.ts +2 -0
- package/src/LinkButton.ts +1 -0
- package/src/ListView.ts +1 -0
- package/src/Logo.ts +1 -0
- package/src/Menu.ts +1 -0
- package/src/PageLayout.ts +1 -0
- package/src/Picker.ts +1 -0
- package/src/ProfileCard.ts +1 -0
- package/src/ProjectCard.ts +1 -0
- package/src/Provider.ts +1 -0
- package/src/RangeCalendar.ts +1 -0
- package/src/SearchField.ts +1 -0
- package/src/SegmentedControl.ts +1 -0
- package/src/Switch.ts +1 -0
- package/src/Tabs.ts +1 -0
- package/src/TextArea.ts +1 -0
- package/src/TextField.ts +1 -0
- package/src/TimelineItem.ts +1 -0
- package/src/TreeView.ts +1 -0
- package/src/components.css +2 -1077
- package/src/custom/calendar-card/index.tsx +99 -50
- package/src/custom/chip/index.tsx +59 -27
- package/src/custom/conversation/index.tsx +149 -55
- package/src/custom/event-card/index.tsx +174 -74
- package/src/custom/header/index.tsx +64 -33
- package/src/custom/lateral-nav/index.tsx +84 -38
- package/src/custom/logo/index.tsx +34 -39
- package/src/custom/nav-header/index.tsx +81 -25
- package/src/custom/page-layout/index.tsx +23 -19
- package/src/custom/profile-card/index.tsx +85 -35
- package/src/custom/project-card/index.tsx +57 -40
- package/src/custom/timeline-item/index.tsx +83 -48
- package/src/font-faces.css +1 -0
- package/src/index.ts +8 -322
- package/src/style/runtime.ts +2 -0
- package/src/style.ts +5 -0
- package/src/styles.css +6 -450
- package/src/theme.css +2 -101
- package/src/vite.ts +152 -0
- package/src/viviana-tokens.css +318 -0
- package/dist/alert/index.d.ts +0 -12
- package/dist/alert/index.d.ts.map +0 -1
- package/dist/autocomplete/index.d.ts +0 -89
- package/dist/autocomplete/index.d.ts.map +0 -1
- package/dist/avatar/index.d.ts +0 -17
- package/dist/avatar/index.d.ts.map +0 -1
- package/dist/badge/index.d.ts +0 -12
- package/dist/badge/index.d.ts.map +0 -1
- package/dist/breadcrumbs/index.d.ts +0 -38
- package/dist/breadcrumbs/index.d.ts.map +0 -1
- package/dist/button/Button.d.ts +0 -19
- package/dist/button/Button.d.ts.map +0 -1
- package/dist/button/index.d.ts +0 -3
- package/dist/button/index.d.ts.map +0 -1
- package/dist/button/types.d.ts +0 -23
- package/dist/button/types.d.ts.map +0 -1
- package/dist/calendar/DateField.d.ts +0 -47
- package/dist/calendar/DateField.d.ts.map +0 -1
- package/dist/calendar/DatePicker.d.ts +0 -48
- package/dist/calendar/DatePicker.d.ts.map +0 -1
- package/dist/calendar/RangeCalendar.d.ts +0 -42
- package/dist/calendar/RangeCalendar.d.ts.map +0 -1
- package/dist/calendar/TimeField.d.ts +0 -44
- package/dist/calendar/TimeField.d.ts.map +0 -1
- package/dist/calendar/index.d.ts +0 -50
- package/dist/calendar/index.d.ts.map +0 -1
- package/dist/checkbox/index.d.ts +0 -43
- package/dist/checkbox/index.d.ts.map +0 -1
- package/dist/color/index.d.ts +0 -228
- package/dist/color/index.d.ts.map +0 -1
- package/dist/combobox/index.d.ts +0 -81
- package/dist/combobox/index.d.ts.map +0 -1
- package/dist/dialog/Dialog.d.ts +0 -67
- package/dist/dialog/Dialog.d.ts.map +0 -1
- package/dist/dialog/index.d.ts +0 -3
- package/dist/dialog/index.d.ts.map +0 -1
- package/dist/disclosure/index.d.ts +0 -84
- package/dist/disclosure/index.d.ts.map +0 -1
- package/dist/gridlist/index.d.ts +0 -92
- package/dist/gridlist/index.d.ts.map +0 -1
- package/dist/icon/icons/GitHubIcon.d.ts +0 -7
- package/dist/icon/icons/GitHubIcon.d.ts.map +0 -1
- package/dist/icon/index.d.ts +0 -28
- package/dist/icon/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/index.ssr.js +0 -6631
- package/dist/index.ssr.js.map +0 -7
- package/dist/landmark/index.d.ts +0 -83
- package/dist/landmark/index.d.ts.map +0 -1
- package/dist/link/index.d.ts +0 -39
- package/dist/link/index.d.ts.map +0 -1
- package/dist/listbox/index.d.ts +0 -47
- package/dist/listbox/index.d.ts.map +0 -1
- package/dist/menu/index.d.ts +0 -74
- package/dist/menu/index.d.ts.map +0 -1
- package/dist/meter/index.d.ts +0 -49
- package/dist/meter/index.d.ts.map +0 -1
- package/dist/numberfield/index.d.ts +0 -50
- package/dist/numberfield/index.d.ts.map +0 -1
- package/dist/popover/index.d.ts +0 -85
- package/dist/popover/index.d.ts.map +0 -1
- package/dist/progress-bar/index.d.ts +0 -49
- package/dist/progress-bar/index.d.ts.map +0 -1
- package/dist/radio/index.d.ts +0 -46
- package/dist/radio/index.d.ts.map +0 -1
- package/dist/searchfield/index.d.ts +0 -44
- package/dist/searchfield/index.d.ts.map +0 -1
- package/dist/select/index.d.ts +0 -72
- package/dist/select/index.d.ts.map +0 -1
- package/dist/separator/index.d.ts +0 -42
- package/dist/separator/index.d.ts.map +0 -1
- package/dist/slider/index.d.ts +0 -53
- package/dist/slider/index.d.ts.map +0 -1
- package/dist/switch/ToggleSwitch.d.ts +0 -28
- package/dist/switch/ToggleSwitch.d.ts.map +0 -1
- package/dist/switch/index.d.ts +0 -26
- package/dist/switch/index.d.ts.map +0 -1
- package/dist/table/index.d.ts +0 -140
- package/dist/table/index.d.ts.map +0 -1
- package/dist/tabs/index.d.ts +0 -56
- package/dist/tabs/index.d.ts.map +0 -1
- package/dist/tag-group/index.d.ts +0 -80
- package/dist/tag-group/index.d.ts.map +0 -1
- package/dist/test-utils/index.d.ts +0 -44
- package/dist/test-utils/index.d.ts.map +0 -1
- package/dist/textfield/index.d.ts +0 -31
- package/dist/textfield/index.d.ts.map +0 -1
- package/dist/toast/index.d.ts +0 -101
- package/dist/toast/index.d.ts.map +0 -1
- package/dist/toolbar/index.d.ts +0 -42
- package/dist/toolbar/index.d.ts.map +0 -1
- package/dist/tooltip/index.d.ts +0 -78
- package/dist/tooltip/index.d.ts.map +0 -1
- package/dist/tree/index.d.ts +0 -99
- package/dist/tree/index.d.ts.map +0 -1
- package/src/alert/index.tsx +0 -48
- package/src/assets/favicon.png +0 -0
- package/src/assets/fire.gif +0 -0
- package/src/autocomplete/index.tsx +0 -313
- package/src/avatar/index.tsx +0 -75
- package/src/badge/index.tsx +0 -43
- package/src/breadcrumbs/index.tsx +0 -207
- package/src/button/Button.tsx +0 -74
- package/src/button/index.ts +0 -2
- package/src/button/types.ts +0 -24
- package/src/calendar/DateField.tsx +0 -200
- package/src/calendar/DatePicker.tsx +0 -298
- package/src/calendar/RangeCalendar.tsx +0 -236
- package/src/calendar/TimeField.tsx +0 -196
- package/src/calendar/index.tsx +0 -223
- package/src/checkbox/index.tsx +0 -257
- package/src/color/index.tsx +0 -687
- package/src/combobox/index.tsx +0 -383
- package/src/dialog/Dialog.tsx +0 -260
- package/src/dialog/index.tsx +0 -3
- package/src/disclosure/index.tsx +0 -307
- package/src/gridlist/index.tsx +0 -403
- package/src/icon/icons/GitHubIcon.tsx +0 -20
- package/src/icon/index.tsx +0 -48
- package/src/landmark/index.tsx +0 -231
- package/src/link/index.tsx +0 -130
- package/src/listbox/index.tsx +0 -231
- package/src/menu/index.tsx +0 -297
- package/src/meter/index.tsx +0 -163
- package/src/numberfield/index.tsx +0 -482
- package/src/popover/index.tsx +0 -260
- package/src/progress-bar/index.tsx +0 -169
- package/src/radio/index.tsx +0 -173
- package/src/searchfield/index.tsx +0 -453
- package/src/select/index.tsx +0 -349
- package/src/separator/index.tsx +0 -141
- package/src/slider/index.tsx +0 -382
- package/src/switch/ToggleSwitch.tsx +0 -112
- package/src/switch/index.tsx +0 -90
- package/src/table/index.tsx +0 -531
- package/src/tabs/index.tsx +0 -273
- package/src/tag-group/index.tsx +0 -240
- package/src/test-utils/index.ts +0 -40
- package/src/textfield/index.tsx +0 -211
- package/src/toast/index.tsx +0 -324
- package/src/toolbar/index.tsx +0 -108
- package/src/tooltip/index.tsx +0 -197
- package/src/tree/index.tsx +0 -494
|
@@ -1,42 +1,98 @@
|
|
|
1
|
-
import type { JSX } from
|
|
2
|
-
import { Show } from
|
|
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" };
|
|
3
8
|
|
|
4
9
|
export interface NavHeaderProps {
|
|
5
|
-
logo?: string
|
|
6
|
-
logoAlt?: string
|
|
7
|
-
logoText?: string
|
|
8
|
-
children?: JSX.Element
|
|
9
|
-
menuIcon?: JSX.Element
|
|
10
|
-
onMenuClick?: () => void
|
|
11
|
-
|
|
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;
|
|
12
18
|
}
|
|
13
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
|
+
|
|
14
68
|
export function NavHeader(props: NavHeaderProps) {
|
|
15
69
|
return (
|
|
16
|
-
<nav class={
|
|
17
|
-
<div class=
|
|
18
|
-
<Show
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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"} />
|
|
26
81
|
</Show>
|
|
27
82
|
</div>
|
|
28
83
|
|
|
29
|
-
<div class=
|
|
84
|
+
<div class={trail}>
|
|
30
85
|
{props.children}
|
|
31
86
|
<Show when={props.menuIcon}>
|
|
32
|
-
<
|
|
33
|
-
class=
|
|
34
|
-
|
|
87
|
+
<HeadlessButton
|
|
88
|
+
class={menuButton}
|
|
89
|
+
onPress={() => props.onMenuClick?.()}
|
|
90
|
+
aria-label={props.menuAriaLabel ?? "Open menu"}
|
|
35
91
|
>
|
|
36
92
|
{props.menuIcon}
|
|
37
|
-
</
|
|
93
|
+
</HeadlessButton>
|
|
38
94
|
</Show>
|
|
39
95
|
</div>
|
|
40
96
|
</nav>
|
|
41
|
-
)
|
|
97
|
+
);
|
|
42
98
|
}
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { JSX, splitProps } from
|
|
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" };
|
|
2
6
|
|
|
3
7
|
export interface PageLayoutProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** Add padding-top to account for fixed header (use for non-landing pages) */
|
|
7
|
-
withHeader?: boolean
|
|
8
|
+
children: JSX.Element;
|
|
9
|
+
withHeader?: boolean;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
+
});
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const header = local.withHeader ? 'vui-page--with-header' : ''
|
|
20
|
-
const custom = local.class ?? ''
|
|
21
|
-
return [base, header, custom].filter(Boolean).join(' ')
|
|
22
|
-
}
|
|
22
|
+
export function PageLayout(props: PageLayoutProps) {
|
|
23
|
+
const [local, rest] = splitProps(props, ["class", "withHeader"]);
|
|
23
24
|
|
|
24
25
|
return (
|
|
25
|
-
<div
|
|
26
|
+
<div
|
|
27
|
+
class={`${page({ isWithHeader: local.withHeader ?? false })} ${local.class ?? ""}`}
|
|
28
|
+
{...rest}
|
|
29
|
+
>
|
|
26
30
|
{props.children}
|
|
27
31
|
</div>
|
|
28
|
-
)
|
|
32
|
+
);
|
|
29
33
|
}
|
|
@@ -1,64 +1,114 @@
|
|
|
1
|
-
import type { JSX } from
|
|
2
|
-
import { Show } from
|
|
3
|
-
import { Avatar } from
|
|
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" };
|
|
4
8
|
|
|
5
9
|
export interface ProfileCardProps {
|
|
6
|
-
username: string
|
|
7
|
-
avatar?: string
|
|
8
|
-
bio?: string
|
|
9
|
-
followers?: number
|
|
10
|
-
following?: number
|
|
10
|
+
username: string;
|
|
11
|
+
avatar?: string;
|
|
12
|
+
bio?: string;
|
|
13
|
+
followers?: number;
|
|
14
|
+
following?: number;
|
|
11
15
|
/**
|
|
12
16
|
* Actions to display below the profile.
|
|
13
17
|
* Use a function returning JSX for SSR compatibility: `actions={() => <Button>...</Button>}`
|
|
14
18
|
*/
|
|
15
|
-
actions?: JSX.Element | (() => JSX.Element)
|
|
16
|
-
class?: string
|
|
19
|
+
actions?: JSX.Element | (() => JSX.Element);
|
|
20
|
+
class?: string;
|
|
17
21
|
}
|
|
18
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
|
+
|
|
19
77
|
export function ProfileCard(props: ProfileCardProps) {
|
|
20
78
|
const formatNumber = (num: number) => {
|
|
21
|
-
if (num >= 1000000) return `${(num / 1000000).toFixed(1)}M
|
|
22
|
-
if (num >= 1000) return `${(num / 1000).toFixed(1)}K
|
|
23
|
-
return num.toString()
|
|
24
|
-
}
|
|
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
|
+
};
|
|
25
83
|
|
|
26
84
|
return (
|
|
27
|
-
<div class={
|
|
28
|
-
<div class=
|
|
85
|
+
<div class={`${card} ${props.class ?? ""}`}>
|
|
86
|
+
<div class={head}>
|
|
29
87
|
<Avatar src={props.avatar} alt={props.username} size="lg" />
|
|
30
|
-
<div class=
|
|
31
|
-
<h3 class=
|
|
32
|
-
{props.username}
|
|
33
|
-
</h3>
|
|
88
|
+
<div class={info}>
|
|
89
|
+
<h3 class={name}>{props.username}</h3>
|
|
34
90
|
<Show when={props.bio}>
|
|
35
|
-
<p class=
|
|
91
|
+
<p class={bio}>{props.bio}</p>
|
|
36
92
|
</Show>
|
|
37
|
-
<div class=
|
|
93
|
+
<div class={stats}>
|
|
38
94
|
<Show when={props.followers !== undefined}>
|
|
39
|
-
<span
|
|
40
|
-
<span class=
|
|
41
|
-
{formatNumber(props.followers!)}
|
|
42
|
-
</span>{' '}
|
|
43
|
-
seguidores
|
|
95
|
+
<span>
|
|
96
|
+
<span class={statValue}>{formatNumber(props.followers!)}</span> seguidores
|
|
44
97
|
</span>
|
|
45
98
|
</Show>
|
|
46
99
|
<Show when={props.following !== undefined}>
|
|
47
|
-
<span
|
|
48
|
-
<span class=
|
|
49
|
-
{formatNumber(props.following!)}
|
|
50
|
-
</span>{' '}
|
|
51
|
-
siguiendo
|
|
100
|
+
<span>
|
|
101
|
+
<span class={statValue}>{formatNumber(props.following!)}</span> siguiendo
|
|
52
102
|
</span>
|
|
53
103
|
</Show>
|
|
54
104
|
</div>
|
|
55
105
|
</div>
|
|
56
106
|
</div>
|
|
57
107
|
<Show when={props.actions}>
|
|
58
|
-
<div class=
|
|
59
|
-
{typeof props.actions ===
|
|
108
|
+
<div class={actionRow}>
|
|
109
|
+
{typeof props.actions === "function" ? props.actions() : props.actions}
|
|
60
110
|
</div>
|
|
61
111
|
</Show>
|
|
62
112
|
</div>
|
|
63
|
-
)
|
|
113
|
+
);
|
|
64
114
|
}
|
|
@@ -1,59 +1,76 @@
|
|
|
1
|
-
import type { JSX } from
|
|
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" };
|
|
2
7
|
|
|
3
|
-
export type ProjectCardSize =
|
|
8
|
+
export type ProjectCardSize = "sm" | "md" | "lg";
|
|
4
9
|
|
|
5
10
|
export interface ProjectCardProps {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
href?: string
|
|
14
|
-
/** Size of the card */
|
|
15
|
-
size?: ProjectCardSize
|
|
16
|
-
/** Whether the project is inactive/greyed out */
|
|
17
|
-
inactive?: boolean
|
|
18
|
-
/** Additional CSS class */
|
|
19
|
-
class?: string
|
|
11
|
+
name: string;
|
|
12
|
+
imageSrc: string;
|
|
13
|
+
imageAlt?: string;
|
|
14
|
+
href?: string;
|
|
15
|
+
size?: ProjectCardSize;
|
|
16
|
+
inactive?: boolean;
|
|
17
|
+
class?: string;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
+
|
|
26
54
|
export function ProjectCard(props: ProjectCardProps): JSX.Element {
|
|
27
|
-
const size = () => props.size ??
|
|
28
|
-
const inactive = () => props.inactive ?? false
|
|
55
|
+
const size = () => props.size ?? "sm";
|
|
56
|
+
const inactive = () => props.inactive ?? false;
|
|
29
57
|
|
|
30
58
|
const cardContent = () => (
|
|
31
59
|
<>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
<img
|
|
36
|
-
class="vui-project-card__image"
|
|
37
|
-
src={props.imageSrc}
|
|
38
|
-
alt={props.imageAlt ?? props.name}
|
|
39
|
-
/>
|
|
60
|
+
<img class={image} src={props.imageSrc} alt={props.imageAlt ?? props.name} />
|
|
61
|
+
<span class={caption({ size: size() })}>{props.name}</span>
|
|
40
62
|
</>
|
|
41
|
-
)
|
|
63
|
+
);
|
|
42
64
|
|
|
43
|
-
const
|
|
44
|
-
`vui-project-card vui-project-card--${size()} ${inactive() ? 'vui-project-card--inactive' : ''} ${props.class ?? ''}`
|
|
65
|
+
const classes = () => `${card({ size: size(), isInactive: inactive() })} ${props.class ?? ""}`;
|
|
45
66
|
|
|
46
67
|
if (props.href) {
|
|
47
68
|
return (
|
|
48
|
-
<a href={props.href} target="_blank" rel="noopener noreferrer" class={
|
|
69
|
+
<a href={props.href} target="_blank" rel="noopener noreferrer" class={classes()}>
|
|
49
70
|
{cardContent()}
|
|
50
71
|
</a>
|
|
51
|
-
)
|
|
72
|
+
);
|
|
52
73
|
}
|
|
53
74
|
|
|
54
|
-
return (
|
|
55
|
-
<div class={cardClasses()}>
|
|
56
|
-
{cardContent()}
|
|
57
|
-
</div>
|
|
58
|
-
)
|
|
75
|
+
return <div class={classes()}>{cardContent()}</div>;
|
|
59
76
|
}
|
|
@@ -1,105 +1,140 @@
|
|
|
1
|
-
import type { JSX } from
|
|
2
|
-
import { Show } from
|
|
3
|
-
import { Avatar } from
|
|
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" };
|
|
4
8
|
|
|
5
|
-
export type TimelineEventType =
|
|
9
|
+
export type TimelineEventType = "follow" | "like" | "comment" | "event" | "custom";
|
|
6
10
|
|
|
7
11
|
export interface TimelineItemProps {
|
|
8
|
-
type?: TimelineEventType
|
|
12
|
+
type?: TimelineEventType;
|
|
9
13
|
/**
|
|
10
14
|
* Icon to display between the two avatars.
|
|
11
15
|
* Use a function returning JSX for SSR compatibility: `icon={() => <MyIcon />}`
|
|
12
16
|
* Or pass a simple string for text-based icons: `icon="👋"`
|
|
13
17
|
*/
|
|
14
|
-
icon?: string | (() => JSX.Element)
|
|
18
|
+
icon?: string | (() => JSX.Element);
|
|
15
19
|
leftUser?: {
|
|
16
|
-
name: string
|
|
17
|
-
avatar?: string
|
|
18
|
-
}
|
|
20
|
+
name: string;
|
|
21
|
+
avatar?: string;
|
|
22
|
+
};
|
|
19
23
|
rightUser?: {
|
|
20
|
-
name: string
|
|
21
|
-
avatar?: string
|
|
22
|
-
}
|
|
24
|
+
name: string;
|
|
25
|
+
avatar?: string;
|
|
26
|
+
};
|
|
23
27
|
/**
|
|
24
28
|
* Custom message content.
|
|
25
29
|
* Use a function returning JSX for SSR compatibility: `message={() => <span>...</span>}`
|
|
26
30
|
* Or pass a simple string.
|
|
27
31
|
*/
|
|
28
|
-
message?: string | (() => JSX.Element)
|
|
29
|
-
class?: string
|
|
32
|
+
message?: string | (() => JSX.Element);
|
|
33
|
+
class?: string;
|
|
30
34
|
}
|
|
31
35
|
|
|
36
|
+
const nameEmph = style({
|
|
37
|
+
fontWeight: "bold",
|
|
38
|
+
color: "[var(--color-accent)]",
|
|
39
|
+
});
|
|
40
|
+
|
|
32
41
|
const eventMessages: Record<TimelineEventType, (left: string, right: string) => JSX.Element> = {
|
|
33
42
|
follow: (left, right) => (
|
|
34
43
|
<>
|
|
35
|
-
<span class=
|
|
36
|
-
{
|
|
37
|
-
<span class=
|
|
44
|
+
<span class={nameEmph}>{left}</span>
|
|
45
|
+
{" ha empezado a seguir a "}
|
|
46
|
+
<span class={nameEmph}>{right}</span>
|
|
38
47
|
</>
|
|
39
48
|
),
|
|
40
49
|
like: (left, right) => (
|
|
41
50
|
<>
|
|
42
|
-
<span class=
|
|
43
|
-
{
|
|
44
|
-
<span class=
|
|
51
|
+
<span class={nameEmph}>{left}</span>
|
|
52
|
+
{" le ha dado like a "}
|
|
53
|
+
<span class={nameEmph}>{right}</span>
|
|
45
54
|
</>
|
|
46
55
|
),
|
|
47
56
|
comment: (left, right) => (
|
|
48
57
|
<>
|
|
49
|
-
<span class=
|
|
50
|
-
{
|
|
51
|
-
<span class=
|
|
58
|
+
<span class={nameEmph}>{left}</span>
|
|
59
|
+
{" ha comentado en "}
|
|
60
|
+
<span class={nameEmph}>{right}</span>
|
|
52
61
|
</>
|
|
53
62
|
),
|
|
54
63
|
event: (left, right) => (
|
|
55
64
|
<>
|
|
56
|
-
<span class=
|
|
57
|
-
{
|
|
58
|
-
<span class=
|
|
65
|
+
<span class={nameEmph}>{left}</span>
|
|
66
|
+
{" asistirá al evento de "}
|
|
67
|
+
<span class={nameEmph}>{right}</span>
|
|
59
68
|
</>
|
|
60
69
|
),
|
|
61
70
|
custom: () => null,
|
|
62
|
-
}
|
|
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
|
+
});
|
|
63
100
|
|
|
64
101
|
export function TimelineItem(props: TimelineItemProps) {
|
|
65
|
-
const type = () => props.type ??
|
|
66
|
-
const leftName = () => props.leftUser?.name ??
|
|
67
|
-
const rightName = () => props.rightUser?.name ??
|
|
102
|
+
const type = () => props.type ?? "follow";
|
|
103
|
+
const leftName = () => props.leftUser?.name ?? "";
|
|
104
|
+
const rightName = () => props.rightUser?.name ?? "";
|
|
68
105
|
|
|
69
106
|
const renderIcon = () => {
|
|
70
|
-
const icon = props.icon
|
|
71
|
-
if (!icon) return null
|
|
72
|
-
if (typeof icon ===
|
|
73
|
-
return icon()
|
|
74
|
-
}
|
|
107
|
+
const icon = props.icon;
|
|
108
|
+
if (!icon) return null;
|
|
109
|
+
if (typeof icon === "string") return icon;
|
|
110
|
+
return icon();
|
|
111
|
+
};
|
|
75
112
|
|
|
76
113
|
const renderMessage = () => {
|
|
77
|
-
const message = props.message
|
|
78
|
-
if (!message) return null
|
|
79
|
-
if (typeof message ===
|
|
80
|
-
return message()
|
|
81
|
-
}
|
|
114
|
+
const message = props.message;
|
|
115
|
+
if (!message) return null;
|
|
116
|
+
if (typeof message === "string") return message;
|
|
117
|
+
return message();
|
|
118
|
+
};
|
|
82
119
|
|
|
83
120
|
return (
|
|
84
|
-
<div class={
|
|
85
|
-
<div class=
|
|
121
|
+
<div class={`${card} ${props.class ?? ""}`}>
|
|
122
|
+
<div class={avatarsRow}>
|
|
86
123
|
<Show when={props.leftUser}>
|
|
87
124
|
<Avatar src={props.leftUser!.avatar} alt={props.leftUser!.name} />
|
|
88
125
|
</Show>
|
|
89
|
-
<Show when={props.icon}>
|
|
90
|
-
{renderIcon()}
|
|
91
|
-
</Show>
|
|
126
|
+
<Show when={props.icon}>{renderIcon()}</Show>
|
|
92
127
|
<Show when={props.rightUser}>
|
|
93
128
|
<Avatar src={props.rightUser!.avatar} alt={props.rightUser!.name} />
|
|
94
129
|
</Show>
|
|
95
130
|
</div>
|
|
96
|
-
<div class=
|
|
97
|
-
<span
|
|
131
|
+
<div class={messageRow}>
|
|
132
|
+
<span>
|
|
98
133
|
<Show when={props.message} fallback={eventMessages[type()](leftName(), rightName())}>
|
|
99
134
|
{renderMessage()}
|
|
100
135
|
</Show>
|
|
101
136
|
</span>
|
|
102
137
|
</div>
|
|
103
138
|
</div>
|
|
104
|
-
)
|
|
139
|
+
);
|
|
105
140
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@proyecto-viviana/solid-spectrum/font-faces.css";
|