@ohos-ports/dxos-react-ui-theme 0.6.7-beta.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 +8 -0
- package/README.md +25 -0
- package/README.yml +1 -0
- package/dist/lib/browser/index.mjs +2300 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/plugin/node/chunk-G3RQ5GOB.cjs +712 -0
- package/dist/plugin/node/chunk-G3RQ5GOB.cjs.map +7 -0
- package/dist/plugin/node/esbuild-plugin.cjs +89 -0
- package/dist/plugin/node/esbuild-plugin.cjs.map +7 -0
- package/dist/plugin/node/meta.json +1 -0
- package/dist/plugin/node/plugin.cjs +77 -0
- package/dist/plugin/node/plugin.cjs.map +7 -0
- package/dist/plugin/node/theme.css +418 -0
- package/dist/plugin/node/theme.css.map +7 -0
- package/dist/types/src/config/colors.d.ts +109 -0
- package/dist/types/src/config/colors.d.ts.map +1 -0
- package/dist/types/src/config/index.d.ts +3 -0
- package/dist/types/src/config/index.d.ts.map +1 -0
- package/dist/types/src/config/resolveContent.d.ts +2 -0
- package/dist/types/src/config/resolveContent.d.ts.map +1 -0
- package/dist/types/src/config/tailwind.d.ts +9 -0
- package/dist/types/src/config/tailwind.d.ts.map +1 -0
- package/dist/types/src/esbuild-plugin.d.ts +9 -0
- package/dist/types/src/esbuild-plugin.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +13 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/styles/components/anchored-overflow.d.ts +6 -0
- package/dist/types/src/styles/components/anchored-overflow.d.ts.map +1 -0
- package/dist/types/src/styles/components/avatar.d.ts +21 -0
- package/dist/types/src/styles/components/avatar.d.ts.map +1 -0
- package/dist/types/src/styles/components/breadcrumb.d.ts +9 -0
- package/dist/types/src/styles/components/breadcrumb.d.ts.map +1 -0
- package/dist/types/src/styles/components/button.d.ts +19 -0
- package/dist/types/src/styles/components/button.d.ts.map +1 -0
- package/dist/types/src/styles/components/dialog.d.ts +12 -0
- package/dist/types/src/styles/components/dialog.d.ts.map +1 -0
- package/dist/types/src/styles/components/index.d.ts +22 -0
- package/dist/types/src/styles/components/index.d.ts.map +1 -0
- package/dist/types/src/styles/components/input.d.ts +103 -0
- package/dist/types/src/styles/components/input.d.ts.map +1 -0
- package/dist/types/src/styles/components/link.d.ts +7 -0
- package/dist/types/src/styles/components/link.d.ts.map +1 -0
- package/dist/types/src/styles/components/list.d.ts +14 -0
- package/dist/types/src/styles/components/list.d.ts.map +1 -0
- package/dist/types/src/styles/components/main.d.ts +25 -0
- package/dist/types/src/styles/components/main.d.ts.map +1 -0
- package/dist/types/src/styles/components/menu.d.ts +12 -0
- package/dist/types/src/styles/components/menu.d.ts.map +1 -0
- package/dist/types/src/styles/components/message.d.ts +10 -0
- package/dist/types/src/styles/components/message.d.ts.map +1 -0
- package/dist/types/src/styles/components/popover.d.ts +10 -0
- package/dist/types/src/styles/components/popover.d.ts.map +1 -0
- package/dist/types/src/styles/components/scroll-area.d.ts +9 -0
- package/dist/types/src/styles/components/scroll-area.d.ts.map +1 -0
- package/dist/types/src/styles/components/select.d.ts +13 -0
- package/dist/types/src/styles/components/select.d.ts.map +1 -0
- package/dist/types/src/styles/components/separator.d.ts +7 -0
- package/dist/types/src/styles/components/separator.d.ts.map +1 -0
- package/dist/types/src/styles/components/status.d.ts +8 -0
- package/dist/types/src/styles/components/status.d.ts.map +1 -0
- package/dist/types/src/styles/components/tag.d.ts +7 -0
- package/dist/types/src/styles/components/tag.d.ts.map +1 -0
- package/dist/types/src/styles/components/toast.d.ts +12 -0
- package/dist/types/src/styles/components/toast.d.ts.map +1 -0
- package/dist/types/src/styles/components/toolbar.d.ts +5 -0
- package/dist/types/src/styles/components/toolbar.d.ts.map +1 -0
- package/dist/types/src/styles/components/tooltip.d.ts +6 -0
- package/dist/types/src/styles/components/tooltip.d.ts.map +1 -0
- package/dist/types/src/styles/components/treegrid.d.ts +10 -0
- package/dist/types/src/styles/components/treegrid.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/arrow.d.ts +6 -0
- package/dist/types/src/styles/fragments/arrow.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/density.d.ts +13 -0
- package/dist/types/src/styles/fragments/density.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/dimensions.d.ts +2 -0
- package/dist/types/src/styles/fragments/dimensions.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/disabled.d.ts +3 -0
- package/dist/types/src/styles/fragments/disabled.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/elevation.d.ts +11 -0
- package/dist/types/src/styles/fragments/elevation.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/focus.d.ts +6 -0
- package/dist/types/src/styles/fragments/focus.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/group.d.ts +5 -0
- package/dist/types/src/styles/fragments/group.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/hover.d.ts +14 -0
- package/dist/types/src/styles/fragments/hover.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/hue.d.ts +16 -0
- package/dist/types/src/styles/fragments/hue.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/index.d.ts +19 -0
- package/dist/types/src/styles/fragments/index.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/layout.d.ts +3 -0
- package/dist/types/src/styles/fragments/layout.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/motion.d.ts +3 -0
- package/dist/types/src/styles/fragments/motion.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/ornament.d.ts +4 -0
- package/dist/types/src/styles/fragments/ornament.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/selected.d.ts +12 -0
- package/dist/types/src/styles/fragments/selected.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/shimmer.d.ts +3 -0
- package/dist/types/src/styles/fragments/shimmer.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/size.d.ts +9 -0
- package/dist/types/src/styles/fragments/size.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/surface.d.ts +9 -0
- package/dist/types/src/styles/fragments/surface.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/text.d.ts +6 -0
- package/dist/types/src/styles/fragments/text.d.ts.map +1 -0
- package/dist/types/src/styles/fragments/valence.d.ts +13 -0
- package/dist/types/src/styles/fragments/valence.d.ts.map +1 -0
- package/dist/types/src/styles/index.d.ts +4 -0
- package/dist/types/src/styles/index.d.ts.map +1 -0
- package/dist/types/src/styles/theme.d.ts +5 -0
- package/dist/types/src/styles/theme.d.ts.map +1 -0
- package/dist/types/src/tailwind.d.ts +1 -0
- package/dist/types/src/tailwind.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/mx.d.ts +2 -0
- package/dist/types/src/util/mx.d.ts.map +1 -0
- package/dist/types/src/util/semanticColors.d.ts +10 -0
- package/dist/types/src/util/semanticColors.d.ts.map +1 -0
- package/dist/types/src/util/withLogical.d.ts +158 -0
- package/dist/types/src/util/withLogical.d.ts.map +1 -0
- package/package.json +45 -0
- package/plugin.d.ts +7 -0
- package/plugin.js +10 -0
- package/src/config/colors.ts +293 -0
- package/src/config/index.ts +6 -0
- package/src/config/resolveContent.ts +50 -0
- package/src/config/tailwind.ts +200 -0
- package/src/esbuild-plugin.ts +60 -0
- package/src/index.ts +7 -0
- package/src/plugin.ts +63 -0
- package/src/styles/components/anchored-overflow.ts +20 -0
- package/src/styles/components/avatar.ts +96 -0
- package/src/styles/components/breadcrumb.ts +29 -0
- package/src/styles/components/button.ts +47 -0
- package/src/styles/components/dialog.ts +46 -0
- package/src/styles/components/index.ts +25 -0
- package/src/styles/components/input.ts +172 -0
- package/src/styles/components/link.ts +27 -0
- package/src/styles/components/list.ts +46 -0
- package/src/styles/components/main.ts +81 -0
- package/src/styles/components/menu.ts +52 -0
- package/src/styles/components/message.ts +27 -0
- package/src/styles/components/popover.ts +32 -0
- package/src/styles/components/scroll-area.ts +42 -0
- package/src/styles/components/select.ts +55 -0
- package/src/styles/components/separator.ts +19 -0
- package/src/styles/components/status.ts +27 -0
- package/src/styles/components/tag.ts +49 -0
- package/src/styles/components/toast.ts +53 -0
- package/src/styles/components/toolbar.ts +17 -0
- package/src/styles/components/tooltip.ts +27 -0
- package/src/styles/components/treegrid.ts +37 -0
- package/src/styles/fragments/arrow.ts +10 -0
- package/src/styles/fragments/density.ts +17 -0
- package/src/styles/fragments/dimensions.ts +5 -0
- package/src/styles/fragments/disabled.ts +6 -0
- package/src/styles/fragments/elevation.ts +14 -0
- package/src/styles/fragments/focus.ts +18 -0
- package/src/styles/fragments/group.ts +12 -0
- package/src/styles/fragments/hover.ts +22 -0
- package/src/styles/fragments/hue.ts +151 -0
- package/src/styles/fragments/index.ts +22 -0
- package/src/styles/fragments/layout.ts +7 -0
- package/src/styles/fragments/motion.ts +8 -0
- package/src/styles/fragments/ornament.ts +7 -0
- package/src/styles/fragments/selected.ts +39 -0
- package/src/styles/fragments/shimmer.ts +9 -0
- package/src/styles/fragments/size.ts +117 -0
- package/src/styles/fragments/surface.ts +29 -0
- package/src/styles/fragments/text.ts +11 -0
- package/src/styles/fragments/valence.ts +50 -0
- package/src/styles/index.ts +7 -0
- package/src/styles/layers/anchored-overflow.css +9 -0
- package/src/styles/layers/attention.css +50 -0
- package/src/styles/layers/button.css +73 -0
- package/src/styles/layers/can-scroll.css +26 -0
- package/src/styles/layers/checkbox.css +25 -0
- package/src/styles/layers/focus-ring.css +26 -0
- package/src/styles/layers/index.css +10 -0
- package/src/styles/layers/positioning.css +20 -0
- package/src/styles/layers/surfaces.css +39 -0
- package/src/styles/layers/tldraw.css +87 -0
- package/src/styles/layers/typography.css +152 -0
- package/src/styles/theme.ts +69 -0
- package/src/tailwind.ts +5 -0
- package/src/theme.css +52 -0
- package/src/typings.d.ts +7 -0
- package/src/util/index.ts +5 -0
- package/src/util/mx.ts +40 -0
- package/src/util/semanticColors.ts +57 -0
- package/src/util/withLogical.ts +110 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const popperMotion =
|
|
6
|
+
'will-change-[opacity,transform] data-[side=top]:animate-slideDownAndFade data-[side=right]:animate-slideLeftAndFade data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade';
|
|
7
|
+
|
|
8
|
+
export const dialogMotion = 'will-change-[opacity,transform] animate-slideUpAndFade';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFragment } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { ghostHover } from './hover';
|
|
8
|
+
|
|
9
|
+
export const ghostSelectedCurrent =
|
|
10
|
+
ghostHover +
|
|
11
|
+
' aria-[current]:surface-input hover:aria-[current]:surface-hover' +
|
|
12
|
+
' aria-selected:bg-primary-100 dark:aria-selected:bg-primary-850 hover:aria-selected:bg-primary-150 hover:dark:aria-selected:bg-primary-800' +
|
|
13
|
+
' aria-[current]:aria-selected:bg-primary-200 dark:aria-[current]:aria-selected:bg-primary-750 hover:aria-[current]:aria-selected:bg-primary-200 hover:dark:aria-[current]:aria-selected:bg-primary-750';
|
|
14
|
+
|
|
15
|
+
export const ghostHighlighted =
|
|
16
|
+
'data-[highlighted]:bg-primary-100 dark:data-[highlighted]:bg-primary-850 hover:data-[highlighted]:bg-primary-150 hover:dark:data-[highlighted]:bg-primary-800';
|
|
17
|
+
|
|
18
|
+
export const ghostSelectedTrackingInterFromNormal = 'tracking-[0.0092em]';
|
|
19
|
+
|
|
20
|
+
export const ghostSelected =
|
|
21
|
+
'aria-selected:surface-base aria-selected:fg-accent aria-selected:font-semibold aria-selected:tracking-normal transition-[color,font-variation-settings,letter-spacing]';
|
|
22
|
+
|
|
23
|
+
export type SelectedStyleProps = {
|
|
24
|
+
current?: boolean;
|
|
25
|
+
selected?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const staticGhostSelectedCurrent: ComponentFragment<SelectedStyleProps> = ({ current, selected }) => [
|
|
29
|
+
current && selected
|
|
30
|
+
? 'bg-primary-200 dark:bg-primary-750 hover:bg-primary-200 hover:dark:bg-primary-750'
|
|
31
|
+
: current
|
|
32
|
+
? 'surface-input hover:surface-hover'
|
|
33
|
+
: selected
|
|
34
|
+
? 'bg-primary-100 dark:bg-primary-850 hover:bg-primary-150 hover:dark:bg-primary-800'
|
|
35
|
+
: ghostHover,
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export const staticGhostSelected: ComponentFragment<Pick<SelectedStyleProps, 'selected'>> = ({ selected }) =>
|
|
39
|
+
selected ? ['bg-primary-200 dark:bg-primary-750'] : [];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const shimmer =
|
|
6
|
+
'relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-neutral-100/10 before:to-transparent isolate overflow-hidden';
|
|
7
|
+
|
|
8
|
+
export const strongShimmer =
|
|
9
|
+
'relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-primary-100/80 before:to-transparent isolate overflow-hidden';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Size } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export const sizeWidthMap = new Map<Size, string>([
|
|
10
|
+
[0, 'is-0'],
|
|
11
|
+
['px', 'is-px'],
|
|
12
|
+
[0.5, 'is-0.5'],
|
|
13
|
+
[1, 'is-1'],
|
|
14
|
+
[1.5, 'is-1.5'],
|
|
15
|
+
[2, 'is-2'],
|
|
16
|
+
[2.5, 'is-2.5'],
|
|
17
|
+
[3, 'is-3'],
|
|
18
|
+
[3.5, 'is-3.5'],
|
|
19
|
+
[4, 'is-4'],
|
|
20
|
+
[5, 'is-5'],
|
|
21
|
+
[6, 'is-6'],
|
|
22
|
+
[7, 'is-7'],
|
|
23
|
+
[8, 'is-8'],
|
|
24
|
+
[9, 'is-9'],
|
|
25
|
+
[10, 'is-10'],
|
|
26
|
+
[11, 'is-11'],
|
|
27
|
+
[12, 'is-12'],
|
|
28
|
+
[14, 'is-14'],
|
|
29
|
+
[16, 'is-16'],
|
|
30
|
+
[20, 'is-20'],
|
|
31
|
+
[24, 'is-24'],
|
|
32
|
+
[28, 'is-28'],
|
|
33
|
+
[32, 'is-32'],
|
|
34
|
+
[36, 'is-36'],
|
|
35
|
+
[40, 'is-40'],
|
|
36
|
+
[44, 'is-44'],
|
|
37
|
+
[48, 'is-48'],
|
|
38
|
+
[52, 'is-52'],
|
|
39
|
+
[56, 'is-56'],
|
|
40
|
+
[60, 'is-60'],
|
|
41
|
+
[64, 'is-64'],
|
|
42
|
+
[72, 'is-72'],
|
|
43
|
+
[80, 'is-80'],
|
|
44
|
+
[96, 'is-96'],
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
export const sizeHeightMap = new Map<Size, string>([
|
|
48
|
+
[0, 'bs-0'],
|
|
49
|
+
['px', 'bs-px'],
|
|
50
|
+
[0.5, 'bs-0.5'],
|
|
51
|
+
[1, 'bs-1'],
|
|
52
|
+
[1.5, 'bs-1.5'],
|
|
53
|
+
[2, 'bs-2'],
|
|
54
|
+
[2.5, 'bs-2.5'],
|
|
55
|
+
[3, 'bs-3'],
|
|
56
|
+
[3.5, 'bs-3.5'],
|
|
57
|
+
[4, 'bs-4'],
|
|
58
|
+
[5, 'bs-5'],
|
|
59
|
+
[6, 'bs-6'],
|
|
60
|
+
[7, 'bs-7'],
|
|
61
|
+
[8, 'bs-8'],
|
|
62
|
+
[9, 'bs-9'],
|
|
63
|
+
[10, 'bs-10'],
|
|
64
|
+
[11, 'bs-11'],
|
|
65
|
+
[12, 'bs-12'],
|
|
66
|
+
[14, 'bs-14'],
|
|
67
|
+
[16, 'bs-16'],
|
|
68
|
+
[20, 'bs-20'],
|
|
69
|
+
[24, 'bs-24'],
|
|
70
|
+
[28, 'bs-28'],
|
|
71
|
+
[32, 'bs-32'],
|
|
72
|
+
[36, 'bs-36'],
|
|
73
|
+
[40, 'bs-40'],
|
|
74
|
+
[44, 'bs-44'],
|
|
75
|
+
[48, 'bs-48'],
|
|
76
|
+
[52, 'bs-52'],
|
|
77
|
+
[56, 'bs-56'],
|
|
78
|
+
[60, 'bs-60'],
|
|
79
|
+
[64, 'bs-64'],
|
|
80
|
+
[72, 'bs-72'],
|
|
81
|
+
[80, 'bs-80'],
|
|
82
|
+
[96, 'bs-96'],
|
|
83
|
+
]);
|
|
84
|
+
|
|
85
|
+
const sizes = new Set(sizeWidthMap.keys());
|
|
86
|
+
|
|
87
|
+
export const getSizeHeight = sizeHeightMap.get.bind(sizeHeightMap);
|
|
88
|
+
export const getSizeWidth = sizeWidthMap.get.bind(sizeWidthMap);
|
|
89
|
+
export const getSize = (size: Size) => mx(getSizeHeight(size), getSizeWidth(size));
|
|
90
|
+
|
|
91
|
+
export const computeSize = (value: number, defaultSize: Size) => {
|
|
92
|
+
if (sizes.has(value as Size)) {
|
|
93
|
+
return value as Size;
|
|
94
|
+
} else if (value <= 0) {
|
|
95
|
+
return 0;
|
|
96
|
+
} else if (value === 1) {
|
|
97
|
+
return 'px';
|
|
98
|
+
} else {
|
|
99
|
+
const wholeSeries = Math.floor(value);
|
|
100
|
+
const halfSeries = Math.floor(value * 2) / 2;
|
|
101
|
+
const doubleSeries = Math.floor(value / 2) * 2;
|
|
102
|
+
const quadrupleSeries = Math.floor(value / 4) * 4;
|
|
103
|
+
if (sizes.has(halfSeries as Size)) {
|
|
104
|
+
return halfSeries as Size;
|
|
105
|
+
} else if (sizes.has(wholeSeries as Size)) {
|
|
106
|
+
return wholeSeries as Size;
|
|
107
|
+
} else if (sizes.has(doubleSeries as Size)) {
|
|
108
|
+
return doubleSeries as Size;
|
|
109
|
+
} else if (sizes.has(quadrupleSeries as Size)) {
|
|
110
|
+
return quadrupleSeries as Size;
|
|
111
|
+
} else {
|
|
112
|
+
return defaultSize;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const sizeValue = (size: Size): number => (size === 'px' ? 1 : size);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// NOTE: Please don’t make changes to these fragments without testing *all* the places where they’re used.
|
|
6
|
+
|
|
7
|
+
// If your scope of concern is narrower than exactly *the entire design system*, please define and apply your own
|
|
8
|
+
// fragment, either to the specific component or in an override to `ThemeProvider`’s `tx` value.
|
|
9
|
+
|
|
10
|
+
// Main background.
|
|
11
|
+
// NOTE: This should align with theme's root --surface-bg.
|
|
12
|
+
export const baseSurface = 'base-surface';
|
|
13
|
+
|
|
14
|
+
// Sidebars, main heading (“topbar”), and nothing else.
|
|
15
|
+
export const fixedSurface = 'base-surface md:fixed-surface backdrop-blur-md dark:backdrop-blur-lg';
|
|
16
|
+
export const fixedBorder = 'separator-separator';
|
|
17
|
+
|
|
18
|
+
// Generic grouping style.
|
|
19
|
+
export const groupSurface = 'base-surface';
|
|
20
|
+
export const groupBorder = 'separator-separator';
|
|
21
|
+
|
|
22
|
+
// Tooltips, popovers, menus, dialogs, etc.
|
|
23
|
+
export const modalSurface = 'modal-surface';
|
|
24
|
+
|
|
25
|
+
// Elements that actively have the user’s “attention”; prefer to select with CSS-native selectors like focus-within,
|
|
26
|
+
// but may be applied by app state. ⚠️ Do not apply statically.
|
|
27
|
+
export const attentionSurface = 'attention-surface';
|
|
28
|
+
|
|
29
|
+
export const accentSurface = 'surface-accent fg-inverse';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const placeholderText = 'placeholder-neutral-300 dark:placeholder-neutral-500';
|
|
6
|
+
export const staticPlaceholderText = 'text-neutral-300 dark:text-neutral-500';
|
|
7
|
+
|
|
8
|
+
export const descriptionText = 'text-xs font-normal fg-description';
|
|
9
|
+
export const descriptionTextPrimary = 'text-xs font-normal fg-base';
|
|
10
|
+
|
|
11
|
+
export const chromeText = 'text-xs font-normal';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type MessageValence } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
export const successText = 'text-xs font-medium text-success-550 dark:text-success-300';
|
|
8
|
+
export const infoText = 'text-xs font-medium text-info-550 dark:text-info-300';
|
|
9
|
+
export const warningText = 'text-xs font-medium text-warning-550 dark:text-warning-300';
|
|
10
|
+
export const errorText = 'text-xs font-medium text-error-550 dark:text-error-300';
|
|
11
|
+
|
|
12
|
+
export const valenceColorText = (valence?: MessageValence) => {
|
|
13
|
+
switch (valence) {
|
|
14
|
+
case 'success':
|
|
15
|
+
return successText;
|
|
16
|
+
case 'info':
|
|
17
|
+
return infoText;
|
|
18
|
+
case 'warning':
|
|
19
|
+
return warningText;
|
|
20
|
+
case 'error':
|
|
21
|
+
return errorText;
|
|
22
|
+
default:
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const neutralMessageColors = 'bg-neutral-25 dark:bg-neutral-850';
|
|
28
|
+
export const successMessageColors =
|
|
29
|
+
'shadow-success-500/50 dark:shadow-success-500/50 text-success-600 dark:text-success-100 bg-success-50 dark:bg-success-900';
|
|
30
|
+
export const infoMessageColors =
|
|
31
|
+
'shadow-info-500/50 dark:shadow-info-500/50 text-info-600 dark:text-info-100 bg-info-50 dark:bg-info-900';
|
|
32
|
+
export const warningMessageColors =
|
|
33
|
+
'shadow-warning-500/50 dark:shadow-warning-500/50 text-warning-600 dark:text-warning-100 bg-warning-50 dark:bg-warning-900';
|
|
34
|
+
export const errorMessageColors =
|
|
35
|
+
'shadow-error-500/50 dark:shadow-error-500/50 text-error-600 dark:text-error-100 bg-error-50 dark:bg-error-900';
|
|
36
|
+
|
|
37
|
+
export const messageValence = (valence?: MessageValence) => {
|
|
38
|
+
switch (valence) {
|
|
39
|
+
case 'success':
|
|
40
|
+
return successMessageColors;
|
|
41
|
+
case 'info':
|
|
42
|
+
return infoMessageColors;
|
|
43
|
+
case 'warning':
|
|
44
|
+
return warningMessageColors;
|
|
45
|
+
case 'error':
|
|
46
|
+
return errorMessageColors;
|
|
47
|
+
default:
|
|
48
|
+
return neutralMessageColors;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@layer utilities {
|
|
2
|
+
.attention-surface {
|
|
3
|
+
background-color: white;
|
|
4
|
+
--surface-bg: white;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dark .attention-surface {
|
|
8
|
+
background-color: theme(colors.neutral.900);
|
|
9
|
+
--surface-bg: theme(colors.neutral.900);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@layer components {
|
|
14
|
+
.attention {
|
|
15
|
+
--surface-bg: transparent;
|
|
16
|
+
--surface-separator: transparent;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.attention-within:focus-within {
|
|
20
|
+
--surface-bg: white;
|
|
21
|
+
--surface-separator: theme(colors.neutral.75);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dark .attention-within:focus-within {
|
|
25
|
+
--surface-bg: theme(colors.neutral.900);
|
|
26
|
+
--surface-separator: theme(colors.neutral.750);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.group\/attention:not(:focus-within) .attention-current[aria-current] {
|
|
30
|
+
--surface-bg: white;
|
|
31
|
+
--surface-separator: theme(colors.neutral.75);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dark .group\/attention:not(:focus-within) .attention-current[aria-current] {
|
|
35
|
+
--surface-bg: theme(colors.neutral.900);
|
|
36
|
+
--surface-separator: theme(colors.neutral.750);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.attention-static,
|
|
40
|
+
.attention-within.attention-static {
|
|
41
|
+
--surface-bg: white;
|
|
42
|
+
--surface-separator: theme(colors.neutral.75);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dark .attention-static,
|
|
46
|
+
.dark .attention-within.attention-static {
|
|
47
|
+
--surface-bg: theme(colors.neutral.900);
|
|
48
|
+
--surface-separator: theme(colors.neutral.750);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* TODO(thure): Focus is handled by .ch-focus-ring, but should ideally be applied as part of this component.*/
|
|
2
|
+
/* TODO(thure): This should be on the `components` layer, but utility classes like `pli-0` weren’t getting precedence like they should. */
|
|
3
|
+
@layer base {
|
|
4
|
+
/* Base styles */
|
|
5
|
+
.ch-button {
|
|
6
|
+
@apply font-medium text-sm shrink-0 inline-flex select-none items-center justify-center overflow-hidden transition-colors duration-100 ease-linear surface-input min-bs-[2.5rem] pli-4;
|
|
7
|
+
&[aria-pressed='true'],
|
|
8
|
+
&[aria-checked='true'] {
|
|
9
|
+
@apply fg-accent surface-attention;
|
|
10
|
+
}
|
|
11
|
+
/* Disabled styles */
|
|
12
|
+
&[disabled]:not([disabled='false']) {
|
|
13
|
+
@apply opacity-40 cursor-not-allowed shadow-none;
|
|
14
|
+
}
|
|
15
|
+
/* Variants consistent between enabled & disabled */
|
|
16
|
+
&[data-variant='ghost'] {
|
|
17
|
+
@apply bg-transparent;
|
|
18
|
+
&:hover {
|
|
19
|
+
@apply surface-hover text-inherit;
|
|
20
|
+
}
|
|
21
|
+
&[data-state='open'] {
|
|
22
|
+
@apply surface-input;
|
|
23
|
+
}
|
|
24
|
+
&[aria-pressed='true'],
|
|
25
|
+
&[aria-checked='true'] {
|
|
26
|
+
@apply surface-base fg-accent;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
&[data-variant='outline'] {
|
|
30
|
+
@apply border separator-base bg-transparent;
|
|
31
|
+
&:hover {
|
|
32
|
+
@apply surface-hover;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/* Enabled styles */
|
|
36
|
+
&:not([disabled]),
|
|
37
|
+
&[disabled='false'] {
|
|
38
|
+
/* Hover */
|
|
39
|
+
&:hover {
|
|
40
|
+
@apply surface-hover;
|
|
41
|
+
}
|
|
42
|
+
/* Variants */
|
|
43
|
+
&[data-variant='primary'] {
|
|
44
|
+
@apply fg-inverse surface-accent;
|
|
45
|
+
&:hover,
|
|
46
|
+
&[aria-pressed='true'],
|
|
47
|
+
&[aria-checked='true'] &[data-state='open'] {
|
|
48
|
+
@apply surface-accentHover;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
&[data-variant='destructive'] {
|
|
52
|
+
@apply fg-inverse bg-error-550;
|
|
53
|
+
&:hover,
|
|
54
|
+
&[aria-pressed='true'],
|
|
55
|
+
&[aria-checked='true'] &[data-state='open'] {
|
|
56
|
+
@apply bg-error-500;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/* Props */
|
|
62
|
+
.ch-button:not([data-props~='grouped']) {
|
|
63
|
+
@apply rounded-sm;
|
|
64
|
+
}
|
|
65
|
+
.ch-button:not([data-props~='wrap']) {
|
|
66
|
+
@apply truncate;
|
|
67
|
+
}
|
|
68
|
+
@media (pointer: fine) {
|
|
69
|
+
.ch-button[data-density='fine'] {
|
|
70
|
+
@apply min-bs-[2rem] pli-2.5;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
:root {
|
|
3
|
+
--can-scroll-inline: initial;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@keyframes detect-scroll-inline {
|
|
7
|
+
from,
|
|
8
|
+
to {
|
|
9
|
+
--can-scroll-inline: ;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.justify-center-if-no-scroll {
|
|
14
|
+
justify-content: start;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@supports (animation-timeline: scroll(inline self)) {
|
|
18
|
+
.justify-center-if-no-scroll {
|
|
19
|
+
animation: detect-scroll-inline linear;
|
|
20
|
+
animation-timeline: scroll(inline self);
|
|
21
|
+
--justify-if-no-scroll: center;
|
|
22
|
+
--justify-if-can-scroll: var(--can-scroll-inline) start;
|
|
23
|
+
justify-content: var(--justify-if-can-scroll, var(--justify-if-no-scroll));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* TODO(thure): Focus is handled by .ch-focus-ring, but should ideally be applied as part of this component.*/
|
|
2
|
+
/* TODO(thure): This should be on the `components` layer, but utility classes like `pli-0` weren’t getting precedence like they should. */
|
|
3
|
+
@layer base {
|
|
4
|
+
.ch-checkbox {
|
|
5
|
+
@apply is-4 bs-4 border-0 shadow-inner transition-colors surface-unAccent s-accent-unAccent fg-inverse shrink-0 inline-grid place-items-center rounded-sm;
|
|
6
|
+
/* Not-unchecked styles */
|
|
7
|
+
&[aria-checked='true'],
|
|
8
|
+
&[aria-checked='mixed'],
|
|
9
|
+
&:checked {
|
|
10
|
+
@apply surface-accent s-accent-accent;
|
|
11
|
+
}
|
|
12
|
+
/* Enabled styles */
|
|
13
|
+
&:not([disabled]),
|
|
14
|
+
&[disabled='false'] {
|
|
15
|
+
&:hover {
|
|
16
|
+
@apply surface-unAccentHover s-accent-unAccentHover;
|
|
17
|
+
&[aria-checked='true'],
|
|
18
|
+
&[aria-checked='mixed'],
|
|
19
|
+
&:checked {
|
|
20
|
+
@apply surface-accentHover s-accent-accentHover;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@layer base {
|
|
2
|
+
.ch-focus-ring {
|
|
3
|
+
&:not([disabled]),
|
|
4
|
+
&[disabled='false'] {
|
|
5
|
+
&:focus {
|
|
6
|
+
@apply outline-none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&:focus-visible {
|
|
10
|
+
@apply z-[1] ring-2 ring-offset-0 ring-primary-350 ring-offset-white;
|
|
11
|
+
|
|
12
|
+
.dark & {
|
|
13
|
+
@apply ring-primary-450 ring-offset-black;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:hover {
|
|
17
|
+
@apply outline-none;
|
|
18
|
+
|
|
19
|
+
.dark & {
|
|
20
|
+
@apply outline-none;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@import './anchored-overflow.css';
|
|
2
|
+
@import './attention.css';
|
|
3
|
+
@import './button.css';
|
|
4
|
+
@import './can-scroll.css';
|
|
5
|
+
@import './checkbox.css';
|
|
6
|
+
@import './focus-ring.css';
|
|
7
|
+
@import './positioning.css';
|
|
8
|
+
@import './surfaces.css';
|
|
9
|
+
@import './tldraw.css';
|
|
10
|
+
@import './typography.css';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@layer utilities {
|
|
2
|
+
.snap-inline {
|
|
3
|
+
scroll-snap-type: inline var(--tw-scroll-snap-strictness);
|
|
4
|
+
}
|
|
5
|
+
.snap-block {
|
|
6
|
+
scroll-snap-type: block var(--tw-scroll-snap-strictness);
|
|
7
|
+
}
|
|
8
|
+
.sticky-top-0 {
|
|
9
|
+
--sticky-top: 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@layer components {
|
|
14
|
+
.sticky-top-from-topbar-bottom {
|
|
15
|
+
--sticky-top: var(--topbar-size);
|
|
16
|
+
}
|
|
17
|
+
.sticky-bottom-from-statusbar-bottom {
|
|
18
|
+
--sticky-bottom: var(--statusbar-size);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@layer utilities {
|
|
2
|
+
.base-surface {
|
|
3
|
+
background-color: theme(colors.neutral.25);
|
|
4
|
+
--surface-bg: theme(colors.neutral.25);
|
|
5
|
+
--input-bg: theme(colors.neutral.50);
|
|
6
|
+
--input-bg-hover: theme(colors.neutral.75);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dark .base-surface {
|
|
10
|
+
background-color: theme(colors.neutral.850);
|
|
11
|
+
--surface-bg: theme(colors.neutral.850);
|
|
12
|
+
--input-bg: theme(colors.neutral.825);
|
|
13
|
+
--input-bg-hover: theme(colors.neutral.800);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.fixed-surface {
|
|
17
|
+
background-color: theme(colors.neutral.25 / 90%);
|
|
18
|
+
--surface-bg: theme(colors.neutral.25);
|
|
19
|
+
--input-bg: theme(colors.neutral.50);
|
|
20
|
+
--input-bg-hover: theme(colors.neutral.75);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dark .fixed-surface {
|
|
24
|
+
background-color: theme(colors.neutral.850 / 90%);
|
|
25
|
+
--surface-bg: theme(colors.neutral.850);
|
|
26
|
+
--input-bg: theme(colors.neutral.825);
|
|
27
|
+
--input-bg-hover: theme(colors.neutral.800);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.modal-surface {
|
|
31
|
+
background-color: #ffffff;
|
|
32
|
+
--surface-bg: white;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.dark .modal-surface {
|
|
36
|
+
background-color: theme(colors.neutral.750);
|
|
37
|
+
--surface-bg: theme(colors.neutral.750);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.tl-container.tl-theme__light {
|
|
2
|
+
/* Converted */
|
|
3
|
+
/* General */
|
|
4
|
+
--color-accent: var(--color-accent);
|
|
5
|
+
--color-background: var(--surface-bg); /* Main background. */
|
|
6
|
+
|
|
7
|
+
/* Panels *
|
|
8
|
+
--color-panel: theme(colors.neutral.50);
|
|
9
|
+
--color-divider: theme(colors.neutral.75); /* Separator light. */
|
|
10
|
+
--color-panel-contrast: theme(colors.neutral.25);
|
|
11
|
+
--color-panel-overlay: rgba(255, 255, 255, 0.82);
|
|
12
|
+
|
|
13
|
+
/* Unmodified.
|
|
14
|
+
--color-brush-fill: rgba(144, 144, 144, 0.102);
|
|
15
|
+
--color-brush-stroke: rgba(144, 144, 144, 0.251);
|
|
16
|
+
--color-grid: rgba(144, 144, 144, 0.902);
|
|
17
|
+
--color-low: rgb(237, 240, 242);
|
|
18
|
+
--color-culled: rgb(235, 238, 240);
|
|
19
|
+
--color-muted-0: rgba(0, 0, 0, 0.02);
|
|
20
|
+
--color-muted-1: rgba(0, 0, 0, 0.1);
|
|
21
|
+
--color-muted-2: rgba(0, 0, 0, 0.035);
|
|
22
|
+
--color-hint: rgba(0, 0, 0, 0.055);
|
|
23
|
+
--color-overlay: rgba(0, 0, 0, 0.2);
|
|
24
|
+
--color-focus: #004094;
|
|
25
|
+
--color-selected: #2f80ed;
|
|
26
|
+
--color-selected-contrast: #ffffff;
|
|
27
|
+
--color-selection-fill: #1e90ff06;
|
|
28
|
+
--color-selection-stroke: #2f80ed;
|
|
29
|
+
--color-text-0: #1d1d1d;
|
|
30
|
+
--color-text-1: #2d2d2d;
|
|
31
|
+
--color-text-2: #5f6369;
|
|
32
|
+
--color-text-3: #b6b7ba;
|
|
33
|
+
--color-primary: #2f80ed;
|
|
34
|
+
--color-warn: #d10b0b;
|
|
35
|
+
--color-text: #000000;
|
|
36
|
+
--color-laser: #ff0000;
|
|
37
|
+
--shadow-1: 0px 1px 2px rgba(0, 0, 0, 0.22), 0px 1px 3px rgba(0, 0, 0, 0.09);
|
|
38
|
+
--shadow-2: 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 3px rgba(0, 0, 0, 0.24), 0px 2px 6px rgba(0, 0, 0, 0.1),
|
|
39
|
+
inset 0px 0px 0px 1px var(--color-panel-contrast);
|
|
40
|
+
--shadow-3: 0px 1px 2px rgba(0, 0, 0, 0.25), 0px 2px 6px rgba(0, 0, 0, 0.14),
|
|
41
|
+
inset 0px 0px 0px 1px var(--color-panel-contrast);
|
|
42
|
+
--shadow-4: 0px 0px 3px rgba(0, 0, 0, 0.16), 0px 5px 4px rgba(0, 0, 0, 0.16), 0px 2px 16px rgba(0, 0, 0, 0.06),
|
|
43
|
+
inset 0px 0px 0px 1px var(--color-panel-contrast);
|
|
44
|
+
*/
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tl-container.tl-theme__dark {
|
|
48
|
+
/* Converted */
|
|
49
|
+
/* General */
|
|
50
|
+
--color-accent: var(--color-accent);
|
|
51
|
+
--color-background: var(--surface-bg);
|
|
52
|
+
|
|
53
|
+
/* Panels */
|
|
54
|
+
--color-divider: theme(colors.neutral.750); /* Separator dark. */
|
|
55
|
+
--color-panel: theme(colors.neutral.900);
|
|
56
|
+
--color-panel-contrast: theme(colors.neutral.750);
|
|
57
|
+
--color-panel-overlay: rgba(54, 61, 68, 0.82);
|
|
58
|
+
|
|
59
|
+
/* Unmodified.
|
|
60
|
+
--color-brush-fill: rgba(180, 180, 180, 0.05);
|
|
61
|
+
--color-brush-stroke: rgba(180, 180, 180, 0.25);
|
|
62
|
+
--color-grid: #909090e6;
|
|
63
|
+
--color-low: #2c3136;
|
|
64
|
+
--color-culled: rgb(47, 52, 57);
|
|
65
|
+
--color-muted-0: rgba(255, 255, 255, 0.02);
|
|
66
|
+
--color-muted-1: rgba(255, 255, 255, 0.1);
|
|
67
|
+
--color-muted-2: rgba(255, 255, 255, 0.05);
|
|
68
|
+
--color-hint: rgba(255, 255, 255, 0.1);
|
|
69
|
+
--color-overlay: rgba(0, 0, 0, 0.35);
|
|
70
|
+
--color-focus: #a5c3f3;
|
|
71
|
+
--color-selected: #4285f4;
|
|
72
|
+
--color-selected-contrast: #ffffff;
|
|
73
|
+
--color-selection-fill: rgba(38, 150, 255, 0.05);
|
|
74
|
+
--color-selection-stroke: #2f80ed;
|
|
75
|
+
--color-text-0: #f0eded;
|
|
76
|
+
--color-text-1: #d9d9d9;
|
|
77
|
+
--color-text-2: #8e9094;
|
|
78
|
+
--color-text-3: #515a62;
|
|
79
|
+
--color-primary: #2f80ed;
|
|
80
|
+
--color-warn: #d10b0b;
|
|
81
|
+
--color-text: #f8f9fa;
|
|
82
|
+
--color-laser: #ff0000;
|
|
83
|
+
--shadow-1: 0px 1px 2px #00000029, 0px 1px 3px #00000038, inset 0px 0px 0px 1px var(--color-panel-contrast);
|
|
84
|
+
--shadow-2: 0px 1px 3px #00000077, 0px 2px 6px #00000055, inset 0px 0px 0px 1px var(--color-panel-contrast);
|
|
85
|
+
--shadow-3: 0px 1px 3px #00000077, 0px 2px 12px rgba(0, 0, 0, 0.22), inset 0px 0px 0px 1px var(--color-panel-contrast);
|
|
86
|
+
*/
|
|
87
|
+
}
|