@proyecto-viviana/ui 0.3.5 → 0.4.1
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 +96 -0
- package/dist/CalendarCard.js.map +1 -0
- package/dist/CalendarCard.jsx +50 -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 +176 -0
- package/dist/Conversation.js.map +1 -0
- package/dist/Conversation.jsx +106 -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 +171 -0
- package/dist/EventCard.js.map +1 -0
- package/dist/EventCard.jsx +94 -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 +77 -0
- package/dist/ProfileCard.js.map +1 -0
- package/dist/ProfileCard.jsx +52 -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 +162 -0
- package/dist/ProjectCard.js.map +1 -0
- package/dist/ProjectCard.jsx +131 -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 +16 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +82 -0
- package/dist/vite.js.map +1 -0
- package/dist/vite.jsx +82 -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 +108 -50
- package/src/custom/chip/index.tsx +63 -27
- package/src/custom/conversation/index.tsx +166 -55
- package/src/custom/event-card/index.tsx +195 -74
- package/src/custom/header/index.tsx +64 -33
- package/src/custom/lateral-nav/index.tsx +93 -38
- package/src/custom/logo/index.tsx +41 -39
- package/src/custom/nav-header/index.tsx +89 -25
- package/src/custom/page-layout/index.tsx +23 -19
- package/src/custom/profile-card/index.tsx +94 -35
- package/src/custom/project-card/index.tsx +57 -40
- package/src/custom/timeline-item/index.tsx +91 -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 +164 -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
package/dist/vite.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import macros from "unplugin-parcel-macros";
|
|
2
|
+
//#region src/vite.ts
|
|
3
|
+
const macroCssIdPattern = /^macro-[a-f0-9]+\.css$/;
|
|
4
|
+
const macroCssImportPattern = /import\s+["']macro-[a-f0-9]+\.css["'];\n?/g;
|
|
5
|
+
function getMacroSourceFilePath(id) {
|
|
6
|
+
const queryIndex = id.indexOf("?");
|
|
7
|
+
if (queryIndex === -1 || !/^\?tsr-split=[^&#]+(?:#.*)?$/.test(id.slice(queryIndex))) return id;
|
|
8
|
+
return id.slice(0, queryIndex);
|
|
9
|
+
}
|
|
10
|
+
function getMacroCssFileName(id) {
|
|
11
|
+
const fileName = id.split("/").pop();
|
|
12
|
+
return fileName && macroCssIdPattern.test(fileName) ? fileName : null;
|
|
13
|
+
}
|
|
14
|
+
function removeMacroCssImports(code) {
|
|
15
|
+
return code.replace(macroCssImportPattern, "");
|
|
16
|
+
}
|
|
17
|
+
function getMacroCssContent(content) {
|
|
18
|
+
if (typeof content === "string") return content;
|
|
19
|
+
if (content && typeof content === "object" && "code" in content) {
|
|
20
|
+
const code = content.code;
|
|
21
|
+
return typeof code === "string" ? code : null;
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the S2 style() macro plugin wrapped so its emitted CSS resolves and
|
|
27
|
+
* loads correctly under rolldown-vite. Place it before `vite-plugin-solid`.
|
|
28
|
+
*/
|
|
29
|
+
function vivianaMacros() {
|
|
30
|
+
const plugin = macros.rolldown();
|
|
31
|
+
const macroCssCache = /* @__PURE__ */ new Map();
|
|
32
|
+
const cacheMacroCss = (id, content) => {
|
|
33
|
+
const fileName = getMacroCssFileName(id);
|
|
34
|
+
const css = getMacroCssContent(content);
|
|
35
|
+
if (fileName && css != null) macroCssCache.set(fileName, css);
|
|
36
|
+
return css;
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
...plugin,
|
|
40
|
+
transformInclude(id) {
|
|
41
|
+
return plugin.transformInclude?.(getMacroSourceFilePath(id)) ?? false;
|
|
42
|
+
},
|
|
43
|
+
async transform(code, id) {
|
|
44
|
+
const result = await plugin.transform?.call(this, code, getMacroSourceFilePath(id));
|
|
45
|
+
const transformedCode = typeof result === "string" ? result : result && typeof result === "object" && "code" in result ? String(result.code) : "";
|
|
46
|
+
for (const match of transformedCode.matchAll(/import\s+["'](macro-[a-f0-9]+\.css)["'];/g)) {
|
|
47
|
+
const content = await plugin.load?.call(this, match[1]);
|
|
48
|
+
cacheMacroCss(match[1], content);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
},
|
|
52
|
+
async resolveId(id, importer, options) {
|
|
53
|
+
const resolved = await plugin.resolveId?.call(this, id, importer, options);
|
|
54
|
+
if (resolved) return resolved;
|
|
55
|
+
const fileName = getMacroCssFileName(id);
|
|
56
|
+
if (fileName && macroCssCache.has(fileName)) return fileName;
|
|
57
|
+
return resolved;
|
|
58
|
+
},
|
|
59
|
+
loadInclude(id) {
|
|
60
|
+
const fileName = getMacroCssFileName(id);
|
|
61
|
+
return fileName != null && macroCssCache.has(fileName) || (plugin.loadInclude?.(id) ?? false);
|
|
62
|
+
},
|
|
63
|
+
async load(id) {
|
|
64
|
+
if (plugin.loadInclude?.(id)) {
|
|
65
|
+
const content = await plugin.load?.call(this, id);
|
|
66
|
+
const css = cacheMacroCss(id, content);
|
|
67
|
+
if (css != null) return css;
|
|
68
|
+
return content;
|
|
69
|
+
}
|
|
70
|
+
const fileName = getMacroCssFileName(id);
|
|
71
|
+
if (fileName) return macroCssCache.get(fileName);
|
|
72
|
+
return null;
|
|
73
|
+
},
|
|
74
|
+
renderChunk(code) {
|
|
75
|
+
return removeMacroCssImports(code);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { vivianaMacros };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["// The supported Vite macro preset for apps that author their own `style()` calls\n// against `@proyecto-viviana/ui/style`.\n//\n// Consuming the *pre-built* components needs no macro plugin — their style()\n// calls are already expanded in the published build. But an app that writes its\n// own macro calls must run the S2 style() macro at its own build. The bare\n// `unplugin-parcel-macros` plugin isn't enough under rolldown-vite: the macro\n// emits `import \"macro-<hash>.css\"` statements plus matching virtual CSS modules,\n// and rolldown doesn't honor the plugin's resolveId/load for those virtual ids\n// (\"failed to resolve import macro-….css\"). So we wrap it: cache each macro CSS\n// body as it's transformed, resolve/serve those ids ourselves (with a `.css`\n// extension so Vite's CSS pipeline bundles them), then strip the now-redundant JS\n// import. This is the single source of truth for that wrapper — apps import it\n// instead of copying it into their config.\n//\n// `unplugin-parcel-macros` is a peerDependency: every app that authors style()\n// already installs it, and it must be the app's instance (it runs at the app's\n// build), so we never bundle it.\n//\n// Usage (a dual-target app build, e.g. TanStack Start / solid-start):\n//\n// import { defineConfig } from \"vite\";\n// import solid from \"vite-plugin-solid\";\n// import { vivianaMacros } from \"@proyecto-viviana/ui/vite\";\n//\n// export default defineConfig({\n// plugins: [vivianaMacros(), solid({ ssr: true })],\n// // Keep our Solid packages out of the optimizer and bundle them into SSR:\n// optimizeDeps: { exclude: [\"@proyecto-viviana/ui\", \"@proyecto-viviana/solid-spectrum\"] },\n// ssr: { noExternal: [\"@proyecto-viviana/ui\", \"@proyecto-viviana/solid-spectrum\"] },\n// });\n//\n// Plugin order: place `vivianaMacros()` before `vite-plugin-solid` (the macro\n// must expand style() before Solid compiles JSX), and before framework plugins\n// (TanStack Start / Cloudflare) that wrap the build. The macro plugin only\n// touches macro CSS resolution/loading and import stripping; the\n// `optimizeDeps.exclude` / `ssr.noExternal` of our Solid packages stays\n// app-owned (it depends on whether the app links sources or pre-built dists).\nimport macros from \"unplugin-parcel-macros\";\n\n// A minimal structural view of the rolldown plugin that\n// `unplugin-parcel-macros` returns — only the hooks we wrap. Kept local (and\n// self-contained, with no rolldown/vite type imports) so the emitted\n// `dist/vite.d.ts` is portable: consumers don't need rolldown's types resolvable\n// to use the helper, and tsc can name the return type. `macros.rolldown()` is\n// typed `Plugin | Plugin[]`; we always get the single-plugin form.\ninterface MacroPlugin {\n name?: string;\n transformInclude?: (id: string) => boolean | void;\n transform?: (this: unknown, code: string, id: string) => unknown;\n resolveId?: (this: unknown, id: string, importer?: string, options?: object) => unknown;\n loadInclude?: (id: string) => boolean | void;\n load?: (this: unknown, id: string) => unknown;\n [key: string]: unknown;\n}\n\nconst macroCssIdPattern = /^macro-[a-f0-9]+\\.css$/;\nconst macroCssImportPattern = /import\\s+[\"']macro-[a-f0-9]+\\.css[\"'];\\n?/g;\n\nfunction getMacroSourceFilePath(id: string) {\n const queryIndex = id.indexOf(\"?\");\n if (queryIndex === -1 || !/^\\?tsr-split=[^&#]+(?:#.*)?$/.test(id.slice(queryIndex))) {\n return id;\n }\n return id.slice(0, queryIndex);\n}\n\nfunction getMacroCssFileName(id: string) {\n const fileName = id.split(\"/\").pop();\n return fileName && macroCssIdPattern.test(fileName) ? fileName : null;\n}\n\nfunction removeMacroCssImports(code: string) {\n return code.replace(macroCssImportPattern, \"\");\n}\n\nfunction getMacroCssContent(content: unknown) {\n if (typeof content === \"string\") {\n return content;\n }\n\n if (content && typeof content === \"object\" && \"code\" in content) {\n const code = (content as { code: unknown }).code;\n return typeof code === \"string\" ? code : null;\n }\n\n return null;\n}\n\n/**\n * Returns the S2 style() macro plugin wrapped so its emitted CSS resolves and\n * loads correctly under rolldown-vite. Place it before `vite-plugin-solid`.\n */\nexport function vivianaMacros(): MacroPlugin {\n const plugin = macros.rolldown() as unknown as MacroPlugin;\n const macroCssCache = new Map<string, string>();\n\n const cacheMacroCss = (id: string, content: unknown) => {\n const fileName = getMacroCssFileName(id);\n const css = getMacroCssContent(content);\n if (fileName && css != null) {\n macroCssCache.set(fileName, css);\n }\n return css;\n };\n\n return {\n ...plugin,\n transformInclude(id: string) {\n return plugin.transformInclude?.(getMacroSourceFilePath(id)) ?? false;\n },\n async transform(this: unknown, code: string, id: string) {\n const result = await plugin.transform?.call(this, code, getMacroSourceFilePath(id));\n const transformedCode =\n typeof result === \"string\"\n ? result\n : result && typeof result === \"object\" && \"code\" in result\n ? String(result.code)\n : \"\";\n\n for (const match of transformedCode.matchAll(/import\\s+[\"'](macro-[a-f0-9]+\\.css)[\"'];/g)) {\n const content = await plugin.load?.call(this, match[1]);\n cacheMacroCss(match[1], content);\n }\n\n return result;\n },\n async resolveId(this: unknown, id: string, importer?: string, options?: object) {\n const resolved = await plugin.resolveId?.call(this, id, importer, options);\n if (resolved) {\n return resolved;\n }\n const fileName = getMacroCssFileName(id);\n if (fileName && macroCssCache.has(fileName)) {\n return fileName;\n }\n return resolved;\n },\n loadInclude(id: string) {\n const fileName = getMacroCssFileName(id);\n return (\n (fileName != null && macroCssCache.has(fileName)) || (plugin.loadInclude?.(id) ?? false)\n );\n },\n async load(this: unknown, id: string) {\n if (plugin.loadInclude?.(id)) {\n const content = await plugin.load?.call(this, id);\n const css = cacheMacroCss(id, content);\n if (css != null) {\n return css;\n }\n return content;\n }\n const fileName = getMacroCssFileName(id);\n if (fileName) {\n return macroCssCache.get(fileName);\n }\n return null;\n },\n renderChunk(code: string) {\n return removeMacroCssImports(code);\n },\n };\n}\n"],"mappings":";;AAwDA,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAE9B,SAAS,uBAAuB,IAAY;CAC1C,MAAM,aAAa,GAAG,QAAQ,GAAG;CACjC,IAAI,eAAe,MAAM,CAAC,+BAA+B,KAAK,GAAG,MAAM,UAAU,CAAC,GAChF,OAAO;CAET,OAAO,GAAG,MAAM,GAAG,UAAU;AAC/B;AAEA,SAAS,oBAAoB,IAAY;CACvC,MAAM,WAAW,GAAG,MAAM,GAAG,EAAE,IAAI;CACnC,OAAO,YAAY,kBAAkB,KAAK,QAAQ,IAAI,WAAW;AACnE;AAEA,SAAS,sBAAsB,MAAc;CAC3C,OAAO,KAAK,QAAQ,uBAAuB,EAAE;AAC/C;AAEA,SAAS,mBAAmB,SAAkB;CAC5C,IAAI,OAAO,YAAY,UACrB,OAAO;CAGT,IAAI,WAAW,OAAO,YAAY,YAAY,UAAU,SAAS;EAC/D,MAAM,OAAQ,QAA8B;EAC5C,OAAO,OAAO,SAAS,WAAW,OAAO;CAC3C;CAEA,OAAO;AACT;;;;;AAMA,SAAgB,gBAA6B;CAC3C,MAAM,SAAS,OAAO,SAAS;CAC/B,MAAM,gCAAgB,IAAI,IAAoB;CAE9C,MAAM,iBAAiB,IAAY,YAAqB;EACtD,MAAM,WAAW,oBAAoB,EAAE;EACvC,MAAM,MAAM,mBAAmB,OAAO;EACtC,IAAI,YAAY,OAAO,MACrB,cAAc,IAAI,UAAU,GAAG;EAEjC,OAAO;CACT;CAEA,OAAO;EACL,GAAG;EACH,iBAAiB,IAAY;GAC3B,OAAO,OAAO,mBAAmB,uBAAuB,EAAE,CAAC,KAAK;EAClE;EACA,MAAM,UAAyB,MAAc,IAAY;GACvD,MAAM,SAAS,MAAM,OAAO,WAAW,KAAK,MAAM,MAAM,uBAAuB,EAAE,CAAC;GAClF,MAAM,kBACJ,OAAO,WAAW,WACd,SACA,UAAU,OAAO,WAAW,YAAY,UAAU,SAChD,OAAO,OAAO,IAAI,IAClB;GAER,KAAK,MAAM,SAAS,gBAAgB,SAAS,2CAA2C,GAAG;IACzF,MAAM,UAAU,MAAM,OAAO,MAAM,KAAK,MAAM,MAAM,EAAE;IACtD,cAAc,MAAM,IAAI,OAAO;GACjC;GAEA,OAAO;EACT;EACA,MAAM,UAAyB,IAAY,UAAmB,SAAkB;GAC9E,MAAM,WAAW,MAAM,OAAO,WAAW,KAAK,MAAM,IAAI,UAAU,OAAO;GACzE,IAAI,UACF,OAAO;GAET,MAAM,WAAW,oBAAoB,EAAE;GACvC,IAAI,YAAY,cAAc,IAAI,QAAQ,GACxC,OAAO;GAET,OAAO;EACT;EACA,YAAY,IAAY;GACtB,MAAM,WAAW,oBAAoB,EAAE;GACvC,OACG,YAAY,QAAQ,cAAc,IAAI,QAAQ,MAAO,OAAO,cAAc,EAAE,KAAK;EAEtF;EACA,MAAM,KAAoB,IAAY;GACpC,IAAI,OAAO,cAAc,EAAE,GAAG;IAC5B,MAAM,UAAU,MAAM,OAAO,MAAM,KAAK,MAAM,EAAE;IAChD,MAAM,MAAM,cAAc,IAAI,OAAO;IACrC,IAAI,OAAO,MACT,OAAO;IAET,OAAO;GACT;GACA,MAAM,WAAW,oBAAoB,EAAE;GACvC,IAAI,UACF,OAAO,cAAc,IAAI,QAAQ;GAEnC,OAAO;EACT;EACA,YAAY,MAAc;GACxB,OAAO,sBAAsB,IAAI;EACnC;CACF;AACF"}
|
package/dist/vite.jsx
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import macros from "unplugin-parcel-macros";
|
|
2
|
+
//#region src/vite.ts
|
|
3
|
+
const macroCssIdPattern = /^macro-[a-f0-9]+\.css$/;
|
|
4
|
+
const macroCssImportPattern = /import\s+["']macro-[a-f0-9]+\.css["'];\n?/g;
|
|
5
|
+
function getMacroSourceFilePath(id) {
|
|
6
|
+
const queryIndex = id.indexOf("?");
|
|
7
|
+
if (queryIndex === -1 || !/^\?tsr-split=[^&#]+(?:#.*)?$/.test(id.slice(queryIndex))) return id;
|
|
8
|
+
return id.slice(0, queryIndex);
|
|
9
|
+
}
|
|
10
|
+
function getMacroCssFileName(id) {
|
|
11
|
+
const fileName = id.split("/").pop();
|
|
12
|
+
return fileName && macroCssIdPattern.test(fileName) ? fileName : null;
|
|
13
|
+
}
|
|
14
|
+
function removeMacroCssImports(code) {
|
|
15
|
+
return code.replace(macroCssImportPattern, "");
|
|
16
|
+
}
|
|
17
|
+
function getMacroCssContent(content) {
|
|
18
|
+
if (typeof content === "string") return content;
|
|
19
|
+
if (content && typeof content === "object" && "code" in content) {
|
|
20
|
+
const code = content.code;
|
|
21
|
+
return typeof code === "string" ? code : null;
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the S2 style() macro plugin wrapped so its emitted CSS resolves and
|
|
27
|
+
* loads correctly under rolldown-vite. Place it before `vite-plugin-solid`.
|
|
28
|
+
*/
|
|
29
|
+
function vivianaMacros() {
|
|
30
|
+
const plugin = macros.rolldown();
|
|
31
|
+
const macroCssCache = /* @__PURE__ */ new Map();
|
|
32
|
+
const cacheMacroCss = (id, content) => {
|
|
33
|
+
const fileName = getMacroCssFileName(id);
|
|
34
|
+
const css = getMacroCssContent(content);
|
|
35
|
+
if (fileName && css != null) macroCssCache.set(fileName, css);
|
|
36
|
+
return css;
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
...plugin,
|
|
40
|
+
transformInclude(id) {
|
|
41
|
+
return plugin.transformInclude?.(getMacroSourceFilePath(id)) ?? false;
|
|
42
|
+
},
|
|
43
|
+
async transform(code, id) {
|
|
44
|
+
const result = await plugin.transform?.call(this, code, getMacroSourceFilePath(id));
|
|
45
|
+
const transformedCode = typeof result === "string" ? result : result && typeof result === "object" && "code" in result ? String(result.code) : "";
|
|
46
|
+
for (const match of transformedCode.matchAll(/import\s+["'](macro-[a-f0-9]+\.css)["'];/g)) {
|
|
47
|
+
const content = await plugin.load?.call(this, match[1]);
|
|
48
|
+
cacheMacroCss(match[1], content);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
},
|
|
52
|
+
async resolveId(id, importer, options) {
|
|
53
|
+
const resolved = await plugin.resolveId?.call(this, id, importer, options);
|
|
54
|
+
if (resolved) return resolved;
|
|
55
|
+
const fileName = getMacroCssFileName(id);
|
|
56
|
+
if (fileName && macroCssCache.has(fileName)) return fileName;
|
|
57
|
+
return resolved;
|
|
58
|
+
},
|
|
59
|
+
loadInclude(id) {
|
|
60
|
+
const fileName = getMacroCssFileName(id);
|
|
61
|
+
return fileName != null && macroCssCache.has(fileName) || (plugin.loadInclude?.(id) ?? false);
|
|
62
|
+
},
|
|
63
|
+
async load(id) {
|
|
64
|
+
if (plugin.loadInclude?.(id)) {
|
|
65
|
+
const content = await plugin.load?.call(this, id);
|
|
66
|
+
const css = cacheMacroCss(id, content);
|
|
67
|
+
if (css != null) return css;
|
|
68
|
+
return content;
|
|
69
|
+
}
|
|
70
|
+
const fileName = getMacroCssFileName(id);
|
|
71
|
+
if (fileName) return macroCssCache.get(fileName);
|
|
72
|
+
return null;
|
|
73
|
+
},
|
|
74
|
+
renderChunk(code) {
|
|
75
|
+
return removeMacroCssImports(code);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { vivianaMacros };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=vite.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.jsx","names":[],"sources":["../src/vite.ts"],"sourcesContent":["// The supported Vite macro preset for apps that author their own `style()` calls\n// against `@proyecto-viviana/ui/style`.\n//\n// Consuming the *pre-built* components needs no macro plugin — their style()\n// calls are already expanded in the published build. But an app that writes its\n// own macro calls must run the S2 style() macro at its own build. The bare\n// `unplugin-parcel-macros` plugin isn't enough under rolldown-vite: the macro\n// emits `import \"macro-<hash>.css\"` statements plus matching virtual CSS modules,\n// and rolldown doesn't honor the plugin's resolveId/load for those virtual ids\n// (\"failed to resolve import macro-….css\"). So we wrap it: cache each macro CSS\n// body as it's transformed, resolve/serve those ids ourselves (with a `.css`\n// extension so Vite's CSS pipeline bundles them), then strip the now-redundant JS\n// import. This is the single source of truth for that wrapper — apps import it\n// instead of copying it into their config.\n//\n// `unplugin-parcel-macros` is a peerDependency: every app that authors style()\n// already installs it, and it must be the app's instance (it runs at the app's\n// build), so we never bundle it.\n//\n// Usage (a dual-target app build, e.g. TanStack Start / solid-start):\n//\n// import { defineConfig } from \"vite\";\n// import solid from \"vite-plugin-solid\";\n// import { vivianaMacros } from \"@proyecto-viviana/ui/vite\";\n//\n// export default defineConfig({\n// plugins: [vivianaMacros(), solid({ ssr: true })],\n// // Keep our Solid packages out of the optimizer and bundle them into SSR:\n// optimizeDeps: { exclude: [\"@proyecto-viviana/ui\", \"@proyecto-viviana/solid-spectrum\"] },\n// ssr: { noExternal: [\"@proyecto-viviana/ui\", \"@proyecto-viviana/solid-spectrum\"] },\n// });\n//\n// Plugin order: place `vivianaMacros()` before `vite-plugin-solid` (the macro\n// must expand style() before Solid compiles JSX), and before framework plugins\n// (TanStack Start / Cloudflare) that wrap the build. The macro plugin only\n// touches macro CSS resolution/loading and import stripping; the\n// `optimizeDeps.exclude` / `ssr.noExternal` of our Solid packages stays\n// app-owned (it depends on whether the app links sources or pre-built dists).\nimport macros from \"unplugin-parcel-macros\";\n\n// A minimal structural view of the rolldown plugin that\n// `unplugin-parcel-macros` returns — only the hooks we wrap. Kept local (and\n// self-contained, with no rolldown/vite type imports) so the emitted\n// `dist/vite.d.ts` is portable: consumers don't need rolldown's types resolvable\n// to use the helper, and tsc can name the return type. `macros.rolldown()` is\n// typed `Plugin | Plugin[]`; we always get the single-plugin form.\ninterface MacroPlugin {\n name?: string;\n transformInclude?: (id: string) => boolean | void;\n transform?: (this: unknown, code: string, id: string) => unknown;\n resolveId?: (this: unknown, id: string, importer?: string, options?: object) => unknown;\n loadInclude?: (id: string) => boolean | void;\n load?: (this: unknown, id: string) => unknown;\n [key: string]: unknown;\n}\n\nconst macroCssIdPattern = /^macro-[a-f0-9]+\\.css$/;\nconst macroCssImportPattern = /import\\s+[\"']macro-[a-f0-9]+\\.css[\"'];\\n?/g;\n\nfunction getMacroSourceFilePath(id: string) {\n const queryIndex = id.indexOf(\"?\");\n if (queryIndex === -1 || !/^\\?tsr-split=[^&#]+(?:#.*)?$/.test(id.slice(queryIndex))) {\n return id;\n }\n return id.slice(0, queryIndex);\n}\n\nfunction getMacroCssFileName(id: string) {\n const fileName = id.split(\"/\").pop();\n return fileName && macroCssIdPattern.test(fileName) ? fileName : null;\n}\n\nfunction removeMacroCssImports(code: string) {\n return code.replace(macroCssImportPattern, \"\");\n}\n\nfunction getMacroCssContent(content: unknown) {\n if (typeof content === \"string\") {\n return content;\n }\n\n if (content && typeof content === \"object\" && \"code\" in content) {\n const code = (content as { code: unknown }).code;\n return typeof code === \"string\" ? code : null;\n }\n\n return null;\n}\n\n/**\n * Returns the S2 style() macro plugin wrapped so its emitted CSS resolves and\n * loads correctly under rolldown-vite. Place it before `vite-plugin-solid`.\n */\nexport function vivianaMacros(): MacroPlugin {\n const plugin = macros.rolldown() as unknown as MacroPlugin;\n const macroCssCache = new Map<string, string>();\n\n const cacheMacroCss = (id: string, content: unknown) => {\n const fileName = getMacroCssFileName(id);\n const css = getMacroCssContent(content);\n if (fileName && css != null) {\n macroCssCache.set(fileName, css);\n }\n return css;\n };\n\n return {\n ...plugin,\n transformInclude(id: string) {\n return plugin.transformInclude?.(getMacroSourceFilePath(id)) ?? false;\n },\n async transform(this: unknown, code: string, id: string) {\n const result = await plugin.transform?.call(this, code, getMacroSourceFilePath(id));\n const transformedCode =\n typeof result === \"string\"\n ? result\n : result && typeof result === \"object\" && \"code\" in result\n ? String(result.code)\n : \"\";\n\n for (const match of transformedCode.matchAll(/import\\s+[\"'](macro-[a-f0-9]+\\.css)[\"'];/g)) {\n const content = await plugin.load?.call(this, match[1]);\n cacheMacroCss(match[1], content);\n }\n\n return result;\n },\n async resolveId(this: unknown, id: string, importer?: string, options?: object) {\n const resolved = await plugin.resolveId?.call(this, id, importer, options);\n if (resolved) {\n return resolved;\n }\n const fileName = getMacroCssFileName(id);\n if (fileName && macroCssCache.has(fileName)) {\n return fileName;\n }\n return resolved;\n },\n loadInclude(id: string) {\n const fileName = getMacroCssFileName(id);\n return (\n (fileName != null && macroCssCache.has(fileName)) || (plugin.loadInclude?.(id) ?? false)\n );\n },\n async load(this: unknown, id: string) {\n if (plugin.loadInclude?.(id)) {\n const content = await plugin.load?.call(this, id);\n const css = cacheMacroCss(id, content);\n if (css != null) {\n return css;\n }\n return content;\n }\n const fileName = getMacroCssFileName(id);\n if (fileName) {\n return macroCssCache.get(fileName);\n }\n return null;\n },\n renderChunk(code: string) {\n return removeMacroCssImports(code);\n },\n };\n}\n"],"mappings":";;AAwDA,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAE9B,SAAS,uBAAuB,IAAY;CAC1C,MAAM,aAAa,GAAG,QAAQ,GAAG;CACjC,IAAI,eAAe,MAAM,CAAC,+BAA+B,KAAK,GAAG,MAAM,UAAU,CAAC,GAChF,OAAO;CAET,OAAO,GAAG,MAAM,GAAG,UAAU;AAC/B;AAEA,SAAS,oBAAoB,IAAY;CACvC,MAAM,WAAW,GAAG,MAAM,GAAG,EAAE,IAAI;CACnC,OAAO,YAAY,kBAAkB,KAAK,QAAQ,IAAI,WAAW;AACnE;AAEA,SAAS,sBAAsB,MAAc;CAC3C,OAAO,KAAK,QAAQ,uBAAuB,EAAE;AAC/C;AAEA,SAAS,mBAAmB,SAAkB;CAC5C,IAAI,OAAO,YAAY,UACrB,OAAO;CAGT,IAAI,WAAW,OAAO,YAAY,YAAY,UAAU,SAAS;EAC/D,MAAM,OAAQ,QAA8B;EAC5C,OAAO,OAAO,SAAS,WAAW,OAAO;CAC3C;CAEA,OAAO;AACT;;;;;AAMA,SAAgB,gBAA6B;CAC3C,MAAM,SAAS,OAAO,SAAS;CAC/B,MAAM,gCAAgB,IAAI,IAAoB;CAE9C,MAAM,iBAAiB,IAAY,YAAqB;EACtD,MAAM,WAAW,oBAAoB,EAAE;EACvC,MAAM,MAAM,mBAAmB,OAAO;EACtC,IAAI,YAAY,OAAO,MACrB,cAAc,IAAI,UAAU,GAAG;EAEjC,OAAO;CACT;CAEA,OAAO;EACL,GAAG;EACH,iBAAiB,IAAY;GAC3B,OAAO,OAAO,mBAAmB,uBAAuB,EAAE,CAAC,KAAK;EAClE;EACA,MAAM,UAAyB,MAAc,IAAY;GACvD,MAAM,SAAS,MAAM,OAAO,WAAW,KAAK,MAAM,MAAM,uBAAuB,EAAE,CAAC;GAClF,MAAM,kBACJ,OAAO,WAAW,WACd,SACA,UAAU,OAAO,WAAW,YAAY,UAAU,SAChD,OAAO,OAAO,IAAI,IAClB;GAER,KAAK,MAAM,SAAS,gBAAgB,SAAS,2CAA2C,GAAG;IACzF,MAAM,UAAU,MAAM,OAAO,MAAM,KAAK,MAAM,MAAM,EAAE;IACtD,cAAc,MAAM,IAAI,OAAO;GACjC;GAEA,OAAO;EACT;EACA,MAAM,UAAyB,IAAY,UAAmB,SAAkB;GAC9E,MAAM,WAAW,MAAM,OAAO,WAAW,KAAK,MAAM,IAAI,UAAU,OAAO;GACzE,IAAI,UACF,OAAO;GAET,MAAM,WAAW,oBAAoB,EAAE;GACvC,IAAI,YAAY,cAAc,IAAI,QAAQ,GACxC,OAAO;GAET,OAAO;EACT;EACA,YAAY,IAAY;GACtB,MAAM,WAAW,oBAAoB,EAAE;GACvC,OACG,YAAY,QAAQ,cAAc,IAAI,QAAQ,MAAO,OAAO,cAAc,EAAE,KAAK;EAEtF;EACA,MAAM,KAAoB,IAAY;GACpC,IAAI,OAAO,cAAc,EAAE,GAAG;IAC5B,MAAM,UAAU,MAAM,OAAO,MAAM,KAAK,MAAM,EAAE;IAChD,MAAM,MAAM,cAAc,IAAI,OAAO;IACrC,IAAI,OAAO,MACT,OAAO;IAET,OAAO;GACT;GACA,MAAM,WAAW,oBAAoB,EAAE;GACvC,IAAI,UACF,OAAO,cAAc,IAAI,QAAQ;GAEnC,OAAO;EACT;EACA,YAAY,MAAc;GACxB,OAAO,sBAAsB,IAAI;EACnC;CACF;AACF"}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Viviana ("Silapse") design tokens.
|
|
3
|
+
*
|
|
4
|
+
* The brand's color palette + typography, owned by the design system itself so
|
|
5
|
+
* the product components are self-contained. The S2 style() macro carries the
|
|
6
|
+
* *shape* (spacing, radius, sizing, type ramp) via its named tokens; these vars
|
|
7
|
+
* supply the *colors*, referenced from components as arbitrary `[var(--color-*)]`
|
|
8
|
+
* values. Dark is the default (`:root`); light overrides bind to the same
|
|
9
|
+
* `data-color-scheme` attribute solid-spectrum's theme uses, so a single scheme
|
|
10
|
+
* switch flips both layers together.
|
|
11
|
+
*
|
|
12
|
+
* Values mirror apps/web's palette verbatim — keep them in sync until apps/web
|
|
13
|
+
* consumes this file directly.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
:root {
|
|
17
|
+
/* Grey scale */
|
|
18
|
+
--color-grey-50: #ffffff;
|
|
19
|
+
--color-grey-100: #e0e0e0;
|
|
20
|
+
--color-grey-200: #c0c0c0;
|
|
21
|
+
--color-grey-300: #a0a0a0;
|
|
22
|
+
--color-grey-400: #606060;
|
|
23
|
+
--color-grey-500: #404040;
|
|
24
|
+
--color-grey-600: #1a1a1a;
|
|
25
|
+
--color-grey-700: #111111;
|
|
26
|
+
--color-grey-800: #0a0a0a;
|
|
27
|
+
--color-grey-900: #000000;
|
|
28
|
+
|
|
29
|
+
/* Blue scale */
|
|
30
|
+
--color-blue-50: #f0f7ff;
|
|
31
|
+
--color-blue-100: #ddf4ff;
|
|
32
|
+
--color-blue-200: #b6e3ff;
|
|
33
|
+
--color-blue-300: #80ccff;
|
|
34
|
+
--color-blue-400: #54aeff;
|
|
35
|
+
--color-blue-500: #388bfd;
|
|
36
|
+
--color-blue-600: #1f6feb;
|
|
37
|
+
--color-blue-700: #1158c7;
|
|
38
|
+
--color-blue-800: #0d419d;
|
|
39
|
+
--color-blue-900: #050a12;
|
|
40
|
+
|
|
41
|
+
/* Pink scale */
|
|
42
|
+
--color-pink-50: #fff5f9;
|
|
43
|
+
--color-pink-100: #ffe4f3;
|
|
44
|
+
--color-pink-200: #ffc9e9;
|
|
45
|
+
--color-pink-300: #ffa0d5;
|
|
46
|
+
--color-pink-400: #f778ba;
|
|
47
|
+
--color-pink-500: #d84a8f;
|
|
48
|
+
--color-pink-600: #b13570;
|
|
49
|
+
--color-pink-700: #912b5a;
|
|
50
|
+
--color-pink-800: #702244;
|
|
51
|
+
--color-pink-900: #0f0508;
|
|
52
|
+
|
|
53
|
+
/* Background — pure void */
|
|
54
|
+
--color-bg-100: #404040;
|
|
55
|
+
--color-bg-200: #252525;
|
|
56
|
+
--color-bg-300: #1a1a1a;
|
|
57
|
+
--color-bg-400: #111111;
|
|
58
|
+
--color-bg-light: #515151;
|
|
59
|
+
|
|
60
|
+
/* Primary — blue scale */
|
|
61
|
+
--color-primary: #75abc7;
|
|
62
|
+
--color-primary-50: #081018;
|
|
63
|
+
--color-primary-100: #ddf4ff;
|
|
64
|
+
--color-primary-200: #b6e3ff;
|
|
65
|
+
--color-primary-300: #80ccff;
|
|
66
|
+
--color-primary-400: #54aeff;
|
|
67
|
+
--color-primary-500: #4da0ff;
|
|
68
|
+
--color-primary-600: #3080f4;
|
|
69
|
+
--color-primary-700: #1158c7;
|
|
70
|
+
--color-primary-800: #0d419d;
|
|
71
|
+
--color-primary-900: #050a12;
|
|
72
|
+
|
|
73
|
+
/* Accent — pink */
|
|
74
|
+
--color-accent: #df5c9a;
|
|
75
|
+
--color-accent-50: #100810;
|
|
76
|
+
--color-accent-100: #0f0508;
|
|
77
|
+
--color-accent-200: #150a12;
|
|
78
|
+
--color-accent-300: #ffa0d5;
|
|
79
|
+
--color-accent-400: #f778ba;
|
|
80
|
+
--color-accent-500: #d84a8f;
|
|
81
|
+
--color-accent-600: #f778ba;
|
|
82
|
+
--color-accent-700: #ffa0d5;
|
|
83
|
+
--color-accent-800: #ffc9e9;
|
|
84
|
+
--color-accent-900: #0f0508;
|
|
85
|
+
--color-accent-highlight: #e2a2be;
|
|
86
|
+
|
|
87
|
+
/* Semantic colors */
|
|
88
|
+
--color-success-100: #e5fff3;
|
|
89
|
+
--color-success-200: #102a18;
|
|
90
|
+
--color-success-300: #1a3a25;
|
|
91
|
+
--color-success-400: #c2ffc8;
|
|
92
|
+
--color-success-500: #5bc96e;
|
|
93
|
+
--color-success-600: #238636;
|
|
94
|
+
--color-success-700: #9fefaa;
|
|
95
|
+
--color-success-800: #c2ffc8;
|
|
96
|
+
--color-success-900: #e5fff3;
|
|
97
|
+
--color-warning-100: #fffbe5;
|
|
98
|
+
--color-warning-200: #2a2010;
|
|
99
|
+
--color-warning-300: #3a2c18;
|
|
100
|
+
--color-warning-400: #ffdd87;
|
|
101
|
+
--color-warning-500: #e5c462;
|
|
102
|
+
--color-warning-600: #966a13;
|
|
103
|
+
--color-warning-700: #ffea9f;
|
|
104
|
+
--color-warning-800: #fff3c2;
|
|
105
|
+
--color-warning-900: #fffbe5;
|
|
106
|
+
--color-danger-100: #ffe5e5;
|
|
107
|
+
--color-danger-200: #2a1010;
|
|
108
|
+
--color-danger-300: #401818;
|
|
109
|
+
--color-danger-400: #ff8787;
|
|
110
|
+
--color-danger-500: #e56767;
|
|
111
|
+
--color-danger-600: #da3633;
|
|
112
|
+
--color-danger-700: #ffa8a8;
|
|
113
|
+
--color-danger-800: #ffc7c7;
|
|
114
|
+
--color-danger-900: #ffe5e5;
|
|
115
|
+
|
|
116
|
+
/* Cards */
|
|
117
|
+
--color-cards-bg: #373737;
|
|
118
|
+
--color-cards-bg-load: #484848;
|
|
119
|
+
--color-correct: #83f1a7;
|
|
120
|
+
--color-incorrect: #e74c3c;
|
|
121
|
+
|
|
122
|
+
/* Canvas */
|
|
123
|
+
--color-canvas-bg: #000000;
|
|
124
|
+
|
|
125
|
+
/* Surfaces */
|
|
126
|
+
--color-background: #000000;
|
|
127
|
+
--color-surface: #0a0a0a;
|
|
128
|
+
--color-surface-elevated: #111111;
|
|
129
|
+
|
|
130
|
+
/* Blue depth backgrounds */
|
|
131
|
+
--color-bg-blue-deep: #050a12;
|
|
132
|
+
--color-bg-blue-dark: #081020;
|
|
133
|
+
--color-bg-blue-mid: #0a1830;
|
|
134
|
+
--color-bg-blue-light: #102040;
|
|
135
|
+
|
|
136
|
+
/* Text */
|
|
137
|
+
--color-text: #ffffff;
|
|
138
|
+
--color-text-secondary: #a0a0a0;
|
|
139
|
+
--color-text-muted: #606060;
|
|
140
|
+
--color-text-dim: #4f6d85;
|
|
141
|
+
--color-text-disabled: #404040;
|
|
142
|
+
|
|
143
|
+
/* Borders */
|
|
144
|
+
--color-border: #1a1a1a;
|
|
145
|
+
--color-border-muted: #141414;
|
|
146
|
+
--color-divider: #141414;
|
|
147
|
+
|
|
148
|
+
/* Semantic base + dim */
|
|
149
|
+
--color-success: #3fb950;
|
|
150
|
+
--color-success-dim: #238636;
|
|
151
|
+
--color-warning: #d29922;
|
|
152
|
+
--color-warning-dim: #966a13;
|
|
153
|
+
--color-danger: #f85149;
|
|
154
|
+
--color-danger-dim: #da3633;
|
|
155
|
+
|
|
156
|
+
/* Dim versions (wire base / inactive elements) */
|
|
157
|
+
--color-primary-dim: #1a3040;
|
|
158
|
+
--color-accent-dim: #301520;
|
|
159
|
+
|
|
160
|
+
/* Header background */
|
|
161
|
+
--color-header-bg: #181818;
|
|
162
|
+
|
|
163
|
+
/* Glow effects (for drop-shadow filters) */
|
|
164
|
+
--color-primary-glow: rgba(128, 204, 255, 0.6);
|
|
165
|
+
--color-accent-glow: rgba(255, 160, 213, 0.6);
|
|
166
|
+
--color-fusion-glow: rgba(180, 140, 230, 0.7);
|
|
167
|
+
|
|
168
|
+
/* Semantic background tints */
|
|
169
|
+
--color-success-bg: rgba(63, 185, 80, 0.1);
|
|
170
|
+
--color-warning-bg: rgba(210, 153, 34, 0.1);
|
|
171
|
+
--color-danger-bg: rgba(248, 81, 73, 0.1);
|
|
172
|
+
|
|
173
|
+
/* Typography */
|
|
174
|
+
--font-sen: "Sen", sans-serif;
|
|
175
|
+
--font-jost: "Jost", sans-serif;
|
|
176
|
+
--font-sans: "Sen", sans-serif;
|
|
177
|
+
--font-mono: "JetBrains Mono", monospace;
|
|
178
|
+
--font-title: "Jost", system-ui, sans-serif;
|
|
179
|
+
--font-body: "Sen", system-ui, sans-serif;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[data-color-scheme="light"] {
|
|
183
|
+
/* Grey scale */
|
|
184
|
+
--color-grey-100: #f5f5f5;
|
|
185
|
+
--color-grey-200: #e5e5e5;
|
|
186
|
+
--color-grey-300: #d4d4d4;
|
|
187
|
+
--color-grey-400: #a3a3a3;
|
|
188
|
+
--color-grey-500: #737373;
|
|
189
|
+
--color-grey-600: #525252;
|
|
190
|
+
--color-grey-700: #404040;
|
|
191
|
+
--color-grey-800: #262626;
|
|
192
|
+
--color-grey-900: #171717;
|
|
193
|
+
|
|
194
|
+
--color-blue-100: #e0f0f7;
|
|
195
|
+
--color-blue-200: #b6d9eb;
|
|
196
|
+
--color-blue-300: #8bc4db;
|
|
197
|
+
--color-blue-400: #75abc7;
|
|
198
|
+
--color-blue-500: #5a94b3;
|
|
199
|
+
--color-blue-600: #3d7a9c;
|
|
200
|
+
--color-blue-700: #2b6080;
|
|
201
|
+
--color-blue-800: #1a4560;
|
|
202
|
+
--color-blue-900: #0d2a3d;
|
|
203
|
+
|
|
204
|
+
--color-pink-100: #fef2f7;
|
|
205
|
+
--color-pink-200: #fcc7e0;
|
|
206
|
+
--color-pink-300: #f78fb9;
|
|
207
|
+
--color-pink-400: #df5c9a;
|
|
208
|
+
--color-pink-500: #cf2c74;
|
|
209
|
+
--color-pink-600: #a31f58;
|
|
210
|
+
--color-pink-700: #8a1a4a;
|
|
211
|
+
--color-pink-800: #6b143a;
|
|
212
|
+
--color-pink-900: #4d0f2a;
|
|
213
|
+
|
|
214
|
+
/* Backgrounds — AA-verified against primary text */
|
|
215
|
+
--color-bg-100: #7096a8;
|
|
216
|
+
--color-bg-200: #a8c5d4;
|
|
217
|
+
--color-bg-300: #c8dce6;
|
|
218
|
+
--color-bg-400: #dbe8ef;
|
|
219
|
+
--color-bg-light: #ffffff;
|
|
220
|
+
|
|
221
|
+
/* Primary — blue */
|
|
222
|
+
--color-primary: #75abc7;
|
|
223
|
+
--color-primary-50: #f0f7ff;
|
|
224
|
+
--color-primary-100: #06131d;
|
|
225
|
+
--color-primary-200: #0c2436;
|
|
226
|
+
--color-primary-300: #133a54;
|
|
227
|
+
--color-primary-400: #195073;
|
|
228
|
+
--color-primary-500: #1e6090;
|
|
229
|
+
--color-primary-600: #2470a5;
|
|
230
|
+
--color-primary-700: #5ea8d0;
|
|
231
|
+
--color-primary-800: #9dcce4;
|
|
232
|
+
--color-primary-900: #0d2a3d;
|
|
233
|
+
|
|
234
|
+
/* Accent — pink */
|
|
235
|
+
--color-accent: #df5c9a;
|
|
236
|
+
--color-accent-100: #fef2f7;
|
|
237
|
+
--color-accent-200: #7d1c48;
|
|
238
|
+
--color-accent-300: #f78fb9;
|
|
239
|
+
--color-accent-400: #df5c9a;
|
|
240
|
+
--color-accent-500: #8a1e4a;
|
|
241
|
+
--color-accent-highlight: #d4508a;
|
|
242
|
+
|
|
243
|
+
/* Semantic — darker for readability on light bgs */
|
|
244
|
+
--color-success-100: #e5fff3;
|
|
245
|
+
--color-success-200: #c2ffc8;
|
|
246
|
+
--color-success-300: #9fefaa;
|
|
247
|
+
--color-success-400: #1a7f37;
|
|
248
|
+
--color-success-500: #5bc96e;
|
|
249
|
+
--color-success-600: #116329;
|
|
250
|
+
--color-success-700: #3d7a5f;
|
|
251
|
+
--color-success-800: #2a5741;
|
|
252
|
+
--color-success-900: #1a3529;
|
|
253
|
+
--color-warning-100: #fffbe5;
|
|
254
|
+
--color-warning-200: #fff3c2;
|
|
255
|
+
--color-warning-300: #ffea9f;
|
|
256
|
+
--color-warning-400: #7d5200;
|
|
257
|
+
--color-warning-500: #e5c462;
|
|
258
|
+
--color-warning-600: #654200;
|
|
259
|
+
--color-warning-700: #7a6d42;
|
|
260
|
+
--color-warning-800: #574d2f;
|
|
261
|
+
--color-warning-900: #352f1c;
|
|
262
|
+
--color-danger-100: #ffe5e5;
|
|
263
|
+
--color-danger-200: #ffc7c7;
|
|
264
|
+
--color-danger-300: #ffa8a8;
|
|
265
|
+
--color-danger-400: #cf222e;
|
|
266
|
+
--color-danger-500: #e56767;
|
|
267
|
+
--color-danger-600: #a40e26;
|
|
268
|
+
--color-danger-700: #7a4242;
|
|
269
|
+
--color-danger-800: #572f2f;
|
|
270
|
+
--color-danger-900: #351c1c;
|
|
271
|
+
|
|
272
|
+
--color-cards-bg: #ecf2f5;
|
|
273
|
+
--color-cards-bg-load: #dfeaef;
|
|
274
|
+
--color-correct: #1a7f37;
|
|
275
|
+
--color-incorrect: #cf222e;
|
|
276
|
+
|
|
277
|
+
--color-canvas-bg: #404040;
|
|
278
|
+
|
|
279
|
+
/* Surfaces */
|
|
280
|
+
--color-background: #f2f7fa;
|
|
281
|
+
--color-surface: #ffffff;
|
|
282
|
+
--color-surface-elevated: #e6f0f5;
|
|
283
|
+
|
|
284
|
+
--color-bg-blue-deep: #e0f0f7;
|
|
285
|
+
--color-bg-blue-dark: #b6d9eb;
|
|
286
|
+
--color-bg-blue-mid: #8bc4db;
|
|
287
|
+
--color-bg-blue-light: #75abc7;
|
|
288
|
+
|
|
289
|
+
/* Text */
|
|
290
|
+
--color-text: #1a3040;
|
|
291
|
+
--color-text-secondary: #405d70;
|
|
292
|
+
--color-text-muted: #7096a8;
|
|
293
|
+
--color-text-disabled: #a8c5d4;
|
|
294
|
+
|
|
295
|
+
/* Borders */
|
|
296
|
+
--color-border: #c8dce6;
|
|
297
|
+
--color-border-muted: #dbe8ef;
|
|
298
|
+
--color-divider: #dbe8ef;
|
|
299
|
+
|
|
300
|
+
/* Semantic base + dim */
|
|
301
|
+
--color-success: #5bc96e;
|
|
302
|
+
--color-success-dim: #559d87;
|
|
303
|
+
--color-warning: #e5c462;
|
|
304
|
+
--color-warning-dim: #9d8d55;
|
|
305
|
+
--color-danger: #e56767;
|
|
306
|
+
--color-danger-dim: #9d5555;
|
|
307
|
+
|
|
308
|
+
/* Dim, glow, bg tints */
|
|
309
|
+
--color-primary-dim: #b6d9eb;
|
|
310
|
+
--color-accent-dim: #fcc7e0;
|
|
311
|
+
--color-header-bg: #d0e4ed;
|
|
312
|
+
--color-primary-glow: rgba(117, 171, 199, 0.4);
|
|
313
|
+
--color-accent-glow: rgba(223, 92, 154, 0.4);
|
|
314
|
+
--color-fusion-glow: rgba(170, 130, 180, 0.5);
|
|
315
|
+
--color-success-bg: rgba(63, 185, 80, 0.1);
|
|
316
|
+
--color-warning-bg: rgba(210, 153, 34, 0.15);
|
|
317
|
+
--color-danger-bg: rgba(248, 81, 73, 0.1);
|
|
318
|
+
}
|