@dxos/ui-theme 0.8.4-main.c85a9c8dae → 0.8.4-main.d05539e30a
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 +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/index.mjs +423 -499
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +423 -499
- 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} +204 -125
- 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} +204 -125
- 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/Theme.stories.d.ts.map +1 -1
- package/dist/types/src/defs.d.ts +2 -2
- package/dist/types/src/defs.d.ts.map +1 -1
- package/dist/types/src/fragments/density.d.ts +1 -4
- package/dist/types/src/fragments/density.d.ts.map +1 -1
- package/dist/types/src/fragments/hover.d.ts +0 -1
- package/dist/types/src/fragments/hover.d.ts.map +1 -1
- 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 -5
- 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 +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/button.d.ts +2 -2
- package/dist/types/src/theme/components/button.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 +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 +8 -8
- 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/main.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 +25 -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/hash-styles.d.ts +1 -1
- package/dist/types/src/util/hash-styles.d.ts.map +1 -1
- 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 +52 -4
- 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 +4 -0
- package/dist/types/src/util/valence.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -18
- package/src/Theme.stories.tsx +5 -5
- package/src/css/DESIGN_SYSTEM.md +159 -0
- package/src/css/base/base.css +2 -2
- package/src/css/components/button.css +4 -3
- package/src/css/components/checkbox.css +1 -1
- package/src/css/components/{focus-ring.css → focus.css} +27 -13
- package/src/css/components/icon.css +9 -0
- package/src/css/components/link.css +3 -0
- package/src/css/components/panel.css +45 -45
- package/src/css/components/selected.css +76 -0
- package/src/css/components/selected.md +101 -0
- package/src/css/components/surface.css +4 -4
- package/src/css/components/tag.css +25 -23
- 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 +19 -27
- package/src/css/theme/animation.css +31 -0
- package/src/css/theme/palette.css +8 -0
- package/src/css/theme/semantic.css +48 -36
- package/src/css/theme/spacing.css +37 -20
- package/src/css/theme/styles.css +22 -22
- package/src/css/utilities.css +114 -3
- package/src/defs.ts +2 -2
- package/src/fragments/AUDIT.md +55 -0
- package/src/fragments/density.ts +8 -5
- package/src/fragments/hover.ts +0 -2
- package/src/fragments/index.ts +1 -6
- package/src/fragments/text.ts +1 -6
- package/src/index.ts +1 -1
- package/src/{theme.css → main.css} +48 -10
- 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 +3 -3
- package/src/theme/components/card.ts +19 -11
- package/src/theme/components/dialog.ts +4 -3
- package/src/theme/components/focus.ts +33 -0
- package/src/theme/components/icon-button.ts +6 -5
- package/src/theme/components/icon.ts +13 -4
- package/src/theme/components/index.ts +1 -0
- package/src/theme/components/input.ts +18 -33
- 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 +6 -7
- package/src/theme/components/popover.ts +4 -5
- package/src/theme/components/scroll-area.ts +58 -46
- package/src/theme/components/select.ts +3 -4
- 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 +2 -3
- package/src/theme/components/treegrid.ts +1 -1
- package/src/theme/index.ts +1 -0
- package/src/theme/primitives/column.ts +49 -8
- package/src/theme/primitives/panel.ts +19 -23
- package/src/theme/theme.ts +2 -0
- package/src/typings.d.ts +3 -0
- package/src/util/hash-styles.ts +19 -19
- package/src/util/index.ts +3 -0
- package/src/util/mx.ts +119 -8
- 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 +0 -4
- 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/src/{fragments → util}/elevation.ts +0 -0
- /package/src/{fragments → util}/valence.ts +0 -0
package/src/fragments/focus.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
export const focusRing = 'dx-focus-ring';
|
|
6
|
-
|
|
7
|
-
export const subduedFocus =
|
|
8
|
-
'focus:outline-hidden focus-visible:outline-hidden focus:ring-0 ring-0 focus:border-0 border-0';
|
|
9
|
-
|
|
10
|
-
export const staticFocusRing =
|
|
11
|
-
'ring-2 ring-offset-0 ring-primary-350 ring-offset-white dark:ring-primary-450 dark:ring-offset-black';
|
|
@@ -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
|