@dxos/ui-theme 0.8.4-main.bc674ce → 0.8.4-main.c85a9c8dae
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 +556 -2523
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +556 -2523
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/plugin/node-cjs/meta.json +1 -1
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +144 -0
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +7 -0
- package/dist/plugin/node-cjs/theme.css +893 -817
- package/dist/plugin/node-cjs/theme.css.map +3 -3
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +112 -0
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +7 -0
- package/dist/plugin/node-esm/theme.css +893 -817
- package/dist/plugin/node-esm/theme.css.map +3 -3
- 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 +7 -0
- package/dist/types/src/fragments/density.d.ts.map +1 -0
- package/dist/types/src/fragments/disabled.d.ts.map +1 -0
- package/dist/types/src/{styles/fragments → fragments}/elevation.d.ts +0 -6
- package/dist/types/src/fragments/elevation.d.ts.map +1 -0
- package/dist/types/src/fragments/focus.d.ts +4 -0
- package/dist/types/src/fragments/focus.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/{styles/fragments → fragments}/index.d.ts +0 -7
- package/dist/types/src/fragments/index.d.ts.map +1 -0
- package/dist/types/src/fragments/selected.d.ts +4 -0
- package/dist/types/src/fragments/selected.d.ts.map +1 -0
- package/dist/types/src/{styles/fragments → fragments}/size.d.ts +0 -2
- package/dist/types/src/fragments/size.d.ts.map +1 -0
- package/dist/types/src/fragments/text.d.ts +7 -0
- package/dist/types/src/fragments/text.d.ts.map +1 -0
- package/dist/types/src/fragments/valence.d.ts +4 -0
- package/dist/types/src/fragments/valence.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -10
- package/dist/types/src/index.d.ts.map +1 -1
- 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.map +1 -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 +11 -0
- package/dist/types/src/theme/components/card.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/dialog.d.ts +2 -0
- package/dist/types/src/theme/components/dialog.d.ts.map +1 -0
- package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
- package/dist/types/src/theme/components/icon.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/index.d.ts +3 -1
- package/dist/types/src/theme/components/index.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/input.d.ts +25 -21
- package/dist/types/src/theme/components/input.d.ts.map +1 -0
- package/dist/types/src/theme/components/link.d.ts.map +1 -0
- package/dist/types/src/theme/components/list.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/main.d.ts +2 -7
- package/dist/types/src/theme/components/main.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/menu.d.ts +1 -1
- package/dist/types/src/theme/components/menu.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/message.d.ts +1 -0
- package/dist/types/src/theme/components/message.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/popover.d.ts +1 -1
- package/dist/types/src/theme/components/popover.d.ts.map +1 -0
- package/dist/types/src/theme/components/scroll-area.d.ts +22 -0
- package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -0
- package/dist/types/src/theme/components/select.d.ts.map +1 -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.map +1 -0
- package/dist/types/src/theme/components/tag.d.ts.map +1 -0
- package/dist/types/src/theme/components/toast.d.ts.map +1 -0
- package/dist/types/src/theme/components/toolbar.d.ts +12 -0
- package/dist/types/src/theme/components/toolbar.d.ts.map +1 -0
- package/dist/types/src/theme/components/tooltip.d.ts.map +1 -0
- package/dist/types/src/theme/components/treegrid.d.ts.map +1 -0
- package/dist/types/src/theme/index.d.ts +3 -0
- package/dist/types/src/theme/index.d.ts.map +1 -0
- package/dist/types/src/theme/primitives/column.d.ts +7 -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 +9 -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/hash-styles.d.ts +8 -5
- package/dist/types/src/util/hash-styles.d.ts.map +1 -1
- package/dist/types/src/util/mx.d.ts +8 -0
- package/dist/types/src/util/mx.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -27
- package/src/Theme.stories.tsx +224 -0
- package/src/css/base/base.css +43 -0
- package/src/{styles/layers → css/base}/typography.css +3 -5
- package/src/{styles/layers → css/components}/button.css +22 -14
- package/src/{styles/layers → css/components}/checkbox.css +12 -8
- package/src/{styles/layers → css/components}/dialog.css +16 -15
- package/src/{styles/layers → css/components}/focus-ring.css +45 -40
- 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/surface.css +34 -0
- package/src/css/components/tag.css +130 -0
- package/src/css/components/text.css +124 -0
- package/src/css/integrations/codemirror.css +32 -0
- package/src/css/integrations/tldraw.css +13 -0
- package/src/css/layout/main.css +212 -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 +137 -108
- package/src/css/theme/animation.css +229 -0
- package/src/css/theme/border.css +23 -0
- package/src/css/theme/palette.css +28 -0
- package/src/css/theme/semantic.css +100 -0
- package/src/css/theme/spacing.css +130 -0
- package/src/css/theme/styles.css +145 -0
- package/src/css/theme/text.css +37 -0
- package/src/css/utilities.css +7 -0
- package/src/defs.ts +48 -0
- package/src/fragments/density.ts +13 -0
- package/src/{styles/fragments → fragments}/elevation.ts +6 -8
- package/src/fragments/focus.ts +11 -0
- package/src/fragments/hover.ts +18 -0
- package/src/{styles/fragments → fragments}/index.ts +2 -7
- package/src/fragments/selected.ts +12 -0
- package/src/fragments/size.ts +117 -0
- package/src/fragments/text.ts +11 -0
- package/src/fragments/valence.ts +33 -0
- package/src/index.ts +3 -14
- package/src/plugins/ThemePlugin.ts +137 -0
- package/src/plugins/dark-mode.ts +22 -0
- package/src/{styles → theme}/components/avatar.ts +11 -11
- package/src/theme/components/button.ts +48 -0
- package/src/theme/components/card.ts +94 -0
- package/src/{styles → theme}/components/dialog.ts +18 -10
- package/src/{styles → theme}/components/icon-button.ts +1 -1
- package/src/{styles → theme}/components/icon.ts +2 -2
- package/src/{styles → theme}/components/index.ts +3 -1
- package/src/theme/components/input.ts +186 -0
- package/src/{styles → theme}/components/link.ts +3 -3
- package/src/{styles → theme}/components/list.ts +3 -3
- package/src/{styles → theme}/components/main.ts +2 -6
- package/src/{styles → theme}/components/menu.ts +9 -19
- package/src/{styles → theme}/components/message.ts +11 -6
- package/src/{styles → theme}/components/popover.ts +13 -11
- package/src/theme/components/scroll-area.ts +103 -0
- package/src/{styles → theme}/components/select.ts +7 -14
- 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 +5 -5
- package/src/{styles → theme}/components/tag.ts +1 -1
- package/src/{styles → theme}/components/toast.ts +5 -6
- package/src/theme/components/toolbar.ts +41 -0
- package/src/{styles → theme}/components/tooltip.ts +4 -5
- package/src/{styles → theme}/components/treegrid.ts +8 -8
- package/src/{styles → theme}/index.ts +1 -2
- package/src/theme/primitives/column.ts +30 -0
- package/src/theme/primitives/index.ts +6 -0
- package/src/theme/primitives/panel.ts +47 -0
- package/src/{styles → theme}/theme.ts +25 -9
- package/src/theme.css +78 -4
- package/src/typings.d.ts +0 -1
- package/src/util/hash-styles.ts +118 -98
- package/src/util/mx.ts +54 -43
- package/dist/plugin/node-cjs/chunk-UUMDOU7E.cjs +0 -79
- package/dist/plugin/node-cjs/chunk-UUMDOU7E.cjs.map +0 -7
- package/dist/plugin/node-cjs/chunk-ZVALPM6U.cjs +0 -1619
- package/dist/plugin/node-cjs/chunk-ZVALPM6U.cjs.map +0 -7
- package/dist/plugin/node-cjs/config/tailwind.cjs +0 -29
- package/dist/plugin/node-cjs/config/tailwind.cjs.map +0 -7
- package/dist/plugin/node-cjs/plugins/esbuild-plugin.cjs +0 -90
- package/dist/plugin/node-cjs/plugins/esbuild-plugin.cjs.map +0 -7
- package/dist/plugin/node-cjs/plugins/plugin.cjs +0 -124
- package/dist/plugin/node-cjs/plugins/plugin.cjs.map +0 -7
- package/dist/plugin/node-esm/chunk-AFRHJHP4.mjs +0 -49
- package/dist/plugin/node-esm/chunk-AFRHJHP4.mjs.map +0 -7
- package/dist/plugin/node-esm/chunk-HJE6EZWE.mjs +0 -1614
- package/dist/plugin/node-esm/chunk-HJE6EZWE.mjs.map +0 -7
- package/dist/plugin/node-esm/config/tailwind.mjs +0 -8
- package/dist/plugin/node-esm/config/tailwind.mjs.map +0 -7
- package/dist/plugin/node-esm/plugins/esbuild-plugin.mjs +0 -63
- package/dist/plugin/node-esm/plugins/esbuild-plugin.mjs.map +0 -7
- package/dist/plugin/node-esm/plugins/plugin.mjs +0 -98
- package/dist/plugin/node-esm/plugins/plugin.mjs.map +0 -7
- package/dist/types/src/Tokens.stories.d.ts +0 -10
- package/dist/types/src/Tokens.stories.d.ts.map +0 -1
- package/dist/types/src/config/index.d.ts +0 -3
- package/dist/types/src/config/index.d.ts.map +0 -1
- package/dist/types/src/config/tailwind.d.ts +0 -9
- package/dist/types/src/config/tailwind.d.ts.map +0 -1
- package/dist/types/src/config/tokens/alias-colors.d.ts +0 -21
- package/dist/types/src/config/tokens/alias-colors.d.ts.map +0 -1
- package/dist/types/src/config/tokens/index.d.ts +0 -486
- package/dist/types/src/config/tokens/index.d.ts.map +0 -1
- package/dist/types/src/config/tokens/lengths.d.ts +0 -139
- package/dist/types/src/config/tokens/lengths.d.ts.map +0 -1
- package/dist/types/src/config/tokens/physical-colors.d.ts +0 -23
- package/dist/types/src/config/tokens/physical-colors.d.ts.map +0 -1
- package/dist/types/src/config/tokens/semantic-colors.d.ts +0 -187
- package/dist/types/src/config/tokens/semantic-colors.d.ts.map +0 -1
- package/dist/types/src/config/tokens/sememes-calls.d.ts +0 -3
- package/dist/types/src/config/tokens/sememes-calls.d.ts.map +0 -1
- package/dist/types/src/config/tokens/sememes-codemirror.d.ts +0 -43
- package/dist/types/src/config/tokens/sememes-codemirror.d.ts.map +0 -1
- package/dist/types/src/config/tokens/sememes-hue.d.ts +0 -4
- package/dist/types/src/config/tokens/sememes-hue.d.ts.map +0 -1
- package/dist/types/src/config/tokens/sememes-sheet.d.ts +0 -58
- package/dist/types/src/config/tokens/sememes-sheet.d.ts.map +0 -1
- package/dist/types/src/config/tokens/sememes-system.d.ts +0 -99
- package/dist/types/src/config/tokens/sememes-system.d.ts.map +0 -1
- package/dist/types/src/config/tokens/sizes.d.ts +0 -7
- package/dist/types/src/config/tokens/sizes.d.ts.map +0 -1
- package/dist/types/src/config/tokens/types.d.ts +0 -5
- package/dist/types/src/config/tokens/types.d.ts.map +0 -1
- package/dist/types/src/plugins/esbuild-plugin.d.ts +0 -9
- package/dist/types/src/plugins/esbuild-plugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin.d.ts +0 -20
- package/dist/types/src/plugins/plugin.d.ts.map +0 -1
- package/dist/types/src/plugins/resolveContent.d.ts +0 -2
- package/dist/types/src/plugins/resolveContent.d.ts.map +0 -1
- package/dist/types/src/styles/components/anchored-overflow.d.ts +0 -6
- package/dist/types/src/styles/components/anchored-overflow.d.ts.map +0 -1
- package/dist/types/src/styles/components/avatar.d.ts.map +0 -1
- package/dist/types/src/styles/components/breadcrumb.d.ts.map +0 -1
- package/dist/types/src/styles/components/button.d.ts +0 -19
- package/dist/types/src/styles/components/button.d.ts.map +0 -1
- package/dist/types/src/styles/components/dialog.d.ts.map +0 -1
- package/dist/types/src/styles/components/icon-button.d.ts.map +0 -1
- package/dist/types/src/styles/components/icon.d.ts.map +0 -1
- package/dist/types/src/styles/components/index.d.ts.map +0 -1
- package/dist/types/src/styles/components/input.d.ts.map +0 -1
- package/dist/types/src/styles/components/link.d.ts.map +0 -1
- package/dist/types/src/styles/components/list.d.ts.map +0 -1
- package/dist/types/src/styles/components/main.d.ts.map +0 -1
- package/dist/types/src/styles/components/menu.d.ts.map +0 -1
- package/dist/types/src/styles/components/message.d.ts.map +0 -1
- package/dist/types/src/styles/components/popover.d.ts.map +0 -1
- package/dist/types/src/styles/components/scroll-area.d.ts +0 -9
- package/dist/types/src/styles/components/scroll-area.d.ts.map +0 -1
- package/dist/types/src/styles/components/select.d.ts.map +0 -1
- package/dist/types/src/styles/components/separator.d.ts.map +0 -1
- package/dist/types/src/styles/components/status.d.ts.map +0 -1
- package/dist/types/src/styles/components/tag.d.ts.map +0 -1
- package/dist/types/src/styles/components/toast.d.ts.map +0 -1
- package/dist/types/src/styles/components/toolbar.d.ts +0 -11
- package/dist/types/src/styles/components/toolbar.d.ts.map +0 -1
- package/dist/types/src/styles/components/tooltip.d.ts.map +0 -1
- package/dist/types/src/styles/components/treegrid.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/density.d.ts +0 -13
- package/dist/types/src/styles/fragments/density.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/dimension.d.ts +0 -5
- package/dist/types/src/styles/fragments/dimension.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/disabled.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/elevation.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/focus.d.ts +0 -6
- package/dist/types/src/styles/fragments/focus.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/group.d.ts +0 -5
- package/dist/types/src/styles/fragments/group.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/hover.d.ts +0 -17
- package/dist/types/src/styles/fragments/hover.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/index.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/layout.d.ts +0 -3
- package/dist/types/src/styles/fragments/layout.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/motion.d.ts +0 -2
- package/dist/types/src/styles/fragments/motion.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/ornament.d.ts +0 -5
- package/dist/types/src/styles/fragments/ornament.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/selected.d.ts +0 -13
- package/dist/types/src/styles/fragments/selected.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/shimmer.d.ts +0 -3
- package/dist/types/src/styles/fragments/shimmer.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/size.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/surface.d.ts +0 -9
- package/dist/types/src/styles/fragments/surface.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/text.d.ts +0 -7
- package/dist/types/src/styles/fragments/text.d.ts.map +0 -1
- package/dist/types/src/styles/fragments/valence.d.ts +0 -13
- package/dist/types/src/styles/fragments/valence.d.ts.map +0 -1
- package/dist/types/src/styles/index.d.ts +0 -4
- package/dist/types/src/styles/index.d.ts.map +0 -1
- package/dist/types/src/styles/theme.d.ts +0 -5
- package/dist/types/src/styles/theme.d.ts.map +0 -1
- package/dist/types/src/tailwind.d.ts +0 -3
- package/dist/types/src/tailwind.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -3
- package/dist/types/src/types.d.ts.map +0 -1
- package/dist/types/src/util/withLogical.d.ts +0 -164
- package/dist/types/src/util/withLogical.d.ts.map +0 -1
- package/src/Tokens.stories.tsx +0 -88
- package/src/config/index.ts +0 -6
- package/src/config/tailwind.ts +0 -264
- 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 -10
- 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/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/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/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 -227
- 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 -46
- package/src/tailwind.ts +0 -7
- package/src/types.ts +0 -7
- package/src/util/withLogical.ts +0 -114
- /package/dist/types/src/{styles/fragments → fragments}/disabled.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/avatar.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/breadcrumb.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/icon-button.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/icon.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/link.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/list.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/select.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/separator.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/status.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/tag.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/toast.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/tooltip.d.ts +0 -0
- /package/dist/types/src/{styles → theme}/components/treegrid.d.ts +0 -0
- /package/src/{styles/fragments → fragments}/disabled.ts +0 -0
- /package/src/{styles → theme}/components/breadcrumb.ts +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type AllowedAxis, type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type ScrollAreaStyleProps = {
|
|
10
|
+
orientation?: AllowedAxis;
|
|
11
|
+
autoHide?: boolean;
|
|
12
|
+
/** Balance left/right, top/bottom "margin" with scrollbar. */
|
|
13
|
+
margin?: boolean;
|
|
14
|
+
/** Add default padding. */
|
|
15
|
+
/** TODO(burdon): Integrate with Column.Root padding. */
|
|
16
|
+
padding?: boolean;
|
|
17
|
+
/** Use thin scrollbars. */
|
|
18
|
+
/** TODO(burdon): Density fine/course. */
|
|
19
|
+
thin?: boolean;
|
|
20
|
+
/** Enable snap scrolling. */
|
|
21
|
+
snap?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const scrollAreaRoot: ComponentFunction<ScrollAreaStyleProps> = ({ orientation, margin, thin }, ...etc) =>
|
|
25
|
+
mx(
|
|
26
|
+
'overflow-hidden',
|
|
27
|
+
|
|
28
|
+
orientation === 'vertical' && 'group/scroll-v dx-container',
|
|
29
|
+
orientation === 'horizontal' && 'group/scroll-h dx-container',
|
|
30
|
+
orientation === 'all' && 'group/scroll-all dx-container',
|
|
31
|
+
|
|
32
|
+
// TODO(burdon): Audit composition.
|
|
33
|
+
// Apply col-span-full only when inside a Column.Root grid (detected via dx-column marker).
|
|
34
|
+
'[.dx-column_&]:col-span-full',
|
|
35
|
+
|
|
36
|
+
// NOTE: Uses --gutter CSS variable
|
|
37
|
+
// If contained within Column.Root grid, the gutter is set by that component.
|
|
38
|
+
margin && [
|
|
39
|
+
orientation === 'vertical' &&
|
|
40
|
+
(thin
|
|
41
|
+
? 'pl-[var(--gutter,4px)] pr-[calc(var(--gutter,4px)-4px)]'
|
|
42
|
+
: 'pl-[var(--gutter,8px)] pr-[calc(var(--gutter,8px)-8px)]'),
|
|
43
|
+
orientation === 'horizontal' && (thin ? 'py-[var(--gutter,4px)]' : 'py-[var(--gutter,8px)]'),
|
|
44
|
+
orientation === 'all' &&
|
|
45
|
+
(thin ? 'pl-[var(--gutter,4px)] py-[var(--gutter,8px)]' : 'pl-[var(--gutter,8px)] py-[var(--gutter,8px)]'),
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
...etc,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* NOTE: The browser reserves space for scrollbars.
|
|
53
|
+
*/
|
|
54
|
+
export const scrollAreaViewport: ComponentFunction<ScrollAreaStyleProps> = (
|
|
55
|
+
{ orientation, autoHide, padding, snap, thin },
|
|
56
|
+
...etc
|
|
57
|
+
) =>
|
|
58
|
+
mx(
|
|
59
|
+
'h-full w-full',
|
|
60
|
+
|
|
61
|
+
orientation === 'vertical' && 'flex flex-col overflow-y-scroll',
|
|
62
|
+
orientation === 'horizontal' && 'flex overflow-x-scroll',
|
|
63
|
+
orientation === 'all' && 'overflow-scroll',
|
|
64
|
+
|
|
65
|
+
thin
|
|
66
|
+
? '[&::-webkit-scrollbar]:w-[4px] [&::-webkit-scrollbar]:h-[4px]'
|
|
67
|
+
: '[&::-webkit-scrollbar]:w-[8px] [&::-webkit-scrollbar]:h-[8px]',
|
|
68
|
+
|
|
69
|
+
'[&::-webkit-scrollbar-corner]:bg-transparent',
|
|
70
|
+
'[&::-webkit-scrollbar-track]:bg-transparent',
|
|
71
|
+
'[&::-webkit-scrollbar-thumb]:rounded-none',
|
|
72
|
+
|
|
73
|
+
autoHide
|
|
74
|
+
? [
|
|
75
|
+
orientation === 'vertical' && 'group-hover/scroll-v:[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
76
|
+
orientation === 'horizontal' && 'group-hover/scroll-h:[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
77
|
+
orientation === 'all' && 'group-hover/scroll-all:[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
78
|
+
]
|
|
79
|
+
: [
|
|
80
|
+
orientation === 'vertical' && '[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
81
|
+
orientation === 'horizontal' && '[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
82
|
+
orientation === 'all' && '[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
83
|
+
],
|
|
84
|
+
|
|
85
|
+
padding && [
|
|
86
|
+
orientation === 'vertical' && 'px-[4px]',
|
|
87
|
+
orientation === 'horizontal' && 'pb-[4px]',
|
|
88
|
+
orientation === 'all' && 'pl-[4px] pb-[4px]',
|
|
89
|
+
],
|
|
90
|
+
|
|
91
|
+
snap && [
|
|
92
|
+
orientation === 'vertical' && 'snap-y snap-mandatory',
|
|
93
|
+
orientation === 'horizontal' && 'snap-x snap-mandatory',
|
|
94
|
+
orientation === 'all' && 'snap-both snap-mandatory',
|
|
95
|
+
],
|
|
96
|
+
|
|
97
|
+
...etc,
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
export const scrollAreaTheme: Theme<ScrollAreaStyleProps> = {
|
|
101
|
+
root: scrollAreaRoot,
|
|
102
|
+
viewport: scrollAreaViewport,
|
|
103
|
+
};
|
|
@@ -4,15 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
+
import { ghostHighlighted, surfaceShadow, surfaceZIndex } from '../../fragments';
|
|
7
8
|
import { mx } from '../../util';
|
|
8
|
-
import {
|
|
9
|
-
blockSeparator,
|
|
10
|
-
ghostHighlighted,
|
|
11
|
-
modalSurface,
|
|
12
|
-
separatorBorderColor,
|
|
13
|
-
surfaceShadow,
|
|
14
|
-
surfaceZIndex,
|
|
15
|
-
} from '../fragments';
|
|
16
9
|
|
|
17
10
|
export type SelectStyleProps = Partial<{
|
|
18
11
|
elevation: Elevation;
|
|
@@ -20,8 +13,8 @@ export type SelectStyleProps = Partial<{
|
|
|
20
13
|
|
|
21
14
|
export const selectContent: ComponentFunction<SelectStyleProps> = ({ elevation }, ...etc) => {
|
|
22
15
|
return mx(
|
|
23
|
-
'
|
|
24
|
-
|
|
16
|
+
'dx-modal-surface rounded-sm border border-separator',
|
|
17
|
+
'min-w-(--radix-select-trigger-width) max-h-(--radix-select-content-available-height)',
|
|
25
18
|
surfaceShadow({ elevation: 'positioned' }),
|
|
26
19
|
surfaceZIndex({ elevation, level: 'menu' }),
|
|
27
20
|
...etc,
|
|
@@ -32,8 +25,8 @@ export const selectViewport: ComponentFunction<SelectStyleProps> = (_props, ...e
|
|
|
32
25
|
|
|
33
26
|
export const selectItem: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
34
27
|
mx(
|
|
35
|
-
'flex items-center min-
|
|
36
|
-
'text-
|
|
28
|
+
'flex items-center min-h-[2rem] px-3 py-1 gap-2',
|
|
29
|
+
'text-base-surface-text leading-none select-none outline-hidden',
|
|
37
30
|
'[&>svg]:invisible [&[data-state=checked]>svg]:visible',
|
|
38
31
|
ghostHighlighted,
|
|
39
32
|
...etc,
|
|
@@ -44,10 +37,10 @@ export const selectItemIndicator: ComponentFunction<SelectStyleProps> = (_props,
|
|
|
44
37
|
export const selectArrow: ComponentFunction<SelectStyleProps> = (_props, ...etc) => mx('fill-separator', ...etc);
|
|
45
38
|
|
|
46
39
|
export const selectSeparator: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
47
|
-
mx(
|
|
40
|
+
mx('self-stretch border-b my-1 border-separator', ...etc);
|
|
48
41
|
|
|
49
42
|
export const selectScrollButton: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
50
|
-
mx(
|
|
43
|
+
mx('dx-modal-surface flex items-center justify-center cursor-default h-6 w-full', ...etc);
|
|
51
44
|
|
|
52
45
|
export const selectTheme: Theme<SelectStyleProps> = {
|
|
53
46
|
content: selectContent,
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import { type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
7
|
import { mx } from '../../util';
|
|
8
|
-
import { blockSeparator, inlineSeparator, separatorBorderColor, subduedSeparatorBorderColor } from '../fragments';
|
|
9
8
|
|
|
10
9
|
export type SeparatorStyleProps = {
|
|
11
10
|
orientation?: 'horizontal' | 'vertical';
|
|
@@ -14,8 +13,9 @@ export type SeparatorStyleProps = {
|
|
|
14
13
|
|
|
15
14
|
export const separatorRoot: ComponentFunction<SeparatorStyleProps> = ({ orientation, subdued }, ...etc) =>
|
|
16
15
|
mx(
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
'self-stretch',
|
|
17
|
+
orientation === 'vertical' ? 'border-e mx-1' : 'border-b my-1',
|
|
18
|
+
subdued ? 'border-subdued-separator' : 'border-separator',
|
|
19
19
|
...etc,
|
|
20
20
|
);
|
|
21
21
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { ComponentFunction, Theme } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type SkeletonStyleProps = {
|
|
10
|
+
variant?: 'default' | 'circle' | 'text';
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const skeletonRoot: ComponentFunction<SkeletonStyleProps> = ({ variant = 'default' }, ...etc) =>
|
|
14
|
+
mx(
|
|
15
|
+
'animate-pulse bg-neutral-300 dark:bg-neutral-700 rounded-md',
|
|
16
|
+
variant === 'circle' && 'rounded-full',
|
|
17
|
+
variant === 'text' && 'rounded-sm',
|
|
18
|
+
...etc,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const skeletonTheme: Theme<SkeletonStyleProps> = {
|
|
22
|
+
root: skeletonRoot,
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type SplitterStyleProps = {};
|
|
10
|
+
|
|
11
|
+
const splitterRoot: ComponentFunction<SplitterStyleProps> = (_props, ...etc) =>
|
|
12
|
+
mx('relative h-full overflow-hidden', ...etc);
|
|
13
|
+
|
|
14
|
+
const splitterPanel: ComponentFunction<SplitterStyleProps> = (_props, ...etc) =>
|
|
15
|
+
mx('absolute inset-x-0 flex flex-col overflow-hidden', ...etc);
|
|
16
|
+
|
|
17
|
+
export const splitterTheme: Theme<SplitterStyleProps> = {
|
|
18
|
+
root: splitterRoot,
|
|
19
|
+
panel: splitterPanel,
|
|
20
|
+
};
|
|
@@ -13,16 +13,16 @@ export type StatusStyleProps = {
|
|
|
13
13
|
|
|
14
14
|
export const statusRoot: ComponentFunction<StatusStyleProps> = ({ variant = 'default' }, ...etc) =>
|
|
15
15
|
mx(
|
|
16
|
-
'
|
|
17
|
-
variant === 'main-bottom' ? '
|
|
16
|
+
'h-1 relative bg-hover-overlay rounded-full overflow-hidden',
|
|
17
|
+
variant === 'main-bottom' ? 'w-full block' : 'inline-20 inline-block',
|
|
18
18
|
...etc,
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
export const statusBar: ComponentFunction<StatusStyleProps> = ({ indeterminate, variant = 'default' }, ...etc) =>
|
|
22
22
|
mx(
|
|
23
|
-
'absolute inset-
|
|
24
|
-
variant === 'main-bottom' ? 'bg-
|
|
25
|
-
indeterminate ? 'animate-progress-indeterminate' : '
|
|
23
|
+
'absolute inset-y-0 block rounded-full',
|
|
24
|
+
variant === 'main-bottom' ? 'bg-accent-surface' : 'bg-un-accent',
|
|
25
|
+
indeterminate ? 'animate-progress-indeterminate' : 'start-0',
|
|
26
26
|
...etc,
|
|
27
27
|
);
|
|
28
28
|
|
|
@@ -16,7 +16,7 @@ export type TagStyleProps = {
|
|
|
16
16
|
palette?: ChromaticPalette | NeutralPalette | MessageValence;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
export const tagRoot: ComponentFunction<TagStyleProps> = (
|
|
19
|
+
export const tagRoot: ComponentFunction<TagStyleProps> = (_, ...etc) => mx('dx-tag', ...etc);
|
|
20
20
|
|
|
21
21
|
export const tagTheme: Theme<TagStyleProps> = {
|
|
22
22
|
root: tagRoot,
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
+
import { focusRing, surfaceShadow } from '../../fragments';
|
|
7
8
|
import { mx } from '../../util';
|
|
8
|
-
import { descriptionText, focusRing, modalSurface, surfaceShadow } from '../fragments';
|
|
9
9
|
|
|
10
10
|
export type ToastStyleProps = Partial<{
|
|
11
11
|
srOnly: boolean;
|
|
@@ -14,15 +14,14 @@ export type ToastStyleProps = Partial<{
|
|
|
14
14
|
export const toastViewport: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
15
15
|
mx(
|
|
16
16
|
// TODO(burdon): block-end should take into account status bar.
|
|
17
|
-
'z-40 fixed
|
|
17
|
+
'z-40 fixed bottom-[calc(env(safe-area-inset-bottom)+1rem)] inset-start-[calc(env(safe-area-inset-left)+1rem)] inset-end-[calc(env(safe-area-inset-right)+1rem)] w-auto md:end-[calc(env(safe-area-inset-right)+1rem)] md:left-auto md:w-full md:max-w-sm',
|
|
18
18
|
'rounded-md flex flex-col gap-2',
|
|
19
19
|
...etc,
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
export const toastRoot: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
23
23
|
mx(
|
|
24
|
-
'rounded-md flex p-2 gap-2',
|
|
25
|
-
modalSurface,
|
|
24
|
+
'dx-modal-surface rounded-md flex p-2 gap-2',
|
|
26
25
|
surfaceShadow({ elevation: 'toast' }),
|
|
27
26
|
'radix-state-open:animate-toast-slide-in-bottom md:radix-state-open:animate-toast-slide-in-right',
|
|
28
27
|
'radix-state-closed:animate-toast-hide',
|
|
@@ -34,7 +33,7 @@ export const toastRoot: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
|
34
33
|
);
|
|
35
34
|
|
|
36
35
|
export const toastBody: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
37
|
-
mx('grow flex flex-col gap-1 justify-center
|
|
36
|
+
mx('grow flex flex-col gap-1 justify-center pl-2', ...etc);
|
|
38
37
|
|
|
39
38
|
export const toastActions: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
|
|
40
39
|
mx('shrink-0 flex flex-col gap-1 justify-center', ...etc);
|
|
@@ -43,7 +42,7 @@ export const toastTitle: ComponentFunction<ToastStyleProps> = ({ srOnly }, ...et
|
|
|
43
42
|
mx('shrink-0 font-medium', srOnly && 'sr-only', ...etc);
|
|
44
43
|
|
|
45
44
|
export const toastDescription: ComponentFunction<ToastStyleProps> = ({ srOnly }, ...etc) =>
|
|
46
|
-
mx(
|
|
45
|
+
mx('text-description', 'shrink-0', srOnly && 'sr-only', ...etc);
|
|
47
46
|
|
|
48
47
|
export const toastTheme: Theme<ToastStyleProps> = {
|
|
49
48
|
viewport: toastViewport,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Density, type Theme } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { textBlockWidth } from '../../fragments';
|
|
8
|
+
import { mx } from '../../util';
|
|
9
|
+
|
|
10
|
+
export type ToolbarStyleProps = Partial<{
|
|
11
|
+
density: Density;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
layoutManaged: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export const toolbarLayout =
|
|
17
|
+
'w-full shrink-0 flex flex-nowrap p-1 gap-1 items-center overflow-x-auto scrollbar-none dx-contain-layout';
|
|
18
|
+
|
|
19
|
+
export const toolbarRoot: ComponentFunction<ToolbarStyleProps> = ({ density, disabled, layoutManaged }, ...etc) => {
|
|
20
|
+
return mx(
|
|
21
|
+
'bg-toolbar-surface dx-toolbar',
|
|
22
|
+
density === 'coarse' && 'h-(--dx-rail-size) px-3!',
|
|
23
|
+
disabled && '*:opacity-20',
|
|
24
|
+
!layoutManaged && toolbarLayout,
|
|
25
|
+
...etc,
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const toolbarInner: ComponentFunction<ToolbarStyleProps> = ({ layoutManaged }, ...etc) => {
|
|
30
|
+
return mx(!layoutManaged && ['flex gap-1', textBlockWidth], ...etc);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const toolbarText: ComponentFunction<ToolbarStyleProps> = (_, ...etc) => {
|
|
34
|
+
return mx('grow truncate items-center', textBlockWidth, ...etc);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const toolbarTheme: Theme<ToolbarStyleProps> = {
|
|
38
|
+
root: toolbarRoot,
|
|
39
|
+
inner: toolbarInner,
|
|
40
|
+
text: toolbarText,
|
|
41
|
+
};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
+
import { surfaceShadow, surfaceZIndex } from '../../fragments';
|
|
7
8
|
import { mx } from '../../util';
|
|
8
|
-
import { chromeText, popperMotion, surfaceShadow, surfaceZIndex } from '../fragments';
|
|
9
9
|
|
|
10
10
|
export type TooltipStyleProps = Partial<{
|
|
11
11
|
elevation: Elevation;
|
|
@@ -13,15 +13,14 @@ export type TooltipStyleProps = Partial<{
|
|
|
13
13
|
|
|
14
14
|
export const tooltipContent: ComponentFunction<TooltipStyleProps> = ({ elevation }, ...etc) =>
|
|
15
15
|
mx(
|
|
16
|
-
'inline-flex items-center
|
|
17
|
-
popperMotion,
|
|
16
|
+
'inline-flex items-center p-1 max-w-64 text-sm bg-inverse-surface text-inverse-surface-text rounded-sm',
|
|
18
17
|
surfaceShadow({ elevation: 'positioned' }),
|
|
19
18
|
surfaceZIndex({ elevation, level: 'tooltip' }),
|
|
20
|
-
chromeText,
|
|
21
19
|
...etc,
|
|
22
20
|
);
|
|
23
21
|
|
|
24
|
-
export const tooltipArrow: ComponentFunction<TooltipStyleProps> = (_props, ...etc) =>
|
|
22
|
+
export const tooltipArrow: ComponentFunction<TooltipStyleProps> = (_props, ...etc) =>
|
|
23
|
+
mx('fill-inverse-surface', ...etc);
|
|
25
24
|
|
|
26
25
|
export const tooltipTheme: Theme<TooltipStyleProps> = {
|
|
27
26
|
content: tooltipContent,
|
|
@@ -12,14 +12,14 @@ export type TreegridStyleProps = Partial<{
|
|
|
12
12
|
}>;
|
|
13
13
|
|
|
14
14
|
const levelStyles = new Map<number, string>([
|
|
15
|
-
[1, '[&>.indent:first-of-type]:
|
|
16
|
-
[2, '[&>.indent:first-of-type]:
|
|
17
|
-
[3, '[&>.indent:first-of-type]:
|
|
18
|
-
[4, '[&>.indent:first-of-type]:
|
|
19
|
-
[5, '[&>.indent:first-of-type]:
|
|
20
|
-
[6, '[&>.indent:first-of-type]:
|
|
21
|
-
[7, '[&>.indent:first-of-type]:
|
|
22
|
-
[8, '[&>.indent:first-of-type]:
|
|
15
|
+
[1, '[&>.indent:first-of-type]:pl-0 font-medium'],
|
|
16
|
+
[2, '[&>.indent:first-of-type]:pl-0'],
|
|
17
|
+
[3, '[&>.indent:first-of-type]:pl-1'],
|
|
18
|
+
[4, '[&>.indent:first-of-type]:pl-2'],
|
|
19
|
+
[5, '[&>.indent:first-of-type]:pl-3'],
|
|
20
|
+
[6, '[&>.indent:first-of-type]:pl-4'],
|
|
21
|
+
[7, '[&>.indent:first-of-type]:pl-5'],
|
|
22
|
+
[8, '[&>.indent:first-of-type]:pl-6'],
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
25
|
export const treegridRoot: ComponentFunction<TreegridStyleProps> = (_, ...etc) => mx('grid', ...etc);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
const columnRoot: ComponentFunction<Record<string, any>> = (_, ...etc) => mx('dx-column w-full min-w-0 grid', ...etc);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Three-column icon-slot row: spans all 3 columns of the parent Column.Root grid.
|
|
13
|
+
* Uses CSS subgrid to inherit column sizing from the parent Column.
|
|
14
|
+
* Children map to: [col-1: icon/slot] [col-2: content] [col-3: icon/action].
|
|
15
|
+
*/
|
|
16
|
+
const columnRow: ComponentFunction<Record<string, any>> = (_, ...etc) =>
|
|
17
|
+
mx('col-span-3 grid grid-cols-subgrid', ...etc);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* NOTE: Must not use overflow-hidden here since it will clip input focus rings.
|
|
21
|
+
* Occupies only the center column (col-2) of the parent Column.Root grid.
|
|
22
|
+
*/
|
|
23
|
+
const columnSegment: ComponentFunction<Record<string, any>> = (_, ...etc) =>
|
|
24
|
+
mx('col-start-2 col-span-1 min-w-0', ...etc);
|
|
25
|
+
|
|
26
|
+
export const columnTheme = {
|
|
27
|
+
root: columnRoot,
|
|
28
|
+
row: columnRow,
|
|
29
|
+
segment: columnSegment,
|
|
30
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type PanelProps = {};
|
|
10
|
+
|
|
11
|
+
const panelRoot: ComponentFunction<PanelProps> = (_, ...etc) =>
|
|
12
|
+
mx(
|
|
13
|
+
// prettier-ignore
|
|
14
|
+
'h-full w-full grid grid-cols-[100%] overflow-hidden',
|
|
15
|
+
'[&>*:not([data-slot])]:[grid-area:content]',
|
|
16
|
+
...etc,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const panelToolbar: ComponentFunction<PanelProps> = (_, ...etc) =>
|
|
20
|
+
mx(
|
|
21
|
+
// prettier-ignore
|
|
22
|
+
'[grid-area:toolbar]',
|
|
23
|
+
'border-b border-subdued-separator relative',
|
|
24
|
+
'[.dx-main-mobile-layout_&]:px-3',
|
|
25
|
+
...etc,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const panelContent: ComponentFunction<PanelProps> = (_, ...etc) =>
|
|
29
|
+
mx(
|
|
30
|
+
// prettier-ignore
|
|
31
|
+
'[grid-area:content] overflow-hidden min-h-0',
|
|
32
|
+
...etc,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const panelStatusbar: ComponentFunction<PanelProps> = (_, ...etc) =>
|
|
36
|
+
mx(
|
|
37
|
+
// prettier-ignore
|
|
38
|
+
'[grid-area:statusbar]',
|
|
39
|
+
...etc,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const panelTheme = {
|
|
43
|
+
root: panelRoot,
|
|
44
|
+
toolbar: panelToolbar,
|
|
45
|
+
content: panelContent,
|
|
46
|
+
statusbar: panelStatusbar,
|
|
47
|
+
};
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
|
-
import {
|
|
5
|
+
import { type ClassNameArray, type ComponentFunction, type Theme, type ThemeFunction } from '@dxos/ui-types';
|
|
6
|
+
import { getDeep } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
anchoredOverflowTheme,
|
|
10
9
|
avatarTheme,
|
|
11
10
|
breadcrumbTheme,
|
|
12
11
|
buttonTheme,
|
|
12
|
+
cardTheme,
|
|
13
13
|
dialogTheme,
|
|
14
14
|
iconButtonTheme,
|
|
15
15
|
iconTheme,
|
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
scrollAreaTheme,
|
|
24
24
|
selectTheme,
|
|
25
25
|
separatorTheme,
|
|
26
|
+
skeletonTheme,
|
|
27
|
+
splitterTheme,
|
|
26
28
|
statusTheme,
|
|
27
29
|
tagTheme,
|
|
28
30
|
toastTheme,
|
|
@@ -30,14 +32,26 @@ import {
|
|
|
30
32
|
tooltipTheme,
|
|
31
33
|
treegridTheme,
|
|
32
34
|
} from './components';
|
|
35
|
+
import { columnTheme, panelTheme } from './primitives';
|
|
33
36
|
|
|
34
37
|
export const defaultTheme: Theme<Record<string, any>> = {
|
|
35
38
|
themeName: () => 'default',
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
//
|
|
41
|
+
// Primitives
|
|
42
|
+
//
|
|
43
|
+
|
|
44
|
+
column: columnTheme,
|
|
45
|
+
panel: panelTheme,
|
|
46
|
+
|
|
47
|
+
//
|
|
48
|
+
// Components
|
|
49
|
+
//
|
|
50
|
+
|
|
38
51
|
avatar: avatarTheme,
|
|
39
52
|
breadcrumb: breadcrumbTheme,
|
|
40
53
|
button: buttonTheme,
|
|
54
|
+
card: cardTheme,
|
|
41
55
|
dialog: dialogTheme,
|
|
42
56
|
icon: iconTheme,
|
|
43
57
|
iconButton: iconButtonTheme,
|
|
@@ -48,9 +62,11 @@ export const defaultTheme: Theme<Record<string, any>> = {
|
|
|
48
62
|
message: messageTheme,
|
|
49
63
|
menu: menuTheme,
|
|
50
64
|
popover: popoverTheme,
|
|
51
|
-
select: selectTheme,
|
|
52
65
|
scrollArea: scrollAreaTheme,
|
|
66
|
+
select: selectTheme,
|
|
53
67
|
separator: separatorTheme,
|
|
68
|
+
skeleton: skeletonTheme,
|
|
69
|
+
splitter: splitterTheme,
|
|
54
70
|
status: statusTheme,
|
|
55
71
|
tag: tagTheme,
|
|
56
72
|
toast: toastTheme,
|
|
@@ -59,10 +75,10 @@ export const defaultTheme: Theme<Record<string, any>> = {
|
|
|
59
75
|
treegrid: treegridTheme,
|
|
60
76
|
};
|
|
61
77
|
|
|
62
|
-
export const bindTheme = <P extends Record<string, any>>(theme: Theme<Record<string, any>>) => {
|
|
63
|
-
return (path: string,
|
|
64
|
-
const result
|
|
65
|
-
return typeof result === 'function' ? result(styleProps, ...
|
|
78
|
+
export const bindTheme = <P extends Record<string, any>>(theme: Theme<Record<string, any>>): ThemeFunction<P> => {
|
|
79
|
+
return (path: string, styleProps?: P, ...etc: ClassNameArray) => {
|
|
80
|
+
const result = getDeep<Theme<P> | ComponentFunction<P>>(theme, path.split('.'));
|
|
81
|
+
return typeof result === 'function' ? result(styleProps ?? ({} as P), ...etc) : undefined;
|
|
66
82
|
};
|
|
67
83
|
};
|
|
68
84
|
|
package/src/theme.css
CHANGED
|
@@ -2,8 +2,82 @@
|
|
|
2
2
|
* Main theme.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Establish CSS cascade layer order before Tailwind sets its own.
|
|
7
|
+
* First mention of a layer name wins its position in the order.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: `utilities` must be last so it overrides all base and component layers.
|
|
10
|
+
* NOTE: This must be in sync with the `transformIndexHtml` function in `packages/ui/ui-theme/src/plugins/plugin.ts`.
|
|
11
|
+
*/
|
|
12
|
+
@layer properties, theme, dx-tokens, user-tokens, base, tw-base, dx-base, components, tw-components, dx-components, utilities;
|
|
13
|
+
|
|
14
|
+
@import 'tailwindcss';
|
|
15
|
+
|
|
16
|
+
/* @theme extensions */
|
|
17
|
+
@import './css/theme/animation.css';
|
|
18
|
+
@import './css/theme/border.css';
|
|
19
|
+
@import './css/theme/palette.css';
|
|
20
|
+
@import './css/theme/semantic.css';
|
|
21
|
+
@import './css/theme/spacing.css';
|
|
22
|
+
@import './css/theme/styles.css';
|
|
23
|
+
@import './css/theme/text.css';
|
|
24
|
+
|
|
25
|
+
/* @layer dx-base, dx-tokens */
|
|
26
|
+
@import './css/base/base.css';
|
|
27
|
+
@import './css/base/typography.css';
|
|
28
|
+
|
|
29
|
+
/* @layer dx-components (components) */
|
|
30
|
+
@import './css/components/button.css';
|
|
31
|
+
@import './css/components/checkbox.css';
|
|
32
|
+
@import './css/components/dialog.css';
|
|
33
|
+
@import './css/components/focus-ring.css';
|
|
34
|
+
@import './css/components/panel.css';
|
|
35
|
+
@import './css/components/link.css';
|
|
36
|
+
@import './css/components/scrollbar.css';
|
|
37
|
+
@import './css/components/surface.css';
|
|
38
|
+
@import './css/components/tag.css';
|
|
39
|
+
@import './css/components/text.css';
|
|
40
|
+
|
|
41
|
+
/* @layer dx-components (layout) */
|
|
42
|
+
@import './css/layout/main.css';
|
|
43
|
+
@import './css/layout/native.css';
|
|
44
|
+
@import './css/layout/positioning.css';
|
|
45
|
+
@import './css/layout/size.css';
|
|
46
|
+
|
|
47
|
+
/* @layer dx-utilities */
|
|
48
|
+
@import './css/utilities.css';
|
|
49
|
+
|
|
50
|
+
/* Third-party integrations */
|
|
51
|
+
@import './css/integrations/codemirror.css';
|
|
52
|
+
@import './css/integrations/tldraw.css';
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Force-emit CSS variables for the full color palette for all:
|
|
56
|
+
* --color-{hue}-{shade}
|
|
57
|
+
* --color-{hue}-{style}
|
|
58
|
+
*/
|
|
59
|
+
@source inline("bg-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{50,100,200,300,400,500,600,700,800,900,950}");
|
|
60
|
+
@source inline("bg-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{fill,surface,surface-text,text,border}");
|
|
61
|
+
@source inline("border-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-border");
|
|
62
|
+
@source inline("bg-{info,success,warning,error}-{fill,surface,surface-text,text,border}");
|
|
63
|
+
@source inline("border-{info,success,warning,error}-border");
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Plugins must come after all imports.
|
|
67
|
+
*/
|
|
68
|
+
@plugin '@tailwindcss/forms';
|
|
69
|
+
@plugin 'tailwind-scrollbar';
|
|
70
|
+
@plugin 'tailwindcss-radix';
|
|
8
71
|
|
|
9
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Class-based dark mode.
|
|
74
|
+
* The `.dark` class on an ancestor toggles `dark:` utilities.
|
|
75
|
+
*/
|
|
76
|
+
@variant dark (&:where(.dark, .dark *));
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Custom variants.
|
|
80
|
+
*/
|
|
81
|
+
@custom-variant is-current (&[aria-current]:not([aria-current="false"]));
|
|
82
|
+
@custom-variant hover-hover (@media (hover: hover));
|
|
83
|
+
@custom-variant pointer-fine (@media (pointer: fine));
|
package/src/typings.d.ts
CHANGED