@dxos/ui-theme 0.0.0 → 0.8.4-main.16b68245aa
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 +1372 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/node-esm/index.mjs +1374 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/plugin/node-cjs/main.css +1564 -0
- package/dist/plugin/node-cjs/main.css.map +7 -0
- package/dist/plugin/node-cjs/meta.json +1 -0
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +137 -0
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +7 -0
- package/dist/plugin/node-esm/main.css +1564 -0
- package/dist/plugin/node-esm/main.css.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -0
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +105 -0
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +7 -0
- package/dist/types/src/Theme.stories.d.ts +27 -0
- package/dist/types/src/Theme.stories.d.ts.map +1 -0
- package/dist/types/src/defs.d.ts +21 -0
- package/dist/types/src/defs.d.ts.map +1 -0
- package/dist/types/src/fragments/density.d.ts +4 -0
- package/dist/types/src/fragments/density.d.ts.map +1 -0
- package/dist/types/src/fragments/disabled.d.ts +3 -0
- package/dist/types/src/fragments/disabled.d.ts.map +1 -0
- package/dist/types/src/fragments/hover.d.ts +10 -0
- package/dist/types/src/fragments/hover.d.ts.map +1 -0
- package/dist/types/src/fragments/index.d.ts +5 -0
- package/dist/types/src/fragments/index.d.ts.map +1 -0
- package/dist/types/src/fragments/text.d.ts +2 -0
- package/dist/types/src/fragments/text.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/plugins/ThemePlugin.d.ts +16 -0
- package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -0
- package/dist/types/src/plugins/dark-mode.d.ts +1 -0
- package/dist/types/src/plugins/dark-mode.d.ts.map +1 -0
- package/dist/types/src/theme/components/avatar.d.ts +21 -0
- package/dist/types/src/theme/components/avatar.d.ts.map +1 -0
- package/dist/types/src/theme/components/breadcrumb.d.ts +9 -0
- package/dist/types/src/theme/components/breadcrumb.d.ts.map +1 -0
- package/dist/types/src/theme/components/button.d.ts +15 -0
- package/dist/types/src/theme/components/button.d.ts.map +1 -0
- package/dist/types/src/theme/components/card.d.ts +12 -0
- package/dist/types/src/theme/components/card.d.ts.map +1 -0
- package/dist/types/src/theme/components/dialog.d.ts +17 -0
- package/dist/types/src/theme/components/dialog.d.ts.map +1 -0
- 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 +9 -0
- package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
- package/dist/types/src/theme/components/icon.d.ts +10 -0
- package/dist/types/src/theme/components/icon.d.ts.map +1 -0
- package/dist/types/src/theme/components/index.d.ts +27 -0
- package/dist/types/src/theme/components/index.d.ts.map +1 -0
- package/dist/types/src/theme/components/input.d.ts +115 -0
- package/dist/types/src/theme/components/input.d.ts.map +1 -0
- package/dist/types/src/theme/components/link.d.ts +7 -0
- package/dist/types/src/theme/components/link.d.ts.map +1 -0
- package/dist/types/src/theme/components/list.d.ts +14 -0
- package/dist/types/src/theme/components/list.d.ts.map +1 -0
- package/dist/types/src/theme/components/main.d.ts +28 -0
- package/dist/types/src/theme/components/main.d.ts.map +1 -0
- package/dist/types/src/theme/components/menu.d.ts +13 -0
- package/dist/types/src/theme/components/menu.d.ts.map +1 -0
- package/dist/types/src/theme/components/message.d.ts +12 -0
- package/dist/types/src/theme/components/message.d.ts.map +1 -0
- package/dist/types/src/theme/components/popover.d.ts +11 -0
- package/dist/types/src/theme/components/popover.d.ts.map +1 -0
- package/dist/types/src/theme/components/scroll-area.d.ts +32 -0
- package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -0
- package/dist/types/src/theme/components/select.d.ts +13 -0
- package/dist/types/src/theme/components/select.d.ts.map +1 -0
- package/dist/types/src/theme/components/separator.d.ts +8 -0
- package/dist/types/src/theme/components/separator.d.ts.map +1 -0
- package/dist/types/src/theme/components/skeleton.d.ts +7 -0
- package/dist/types/src/theme/components/skeleton.d.ts.map +1 -0
- package/dist/types/src/theme/components/splitter.d.ts +4 -0
- package/dist/types/src/theme/components/splitter.d.ts.map +1 -0
- package/dist/types/src/theme/components/status.d.ts +9 -0
- package/dist/types/src/theme/components/status.d.ts.map +1 -0
- package/dist/types/src/theme/components/tag.d.ts +7 -0
- package/dist/types/src/theme/components/tag.d.ts.map +1 -0
- package/dist/types/src/theme/components/toast.d.ts +12 -0
- package/dist/types/src/theme/components/toast.d.ts.map +1 -0
- package/dist/types/src/theme/components/toolbar.d.ts +11 -0
- package/dist/types/src/theme/components/toolbar.d.ts.map +1 -0
- package/dist/types/src/theme/components/tooltip.d.ts +8 -0
- package/dist/types/src/theme/components/tooltip.d.ts.map +1 -0
- package/dist/types/src/theme/components/treegrid.d.ts +10 -0
- package/dist/types/src/theme/components/treegrid.d.ts.map +1 -0
- package/dist/types/src/theme/index.d.ts +4 -0
- package/dist/types/src/theme/index.d.ts.map +1 -0
- package/dist/types/src/theme/primitives/column.d.ts +29 -0
- package/dist/types/src/theme/primitives/column.d.ts.map +1 -0
- package/dist/types/src/theme/primitives/index.d.ts +3 -0
- package/dist/types/src/theme/primitives/index.d.ts.map +1 -0
- package/dist/types/src/theme/primitives/panel.d.ts +13 -0
- package/dist/types/src/theme/primitives/panel.d.ts.map +1 -0
- package/dist/types/src/theme/theme.d.ts +5 -0
- package/dist/types/src/theme/theme.d.ts.map +1 -0
- package/dist/types/src/util/elevation.d.ts +9 -0
- package/dist/types/src/util/elevation.d.ts.map +1 -0
- package/dist/types/src/util/hash-styles.d.ts +18 -0
- package/dist/types/src/util/hash-styles.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +6 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/mx.d.ts +58 -0
- package/dist/types/src/util/mx.d.ts.map +1 -0
- 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 -0
- package/package.json +30 -36
- package/src/Theme.stories.tsx +224 -0
- package/src/css/base/base.css +43 -0
- package/src/{styles/layers → css/base}/typography.css +21 -3
- package/src/{styles/layers → css/components}/button.css +23 -14
- package/src/{styles/layers → css/components}/checkbox.css +12 -8
- package/src/css/components/dialog.css +78 -0
- package/src/{styles/layers/focus-ring.css → css/components/focus.css} +60 -41
- package/src/css/components/icon.css +9 -0
- package/src/css/components/link.css +9 -0
- package/src/css/components/panel.css +117 -0
- package/src/css/components/scrollbar.css +24 -0
- package/src/css/components/selected.css +35 -0
- package/src/css/components/selected.md +101 -0
- package/src/css/components/surface.css +34 -0
- package/src/css/components/tag.css +132 -0
- package/src/css/components/text.css +124 -0
- package/src/css/integrations/codemirror.css +34 -0
- package/src/css/integrations/tldraw.css +14 -0
- package/src/css/layout/main.css +205 -0
- package/src/{styles/layers → css/layout}/native.css +6 -4
- package/src/css/layout/positioning.css +19 -0
- package/src/{styles/layers → css/layout}/size.css +130 -102
- package/src/css/theme/animation.css +260 -0
- package/src/css/theme/border.css +23 -0
- package/src/css/theme/palette.css +36 -0
- package/src/css/theme/semantic.css +116 -0
- package/src/css/theme/spacing.css +147 -0
- package/src/css/theme/styles.css +145 -0
- package/src/css/theme/text.css +37 -0
- package/src/css/utilities.css +118 -0
- package/src/defs.ts +48 -0
- package/src/fragments/AUDIT.md +57 -0
- package/src/fragments/density.ts +16 -0
- package/src/fragments/hover.ts +18 -0
- package/src/fragments/index.ts +10 -0
- package/src/fragments/text.ts +6 -0
- package/src/index.ts +3 -14
- package/src/main.css +121 -0
- package/src/plugins/ThemePlugin.ts +125 -0
- package/src/plugins/dark-mode.ts +22 -0
- package/src/plugins/main.css +45 -0
- package/src/{styles → theme}/components/avatar.ts +12 -13
- package/src/theme/components/button.ts +48 -0
- package/src/theme/components/card.ts +102 -0
- package/src/theme/components/dialog.ts +61 -0
- package/src/theme/components/focus.ts +33 -0
- package/src/{styles → theme}/components/icon-button.ts +6 -5
- package/src/theme/components/icon.ts +28 -0
- package/src/{styles → theme}/components/index.ts +4 -1
- package/src/theme/components/input.ts +171 -0
- package/src/{styles → theme}/components/link.ts +3 -4
- package/src/{styles → theme}/components/list.ts +5 -5
- package/src/{styles → theme}/components/main.ts +9 -11
- package/src/{styles → theme}/components/menu.ts +11 -21
- package/src/{styles → theme}/components/message.ts +11 -7
- package/src/{styles → theme}/components/popover.ts +13 -12
- package/src/theme/components/scroll-area.ts +115 -0
- package/src/{styles → theme}/components/select.ts +8 -16
- package/src/{styles → theme}/components/separator.ts +3 -3
- package/src/theme/components/skeleton.ts +23 -0
- package/src/theme/components/splitter.ts +20 -0
- package/src/{styles → theme}/components/status.ts +7 -7
- package/src/{styles → theme}/components/tag.ts +1 -1
- package/src/{styles → theme}/components/toast.ts +6 -8
- package/src/theme/components/toolbar.ts +35 -0
- package/src/{styles → theme}/components/tooltip.ts +4 -6
- package/src/{styles → theme}/components/treegrid.ts +9 -9
- package/src/{styles → theme}/index.ts +2 -2
- package/src/theme/primitives/column.ts +71 -0
- package/src/theme/primitives/index.ts +6 -0
- package/src/theme/primitives/panel.ts +43 -0
- package/src/{styles → theme}/theme.ts +27 -9
- package/src/typings.d.ts +3 -1
- package/src/{styles/fragments → util}/elevation.ts +6 -8
- package/src/util/hash-styles.ts +118 -98
- package/src/util/index.ts +3 -0
- package/src/util/mx.ts +165 -43
- package/src/util/size.ts +103 -0
- package/src/util/valence.ts +33 -0
- package/src/Tokens.stories.tsx +0 -88
- package/src/config/index.ts +0 -6
- package/src/config/tailwind.ts +0 -250
- package/src/config/tokens/alias-colors.ts +0 -39
- package/src/config/tokens/index.ts +0 -92
- package/src/config/tokens/lengths.ts +0 -97
- package/src/config/tokens/physical-colors.ts +0 -125
- package/src/config/tokens/semantic-colors.ts +0 -27
- package/src/config/tokens/sememes-calls.ts +0 -17
- package/src/config/tokens/sememes-codemirror.ts +0 -50
- package/src/config/tokens/sememes-hue.ts +0 -54
- package/src/config/tokens/sememes-sheet.ts +0 -62
- package/src/config/tokens/sememes-system.ts +0 -302
- package/src/config/tokens/sizes.ts +0 -7
- package/src/config/tokens/types.ts +0 -9
- package/src/docs/theme.drawio.svg +0 -635
- package/src/plugins/esbuild-plugin.ts +0 -65
- package/src/plugins/plugin.ts +0 -130
- package/src/plugins/resolveContent.ts +0 -51
- package/src/styles/components/README.md +0 -6
- package/src/styles/components/anchored-overflow.ts +0 -20
- package/src/styles/components/button.ts +0 -48
- package/src/styles/components/dialog.ts +0 -36
- package/src/styles/components/icon.ts +0 -19
- package/src/styles/components/input.ts +0 -177
- package/src/styles/components/scroll-area.ts +0 -43
- package/src/styles/components/toolbar.ts +0 -29
- package/src/styles/fragments/density.ts +0 -17
- package/src/styles/fragments/dimension.ts +0 -8
- package/src/styles/fragments/focus.ts +0 -16
- package/src/styles/fragments/group.ts +0 -12
- package/src/styles/fragments/hover.ts +0 -25
- package/src/styles/fragments/index.ts +0 -20
- package/src/styles/fragments/layout.ts +0 -7
- package/src/styles/fragments/motion.ts +0 -6
- package/src/styles/fragments/ornament.ts +0 -10
- package/src/styles/fragments/selected.ts +0 -45
- package/src/styles/fragments/shimmer.ts +0 -9
- package/src/styles/fragments/size.ts +0 -117
- package/src/styles/fragments/surface.ts +0 -29
- package/src/styles/fragments/text.ts +0 -12
- package/src/styles/fragments/valence.ts +0 -46
- package/src/styles/layers/README.md +0 -15
- package/src/styles/layers/anchored-overflow.css +0 -9
- package/src/styles/layers/animation.css +0 -17
- package/src/styles/layers/attention.css +0 -8
- package/src/styles/layers/base.css +0 -25
- package/src/styles/layers/can-scroll.css +0 -26
- package/src/styles/layers/dialog.css +0 -42
- package/src/styles/layers/drag-preview.css +0 -18
- package/src/styles/layers/hues.css +0 -110
- package/src/styles/layers/index.css +0 -26
- package/src/styles/layers/main.css +0 -160
- package/src/styles/layers/positioning.css +0 -23
- package/src/styles/layers/surfaces.css +0 -31
- package/src/styles/layers/tag.css +0 -132
- package/src/styles/layers/tldraw.css +0 -91
- package/src/styles/layers/tokens.css +0 -45
- package/src/tailwind.ts +0 -5
- package/src/theme.css +0 -9
- package/src/types.ts +0 -7
- package/src/util/withLogical.ts +0 -114
- /package/src/{styles/fragments → fragments}/disabled.ts +0 -0
- /package/src/{styles → theme}/components/breadcrumb.ts +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dialog
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@layer dx-components {
|
|
6
|
+
.dx-dialog__overlay {
|
|
7
|
+
@apply z-40 fixed grid inset-x-0 top-0 h-dvh py-[env(safe-area-inset-top)] place-items-center;
|
|
8
|
+
@apply bg-scrim-surface backdrop-blur-xs;
|
|
9
|
+
|
|
10
|
+
&[data-state='open'] {
|
|
11
|
+
@apply animate-fade-in;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&[data-state='closed'] {
|
|
15
|
+
@apply animate-fade-out;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&[data-block-align='start'] {
|
|
19
|
+
align-items: start;
|
|
20
|
+
justify-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-block-align='center'] {
|
|
24
|
+
place-items: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&[data-block-align='end'] {
|
|
28
|
+
align-items: end;
|
|
29
|
+
justify-items: center;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (width >= theme(--breakpoint-sm)) {
|
|
34
|
+
.dx-dialog__overlay {
|
|
35
|
+
@apply p-[calc(env(safe-area-inset-top)+.6rem)];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (width >= theme(--breakpoint-md)) {
|
|
40
|
+
.dx-dialog__overlay {
|
|
41
|
+
@apply p-[calc(env(safe-area-inset-top)+1.2rem)];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (width >= theme(--breakpoint-lg)) {
|
|
46
|
+
.dx-dialog__overlay {
|
|
47
|
+
@apply p-[calc(env(safe-area-inset-top)+2.4rem)];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dx-dialog__content {
|
|
52
|
+
@apply flex flex-col w-dvw max-w-full max-h-full overflow-hidden shadow-md;
|
|
53
|
+
|
|
54
|
+
&[data-state='open'] {
|
|
55
|
+
@apply animate-slide-up-and-fade;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&[data-state='closed'] {
|
|
59
|
+
@apply animate-slide-down-and-fade;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (width >= theme(--breakpoint-sm)) {
|
|
64
|
+
.dx-dialog__content {
|
|
65
|
+
@apply w-[95vw] border rounded-md border-separator;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (width >= theme(--breakpoint-md)) {
|
|
70
|
+
.dx-dialog__content {
|
|
71
|
+
@apply max-w-[24rem];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dx-dialog__title {
|
|
76
|
+
@apply shrink-0 text-xl font-medium;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,50 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Focus ring
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@layer dx-components {
|
|
2
6
|
.dx-focus-ring,
|
|
3
7
|
.dx-focus-ring-inset {
|
|
4
8
|
&:not([disabled]),
|
|
5
9
|
&[disabled='false'] {
|
|
6
10
|
&:focus {
|
|
7
|
-
@apply outline-
|
|
11
|
+
@apply outline-hidden;
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
&:focus-visible {
|
|
11
|
-
@apply ring-
|
|
15
|
+
@apply ring-focus-line ring-offset-focus-offset z-[1] ring-[var(--color-neutral-focus-indicator)];
|
|
12
16
|
|
|
13
17
|
&[data-variant='primary'] {
|
|
14
|
-
@apply ring-
|
|
18
|
+
@apply ring-[var(--color-accent-focus-indicator)];
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
&:hover {
|
|
18
|
-
@apply outline-
|
|
22
|
+
@apply outline-hidden;
|
|
19
23
|
|
|
20
24
|
.dark & {
|
|
21
|
-
@apply outline-
|
|
25
|
+
@apply outline-hidden;
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
|
|
32
|
+
.dx-focus-ring-none {
|
|
33
|
+
&:focus,
|
|
34
|
+
&:focus-visible {
|
|
35
|
+
@apply outline-hidden! ring-0!;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
.dx-focus-ring-always,
|
|
29
40
|
.dx-focus-ring-inset-always {
|
|
30
41
|
&:not([disabled]),
|
|
31
42
|
&[disabled='false'] {
|
|
32
43
|
&:focus {
|
|
33
|
-
@apply outline-
|
|
44
|
+
@apply outline-hidden;
|
|
34
45
|
}
|
|
35
46
|
|
|
36
47
|
&:focus {
|
|
37
|
-
@apply ring-
|
|
48
|
+
@apply ring-focus-line ring-offset-focus-offset z-[1] ring-[var(--color-neutral-focus-indicator)];
|
|
38
49
|
|
|
39
50
|
&[data-variant='primary'] {
|
|
40
|
-
@apply ring-
|
|
51
|
+
@apply ring-[var(--color-accent-focus-indicator)];
|
|
41
52
|
}
|
|
42
53
|
|
|
43
54
|
&:hover {
|
|
44
|
-
@apply outline-
|
|
55
|
+
@apply outline-hidden;
|
|
45
56
|
|
|
46
57
|
.dark & {
|
|
47
|
-
@apply outline-
|
|
58
|
+
@apply outline-hidden;
|
|
48
59
|
}
|
|
49
60
|
}
|
|
50
61
|
}
|
|
@@ -60,7 +71,7 @@
|
|
|
60
71
|
&:not([disabled]),
|
|
61
72
|
&[disabled='false'] {
|
|
62
73
|
&:focus {
|
|
63
|
-
@apply outline-
|
|
74
|
+
@apply outline-hidden;
|
|
64
75
|
}
|
|
65
76
|
}
|
|
66
77
|
}
|
|
@@ -68,17 +79,17 @@
|
|
|
68
79
|
.dx-focus-ring-group:focus-visible .dx-focus-ring-group-indicator,
|
|
69
80
|
.dx-focus-ring-group-x:focus-visible .dx-focus-ring-group-x-indicator,
|
|
70
81
|
.dx-focus-ring-group-y:focus-visible .dx-focus-ring-group-y-indicator {
|
|
71
|
-
@apply ring-
|
|
82
|
+
@apply ring-focus-line ring-offset-focus-offset ring-[var(--color-neutral-focus-indicator)];
|
|
72
83
|
|
|
73
84
|
&[data-variant='primary'] {
|
|
74
|
-
@apply ring-
|
|
85
|
+
@apply ring-[var(--color-accent-focus-indicator)];
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
&:hover {
|
|
78
|
-
@apply outline-
|
|
89
|
+
@apply outline-hidden;
|
|
79
90
|
|
|
80
91
|
.dark & {
|
|
81
|
-
@apply outline-
|
|
92
|
+
@apply outline-hidden;
|
|
82
93
|
}
|
|
83
94
|
}
|
|
84
95
|
}
|
|
@@ -86,17 +97,17 @@
|
|
|
86
97
|
.dx-focus-ring-group-always:focus .dx-focus-ring-group-indicator,
|
|
87
98
|
.dx-focus-ring-group-x-always:focus .dx-focus-ring-group-x-indicator,
|
|
88
99
|
.dx-focus-ring-group-y-always:focus .dx-focus-ring-group-y-indicator {
|
|
89
|
-
@apply ring-
|
|
100
|
+
@apply ring-focus-line ring-offset-focus-offset ring-[var(--color-neutral-focus-indicator)];
|
|
90
101
|
|
|
91
102
|
&[data-variant='primary'] {
|
|
92
|
-
@apply ring-
|
|
103
|
+
@apply ring-[var(--color-accent-focus-indicator)];
|
|
93
104
|
}
|
|
94
105
|
|
|
95
106
|
&:hover {
|
|
96
|
-
@apply outline-
|
|
107
|
+
@apply outline-hidden;
|
|
97
108
|
|
|
98
109
|
.dark & {
|
|
99
|
-
@apply outline-
|
|
110
|
+
@apply outline-hidden;
|
|
100
111
|
}
|
|
101
112
|
}
|
|
102
113
|
}
|
|
@@ -129,23 +140,23 @@
|
|
|
129
140
|
}
|
|
130
141
|
|
|
131
142
|
&:focus {
|
|
132
|
-
@apply outline-
|
|
143
|
+
@apply outline-hidden;
|
|
133
144
|
}
|
|
134
145
|
|
|
135
146
|
&:focus-visible {
|
|
136
147
|
&::after {
|
|
137
|
-
@apply ring-
|
|
148
|
+
@apply ring-focus-line ring-offset-focus-offset ring-inset z-[1] ring-[var(--color-neutral-focus-indicator)];
|
|
138
149
|
}
|
|
139
150
|
|
|
140
151
|
&[data-variant='primary']::after {
|
|
141
|
-
@apply ring-
|
|
152
|
+
@apply ring-[var(--color-accent-focus-indicator)];
|
|
142
153
|
}
|
|
143
154
|
|
|
144
155
|
&:hover {
|
|
145
|
-
@apply outline-
|
|
156
|
+
@apply outline-hidden;
|
|
146
157
|
|
|
147
158
|
.dark & {
|
|
148
|
-
@apply outline-
|
|
159
|
+
@apply outline-hidden;
|
|
149
160
|
}
|
|
150
161
|
}
|
|
151
162
|
}
|
|
@@ -162,30 +173,30 @@
|
|
|
162
173
|
}
|
|
163
174
|
|
|
164
175
|
&:focus {
|
|
165
|
-
@apply outline-
|
|
176
|
+
@apply outline-hidden;
|
|
166
177
|
}
|
|
167
178
|
|
|
168
179
|
&:focus {
|
|
169
180
|
&::after {
|
|
170
|
-
@apply ring-
|
|
181
|
+
@apply ring-focus-line ring-offset-focus-offset ring-inset z-[1] ring-[var(--color-neutral-focus-indicator)];
|
|
171
182
|
}
|
|
172
183
|
|
|
173
184
|
&[data-variant='primary']::after {
|
|
174
|
-
@apply ring-
|
|
185
|
+
@apply ring-[var(--color-accent-focus-indicator)];
|
|
175
186
|
}
|
|
176
187
|
|
|
177
188
|
&:hover {
|
|
178
|
-
@apply outline-
|
|
179
|
-
|
|
189
|
+
@apply outline-hidden;
|
|
180
190
|
.dark & {
|
|
181
|
-
@apply outline-
|
|
191
|
+
@apply outline-hidden;
|
|
182
192
|
}
|
|
183
193
|
}
|
|
184
194
|
}
|
|
185
195
|
}
|
|
186
196
|
}
|
|
187
197
|
|
|
188
|
-
.dx-focus-ring-inset-over-all,
|
|
198
|
+
.dx-focus-ring-inset-over-all,
|
|
199
|
+
.dx-focus-ring-inset-over-all-always {
|
|
189
200
|
&:not([disabled]),
|
|
190
201
|
&[disabled='false'] {
|
|
191
202
|
&::after {
|
|
@@ -202,23 +213,31 @@
|
|
|
202
213
|
inset: 0;
|
|
203
214
|
}
|
|
204
215
|
|
|
205
|
-
@media
|
|
206
|
-
&[data-sidebar-
|
|
207
|
-
inset-inline-start: var(--nav-sidebar-size);
|
|
216
|
+
@media (width >= theme(--breakpoint-lg)) {
|
|
217
|
+
&[data-sidebar-left-state='expanded']::after {
|
|
218
|
+
inset-inline-start: var(--dx-nav-sidebar-size);
|
|
208
219
|
}
|
|
209
220
|
|
|
210
|
-
&[data-sidebar-
|
|
211
|
-
inset-inline-start: var(--l0-size);
|
|
221
|
+
&[data-sidebar-left-state='collapsed']::after {
|
|
222
|
+
inset-inline-start: var(--dx-l0-size);
|
|
212
223
|
}
|
|
213
224
|
|
|
214
|
-
&[data-sidebar-
|
|
215
|
-
inset-inline-end: var(--complementary-sidebar-size);
|
|
225
|
+
&[data-sidebar-right-state='expanded']::after {
|
|
226
|
+
inset-inline-end: var(--dx-complementary-sidebar-size);
|
|
216
227
|
}
|
|
217
228
|
|
|
218
|
-
&[data-sidebar-
|
|
219
|
-
inset-inline-end: var(--r0-size);
|
|
229
|
+
&[data-sidebar-right-state='collapsed']::after {
|
|
230
|
+
inset-inline-end: var(--dx-r0-size);
|
|
220
231
|
}
|
|
221
232
|
}
|
|
222
233
|
}
|
|
223
234
|
}
|
|
235
|
+
|
|
236
|
+
.dx-focus-subdued {
|
|
237
|
+
@apply focus:outline-hidden focus-visible:outline-hidden focus:ring-0 ring-0 focus:border-0 border-0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.dx-focus-static {
|
|
241
|
+
@apply ring-2 ring-offset-0 ring-primary-300 ring-offset-white dark:ring-primary-400 dark:ring-offset-black;
|
|
242
|
+
}
|
|
224
243
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel — applies bg-{hue}-surface / text-{hue}-surface-text / border-{hue}-border tokens via data-hue attribute or BEM modifier.
|
|
3
|
+
* Example: <div className='dx-panel' data-hue='blue'>...</div>
|
|
4
|
+
* Example: <div className='dx-panel dx-panel--blue'>...</div>
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
@layer dx-components {
|
|
8
|
+
[data-hue='neutral'] .dx-panel,
|
|
9
|
+
.dx-panel--neutral {
|
|
10
|
+
@apply bg-neutral-surface text-neutral-surface-text border-neutral-border;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-hue='red'] .dx-panel,
|
|
14
|
+
.dx-panel--red {
|
|
15
|
+
@apply bg-red-surface text-red-surface-text border-red-border;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-hue='orange'] .dx-panel,
|
|
19
|
+
.dx-panel--orange {
|
|
20
|
+
@apply bg-orange-surface text-orange-surface-text border-orange-border;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-hue='amber'] .dx-panel,
|
|
24
|
+
.dx-panel--amber {
|
|
25
|
+
@apply bg-amber-surface text-amber-surface-text border-amber-border;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-hue='yellow'] .dx-panel,
|
|
29
|
+
.dx-panel--yellow {
|
|
30
|
+
@apply bg-yellow-surface text-yellow-surface-text border-yellow-border;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-hue='lime'] .dx-panel,
|
|
34
|
+
.dx-panel--lime {
|
|
35
|
+
@apply bg-lime-surface text-lime-surface-text border-lime-border;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-hue='green'] .dx-panel,
|
|
39
|
+
.dx-panel--green {
|
|
40
|
+
@apply bg-green-surface text-green-surface-text border-green-border;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-hue='emerald'] .dx-panel,
|
|
44
|
+
.dx-panel--emerald {
|
|
45
|
+
@apply bg-emerald-surface text-emerald-surface-text border-emerald-border;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[data-hue='teal'] .dx-panel,
|
|
49
|
+
.dx-panel--teal {
|
|
50
|
+
@apply bg-teal-surface text-teal-surface-text border-teal-border;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[data-hue='cyan'] .dx-panel,
|
|
54
|
+
.dx-panel--cyan {
|
|
55
|
+
@apply bg-cyan-surface text-cyan-surface-text border-cyan-border;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[data-hue='sky'] .dx-panel,
|
|
59
|
+
.dx-panel--sky {
|
|
60
|
+
@apply bg-sky-surface text-sky-surface-text border-sky-border;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-hue='blue'] .dx-panel,
|
|
64
|
+
.dx-panel--blue {
|
|
65
|
+
@apply bg-blue-surface text-blue-surface-text border-blue-border;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-hue='indigo'] .dx-panel,
|
|
69
|
+
.dx-panel--indigo {
|
|
70
|
+
@apply bg-indigo-surface text-indigo-surface-text border-indigo-border;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-hue='violet'] .dx-panel,
|
|
74
|
+
.dx-panel--violet {
|
|
75
|
+
@apply bg-violet-surface text-violet-surface-text border-violet-border;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[data-hue='purple'] .dx-panel,
|
|
79
|
+
.dx-panel--purple {
|
|
80
|
+
@apply bg-purple-surface text-purple-surface-text border-purple-border;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[data-hue='fuchsia'] .dx-panel,
|
|
84
|
+
.dx-panel--fuchsia {
|
|
85
|
+
@apply bg-fuchsia-surface text-fuchsia-surface-text border-fuchsia-border;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-hue='pink'] .dx-panel,
|
|
89
|
+
.dx-panel--pink {
|
|
90
|
+
@apply bg-pink-surface text-pink-surface-text border-pink-border;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-hue='rose'] .dx-panel,
|
|
94
|
+
.dx-panel--rose {
|
|
95
|
+
@apply bg-rose-surface text-rose-surface-text border-rose-border;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-hue='info'] .dx-panel,
|
|
99
|
+
.dx-panel--info {
|
|
100
|
+
@apply bg-info-surface text-info-surface-text border-info-border;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-hue='success'] .dx-panel,
|
|
104
|
+
.dx-panel--success {
|
|
105
|
+
@apply bg-success-surface text-success-surface-text border-success-border;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-hue='warning'] .dx-panel,
|
|
109
|
+
.dx-panel--warning {
|
|
110
|
+
@apply bg-warning-surface text-warning-surface-text border-warning-border;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[data-hue='error'] .dx-panel,
|
|
114
|
+
.dx-panel--error {
|
|
115
|
+
@apply bg-error-surface text-error-surface-text border-error-border;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scrolling
|
|
3
|
+
* Pseudo-classes are not supported by Tailwind.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@layer dx-components {
|
|
7
|
+
::-webkit-scrollbar-thumb:hover {
|
|
8
|
+
@apply bg-scrollbar-thumb-hover!;
|
|
9
|
+
}
|
|
10
|
+
::-webkit-scrollbar-thumb:active {
|
|
11
|
+
@apply bg-scrollbar-thumb-active!;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dx-scrollbar-thin::-webkit-scrollbar {
|
|
15
|
+
@apply w-[4px];
|
|
16
|
+
}
|
|
17
|
+
.dx-scrollbar-thin::-webkit-scrollbar-thumb {
|
|
18
|
+
@apply bg-transparent;
|
|
19
|
+
transition: background 0.15s;
|
|
20
|
+
}
|
|
21
|
+
.dx-scrollbar-thin:hover::-webkit-scrollbar-thumb {
|
|
22
|
+
@apply bg-scrollbar-thumb;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selected / Highlighted state utilities.
|
|
3
|
+
*
|
|
4
|
+
* See `./selected.md` for the ARIA pairing grammar — every class below
|
|
5
|
+
* fires off a specific attribute and silently does nothing without it.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@layer dx-components {
|
|
9
|
+
/* Pure visual affordance, no ARIA pair. Combine with dx-selected or dx-current. */
|
|
10
|
+
.dx-hover {
|
|
11
|
+
@apply cursor-pointer hover:bg-highlight-surface! hover:text-highlight-surface-text!;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Pairs with Radix-managed `data-highlighted`. Don't set the attribute manually. */
|
|
15
|
+
.dx-highlighted {
|
|
16
|
+
@apply data-[highlighted]:bg-highlight-surface
|
|
17
|
+
data-[highlighted]:text-highlight-surface-text
|
|
18
|
+
hover:data-[highlighted]:bg-highlight-surface-hover;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Pairs with `aria-current="true|page|…"`. Use for "you are here" navigation. */
|
|
22
|
+
.dx-current {
|
|
23
|
+
@apply dx-ring-pseudo
|
|
24
|
+
aria-[current=true]:bg-highlight-surface aria-[current=true]:text-highlight-surface-text
|
|
25
|
+
aria-[current=true]:after:ring-active-separator!;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Pairs with `aria-selected`. Use for listbox/option selection (master/detail). */
|
|
29
|
+
.dx-selected {
|
|
30
|
+
@apply aria-selected:bg-selected-surface
|
|
31
|
+
aria-selected:text-selected-surface-text hover:aria-selected:text-selected-surface-text
|
|
32
|
+
aria-selected:font-semibold aria-selected:tracking-normal
|
|
33
|
+
transition-[color,font-variation-settings,letter-spacing];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# `dx-*` selection / navigation grammar
|
|
2
|
+
|
|
3
|
+
Companion to `selected.css`. The four selection-state utilities below are
|
|
4
|
+
each bound to a specific ARIA attribute (or `data-*`) selector. **The
|
|
5
|
+
class only fires when the matching ARIA attribute is set on the same
|
|
6
|
+
element.** Mismatches (e.g. `dx-current` paired with `aria-selected`)
|
|
7
|
+
silently render as a plain row.
|
|
8
|
+
|
|
9
|
+
| Class | Bound selector | Pair with | Use when |
|
|
10
|
+
| ---------------- | ---------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `dx-hover` | `hover:` | (no ARIA — pure visual affordance) | Always, on any clickable row. Adds the cursor + hover bg/text. |
|
|
12
|
+
| `dx-selected` | `aria-selected:` | `aria-selected={boolean}` | A row is "the chosen one" driving a master/detail panel. Listbox / option pattern. Multi-select OK. |
|
|
13
|
+
| `dx-current` | `aria-[current=true]:` | `aria-current='true'` | A row is "where you are" in a navigation set (current page, current step). At most one current per group. The CSS variant fires only on `aria-current='true'`, so use that literal even on `<a>`/nav links. |
|
|
14
|
+
| `dx-highlighted` | `data-[highlighted]:` | Radix `data-highlighted` (managed) | A Radix-managed transient highlight (menu / combobox active option). Don't set the attribute manually. |
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
1. **Never combine `dx-selected` and `dx-current` on the same element**
|
|
19
|
+
unless you also set both `aria-selected` and `aria-current`. They
|
|
20
|
+
express different things (chosen vs you-are-here) and the visual
|
|
21
|
+
weight is similar enough that combining them defeats both.
|
|
22
|
+
2. **`aria-pressed`, `aria-checked`, `aria-expanded`, `aria-disabled`
|
|
23
|
+
are not selection-row attributes.** None of the `dx-*` selection
|
|
24
|
+
utilities pair with them. Toggle buttons (mute/unmute) want
|
|
25
|
+
`aria-pressed`; a selection row wants `aria-selected`.
|
|
26
|
+
3. **`aria-selected` is only valid on roles that admit it** — `option`,
|
|
27
|
+
`tab`, `gridcell`, `row`, `treeitem`, `columnheader`, `rowheader`.
|
|
28
|
+
On a plain `<button>` inside a `<ul role='listbox'>`, give the button
|
|
29
|
+
`role='option'` so assistive tech sees the attribute.
|
|
30
|
+
4. **`dx-active` does not exist.** If you see it in code it's a no-op
|
|
31
|
+
string. Use `dx-selected` (selection) or `dx-current` (navigation)
|
|
32
|
+
instead.
|
|
33
|
+
5. **Set ARIA before adding the class.** The class is inert without
|
|
34
|
+
the attribute; it's not a fallback styler. Reviewers should reject
|
|
35
|
+
PRs that add `dx-selected` without `aria-selected`.
|
|
36
|
+
|
|
37
|
+
## Canonical patterns
|
|
38
|
+
|
|
39
|
+
### Selectable row in a list (master/detail)
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<ul role='listbox' aria-label='…'>
|
|
43
|
+
{items.map((item) => (
|
|
44
|
+
<li key={item.id} role='presentation'>
|
|
45
|
+
<button
|
|
46
|
+
type='button'
|
|
47
|
+
role='option'
|
|
48
|
+
aria-selected={item.id === selectedId}
|
|
49
|
+
className='dx-hover dx-selected'
|
|
50
|
+
onClick={() => onSelect(item.id)}
|
|
51
|
+
>
|
|
52
|
+
{item.label}
|
|
53
|
+
</button>
|
|
54
|
+
</li>
|
|
55
|
+
))}
|
|
56
|
+
</ul>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### "You are here" in a navigation list
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<nav>
|
|
63
|
+
<ul>
|
|
64
|
+
{pages.map((page) => (
|
|
65
|
+
<li key={page.href}>
|
|
66
|
+
<a
|
|
67
|
+
href={page.href}
|
|
68
|
+
aria-current={page.href === currentHref ? 'true' : undefined}
|
|
69
|
+
className='dx-hover dx-current'
|
|
70
|
+
>
|
|
71
|
+
{page.label}
|
|
72
|
+
</a>
|
|
73
|
+
</li>
|
|
74
|
+
))}
|
|
75
|
+
</ul>
|
|
76
|
+
</nav>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Toggle button (NOT a row)
|
|
80
|
+
|
|
81
|
+
Don't reach for `dx-selected` here. Toggle buttons want their own
|
|
82
|
+
visual treatment via `aria-pressed:` variants — out of scope for this
|
|
83
|
+
file.
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<button type='button' aria-pressed={muted} onClick={toggleMute}>
|
|
87
|
+
{muted ? 'Unmute' : 'Mute'}
|
|
88
|
+
</button>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Enforcing the grammar
|
|
92
|
+
|
|
93
|
+
A future ESLint rule could flag:
|
|
94
|
+
|
|
95
|
+
- `dx-selected` without `aria-selected` on the same element.
|
|
96
|
+
- `dx-current` without `aria-current` on the same element.
|
|
97
|
+
- `dx-active` literal anywhere.
|
|
98
|
+
|
|
99
|
+
Until that exists, reviewers and the `react-ui-list` `RowList` /
|
|
100
|
+
`CardList` containers (which set both attribute and class together)
|
|
101
|
+
are the enforcement.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surfaces
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@layer dx-components {
|
|
6
|
+
.dx-base-surface {
|
|
7
|
+
@apply bg-base-surface text-base-surface-text;
|
|
8
|
+
--surface-bg: var(--color-base-surface);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dx-sidebar-surface {
|
|
12
|
+
@apply bg-sidebar-surface text-base-surface-text;
|
|
13
|
+
--surface-bg: var(--color-sidebar-surface);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dx-modal-surface {
|
|
17
|
+
@apply bg-modal-surface text-base-surface-text backdrop-blur-md;
|
|
18
|
+
--surface-bg: var(--color-modal-surface);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.dx-attention-surface {
|
|
22
|
+
@apply bg-attention-surface text-base-surface-text;
|
|
23
|
+
--surface-bg: var(--color-attention-surface);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* TODO(burdon): Resolve. */
|
|
28
|
+
/* @layer dx-tokens {
|
|
29
|
+
.dx-sidebar-surface, .dx-modal-surface {
|
|
30
|
+
--color-hover-surface: light-dark(var(--color-neutral-300), var(--color-neutral-700));
|
|
31
|
+
--color-input-surface: light-dark(var(--color-neutral-200), var(--color-neutral-800));
|
|
32
|
+
--color-separator: light-dark(var(--color-neutral-300), var(--color-neutral-700));
|
|
33
|
+
}
|
|
34
|
+
} */
|