@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,20 +0,0 @@
|
|
|
1
|
-
import type { JSX } from 'solid-js';
|
|
2
|
-
|
|
3
|
-
export interface GitHubIconProps {
|
|
4
|
-
size?: number;
|
|
5
|
-
color?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function GitHubIcon(props: GitHubIconProps): JSX.Element {
|
|
9
|
-
return (
|
|
10
|
-
<svg
|
|
11
|
-
viewBox="0 0 24 24"
|
|
12
|
-
width={props.size}
|
|
13
|
-
height={props.size}
|
|
14
|
-
fill={props.color}
|
|
15
|
-
aria-hidden="true"
|
|
16
|
-
>
|
|
17
|
-
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
|
|
18
|
-
</svg>
|
|
19
|
-
);
|
|
20
|
-
}
|
package/src/icon/index.tsx
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Component, JSX } from 'solid-js'
|
|
2
|
-
|
|
3
|
-
export interface IconProps {
|
|
4
|
-
/** The icon component to render (should accept size and color props) */
|
|
5
|
-
icon: Component<{ size?: string | number; color?: string }>
|
|
6
|
-
/** Size of the icon (e.g., '24px' or 24) */
|
|
7
|
-
size?: string | number
|
|
8
|
-
/** Color of the icon */
|
|
9
|
-
color?: string
|
|
10
|
-
/** Whether to show the accent shadow effect (4px offset to bottom) */
|
|
11
|
-
withShadow?: boolean
|
|
12
|
-
/** Additional CSS class */
|
|
13
|
-
class?: string
|
|
14
|
-
/** Click handler */
|
|
15
|
-
onClick?: () => void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Icon wrapper component with optional accent shadow effect.
|
|
20
|
-
*
|
|
21
|
-
* The shadow effect creates a 4px offset accent-colored duplicate
|
|
22
|
-
* of the icon behind it for a stylized look.
|
|
23
|
-
*/
|
|
24
|
-
export function Icon(props: IconProps): JSX.Element {
|
|
25
|
-
const size = () => props.size ?? 24
|
|
26
|
-
const color = () => props.color ?? 'var(--color-primary-500)'
|
|
27
|
-
const IconComponent = props.icon
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div
|
|
31
|
-
class={`vui-icon ${props.withShadow ? 'vui-icon--with-shadow' : ''} ${props.class ?? ''}`}
|
|
32
|
-
onClick={props.onClick}
|
|
33
|
-
>
|
|
34
|
-
{props.withShadow && (
|
|
35
|
-
<div class="vui-icon__shadow">
|
|
36
|
-
<IconComponent size={size()} color="var(--color-accent)" />
|
|
37
|
-
</div>
|
|
38
|
-
)}
|
|
39
|
-
<div class="vui-icon__main">
|
|
40
|
-
<IconComponent size={size()} color={color()} />
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Re-export common icons
|
|
47
|
-
export { GitHubIcon } from './icons/GitHubIcon'
|
|
48
|
-
export type { GitHubIconProps } from './icons/GitHubIcon'
|
package/src/landmark/index.tsx
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Landmark component for proyecto-viviana-ui
|
|
3
|
-
*
|
|
4
|
-
* Styled landmark component built on top of solidaria-components.
|
|
5
|
-
* Landmarks help screen reader users navigate between major sections of a page.
|
|
6
|
-
* Press F6 to cycle through landmarks, or Shift+F6 to go backwards.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { type JSX, splitProps, Show } from 'solid-js'
|
|
10
|
-
import {
|
|
11
|
-
Landmark as HeadlessLandmark,
|
|
12
|
-
useLandmarkController,
|
|
13
|
-
type LandmarkProps as HeadlessLandmarkProps,
|
|
14
|
-
type AriaLandmarkRole,
|
|
15
|
-
type LandmarkController,
|
|
16
|
-
} from '@proyecto-viviana/solidaria-components'
|
|
17
|
-
|
|
18
|
-
// ============================================
|
|
19
|
-
// TYPES
|
|
20
|
-
// ============================================
|
|
21
|
-
|
|
22
|
-
export interface LandmarkProps extends Omit<HeadlessLandmarkProps, 'class' | 'style'> {
|
|
23
|
-
/** Additional CSS class name. */
|
|
24
|
-
class?: string
|
|
25
|
-
/** Whether to show a visual indicator (for development). */
|
|
26
|
-
showLabel?: boolean
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type { AriaLandmarkRole, LandmarkController }
|
|
30
|
-
|
|
31
|
-
// ============================================
|
|
32
|
-
// STYLES
|
|
33
|
-
// ============================================
|
|
34
|
-
|
|
35
|
-
const roleLabels: Record<AriaLandmarkRole, string> = {
|
|
36
|
-
main: 'Main',
|
|
37
|
-
navigation: 'Navigation',
|
|
38
|
-
search: 'Search',
|
|
39
|
-
banner: 'Banner',
|
|
40
|
-
contentinfo: 'Footer',
|
|
41
|
-
complementary: 'Aside',
|
|
42
|
-
form: 'Form',
|
|
43
|
-
region: 'Region',
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const roleColors: Record<AriaLandmarkRole, string> = {
|
|
47
|
-
main: 'bg-accent/10 border-accent-300',
|
|
48
|
-
navigation: 'bg-primary-500/10 border-primary-400',
|
|
49
|
-
search: 'bg-warning-400/10 border-warning-400',
|
|
50
|
-
banner: 'bg-success-400/10 border-success-400',
|
|
51
|
-
contentinfo: 'bg-danger-400/10 border-danger-400',
|
|
52
|
-
complementary: 'bg-primary-300/10 border-primary-300',
|
|
53
|
-
form: 'bg-accent-200/10 border-accent-200',
|
|
54
|
-
region: 'bg-bg-200/50 border-bg-300',
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// ============================================
|
|
58
|
-
// LANDMARK COMPONENT
|
|
59
|
-
// ============================================
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* A landmark is a region of the page that helps screen reader users navigate.
|
|
63
|
-
* Press F6 to cycle through landmarks, or Shift+F6 to go backwards.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```tsx
|
|
67
|
-
* // Main content area
|
|
68
|
-
* <Landmark role="main" aria-label="Main content">
|
|
69
|
-
* <h1>Welcome</h1>
|
|
70
|
-
* <p>Page content here...</p>
|
|
71
|
-
* </Landmark>
|
|
72
|
-
*
|
|
73
|
-
* // Navigation
|
|
74
|
-
* <Landmark role="navigation" aria-label="Primary navigation">
|
|
75
|
-
* <nav>...</nav>
|
|
76
|
-
* </Landmark>
|
|
77
|
-
*
|
|
78
|
-
* // With development label visible
|
|
79
|
-
* <Landmark role="main" aria-label="Main content" showLabel>
|
|
80
|
-
* ...
|
|
81
|
-
* </Landmark>
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
export function Landmark(props: LandmarkProps): JSX.Element {
|
|
85
|
-
const [local, headlessProps] = splitProps(props, ['class', 'showLabel'])
|
|
86
|
-
const customClass = local.class ?? ''
|
|
87
|
-
|
|
88
|
-
const role = () => headlessProps.role
|
|
89
|
-
|
|
90
|
-
const getClassName = (): string => {
|
|
91
|
-
const base = 'relative'
|
|
92
|
-
const debugClass = local.showLabel
|
|
93
|
-
? `border-2 border-dashed ${roleColors[role()]}`
|
|
94
|
-
: ''
|
|
95
|
-
return [base, debugClass, customClass].filter(Boolean).join(' ')
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<HeadlessLandmark {...headlessProps} class={getClassName()}>
|
|
100
|
-
<Show when={local.showLabel}>
|
|
101
|
-
<div
|
|
102
|
-
class={`absolute -top-3 left-2 px-2 py-0.5 text-xs font-medium rounded ${roleColors[role()]} text-primary-200`}
|
|
103
|
-
>
|
|
104
|
-
{roleLabels[role()]}
|
|
105
|
-
<Show when={headlessProps['aria-label']}>
|
|
106
|
-
<span class="text-primary-400"> - {headlessProps['aria-label']}</span>
|
|
107
|
-
</Show>
|
|
108
|
-
</div>
|
|
109
|
-
</Show>
|
|
110
|
-
{props.children}
|
|
111
|
-
</HeadlessLandmark>
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// ============================================
|
|
116
|
-
// SKIP LINK COMPONENT
|
|
117
|
-
// ============================================
|
|
118
|
-
|
|
119
|
-
export interface SkipLinkProps {
|
|
120
|
-
/** The ID of the element to skip to (usually the main landmark). */
|
|
121
|
-
href: string
|
|
122
|
-
/** The text to display in the skip link. */
|
|
123
|
-
children?: JSX.Element
|
|
124
|
-
/** Additional CSS class name. */
|
|
125
|
-
class?: string
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* A skip link allows keyboard users to bypass repetitive navigation and jump directly to main content.
|
|
130
|
-
* The link is visually hidden until focused.
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```tsx
|
|
134
|
-
* <SkipLink href="#main-content">Skip to main content</SkipLink>
|
|
135
|
-
*
|
|
136
|
-
* <Landmark role="navigation">...</Landmark>
|
|
137
|
-
*
|
|
138
|
-
* <Landmark role="main" id="main-content">
|
|
139
|
-
* ...
|
|
140
|
-
* </Landmark>
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
export function SkipLink(props: SkipLinkProps): JSX.Element {
|
|
144
|
-
const customClass = props.class ?? ''
|
|
145
|
-
|
|
146
|
-
const className = [
|
|
147
|
-
// Visually hidden by default
|
|
148
|
-
'absolute left-0 top-0 -translate-y-full',
|
|
149
|
-
// Show when focused
|
|
150
|
-
'focus:translate-y-0',
|
|
151
|
-
// Styling
|
|
152
|
-
'z-50 px-4 py-2 bg-accent text-white font-medium rounded-br-lg',
|
|
153
|
-
'transition-transform duration-200',
|
|
154
|
-
'focus:outline-none focus:ring-2 focus:ring-accent-300 focus:ring-offset-2',
|
|
155
|
-
customClass,
|
|
156
|
-
]
|
|
157
|
-
.filter(Boolean)
|
|
158
|
-
.join(' ')
|
|
159
|
-
|
|
160
|
-
return (
|
|
161
|
-
<a href={props.href} class={className}>
|
|
162
|
-
{props.children ?? 'Skip to main content'}
|
|
163
|
-
</a>
|
|
164
|
-
)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// ============================================
|
|
168
|
-
// LANDMARK NAVIGATOR COMPONENT
|
|
169
|
-
// ============================================
|
|
170
|
-
|
|
171
|
-
export interface LandmarkNavigatorProps {
|
|
172
|
-
/** Additional CSS class name. */
|
|
173
|
-
class?: string
|
|
174
|
-
/** Whether to show the navigator (for development/accessibility testing). */
|
|
175
|
-
isVisible?: boolean
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* A floating navigator for landmarks, useful for development and accessibility testing.
|
|
180
|
-
* Provides buttons to navigate between landmarks programmatically.
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* ```tsx
|
|
184
|
-
* // Show in development only
|
|
185
|
-
* <LandmarkNavigator isVisible={import.meta.env.DEV} />
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
|
-
export function LandmarkNavigator(props: LandmarkNavigatorProps): JSX.Element {
|
|
189
|
-
const controller = useLandmarkController()
|
|
190
|
-
|
|
191
|
-
return (
|
|
192
|
-
<Show when={props.isVisible}>
|
|
193
|
-
<div
|
|
194
|
-
class={`fixed bottom-4 right-4 z-50 flex flex-col gap-2 p-3 bg-bg-400 border border-bg-300 rounded-lg shadow-lg ${props.class ?? ''}`}
|
|
195
|
-
>
|
|
196
|
-
<span class="text-xs font-medium text-primary-400 uppercase tracking-wider">
|
|
197
|
-
Landmarks (F6)
|
|
198
|
-
</span>
|
|
199
|
-
<div class="flex gap-1">
|
|
200
|
-
<button
|
|
201
|
-
type="button"
|
|
202
|
-
onClick={() => controller.focusPrevious()}
|
|
203
|
-
class="px-2 py-1 text-sm bg-bg-300 hover:bg-bg-200 text-primary-200 rounded transition-colors"
|
|
204
|
-
title="Previous landmark (Shift+F6)"
|
|
205
|
-
>
|
|
206
|
-
←
|
|
207
|
-
</button>
|
|
208
|
-
<button
|
|
209
|
-
type="button"
|
|
210
|
-
onClick={() => controller.focusMain()}
|
|
211
|
-
class="px-3 py-1 text-sm bg-accent hover:bg-accent-200 text-white rounded transition-colors"
|
|
212
|
-
title="Go to main content"
|
|
213
|
-
>
|
|
214
|
-
Main
|
|
215
|
-
</button>
|
|
216
|
-
<button
|
|
217
|
-
type="button"
|
|
218
|
-
onClick={() => controller.focusNext()}
|
|
219
|
-
class="px-2 py-1 text-sm bg-bg-300 hover:bg-bg-200 text-primary-200 rounded transition-colors"
|
|
220
|
-
title="Next landmark (F6)"
|
|
221
|
-
>
|
|
222
|
-
→
|
|
223
|
-
</button>
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
</Show>
|
|
227
|
-
)
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Export controller hook for convenience
|
|
231
|
-
export { useLandmarkController }
|
package/src/link/index.tsx
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Link component for proyecto-viviana-ui
|
|
3
|
-
*
|
|
4
|
-
* Styled link component built on top of solidaria-components.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { type JSX, splitProps } from 'solid-js';
|
|
8
|
-
import {
|
|
9
|
-
Link as HeadlessLink,
|
|
10
|
-
type LinkProps as HeadlessLinkProps,
|
|
11
|
-
type LinkRenderProps,
|
|
12
|
-
} from '@proyecto-viviana/solidaria-components';
|
|
13
|
-
|
|
14
|
-
// ============================================
|
|
15
|
-
// TYPES
|
|
16
|
-
// ============================================
|
|
17
|
-
|
|
18
|
-
export type LinkVariant = 'primary' | 'secondary' | 'subtle';
|
|
19
|
-
|
|
20
|
-
export interface LinkProps extends Omit<HeadlessLinkProps, 'class' | 'style' | 'children'> {
|
|
21
|
-
/** The visual style of the link. @default 'primary' */
|
|
22
|
-
variant?: LinkVariant;
|
|
23
|
-
/** Whether the link is on its own vs inside a longer string of text. */
|
|
24
|
-
isStandalone?: boolean;
|
|
25
|
-
/** Whether the link should be displayed with a quiet style (no underline by default). */
|
|
26
|
-
isQuiet?: boolean;
|
|
27
|
-
/** Additional CSS class name. */
|
|
28
|
-
class?: string;
|
|
29
|
-
/** The content of the link. */
|
|
30
|
-
children?: JSX.Element;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// ============================================
|
|
34
|
-
// STYLES
|
|
35
|
-
// ============================================
|
|
36
|
-
|
|
37
|
-
const variantStyles = {
|
|
38
|
-
primary: 'text-accent hover:text-accent-300',
|
|
39
|
-
secondary: 'text-primary-300 hover:text-primary-200',
|
|
40
|
-
subtle: 'text-primary-400 hover:text-primary-300',
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// ============================================
|
|
44
|
-
// LINK COMPONENT
|
|
45
|
-
// ============================================
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Links allow users to navigate to a different location.
|
|
49
|
-
* They can be presented inline inside a paragraph or as standalone text.
|
|
50
|
-
*
|
|
51
|
-
* Built on solidaria-components Link for full accessibility support.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```tsx
|
|
55
|
-
* <Link href="/about">About Us</Link>
|
|
56
|
-
*
|
|
57
|
-
* // Secondary variant
|
|
58
|
-
* <Link href="/help" variant="secondary">Help</Link>
|
|
59
|
-
*
|
|
60
|
-
* // Standalone (bold, no underline until hover)
|
|
61
|
-
* <Link href="/home" isStandalone isQuiet>Home</Link>
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export function Link(props: LinkProps): JSX.Element {
|
|
65
|
-
const [local, headlessProps] = splitProps(props, [
|
|
66
|
-
'variant',
|
|
67
|
-
'isStandalone',
|
|
68
|
-
'isQuiet',
|
|
69
|
-
'class',
|
|
70
|
-
]);
|
|
71
|
-
|
|
72
|
-
const variant = local.variant ?? 'primary';
|
|
73
|
-
const customClass = local.class ?? '';
|
|
74
|
-
|
|
75
|
-
// Generate class based on render props
|
|
76
|
-
const getClassName = (renderProps: LinkRenderProps): string => {
|
|
77
|
-
const base = 'transition-colors duration-200 cursor-pointer rounded-sm outline-none';
|
|
78
|
-
|
|
79
|
-
// Variant colors
|
|
80
|
-
const variantClass = variantStyles[variant];
|
|
81
|
-
|
|
82
|
-
// Underline behavior
|
|
83
|
-
let underlineClass: string;
|
|
84
|
-
if (local.isStandalone && local.isQuiet) {
|
|
85
|
-
// Quiet standalone: no underline by default, underline on hover/focus
|
|
86
|
-
underlineClass = renderProps.isHovered || renderProps.isFocusVisible
|
|
87
|
-
? 'underline'
|
|
88
|
-
: 'no-underline';
|
|
89
|
-
} else {
|
|
90
|
-
// Inline links always have underline for accessibility
|
|
91
|
-
underlineClass = 'underline';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Font weight for standalone
|
|
95
|
-
const weightClass = local.isStandalone ? 'font-medium' : '';
|
|
96
|
-
|
|
97
|
-
// Focus ring
|
|
98
|
-
const focusClass = renderProps.isFocusVisible
|
|
99
|
-
? 'ring-2 ring-accent-300 ring-offset-2 ring-offset-bg-400'
|
|
100
|
-
: '';
|
|
101
|
-
|
|
102
|
-
// Disabled state
|
|
103
|
-
const disabledClass = renderProps.isDisabled
|
|
104
|
-
? 'opacity-50 cursor-not-allowed'
|
|
105
|
-
: '';
|
|
106
|
-
|
|
107
|
-
// Pressed state
|
|
108
|
-
const pressedClass = renderProps.isPressed ? 'opacity-80' : '';
|
|
109
|
-
|
|
110
|
-
return [
|
|
111
|
-
base,
|
|
112
|
-
variantClass,
|
|
113
|
-
underlineClass,
|
|
114
|
-
weightClass,
|
|
115
|
-
focusClass,
|
|
116
|
-
disabledClass,
|
|
117
|
-
pressedClass,
|
|
118
|
-
customClass,
|
|
119
|
-
].filter(Boolean).join(' ');
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<HeadlessLink
|
|
124
|
-
{...headlessProps}
|
|
125
|
-
class={getClassName}
|
|
126
|
-
>
|
|
127
|
-
{props.children}
|
|
128
|
-
</HeadlessLink>
|
|
129
|
-
);
|
|
130
|
-
}
|
package/src/listbox/index.tsx
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ListBox component for proyecto-viviana-ui
|
|
3
|
-
*
|
|
4
|
-
* Styled listbox component built on top of solidaria-components.
|
|
5
|
-
* Inspired by Spectrum 2's ListBox component patterns.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { type JSX, splitProps, createContext, useContext, Show } from 'solid-js'
|
|
9
|
-
import {
|
|
10
|
-
ListBox as HeadlessListBox,
|
|
11
|
-
ListBoxOption as HeadlessListBoxOption,
|
|
12
|
-
type ListBoxProps as HeadlessListBoxProps,
|
|
13
|
-
type ListBoxOptionProps as HeadlessListBoxOptionProps,
|
|
14
|
-
type ListBoxRenderProps,
|
|
15
|
-
type ListBoxOptionRenderProps,
|
|
16
|
-
} from '@proyecto-viviana/solidaria-components'
|
|
17
|
-
import type { Key } from '@proyecto-viviana/solid-stately'
|
|
18
|
-
|
|
19
|
-
// ============================================
|
|
20
|
-
// SIZE CONTEXT
|
|
21
|
-
// ============================================
|
|
22
|
-
|
|
23
|
-
export type ListBoxSize = 'sm' | 'md' | 'lg'
|
|
24
|
-
|
|
25
|
-
const ListBoxSizeContext = createContext<ListBoxSize>('md')
|
|
26
|
-
|
|
27
|
-
// ============================================
|
|
28
|
-
// TYPES
|
|
29
|
-
// ============================================
|
|
30
|
-
|
|
31
|
-
export interface ListBoxProps<T> extends Omit<HeadlessListBoxProps<T>, 'class' | 'style'> {
|
|
32
|
-
/** The size of the listbox. */
|
|
33
|
-
size?: ListBoxSize
|
|
34
|
-
/** Additional CSS class name. */
|
|
35
|
-
class?: string
|
|
36
|
-
/** Label for the listbox. */
|
|
37
|
-
label?: string
|
|
38
|
-
/** Description for the listbox. */
|
|
39
|
-
description?: string
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface ListBoxOptionProps<T> extends Omit<HeadlessListBoxOptionProps<T>, 'class' | 'style'> {
|
|
43
|
-
/** Additional CSS class name. */
|
|
44
|
-
class?: string
|
|
45
|
-
/** Optional description text. */
|
|
46
|
-
description?: string
|
|
47
|
-
/**
|
|
48
|
-
* Optional icon to display before the label.
|
|
49
|
-
* Use a function returning JSX for SSR compatibility: `icon={() => <MyIcon />}`
|
|
50
|
-
*/
|
|
51
|
-
icon?: () => JSX.Element
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ============================================
|
|
55
|
-
// STYLES
|
|
56
|
-
// ============================================
|
|
57
|
-
|
|
58
|
-
const sizeStyles = {
|
|
59
|
-
sm: {
|
|
60
|
-
list: 'py-1',
|
|
61
|
-
option: 'text-sm py-1.5 px-3 gap-2',
|
|
62
|
-
icon: 'h-4 w-4',
|
|
63
|
-
label: 'text-sm',
|
|
64
|
-
description: 'text-xs',
|
|
65
|
-
},
|
|
66
|
-
md: {
|
|
67
|
-
list: 'py-1.5',
|
|
68
|
-
option: 'text-base py-2 px-4 gap-3',
|
|
69
|
-
icon: 'h-5 w-5',
|
|
70
|
-
label: 'text-base',
|
|
71
|
-
description: 'text-sm',
|
|
72
|
-
},
|
|
73
|
-
lg: {
|
|
74
|
-
list: 'py-2',
|
|
75
|
-
option: 'text-lg py-2.5 px-5 gap-3',
|
|
76
|
-
icon: 'h-6 w-6',
|
|
77
|
-
label: 'text-lg',
|
|
78
|
-
description: 'text-base',
|
|
79
|
-
},
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// ============================================
|
|
83
|
-
// LISTBOX COMPONENT
|
|
84
|
-
// ============================================
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* A listbox displays a list of options and allows a user to select one or more of them.
|
|
88
|
-
*
|
|
89
|
-
* Built on solidaria-components ListBox for full accessibility support.
|
|
90
|
-
*/
|
|
91
|
-
export function ListBox<T>(props: ListBoxProps<T>): JSX.Element {
|
|
92
|
-
const [local, headlessProps] = splitProps(props, [
|
|
93
|
-
'size',
|
|
94
|
-
'class',
|
|
95
|
-
'label',
|
|
96
|
-
'description',
|
|
97
|
-
'renderEmptyState',
|
|
98
|
-
])
|
|
99
|
-
|
|
100
|
-
const size = local.size ?? 'md'
|
|
101
|
-
const styles = sizeStyles[size]
|
|
102
|
-
const customClass = local.class ?? ''
|
|
103
|
-
|
|
104
|
-
const getClassName = (renderProps: ListBoxRenderProps): string => {
|
|
105
|
-
const base = 'rounded-lg border-2 border-primary-600 bg-bg-400 overflow-auto focus:outline-none'
|
|
106
|
-
const sizeClass = styles.list
|
|
107
|
-
|
|
108
|
-
let stateClass: string
|
|
109
|
-
if (renderProps.isDisabled) {
|
|
110
|
-
stateClass = 'opacity-50'
|
|
111
|
-
} else {
|
|
112
|
-
stateClass = ''
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const focusClass = renderProps.isFocusVisible
|
|
116
|
-
? 'ring-2 ring-accent-300 ring-offset-2 ring-offset-bg-400'
|
|
117
|
-
: ''
|
|
118
|
-
|
|
119
|
-
return [base, sizeClass, stateClass, focusClass, customClass].filter(Boolean).join(' ')
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const defaultEmptyState = () => (
|
|
123
|
-
<li class="py-4 px-4 text-center text-primary-500">
|
|
124
|
-
No items
|
|
125
|
-
</li>
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<ListBoxSizeContext.Provider value={size}>
|
|
130
|
-
<div class="flex flex-col gap-1.5">
|
|
131
|
-
<Show when={local.label}>
|
|
132
|
-
<label class={`text-primary-200 font-medium ${styles.label}`}>
|
|
133
|
-
{local.label}
|
|
134
|
-
</label>
|
|
135
|
-
</Show>
|
|
136
|
-
<HeadlessListBox
|
|
137
|
-
{...headlessProps}
|
|
138
|
-
class={getClassName}
|
|
139
|
-
renderEmptyState={local.renderEmptyState ?? defaultEmptyState}
|
|
140
|
-
children={props.children}
|
|
141
|
-
/>
|
|
142
|
-
<Show when={local.description}>
|
|
143
|
-
<span class="text-primary-400 text-sm">{local.description}</span>
|
|
144
|
-
</Show>
|
|
145
|
-
</div>
|
|
146
|
-
</ListBoxSizeContext.Provider>
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// ============================================
|
|
151
|
-
// LISTBOX OPTION COMPONENT
|
|
152
|
-
// ============================================
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* An option in a listbox.
|
|
156
|
-
* SSR-compatible - renders icon, check, content, and description directly without render props.
|
|
157
|
-
*/
|
|
158
|
-
export function ListBoxOption<T>(props: ListBoxOptionProps<T>): JSX.Element {
|
|
159
|
-
const [local, headlessProps] = splitProps(props, ['class', 'description', 'icon'])
|
|
160
|
-
const size = useContext(ListBoxSizeContext)
|
|
161
|
-
const sizeStyle = sizeStyles[size]
|
|
162
|
-
const customClass = local.class ?? ''
|
|
163
|
-
|
|
164
|
-
const getClassName = (renderProps: ListBoxOptionRenderProps): string => {
|
|
165
|
-
const base = 'flex items-center cursor-pointer transition-colors duration-150 outline-none'
|
|
166
|
-
const sizeClass = sizeStyle.option
|
|
167
|
-
|
|
168
|
-
let colorClass: string
|
|
169
|
-
if (renderProps.isDisabled) {
|
|
170
|
-
colorClass = 'text-primary-500 cursor-not-allowed'
|
|
171
|
-
} else if (renderProps.isSelected) {
|
|
172
|
-
if (renderProps.isFocused || renderProps.isHovered) {
|
|
173
|
-
colorClass = 'bg-accent/30 text-accent'
|
|
174
|
-
} else {
|
|
175
|
-
colorClass = 'bg-accent/20 text-accent'
|
|
176
|
-
}
|
|
177
|
-
} else if (renderProps.isFocused || renderProps.isHovered) {
|
|
178
|
-
colorClass = 'bg-bg-300 text-primary-100'
|
|
179
|
-
} else {
|
|
180
|
-
colorClass = 'text-primary-200'
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const focusClass = renderProps.isFocusVisible
|
|
184
|
-
? 'ring-2 ring-inset ring-accent-300'
|
|
185
|
-
: ''
|
|
186
|
-
|
|
187
|
-
return [base, sizeClass, colorClass, focusClass, customClass].filter(Boolean).join(' ')
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return (
|
|
191
|
-
<HeadlessListBoxOption
|
|
192
|
-
{...headlessProps}
|
|
193
|
-
class={getClassName}
|
|
194
|
-
>
|
|
195
|
-
{local.icon && <span class={`shrink-0 ${sizeStyle.icon}`}>{local.icon()}</span>}
|
|
196
|
-
<CheckIcon class={`shrink-0 ${sizeStyle.icon} text-accent hidden data-selected:block`} />
|
|
197
|
-
<div class="flex flex-col flex-1 min-w-0">
|
|
198
|
-
<span class="truncate">{props.children as JSX.Element}</span>
|
|
199
|
-
{local.description && (
|
|
200
|
-
<span class={`text-primary-400 truncate ${sizeStyle.description}`}>
|
|
201
|
-
{local.description}
|
|
202
|
-
</span>
|
|
203
|
-
)}
|
|
204
|
-
</div>
|
|
205
|
-
</HeadlessListBoxOption>
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// ============================================
|
|
210
|
-
// ICONS
|
|
211
|
-
// ============================================
|
|
212
|
-
|
|
213
|
-
function CheckIcon(props: { class?: string }): JSX.Element {
|
|
214
|
-
return (
|
|
215
|
-
<svg
|
|
216
|
-
class={props.class}
|
|
217
|
-
fill="none"
|
|
218
|
-
viewBox="0 0 24 24"
|
|
219
|
-
stroke="currentColor"
|
|
220
|
-
stroke-width="2"
|
|
221
|
-
>
|
|
222
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
|
223
|
-
</svg>
|
|
224
|
-
)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Attach sub-components for convenience
|
|
228
|
-
ListBox.Option = ListBoxOption
|
|
229
|
-
|
|
230
|
-
// Re-export Key type for convenience
|
|
231
|
-
export type { Key }
|