@dxos/ui-theme 0.8.4-main.6fa680abb7 → 0.8.4-main.74a063c4e0
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/lib/browser/index.mjs +355 -443
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +355 -443
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/plugin/node-cjs/{theme.css → main.css} +66 -31
- package/dist/plugin/node-cjs/main.css.map +7 -0
- package/dist/plugin/node-cjs/meta.json +1 -1
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +8 -15
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +3 -3
- package/dist/plugin/node-esm/{theme.css → main.css} +66 -31
- package/dist/plugin/node-esm/main.css.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +8 -15
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +3 -3
- package/dist/types/src/fragments/index.d.ts +0 -5
- package/dist/types/src/fragments/index.d.ts.map +1 -1
- package/dist/types/src/fragments/text.d.ts +0 -4
- package/dist/types/src/fragments/text.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -1
- package/dist/types/src/theme/components/avatar.d.ts.map +1 -1
- package/dist/types/src/theme/components/card.d.ts +3 -2
- package/dist/types/src/theme/components/card.d.ts.map +1 -1
- package/dist/types/src/theme/components/dialog.d.ts.map +1 -1
- package/dist/types/src/theme/components/focus.d.ts +6 -0
- package/dist/types/src/theme/components/focus.d.ts.map +1 -0
- package/dist/types/src/theme/components/icon-button.d.ts.map +1 -1
- package/dist/types/src/theme/components/icon.d.ts +3 -0
- package/dist/types/src/theme/components/icon.d.ts.map +1 -1
- package/dist/types/src/theme/components/index.d.ts +1 -0
- package/dist/types/src/theme/components/index.d.ts.map +1 -1
- package/dist/types/src/theme/components/input.d.ts.map +1 -1
- package/dist/types/src/theme/components/link.d.ts.map +1 -1
- package/dist/types/src/theme/components/list.d.ts.map +1 -1
- package/dist/types/src/theme/components/message.d.ts.map +1 -1
- package/dist/types/src/theme/components/popover.d.ts.map +1 -1
- package/dist/types/src/theme/components/scroll-area.d.ts +12 -2
- package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -1
- package/dist/types/src/theme/components/select.d.ts.map +1 -1
- package/dist/types/src/theme/components/status.d.ts +1 -1
- package/dist/types/src/theme/components/status.d.ts.map +1 -1
- package/dist/types/src/theme/components/toast.d.ts.map +1 -1
- package/dist/types/src/theme/components/toolbar.d.ts +0 -1
- package/dist/types/src/theme/components/toolbar.d.ts.map +1 -1
- package/dist/types/src/theme/components/tooltip.d.ts.map +1 -1
- package/dist/types/src/theme/components/treegrid.d.ts.map +1 -1
- package/dist/types/src/theme/index.d.ts +1 -0
- package/dist/types/src/theme/index.d.ts.map +1 -1
- package/dist/types/src/theme/primitives/column.d.ts +8 -3
- package/dist/types/src/theme/primitives/column.d.ts.map +1 -1
- package/dist/types/src/theme/primitives/panel.d.ts +9 -5
- package/dist/types/src/theme/primitives/panel.d.ts.map +1 -1
- package/dist/types/src/theme/theme.d.ts.map +1 -1
- package/dist/types/src/util/elevation.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +3 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/mx.d.ts +28 -284
- package/dist/types/src/util/mx.d.ts.map +1 -1
- package/dist/types/src/util/size.d.ts +27 -0
- package/dist/types/src/util/size.d.ts.map +1 -0
- package/dist/types/src/util/valence.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -4
- package/src/css/components/button.css +2 -1
- package/src/css/components/{focus-ring.css → focus.css} +15 -1
- package/src/css/components/icon.css +9 -0
- package/src/css/components/selected.css +30 -0
- package/src/css/integrations/codemirror.css +5 -3
- package/src/css/integrations/tldraw.css +1 -0
- package/src/css/layout/main.css +0 -7
- package/src/css/layout/size.css +8 -31
- package/src/css/theme/palette.css +8 -0
- package/src/css/theme/semantic.css +24 -9
- package/src/css/theme/spacing.css +35 -18
- package/src/css/utilities.css +72 -3
- package/src/fragments/AUDIT.md +58 -0
- package/src/fragments/index.ts +1 -6
- package/src/fragments/text.ts +0 -5
- package/src/index.ts +1 -1
- package/src/{theme.css → main.css} +10 -6
- package/src/plugins/ThemePlugin.ts +12 -24
- package/src/plugins/main.css +45 -0
- package/src/theme/components/avatar.ts +3 -4
- package/src/theme/components/button.ts +1 -1
- package/src/theme/components/card.ts +14 -10
- package/src/theme/components/dialog.ts +1 -2
- package/src/theme/components/focus.ts +33 -0
- package/src/theme/components/icon-button.ts +1 -3
- package/src/theme/components/icon.ts +13 -4
- package/src/theme/components/index.ts +1 -0
- package/src/theme/components/input.ts +10 -25
- package/src/theme/components/link.ts +1 -2
- package/src/theme/components/list.ts +4 -4
- package/src/theme/components/menu.ts +4 -4
- package/src/theme/components/message.ts +2 -3
- package/src/theme/components/popover.ts +3 -4
- package/src/theme/components/scroll-area.ts +47 -40
- package/src/theme/components/select.ts +2 -3
- package/src/theme/components/status.ts +5 -5
- package/src/theme/components/toast.ts +2 -3
- package/src/theme/components/toolbar.ts +1 -7
- package/src/theme/components/tooltip.ts +1 -2
- package/src/theme/components/treegrid.ts +1 -1
- package/src/theme/index.ts +1 -0
- package/src/theme/primitives/column.ts +27 -10
- package/src/theme/primitives/panel.ts +18 -25
- package/src/theme/theme.ts +2 -0
- package/src/typings.d.ts +3 -0
- package/src/util/index.ts +3 -0
- package/src/util/mx.ts +106 -7
- package/src/util/size.ts +103 -0
- package/dist/plugin/node-cjs/theme.css.map +0 -7
- package/dist/plugin/node-esm/theme.css.map +0 -7
- package/dist/types/src/fragments/elevation.d.ts.map +0 -1
- package/dist/types/src/fragments/focus.d.ts +0 -4
- package/dist/types/src/fragments/focus.d.ts.map +0 -1
- package/dist/types/src/fragments/selected.d.ts +0 -4
- package/dist/types/src/fragments/selected.d.ts.map +0 -1
- package/dist/types/src/fragments/size.d.ts +0 -7
- package/dist/types/src/fragments/size.d.ts.map +0 -1
- package/dist/types/src/fragments/valence.d.ts.map +0 -1
- package/src/fragments/focus.ts +0 -11
- package/src/fragments/selected.ts +0 -12
- package/src/fragments/size.ts +0 -117
- /package/dist/types/src/{fragments → util}/elevation.d.ts +0 -0
- /package/dist/types/src/{fragments → util}/valence.d.ts +0 -0
- /package/src/{fragments → util}/elevation.ts +0 -0
- /package/src/{fragments → util}/valence.ts +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
export const ghostHighlighted =
|
|
6
|
-
'data-[highlighted]:bg-primary-100 dark:data-[highlighted]:bg-primary-600 hover:data-[highlighted]:bg-primary-150 hover:dark:data-[highlighted]:bg-primary-500';
|
|
7
|
-
|
|
8
|
-
export const ghostSelected =
|
|
9
|
-
'aria-selected:bg-base-surface aria-selected:text-accent-text hover:aria-selected:text-accent-text-hover aria-selected:font-semibold aria-selected:tracking-normal transition-[color,font-variation-settings,letter-spacing]';
|
|
10
|
-
|
|
11
|
-
export const ghostSelectedContainerMd =
|
|
12
|
-
'@md:aria-selected:bg-base-surface @md:aria-selected:text-accent-text @md:hover:aria-selected:text-accent-text-hover @md:aria-selected:font-semibold @md:aria-selected:tracking-normal @md:transition-[color,font-variation-settings,letter-spacing]';
|
package/src/fragments/size.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Size } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
import { mx } from '../util';
|
|
8
|
-
|
|
9
|
-
const sizeWidthMap = new Map<Size, string>([
|
|
10
|
-
[0, 'w-0'],
|
|
11
|
-
['px', 'w-px'], // 1px
|
|
12
|
-
[0.5, 'w-0.5'],
|
|
13
|
-
[1, 'w-1'],
|
|
14
|
-
[1.5, 'w-1.5'],
|
|
15
|
-
[2, 'w-2'],
|
|
16
|
-
[2.5, 'w-2.5'],
|
|
17
|
-
[3, 'w-3'],
|
|
18
|
-
[3.5, 'w-3.5'],
|
|
19
|
-
[4, 'w-4'],
|
|
20
|
-
[5, 'w-5'],
|
|
21
|
-
[6, 'w-6'],
|
|
22
|
-
[7, 'w-7'],
|
|
23
|
-
[8, 'w-8'],
|
|
24
|
-
[9, 'w-9'],
|
|
25
|
-
[10, 'w-10'],
|
|
26
|
-
[11, 'w-11'],
|
|
27
|
-
[12, 'w-12'],
|
|
28
|
-
[14, 'w-14'],
|
|
29
|
-
[16, 'w-16'],
|
|
30
|
-
[20, 'w-20'],
|
|
31
|
-
[24, 'w-24'],
|
|
32
|
-
[28, 'w-28'],
|
|
33
|
-
[32, 'w-32'],
|
|
34
|
-
[36, 'w-36'],
|
|
35
|
-
[40, 'w-40'],
|
|
36
|
-
[44, 'w-44'],
|
|
37
|
-
[48, 'w-48'],
|
|
38
|
-
[52, 'w-52'],
|
|
39
|
-
[56, 'w-56'],
|
|
40
|
-
[60, 'w-60'],
|
|
41
|
-
[64, 'w-64'],
|
|
42
|
-
[72, 'w-72'],
|
|
43
|
-
[80, 'w-80'],
|
|
44
|
-
[96, 'w-96'],
|
|
45
|
-
]);
|
|
46
|
-
|
|
47
|
-
const sizeHeightMap = new Map<Size, string>([
|
|
48
|
-
[0, 'h-0'],
|
|
49
|
-
['px', 'h-px'], // 1px
|
|
50
|
-
[0.5, 'h-0.5'],
|
|
51
|
-
[1, 'h-1'],
|
|
52
|
-
[1.5, 'h-1.5'],
|
|
53
|
-
[2, 'h-2'],
|
|
54
|
-
[2.5, 'h-2.5'],
|
|
55
|
-
[3, 'h-3'],
|
|
56
|
-
[3.5, 'h-3.5'],
|
|
57
|
-
[4, 'h-4'],
|
|
58
|
-
[5, 'h-5'],
|
|
59
|
-
[6, 'h-6'],
|
|
60
|
-
[7, 'h-7'],
|
|
61
|
-
[8, 'h-8'],
|
|
62
|
-
[9, 'h-9'],
|
|
63
|
-
[10, 'h-10'],
|
|
64
|
-
[11, 'h-11'],
|
|
65
|
-
[12, 'h-12'],
|
|
66
|
-
[14, 'h-14'],
|
|
67
|
-
[16, 'h-16'],
|
|
68
|
-
[20, 'h-20'],
|
|
69
|
-
[24, 'h-24'],
|
|
70
|
-
[28, 'h-28'],
|
|
71
|
-
[32, 'h-32'],
|
|
72
|
-
[36, 'h-36'],
|
|
73
|
-
[40, 'h-40'],
|
|
74
|
-
[44, 'h-44'],
|
|
75
|
-
[48, 'h-48'],
|
|
76
|
-
[52, 'h-52'],
|
|
77
|
-
[56, 'h-56'],
|
|
78
|
-
[60, 'h-60'],
|
|
79
|
-
[64, 'h-64'],
|
|
80
|
-
[72, 'h-72'],
|
|
81
|
-
[80, 'h-80'],
|
|
82
|
-
[96, 'h-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);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|