@dxos/ui-theme 0.8.4-main.fbb7a13 → 0.8.4-main.fcc0d83b33
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 +762 -2803
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +762 -2803
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/plugin/node-cjs/main.css +1561 -0
- package/dist/plugin/node-cjs/main.css.map +7 -0
- package/dist/plugin/node-cjs/meta.json +1 -1
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +137 -0
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +7 -0
- package/dist/plugin/node-esm/main.css +1561 -0
- package/dist/plugin/node-esm/main.css.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +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.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 +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 +12 -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/focus.d.ts +6 -0
- package/dist/types/src/theme/components/focus.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/icon-button.d.ts +1 -0
- package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/icon.d.ts +3 -0
- package/dist/types/src/theme/components/icon.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/index.d.ts +4 -1
- package/dist/types/src/theme/components/index.d.ts.map +1 -0
- package/dist/types/src/{styles → theme}/components/input.d.ts +31 -27
- 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 +32 -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/{styles → theme}/components/status.d.ts +1 -1
- 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 +11 -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 +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/{styles/fragments → util}/elevation.d.ts +0 -6
- package/dist/types/src/util/elevation.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/index.d.ts +3 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/mx.d.ts +56 -0
- package/dist/types/src/util/mx.d.ts.map +1 -1
- package/dist/types/src/util/size.d.ts +27 -0
- package/dist/types/src/util/size.d.ts.map +1 -0
- package/dist/types/src/util/valence.d.ts +4 -0
- package/dist/types/src/util/valence.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -35
- 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 +23 -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/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 +30 -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 +129 -108
- 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 +87 -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/{styles → theme}/components/dialog.ts +19 -10
- 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 +2 -6
- 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/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-cjs/theme.css +0 -1418
- package/dist/plugin/node-cjs/theme.css.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/plugin/node-esm/theme.css +0 -1418
- package/dist/plugin/node-esm/theme.css.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 +0 -17
- 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 +0 -9
- 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/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/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/theme.css +0 -9
- 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/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/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,171 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type ComponentFragment,
|
|
7
|
+
type ComponentFunction,
|
|
8
|
+
type Density,
|
|
9
|
+
type Elevation,
|
|
10
|
+
type MessageValence,
|
|
11
|
+
type Size,
|
|
12
|
+
} from '@dxos/ui-types';
|
|
13
|
+
|
|
14
|
+
import { densityDimensions, staticDisabled } from '../../fragments';
|
|
15
|
+
import { getSize, getHeight, getWidth, mx, snapSize, sizeValue, textValence } from '../../util';
|
|
16
|
+
|
|
17
|
+
export type InputStyleProps = Partial<{
|
|
18
|
+
variant: 'default' | 'subdued' | 'static';
|
|
19
|
+
density: Density;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
elevation: Elevation;
|
|
22
|
+
focused: boolean;
|
|
23
|
+
validationValence: MessageValence;
|
|
24
|
+
size: Size;
|
|
25
|
+
checked: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
|
|
28
|
+
export type InputMetaStyleProps = Partial<{
|
|
29
|
+
srOnly: boolean;
|
|
30
|
+
validationValence: MessageValence;
|
|
31
|
+
}>;
|
|
32
|
+
|
|
33
|
+
export const inputTextLabel = 'py-1 text-sm text-description';
|
|
34
|
+
|
|
35
|
+
const textInputSurfaceFocus =
|
|
36
|
+
'transition-colors bg-input-surface focus:bg-focus-surface border border-separator focus:border-separator';
|
|
37
|
+
|
|
38
|
+
const textInputSurfaceHover = 'hover:bg-focus-surface';
|
|
39
|
+
|
|
40
|
+
const booleanInputSurface =
|
|
41
|
+
'shadow-inner transition-colors bg-un-accent aria-checked:bg-accent-surface aria-[checked=mixed]:bg-accent-surface';
|
|
42
|
+
|
|
43
|
+
const booleanInputSurfaceHover =
|
|
44
|
+
'hover:bg-un-accent-hover hover:aria-checked:bg-accent-surface-hover hover:aria-[checked=mixed]:bg-accent-surface-hover';
|
|
45
|
+
|
|
46
|
+
// TODO(burdon): Replace with semantic tokens.
|
|
47
|
+
const inputValence = (valence?: MessageValence) => {
|
|
48
|
+
switch (valence) {
|
|
49
|
+
case 'success':
|
|
50
|
+
return 'shadow-emerald-500/50 dark:shadow-emerald-600/50';
|
|
51
|
+
case 'info':
|
|
52
|
+
return 'shadow-cyan-500/50 dark:shadow-cyan-600/50';
|
|
53
|
+
case 'warning':
|
|
54
|
+
return 'shadow-amber-500/50 dark:shadow-amber-600/50';
|
|
55
|
+
case 'error':
|
|
56
|
+
return 'shadow-rose-500/50 dark:shadow-rose-600/50';
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const sharedSubduedInputStyles: ComponentFragment<InputStyleProps> = (props) => [
|
|
61
|
+
'[[data-drag-autoscroll="active"]_&]:pointer-events-none',
|
|
62
|
+
'py-0 w-full bg-transparent text-current placeholder-placeholder',
|
|
63
|
+
'dx-focus-subdued',
|
|
64
|
+
densityDimensions(props.density),
|
|
65
|
+
props.disabled && staticDisabled,
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const sharedDefaultInputStyles: ComponentFragment<InputStyleProps> = (props) => [
|
|
69
|
+
'[[data-drag-autoscroll="active"]_&]:pointer-events-none',
|
|
70
|
+
'py-0 w-full text-base-surface-text rounded-xs placeholder-placeholder',
|
|
71
|
+
textInputSurfaceFocus,
|
|
72
|
+
densityDimensions(props.density),
|
|
73
|
+
props.disabled ? staticDisabled : textInputSurfaceHover,
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
const sharedStaticInputStyles: ComponentFragment<InputStyleProps> = (props) => [
|
|
77
|
+
'[[data-drag-autoscroll="active"]_&]:pointer-events-none',
|
|
78
|
+
'py-0 w-full text-base-surface-text rounded-xs placeholder-placeholder',
|
|
79
|
+
textInputSurfaceFocus,
|
|
80
|
+
textInputSurfaceHover,
|
|
81
|
+
props.focused && 'bg-attention-surface',
|
|
82
|
+
inputValence(props.validationValence),
|
|
83
|
+
props.disabled && staticDisabled,
|
|
84
|
+
props.focused && 'dx-focus-static',
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
const inputInput: ComponentFunction<InputStyleProps> = (props, ...etc) =>
|
|
88
|
+
props.variant === 'subdued'
|
|
89
|
+
? mx(...sharedSubduedInputStyles(props), ...etc)
|
|
90
|
+
: props.variant === 'static'
|
|
91
|
+
? mx(...sharedStaticInputStyles(props), ...etc)
|
|
92
|
+
: mx(
|
|
93
|
+
...sharedDefaultInputStyles(props),
|
|
94
|
+
!props.disabled && 'dx-focus-ring',
|
|
95
|
+
inputValence(props.validationValence),
|
|
96
|
+
...etc,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const inputTextArea: ComponentFunction<InputStyleProps> = (props, ...etc) => inputInput(props, ...etc);
|
|
100
|
+
|
|
101
|
+
const inputCheckbox: ComponentFunction<InputStyleProps> = ({ size = 5 }, ...etc) =>
|
|
102
|
+
mx('dx-checkbox dx-focus-ring', getSize(size), ...etc);
|
|
103
|
+
|
|
104
|
+
const inputCheckboxIndicator: ComponentFunction<InputStyleProps> = ({ size = 5, checked }, ...etc) =>
|
|
105
|
+
mx(getSize(snapSize(sizeValue(size) * 0.65, 4)), !checked && 'invisible', ...etc);
|
|
106
|
+
|
|
107
|
+
const inputSwitch: ComponentFunction<InputStyleProps> = ({ size = 5, disabled }, ...etc) =>
|
|
108
|
+
mx(
|
|
109
|
+
getHeight(size),
|
|
110
|
+
getWidth(snapSize(sizeValue(size) * 1.75, 9)),
|
|
111
|
+
booleanInputSurface,
|
|
112
|
+
!disabled && booleanInputSurfaceHover,
|
|
113
|
+
// TODO(burdon): Added m-1 margin to make 40px width to align with 40px icon button.
|
|
114
|
+
'cursor-pointer shrink-0 rounded-full px-1 mx-1 relative',
|
|
115
|
+
'dx-focus-ring',
|
|
116
|
+
...etc,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const inputSwitchThumb: ComponentFunction<InputStyleProps> = ({ size = 5 }, ...etc) =>
|
|
120
|
+
mx(
|
|
121
|
+
getSize(size === 'px' ? 'px' : ((size - 2) as Size)),
|
|
122
|
+
'block bg-white rounded-full transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[100%]',
|
|
123
|
+
...etc,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const inputWithSegmentsInput: ComponentFunction<InputStyleProps> = (props, ...etc) =>
|
|
127
|
+
mx(
|
|
128
|
+
'font-mono selection:bg-transparent mx-auto',
|
|
129
|
+
props.density === 'fine' ? 'text-base pointer-fine:text-sm' : 'text-lg',
|
|
130
|
+
props.disabled && 'cursor-not-allowed',
|
|
131
|
+
...etc,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const inputSegment: ComponentFunction<InputStyleProps> = (props, ...etc) =>
|
|
135
|
+
mx(
|
|
136
|
+
'flex items-center justify-center font-mono',
|
|
137
|
+
props.density === 'fine' ? 'size-10 pointer-fine:size-8 rounded-xs' : 'size-12 rounded-xs',
|
|
138
|
+
'bg-input-surface text-base-surface-text transition-colors border border-separator',
|
|
139
|
+
'data-[focused]:bg-attention-surface data-[focused]:border-neutral-focus-indicator',
|
|
140
|
+
'data-[focused]:ring-2 data-[focused]:ring-offset-0 data-[focused]:ring-neutral-focus-indicator',
|
|
141
|
+
inputValence(props.validationValence),
|
|
142
|
+
props.disabled && staticDisabled,
|
|
143
|
+
...etc,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const inputLabel: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
147
|
+
mx('block', inputTextLabel, props.srOnly && 'sr-only', ...etc);
|
|
148
|
+
|
|
149
|
+
const inputDescription: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
150
|
+
mx('text-description', props.srOnly && 'sr-only', ...etc);
|
|
151
|
+
|
|
152
|
+
const inputDescriptionAndValidation: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
153
|
+
mx('leading-none my-1.5', props.srOnly && 'sr-only', ...etc);
|
|
154
|
+
|
|
155
|
+
const inputValidation: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
156
|
+
mx(inputTextLabel, props.srOnly ? 'sr-only' : textValence(props.validationValence), ...etc);
|
|
157
|
+
|
|
158
|
+
export const inputTheme = {
|
|
159
|
+
input: inputInput,
|
|
160
|
+
textArea: inputTextArea,
|
|
161
|
+
inputWithSegments: inputWithSegmentsInput,
|
|
162
|
+
segment: inputSegment,
|
|
163
|
+
checkbox: inputCheckbox,
|
|
164
|
+
checkboxIndicator: inputCheckboxIndicator,
|
|
165
|
+
label: inputLabel,
|
|
166
|
+
description: inputDescription,
|
|
167
|
+
switch: inputSwitch,
|
|
168
|
+
switchThumb: inputSwitchThumb,
|
|
169
|
+
validation: inputValidation,
|
|
170
|
+
descriptionAndValidation: inputDescriptionAndValidation,
|
|
171
|
+
};
|
|
@@ -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 { focusRing } from '../fragments';
|
|
9
8
|
|
|
10
9
|
export type LinkStyleProps = {
|
|
11
10
|
variant?: 'accent' | 'neutral';
|
|
@@ -13,11 +12,11 @@ export type LinkStyleProps = {
|
|
|
13
12
|
|
|
14
13
|
export const linkRoot: ComponentFunction<LinkStyleProps> = ({ variant }, ...etc) =>
|
|
15
14
|
mx(
|
|
16
|
-
'underline decoration-1 underline-offset-2 transition-color rounded-
|
|
15
|
+
'underline decoration-1 underline-offset-2 transition-color rounded-xs',
|
|
17
16
|
variant === 'neutral'
|
|
18
17
|
? 'text-inherit hover:opacity-90 visited:text-inherit visited:hover:opacity-90'
|
|
19
|
-
: 'text-
|
|
20
|
-
|
|
18
|
+
: 'text-accent-text hover:text-accent-text-hover visited:text-accent-text visited:hover:text-accent-text-hover',
|
|
19
|
+
'dx-focus-ring',
|
|
21
20
|
...etc,
|
|
22
21
|
);
|
|
23
22
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Density, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { densityBlockSize, ghostHover } from '../../fragments';
|
|
8
|
+
import { getSize, mx } from '../../util';
|
|
9
9
|
|
|
10
10
|
export type ListStyleProps = Partial<{
|
|
11
11
|
density: Density;
|
|
@@ -21,13 +21,13 @@ export const listItemEndcap: ComponentFunction<ListStyleProps> = ({ density }, .
|
|
|
21
21
|
mx(density === 'fine' ? getSize(8) : getSize(10), 'shrink-0 flex items-center justify-center', ...etc);
|
|
22
22
|
|
|
23
23
|
export const listItemHeading: ComponentFunction<ListStyleProps> = ({ density }, ...etc) =>
|
|
24
|
-
mx(densityBlockSize(density), 'flex items-center', ...etc);
|
|
24
|
+
mx(densityBlockSize(density), 'flex items-center overflow-hidden [&>span]:truncate', ...etc);
|
|
25
25
|
|
|
26
26
|
export const listItemDragHandleIcon: ComponentFunction<ListStyleProps> = (_props, ...etc) =>
|
|
27
|
-
mx(getSize(5), '
|
|
27
|
+
mx(getSize(5), 'mt-2.5', ...etc);
|
|
28
28
|
|
|
29
29
|
export const listItemOpenTrigger: ComponentFunction<ListStyleProps> = ({ density }, ...etc) =>
|
|
30
|
-
mx('
|
|
30
|
+
mx('w-5 rounded-sm flex justify-center items-center', densityBlockSize(density), ghostHover, 'dx-focus-ring', ...etc);
|
|
31
31
|
|
|
32
32
|
export const listItemOpenTriggerIcon: ComponentFunction<ListStyleProps> = (_props, ...etc) => {
|
|
33
33
|
return mx(getSize(5), ...etc);
|
|
@@ -7,8 +7,8 @@ import { type ComponentFunction } from '@dxos/ui-types';
|
|
|
7
7
|
import { mx } from '../../util';
|
|
8
8
|
|
|
9
9
|
// Padding to apply to in-flow elements which need to clear the fixed topbar/bottombar.
|
|
10
|
-
export const topbarBlockPaddingStart = '
|
|
11
|
-
export const bottombarBlockPaddingEnd = '
|
|
10
|
+
export const topbarBlockPaddingStart = 'py-(--dx-topbar-size) dx-sticky-top-from-topbar-bottom';
|
|
11
|
+
export const bottombarBlockPaddingEnd = 'pb-(--dx-statusbar-size) dx-sticky-bottom-from-statusbar-bottom';
|
|
12
12
|
|
|
13
13
|
export const mainPadding = 'dx-main-content-padding';
|
|
14
14
|
export const mainPaddingTransitions = 'dx-main-content-padding-transitions';
|
|
@@ -25,14 +25,10 @@ export const mainContent: ComponentFunction<MainStyleProps> = ({ bounce }, ...et
|
|
|
25
25
|
export const mainSidebar: ComponentFunction<MainStyleProps> = (_, ...etc) =>
|
|
26
26
|
mx('dx-main-sidebar', 'dx-focus-ring-inset-over-all', ...etc);
|
|
27
27
|
|
|
28
|
-
export const mainDrawer: ComponentFunction<MainStyleProps> = (_, ...etc) =>
|
|
29
|
-
mx('dx-main-drawer', 'dx-focus-ring-inset-over-all', ...etc);
|
|
30
|
-
|
|
31
28
|
export const mainOverlay: ComponentFunction<MainStyleProps> = (_, ...etc) => mx('dx-main-overlay', ...etc);
|
|
32
29
|
|
|
33
30
|
export const mainTheme = {
|
|
34
31
|
content: mainContent,
|
|
35
32
|
sidebar: mainSidebar,
|
|
36
|
-
drawer: mainDrawer,
|
|
37
33
|
overlay: mainOverlay,
|
|
38
34
|
};
|
|
@@ -4,49 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
dataDisabled,
|
|
10
|
-
descriptionText,
|
|
11
|
-
modalSurface,
|
|
12
|
-
popperMotion,
|
|
13
|
-
subduedFocus,
|
|
14
|
-
surfaceShadow,
|
|
15
|
-
surfaceZIndex,
|
|
16
|
-
} from '../fragments';
|
|
7
|
+
import { dataDisabled } from '../../fragments';
|
|
8
|
+
import { mx, surfaceShadow, surfaceZIndex } from '../../util';
|
|
17
9
|
|
|
18
10
|
export type MenuStyleProps = Partial<{
|
|
19
11
|
constrainBlockSize: boolean;
|
|
20
12
|
elevation: Elevation;
|
|
21
13
|
}>;
|
|
22
14
|
|
|
23
|
-
export const menuViewport: ComponentFunction<MenuStyleProps> = (_props, ...etc) =>
|
|
24
|
-
mx('rounded p-1 max-bs-[--radix-dropdown-menu-content-available-height] overflow-y-auto', ...etc);
|
|
25
|
-
|
|
26
15
|
export const menuContent: ComponentFunction<MenuStyleProps> = ({ elevation }, ...etc) =>
|
|
27
16
|
mx(
|
|
28
|
-
'
|
|
17
|
+
'dx-modal-surface w-48 rounded-sm md:w-56 border border-separator',
|
|
29
18
|
surfaceZIndex({ elevation, level: 'menu' }),
|
|
30
19
|
surfaceShadow({ elevation: 'positioned' }),
|
|
31
|
-
modalSurface,
|
|
32
|
-
popperMotion,
|
|
33
20
|
...etc,
|
|
34
21
|
);
|
|
35
22
|
|
|
23
|
+
export const menuViewport: ComponentFunction<MenuStyleProps> = (_props, ...etc) =>
|
|
24
|
+
mx('rounded-sm p-1 max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto', ...etc);
|
|
25
|
+
|
|
36
26
|
export const menuItem: ComponentFunction<MenuStyleProps> = (_props, ...etc) =>
|
|
37
27
|
mx(
|
|
38
|
-
'flex cursor-pointer select-none items-center gap-2 rounded-
|
|
39
|
-
'data-[highlighted]:bg-
|
|
40
|
-
|
|
28
|
+
'flex cursor-pointer select-none items-center gap-2 rounded-xs px-2 py-2 text-sm',
|
|
29
|
+
'hover:bg-hover-surface data-[highlighted]:bg-hover-surface',
|
|
30
|
+
'dx-focus-subdued',
|
|
41
31
|
dataDisabled,
|
|
42
32
|
...etc,
|
|
43
33
|
);
|
|
44
34
|
|
|
45
35
|
export const menuSeparator: ComponentFunction<MenuStyleProps> = (_props, ...etc) =>
|
|
46
|
-
mx('
|
|
36
|
+
mx('my-1 mx-2 h-px bg-separator', ...etc);
|
|
47
37
|
|
|
48
38
|
export const menuGroupLabel: ComponentFunction<MenuStyleProps> = (_props, ...etc) =>
|
|
49
|
-
mx(
|
|
39
|
+
mx('text-description', 'select-none px-2 py-2', ...etc);
|
|
50
40
|
|
|
51
41
|
export const menuArrow: ComponentFunction<MenuStyleProps> = (_props, ...etc) => mx('fill-separator', ...etc);
|
|
52
42
|
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Elevation, type MessageValence, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
import { messageValence } from '../fragments';
|
|
7
|
+
import { mx, messageValence } from '../../util';
|
|
9
8
|
|
|
10
9
|
export type MessageStyleProps = {
|
|
11
10
|
valence?: MessageValence;
|
|
@@ -13,24 +12,29 @@ export type MessageStyleProps = {
|
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
export const messageRoot: ComponentFunction<MessageStyleProps> = ({ valence }, etc) => {
|
|
16
|
-
return mx('p-
|
|
15
|
+
return mx('grid grid-cols-[min-content_1fr] gap-x-2 p-trim-sm rounded-sm', messageValence(valence), etc);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const messageHeader: ComponentFunction<MessageStyleProps> = (_, etc) => {
|
|
19
|
+
return mx('col-span-2 grid grid-cols-subgrid items-center', etc);
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
export const messageTitle: ComponentFunction<MessageStyleProps> = (_, etc) => {
|
|
20
|
-
return mx('
|
|
23
|
+
return mx('col-start-2 gap-trim-sm [&>svg]:inline-block', etc);
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
export const messageIcon: ComponentFunction<MessageStyleProps> = (_, etc) => {
|
|
24
|
-
return mx('
|
|
27
|
+
return mx('col-start-1', etc);
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
export const messageContent: ComponentFunction<MessageStyleProps> = (_, etc) => {
|
|
28
|
-
return mx('first:font-medium', etc);
|
|
31
|
+
return mx('grid grid-cols-subgrid col-start-2 first:font-medium', etc);
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
export const messageTheme: Theme<MessageStyleProps> = {
|
|
32
35
|
root: messageRoot,
|
|
33
|
-
|
|
36
|
+
header: messageHeader,
|
|
34
37
|
icon: messageIcon,
|
|
35
38
|
title: messageTitle,
|
|
39
|
+
content: messageContent,
|
|
36
40
|
};
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
import { focusRing, modalSurface, surfaceShadow, surfaceZIndex } from '../fragments';
|
|
7
|
+
import { mx, surfaceShadow, surfaceZIndex } from '../../util';
|
|
9
8
|
|
|
10
9
|
export type PopoverStyleProps = Partial<{
|
|
11
10
|
constrainBlock: boolean;
|
|
@@ -13,21 +12,23 @@ export type PopoverStyleProps = Partial<{
|
|
|
13
12
|
elevation: Elevation;
|
|
14
13
|
}>;
|
|
15
14
|
|
|
16
|
-
export const
|
|
15
|
+
export const popoverContent: ComponentFunction<PopoverStyleProps> = ({ elevation }, ...etc) =>
|
|
17
16
|
mx(
|
|
18
|
-
'rounded-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
'dx-modal-surface border border-separator rounded-sm',
|
|
18
|
+
surfaceShadow({ elevation: 'positioned' }),
|
|
19
|
+
surfaceZIndex({ elevation, level: 'menu' }),
|
|
20
|
+
'dx-focus-ring',
|
|
21
21
|
...etc,
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
export const
|
|
24
|
+
export const popoverViewport: ComponentFunction<PopoverStyleProps> = ({ constrainBlock, constrainInline }, ...etc) =>
|
|
25
25
|
mx(
|
|
26
|
-
'
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
'grid grid-rows-[1fr] min-h-0 min-w-popover-min-width',
|
|
27
|
+
(constrainBlock || constrainInline) && 'overflow-hidden',
|
|
28
|
+
constrainBlock && 'max-h-(--radix-popover-content-available-height)',
|
|
29
|
+
constrainBlock &&
|
|
30
|
+
'max-h-[min(var(--radix-popover-content-available-height),calc(100dvh-var(--spacing-screen-border)*2))]',
|
|
31
|
+
constrainInline && 'max-w-(--radix-popover-content-available-width)',
|
|
31
32
|
...etc,
|
|
32
33
|
);
|
|
33
34
|
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
import { withColumn } from '../primitives/column';
|
|
9
|
+
|
|
10
|
+
export const scrollbar = {
|
|
11
|
+
thin: {
|
|
12
|
+
size: 4,
|
|
13
|
+
padding: 4,
|
|
14
|
+
},
|
|
15
|
+
coarse: {
|
|
16
|
+
size: 8,
|
|
17
|
+
padding: 8,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ScrollAreaStyleProps = {
|
|
22
|
+
orientation?: AllowedAxis;
|
|
23
|
+
autoHide?: boolean;
|
|
24
|
+
/** Balance left/right, top/bottom offset with scrollbar. */
|
|
25
|
+
centered?: boolean;
|
|
26
|
+
/** Add default padding. */
|
|
27
|
+
/** TODO(burdon): Integrate with Column.Root padding. */
|
|
28
|
+
padding?: boolean;
|
|
29
|
+
/** Use thin scrollbars. */
|
|
30
|
+
/** TODO(burdon): Density fine/course. */
|
|
31
|
+
thin?: boolean;
|
|
32
|
+
/** Enable snap scrolling. */
|
|
33
|
+
snap?: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const scrollAreaRoot: ComponentFunction<ScrollAreaStyleProps> = ({ orientation }, ...etc) =>
|
|
37
|
+
mx(
|
|
38
|
+
// Expand
|
|
39
|
+
'dx-container',
|
|
40
|
+
|
|
41
|
+
orientation === 'vertical' && 'group/scroll-v flex flex-col',
|
|
42
|
+
orientation === 'horizontal' && 'group/scroll-h flex',
|
|
43
|
+
orientation === 'all' && 'group/scroll-all',
|
|
44
|
+
|
|
45
|
+
// Apply col-span-full only when inside a Column.Root grid (detected via dx-column-root marker).
|
|
46
|
+
'[.dx-column-root_&]:col-span-full',
|
|
47
|
+
|
|
48
|
+
...etc,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* NOTE: The browser reserves space for scrollbars.
|
|
53
|
+
*/
|
|
54
|
+
export const scrollAreaViewport: ComponentFunction<ScrollAreaStyleProps> = (
|
|
55
|
+
{ orientation, centered, padding, snap, autoHide },
|
|
56
|
+
...etc
|
|
57
|
+
) => {
|
|
58
|
+
return mx(
|
|
59
|
+
'flex-1 min-h-0 w-full',
|
|
60
|
+
|
|
61
|
+
// Reset --dx-col so nested components don't try to grid-position themselves.
|
|
62
|
+
// ScrollArea has already consumed --gutter for padding.
|
|
63
|
+
withColumn.consumed(),
|
|
64
|
+
|
|
65
|
+
orientation === 'vertical' && 'overflow-y-scroll',
|
|
66
|
+
orientation === 'horizontal' && 'flex overflow-x-scroll overscroll-x-contain',
|
|
67
|
+
orientation === 'all' && 'overflow-scroll',
|
|
68
|
+
|
|
69
|
+
'[&::-webkit-scrollbar-corner]:bg-transparent',
|
|
70
|
+
'[&::-webkit-scrollbar-track]:bg-transparent',
|
|
71
|
+
'[&::-webkit-scrollbar-thumb]:rounded-none',
|
|
72
|
+
|
|
73
|
+
'[&::-webkit-scrollbar]:w-[var(--scroll-width)] [&::-webkit-scrollbar]:h-[var(--scroll-width)]',
|
|
74
|
+
|
|
75
|
+
// If contained within Column.Root grid the gutter is set by that component (--gutter CSS variable).
|
|
76
|
+
// If centered, left padding compensates for scrollbar width so content is visually centered.
|
|
77
|
+
(orientation === 'vertical' || orientation === 'all') &&
|
|
78
|
+
(padding
|
|
79
|
+
? [
|
|
80
|
+
centered ? 'pl-[var(--gutter,calc(var(--scroll-width)+var(--scroll-padding)))]' : 'pl-[var(--gutter,0)]',
|
|
81
|
+
'pr-[calc(var(--gutter,calc(var(--scroll-width)+var(--scroll-padding)))-var(--scroll-width))]',
|
|
82
|
+
]
|
|
83
|
+
: centered && 'pl-[var(--scroll-width)]'),
|
|
84
|
+
|
|
85
|
+
(orientation === 'horizontal' || orientation === 'all') &&
|
|
86
|
+
(padding
|
|
87
|
+
? [centered && 'pt-[calc(var(--scroll-width)+var(--scroll-padding))]', 'pb-[var(--scroll-padding)]']
|
|
88
|
+
: centered && 'pt-[var(--scroll-width)]'),
|
|
89
|
+
|
|
90
|
+
snap && [
|
|
91
|
+
orientation === 'vertical' && 'snap-y snap-mandatory',
|
|
92
|
+
orientation === 'horizontal' && 'snap-x snap-mandatory',
|
|
93
|
+
orientation === 'all' && 'snap-both snap-mandatory',
|
|
94
|
+
],
|
|
95
|
+
|
|
96
|
+
autoHide
|
|
97
|
+
? [
|
|
98
|
+
orientation === 'vertical' && 'group-hover/scroll-v:[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
99
|
+
orientation === 'horizontal' && 'group-hover/scroll-h:[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
100
|
+
orientation === 'all' && 'group-hover/scroll-all:[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
101
|
+
]
|
|
102
|
+
: [
|
|
103
|
+
orientation === 'vertical' && '[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
104
|
+
orientation === 'horizontal' && '[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
105
|
+
orientation === 'all' && '[&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb',
|
|
106
|
+
],
|
|
107
|
+
|
|
108
|
+
...etc,
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const scrollAreaTheme: Theme<ScrollAreaStyleProps> = {
|
|
113
|
+
root: scrollAreaRoot,
|
|
114
|
+
viewport: scrollAreaViewport,
|
|
115
|
+
};
|
|
@@ -4,15 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
import {
|
|
9
|
-
blockSeparator,
|
|
10
|
-
ghostHighlighted,
|
|
11
|
-
modalSurface,
|
|
12
|
-
separatorBorderColor,
|
|
13
|
-
surfaceShadow,
|
|
14
|
-
surfaceZIndex,
|
|
15
|
-
} from '../fragments';
|
|
7
|
+
import { mx, surfaceShadow, surfaceZIndex } from '../../util';
|
|
16
8
|
|
|
17
9
|
export type SelectStyleProps = Partial<{
|
|
18
10
|
elevation: Elevation;
|
|
@@ -20,8 +12,8 @@ export type SelectStyleProps = Partial<{
|
|
|
20
12
|
|
|
21
13
|
export const selectContent: ComponentFunction<SelectStyleProps> = ({ elevation }, ...etc) => {
|
|
22
14
|
return mx(
|
|
23
|
-
'
|
|
24
|
-
|
|
15
|
+
'dx-modal-surface rounded-sm border border-separator',
|
|
16
|
+
'min-w-(--radix-select-trigger-width) max-h-(--radix-select-content-available-height)',
|
|
25
17
|
surfaceShadow({ elevation: 'positioned' }),
|
|
26
18
|
surfaceZIndex({ elevation, level: 'menu' }),
|
|
27
19
|
...etc,
|
|
@@ -32,10 +24,10 @@ export const selectViewport: ComponentFunction<SelectStyleProps> = (_props, ...e
|
|
|
32
24
|
|
|
33
25
|
export const selectItem: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
34
26
|
mx(
|
|
35
|
-
'flex items-center min-
|
|
36
|
-
'text-
|
|
27
|
+
'flex items-center min-h-[2rem] px-3 py-1 gap-2',
|
|
28
|
+
'text-base-surface-text leading-none select-none outline-hidden',
|
|
37
29
|
'[&>svg]:invisible [&[data-state=checked]>svg]:visible',
|
|
38
|
-
|
|
30
|
+
'dx-highlighted',
|
|
39
31
|
...etc,
|
|
40
32
|
);
|
|
41
33
|
|
|
@@ -44,10 +36,10 @@ export const selectItemIndicator: ComponentFunction<SelectStyleProps> = (_props,
|
|
|
44
36
|
export const selectArrow: ComponentFunction<SelectStyleProps> = (_props, ...etc) => mx('fill-separator', ...etc);
|
|
45
37
|
|
|
46
38
|
export const selectSeparator: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
47
|
-
mx(
|
|
39
|
+
mx('self-stretch border-b my-1 border-separator', ...etc);
|
|
48
40
|
|
|
49
41
|
export const selectScrollButton: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
|
|
50
|
-
mx(
|
|
42
|
+
mx('dx-modal-surface flex items-center justify-center cursor-default h-6 w-full', ...etc);
|
|
51
43
|
|
|
52
44
|
export const selectTheme: Theme<SelectStyleProps> = {
|
|
53
45
|
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
|
+
};
|