@adecore/ui 0.38.0 → 0.39.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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/tint.d.ts +2 -0
- package/dist/tint.js +13 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/tint.ts +15 -0
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export { UI_NAMESPACE, UI_RESOURCES } from './locales.ts';
|
|
|
82
82
|
export { matchScore } from './match.ts';
|
|
83
83
|
export { isApplePlatform } from './platform.ts';
|
|
84
84
|
export { prefetcher, type Loader, type WhenIdle } from './prefetch.ts';
|
|
85
|
+
export { tintStyle } from './tint.ts';
|
|
85
86
|
export { selectAllWithin, selectionWithin } from './selection.ts';
|
|
86
87
|
export { EDIT_SHORTCUTS, KEY_SHORTCUTS, formatShortcut, isModHeld, matchesShortcut, shortcut, shortcutParts, type KeyLike, type Shortcut } from './shortcut.ts';
|
|
87
88
|
export { UNDO_MS, createToastStore, type Toast, type ToastAction, type ToastDeadline, type ToastInput, type ToastKind, type ToastPatch, type ToastStore, type ToastStoreHook } from './toast-store.ts';
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,7 @@ export { UI_NAMESPACE, UI_RESOURCES } from './locales.js';
|
|
|
76
76
|
export { matchScore } from './match.js';
|
|
77
77
|
export { isApplePlatform } from './platform.js';
|
|
78
78
|
export { prefetcher } from './prefetch.js';
|
|
79
|
+
export { tintStyle } from './tint.js';
|
|
79
80
|
export { selectAllWithin, selectionWithin } from './selection.js';
|
|
80
81
|
export { EDIT_SHORTCUTS, KEY_SHORTCUTS, formatShortcut, isModHeld, matchesShortcut, shortcut, shortcutParts } from './shortcut.js';
|
|
81
82
|
export { UNDO_MS, createToastStore } from './toast-store.js';
|
package/dist/tint.d.ts
ADDED
package/dist/tint.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The custom properties that let what stands on a colored ground follow its color: the hover of a
|
|
3
|
+
* button and a separator. The theme's utilities read `--surface-hover` and `--border` themselves
|
|
4
|
+
* (`@theme inline`), so a host sets this on the colored element and its buttons and separators
|
|
5
|
+
* take it. `--border` is mixed from `--border-strong`, since a property that reads itself is no
|
|
6
|
+
* value at all.
|
|
7
|
+
*/
|
|
8
|
+
export function tintStyle(color, ground = 'var(--surface-raised)') {
|
|
9
|
+
return {
|
|
10
|
+
'--surface-hover': `color-mix(in srgb, ${color} 34%, ${ground})`,
|
|
11
|
+
'--border': `color-mix(in srgb, ${color} 35%, var(--border-strong))`
|
|
12
|
+
};
|
|
13
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -98,6 +98,7 @@ export { UI_NAMESPACE, UI_RESOURCES } from './locales.ts';
|
|
|
98
98
|
export { matchScore } from './match.ts';
|
|
99
99
|
export { isApplePlatform } from './platform.ts';
|
|
100
100
|
export { prefetcher, type Loader, type WhenIdle } from './prefetch.ts';
|
|
101
|
+
export { tintStyle } from './tint.ts';
|
|
101
102
|
export { selectAllWithin, selectionWithin } from './selection.ts';
|
|
102
103
|
export { EDIT_SHORTCUTS, KEY_SHORTCUTS, formatShortcut, isModHeld, matchesShortcut, shortcut, shortcutParts, type KeyLike, type Shortcut } from './shortcut.ts';
|
|
103
104
|
export {
|
package/src/tint.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* The custom properties that let what stands on a colored ground follow its color: the hover of a
|
|
5
|
+
* button and a separator. The theme's utilities read `--surface-hover` and `--border` themselves
|
|
6
|
+
* (`@theme inline`), so a host sets this on the colored element and its buttons and separators
|
|
7
|
+
* take it. `--border` is mixed from `--border-strong`, since a property that reads itself is no
|
|
8
|
+
* value at all.
|
|
9
|
+
*/
|
|
10
|
+
export function tintStyle(color: string, ground = 'var(--surface-raised)'): CSSProperties {
|
|
11
|
+
return {
|
|
12
|
+
'--surface-hover': `color-mix(in srgb, ${color} 34%, ${ground})`,
|
|
13
|
+
'--border': `color-mix(in srgb, ${color} 35%, var(--border-strong))`
|
|
14
|
+
} as CSSProperties;
|
|
15
|
+
}
|