@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
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { cp, mkdir } from 'node:fs/promises';
|
|
6
|
-
import { basename, join, relative, resolve } from 'node:path';
|
|
7
|
-
|
|
8
|
-
import autoprefixer from 'autoprefixer';
|
|
9
|
-
import type { Plugin } from 'esbuild';
|
|
10
|
-
import stylePlugin from 'esbuild-style-plugin';
|
|
11
|
-
import tailwindcss from 'tailwindcss';
|
|
12
|
-
import type { ThemeConfig } from 'tailwindcss/types/config';
|
|
13
|
-
|
|
14
|
-
import { tailwindConfig } from '../config';
|
|
15
|
-
|
|
16
|
-
import { resolveKnownPeers } from './resolveContent';
|
|
17
|
-
|
|
18
|
-
export const ThemePlugins = async (options: {
|
|
19
|
-
content: string[];
|
|
20
|
-
root?: string;
|
|
21
|
-
outdir: string;
|
|
22
|
-
extensions?: Partial<ThemeConfig>[];
|
|
23
|
-
}): Promise<Plugin[]> => {
|
|
24
|
-
const resolvedContent = options.root ? await resolveKnownPeers(options.content, options.root) : options.content;
|
|
25
|
-
return [
|
|
26
|
-
// TODO(thure): This really shouldn’t be this way, but after hours of searching for a reasonable way to do this I came up empty. The prior art I found was mainly this thread, though it’s only tangentially related: https://github.com/evanw/esbuild/issues/800#issuecomment-786151076
|
|
27
|
-
{
|
|
28
|
-
name: 'esbuild-plugin-dxos-ui-theme-resolvers',
|
|
29
|
-
setup: async (build) => {
|
|
30
|
-
const fontsDir = join(options.outdir, 'node_modules/@dxos/ui-theme/fonts');
|
|
31
|
-
try {
|
|
32
|
-
await mkdir(fontsDir);
|
|
33
|
-
} catch {}
|
|
34
|
-
build.onResolve({ filter: /\.woff2$/ }, async (args) => {
|
|
35
|
-
const depPath = resolve(args.resolveDir, args.path);
|
|
36
|
-
const destPath = join(fontsDir, basename(args.path));
|
|
37
|
-
try {
|
|
38
|
-
await cp(depPath, destPath);
|
|
39
|
-
} catch {}
|
|
40
|
-
return {
|
|
41
|
-
path: `./${relative(options.outdir, join('fonts', basename(args.path)))}`,
|
|
42
|
-
external: true,
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
// TODO(thure): theme.css must be part of entryPoints in order to be processed with `stylePlugin`, but this should not be necessary. ESBuild would not load theme.css using stylePlugin if referenced within index.ts(x) as with the Vite plugin.
|
|
48
|
-
// TODO(thure): Note also that because it is an entryPoint, the developer has to reference the built theme.css from `index.html`, which is inflexible and possibly inconvenient.
|
|
49
|
-
// TODO(zhenyasav): autoprefixer version misalignment with esbuild-style-plugin requires the `as any`.
|
|
50
|
-
stylePlugin({
|
|
51
|
-
postcss: {
|
|
52
|
-
plugins: [
|
|
53
|
-
tailwindcss(
|
|
54
|
-
tailwindConfig({
|
|
55
|
-
env: process.env.NODE_ENV,
|
|
56
|
-
content: resolvedContent,
|
|
57
|
-
extensions: options.extensions,
|
|
58
|
-
}),
|
|
59
|
-
),
|
|
60
|
-
autoprefixer as any,
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
];
|
|
65
|
-
};
|
package/src/plugins/plugin.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
/* eslint-disable no-console */
|
|
6
|
-
|
|
7
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
8
|
-
import { resolve } from 'node:path';
|
|
9
|
-
|
|
10
|
-
import chTokens from '@ch-ui/tokens/postcss';
|
|
11
|
-
import autoprefixer from 'autoprefixer';
|
|
12
|
-
import postcss from 'postcss';
|
|
13
|
-
import postcssImport from 'postcss-import';
|
|
14
|
-
import tailwindcss from 'tailwindcss';
|
|
15
|
-
import nesting from 'tailwindcss/nesting/index.js';
|
|
16
|
-
import { type ThemeConfig } from 'tailwindcss/types/config';
|
|
17
|
-
import { type Plugin, type UserConfig } from 'vite';
|
|
18
|
-
|
|
19
|
-
import { tailwindConfig, tokenSet } from '../config';
|
|
20
|
-
|
|
21
|
-
import { resolveKnownPeers } from './resolveContent';
|
|
22
|
-
|
|
23
|
-
export type ThemePluginOptions = {
|
|
24
|
-
jit?: boolean;
|
|
25
|
-
cssPath?: string;
|
|
26
|
-
srcCssPath?: string;
|
|
27
|
-
virtualFileId?: string;
|
|
28
|
-
content?: string[];
|
|
29
|
-
root?: string;
|
|
30
|
-
verbose?: boolean;
|
|
31
|
-
extensions?: Partial<ThemeConfig>[];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
let environment!: string;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Configures PostCSS pipeline for theme.css processing.
|
|
38
|
-
* @param environment - The current environment (development/production).
|
|
39
|
-
* @param config - Theme plugin configuration options.
|
|
40
|
-
* @returns Array of PostCSS plugins.
|
|
41
|
-
*/
|
|
42
|
-
const createPostCSSPipeline = (environment: string, config: ThemePluginOptions): postcss.Transformer[] => [
|
|
43
|
-
// Handles @import statements in CSS.
|
|
44
|
-
postcssImport(),
|
|
45
|
-
// Processes CSS nesting syntax.
|
|
46
|
-
nesting,
|
|
47
|
-
// Processes custom design tokens.
|
|
48
|
-
chTokens({ config: () => tokenSet }),
|
|
49
|
-
// Processes Tailwind directives and utilities.
|
|
50
|
-
tailwindcss(
|
|
51
|
-
tailwindConfig({
|
|
52
|
-
env: environment,
|
|
53
|
-
content: config.content,
|
|
54
|
-
extensions: config.extensions,
|
|
55
|
-
}),
|
|
56
|
-
),
|
|
57
|
-
// Adds vendor prefixes.
|
|
58
|
-
autoprefixer as any,
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Vite plugin to configure theme.
|
|
63
|
-
*/
|
|
64
|
-
export const ThemePlugin = (options: ThemePluginOptions): Plugin => {
|
|
65
|
-
const config: ThemePluginOptions = {
|
|
66
|
-
jit: true,
|
|
67
|
-
cssPath: resolve(import.meta.dirname, '../theme.css'),
|
|
68
|
-
srcCssPath: resolve(import.meta.dirname, '../../../../src/theme.css'),
|
|
69
|
-
virtualFileId: '@dxos-theme',
|
|
70
|
-
...options,
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
if (process.env.DEBUG) {
|
|
74
|
-
console.log('ThemePlugin config:\n', JSON.stringify(config, null, 2));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
name: 'vite-plugin-dxos-ui-theme',
|
|
79
|
-
config: async ({ root }, env): Promise<UserConfig> => {
|
|
80
|
-
environment = env.mode;
|
|
81
|
-
const content = root ? await resolveKnownPeers(config.content ?? [], root) : config.content;
|
|
82
|
-
if (options.verbose) {
|
|
83
|
-
console.log('content', content);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
css: {
|
|
88
|
-
postcss: {
|
|
89
|
-
plugins: createPostCSSPipeline(environment, config),
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
resolveId: (id) => {
|
|
95
|
-
if (id === config.virtualFileId) {
|
|
96
|
-
return config.cssPath;
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
handleHotUpdate: async ({ file, server }) => {
|
|
100
|
-
// NOTE(ZaymonFC): Changes to *any* CSS file triggers this step. We might want to refine this.
|
|
101
|
-
// Ignore the output file to prevent infinite loops.
|
|
102
|
-
if (file.endsWith('.css') && file !== config.cssPath) {
|
|
103
|
-
try {
|
|
104
|
-
// Get reference to the theme virtual module.
|
|
105
|
-
const module = server.moduleGraph.getModuleById(config.cssPath!);
|
|
106
|
-
if (module) {
|
|
107
|
-
// Read the source theme file that imports all other CSS files.
|
|
108
|
-
const css = await readFile(config.srcCssPath!, 'utf8');
|
|
109
|
-
const processor = postcss(createPostCSSPipeline(environment, config));
|
|
110
|
-
console.log('[theme-plugin] Reprocessing CSS with PostCSS.');
|
|
111
|
-
const result = await processor.process(css, {
|
|
112
|
-
from: config.srcCssPath,
|
|
113
|
-
to: config.cssPath,
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
if (result.css) {
|
|
117
|
-
await writeFile(config.cssPath!, result.css);
|
|
118
|
-
// Return the module to trigger HMR update.
|
|
119
|
-
return [];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
} catch (err) {
|
|
123
|
-
console.error('[theme-plugin] Error:', err);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
ThemePlugin.foo = 'bar';
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { promisify } from 'node:util';
|
|
6
|
-
|
|
7
|
-
import Glob from 'glob';
|
|
8
|
-
|
|
9
|
-
const glob = promisify(Glob.glob);
|
|
10
|
-
|
|
11
|
-
// TODO(burdon): Comment.
|
|
12
|
-
const knownIndirectPeers = [
|
|
13
|
-
'@dxos/devtools',
|
|
14
|
-
'@dxos/react-*',
|
|
15
|
-
'@dxos/react-ui-*',
|
|
16
|
-
// TODO(thure): glob v7 runs out of memory if we do a `**` search, and this is (hopefully) the only L3 content package; find a better solution.
|
|
17
|
-
'@dxos/react-ui-table/node_modules/@dxos/react-ui-searchlist',
|
|
18
|
-
'@dxos/shell',
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const knownDirectPeers = ['@dxos/plugin-*', ...knownIndirectPeers];
|
|
22
|
-
|
|
23
|
-
const packageNamePattern = /.*node_modules\/(.+?)$/;
|
|
24
|
-
const packageName = (path: string) => path.match(packageNamePattern)?.[1];
|
|
25
|
-
|
|
26
|
-
const flatten = (acc: string[], group: string[]) => [...acc, ...group];
|
|
27
|
-
const dedupe = (acc: Record<string, string>, path: string) => {
|
|
28
|
-
const name = packageName(path);
|
|
29
|
-
if (name && !acc[name]) {
|
|
30
|
-
acc[name] = path;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return acc;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const resolveKnownPeers = async (content: string[], cwd: string): Promise<string[]> => {
|
|
37
|
-
const globOptions = { cwd, absolute: true };
|
|
38
|
-
|
|
39
|
-
const directPeers = await Promise.all(knownDirectPeers.map((peer) => glob(`./node_modules/${peer}`, globOptions)));
|
|
40
|
-
|
|
41
|
-
// NOTE(thure): With glob v7, JS runs out of memory if `**` is used, so this limits the search to @dxos/plugin-*/node_modules
|
|
42
|
-
const indirectPeers = await Promise.all(
|
|
43
|
-
knownIndirectPeers.map((peer) => glob(`./node_modules/@dxos/plugin-*/node_modules/${peer}`, globOptions)),
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const knownPeerContent = Object.values(
|
|
47
|
-
indirectPeers.reduce(flatten, []).reduce(dedupe, directPeers.reduce(flatten, []).reduce(dedupe, {})),
|
|
48
|
-
).map((value) => `${value}/dist/lib/**/*.mjs`);
|
|
49
|
-
|
|
50
|
-
return [...content, ...knownPeerContent];
|
|
51
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
|
|
9
|
-
export type AnchoredOverflowStyleProps = {};
|
|
10
|
-
|
|
11
|
-
export const anchoredOverflowRoot: ComponentFunction<AnchoredOverflowStyleProps> = (_props, ...etc) =>
|
|
12
|
-
mx('overflow-anchored overflow-auto', ...etc);
|
|
13
|
-
|
|
14
|
-
export const anchoredOverflowAnchor: ComponentFunction<AnchoredOverflowStyleProps> = (_props, ...etc) =>
|
|
15
|
-
mx('overflow-anchor is-px bs-px', ...etc);
|
|
16
|
-
|
|
17
|
-
export const anchoredOverflowTheme: Theme<AnchoredOverflowStyleProps> = {
|
|
18
|
-
root: anchoredOverflowRoot,
|
|
19
|
-
anchor: anchoredOverflowAnchor,
|
|
20
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import type { ComponentFunction, Density, Elevation, Theme } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
import { ghostHover } from '../fragments';
|
|
9
|
-
|
|
10
|
-
export const primaryButtonColors =
|
|
11
|
-
'text-accentSurfaceText bg-accentSurface hover:bg-accentSurfaceHover 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-inputSurface';
|
|
14
|
-
|
|
15
|
-
export const defaultButtonColors = mx(
|
|
16
|
-
staticDefaultButtonColors,
|
|
17
|
-
'data-[state=open]:bg-inputSurface aria-pressed:text-accentText aria-pressed:bg-baseSurface aria-checked:text-accentText aria-checked:bg-baseSurface',
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export const ghostButtonColors = mx(
|
|
21
|
-
ghostHover,
|
|
22
|
-
'hover:text-inherit data-[state=open]:bg-inputSurface aria-pressed:text-accentText aria-pressed:bg-baseSurface aria-checked:text-accentText aria-checked:bg-baseSurface',
|
|
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
|
-
export const buttonRoot: ComponentFunction<ButtonStyleProps> = (_props, ...etc) => {
|
|
35
|
-
return mx('dx-button dx-focus-ring group max-is-full [&_span]:truncate', ...etc);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const buttonGroup: ComponentFunction<{ elevation?: Elevation }> = (_props, ...etc) => {
|
|
39
|
-
return mx(
|
|
40
|
-
'inline-flex rounded-sm [&>:first-child]:rounded-is-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
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ComponentFunction, type Size, type Theme } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
import { getSize } from '../fragments';
|
|
9
|
-
|
|
10
|
-
export type IconStyleProps = {
|
|
11
|
-
size?: Size;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const iconRoot: ComponentFunction<IconStyleProps> = ({ size }, etc) =>
|
|
15
|
-
mx('shrink-0 bs-[1em] is-[1em] text-[var(--icons-color,currentColor)]', size && getSize(size), etc);
|
|
16
|
-
|
|
17
|
-
export const iconTheme: Theme<IconStyleProps> = {
|
|
18
|
-
root: iconRoot,
|
|
19
|
-
};
|
|
@@ -1,177 +0,0 @@
|
|
|
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 { mx } from '../../util';
|
|
15
|
-
import {
|
|
16
|
-
coarseBlockSize,
|
|
17
|
-
coarseDimensions,
|
|
18
|
-
computeSize,
|
|
19
|
-
descriptionText,
|
|
20
|
-
fineBlockSize,
|
|
21
|
-
fineDimensions,
|
|
22
|
-
focusRing,
|
|
23
|
-
getSize,
|
|
24
|
-
getSizeHeight,
|
|
25
|
-
getSizeWidth,
|
|
26
|
-
placeholderText,
|
|
27
|
-
sizeValue,
|
|
28
|
-
staticDisabled,
|
|
29
|
-
staticFocusRing,
|
|
30
|
-
subduedFocus,
|
|
31
|
-
valenceColorText,
|
|
32
|
-
} from '../fragments';
|
|
33
|
-
|
|
34
|
-
export type InputStyleProps = Partial<{
|
|
35
|
-
variant: 'default' | 'subdued' | 'static';
|
|
36
|
-
density: Density;
|
|
37
|
-
disabled: boolean;
|
|
38
|
-
elevation: Elevation;
|
|
39
|
-
focused: boolean;
|
|
40
|
-
validationValence: MessageValence;
|
|
41
|
-
size: Size;
|
|
42
|
-
checked: boolean;
|
|
43
|
-
}>;
|
|
44
|
-
|
|
45
|
-
export type InputMetaStyleProps = Partial<{
|
|
46
|
-
srOnly: boolean;
|
|
47
|
-
validationValence: MessageValence;
|
|
48
|
-
}>;
|
|
49
|
-
|
|
50
|
-
export const neutralInputValence = '';
|
|
51
|
-
export const successInputValence = 'shadow-emerald-500/50 dark:shadow-emerald-600/50';
|
|
52
|
-
export const infoInputValence = 'shadow-cyan-500/50 dark:shadow-cyan-600/50';
|
|
53
|
-
export const warningInputValence = 'shadow-amber-500/50 dark:shadow-amber-600/50';
|
|
54
|
-
export const errorInputValence = 'shadow-rose-500/50 dark:shadow-rose-600/50';
|
|
55
|
-
|
|
56
|
-
const textInputSurfaceFocus =
|
|
57
|
-
'transition-colors bg-textInputSurface focus:bg-focusSurface border border-separator focus:border-separator';
|
|
58
|
-
|
|
59
|
-
const textInputSurfaceHover = 'hover:bg-textInputSurface focus:hover:bg-focusSurface';
|
|
60
|
-
|
|
61
|
-
const booleanInputSurface =
|
|
62
|
-
'shadow-inner transition-colors bg-unAccent aria-checked:bg-accentSurface aria-[checked=mixed]:bg-accentSurface';
|
|
63
|
-
|
|
64
|
-
const booleanInputSurfaceHover =
|
|
65
|
-
'hover:bg-unAccentHover hover:aria-checked:bg-accentSurfaceHover hover:aria-[checked=mixed]:bg-accentSurfaceHover';
|
|
66
|
-
|
|
67
|
-
export const inputTextLabel =
|
|
68
|
-
'text-description text-xs font-medium mbs-inputSpacingBlock mbe-labelSpacingBlock first:mbs-0';
|
|
69
|
-
|
|
70
|
-
export const inputValence = (valence?: MessageValence) => {
|
|
71
|
-
switch (valence) {
|
|
72
|
-
case 'success':
|
|
73
|
-
return successInputValence;
|
|
74
|
-
case 'info':
|
|
75
|
-
return infoInputValence;
|
|
76
|
-
case 'warning':
|
|
77
|
-
return warningInputValence;
|
|
78
|
-
case 'error':
|
|
79
|
-
return errorInputValence;
|
|
80
|
-
default:
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// TODO(burdon): Factor out color defs?
|
|
86
|
-
|
|
87
|
-
const sharedSubduedInputStyles: ComponentFragment<InputStyleProps> = (props) => [
|
|
88
|
-
'plb-0 is-full bg-transparent text-current [[data-drag-autoscroll="active"]_&]:pointer-events-none',
|
|
89
|
-
props.density === 'fine' ? fineBlockSize : coarseBlockSize,
|
|
90
|
-
placeholderText,
|
|
91
|
-
subduedFocus,
|
|
92
|
-
props.disabled && staticDisabled,
|
|
93
|
-
];
|
|
94
|
-
|
|
95
|
-
const sharedDefaultInputStyles: ComponentFragment<InputStyleProps> = (props) => [
|
|
96
|
-
'plb-0 is-full text-baseText rounded-sm text-[color:var(--surface-text)] [[data-drag-autoscroll="active"]_&]:pointer-events-none',
|
|
97
|
-
textInputSurfaceFocus,
|
|
98
|
-
placeholderText,
|
|
99
|
-
props.density === 'fine' ? fineDimensions : coarseDimensions,
|
|
100
|
-
props.disabled ? staticDisabled : textInputSurfaceHover,
|
|
101
|
-
];
|
|
102
|
-
|
|
103
|
-
const sharedStaticInputStyles: ComponentFragment<InputStyleProps> = (props) => [
|
|
104
|
-
'plb-0 is-full text-baseText rounded-sm text-[color:var(--surface-text)] [[data-drag-autoscroll="active"]_&]:pointer-events-none',
|
|
105
|
-
textInputSurfaceFocus,
|
|
106
|
-
textInputSurfaceHover,
|
|
107
|
-
props.focused && 'bg-attention',
|
|
108
|
-
placeholderText,
|
|
109
|
-
inputValence(props.validationValence),
|
|
110
|
-
props.disabled && staticDisabled,
|
|
111
|
-
props.focused && staticFocusRing,
|
|
112
|
-
];
|
|
113
|
-
|
|
114
|
-
export const inputInput: ComponentFunction<InputStyleProps> = (props, ...etc) =>
|
|
115
|
-
props.variant === 'subdued'
|
|
116
|
-
? mx(...sharedSubduedInputStyles(props), ...etc)
|
|
117
|
-
: props.variant === 'static'
|
|
118
|
-
? mx(...sharedStaticInputStyles(props), ...etc)
|
|
119
|
-
: mx(
|
|
120
|
-
...sharedDefaultInputStyles(props),
|
|
121
|
-
!props.disabled && focusRing,
|
|
122
|
-
inputValence(props.validationValence) || neutralInputValence,
|
|
123
|
-
...etc,
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
export const inputCheckbox: ComponentFunction<InputStyleProps> = ({ size = 5 }, ...etc) =>
|
|
127
|
-
mx('dx-checkbox dx-focus-ring', getSize(size), ...etc);
|
|
128
|
-
|
|
129
|
-
export const inputCheckboxIndicator: ComponentFunction<InputStyleProps> = ({ size = 5, checked }, ...etc) =>
|
|
130
|
-
mx(getSize(computeSize(sizeValue(size) * 0.65, 4)), !checked && 'invisible', ...etc);
|
|
131
|
-
|
|
132
|
-
export const inputSwitch: ComponentFunction<InputStyleProps> = ({ size = 5, disabled }, ...etc) =>
|
|
133
|
-
mx(
|
|
134
|
-
getSizeHeight(size),
|
|
135
|
-
getSizeWidth(computeSize(sizeValue(size) * 1.75, 9)),
|
|
136
|
-
booleanInputSurface,
|
|
137
|
-
!disabled && booleanInputSurfaceHover,
|
|
138
|
-
// TODO(burdon): Added m-1 margin to make 40px width to align with 40px icon button.
|
|
139
|
-
'cursor-pointer shrink-0 rounded-full pli-1 mx-1 relative',
|
|
140
|
-
focusRing,
|
|
141
|
-
...etc,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
export const inputSwitchThumb: ComponentFunction<InputStyleProps> = ({ size = 5 }, ...etc) =>
|
|
145
|
-
mx(
|
|
146
|
-
getSize(size === 'px' ? 'px' : ((size - 2) as Size)),
|
|
147
|
-
'block bg-white rounded-full transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[100%]',
|
|
148
|
-
...etc,
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
export const inputWithSegmentsInput: ComponentFunction<InputStyleProps> = (props, ...etc) =>
|
|
152
|
-
mx('font-mono selection:bg-transparent mli-auto', props.disabled && 'cursor-not-allowed', ...etc);
|
|
153
|
-
|
|
154
|
-
export const inputLabel: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
155
|
-
mx('block', inputTextLabel, props.srOnly && 'sr-only', ...etc);
|
|
156
|
-
|
|
157
|
-
export const inputDescription: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
158
|
-
mx(descriptionText, props.srOnly && 'sr-only', ...etc);
|
|
159
|
-
|
|
160
|
-
export const inputDescriptionAndValidation: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
161
|
-
mx('leading-none mlb-labelSpacingBlock', props.srOnly && 'sr-only', ...etc);
|
|
162
|
-
|
|
163
|
-
export const inputValidation: ComponentFunction<InputMetaStyleProps> = (props, ...etc) =>
|
|
164
|
-
mx(descriptionText, props.srOnly ? 'sr-only' : valenceColorText(props.validationValence), ...etc);
|
|
165
|
-
|
|
166
|
-
export const inputTheme = {
|
|
167
|
-
input: inputInput,
|
|
168
|
-
inputWithSegments: inputWithSegmentsInput,
|
|
169
|
-
checkbox: inputCheckbox,
|
|
170
|
-
checkboxIndicator: inputCheckboxIndicator,
|
|
171
|
-
label: inputLabel,
|
|
172
|
-
description: inputDescription,
|
|
173
|
-
validation: inputValidation,
|
|
174
|
-
switch: inputSwitch,
|
|
175
|
-
switchThumb: inputSwitchThumb,
|
|
176
|
-
descriptionAndValidation: inputDescriptionAndValidation,
|
|
177
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
|
|
9
|
-
export type ScrollAreaStyleProps = {};
|
|
10
|
-
|
|
11
|
-
export const scrollAreaRoot: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
12
|
-
mx('__bs-full __is-full overflow-hidden', ...etc);
|
|
13
|
-
|
|
14
|
-
export const scrollAreaViewport: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
15
|
-
// mx('bs-full is-full [&>div]:is-full [&>div]:bs-auto', ...etc);
|
|
16
|
-
mx('bs-full is-full [&>div]:table-fixed [&>div]:is-full', ...etc);
|
|
17
|
-
|
|
18
|
-
export const scrollAreaScrollbar: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
19
|
-
mx(
|
|
20
|
-
'flex select-none touch-none p-0.5 ease-out',
|
|
21
|
-
'data-[orientation=vertical]:is-1.5 sm:data-[orientation=vertical]:data-[variant=coarse]:is-3',
|
|
22
|
-
'data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:bs-1.5 sm:data-[orientation=horizontal]:data-[variant=coarse]:bs-3',
|
|
23
|
-
'sm:data-[variant=coarse]:bg-separator rounded-full',
|
|
24
|
-
'[&>div]:bg-unAccent sm:[&[data-variant=coarse]>div]:bg-attention',
|
|
25
|
-
...etc,
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export const scrollAreaThumb: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) =>
|
|
29
|
-
mx(
|
|
30
|
-
'flex-1 rounded-full relative',
|
|
31
|
-
"before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:is-full before:bs-full before:min-w-[6px] before:min-h-[6px]",
|
|
32
|
-
...etc,
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export const scrollAreaCorner: ComponentFunction<ScrollAreaStyleProps> = (_props, ...etc) => mx(...etc);
|
|
36
|
-
|
|
37
|
-
export const scrollAreaTheme: Theme<ScrollAreaStyleProps> = {
|
|
38
|
-
root: scrollAreaRoot,
|
|
39
|
-
viewport: scrollAreaViewport,
|
|
40
|
-
scrollbar: scrollAreaScrollbar,
|
|
41
|
-
thumb: scrollAreaThumb,
|
|
42
|
-
corner: scrollAreaCorner,
|
|
43
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ComponentFunction, type Theme } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
import { mx } from '../../util';
|
|
8
|
-
import { textBlockWidth } from '../fragments';
|
|
9
|
-
|
|
10
|
-
export type ToolbarStyleProps = Partial<{ layoutManaged: boolean; disabled: boolean }>;
|
|
11
|
-
|
|
12
|
-
export const toolbarLayout =
|
|
13
|
-
'is-full shrink-0 flex flex-nowrap items-center gap-1 p-1 overflow-x-auto scrollbar-none contain-layout';
|
|
14
|
-
|
|
15
|
-
// TODO(burdon): Detect: &:not([data-is-attention-source]_&)]:
|
|
16
|
-
export const toolbarInactive = '*:opacity-20';
|
|
17
|
-
|
|
18
|
-
export const toolbarRoot: ComponentFunction<ToolbarStyleProps> = ({ layoutManaged, disabled }, ...etc) => {
|
|
19
|
-
return mx('bg-toolbarSurface dx-toolbar', !layoutManaged && toolbarLayout, disabled && toolbarInactive, ...etc);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const toolbarInner: ComponentFunction<ToolbarStyleProps> = ({ layoutManaged }, ...etc) => {
|
|
23
|
-
return mx(!layoutManaged && ['flex gap-1', textBlockWidth], ...etc);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const toolbarTheme: Theme<ToolbarStyleProps> = {
|
|
27
|
-
root: toolbarRoot,
|
|
28
|
-
inner: toolbarInner,
|
|
29
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Density } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
export const coarseBlockSize = 'min-bs-[2.5rem]';
|
|
8
|
-
export const coarseTextPadding = 'pli-3';
|
|
9
|
-
export const coarseButtonPadding = 'pli-4';
|
|
10
|
-
export const coarseDimensions = `${coarseBlockSize} ${coarseTextPadding}`;
|
|
11
|
-
export const coarseButtonDimensions = `${coarseBlockSize} ${coarseButtonPadding}`;
|
|
12
|
-
export const fineBlockSize = 'min-bs-[2.5rem] pointer-fine:min-bs-[2rem]';
|
|
13
|
-
export const fineTextPadding = 'pli-2';
|
|
14
|
-
export const fineButtonPadding = 'pli-2.5';
|
|
15
|
-
export const fineDimensions = `${fineBlockSize} ${fineTextPadding}`;
|
|
16
|
-
export const fineButtonDimensions = `${fineBlockSize} ${fineButtonPadding}`;
|
|
17
|
-
export const densityBlockSize = (density: Density = 'coarse') => (density === 'fine' ? fineBlockSize : coarseBlockSize);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
export const focusRing = 'dx-focus-ring';
|
|
6
|
-
|
|
7
|
-
export const dropRing =
|
|
8
|
-
'ring-1 ring-offset-0 ring-primary-350 ring-offset-white dark:ring-primary-450 dark:ring-offset-black';
|
|
9
|
-
|
|
10
|
-
export const dropRingInner =
|
|
11
|
-
'before:z-[1] before:absolute before:inset-0 before:ring-1 before:ring-inset before:ring-primary-350 before:dark:ring-primary-450';
|
|
12
|
-
|
|
13
|
-
export const subduedFocus = 'focus:outline-none focus-visible:outline-none focus:ring-0 ring-0 focus:border-0 border-0';
|
|
14
|
-
|
|
15
|
-
export const staticFocusRing =
|
|
16
|
-
'ring-2 ring-offset-0 ring-primary-350 ring-offset-white dark:ring-primary-450 dark:ring-offset-black';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ComponentFragment, type Elevation } from '@dxos/ui-types';
|
|
6
|
-
|
|
7
|
-
import { surfaceShadow } from './elevation';
|
|
8
|
-
|
|
9
|
-
export const group: ComponentFragment<{ elevation?: Elevation }> = (props) => [
|
|
10
|
-
props.elevation === 'base' ? 'bg-transparent border border-separator' : 'bg-modalSurface',
|
|
11
|
-
surfaceShadow(props),
|
|
12
|
-
];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated
|
|
7
|
-
*/
|
|
8
|
-
export const hoverColors = 'transition-colors duration-100 linear hover:bg-hoverSurface';
|
|
9
|
-
|
|
10
|
-
export const ghostHover = 'hover:bg-hoverSurface';
|
|
11
|
-
export const ghostFocusWithin = 'focus-within:bg-hoverSurface';
|
|
12
|
-
export const subtleHover = 'hover:bg-hoverOverlay';
|
|
13
|
-
|
|
14
|
-
export const hoverableControls =
|
|
15
|
-
'[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]';
|
|
16
|
-
|
|
17
|
-
export const groupHoverControlItemWithTransition = 'transition-opacity duration-200 opacity-0 group-hover:opacity-100';
|
|
18
|
-
|
|
19
|
-
export const hoverableFocusedKeyboardControls = 'focus-visible:[--controls-opacity:1]';
|
|
20
|
-
export const hoverableFocusedWithinControls = 'focus-within:[--controls-opacity:1]';
|
|
21
|
-
export const hoverableFocusedControls = 'focus:[--controls-opacity:1]';
|
|
22
|
-
export const hoverableOpenControlItem = 'hover-hover:aria-[expanded=true]:[--controls-opacity:1]';
|
|
23
|
-
export const hoverableControlItem = 'opacity-[--controls-opacity]';
|
|
24
|
-
export const hoverableControlItemTransition = 'transition-opacity duration-200';
|
|
25
|
-
export const staticHoverableControls = 'hover-hover:[--controls-opacity:1]';
|