moi-computer 0.6.1-next.0 → 0.8.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/README.md +2 -2
- package/client/components/shared/BottomPanel.tsx +2 -1
- package/client/components/shared/PanelHeader.tsx +1 -1
- package/client/features/applets/AppletMount.tsx +9 -22
- package/client/features/applets/applet-cache.ts +7 -0
- package/client/features/applets/applet-styles.ts +21 -1
- package/client/features/applets/useApplet.ts +1 -1
- package/client/features/chat/ChatComposer.tsx +18 -4
- package/client/features/chat/ChatSelector.tsx +1 -1
- package/client/features/chat/TurnView.tsx +1 -1
- package/client/features/home/api.ts +0 -10
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +21 -64
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +1 -1
- package/client/features/scratchpad/Scratchpad.tsx +1 -3
- package/client/features/views/ViewManager.tsx +258 -0
- package/client/features/views/view-residency.ts +77 -0
- package/client/features/widgets/WidgetFrame.tsx +6 -2
- package/client/features/workspace/CustomizePanel.tsx +40 -24
- package/client/features/workspace/WorkspaceLayoutContext.tsx +8 -0
- package/client/features/workspace/WorkspaceScreen.tsx +51 -103
- package/client/features/workspace/WorkspaceTabs.tsx +1 -1
- package/client/index.css +4 -1
- package/client/runtime/workspace-theme.ts +29 -10
- package/client/theme.css +96 -6
- package/dist/chunk-0k7brsms.js +9 -0
- package/dist/{chunk-m11ckkxd.js → chunk-dtwxpxbg.js} +1 -1
- package/dist/{chunk-55sh4dty.js → chunk-ga7t9qsk.js} +1 -1
- package/dist/{chunk-w3tnv51j.js → chunk-h9h8f176.js} +1 -1
- package/dist/{chunk-rxvx4ta9.js → chunk-r5ce5cdg.js} +2 -2
- package/dist/chunk-tey2nq7c.js +31 -0
- package/dist/{chunk-afgbg75t.js → chunk-z73xpsa0.js} +1 -1
- package/dist/chunk-zzgredta.css +1 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +18 -4
- package/lib/system-messages.ts +241 -0
- package/lib/themes.ts +123 -51
- package/lib/types.ts +2 -5
- package/package.json +5 -4
- package/server/api.ts +2 -73
- package/server/bundler/build-applet.ts +7 -4
- package/server/cli.ts +46 -15
- package/server/control.ts +13 -6
- package/server/harness/README.md +11 -0
- package/server/harness/claude-code/NOTES.md +22 -7
- package/server/harness/claude-code/adapter.ts +39 -5
- package/server/moi-scaffold.ts +1 -1
- package/server/registry.ts +0 -20
- package/server/scratchpad-executor.ts +23 -1
- package/server/theme.ts +24 -27
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +94 -57
- package/workspace/.claude/skills/moi-workspace/SKILL.md +10 -12
- package/dist/chunk-175bm057.js +0 -27
- package/dist/chunk-agtetn7n.css +0 -1
- package/dist/chunk-exj6hr30.js +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { lazy, Suspense, useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { AnimatePresence
|
|
3
|
+
import { AnimatePresence } from 'motion/react'
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
IconArticle,
|
|
@@ -15,9 +15,7 @@ import { IconGhost } from '@/client/components/shared/IconGhost'
|
|
|
15
15
|
import { ChatPanel } from '@/client/features/chat/ChatPanel'
|
|
16
16
|
import { ChatPopup } from '@/client/features/chat/ChatPopup'
|
|
17
17
|
import { CustomizePanel } from '@/client/features/workspace/CustomizePanel'
|
|
18
|
-
import { AppletMount } from '@/client/features/applets/AppletMount'
|
|
19
18
|
import { useAppletEvent } from '@/client/features/applets/applet-runtime'
|
|
20
|
-
import { WidgetErrorBoundary } from '@/client/features/applets/WidgetErrorBoundary'
|
|
21
19
|
import { Widgets } from '@/client/features/widgets/Widgets'
|
|
22
20
|
import { PanelHeader } from '@/client/components/shared/PanelHeader'
|
|
23
21
|
import { workspaceProviderIcon } from '@/client/features/home/workspace-presentation'
|
|
@@ -26,8 +24,8 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/
|
|
|
26
24
|
import { WorkspaceSettings } from '@/client/features/settings/WorkspaceSettings'
|
|
27
25
|
import { useAppletChatMessage } from '@/client/features/chat/useAppletChatMessage'
|
|
28
26
|
import { useChat } from '@/client/features/chat/useChat'
|
|
29
|
-
import { useView } from '@/client/features/applets/useApplet'
|
|
30
27
|
import { ViewBuilderTab } from '@/client/features/views/ViewBuilderTab'
|
|
28
|
+
import { ViewManager } from '@/client/features/views/ViewManager'
|
|
31
29
|
import { useViewBuilderActions } from '@/client/features/views/useViewBuilderActions'
|
|
32
30
|
import { useFitsSplitLayout } from '@/client/features/workspace/useFitsSplitLayout'
|
|
33
31
|
import { useWorkspaceAvailability } from '@/client/features/workspace/api'
|
|
@@ -39,7 +37,6 @@ import {
|
|
|
39
37
|
isSessionRunning,
|
|
40
38
|
useLive
|
|
41
39
|
} from '@/client/features/chat/chat-store'
|
|
42
|
-
import { useWorkspaceId } from '@/client/features/workspace/WorkspaceContext'
|
|
43
40
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/WorkspaceLayoutContext'
|
|
44
41
|
import {
|
|
45
42
|
effectiveOpenTabs,
|
|
@@ -100,67 +97,6 @@ function SectionControls({ mode, onToggleMode }: SectionControlsProps) {
|
|
|
100
97
|
)
|
|
101
98
|
}
|
|
102
99
|
|
|
103
|
-
type ViewAppProps = {
|
|
104
|
-
view: ViewInfo
|
|
105
|
-
// The view's addressable state, read from navigation state (focusTab /
|
|
106
|
-
// `moi tab focus`). `{}` on a fresh mount, a new browser tab, or a plain
|
|
107
|
-
// tab-bar click — the view must render sensibly with that.
|
|
108
|
-
params: Record<string, unknown>
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// A view — an agent-defined app — mounted full-area. The bundle owns its own
|
|
112
|
-
// layout + scroll, so we give it a plain filled box and fade it in (mirroring
|
|
113
|
-
// WidgetShell, but full-area instead of a grid cell).
|
|
114
|
-
function ViewApp({ view, params }: ViewAppProps) {
|
|
115
|
-
const workspaceId = useWorkspaceId()
|
|
116
|
-
const bundle = useView(view.id)
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<div className="relative min-h-0 flex-1 overflow-hidden">
|
|
120
|
-
<AnimatePresence mode="wait" initial={false}>
|
|
121
|
-
{bundle.status === 'ready' && (
|
|
122
|
-
<AppletMount
|
|
123
|
-
asChild
|
|
124
|
-
segment="views"
|
|
125
|
-
name={view.id}
|
|
126
|
-
version={bundle.version}
|
|
127
|
-
key={bundle.version}
|
|
128
|
-
>
|
|
129
|
-
<motion.div
|
|
130
|
-
className="absolute inset-0 overflow-auto"
|
|
131
|
-
initial={{ opacity: 0, filter: 'blur(4px)' }}
|
|
132
|
-
animate={{ opacity: 1, filter: 'blur(0px)' }}
|
|
133
|
-
exit={{ opacity: 0, filter: 'blur(4px)' }}
|
|
134
|
-
transition={{ duration: 0.3, ease: 'easeInOut' }}
|
|
135
|
-
>
|
|
136
|
-
<WidgetErrorBoundary
|
|
137
|
-
name={view.id}
|
|
138
|
-
kind="view"
|
|
139
|
-
workspaceId={workspaceId}
|
|
140
|
-
resetKey={bundle.version}
|
|
141
|
-
>
|
|
142
|
-
<bundle.Component params={params} />
|
|
143
|
-
</WidgetErrorBoundary>
|
|
144
|
-
</motion.div>
|
|
145
|
-
</AppletMount>
|
|
146
|
-
)}
|
|
147
|
-
{bundle.status === 'error' && (
|
|
148
|
-
<motion.p
|
|
149
|
-
key={`err-${bundle.version}`}
|
|
150
|
-
className="absolute inset-0 p-4 text-xs text-destructive"
|
|
151
|
-
initial={{ opacity: 0 }}
|
|
152
|
-
animate={{ opacity: 1 }}
|
|
153
|
-
exit={{ opacity: 0 }}
|
|
154
|
-
transition={{ duration: 0.3, ease: 'easeInOut' }}
|
|
155
|
-
>
|
|
156
|
-
{bundle.error}
|
|
157
|
-
</motion.p>
|
|
158
|
-
)}
|
|
159
|
-
</AnimatePresence>
|
|
160
|
-
</div>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
100
|
type WorkspaceCustomizeActionProps = {
|
|
165
101
|
active: boolean
|
|
166
102
|
onToggle: () => void
|
|
@@ -598,8 +534,56 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
598
534
|
{/* Full-screen: whole panel. Split: the left content column. */}
|
|
599
535
|
{(mode === 'fullscreen' || hasWorkspaceContent) && (
|
|
600
536
|
<div
|
|
601
|
-
className={cn(
|
|
537
|
+
className={cn(
|
|
538
|
+
'flex min-h-0 flex-1 flex-col-reverse',
|
|
539
|
+
mode === 'split' && 'min-w-(--column-w)'
|
|
540
|
+
)}
|
|
602
541
|
>
|
|
542
|
+
{activeTab === 'agent' ? (
|
|
543
|
+
tabbedChat
|
|
544
|
+
) : activeTab === 'widgets' ? (
|
|
545
|
+
<Widgets
|
|
546
|
+
editing={widgetMode === 'editing'}
|
|
547
|
+
onEditingChange={editing => setWidgetMode(editing ? 'editing' : 'idle')}
|
|
548
|
+
widgets={widgets}
|
|
549
|
+
onCreateWidget={() => {
|
|
550
|
+
selectSession(null)
|
|
551
|
+
openChat('Create widget')
|
|
552
|
+
}}
|
|
553
|
+
/>
|
|
554
|
+
) : activeTab === 'scratchpad' ? (
|
|
555
|
+
<Suspense fallback={null}>
|
|
556
|
+
<Scratchpad />
|
|
557
|
+
</Suspense>
|
|
558
|
+
) : activeBuilder ? (
|
|
559
|
+
<ViewBuilderTab
|
|
560
|
+
key={activeBuilder.id}
|
|
561
|
+
builder={activeBuilder}
|
|
562
|
+
unavailableReason={unavailableReason}
|
|
563
|
+
onSave={requirements => builderActions.save(activeBuilder.id, requirements)}
|
|
564
|
+
onSubmit={requirements => {
|
|
565
|
+
if (mode === 'fullscreen') setFloatingChatOpen(true)
|
|
566
|
+
return builderActions.submit(activeBuilder, requirements)
|
|
567
|
+
}}
|
|
568
|
+
onOpenChat={() => {
|
|
569
|
+
selectSession(activeBuilder.sessionId)
|
|
570
|
+
openChat()
|
|
571
|
+
}}
|
|
572
|
+
onDiscard={() => discardBuilder(activeBuilder)}
|
|
573
|
+
/>
|
|
574
|
+
) : null}
|
|
575
|
+
|
|
576
|
+
{/* Views are not part of the chain above: ViewManager keeps them
|
|
577
|
+
mounted across tab switches (and collapses to nothing while
|
|
578
|
+
another tab is on screen), which is what makes a switch back
|
|
579
|
+
instant. It stays with the content, so the header below it in
|
|
580
|
+
the DOM keeps painting over both. */}
|
|
581
|
+
<ViewManager
|
|
582
|
+
views={views}
|
|
583
|
+
activeViewId={activeView?.id ?? null}
|
|
584
|
+
params={appletParams}
|
|
585
|
+
/>
|
|
586
|
+
|
|
603
587
|
<PanelHeader>
|
|
604
588
|
<div className="flex min-w-0 flex-1 items-center gap-4">
|
|
605
589
|
<div className="flex items-center gap-2">
|
|
@@ -637,42 +621,6 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
637
621
|
)}
|
|
638
622
|
</div>
|
|
639
623
|
</PanelHeader>
|
|
640
|
-
|
|
641
|
-
{activeTab === 'agent' ? (
|
|
642
|
-
tabbedChat
|
|
643
|
-
) : activeTab === 'widgets' ? (
|
|
644
|
-
<Widgets
|
|
645
|
-
editing={widgetMode === 'editing'}
|
|
646
|
-
onEditingChange={editing => setWidgetMode(editing ? 'editing' : 'idle')}
|
|
647
|
-
widgets={widgets}
|
|
648
|
-
onCreateWidget={() => {
|
|
649
|
-
selectSession(null)
|
|
650
|
-
openChat('Create widget')
|
|
651
|
-
}}
|
|
652
|
-
/>
|
|
653
|
-
) : activeTab === 'scratchpad' ? (
|
|
654
|
-
<Suspense fallback={null}>
|
|
655
|
-
<Scratchpad />
|
|
656
|
-
</Suspense>
|
|
657
|
-
) : activeBuilder ? (
|
|
658
|
-
<ViewBuilderTab
|
|
659
|
-
key={activeBuilder.id}
|
|
660
|
-
builder={activeBuilder}
|
|
661
|
-
unavailableReason={unavailableReason}
|
|
662
|
-
onSave={requirements => builderActions.save(activeBuilder.id, requirements)}
|
|
663
|
-
onSubmit={requirements => {
|
|
664
|
-
if (mode === 'fullscreen') setFloatingChatOpen(true)
|
|
665
|
-
return builderActions.submit(activeBuilder, requirements)
|
|
666
|
-
}}
|
|
667
|
-
onOpenChat={() => {
|
|
668
|
-
selectSession(activeBuilder.sessionId)
|
|
669
|
-
openChat()
|
|
670
|
-
}}
|
|
671
|
-
onDiscard={() => discardBuilder(activeBuilder)}
|
|
672
|
-
/>
|
|
673
|
-
) : activeView ? (
|
|
674
|
-
<ViewApp view={activeView} params={appletParams} />
|
|
675
|
-
) : null}
|
|
676
624
|
</div>
|
|
677
625
|
)}
|
|
678
626
|
|
package/client/index.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@plugin '@tailwindcss/typography';
|
|
13
13
|
|
|
14
14
|
@custom-variant dark (&:is(.dark *));
|
|
15
|
+
@custom-variant dark-or-widget (&:is(.dark *, [data-widget-chrome] *));
|
|
15
16
|
|
|
16
17
|
:root {
|
|
17
18
|
--background: oklch(1 0 0);
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
--muted-foreground: oklch(0.64 0 0);
|
|
27
28
|
--accent: oklch(0 0 0 / 0.07);
|
|
28
29
|
--accent-foreground: var(--foreground);
|
|
30
|
+
--success: oklch(0.527 0.154 150.069);
|
|
29
31
|
--destructive: oklch(0.58 0.22 27);
|
|
30
32
|
--border: oklch(0 0 0 / 0.07);
|
|
31
33
|
--input: oklch(0.922 0 0);
|
|
@@ -71,13 +73,14 @@
|
|
|
71
73
|
--muted-foreground: oklch(0.708 0 0);
|
|
72
74
|
--accent: oklch(1 0 0 / 0.1);
|
|
73
75
|
--accent-foreground: var(--foreground);
|
|
76
|
+
--success: oklch(0.627 0.194 149.214);
|
|
74
77
|
--destructive: oklch(0.58 0.22 27);
|
|
75
78
|
--border: oklch(1 0 0 / 0.1);
|
|
76
79
|
--input: oklch(0.35 0 0);
|
|
77
80
|
--ring: oklch(0.556 0 0);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
/*
|
|
83
|
+
/* Theme tokens and texture utilities shared with applet bundles. */
|
|
81
84
|
@import './theme.css';
|
|
82
85
|
|
|
83
86
|
/* Dragged card floats above all others */
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
2
|
import type { CSSProperties } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
COLOR_THEMES,
|
|
6
|
+
DEFAULT_PRIMARY_COLOR,
|
|
7
|
+
DEFAULT_WORKSPACE_THEME,
|
|
8
|
+
FONT_THEMES,
|
|
9
|
+
RADIUS_THEMES,
|
|
10
|
+
THEME_COLOR_TOKENS,
|
|
11
|
+
deriveThemeColors,
|
|
12
|
+
resolveWorkspaceTheme
|
|
13
|
+
} from '@/lib/themes'
|
|
14
|
+
import type { ThemeColorMode, ThemeColorToken } from '@/lib/themes'
|
|
6
15
|
import type { WorkspaceLayout } from '@/lib/types'
|
|
7
16
|
|
|
8
|
-
const FONT_LINK_ID = '
|
|
9
|
-
const FONT_PREVIEW_LINK_ID = '
|
|
17
|
+
const FONT_LINK_ID = 'moi-fonts'
|
|
18
|
+
const FONT_PREVIEW_LINK_ID = 'moi-font-previews'
|
|
10
19
|
const ALL_FONTS_QUERY = Object.values(FONT_THEMES)
|
|
11
20
|
.map(theme => theme.googleFontsQuery)
|
|
12
21
|
.filter(Boolean)
|
|
@@ -18,9 +27,11 @@ const WORKSPACE_FONT_PROPERTIES = [
|
|
|
18
27
|
const WORKSPACE_COLOR_PROPERTIES = THEME_COLOR_TOKENS.map(
|
|
19
28
|
token => [token, themeColorProperty(token)] as const
|
|
20
29
|
)
|
|
30
|
+
const WORKSPACE_RADIUS_PROPERTY = '--radius' as const
|
|
21
31
|
const WORKSPACE_THEME_PROPERTIES = [
|
|
22
32
|
...WORKSPACE_FONT_PROPERTIES.map(([, property]) => property),
|
|
23
|
-
...WORKSPACE_COLOR_PROPERTIES.map(([, property]) => property)
|
|
33
|
+
...WORKSPACE_COLOR_PROPERTIES.map(([, property]) => property),
|
|
34
|
+
WORKSPACE_RADIUS_PROPERTY
|
|
24
35
|
]
|
|
25
36
|
|
|
26
37
|
type WorkspaceThemeStyle = CSSProperties & {
|
|
@@ -32,16 +43,24 @@ function themeColorProperty(token: ThemeColorToken): `--${string}` {
|
|
|
32
43
|
return `--${name}`
|
|
33
44
|
}
|
|
34
45
|
|
|
35
|
-
export function getWorkspaceThemeStyle(
|
|
46
|
+
export function getWorkspaceThemeStyle(
|
|
47
|
+
theme: WorkspaceLayout['theme'],
|
|
48
|
+
colorMode: ThemeColorMode = 'workspace'
|
|
49
|
+
): WorkspaceThemeStyle {
|
|
36
50
|
const style: WorkspaceThemeStyle = {}
|
|
37
|
-
const
|
|
38
|
-
const
|
|
51
|
+
const resolved = resolveWorkspaceTheme(theme)
|
|
52
|
+
const font = FONT_THEMES[resolved.font] ?? FONT_THEMES[DEFAULT_WORKSPACE_THEME.font]
|
|
53
|
+
const color = COLOR_THEMES[resolved.color] ?? COLOR_THEMES[DEFAULT_WORKSPACE_THEME.color]
|
|
54
|
+
const primary = color.primary ?? (colorMode === 'widget' ? DEFAULT_PRIMARY_COLOR : undefined)
|
|
55
|
+
const colors = primary ? deriveThemeColors(primary, colorMode) : undefined
|
|
56
|
+
const radius = RADIUS_THEMES[resolved.radius] ?? RADIUS_THEMES[DEFAULT_WORKSPACE_THEME.radius]
|
|
39
57
|
for (const [token, property] of WORKSPACE_FONT_PROPERTIES) {
|
|
40
58
|
style[property] = font[token]
|
|
41
59
|
}
|
|
42
60
|
for (const [token, property] of WORKSPACE_COLOR_PROPERTIES) {
|
|
43
61
|
style[property] = colors?.[token]
|
|
44
62
|
}
|
|
63
|
+
style[WORKSPACE_RADIUS_PROPERTY] = radius.radius
|
|
45
64
|
return style
|
|
46
65
|
}
|
|
47
66
|
|
|
@@ -86,11 +105,11 @@ function useDocumentWorkspaceThemeStyle(theme: WorkspaceLayout['theme']) {
|
|
|
86
105
|
// Applies the active workspace theme to the document root so the workspace,
|
|
87
106
|
// sidebar, and body-level portals all resolve the same tokens.
|
|
88
107
|
export function useWorkspaceTheme(theme: WorkspaceLayout['theme']) {
|
|
89
|
-
const font = theme
|
|
108
|
+
const { font } = resolveWorkspaceTheme(theme)
|
|
90
109
|
useDocumentWorkspaceThemeStyle(theme)
|
|
91
110
|
|
|
92
111
|
useEffect(() => {
|
|
93
|
-
const config = FONT_THEMES[font] ?? FONT_THEMES.
|
|
112
|
+
const config = FONT_THEMES[font] ?? FONT_THEMES[DEFAULT_WORKSPACE_THEME.font]
|
|
94
113
|
|
|
95
114
|
const existing = document.getElementById(FONT_LINK_ID) as HTMLLinkElement | null
|
|
96
115
|
if (!config.googleFontsQuery) {
|
package/client/theme.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Shared
|
|
3
|
-
* applet bundles (server/bundler/build-applet.ts
|
|
4
|
-
*
|
|
2
|
+
* Shared Tailwind theme and utilities for both the host app (client/index.css)
|
|
3
|
+
* and applet bundles (server/bundler/build-applet.ts inlines this file into the
|
|
4
|
+
* applet's synthetic CSS).
|
|
5
5
|
*
|
|
6
6
|
* The actual CSS variables (`--sans`, `--mono`, `--background`, etc.)
|
|
7
7
|
* are owned by the host and declared on `:root` / `.dark` in
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* - does NOT emit `--font-sans`, `--color-background`, or their source
|
|
14
14
|
* variables into the output
|
|
15
15
|
*
|
|
16
|
-
* Net effect: applets compile
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* Net effect: the host and applets compile the same semantic theme utilities
|
|
17
|
+
* and texture utilities, then pick up the host's runtime theme without
|
|
18
|
+
* redefining any variable themselves.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
@theme inline {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
--color-muted-foreground: var(--muted-foreground);
|
|
35
35
|
--color-accent: var(--accent);
|
|
36
36
|
--color-accent-foreground: var(--accent-foreground);
|
|
37
|
+
--color-success: var(--success);
|
|
37
38
|
--color-destructive: var(--destructive);
|
|
38
39
|
--color-border: var(--border);
|
|
39
40
|
--color-input: var(--input);
|
|
@@ -67,3 +68,92 @@
|
|
|
67
68
|
0px 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 6px 12px -2px rgba(0, 0, 0, 0.08),
|
|
68
69
|
0px 24px 48px -8px rgba(0, 0, 0, 0.12);
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
/* Texture utilities leave background-color untouched so components keep an
|
|
73
|
+
* opaque semantic base underneath them. */
|
|
74
|
+
|
|
75
|
+
@utility texture-checker {
|
|
76
|
+
background-image: repeating-conic-gradient(
|
|
77
|
+
color-mix(in oklch, var(--primary) 1%, var(--foreground) 1%) 0 25%,
|
|
78
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 0 50%
|
|
79
|
+
);
|
|
80
|
+
background-position: 0 0;
|
|
81
|
+
background-repeat: repeat;
|
|
82
|
+
background-size: 32px 32px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@utility texture-checker-* {
|
|
86
|
+
background-image: repeating-conic-gradient(
|
|
87
|
+
color-mix(in oklch, var(--primary) 1%, var(--foreground) 1%) 0 25%,
|
|
88
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 0 50%
|
|
89
|
+
);
|
|
90
|
+
background-position: 0 0;
|
|
91
|
+
background-repeat: repeat;
|
|
92
|
+
background-size: --value([length]) --value([length]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@utility texture-grid {
|
|
96
|
+
background-image:
|
|
97
|
+
linear-gradient(
|
|
98
|
+
to right,
|
|
99
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 1px,
|
|
100
|
+
transparent 1px
|
|
101
|
+
),
|
|
102
|
+
linear-gradient(
|
|
103
|
+
to bottom,
|
|
104
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 1px,
|
|
105
|
+
transparent 1px
|
|
106
|
+
);
|
|
107
|
+
background-position: -12px -12px;
|
|
108
|
+
background-repeat: repeat;
|
|
109
|
+
background-size: 24px 24px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@utility texture-noise {
|
|
113
|
+
background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1 1%22 width=%22160%22 height=%22160%22 color=%22black%22%3E%3Cdefs%3E%3Cfilter id=%22noise%22 x=%220%22 y=%220%22 width=%221%22 height=%221%22 filterUnits=%22userSpaceOnUse%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22128%22 numOctaves=%2210%22 result=%22turbulence%22/%3E%3CfeColorMatrix in=%22turbulence%22 type=%22luminanceToAlpha%22 result=%22alpha%22/%3E%3CfeComponentTransfer in=%22alpha%22 result=%22threshold%22%3E%3CfeFuncA type=%22linear%22 slope=%222.4%22 intercept=%22-1.12%22/%3E%3C/feComponentTransfer%3E%3CfeFlood flood-color=%22currentColor%22 flood-opacity=%220.1%22 result=%22color%22/%3E%3CfeComposite in=%22color%22 in2=%22threshold%22 operator=%22in%22/%3E%3C/filter%3E%3C/defs%3E%3Crect width=%221%22 height=%221%22 filter=%22url(%23noise)%22/%3E%3C/svg%3E');
|
|
114
|
+
background-blend-mode: hard-light;
|
|
115
|
+
background-position: 0 0;
|
|
116
|
+
background-repeat: repeat;
|
|
117
|
+
background-size: 160px 160px;
|
|
118
|
+
|
|
119
|
+
@variant dark-or-widget {
|
|
120
|
+
background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1 1%22 width=%22160%22 height=%22160%22 color=%22white%22%3E%3Cdefs%3E%3Cfilter id=%22noise%22 x=%220%22 y=%220%22 width=%221%22 height=%221%22 filterUnits=%22userSpaceOnUse%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22128%22 numOctaves=%2210%22 result=%22turbulence%22/%3E%3CfeColorMatrix in=%22turbulence%22 type=%22luminanceToAlpha%22 result=%22alpha%22/%3E%3CfeComponentTransfer in=%22alpha%22 result=%22threshold%22%3E%3CfeFuncA type=%22linear%22 slope=%223.2%22 intercept=%22-1.44%22/%3E%3C/feComponentTransfer%3E%3CfeFlood flood-color=%22currentColor%22 flood-opacity=%220.1%22 result=%22color%22/%3E%3CfeComposite in=%22color%22 in2=%22threshold%22 operator=%22in%22/%3E%3C/filter%3E%3C/defs%3E%3Crect width=%221%22 height=%221%22 filter=%22url(%23noise)%22/%3E%3C/svg%3E');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@utility texture-gradient-linear {
|
|
125
|
+
background-image: linear-gradient(
|
|
126
|
+
to bottom,
|
|
127
|
+
transparent 25%,
|
|
128
|
+
color-mix(in oklch, var(--primary) 4%, transparent) 80%,
|
|
129
|
+
color-mix(in oklch, var(--primary) 8%, transparent) 100%
|
|
130
|
+
);
|
|
131
|
+
background-position: center;
|
|
132
|
+
background-repeat: no-repeat;
|
|
133
|
+
background-size: cover;
|
|
134
|
+
|
|
135
|
+
@variant dark-or-widget {
|
|
136
|
+
background-image: linear-gradient(
|
|
137
|
+
to bottom,
|
|
138
|
+
transparent 25%,
|
|
139
|
+
color-mix(in oklch, var(--primary) 10%, transparent) 80%,
|
|
140
|
+
color-mix(in oklch, var(--primary) 20%, transparent) 100%
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@utility texture-inset-shadow {
|
|
146
|
+
box-shadow: inset 0 0 32px 24px color-mix(in oklch, var(--primary) 4%, transparent);
|
|
147
|
+
|
|
148
|
+
@variant dark-or-widget {
|
|
149
|
+
box-shadow: inset 0 0 32px 24px color-mix(in oklch, var(--primary) 10%, transparent);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@media (width < 48rem) {
|
|
153
|
+
box-shadow: inset 0 0 16px 16px color-mix(in oklch, var(--primary) 4%, transparent);
|
|
154
|
+
|
|
155
|
+
@variant dark-or-widget {
|
|
156
|
+
box-shadow: inset 0 0 16px 16px color-mix(in oklch, var(--primary) 10%, transparent);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|