@dxos/ui-theme 0.0.0 → 0.8.4-main.16b68245aa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +1372 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/node-esm/index.mjs +1374 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/plugin/node-cjs/main.css +1564 -0
- package/dist/plugin/node-cjs/main.css.map +7 -0
- package/dist/plugin/node-cjs/meta.json +1 -0
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +137 -0
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +7 -0
- package/dist/plugin/node-esm/main.css +1564 -0
- package/dist/plugin/node-esm/main.css.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -0
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +105 -0
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +7 -0
- package/dist/types/src/Theme.stories.d.ts +27 -0
- package/dist/types/src/Theme.stories.d.ts.map +1 -0
- package/dist/types/src/defs.d.ts +21 -0
- package/dist/types/src/defs.d.ts.map +1 -0
- package/dist/types/src/fragments/density.d.ts +4 -0
- package/dist/types/src/fragments/density.d.ts.map +1 -0
- package/dist/types/src/fragments/disabled.d.ts +3 -0
- package/dist/types/src/fragments/disabled.d.ts.map +1 -0
- package/dist/types/src/fragments/hover.d.ts +10 -0
- package/dist/types/src/fragments/hover.d.ts.map +1 -0
- package/dist/types/src/fragments/index.d.ts +5 -0
- package/dist/types/src/fragments/index.d.ts.map +1 -0
- package/dist/types/src/fragments/text.d.ts +2 -0
- package/dist/types/src/fragments/text.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/plugins/ThemePlugin.d.ts +16 -0
- package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -0
- package/dist/types/src/plugins/dark-mode.d.ts +1 -0
- package/dist/types/src/plugins/dark-mode.d.ts.map +1 -0
- package/dist/types/src/theme/components/avatar.d.ts +21 -0
- package/dist/types/src/theme/components/avatar.d.ts.map +1 -0
- package/dist/types/src/theme/components/breadcrumb.d.ts +9 -0
- package/dist/types/src/theme/components/breadcrumb.d.ts.map +1 -0
- package/dist/types/src/theme/components/button.d.ts +15 -0
- package/dist/types/src/theme/components/button.d.ts.map +1 -0
- package/dist/types/src/theme/components/card.d.ts +12 -0
- package/dist/types/src/theme/components/card.d.ts.map +1 -0
- package/dist/types/src/theme/components/dialog.d.ts +17 -0
- package/dist/types/src/theme/components/dialog.d.ts.map +1 -0
- package/dist/types/src/theme/components/focus.d.ts +6 -0
- package/dist/types/src/theme/components/focus.d.ts.map +1 -0
- package/dist/types/src/theme/components/icon-button.d.ts +9 -0
- package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
- package/dist/types/src/theme/components/icon.d.ts +10 -0
- package/dist/types/src/theme/components/icon.d.ts.map +1 -0
- package/dist/types/src/theme/components/index.d.ts +27 -0
- package/dist/types/src/theme/components/index.d.ts.map +1 -0
- package/dist/types/src/theme/components/input.d.ts +115 -0
- package/dist/types/src/theme/components/input.d.ts.map +1 -0
- package/dist/types/src/theme/components/link.d.ts +7 -0
- package/dist/types/src/theme/components/link.d.ts.map +1 -0
- package/dist/types/src/theme/components/list.d.ts +14 -0
- package/dist/types/src/theme/components/list.d.ts.map +1 -0
- package/dist/types/src/theme/components/main.d.ts +28 -0
- package/dist/types/src/theme/components/main.d.ts.map +1 -0
- package/dist/types/src/theme/components/menu.d.ts +13 -0
- package/dist/types/src/theme/components/menu.d.ts.map +1 -0
- package/dist/types/src/theme/components/message.d.ts +12 -0
- package/dist/types/src/theme/components/message.d.ts.map +1 -0
- package/dist/types/src/theme/components/popover.d.ts +11 -0
- package/dist/types/src/theme/components/popover.d.ts.map +1 -0
- package/dist/types/src/theme/components/scroll-area.d.ts +32 -0
- package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -0
- package/dist/types/src/theme/components/select.d.ts +13 -0
- package/dist/types/src/theme/components/select.d.ts.map +1 -0
- package/dist/types/src/theme/components/separator.d.ts +8 -0
- package/dist/types/src/theme/components/separator.d.ts.map +1 -0
- package/dist/types/src/theme/components/skeleton.d.ts +7 -0
- package/dist/types/src/theme/components/skeleton.d.ts.map +1 -0
- package/dist/types/src/theme/components/splitter.d.ts +4 -0
- package/dist/types/src/theme/components/splitter.d.ts.map +1 -0
- package/dist/types/src/theme/components/status.d.ts +9 -0
- package/dist/types/src/theme/components/status.d.ts.map +1 -0
- package/dist/types/src/theme/components/tag.d.ts +7 -0
- package/dist/types/src/theme/components/tag.d.ts.map +1 -0
- package/dist/types/src/theme/components/toast.d.ts +12 -0
- package/dist/types/src/theme/components/toast.d.ts.map +1 -0
- package/dist/types/src/theme/components/toolbar.d.ts +11 -0
- package/dist/types/src/theme/components/toolbar.d.ts.map +1 -0
- package/dist/types/src/theme/components/tooltip.d.ts +8 -0
- package/dist/types/src/theme/components/tooltip.d.ts.map +1 -0
- package/dist/types/src/theme/components/treegrid.d.ts +10 -0
- package/dist/types/src/theme/components/treegrid.d.ts.map +1 -0
- package/dist/types/src/theme/index.d.ts +4 -0
- package/dist/types/src/theme/index.d.ts.map +1 -0
- package/dist/types/src/theme/primitives/column.d.ts +29 -0
- package/dist/types/src/theme/primitives/column.d.ts.map +1 -0
- package/dist/types/src/theme/primitives/index.d.ts +3 -0
- package/dist/types/src/theme/primitives/index.d.ts.map +1 -0
- package/dist/types/src/theme/primitives/panel.d.ts +13 -0
- package/dist/types/src/theme/primitives/panel.d.ts.map +1 -0
- package/dist/types/src/theme/theme.d.ts +5 -0
- package/dist/types/src/theme/theme.d.ts.map +1 -0
- package/dist/types/src/util/elevation.d.ts +9 -0
- package/dist/types/src/util/elevation.d.ts.map +1 -0
- package/dist/types/src/util/hash-styles.d.ts +18 -0
- package/dist/types/src/util/hash-styles.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +6 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/mx.d.ts +58 -0
- package/dist/types/src/util/mx.d.ts.map +1 -0
- package/dist/types/src/util/size.d.ts +27 -0
- package/dist/types/src/util/size.d.ts.map +1 -0
- package/dist/types/src/util/valence.d.ts +4 -0
- package/dist/types/src/util/valence.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +30 -36
- package/src/Theme.stories.tsx +224 -0
- package/src/css/base/base.css +43 -0
- package/src/{styles/layers → css/base}/typography.css +21 -3
- package/src/{styles/layers → css/components}/button.css +23 -14
- package/src/{styles/layers → css/components}/checkbox.css +12 -8
- package/src/css/components/dialog.css +78 -0
- package/src/{styles/layers/focus-ring.css → css/components/focus.css} +60 -41
- package/src/css/components/icon.css +9 -0
- package/src/css/components/link.css +9 -0
- package/src/css/components/panel.css +117 -0
- package/src/css/components/scrollbar.css +24 -0
- package/src/css/components/selected.css +35 -0
- package/src/css/components/selected.md +101 -0
- package/src/css/components/surface.css +34 -0
- package/src/css/components/tag.css +132 -0
- package/src/css/components/text.css +124 -0
- package/src/css/integrations/codemirror.css +34 -0
- package/src/css/integrations/tldraw.css +14 -0
- package/src/css/layout/main.css +205 -0
- package/src/{styles/layers → css/layout}/native.css +6 -4
- package/src/css/layout/positioning.css +19 -0
- package/src/{styles/layers → css/layout}/size.css +130 -102
- package/src/css/theme/animation.css +260 -0
- package/src/css/theme/border.css +23 -0
- package/src/css/theme/palette.css +36 -0
- package/src/css/theme/semantic.css +116 -0
- package/src/css/theme/spacing.css +147 -0
- package/src/css/theme/styles.css +145 -0
- package/src/css/theme/text.css +37 -0
- package/src/css/utilities.css +118 -0
- package/src/defs.ts +48 -0
- package/src/fragments/AUDIT.md +57 -0
- package/src/fragments/density.ts +16 -0
- package/src/fragments/hover.ts +18 -0
- package/src/fragments/index.ts +10 -0
- package/src/fragments/text.ts +6 -0
- package/src/index.ts +3 -14
- package/src/main.css +121 -0
- package/src/plugins/ThemePlugin.ts +125 -0
- package/src/plugins/dark-mode.ts +22 -0
- package/src/plugins/main.css +45 -0
- package/src/{styles → theme}/components/avatar.ts +12 -13
- package/src/theme/components/button.ts +48 -0
- package/src/theme/components/card.ts +102 -0
- package/src/theme/components/dialog.ts +61 -0
- package/src/theme/components/focus.ts +33 -0
- package/src/{styles → theme}/components/icon-button.ts +6 -5
- package/src/theme/components/icon.ts +28 -0
- package/src/{styles → theme}/components/index.ts +4 -1
- package/src/theme/components/input.ts +171 -0
- package/src/{styles → theme}/components/link.ts +3 -4
- package/src/{styles → theme}/components/list.ts +5 -5
- package/src/{styles → theme}/components/main.ts +9 -11
- package/src/{styles → theme}/components/menu.ts +11 -21
- package/src/{styles → theme}/components/message.ts +11 -7
- package/src/{styles → theme}/components/popover.ts +13 -12
- package/src/theme/components/scroll-area.ts +115 -0
- package/src/{styles → theme}/components/select.ts +8 -16
- package/src/{styles → theme}/components/separator.ts +3 -3
- package/src/theme/components/skeleton.ts +23 -0
- package/src/theme/components/splitter.ts +20 -0
- package/src/{styles → theme}/components/status.ts +7 -7
- package/src/{styles → theme}/components/tag.ts +1 -1
- package/src/{styles → theme}/components/toast.ts +6 -8
- package/src/theme/components/toolbar.ts +35 -0
- package/src/{styles → theme}/components/tooltip.ts +4 -6
- package/src/{styles → theme}/components/treegrid.ts +9 -9
- package/src/{styles → theme}/index.ts +2 -2
- package/src/theme/primitives/column.ts +71 -0
- package/src/theme/primitives/index.ts +6 -0
- package/src/theme/primitives/panel.ts +43 -0
- package/src/{styles → theme}/theme.ts +27 -9
- package/src/typings.d.ts +3 -1
- package/src/{styles/fragments → util}/elevation.ts +6 -8
- package/src/util/hash-styles.ts +118 -98
- package/src/util/index.ts +3 -0
- package/src/util/mx.ts +165 -43
- package/src/util/size.ts +103 -0
- package/src/util/valence.ts +33 -0
- package/src/Tokens.stories.tsx +0 -88
- package/src/config/index.ts +0 -6
- package/src/config/tailwind.ts +0 -250
- package/src/config/tokens/alias-colors.ts +0 -39
- package/src/config/tokens/index.ts +0 -92
- package/src/config/tokens/lengths.ts +0 -97
- package/src/config/tokens/physical-colors.ts +0 -125
- package/src/config/tokens/semantic-colors.ts +0 -27
- package/src/config/tokens/sememes-calls.ts +0 -17
- package/src/config/tokens/sememes-codemirror.ts +0 -50
- package/src/config/tokens/sememes-hue.ts +0 -54
- package/src/config/tokens/sememes-sheet.ts +0 -62
- package/src/config/tokens/sememes-system.ts +0 -302
- package/src/config/tokens/sizes.ts +0 -7
- package/src/config/tokens/types.ts +0 -9
- package/src/docs/theme.drawio.svg +0 -635
- package/src/plugins/esbuild-plugin.ts +0 -65
- package/src/plugins/plugin.ts +0 -130
- package/src/plugins/resolveContent.ts +0 -51
- package/src/styles/components/README.md +0 -6
- package/src/styles/components/anchored-overflow.ts +0 -20
- package/src/styles/components/button.ts +0 -48
- package/src/styles/components/dialog.ts +0 -36
- package/src/styles/components/icon.ts +0 -19
- package/src/styles/components/input.ts +0 -177
- package/src/styles/components/scroll-area.ts +0 -43
- package/src/styles/components/toolbar.ts +0 -29
- package/src/styles/fragments/density.ts +0 -17
- package/src/styles/fragments/dimension.ts +0 -8
- package/src/styles/fragments/focus.ts +0 -16
- package/src/styles/fragments/group.ts +0 -12
- package/src/styles/fragments/hover.ts +0 -25
- package/src/styles/fragments/index.ts +0 -20
- package/src/styles/fragments/layout.ts +0 -7
- package/src/styles/fragments/motion.ts +0 -6
- package/src/styles/fragments/ornament.ts +0 -10
- package/src/styles/fragments/selected.ts +0 -45
- package/src/styles/fragments/shimmer.ts +0 -9
- package/src/styles/fragments/size.ts +0 -117
- package/src/styles/fragments/surface.ts +0 -29
- package/src/styles/fragments/text.ts +0 -12
- package/src/styles/fragments/valence.ts +0 -46
- package/src/styles/layers/README.md +0 -15
- package/src/styles/layers/anchored-overflow.css +0 -9
- package/src/styles/layers/animation.css +0 -17
- package/src/styles/layers/attention.css +0 -8
- package/src/styles/layers/base.css +0 -25
- package/src/styles/layers/can-scroll.css +0 -26
- package/src/styles/layers/dialog.css +0 -42
- package/src/styles/layers/drag-preview.css +0 -18
- package/src/styles/layers/hues.css +0 -110
- package/src/styles/layers/index.css +0 -26
- package/src/styles/layers/main.css +0 -160
- package/src/styles/layers/positioning.css +0 -23
- package/src/styles/layers/surfaces.css +0 -31
- package/src/styles/layers/tag.css +0 -132
- package/src/styles/layers/tldraw.css +0 -91
- package/src/styles/layers/tokens.css +0 -45
- package/src/tailwind.ts +0 -5
- package/src/theme.css +0 -9
- package/src/types.ts +0 -7
- package/src/util/withLogical.ts +0 -114
- /package/src/{styles/fragments → fragments}/disabled.ts +0 -0
- /package/src/{styles → theme}/components/breadcrumb.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treegrid.d.ts","sourceRoot":"","sources":["../../../../../src/theme/components/treegrid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAI/D,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC,CAAC;AAaH,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,kBAAkB,CAAqC,CAAC;AAErG,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,kBAAkB,CACY,CAAC;AAE3E,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,kBAAkB,CAC/B,CAAC;AAEjC,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,kBAAkB,CAInD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ComponentFunction } from '@dxos/ui-types';
|
|
2
|
+
/**
|
|
3
|
+
* Column-aware theme utilities.
|
|
4
|
+
* Components apply these in their theme functions to participate in the Column grid
|
|
5
|
+
* without importing Column React components.
|
|
6
|
+
*
|
|
7
|
+
* CSS custom property cascade:
|
|
8
|
+
* - Column.Root sets `--dx-col: 2 / span 1` (center column placement).
|
|
9
|
+
* - ScrollArea.Viewport resets `--dx-col: auto` after consuming `--gutter`.
|
|
10
|
+
* - Components apply `grid-column: var(--dx-col, auto)` to auto-center in Column
|
|
11
|
+
* or do nothing outside Column / inside ScrollArea.
|
|
12
|
+
*/
|
|
13
|
+
export declare const withColumn: {
|
|
14
|
+
/** Centers element in the Column grid via --dx-col. No-op outside Column or inside ScrollArea. */
|
|
15
|
+
center: () => string;
|
|
16
|
+
/** Propagates the Column grid to children via subgrid. No-op outside Column.
|
|
17
|
+
* Direct children default to center column unless they are a dx-container (ScrollArea). */
|
|
18
|
+
propagate: () => string;
|
|
19
|
+
/** Resets --dx-col after consuming --gutter. Applied by ScrollArea.Viewport. */
|
|
20
|
+
consumed: () => string;
|
|
21
|
+
};
|
|
22
|
+
export type ColumnStyleProps = {};
|
|
23
|
+
export declare const columnTheme: {
|
|
24
|
+
root: ComponentFunction<ColumnStyleProps>;
|
|
25
|
+
row: ComponentFunction<ColumnStyleProps>;
|
|
26
|
+
bleed: ComponentFunction<ColumnStyleProps>;
|
|
27
|
+
center: ComponentFunction<ColumnStyleProps>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=column.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../../../../src/theme/primitives/column.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU;IACrB,kGAAkG;IAClG,MAAM;IAEN;gGAC4F;IAC5F,SAAS;IAGT,gFAAgF;IAChF,QAAQ;CACT,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAiClC,eAAO,MAAM,WAAW;IACtB,IAAI;IACJ,GAAG;IACH,KAAK;IACL,MAAM;CACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/primitives/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ComponentFunction } from '@dxos/ui-types';
|
|
2
|
+
type Size = 'lg' | 'md' | 'sm';
|
|
3
|
+
export type PanelStyleProps = {
|
|
4
|
+
size?: Size;
|
|
5
|
+
};
|
|
6
|
+
export declare const panelTheme: {
|
|
7
|
+
root: ComponentFunction<PanelStyleProps>;
|
|
8
|
+
toolbar: ComponentFunction<PanelStyleProps>;
|
|
9
|
+
content: ComponentFunction<PanelStyleProps>;
|
|
10
|
+
statusbar: ComponentFunction<PanelStyleProps>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../../../src/theme/primitives/panel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/B,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAyBF,eAAO,MAAM,UAAU;IACrB,IAAI;IACJ,OAAO;IACP,OAAO;IACP,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Theme, type ThemeFunction } from '@dxos/ui-types';
|
|
2
|
+
export declare const defaultTheme: Theme<Record<string, any>>;
|
|
3
|
+
export declare const bindTheme: <P extends Record<string, any>>(theme: Theme<Record<string, any>>) => ThemeFunction<P>;
|
|
4
|
+
export declare const defaultTx: ThemeFunction<Record<string, any>>;
|
|
5
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/theme.ts"],"names":[],"mappings":"AAIA,OAAO,EAA+C,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAiC7G,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwCnD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAG,aAAa,CAAC,CAAC,CAK3G,CAAC;AAEF,eAAO,MAAM,SAAS,oCAA0B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentFragment, type Elevation, type SurfaceLevel } from '@dxos/ui-types';
|
|
2
|
+
export declare const surfaceShadow: ComponentFragment<{
|
|
3
|
+
elevation?: Elevation;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const surfaceZIndex: ComponentFragment<{
|
|
6
|
+
level?: SurfaceLevel;
|
|
7
|
+
elevation?: Elevation;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=elevation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevation.d.ts","sourceRoot":"","sources":["../../../../src/util/elevation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE3F,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC;IAAE,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,CAMtE,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC;IAAE,KAAK,CAAC,EAAE,YAAY,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,CAY5F,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ChromaticPalette } from '@dxos/ui-types';
|
|
2
|
+
export type Hue = ChromaticPalette | 'neutral';
|
|
3
|
+
export type ColorStyles = {
|
|
4
|
+
hue: Hue;
|
|
5
|
+
fill: string;
|
|
6
|
+
surface: string;
|
|
7
|
+
surfaceText: string;
|
|
8
|
+
text: string;
|
|
9
|
+
border: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const palette: {
|
|
12
|
+
neutral: ColorStyles;
|
|
13
|
+
hues: ColorStyles[];
|
|
14
|
+
};
|
|
15
|
+
export declare const getStyles: (hue: string) => ColorStyles;
|
|
16
|
+
export declare const getHashStyles: (id: string | undefined) => ColorStyles;
|
|
17
|
+
export declare const getHashHue: (id: string | undefined) => Hue;
|
|
18
|
+
//# sourceMappingURL=hash-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-styles.d.ts","sourceRoot":"","sources":["../../../../src/util/hash-styles.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,GAAG,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAG/C,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwJF,eAAO,MAAM,OAAO;;;CAGnB,CAAC;AAGF,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,WAEvC,CAAC;AAGF,eAAO,MAAM,aAAa,OAAQ,MAAM,GAAG,SAAS,KAAG,WAEtD,CAAC;AAEF,eAAO,MAAM,UAAU,OAAQ,MAAM,GAAG,SAAS,KAAG,GAEnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type ForwardedRef, type HTMLAttributes, type ReactNode, type RefAttributes, CSSProperties } from 'react';
|
|
2
|
+
import { ThemedClassName, type ComposableProps, type SlottableProps } from '@dxos/ui-types';
|
|
3
|
+
export declare const mx: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Reconciles className properties from a parent slot.
|
|
6
|
+
* - `className` is set by the Slot merge mechanism.
|
|
7
|
+
* - `classNames` is the consumer-facing prop for theming overrides.
|
|
8
|
+
* Use `composableProps` to reconcile both into a single `className`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const composableProps: <P extends HTMLElement = HTMLElement>({ className, classNames, role, style, ...props }: ComposableProps, { classNames: defaultClassNames, ...defaults }?: ThemedClassName<Partial<HTMLAttributes<P>>> | undefined) => {
|
|
11
|
+
children?: ReactNode | undefined;
|
|
12
|
+
role: import("react").AriaRole;
|
|
13
|
+
style: CSSProperties;
|
|
14
|
+
className: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Factory for slottable components.
|
|
18
|
+
* The implementation receives full `HTMLAttributes<E>` so it can destructure `role`, `style`, etc.
|
|
19
|
+
* Consumers see only `SlottableProps<P>` — a narrow type exposing `classNames`, `className`,
|
|
20
|
+
* `children`, `asChild`, and the custom props `P`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const MyPanel = slottable<HTMLDivElement, { border?: boolean }>(
|
|
25
|
+
* ({ children, asChild, border, ...props }, forwardedRef) => {
|
|
26
|
+
* const Comp = asChild ? Slot : Primitive.div;
|
|
27
|
+
* return (
|
|
28
|
+
* <Comp {...composableProps(props, { classNames: border && 'border' })} ref={forwardedRef}>
|
|
29
|
+
* {children}
|
|
30
|
+
* </Comp>
|
|
31
|
+
* );
|
|
32
|
+
* },
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function slottable<E extends HTMLElement, P extends object = {}>(render: (props: SlottableProps<P> & HTMLAttributes<E>, forwardedRef: ForwardedRef<E>) => ReactNode): ForwardRefExoticComponent<SlottableProps<P> & RefAttributes<E>>;
|
|
37
|
+
/**
|
|
38
|
+
* Factory for composable (leaf) components.
|
|
39
|
+
* The implementation receives full `HTMLAttributes<E>` so it can destructure `role`, `style`, etc.
|
|
40
|
+
* Consumers see only `ComposableProps<P>` — a narrow type exposing `classNames`, `className`,
|
|
41
|
+
* `children`, and the custom props `P`.
|
|
42
|
+
*
|
|
43
|
+
* For generic components, use `any` for the type parameter inside `composable` and
|
|
44
|
+
* cast the result to restore the generic signature for consumers.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const Leaf = composable<HTMLButtonElement>(({ children, ...props }, forwardedRef) => {
|
|
49
|
+
* return (
|
|
50
|
+
* <button {...composableProps(props, { classNames: 'btn' })} ref={forwardedRef}>
|
|
51
|
+
* {children}
|
|
52
|
+
* </button>
|
|
53
|
+
* );
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function composable<E extends HTMLElement, P extends object = {}>(render: (props: ComposableProps<P> & HTMLAttributes<E>, forwardedRef: ForwardedRef<E>) => ReactNode): ForwardRefExoticComponent<ComposableProps<P> & RefAttributes<E>>;
|
|
58
|
+
//# sourceMappingURL=mx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mx.d.ts","sourceRoot":"","sources":["../../../../src/util/mx.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,cAAc,EAEnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,aAAa,EACd,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAI5F,eAAO,MAAM,EAAE,sEAuCb,CAAC;AAEH;;;;;GAKG;AAEH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,kEACD,eAAe,mDACjB,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;;;WAY7D,aAAa;;CAIvD,CAAC;AAKH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,EACpE,MAAM,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,SAAS,GACjG,yBAAyB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CA4BjE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,EACrE,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,SAAS,GAClG,yBAAyB,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAIlE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type Size } from '@dxos/ui-types';
|
|
3
|
+
export declare const getHeight: (size: Size) => string;
|
|
4
|
+
export declare const getWidth: (size: Size) => string;
|
|
5
|
+
export declare const getSize: (size: Size) => string;
|
|
6
|
+
export declare const sizeValue: (size: Size) => number;
|
|
7
|
+
export declare const sizeToRem: (size: Size) => string;
|
|
8
|
+
export declare const iconSize: (size: Size | null) => CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* Snaps an arbitrary numeric value to the nearest valid Tailwind size token.
|
|
11
|
+
*
|
|
12
|
+
* The function tries progressively coarser series in order until a match is found:
|
|
13
|
+
* 1. Exact match — returns the value as-is if it is already a valid `Size`.
|
|
14
|
+
* 2. Zero or negative — clamps to `0`.
|
|
15
|
+
* 3. Sub-half values (`< 0.5`) — maps to the `'px'` token (1 px).
|
|
16
|
+
* 4. Half-step series (0.5 increments, e.g. 1.5, 2.5 …).
|
|
17
|
+
* 5. Whole-number series (1, 2, 3 …).
|
|
18
|
+
* 6. Double series (even numbers: 2, 4, 6 …).
|
|
19
|
+
* 7. Quadruple series (multiples of 4: 4, 8, 12 …).
|
|
20
|
+
* 8. Falls back to `defaultSize` if no series matches.
|
|
21
|
+
*
|
|
22
|
+
* @param value - Numeric size to snap (in Tailwind spacing units, where 1 unit = 0.25 rem).
|
|
23
|
+
* @param defaultSize - Fallback `Size` token used when no series produces a valid match.
|
|
24
|
+
* @returns The nearest valid `Size` token.
|
|
25
|
+
*/
|
|
26
|
+
export declare const snapSize: (value: number, defaultSize: Size) => Size;
|
|
27
|
+
//# sourceMappingURL=size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../../../src/util/size.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AA6C3C,eAAO,MAAM,SAAS,SAAU,IAAI,WAAqB,CAAC;AAC1D,eAAO,MAAM,QAAQ,SAAU,IAAI,WAAqB,CAAC;AACzD,eAAO,MAAM,OAAO,SAAU,IAAI,WAAwC,CAAC;AAE3E,eAAO,MAAM,SAAS,SAAU,IAAI,KAAG,MAAoC,CAAC;AAC5E,eAAO,MAAM,SAAS,SAAU,IAAI,KAAG,MAAmE,CAAC;AAE3G,eAAO,MAAM,QAAQ,SAAU,IAAI,GAAG,IAAI,KAAG,aAC6B,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,UAAW,MAAM,eAAe,IAAI,KAAG,IAwB3D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MessageValence } from '@dxos/ui-types';
|
|
2
|
+
export declare const textValence: (valence?: MessageValence) => "font-medium text-error-text" | "font-medium text-info-text" | "font-medium text-success-text" | "font-medium text-warning-text" | undefined;
|
|
3
|
+
export declare const messageValence: (valence?: MessageValence) => "font-medium text-error-text border-error-text bg-error-surface" | "font-medium text-info-text border-info-text bg-info-surface" | "font-medium text-neutral-text border-neutral-text bg-neutral-surface" | "font-medium text-success-text border-success-text bg-success-surface" | "font-medium text-warning-text border-warning-text bg-warning-surface";
|
|
4
|
+
//# sourceMappingURL=valence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valence.d.ts","sourceRoot":"","sources":["../../../../src/util/valence.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAO,MAAM,WAAW,aAAc,cAAc,iJAWnD,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,cAAc,gWAatD,CAAC"}
|