@dxos/ui-theme 0.8.4-main.fbb7a13 → 0.8.4-staging.ac66bdf99f
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 +766 -2802
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +766 -2802
- 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 +1529 -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 +1529 -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/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 +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 +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 +36 -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 +24 -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 +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 +130 -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 +117 -109
- package/src/css/theme/animation.css +229 -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 +76 -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 +1 -3
- 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/icon-button.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,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { ComponentFunction, Density, Elevation, Theme } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { ghostHover } from '../../fragments';
|
|
8
|
+
import { mx } from '../../util';
|
|
9
|
+
|
|
10
|
+
export const primaryButtonColors =
|
|
11
|
+
'text-accent-surface-text bg-accent-surface hover:bg-accent-surface-hover aria-pressed:bg-primary-500 dark:aria-pressed:bg-primary-500 data-[state=open]:bg-primary-500 dark:data-[state=open]:bg-primary-500 aria-checked:bg-primary-500 dark:aria-checked:bg-primary-500 aria-checked:text-primary-100';
|
|
12
|
+
|
|
13
|
+
export const staticDefaultButtonColors = 'bg-input-surface text-input-surface-text';
|
|
14
|
+
|
|
15
|
+
export const defaultButtonColors = mx(
|
|
16
|
+
staticDefaultButtonColors,
|
|
17
|
+
'data-[state=open]:bg-input-surface aria-pressed:text-accent-text aria-pressed:bg-base-surface aria-checked:text-accent-text aria-checked:bg-base-surface',
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const ghostButtonColors = mx(
|
|
21
|
+
ghostHover,
|
|
22
|
+
'hover:text-inherit data-[state=open]:bg-input-surface aria-pressed:text-accent-text aria-pressed:bg-base-surface aria-checked:text-accent-text aria-checked:bg-base-surface',
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export type ButtonStyleProps = Partial<{
|
|
26
|
+
inGroup?: boolean;
|
|
27
|
+
textWrap?: boolean;
|
|
28
|
+
density: Density;
|
|
29
|
+
elevation: Elevation;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
variant: 'default' | 'primary' | 'ghost' | 'outline';
|
|
32
|
+
}>;
|
|
33
|
+
|
|
34
|
+
const buttonRoot: ComponentFunction<ButtonStyleProps> = (_props, ...etc) => {
|
|
35
|
+
return mx('dx-button dx-focus-ring group [&_span]:truncate', ...etc);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const buttonGroup: ComponentFunction<{ elevation?: Elevation }> = (_props, ...etc) => {
|
|
39
|
+
return mx(
|
|
40
|
+
'inline-flex rounded-xs [&>:first-child]:rounded-w-sm [&>:last-child]:rounded-ie-sm [&>button]:relative',
|
|
41
|
+
...etc,
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const buttonTheme: Theme<ButtonStyleProps> = {
|
|
46
|
+
root: buttonRoot,
|
|
47
|
+
group: buttonGroup,
|
|
48
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Density, type Theme } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type CardStyleProps = {
|
|
10
|
+
border?: boolean;
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
srOnly?: boolean;
|
|
13
|
+
variant?: 'default' | 'subtitle' | 'description';
|
|
14
|
+
density?: Density;
|
|
15
|
+
truncate?: boolean;
|
|
16
|
+
padding?: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const cardRoot: ComponentFunction<CardStyleProps> = ({ border, fullWidth }, ...etc) =>
|
|
20
|
+
mx(
|
|
21
|
+
'dx-card dx-card-min-width dx-card-max-width min-h-(--dx-rail-item) group/card relative overflow-hidden',
|
|
22
|
+
border &&
|
|
23
|
+
'bg-card-surface border border-separator dark:border-subdued-separator rounded-xs dx-focus-ring-group-y-indicator',
|
|
24
|
+
fullWidth && 'max-w-none!',
|
|
25
|
+
...etc,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const cardToolbar: ComponentFunction<CardStyleProps> = (_, ...etc) =>
|
|
29
|
+
mx(
|
|
30
|
+
'dx-card__toolbar dx-density-fine bg-transparent p-0! gap-0! col-span-3 grid! grid-cols-subgrid! [contain:none]',
|
|
31
|
+
...etc,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const cardTitle: ComponentFunction<CardStyleProps> = (_props, ...etc) => mx('dx-card__title grow truncate', ...etc);
|
|
35
|
+
|
|
36
|
+
const cardContent: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
|
|
37
|
+
mx('dx-card__content contents pb-1 last:pb-0', ...etc);
|
|
38
|
+
|
|
39
|
+
const cardHeading: ComponentFunction<CardStyleProps> = ({ variant = 'default' }, ...etc) =>
|
|
40
|
+
mx(
|
|
41
|
+
'dx-card__heading',
|
|
42
|
+
variant === 'default' && 'py-1',
|
|
43
|
+
variant === 'subtitle' && 'py-2 text-xs text-description font-medium uppercase',
|
|
44
|
+
...etc,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const cardText: ComponentFunction<CardStyleProps> = ({ variant = 'default', truncate: _truncate }, ...etc) =>
|
|
48
|
+
mx(
|
|
49
|
+
'dx-card__text items-center overflow-hidden',
|
|
50
|
+
variant === 'default' && 'py-1',
|
|
51
|
+
variant === 'description' && 'py-1.5 text-description',
|
|
52
|
+
...etc,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const cardTextSpan: ComponentFunction<CardStyleProps> = ({ variant = 'default', truncate }, ...etc) =>
|
|
56
|
+
mx(variant === 'description' && 'text-sm text-description line-clamp-3', truncate && 'truncate', ...etc);
|
|
57
|
+
|
|
58
|
+
const cardPoster: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
|
|
59
|
+
mx('dx-card__poster col-span-3 max-h-[200px]', ...etc);
|
|
60
|
+
|
|
61
|
+
const cardPosterIcon: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
|
|
62
|
+
mx('dx-card__poster-icon col-span-3 grid place-items-center bg-input-surface text-subdued max-h-[200px]', ...etc);
|
|
63
|
+
|
|
64
|
+
const cardAction: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
|
|
65
|
+
mx('dx-card__acztion col-span-3 !grid grid-cols-subgrid p-0! w-full text-start overflow-hidden', ...etc);
|
|
66
|
+
|
|
67
|
+
const cardActionLabel: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
|
|
68
|
+
mx('dx-card__action-label min-w-0 flex-1 truncate', ...etc);
|
|
69
|
+
|
|
70
|
+
const cardLink: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
|
|
71
|
+
mx('dx-card__link col-span-3 !grid grid-cols-subgrid group p-0! dx-button dx-focus-ring min-h-1!', ...etc);
|
|
72
|
+
|
|
73
|
+
const cardLinkLabel: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
|
|
74
|
+
mx('dx-card__link-label min-w-0 flex-1 truncate', ...etc);
|
|
75
|
+
|
|
76
|
+
const cardRow: ComponentFunction<CardStyleProps> = (_, ...etc) =>
|
|
77
|
+
mx('dx-card__row col-span-3 grid grid-cols-subgrid', ...etc);
|
|
78
|
+
|
|
79
|
+
const cardIconBlock: ComponentFunction<CardStyleProps> = ({ padding }, ...etc) =>
|
|
80
|
+
mx(
|
|
81
|
+
'dx-card__icon-block grid h-[var(--dx-rail-item)] w-[var(--dx-rail-item)] place-items-center',
|
|
82
|
+
padding && '[&>*]:p-1',
|
|
83
|
+
...etc,
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const cardTheme: Theme<CardStyleProps> = {
|
|
87
|
+
root: cardRoot,
|
|
88
|
+
toolbar: cardToolbar,
|
|
89
|
+
title: cardTitle,
|
|
90
|
+
content: cardContent,
|
|
91
|
+
row: cardRow,
|
|
92
|
+
heading: cardHeading,
|
|
93
|
+
text: cardText,
|
|
94
|
+
'text-span': cardTextSpan,
|
|
95
|
+
poster: cardPoster,
|
|
96
|
+
'poster-icon': cardPosterIcon,
|
|
97
|
+
action: cardAction,
|
|
98
|
+
'action-label': cardActionLabel,
|
|
99
|
+
link: cardLink,
|
|
100
|
+
'link-label': cardLinkLabel,
|
|
101
|
+
'icon-block': cardIconBlock,
|
|
102
|
+
};
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
7
|
import { mx } from '../../util';
|
|
8
|
-
import {
|
|
8
|
+
import { withColumn } from '../primitives/column';
|
|
9
9
|
|
|
10
10
|
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
11
11
|
|
|
12
12
|
const sizeMap: Record<DialogSize, string> = {
|
|
13
|
-
sm: 'md
|
|
14
|
-
md: 'md
|
|
15
|
-
lg: 'md
|
|
16
|
-
xl: 'md
|
|
13
|
+
sm: 'md:max-w-[24rem]',
|
|
14
|
+
md: 'md:max-w-[32rem]!',
|
|
15
|
+
lg: 'md:max-w-[40rem]!',
|
|
16
|
+
xl: 'md:max-w-[60rem]!',
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export type DialogStyleProps = {
|
|
@@ -25,28 +25,37 @@ export type DialogStyleProps = {
|
|
|
25
25
|
|
|
26
26
|
export const dialogOverlay: ComponentFunction<DialogStyleProps> = (_props, ...etc) => mx('dx-dialog__overlay', ...etc);
|
|
27
27
|
|
|
28
|
-
export const dialogContent: ComponentFunction<DialogStyleProps> = ({ inOverlayLayout, size }, ...etc) => {
|
|
28
|
+
export const dialogContent: ComponentFunction<DialogStyleProps> = ({ inOverlayLayout, size = 'md' }, ...etc) => {
|
|
29
29
|
return mx(
|
|
30
|
-
'@container
|
|
30
|
+
'@container',
|
|
31
|
+
'dx-dialog__content dx-focus-ring dx-modal-surface dx-density-coarse py-4',
|
|
31
32
|
!inOverlayLayout && 'fixed z-50 top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]',
|
|
32
|
-
|
|
33
|
+
sizeMap[size],
|
|
33
34
|
...etc,
|
|
34
35
|
);
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
export const dialogHeader: ComponentFunction<DialogStyleProps> = (_props, ...etc) =>
|
|
38
|
-
mx('dx-dialog__header flex items-center justify-between', ...etc);
|
|
39
|
+
mx('dx-dialog__header flex pb-4 items-center justify-between', withColumn.center(), ...etc);
|
|
40
|
+
|
|
41
|
+
export const dialogBody: ComponentFunction<DialogStyleProps> = (_props, ...etc) =>
|
|
42
|
+
mx('dx-dialog__body dx-expander', withColumn.propagate(), ...etc);
|
|
43
|
+
|
|
44
|
+
export const dialogActionBar: ComponentFunction<DialogStyleProps> = (_props, ...etc) =>
|
|
45
|
+
mx('dx-dialog__actionbar flex items-center pt-4 gap-2 dx-density-coarse', withColumn.center(), ...etc);
|
|
39
46
|
|
|
40
47
|
export const dialogTitle: ComponentFunction<DialogStyleProps> = ({ srOnly }, ...etc) =>
|
|
41
48
|
mx('dx-dialog__title', srOnly && 'sr-only', ...etc);
|
|
42
49
|
|
|
43
50
|
export const dialogDescription: ComponentFunction<DialogStyleProps> = ({ srOnly }, ...etc) =>
|
|
44
|
-
mx('dx-dialog__description',
|
|
51
|
+
mx('dx-dialog__description', 'text-description', srOnly && 'sr-only', ...etc);
|
|
45
52
|
|
|
46
53
|
export const dialogTheme: Theme<DialogStyleProps> = {
|
|
47
54
|
overlay: dialogOverlay,
|
|
48
55
|
content: dialogContent,
|
|
49
56
|
header: dialogHeader,
|
|
57
|
+
body: dialogBody,
|
|
58
|
+
actionbar: dialogActionBar,
|
|
50
59
|
title: dialogTitle,
|
|
51
60
|
description: dialogDescription,
|
|
52
61
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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 FocusStyleProps = {
|
|
10
|
+
border?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Focus ring styles shared by Focus.Group and Focus.Item.
|
|
15
|
+
* Uses a `::after` pseudo-element overlay so the ring paints above child content
|
|
16
|
+
* (inset box-shadow alone is obscured by children with backgrounds).
|
|
17
|
+
* The pseudo-element is `pointer-events-none` and absolutely positioned over the element.
|
|
18
|
+
* When `border` is true, a subdued CSS border is always visible (e.g., for grid cell edges).
|
|
19
|
+
*/
|
|
20
|
+
const focusRing: ComponentFunction<FocusStyleProps> = ({ border }, ...etc) =>
|
|
21
|
+
mx(
|
|
22
|
+
'dx-ring-pseudo outline-hidden',
|
|
23
|
+
'focus:after:ring-neutral-focus-indicator',
|
|
24
|
+
'data-[focus-state=active]:after:ring-neutral-focus-indicator',
|
|
25
|
+
'data-[focus-state=error]:after:ring-rose-500',
|
|
26
|
+
border && 'border border-separator',
|
|
27
|
+
...etc,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const focusTheme: Theme<FocusStyleProps> = {
|
|
31
|
+
group: focusRing,
|
|
32
|
+
item: focusRing,
|
|
33
|
+
};
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
import type { ComponentFunction, Theme } from '@dxos/ui-types';
|
|
6
6
|
|
|
7
7
|
import { mx } from '../../util';
|
|
8
|
-
|
|
9
8
|
import { type ButtonStyleProps } from './button';
|
|
10
9
|
|
|
11
10
|
export type IconButtonStyleProps = ButtonStyleProps & { iconOnly?: boolean };
|
|
12
11
|
|
|
13
|
-
// TODO(burdon): Gap/font size should depend on density.
|
|
14
12
|
export const iconButtonRoot: ComponentFunction<IconButtonStyleProps> = ({ iconOnly }, ...etc) => {
|
|
15
|
-
return mx('
|
|
13
|
+
return mx('px-1.5', !iconOnly && 'gap-2', ...etc);
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
export const iconButtonTheme: Theme<IconButtonStyleProps> = {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentFunction, type Size, type Theme } from '@dxos/ui-types';
|
|
6
|
+
|
|
7
|
+
import { getSize, mx } from '../../util';
|
|
8
|
+
|
|
9
|
+
export type IconStyleProps = {
|
|
10
|
+
size?: Size;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Size can be specified directly, or inherited from a container (e.g., toolbar).
|
|
15
|
+
*/
|
|
16
|
+
export const iconRoot: ComponentFunction<IconStyleProps> = ({ size }, etc) => {
|
|
17
|
+
return mx(
|
|
18
|
+
'shrink-0 text-[var(--icons-color,currentColor)]',
|
|
19
|
+
size
|
|
20
|
+
? getSize(size)
|
|
21
|
+
: '[width:var(--icon-size,var(--dx-default-icons-size))] [height:var(--icon-size,var(--dx-default-icons-size))]',
|
|
22
|
+
etc,
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const iconTheme: Theme<IconStyleProps> = {
|
|
27
|
+
root: iconRoot,
|
|
28
|
+
};
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './anchored-overflow';
|
|
6
5
|
export * from './avatar';
|
|
7
6
|
export * from './breadcrumb';
|
|
7
|
+
export * from './card';
|
|
8
8
|
export * from './button';
|
|
9
9
|
export * from './dialog';
|
|
10
|
+
export * from './focus';
|
|
10
11
|
export * from './icon';
|
|
11
12
|
export * from './icon-button';
|
|
12
13
|
export * from './input';
|
|
@@ -18,7 +19,9 @@ export * from './message';
|
|
|
18
19
|
export * from './popover';
|
|
19
20
|
export * from './scroll-area';
|
|
20
21
|
export * from './select';
|
|
22
|
+
export * from './splitter';
|
|
21
23
|
export * from './separator';
|
|
24
|
+
export * from './skeleton';
|
|
22
25
|
export * from './status';
|
|
23
26
|
export * from './tag';
|
|
24
27
|
export * from './toast';
|
|
@@ -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
|
|