@floegence/floe-webapp-core 0.50.5 → 0.51.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/dist/components/chat/input/ChatInput.js +8 -8
- package/dist/components/ui/Button.js +16 -13
- package/dist/components/ui/Card.js +125 -119
- package/dist/components/ui/Checkbox.js +178 -132
- package/dist/components/ui/CommandPalette.js +10 -10
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/DirectoryInput.js +5 -5
- package/dist/components/ui/Dropdown.d.ts +2 -0
- package/dist/components/ui/Dropdown.js +119 -114
- package/dist/components/ui/FloatingWindow.js +211 -199
- package/dist/components/ui/HighlightBlock.js +8 -8
- package/dist/components/ui/Input.js +40 -40
- package/dist/components/ui/Pagination.js +90 -88
- package/dist/components/ui/ProcessingIndicator.js +1 -1
- package/dist/components/ui/Progress.js +99 -88
- package/dist/components/ui/QuoteBlock.js +9 -9
- package/dist/components/ui/Radio.js +151 -127
- package/dist/components/ui/SegmentedControl.js +26 -25
- package/dist/components/ui/Stepper.js +114 -112
- package/dist/components/ui/Switch.js +34 -33
- package/dist/components/ui/Tabs.js +153 -150
- package/dist/components/ui/Tag.js +24 -21
- package/dist/components/ui/Tooltip.js +10 -10
- package/dist/components/ui/floatingPresence.js +40 -30
- package/dist/components/workbench/WorkbenchHud.js +9 -9
- package/dist/components/workbench/WorkbenchLockButton.js +4 -4
- package/dist/components/workbench/WorkbenchWidget.js +46 -43
- package/dist/context/FloeConfigContext.d.ts +5 -1
- package/dist/context/FloeConfigContext.js +10 -9
- package/dist/context/ThemeContext.d.ts +3 -1
- package/dist/context/ThemeContext.js +78 -71
- package/dist/floe.css +2 -37
- package/dist/full.js +839 -836
- package/dist/index.js +150 -147
- package/dist/input-focus.css +36 -0
- package/dist/styles/themes/index.d.ts +3 -0
- package/dist/styles/themes/index.js +40 -31
- package/dist/styles/tokens.d.ts +36 -0
- package/dist/styles/tokens.js +12 -5
- package/dist/styles.css +1 -1
- package/dist/surface.css +467 -0
- package/dist/themes.d.ts +1 -1
- package/dist/ui.css +9 -0
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,154 +1,157 @@
|
|
|
1
1
|
import { FloeProvider as r } from "./app/FloeProvider.js";
|
|
2
|
-
import { applyShellThemeAttribute as i,
|
|
3
|
-
import { floeColorTokenCategories as g, floeDesignTokens as
|
|
4
|
-
import { BUILT_IN_SHELL_THEME_DEFAULTS as
|
|
5
|
-
import { CommandProvider as
|
|
6
|
-
import { ComponentRegistryProvider as
|
|
7
|
-
import { DEFAULT_FLOE_CONFIG as
|
|
8
|
-
import { DeckProvider as
|
|
9
|
-
import { FLOE_GEOMETRY_SURFACE_ATTR as
|
|
10
|
-
import { FileBrowserDragProvider as
|
|
11
|
-
import { LayoutProvider as
|
|
12
|
-
import { NotificationContainer as
|
|
13
|
-
import { ThemeProvider as
|
|
14
|
-
import { ViewActivationProvider as
|
|
15
|
-
import { WidgetRegistryProvider as
|
|
16
|
-
import { WidgetStateProvider as
|
|
17
|
-
import { applyDragDelta as
|
|
18
|
-
import { checkCollision as
|
|
19
|
-
import { cn as
|
|
20
|
-
import { createSimpleContext as
|
|
21
|
-
import { createUIFirstSelection as
|
|
22
|
-
import { deferAfterPaint as
|
|
23
|
-
import { duration as
|
|
24
|
-
import { formatKeybind as
|
|
25
|
-
import { isTypingElement as
|
|
26
|
-
import { lockBodyStyle as
|
|
27
|
-
import { registerCommandContributions as
|
|
28
|
-
import { useDebounce as
|
|
29
|
-
import { useDeckDrag as
|
|
30
|
-
import { useFileBrowserDropTarget as
|
|
31
|
-
import { useKeybind as
|
|
32
|
-
import { useMediaQuery as
|
|
33
|
-
import { usePersisted as
|
|
34
|
-
import { useResizeObserver as
|
|
2
|
+
import { applyShellThemeAttribute as i, applySurfaceStyleAttribute as s, applyTheme as n, builtInThemes as a, getSystemTheme as m, isFloeSurfaceStyle as l, isThemeType as p, mergeThemeTokenMaps as f, resolveThemeTokenOverrides as d, resolveThemeTokens as T, syncThemeTokenOverrides as u } from "./styles/themes/index.js";
|
|
3
|
+
import { floeColorTokenCategories as g, floeDesignTokens as x, floeFontFamilyTokens as y, floeMotionTokens as C, floeRadiusTokens as h, floeSharedCssVariables as S, floeSpacingTokens as F, floeSurfaceTokens as v, floeThemeColorVariables as P, floeTypographyTokens as k, getFloeColorTokenValue as I } from "./styles/tokens.js";
|
|
4
|
+
import { BUILT_IN_SHELL_THEME_DEFAULTS as D, REQUIRED_SHELL_THEME_TOKENS as E, assertUniqueThemePresetNames as b, builtInShellThemePresets as L, createShellThemePreset as _, getShellThemePresetsForMode as A, normalizeShellThemeSelection as N, presetSupportsMode as O, resolveShellThemePresetName as M } from "./styles/themes/presets.js";
|
|
5
|
+
import { CommandProvider as w, createCommandService as G, useCommand as H } from "./context/CommandContext.js";
|
|
6
|
+
import { ComponentRegistryProvider as W, createComponentRegistry as K, hasComponentRegistryContext as V, useComponentContextFactory as z, useComponentRegistry as Q, useOptionalComponentRegistry as q } from "./context/ComponentRegistry.js";
|
|
7
|
+
import { DEFAULT_FLOE_CONFIG as j, FloeConfigProvider as J, useFloeConfig as X, useResolvedFloeConfig as Z } from "./context/FloeConfigContext.js";
|
|
8
|
+
import { DeckProvider as ee, createDeckService as oe, useDeck as re } from "./context/DeckContext.js";
|
|
9
|
+
import { FLOE_GEOMETRY_SURFACE_ATTR as ie, FLOE_HOT_INTERACTION_ATTR as se, startHotInteraction as ne } from "./utils/hotInteraction.js";
|
|
10
|
+
import { FileBrowserDragProvider as me, hasFileBrowserDragContext as le, useFileBrowserDrag as pe } from "./context/FileBrowserDragContext.js";
|
|
11
|
+
import { LayoutProvider as de, createLayoutService as Te, useLayout as ue } from "./context/LayoutContext.js";
|
|
12
|
+
import { NotificationContainer as ge, NotificationProvider as xe, createNotificationService as ye, useNotification as Ce } from "./context/NotificationContext.js";
|
|
13
|
+
import { ThemeProvider as Se, createThemeService as Fe, useTheme as ve } from "./context/ThemeContext.js";
|
|
14
|
+
import { ViewActivationProvider as ke, useViewActivation as Ie } from "./context/ViewActivationContext.js";
|
|
15
|
+
import { WidgetRegistryProvider as De, createWidgetRegistry as Ee, useWidgetRegistry as be } from "./context/WidgetRegistry.js";
|
|
16
|
+
import { WidgetStateProvider as _e, useCurrentWidgetId as Ae, useWidgetState as Ne, useWidgetStateContext as Oe } from "./context/WidgetStateContext.js";
|
|
17
|
+
import { applyDragDelta as Be, applyResizeDelta as we, getGridCellSize as Ge, pixelDeltaToGridDelta as He, positionToGridArea as Ue, snapToGrid as We } from "./utils/gridLayout.js";
|
|
18
|
+
import { checkCollision as Ve, constrainPosition as ze, findFreePosition as Qe, hasCollision as qe, sameGridPosition as Ye } from "./utils/gridCollision.js";
|
|
19
|
+
import { cn as Je } from "./utils/cn.js";
|
|
20
|
+
import { createSimpleContext as Ze } from "./context/createSimpleContext.js";
|
|
21
|
+
import { createUIFirstSelection as eo } from "./utils/uiFirstSelection.js";
|
|
22
|
+
import { deferAfterPaint as ro, deferNonBlocking as to } from "./utils/defer.js";
|
|
23
|
+
import { duration as so, easing as no, fadeIn as ao, listContainer as mo, listItem as lo, panelResize as po, popIn as fo, scaleIn as To, sidebarVariants as uo, slideInFromBottom as co, slideInFromLeft as go, slideInFromRight as xo, slideInFromTop as yo, springConfig as Co } from "./utils/animations.js";
|
|
24
|
+
import { formatKeybind as So, isMacLikePlatform as Fo, isPrimaryModKeyPressed as vo, matchKeybind as Po, parseKeybind as ko } from "./utils/keybind.js";
|
|
25
|
+
import { isTypingElement as Ro, shouldIgnoreHotkeys as Do } from "./utils/dom.js";
|
|
26
|
+
import { lockBodyStyle as bo } from "./utils/bodyStyleLock.js";
|
|
27
|
+
import { registerCommandContributions as _o, useCommandContributions as Ao } from "./hooks/useCommandContributions.js";
|
|
28
|
+
import { useDebounce as Oo } from "./hooks/useDebounce.js";
|
|
29
|
+
import { useDeckDrag as Bo } from "./hooks/useDeckDrag.js";
|
|
30
|
+
import { useFileBrowserDropTarget as Go, useFileBrowserItemDrag as Ho } from "./hooks/useFileBrowserDrag.js";
|
|
31
|
+
import { useKeybind as Wo } from "./hooks/useKeybind.js";
|
|
32
|
+
import { useMediaQuery as Vo } from "./hooks/useMediaQuery.js";
|
|
33
|
+
import { usePersisted as Qo } from "./hooks/usePersisted.js";
|
|
34
|
+
import { useResizeObserver as Yo } from "./hooks/useResizeObserver.js";
|
|
35
35
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
D as BUILT_IN_SHELL_THEME_DEFAULTS,
|
|
37
|
+
w as CommandProvider,
|
|
38
|
+
W as ComponentRegistryProvider,
|
|
39
|
+
j as DEFAULT_FLOE_CONFIG,
|
|
40
|
+
ee as DeckProvider,
|
|
41
|
+
ie as FLOE_GEOMETRY_SURFACE_ATTR,
|
|
42
|
+
se as FLOE_HOT_INTERACTION_ATTR,
|
|
43
|
+
me as FileBrowserDragProvider,
|
|
44
|
+
J as FloeConfigProvider,
|
|
45
45
|
r as FloeProvider,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
de as LayoutProvider,
|
|
47
|
+
ge as NotificationContainer,
|
|
48
|
+
xe as NotificationProvider,
|
|
49
|
+
E as REQUIRED_SHELL_THEME_TOKENS,
|
|
50
|
+
Se as ThemeProvider,
|
|
51
|
+
ke as ViewActivationProvider,
|
|
52
|
+
De as WidgetRegistryProvider,
|
|
53
|
+
_e as WidgetStateProvider,
|
|
54
|
+
Be as applyDragDelta,
|
|
55
|
+
we as applyResizeDelta,
|
|
56
56
|
i as applyShellThemeAttribute,
|
|
57
|
-
s as
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
57
|
+
s as applySurfaceStyleAttribute,
|
|
58
|
+
n as applyTheme,
|
|
59
|
+
b as assertUniqueThemePresetNames,
|
|
60
|
+
L as builtInShellThemePresets,
|
|
61
|
+
a as builtInThemes,
|
|
62
|
+
Ve as checkCollision,
|
|
63
|
+
Je as cn,
|
|
64
|
+
ze as constrainPosition,
|
|
65
|
+
G as createCommandService,
|
|
66
|
+
K as createComponentRegistry,
|
|
67
|
+
oe as createDeckService,
|
|
68
|
+
Te as createLayoutService,
|
|
69
|
+
ye as createNotificationService,
|
|
70
|
+
_ as createShellThemePreset,
|
|
71
|
+
Ze as createSimpleContext,
|
|
72
|
+
Fe as createThemeService,
|
|
73
|
+
eo as createUIFirstSelection,
|
|
74
|
+
Ee as createWidgetRegistry,
|
|
75
|
+
ro as deferAfterPaint,
|
|
76
|
+
to as deferNonBlocking,
|
|
77
|
+
so as duration,
|
|
78
|
+
no as easing,
|
|
79
|
+
ao as fadeIn,
|
|
80
|
+
Qe as findFreePosition,
|
|
80
81
|
g as floeColorTokenCategories,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
x as floeDesignTokens,
|
|
83
|
+
y as floeFontFamilyTokens,
|
|
84
|
+
C as floeMotionTokens,
|
|
85
|
+
h as floeRadiusTokens,
|
|
86
|
+
S as floeSharedCssVariables,
|
|
87
|
+
F as floeSpacingTokens,
|
|
88
|
+
v as floeSurfaceTokens,
|
|
89
|
+
P as floeThemeColorVariables,
|
|
90
|
+
k as floeTypographyTokens,
|
|
91
|
+
So as formatKeybind,
|
|
92
|
+
I as getFloeColorTokenValue,
|
|
93
|
+
Ge as getGridCellSize,
|
|
94
|
+
A as getShellThemePresetsForMode,
|
|
93
95
|
m as getSystemTheme,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
go as
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
ve as
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
96
|
+
qe as hasCollision,
|
|
97
|
+
V as hasComponentRegistryContext,
|
|
98
|
+
le as hasFileBrowserDragContext,
|
|
99
|
+
l as isFloeSurfaceStyle,
|
|
100
|
+
Fo as isMacLikePlatform,
|
|
101
|
+
vo as isPrimaryModKeyPressed,
|
|
102
|
+
p as isThemeType,
|
|
103
|
+
Ro as isTypingElement,
|
|
104
|
+
mo as listContainer,
|
|
105
|
+
lo as listItem,
|
|
106
|
+
bo as lockBodyStyle,
|
|
107
|
+
Po as matchKeybind,
|
|
108
|
+
f as mergeThemeTokenMaps,
|
|
109
|
+
N as normalizeShellThemeSelection,
|
|
110
|
+
po as panelResize,
|
|
111
|
+
ko as parseKeybind,
|
|
112
|
+
He as pixelDeltaToGridDelta,
|
|
113
|
+
fo as popIn,
|
|
114
|
+
Ue as positionToGridArea,
|
|
115
|
+
O as presetSupportsMode,
|
|
116
|
+
_o as registerCommandContributions,
|
|
117
|
+
M as resolveShellThemePresetName,
|
|
118
|
+
d as resolveThemeTokenOverrides,
|
|
119
|
+
T as resolveThemeTokens,
|
|
120
|
+
Ye as sameGridPosition,
|
|
121
|
+
To as scaleIn,
|
|
122
|
+
Do as shouldIgnoreHotkeys,
|
|
123
|
+
uo as sidebarVariants,
|
|
124
|
+
co as slideInFromBottom,
|
|
125
|
+
go as slideInFromLeft,
|
|
126
|
+
xo as slideInFromRight,
|
|
127
|
+
yo as slideInFromTop,
|
|
128
|
+
We as snapToGrid,
|
|
129
|
+
Co as springConfig,
|
|
130
|
+
ne as startHotInteraction,
|
|
131
|
+
u as syncThemeTokenOverrides,
|
|
132
|
+
H as useCommand,
|
|
133
|
+
Ao as useCommandContributions,
|
|
134
|
+
z as useComponentContextFactory,
|
|
135
|
+
Q as useComponentRegistry,
|
|
136
|
+
Ae as useCurrentWidgetId,
|
|
137
|
+
Oo as useDebounce,
|
|
138
|
+
re as useDeck,
|
|
139
|
+
Bo as useDeckDrag,
|
|
140
|
+
pe as useFileBrowserDrag,
|
|
141
|
+
Go as useFileBrowserDropTarget,
|
|
142
|
+
Ho as useFileBrowserItemDrag,
|
|
143
|
+
X as useFloeConfig,
|
|
144
|
+
Wo as useKeybind,
|
|
145
|
+
ue as useLayout,
|
|
146
|
+
Vo as useMediaQuery,
|
|
147
|
+
Ce as useNotification,
|
|
148
|
+
q as useOptionalComponentRegistry,
|
|
149
|
+
Qo as usePersisted,
|
|
150
|
+
Yo as useResizeObserver,
|
|
151
|
+
Z as useResolvedFloeConfig,
|
|
152
|
+
ve as useTheme,
|
|
153
|
+
Ie as useViewActivation,
|
|
154
|
+
be as useWidgetRegistry,
|
|
155
|
+
Ne as useWidgetState,
|
|
156
|
+
Oe as useWidgetStateContext
|
|
154
157
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* A field has one visible border. Compound controls mark the element that owns it.
|
|
2
|
+
* Keep the contract unlayered so host base borders cannot silently hide focus.
|
|
3
|
+
* It changes color only and never replaces an existing decorative shadow.
|
|
4
|
+
*/
|
|
5
|
+
:is(
|
|
6
|
+
input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='image']),
|
|
7
|
+
textarea, select, [data-floe-input-surface]
|
|
8
|
+
) {
|
|
9
|
+
outline: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:is(
|
|
13
|
+
input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='image']),
|
|
14
|
+
textarea, select, [data-floe-input-surface]
|
|
15
|
+
):focus:not(:disabled):not([aria-disabled='true']):not([data-floe-input-surface] :is(input, textarea, select)),
|
|
16
|
+
[data-floe-input-surface]:focus-within:not(:disabled):not([aria-disabled='true']) {
|
|
17
|
+
border-color: var(--floe-input-focus-color, var(--ring));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:is(input, textarea, select, [data-floe-input-surface])[aria-invalid='true'] {
|
|
21
|
+
--floe-input-focus-color: var(--error);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Internal buttons use a local fill to identify keyboard focus without a second frame. */
|
|
25
|
+
[data-floe-input-surface] button:focus-visible {
|
|
26
|
+
outline: none;
|
|
27
|
+
background-color: var(--accent);
|
|
28
|
+
color: var(--accent-foreground);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (forced-colors: active) {
|
|
32
|
+
:is(input, textarea, select, [data-floe-input-surface]),
|
|
33
|
+
:is(input, textarea, select, [data-floe-input-surface])[aria-invalid='true'] {
|
|
34
|
+
--floe-input-focus-color: Highlight;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export type ThemeType = 'light' | 'dark' | 'system';
|
|
2
|
+
export type FloeSurfaceStyle = 'standard' | 'soft-neumorphic';
|
|
3
|
+
export declare function isFloeSurfaceStyle(value: unknown): value is FloeSurfaceStyle;
|
|
4
|
+
export declare function applySurfaceStyleAttribute(style: FloeSurfaceStyle | undefined, target?: ThemeTarget): void;
|
|
2
5
|
export type FloeThemePresetMode = 'light' | 'dark' | 'both';
|
|
3
6
|
export type FloeThemeTokenMap = Partial<Record<`--${string}`, string>>;
|
|
4
7
|
export interface FloeMonacoTokenRule {
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
function m(e) {
|
|
2
|
+
return e === "standard" || e === "soft-neumorphic";
|
|
3
|
+
}
|
|
4
|
+
function d(e, r) {
|
|
5
|
+
const t = i(r);
|
|
6
|
+
e ? t?.setAttribute?.("data-floe-surface-style", e) : t?.removeAttribute?.("data-floe-surface-style");
|
|
7
|
+
}
|
|
8
|
+
const h = [
|
|
2
9
|
{ name: "light", displayName: "Light", type: "light" },
|
|
3
10
|
{ name: "dark", displayName: "Dark", type: "dark" }
|
|
4
11
|
];
|
|
5
|
-
function
|
|
12
|
+
function y(e) {
|
|
6
13
|
return e === "light" || e === "dark" || e === "system";
|
|
7
14
|
}
|
|
8
|
-
function
|
|
15
|
+
function u() {
|
|
9
16
|
return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
10
17
|
}
|
|
11
18
|
function i(e) {
|
|
@@ -13,51 +20,53 @@ function i(e) {
|
|
|
13
20
|
if (!(typeof document > "u"))
|
|
14
21
|
return document.documentElement;
|
|
15
22
|
}
|
|
16
|
-
function c(e,
|
|
23
|
+
function c(e, r) {
|
|
17
24
|
return {
|
|
18
25
|
...e?.shared ?? {},
|
|
19
|
-
...
|
|
26
|
+
...r === "light" ? e?.light ?? {} : e?.dark ?? {}
|
|
20
27
|
};
|
|
21
28
|
}
|
|
22
|
-
function
|
|
29
|
+
function f(...e) {
|
|
23
30
|
return Object.assign({}, ...e.filter(Boolean));
|
|
24
31
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
27
|
-
...
|
|
32
|
+
function p(e, ...r) {
|
|
33
|
+
return f(
|
|
34
|
+
...r.map((t) => c(t, e))
|
|
28
35
|
);
|
|
29
36
|
}
|
|
30
|
-
function
|
|
31
|
-
const t = i(
|
|
37
|
+
function T(e, r) {
|
|
38
|
+
const t = i(r);
|
|
32
39
|
if (!t) return;
|
|
33
|
-
const o = e === "system" ?
|
|
40
|
+
const o = e === "system" ? u() : e;
|
|
34
41
|
t.classList.remove("light", "dark"), t.classList.add(o), t.style.colorScheme = o;
|
|
35
42
|
}
|
|
36
|
-
function
|
|
37
|
-
const t = i(
|
|
43
|
+
function g(e, r) {
|
|
44
|
+
const t = i(r);
|
|
38
45
|
t && (e ? t.setAttribute?.("data-floe-shell-theme", e) : t.removeAttribute?.("data-floe-shell-theme"));
|
|
39
46
|
}
|
|
40
|
-
function
|
|
47
|
+
function k(e, r = [], t) {
|
|
41
48
|
const o = i(t);
|
|
42
49
|
if (!o) return [];
|
|
43
|
-
const
|
|
44
|
-
const [, s] =
|
|
50
|
+
const a = Object.entries(e ?? {}).filter((n) => {
|
|
51
|
+
const [, s] = n;
|
|
45
52
|
return typeof s == "string" && s.length > 0;
|
|
46
|
-
}),
|
|
47
|
-
for (const
|
|
48
|
-
|
|
49
|
-
for (const [
|
|
50
|
-
o.style.setProperty(
|
|
51
|
-
return [...
|
|
53
|
+
}), l = new Set(a.map(([n]) => n));
|
|
54
|
+
for (const n of r)
|
|
55
|
+
l.has(n) || o.style.removeProperty(n);
|
|
56
|
+
for (const [n, s] of a)
|
|
57
|
+
o.style.setProperty(n, s);
|
|
58
|
+
return [...l];
|
|
52
59
|
}
|
|
53
60
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
g as applyShellThemeAttribute,
|
|
62
|
+
d as applySurfaceStyleAttribute,
|
|
63
|
+
T as applyTheme,
|
|
64
|
+
h as builtInThemes,
|
|
65
|
+
u as getSystemTheme,
|
|
66
|
+
m as isFloeSurfaceStyle,
|
|
67
|
+
y as isThemeType,
|
|
68
|
+
f as mergeThemeTokenMaps,
|
|
60
69
|
c as resolveThemeTokenOverrides,
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
p as resolveThemeTokens,
|
|
71
|
+
k as syncThemeTokenOverrides
|
|
63
72
|
};
|
package/dist/styles/tokens.d.ts
CHANGED
|
@@ -637,6 +637,25 @@ export declare const floeThemeColorVariables: {
|
|
|
637
637
|
readonly dark: Record<`--${string}`, string>;
|
|
638
638
|
};
|
|
639
639
|
export declare function getFloeColorTokenValue(variable: FloeCssVariableName, theme: FloeResolvedTheme): string | undefined;
|
|
640
|
+
/** Optional shadow overrides. Defaults resolve at each role so local palettes
|
|
641
|
+
* participate without masking overrides supplied by the theme service. */
|
|
642
|
+
export declare const floeSurfaceTokens: readonly [{
|
|
643
|
+
readonly variable: "--floe-surface-shadow-raised";
|
|
644
|
+
readonly role: "raised";
|
|
645
|
+
readonly fallback: "0 2px 5px -2px var(--floe-surface-shade), inset 0 1px 1px var(--floe-surface-highlight)";
|
|
646
|
+
}, {
|
|
647
|
+
readonly variable: "--floe-surface-shadow-inset";
|
|
648
|
+
readonly role: "inset";
|
|
649
|
+
readonly fallback: "inset 0 1px 2px var(--floe-surface-shade), inset 0 -1px 1px var(--floe-surface-highlight)";
|
|
650
|
+
}, {
|
|
651
|
+
readonly variable: "--floe-surface-shadow-floating";
|
|
652
|
+
readonly role: "floating";
|
|
653
|
+
readonly fallback: "0 8px 20px -6px var(--floe-surface-shade), inset 0 1px 1px var(--floe-surface-highlight)";
|
|
654
|
+
}, {
|
|
655
|
+
readonly variable: "--floe-surface-shadow-interacting";
|
|
656
|
+
readonly role: "interacting";
|
|
657
|
+
readonly fallback: "0 1px 2px var(--floe-surface-shade)";
|
|
658
|
+
}];
|
|
640
659
|
export declare const floeDesignTokens: {
|
|
641
660
|
readonly colors: readonly [{
|
|
642
661
|
readonly name: "Base Colors";
|
|
@@ -1227,4 +1246,21 @@ export declare const floeDesignTokens: {
|
|
|
1227
1246
|
readonly '--font-sans': "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
|
|
1228
1247
|
readonly '--font-mono': "'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Monaco, Consolas, monospace";
|
|
1229
1248
|
};
|
|
1249
|
+
readonly surface: readonly [{
|
|
1250
|
+
readonly variable: "--floe-surface-shadow-raised";
|
|
1251
|
+
readonly role: "raised";
|
|
1252
|
+
readonly fallback: "0 2px 5px -2px var(--floe-surface-shade), inset 0 1px 1px var(--floe-surface-highlight)";
|
|
1253
|
+
}, {
|
|
1254
|
+
readonly variable: "--floe-surface-shadow-inset";
|
|
1255
|
+
readonly role: "inset";
|
|
1256
|
+
readonly fallback: "inset 0 1px 2px var(--floe-surface-shade), inset 0 -1px 1px var(--floe-surface-highlight)";
|
|
1257
|
+
}, {
|
|
1258
|
+
readonly variable: "--floe-surface-shadow-floating";
|
|
1259
|
+
readonly role: "floating";
|
|
1260
|
+
readonly fallback: "0 8px 20px -6px var(--floe-surface-shade), inset 0 1px 1px var(--floe-surface-highlight)";
|
|
1261
|
+
}, {
|
|
1262
|
+
readonly variable: "--floe-surface-shadow-interacting";
|
|
1263
|
+
readonly role: "interacting";
|
|
1264
|
+
readonly fallback: "0 1px 2px var(--floe-surface-shade)";
|
|
1265
|
+
}];
|
|
1230
1266
|
};
|
package/dist/styles/tokens.js
CHANGED
|
@@ -628,27 +628,34 @@ const u = {
|
|
|
628
628
|
light: o("light"),
|
|
629
629
|
dark: o("dark")
|
|
630
630
|
};
|
|
631
|
-
function
|
|
631
|
+
function g(a, e) {
|
|
632
632
|
return u[e][a];
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const h = [
|
|
635
|
+
{ variable: "--floe-surface-shadow-raised", role: "raised", fallback: "0 2px 5px -2px var(--floe-surface-shade), inset 0 1px 1px var(--floe-surface-highlight)" },
|
|
636
|
+
{ variable: "--floe-surface-shadow-inset", role: "inset", fallback: "inset 0 1px 2px var(--floe-surface-shade), inset 0 -1px 1px var(--floe-surface-highlight)" },
|
|
637
|
+
{ variable: "--floe-surface-shadow-floating", role: "floating", fallback: "0 8px 20px -6px var(--floe-surface-shade), inset 0 1px 1px var(--floe-surface-highlight)" },
|
|
638
|
+
{ variable: "--floe-surface-shadow-interacting", role: "interacting", fallback: "0 1px 2px var(--floe-surface-shade)" }
|
|
639
|
+
], m = {
|
|
635
640
|
colors: l,
|
|
636
641
|
typography: i,
|
|
637
642
|
fonts: n,
|
|
638
643
|
spacing: s,
|
|
639
644
|
radius: t,
|
|
640
645
|
motion: c,
|
|
641
|
-
shared: r
|
|
646
|
+
shared: r,
|
|
647
|
+
surface: h
|
|
642
648
|
};
|
|
643
649
|
export {
|
|
644
650
|
l as floeColorTokenCategories,
|
|
645
|
-
|
|
651
|
+
m as floeDesignTokens,
|
|
646
652
|
n as floeFontFamilyTokens,
|
|
647
653
|
c as floeMotionTokens,
|
|
648
654
|
t as floeRadiusTokens,
|
|
649
655
|
r as floeSharedCssVariables,
|
|
650
656
|
s as floeSpacingTokens,
|
|
657
|
+
h as floeSurfaceTokens,
|
|
651
658
|
u as floeThemeColorVariables,
|
|
652
659
|
i as floeTypographyTokens,
|
|
653
|
-
|
|
660
|
+
g as getFloeColorTokenValue
|
|
654
661
|
};
|