@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,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
import { focusRing, surfaceElevation, groupArrow, modalSurface } from '../fragments';
|
|
9
|
+
|
|
10
|
+
export type PopoverStyleProps = Partial<{
|
|
11
|
+
constrainInline?: boolean;
|
|
12
|
+
constrainBlock: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export const popoverViewport: ComponentFunction<PopoverStyleProps> = ({ constrainInline, constrainBlock }, ...etc) =>
|
|
16
|
+
mx(
|
|
17
|
+
'p-1 rounded-lg',
|
|
18
|
+
constrainInline && 'max-is-[--radix-popover-content-available-width] overflow-x-auto',
|
|
19
|
+
constrainBlock && 'max-bs-[--radix-popover-content-available-height] overflow-y-auto',
|
|
20
|
+
...etc,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const popoverContent: ComponentFunction<PopoverStyleProps> = (_props, ...etc) =>
|
|
24
|
+
mx('z-[30] rounded-lg', modalSurface, surfaceElevation({ elevation: 'group' }), focusRing, ...etc);
|
|
25
|
+
|
|
26
|
+
export const popoverArrow: ComponentFunction<PopoverStyleProps> = (_props, ...etc) => mx(groupArrow, ...etc);
|
|
27
|
+
|
|
28
|
+
export const popoverTheme: Theme<PopoverStyleProps> = {
|
|
29
|
+
content: popoverContent,
|
|
30
|
+
viewport: popoverViewport,
|
|
31
|
+
arrow: popoverArrow,
|
|
32
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type ScrollAreaStyleProps = {};
|
|
10
|
+
|
|
11
|
+
export const scrollAreaRoot: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
12
|
+
mx('overflow-hidden', ...etc);
|
|
13
|
+
|
|
14
|
+
export const scrollAreaViewport: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
15
|
+
mx('is-full bs-full [&>div]:table-fixed [&>div]:is-full', ...etc);
|
|
16
|
+
|
|
17
|
+
export const scrollAreaScrollbar: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
18
|
+
mx(
|
|
19
|
+
'flex select-none touch-none p-0.5 ease-out',
|
|
20
|
+
'data-[orientation=vertical]:is-1.5 sm:data-[orientation=vertical]:data-[variant=coarse]:is-3',
|
|
21
|
+
'data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:bs-1.5 sm:data-[orientation=horizontal]:data-[variant=coarse]:bs-3',
|
|
22
|
+
'sm:data-[variant=coarse]:surface-separator rounded-full',
|
|
23
|
+
'[&>div]:surface-unAccent sm:[&[data-variant=coarse]>div]:surface-attention',
|
|
24
|
+
...etc,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const scrollAreaThumb: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
28
|
+
mx(
|
|
29
|
+
'flex-1 rounded-full relative',
|
|
30
|
+
"before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-[6px] before:min-h-[6px]",
|
|
31
|
+
...etc,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const scrollAreaCorner: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) => mx(...etc);
|
|
35
|
+
|
|
36
|
+
export const scrollAreaTheme: Theme<ScrollAreaStyleProps> = {
|
|
37
|
+
root: scrollAreaRoot,
|
|
38
|
+
viewport: scrollAreaViewport,
|
|
39
|
+
scrollbar: scrollAreaScrollbar,
|
|
40
|
+
thumb: scrollAreaThumb,
|
|
41
|
+
corner: scrollAreaCorner,
|
|
42
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Elevation, type Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
import {
|
|
9
|
+
arrow,
|
|
10
|
+
blockSeparator,
|
|
11
|
+
modalSurface,
|
|
12
|
+
ghostHighlighted,
|
|
13
|
+
surfaceElevation,
|
|
14
|
+
getSize,
|
|
15
|
+
separatorBorderColor,
|
|
16
|
+
} from '../fragments';
|
|
17
|
+
|
|
18
|
+
export type SelectStyleProps = Partial<{
|
|
19
|
+
elevation: Elevation;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
export const selectContent: ComponentFunction<SelectStyleProps> = ({ elevation = 'chrome' }, ...etc) => {
|
|
23
|
+
return mx('p-1 z-[50] rounded', modalSurface, surfaceElevation({ elevation }), ...etc);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const selectItem: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
27
|
+
mx(
|
|
28
|
+
'relative flex items-center pis-6 pie-3 plb-1',
|
|
29
|
+
'text-base leading-none rounded-sm select-none outline-none',
|
|
30
|
+
ghostHighlighted,
|
|
31
|
+
...etc,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const selectItemIndicator: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
35
|
+
mx('absolute inline-start-0 is-6 inline-flex items-center justify-center', ...etc);
|
|
36
|
+
|
|
37
|
+
export const selectArrow: ComponentFunction<SelectStyleProps> = (_props, ...etc) => mx(arrow, ...etc);
|
|
38
|
+
|
|
39
|
+
export const selectSeparator: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
40
|
+
mx(blockSeparator, separatorBorderColor, ...etc);
|
|
41
|
+
|
|
42
|
+
export const selectScrollButton: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
43
|
+
mx(modalSurface, 'flex items-center justify-center cursor-default bs-6 is-full', ...etc);
|
|
44
|
+
|
|
45
|
+
export const selectTriggerIcon: ComponentFunction<SelectStyleProps> = (_props, ...etc) => mx(getSize(2), ...etc);
|
|
46
|
+
|
|
47
|
+
export const selectTheme: Theme<SelectStyleProps> = {
|
|
48
|
+
content: selectContent,
|
|
49
|
+
item: selectItem,
|
|
50
|
+
itemIndicator: selectItemIndicator,
|
|
51
|
+
arrow: selectArrow,
|
|
52
|
+
separator: selectSeparator,
|
|
53
|
+
scrollButton: selectScrollButton,
|
|
54
|
+
triggerIcon: selectTriggerIcon,
|
|
55
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
import { blockSeparator, inlineSeparator, separatorBorderColor } from '../fragments';
|
|
9
|
+
|
|
10
|
+
export type SeparatorStyleProps = {
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const separatorRoot: ComponentFunction<SeparatorStyleProps> = ({ orientation }, ...etc) =>
|
|
15
|
+
mx(orientation === 'vertical' ? inlineSeparator : blockSeparator, separatorBorderColor, ...etc);
|
|
16
|
+
|
|
17
|
+
export const separatorTheme: Theme<SeparatorStyleProps> = {
|
|
18
|
+
root: separatorRoot,
|
|
19
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { ComponentFunction, Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type StatusStyleProps = {
|
|
10
|
+
indeterminate?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// TODO(burdon): How to customize color without requiring multiple classes.
|
|
14
|
+
export const statusRoot: ComponentFunction<StatusStyleProps> = (_props, ...etc) =>
|
|
15
|
+
mx('relative block bs-1 overflow-hidden rounded-full bg-primary-400/20', ...etc);
|
|
16
|
+
|
|
17
|
+
export const statusBar: ComponentFunction<StatusStyleProps> = ({ indeterminate }, ...etc) =>
|
|
18
|
+
mx(
|
|
19
|
+
'absolute block inline-start-0 inset-block-0 rounded-full bg-primary-400',
|
|
20
|
+
indeterminate && 'animate-progress-indeterminate',
|
|
21
|
+
...etc,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const statusTheme: Theme<StatusStyleProps> = {
|
|
25
|
+
root: statusRoot,
|
|
26
|
+
bar: statusBar,
|
|
27
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type ChromaticPalette,
|
|
7
|
+
type ComponentFunction,
|
|
8
|
+
type MessageValence,
|
|
9
|
+
type NeutralPalette,
|
|
10
|
+
type Theme,
|
|
11
|
+
} from '@dxos/react-ui-types';
|
|
12
|
+
|
|
13
|
+
import { mx } from '../../util';
|
|
14
|
+
|
|
15
|
+
export type TagStyleProps = {
|
|
16
|
+
palette?: ChromaticPalette | NeutralPalette | MessageValence;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const paletteColorMap: Record<Exclude<TagStyleProps['palette'], undefined>, string> = {
|
|
20
|
+
neutral: 'surface-separator text-neutral-800 dark:text-neutral-150',
|
|
21
|
+
red: 'bg-red-200 text-red-800 dark:bg-red-700 dark:text-red-150',
|
|
22
|
+
orange: 'bg-orange-200 text-orange-800 dark:bg-orange-700 dark:text-orange-150',
|
|
23
|
+
amber: 'bg-amber-200 text-amber-800 dark:bg-amber-700 dark:text-amber-150',
|
|
24
|
+
yellow: 'bg-yellow-200 text-yellow-800 dark:bg-yellow-700 dark:text-yellow-150',
|
|
25
|
+
lime: 'bg-lime-200 text-lime-800 dark:bg-lime-700 dark:text-lime-150',
|
|
26
|
+
green: 'bg-green-200 text-green-800 dark:bg-green-700 dark:text-green-150',
|
|
27
|
+
emerald: 'bg-emerald-200 text-emerald-800 dark:bg-emerald-700 dark:text-emerald-150',
|
|
28
|
+
teal: 'bg-teal-200 text-teal-800 dark:bg-teal-700 dark:text-teal-150',
|
|
29
|
+
cyan: 'bg-cyan-200 text-cyan-800 dark:bg-cyan-700 dark:text-cyan-150',
|
|
30
|
+
sky: 'bg-sky-200 text-sky-800 dark:bg-sky-700 dark:text-sky-150',
|
|
31
|
+
blue: 'bg-blue-200 text-blue-800 dark:bg-blue-700 dark:text-blue-150',
|
|
32
|
+
indigo: 'bg-indigo-200 text-indigo-800 dark:bg-indigo-700 dark:text-indigo-150',
|
|
33
|
+
violet: 'bg-violet-200 text-violet-800 dark:bg-violet-700 dark:text-violet-150',
|
|
34
|
+
purple: 'bg-purple-200 text-purple-800 dark:bg-purple-700 dark:text-purple-150',
|
|
35
|
+
fuchsia: 'bg-fuchsia-200 text-fuchsia-800 dark:bg-fuchsia-700 dark:text-fuchsia-150',
|
|
36
|
+
pink: 'bg-pink-200 text-pink-800 dark:bg-pink-700 dark:text-pink-150',
|
|
37
|
+
rose: 'bg-rose-200 text-rose-800 dark:bg-rose-700 dark:text-rose-150',
|
|
38
|
+
info: 'bg-info-200 text-info-800 dark:bg-info-700 dark:text-info-150',
|
|
39
|
+
success: 'bg-success-200 text-success-800 dark:bg-success-700 dark:text-success-150',
|
|
40
|
+
warning: 'bg-warning-200 text-warning-800 dark:bg-warning-700 dark:text-warning-150',
|
|
41
|
+
error: 'bg-error-200 text-error-800 dark:bg-error-700 dark:text-error-150',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const tagRoot: ComponentFunction<TagStyleProps> = ({ palette = 'neutral' }, ...etc) =>
|
|
45
|
+
mx('text-xs font-semibold pli-2 plb-0.5 rounded cursor-default', paletteColorMap[palette], ...etc);
|
|
46
|
+
|
|
47
|
+
export const tagTheme: Theme<TagStyleProps> = {
|
|
48
|
+
root: tagRoot,
|
|
49
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
import { descriptionText, focusRing, modalSurface, surfaceElevation } from '../fragments';
|
|
9
|
+
|
|
10
|
+
export type ToastStyleProps = Partial<{
|
|
11
|
+
srOnly: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
export const toastViewport: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
15
|
+
mx(
|
|
16
|
+
'z-[70] fixed bottom-4 inset-x-4 w-auto md:top-4 md:right-4 md:left-auto md:bottom-auto md:w-full md:max-w-sm rounded-lg flex flex-col gap-2',
|
|
17
|
+
...etc,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const toastRoot: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
21
|
+
mx(
|
|
22
|
+
'rounded-lg flex p-2 gap-2',
|
|
23
|
+
modalSurface,
|
|
24
|
+
surfaceElevation({ elevation: 'chrome' }),
|
|
25
|
+
'radix-state-open:animate-toast-slide-in-bottom md:radix-state-open:animate-toast-slide-in-right',
|
|
26
|
+
'radix-state-closed:animate-toast-hide',
|
|
27
|
+
'radix-swipe-end:animate-toast-swipe-out',
|
|
28
|
+
'translate-x-radix-toast-swipe-move-x',
|
|
29
|
+
'radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]',
|
|
30
|
+
focusRing,
|
|
31
|
+
...etc,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const toastBody: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
35
|
+
mx('grow flex flex-col gap-1 justify-center pis-2', ...etc);
|
|
36
|
+
|
|
37
|
+
export const toastActions: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
38
|
+
mx('shrink-0 flex flex-col gap-1 justify-center', ...etc);
|
|
39
|
+
|
|
40
|
+
export const toastTitle: ComponentFunction<ToastStyleProps> = ({ srOnly }, ...etc) =>
|
|
41
|
+
mx('shrink-0 text-md font-medium', srOnly && 'sr-only', ...etc);
|
|
42
|
+
|
|
43
|
+
export const toastDescription: ComponentFunction<ToastStyleProps> = ({ srOnly }, ...etc) =>
|
|
44
|
+
mx(descriptionText, 'shrink-0', srOnly && 'sr-only', ...etc);
|
|
45
|
+
|
|
46
|
+
export const toastTheme: Theme<ToastStyleProps> = {
|
|
47
|
+
viewport: toastViewport,
|
|
48
|
+
root: toastRoot,
|
|
49
|
+
body: toastBody,
|
|
50
|
+
title: toastTitle,
|
|
51
|
+
description: toastDescription,
|
|
52
|
+
actions: toastActions,
|
|
53
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type ToolbarStyleProps = Partial<{}>;
|
|
10
|
+
|
|
11
|
+
export const toolbarRoot: ComponentFunction<ToolbarStyleProps> = (_props, ...etc) => {
|
|
12
|
+
return mx('flex items-center gap-2 is-full', ...etc);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const toolbarTheme: Theme<ToolbarStyleProps> = {
|
|
16
|
+
root: toolbarRoot,
|
|
17
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
import { arrow, chromeText, surfaceElevation, modalSurface, popperMotion } from '../fragments';
|
|
9
|
+
|
|
10
|
+
export type TooltipStyleProps = {};
|
|
11
|
+
|
|
12
|
+
export const tooltipContent: ComponentFunction<TooltipStyleProps> = (_props, ...etc) =>
|
|
13
|
+
mx(
|
|
14
|
+
'inline-flex items-center rounded-md plb-2 pli-3 max-is-64',
|
|
15
|
+
modalSurface,
|
|
16
|
+
popperMotion,
|
|
17
|
+
surfaceElevation({ elevation: 'group' }),
|
|
18
|
+
chromeText,
|
|
19
|
+
...etc,
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const tooltipArrow: ComponentFunction<TooltipStyleProps> = (_props, ...etc) => mx(arrow, ...etc);
|
|
23
|
+
|
|
24
|
+
export const tooltipTheme: Theme<TooltipStyleProps> = {
|
|
25
|
+
content: tooltipContent,
|
|
26
|
+
arrow: tooltipArrow,
|
|
27
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { ComponentFunction, Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type TreegridStyleProps = Partial<{
|
|
10
|
+
level: number;
|
|
11
|
+
indent: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
const levelStyles = new Map<number, string>([
|
|
15
|
+
[1, '[&>.indent:first-of-type]:pis-0 font-medium'],
|
|
16
|
+
[2, '[&>.indent:first-of-type]:pis-0'],
|
|
17
|
+
[3, '[&>.indent:first-of-type]:pis-1'],
|
|
18
|
+
[4, '[&>.indent:first-of-type]:pis-2'],
|
|
19
|
+
[5, '[&>.indent:first-of-type]:pis-3'],
|
|
20
|
+
[6, '[&>.indent:first-of-type]:pis-4'],
|
|
21
|
+
[7, '[&>.indent:first-of-type]:pis-5'],
|
|
22
|
+
[8, '[&>.indent:first-of-type]:pis-6'],
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
export const treegridRoot: ComponentFunction<TreegridStyleProps> = (_, ...etc) => mx('grid', ...etc);
|
|
26
|
+
|
|
27
|
+
export const treegridRow: ComponentFunction<TreegridStyleProps> = ({ level = 1 }, ...etc) =>
|
|
28
|
+
mx('contents', levelStyles.get(Math.min(Math.max(Math.round(level), 1), 8)), ...etc);
|
|
29
|
+
|
|
30
|
+
export const treegridCell: ComponentFunction<TreegridStyleProps> = ({ indent }, ...etc) =>
|
|
31
|
+
mx(indent && 'indent', ...etc);
|
|
32
|
+
|
|
33
|
+
export const treegridTheme: Theme<TreegridStyleProps> = {
|
|
34
|
+
root: treegridRoot,
|
|
35
|
+
row: treegridRow,
|
|
36
|
+
cell: treegridCell,
|
|
37
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const arrow = 'fill-[--surface-bg] dark:fill-[--surface-bg]';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated With the implementation of the surface-bg variable, this is now obsolete.
|
|
9
|
+
*/
|
|
10
|
+
export const groupArrow = 'fill-[--surface-bg] dark:fill-[--surface-bg]';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Density } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
export const coarseBlockSize = 'min-bs-[2.5rem]';
|
|
8
|
+
export const coarseTextPadding = 'pli-3';
|
|
9
|
+
export const coarseButtonPadding = 'pli-4';
|
|
10
|
+
export const coarseDimensions = `${coarseBlockSize} ${coarseTextPadding}`;
|
|
11
|
+
export const coarseButtonDimensions = `${coarseBlockSize} ${coarseButtonPadding}`;
|
|
12
|
+
export const fineBlockSize = 'min-bs-[2.5rem] pointer-fine:min-bs-[2rem]';
|
|
13
|
+
export const fineTextPadding = 'pli-2';
|
|
14
|
+
export const fineButtonPadding = 'pli-2.5';
|
|
15
|
+
export const fineDimensions = `${fineBlockSize} ${fineTextPadding}`;
|
|
16
|
+
export const fineButtonDimensions = `${fineBlockSize} ${fineButtonPadding}`;
|
|
17
|
+
export const densityBlockSize = (density: Density = 'coarse') => (density === 'fine' ? fineBlockSize : coarseBlockSize);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFragment, type Elevation } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated
|
|
9
|
+
*/
|
|
10
|
+
export const contentElevation: ComponentFragment<{ elevation?: Elevation }> = (_) => ['shadow-none'];
|
|
11
|
+
|
|
12
|
+
export const surfaceElevation: ComponentFragment<{ elevation?: Elevation }> = ({ elevation }) => [
|
|
13
|
+
elevation === 'group' ? 'shadow' : elevation === 'chrome' ? 'shadow-lg' : 'shadow-none',
|
|
14
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const focusRing =
|
|
6
|
+
'focus:outline-none focus-visible:z-[1] focus-visible:hover:outline-none dark:focus-visible:hover:outline-none focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-primary-350 focus-visible:ring-offset-white dark:focus-visible:ring-primary-450 dark:focus-visible:ring-offset-black';
|
|
7
|
+
|
|
8
|
+
// TODO(burdon): Requires container to have m-1.
|
|
9
|
+
export const dropRing =
|
|
10
|
+
'ring-1 ring-offset-0 ring-primary-350 ring-offset-white dark:ring-primary-450 dark:ring-offset-black';
|
|
11
|
+
|
|
12
|
+
export const dropRingInner =
|
|
13
|
+
'before:z-10 before:absolute before:inset-0 before:ring-1 before:ring-inset before:ring-primary-350 before:dark:ring-primary-450';
|
|
14
|
+
|
|
15
|
+
export const subduedFocus = 'focus:outline-none focus-visible:outline-none focus:ring-0 ring-0 focus:border-0 border-0';
|
|
16
|
+
|
|
17
|
+
export const staticFocusRing =
|
|
18
|
+
'ring-2 ring-offset-0 ring-primary-350 ring-offset-white dark:ring-primary-450 dark:ring-offset-black';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFragment, type Elevation } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { surfaceElevation } from './elevation';
|
|
8
|
+
|
|
9
|
+
export const group: ComponentFragment<{ elevation?: Elevation }> = (props) => [
|
|
10
|
+
props.elevation === 'base' ? 'bg-transparent border separator-separator' : 'surface-modal',
|
|
11
|
+
surfaceElevation(props),
|
|
12
|
+
];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
export const hoverColors = 'transition-colors duration-100 linear hover:surface-hover';
|
|
9
|
+
|
|
10
|
+
export const ghostHover = 'hover:surface-hover';
|
|
11
|
+
export const subtleHover = 'hover:bg-neutral-100/20 dark:hover:bg-neutral-800/20';
|
|
12
|
+
|
|
13
|
+
export const hoverableControls =
|
|
14
|
+
'[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]';
|
|
15
|
+
|
|
16
|
+
export const hoverableFocusedKeyboardControls = 'focus-visible:[--controls-opacity:1]';
|
|
17
|
+
export const hoverableFocusedWithinControls = 'focus-within:[--controls-opacity:1]';
|
|
18
|
+
export const hoverableFocusedControls = 'focus:[--controls-opacity:1]';
|
|
19
|
+
export const staticHoverableControls = 'hover-hover:[--controls-opacity:1]';
|
|
20
|
+
export const hoverableOpenControlItem = 'hover-hover:aria-[expanded=true]:[--controls-opacity:1]';
|
|
21
|
+
|
|
22
|
+
export const hoverableControlItem = 'opacity-[--controls-opacity]';
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { Theme } from '@dxos/react-ui-types';
|
|
6
|
+
|
|
7
|
+
import { type HuePalette, physicalColors } from '../../config';
|
|
8
|
+
|
|
9
|
+
export type HueToken = {
|
|
10
|
+
text: string;
|
|
11
|
+
textHover: string;
|
|
12
|
+
fill: string;
|
|
13
|
+
cursorLightValue: string;
|
|
14
|
+
cursorDarkValue: string;
|
|
15
|
+
// highlightLightValue: string;
|
|
16
|
+
// highlightDarkValue: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const hueTokenValueShades = {
|
|
20
|
+
cursorLightValue: 400,
|
|
21
|
+
cursorDarkValue: 300,
|
|
22
|
+
// highlightLightValue: 50,
|
|
23
|
+
// highlightDarkValue: 900,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const hueTokenThemes: Record<HuePalette, Pick<HueToken, 'text' | 'textHover' | 'fill'>> = {
|
|
27
|
+
red: {
|
|
28
|
+
text: 'text-red-550 dark:text-red-300',
|
|
29
|
+
textHover: 'hover:text-red-450 focus-visible:text-red-450 dark:hover:text-red-200 dark:focus-visible:text-red-200',
|
|
30
|
+
fill: 'fill-red-500/60',
|
|
31
|
+
},
|
|
32
|
+
orange: {
|
|
33
|
+
text: 'text-orange-550 dark:text-orange-300',
|
|
34
|
+
textHover:
|
|
35
|
+
'hover:text-orange-450 focus-visible:text-orange-450 dark:hover:text-orange-200 dark:focus-visible:text-orange-200',
|
|
36
|
+
fill: 'fill-orange-500/60',
|
|
37
|
+
},
|
|
38
|
+
amber: {
|
|
39
|
+
text: 'text-amber-550 dark:text-amber-300',
|
|
40
|
+
textHover:
|
|
41
|
+
'hover:text-amber-450 focus-visible:text-amber-450 dark:hover:text-amber-200 dark:focus-visible:text-amber-200',
|
|
42
|
+
fill: 'fill-amber-500/60',
|
|
43
|
+
},
|
|
44
|
+
yellow: {
|
|
45
|
+
text: 'text-yellow-550 dark:text-yellow-300',
|
|
46
|
+
textHover:
|
|
47
|
+
'hover:text-yellow-450 focus-visible:text-yellow-450 dark:hover:text-yellow-200 dark:focus-visible:text-yellow-200',
|
|
48
|
+
fill: 'fill-yellow-500/60',
|
|
49
|
+
},
|
|
50
|
+
lime: {
|
|
51
|
+
text: 'text-lime-550 dark:text-lime-300',
|
|
52
|
+
textHover:
|
|
53
|
+
'hover:text-lime-450 focus-visible:text-lime-450 dark:hover:text-lime-200 dark:focus-visible:text-lime-200',
|
|
54
|
+
fill: 'fill-lime-500/60',
|
|
55
|
+
},
|
|
56
|
+
green: {
|
|
57
|
+
text: 'text-green-550 dark:text-green-300',
|
|
58
|
+
textHover:
|
|
59
|
+
'hover:text-green-450 focus-visible:text-green-450 dark:hover:text-green-200 dark:focus-visible:text-green-200',
|
|
60
|
+
fill: 'fill-green-500/60',
|
|
61
|
+
},
|
|
62
|
+
emerald: {
|
|
63
|
+
text: 'text-emerald-550 dark:text-emerald-300',
|
|
64
|
+
textHover:
|
|
65
|
+
'hover:text-emerald-450 focus-visible:text-emerald-450 dark:hover:text-emerald-200 dark:focus-visible:text-emerald-200',
|
|
66
|
+
fill: 'fill-emerald-500/60',
|
|
67
|
+
},
|
|
68
|
+
teal: {
|
|
69
|
+
text: 'text-teal-550 dark:text-teal-300',
|
|
70
|
+
textHover:
|
|
71
|
+
'hover:text-teal-450 focus-visible:text-teal-450 dark:hover:text-teal-200 dark:focus-visible:text-teal-200',
|
|
72
|
+
fill: 'fill-teal-500/60',
|
|
73
|
+
},
|
|
74
|
+
cyan: {
|
|
75
|
+
text: 'text-cyan-550 dark:text-cyan-300',
|
|
76
|
+
textHover:
|
|
77
|
+
'hover:text-cyan-450 focus-visible:text-cyan-450 dark:hover:text-cyan-200 dark:focus-visible:text-cyan-200',
|
|
78
|
+
fill: 'fill-cyan-500/60',
|
|
79
|
+
},
|
|
80
|
+
sky: {
|
|
81
|
+
text: 'text-sky-550 dark:text-sky-300',
|
|
82
|
+
textHover: 'hover:text-sky-450 focus-visible:text-sky-450 dark:hover:text-sky-200 dark:focus-visible:text-sky-200',
|
|
83
|
+
fill: 'fill-sky-500/60',
|
|
84
|
+
},
|
|
85
|
+
blue: {
|
|
86
|
+
text: 'text-blue-550 dark:text-blue-300',
|
|
87
|
+
textHover:
|
|
88
|
+
'hover:text-blue-450 focus-visible:text-blue-450 dark:hover:text-blue-200 dark:focus-visible:text-blue-200',
|
|
89
|
+
fill: 'fill-blue-500/60',
|
|
90
|
+
},
|
|
91
|
+
indigo: {
|
|
92
|
+
text: 'text-indigo-550 dark:text-indigo-300',
|
|
93
|
+
textHover:
|
|
94
|
+
'hover:text-indigo-450 focus-visible:text-indigo-450 dark:hover:text-indigo-200 dark:focus-visible:text-indigo-200',
|
|
95
|
+
fill: 'fill-indigo-500/60',
|
|
96
|
+
},
|
|
97
|
+
violet: {
|
|
98
|
+
text: 'text-violet-550 dark:text-violet-300',
|
|
99
|
+
textHover:
|
|
100
|
+
'hover:text-violet-450 focus-visible:text-violet-450 dark:hover:text-violet-200 dark:focus-visible:text-violet-200',
|
|
101
|
+
fill: 'fill-violet-500/60',
|
|
102
|
+
},
|
|
103
|
+
purple: {
|
|
104
|
+
text: 'text-purple-550 dark:text-purple-300',
|
|
105
|
+
textHover:
|
|
106
|
+
'hover:text-purple-450 focus-visible:text-purple-450 dark:hover:text-purple-200 dark:focus-visible:text-purple-200',
|
|
107
|
+
fill: 'fill-purple-500/60',
|
|
108
|
+
},
|
|
109
|
+
fuchsia: {
|
|
110
|
+
text: 'text-fuchsia-550 dark:text-fuchsia-300',
|
|
111
|
+
textHover:
|
|
112
|
+
'hover:text-fuchsia-450 focus-visible:text-fuchsia-450 dark:hover:text-fuchsia-200 dark:focus-visible:text-fuchsia-200',
|
|
113
|
+
fill: 'fill-fuchsia-500/60',
|
|
114
|
+
},
|
|
115
|
+
pink: {
|
|
116
|
+
text: 'text-pink-550 dark:text-pink-300',
|
|
117
|
+
textHover:
|
|
118
|
+
'hover:text-pink-450 focus-visible:text-pink-450 dark:hover:text-pink-200 dark:focus-visible:text-pink-200',
|
|
119
|
+
fill: 'fill-pink-500/60',
|
|
120
|
+
},
|
|
121
|
+
rose: {
|
|
122
|
+
text: 'text-rose-550 dark:text-rose-300',
|
|
123
|
+
textHover:
|
|
124
|
+
'hover:text-rose-450 focus-visible:text-rose-450 dark:hover:text-rose-200 dark:focus-visible:text-rose-200',
|
|
125
|
+
fill: 'fill-rose-500/60',
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const hueTokens: Record<HuePalette, HueToken> = Object.keys(hueTokenThemes).reduce(
|
|
130
|
+
(acc: Record<string, HueToken>, huePalette) => {
|
|
131
|
+
acc[huePalette] = {
|
|
132
|
+
...hueTokenThemes[huePalette as HuePalette],
|
|
133
|
+
cursorDarkValue: `${physicalColors[huePalette][hueTokenValueShades.cursorDarkValue]}88`,
|
|
134
|
+
cursorLightValue: physicalColors[huePalette][hueTokenValueShades.cursorLightValue],
|
|
135
|
+
// highlightDarkValue: physicalColors[huePalette][hueTokenValueShades.highlightDarkValue],
|
|
136
|
+
// highlightLightValue: physicalColors[huePalette][hueTokenValueShades.highlightLightValue],
|
|
137
|
+
};
|
|
138
|
+
return acc;
|
|
139
|
+
},
|
|
140
|
+
{},
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
export type HueStyleProps = {
|
|
144
|
+
hue: HuePalette;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const hueTheme: Theme<Record<string, any>> = {
|
|
148
|
+
text: ({ hue }) => hueTokenThemes[hue as HuePalette].text,
|
|
149
|
+
textHover: ({ hue }) => hueTokenThemes[hue as HuePalette].textHover,
|
|
150
|
+
fill: ({ hue }) => hueTokenThemes[hue as HuePalette].fill,
|
|
151
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export * from './arrow';
|
|
6
|
+
export * from './density';
|
|
7
|
+
export * from './dimensions';
|
|
8
|
+
export * from './disabled';
|
|
9
|
+
export * from './elevation';
|
|
10
|
+
export * from './focus';
|
|
11
|
+
export * from './group';
|
|
12
|
+
export * from './hover';
|
|
13
|
+
export * from './hue';
|
|
14
|
+
export * from './layout';
|
|
15
|
+
export * from './motion';
|
|
16
|
+
export * from './ornament';
|
|
17
|
+
export * from './selected';
|
|
18
|
+
export * from './shimmer';
|
|
19
|
+
export * from './surface';
|
|
20
|
+
export * from './size';
|
|
21
|
+
export * from './text';
|
|
22
|
+
export * from './valence';
|