@dxos/ui-theme 0.9.0 → 0.9.1-staging.ee54ba693a
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 +37 -7
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +37 -7
- 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 +56 -27
- package/dist/plugin/node-cjs/main.css.map +2 -2
- package/dist/plugin/node-cjs/meta.json +1 -1
- package/dist/plugin/node-esm/main.css +56 -27
- package/dist/plugin/node-esm/main.css.map +2 -2
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/mx.d.ts.map +1 -1
- package/dist/types/src/util/tv.d.ts +27 -0
- package/dist/types/src/util/tv.d.ts.map +1 -0
- package/dist/types/src/util/tv.test.d.ts +2 -0
- package/dist/types/src/util/tv.test.d.ts.map +1 -0
- package/dist/types/src/util/tw-merge-config.d.ts +17 -0
- package/dist/types/src/util/tw-merge-config.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/src/Theme.stories.tsx +1 -1
- package/src/css/components/button.css +10 -9
- package/src/css/components/state.css +2 -25
- package/src/css/components/surface.css +65 -12
- package/src/css/components/tag.css +2 -2
- package/src/css/layout/size.css +1 -1
- package/src/css/theme/semantic.css +162 -75
- package/src/css/theme/spacing.css +7 -5
- package/src/util/index.ts +2 -0
- package/src/util/mx.ts +5 -35
- package/src/util/tv.test.ts +38 -0
- package/src/util/tv.ts +45 -0
- package/src/util/tw-merge-config.ts +46 -0
|
@@ -300,7 +300,9 @@ var getHash = (id) => id.split("").reduce((acc, char) => acc + char.charCodeAt(0
|
|
|
300
300
|
|
|
301
301
|
// src/util/mx.ts
|
|
302
302
|
import { extendTailwindMerge, validators } from "tailwind-merge";
|
|
303
|
-
|
|
303
|
+
|
|
304
|
+
// src/util/tw-merge-config.ts
|
|
305
|
+
var twMergeConfig = {
|
|
304
306
|
extend: {
|
|
305
307
|
classGroups: {
|
|
306
308
|
"font-family": [
|
|
@@ -308,7 +310,6 @@ var mx = extendTailwindMerge({
|
|
|
308
310
|
"font-mono"
|
|
309
311
|
],
|
|
310
312
|
"font-weight": [
|
|
311
|
-
// App weights
|
|
312
313
|
"font-thin",
|
|
313
314
|
"font-extralight",
|
|
314
315
|
"font-light",
|
|
@@ -317,11 +318,9 @@ var mx = extendTailwindMerge({
|
|
|
317
318
|
"font-semibold",
|
|
318
319
|
"font-bold",
|
|
319
320
|
"font-extrabold",
|
|
320
|
-
"font-black"
|
|
321
|
-
// Arbitrary numbers
|
|
322
|
-
validators.isArbitraryNumber
|
|
321
|
+
"font-black"
|
|
323
322
|
],
|
|
324
|
-
density: [
|
|
323
|
+
"density": [
|
|
325
324
|
"dx-density-sm",
|
|
326
325
|
"dx-density-md",
|
|
327
326
|
"dx-density-lg"
|
|
@@ -344,6 +343,21 @@ var mx = extendTailwindMerge({
|
|
|
344
343
|
]
|
|
345
344
|
}
|
|
346
345
|
}
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// src/util/mx.ts
|
|
349
|
+
var mx = extendTailwindMerge({
|
|
350
|
+
extend: {
|
|
351
|
+
...twMergeConfig.extend,
|
|
352
|
+
classGroups: {
|
|
353
|
+
...twMergeConfig.extend.classGroups,
|
|
354
|
+
// Arbitrary numeric font-weights require a validator (not expressible as a plain string token).
|
|
355
|
+
"font-weight": [
|
|
356
|
+
...twMergeConfig.extend.classGroups["font-weight"],
|
|
357
|
+
validators.isArbitraryNumber
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
}
|
|
347
361
|
});
|
|
348
362
|
|
|
349
363
|
// src/util/size.ts
|
|
@@ -524,6 +538,19 @@ var snapSize = (value, defaultSize) => {
|
|
|
524
538
|
}
|
|
525
539
|
};
|
|
526
540
|
|
|
541
|
+
// src/util/tv.ts
|
|
542
|
+
import { createTV } from "tailwind-variants";
|
|
543
|
+
var tv = createTV({
|
|
544
|
+
twMerge: true,
|
|
545
|
+
twMergeConfig
|
|
546
|
+
});
|
|
547
|
+
var bridgeTv = (recipe, slots) => Object.fromEntries(slots.map((slot) => [
|
|
548
|
+
slot,
|
|
549
|
+
(styleProps, ...etc) => recipe(styleProps)[slot]({
|
|
550
|
+
class: etc
|
|
551
|
+
})
|
|
552
|
+
]));
|
|
553
|
+
|
|
527
554
|
// src/util/valence.ts
|
|
528
555
|
var textValence = (valence) => {
|
|
529
556
|
switch (valence) {
|
|
@@ -555,6 +582,7 @@ var messageValence = (valence) => {
|
|
|
555
582
|
};
|
|
556
583
|
var buttonValence = (_valence) => "text-(--dx-valence-text) bg-(--dx-valence-bg) hover:bg-(--dx-valence-bg-hover)";
|
|
557
584
|
export {
|
|
585
|
+
bridgeTv,
|
|
558
586
|
buttonValence,
|
|
559
587
|
cardDefaultInlineSize,
|
|
560
588
|
cardMaxBlockSize,
|
|
@@ -594,6 +622,8 @@ export {
|
|
|
594
622
|
surfaceShadow,
|
|
595
623
|
surfaceZIndex,
|
|
596
624
|
textValence,
|
|
597
|
-
toHue
|
|
625
|
+
toHue,
|
|
626
|
+
tv,
|
|
627
|
+
twMergeConfig
|
|
598
628
|
};
|
|
599
629
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/defs.ts", "../../../src/fragments/density.ts", "../../../src/fragments/disabled.ts", "../../../src/fragments/hover.ts", "../../../src/fragments/text.ts", "../../../src/util/elevation.ts", "../../../src/util/hash-styles.ts", "../../../src/util/mx.ts", "../../../src/util/size.ts", "../../../src/util/valence.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\n/**\n * Translation namespace for OS-level translations.\n */\nexport const osTranslations = 'org.dxos.i18n.os';\n\n/**\n * Available color hues for UI components.\n */\nexport const hues: ChromaticPalette[] = [\n 'red',\n 'orange',\n 'amber',\n 'yellow',\n 'lime',\n 'green',\n 'emerald',\n 'teal',\n 'cyan',\n 'sky',\n 'blue',\n 'indigo',\n 'violet',\n 'purple',\n 'fuchsia',\n 'pink',\n 'rose',\n] as const;\n\nexport const hueShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] as const;\n\n// NOTE: These are the JS-side style-API role keys (see ColorStyles in util/hash-styles.ts), kept\n// distinct from the renamed CSS custom-property suffixes (`-bg`/`-fg`).\nexport const roles = ['fill', 'surface', 'foreground', 'text', 'border'] as const;\n\n/**\n * Card size constants (Tailwind spacing units).\n * Cards should be no larger than 320px per WCAG 2.1 SC 1.4.10.\n */\n// TODO(burdon): Replace usage of these with semantic tokens.\nexport const cardMinInlineSize = 18;\nexport const cardDefaultInlineSize = 20; // 320px\nexport const cardMaxInlineSize = 22;\nexport const cardMinBlockSize = 18;\nexport const cardMaxBlockSize = 30;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Density } from '@dxos/ui-types';\n\nconst lgBlockSize = 'min-h-[2.5rem]';\nconst mdBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';\nconst smBlockSize = 'min-h-[1.75rem]';\nconst xsBlockSize = 'min-h-[1.5rem]';\n\nconst lgDimensions = `${lgBlockSize} px-3`;\nconst mdDimensions = `${mdBlockSize} px-2`;\nconst smDimensions = `${smBlockSize} px-1.5`;\nconst xsDimensions = `${xsBlockSize} px-1`;\n\nexport const densityDimensions = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgDimensions;\n case 'sm':\n return smDimensions;\n case 'xs':\n return xsDimensions;\n case 'md':\n default:\n return mdDimensions;\n }\n};\n\nexport const densityBlockSize = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgBlockSize;\n case 'sm':\n return smBlockSize;\n case 'xs':\n return xsBlockSize;\n case 'md':\n default:\n return mdBlockSize;\n }\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const staticDisabled = 'opacity-40 cursor-not-allowed shadow-none';\nexport const dataDisabled = 'data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const ghostHover = 'hover:bg-hover-surface';\nexport const ghostFocusWithin = 'focus-within:bg-hover-surface';\n\nexport const hoverableControls =\n '[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]';\n\nexport const groupHoverControlItemWithTransition = 'transition-opacity duration-200 opacity-0 group-hover:opacity-100';\n\nexport const hoverableFocusedKeyboardControls = 'focus-visible:[--controls-opacity:1]';\nexport const hoverableFocusedWithinControls = 'focus-within:[--controls-opacity:1]';\nexport const hoverableOpenControlItem = 'hover-hover:aria-[expanded=true]:[--controls-opacity:1]';\nexport const hoverableControlItem = 'opacity-(--controls-opacity)';\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(burdon): Replace with Message component.\nexport const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentFragment, type Elevation, type SurfaceLevel } from '@dxos/ui-types';\n\nexport const surfaceShadow: ComponentFragment<{ elevation?: Elevation }> = ({ elevation }) => [\n elevation === 'positioned'\n ? 'shadow-sm'\n : elevation === 'dialog' || elevation === 'toast'\n ? 'shadow-md'\n : 'shadow-none',\n];\n\nexport const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?: Elevation }> = ({\n level,\n elevation,\n}) => {\n switch (level) {\n case 'tooltip':\n return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-50'];\n case 'menu':\n return elevation === 'dialog' ? ['z-[52]'] : elevation === 'toast' ? ['z-[42]'] : ['z-20'];\n default:\n return elevation === 'dialog' ? ['z-[51]'] : elevation === 'toast' ? ['z-[41]'] : ['z-[1]'];\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\nexport type Hue = ChromaticPalette | 'neutral';\n\n/**\n * See theme.css\n */\nexport type ColorStyles = {\n hue: Hue;\n bg: string;\n surface: string;\n fg: string;\n text: string;\n border: string;\n};\n\nconst neutral: ColorStyles = {\n hue: 'neutral',\n bg: 'bg-neutral-bg',\n surface: 'bg-neutral-surface',\n fg: 'text-neutral-fg',\n text: 'text-neutral-text',\n border: 'border-neutral-border',\n};\n\n// NOTE: Coordinated with `tag.css`.\n// https://github.com/dxos/dxos/blob/main/packages/ui/react-ui-theme/src/styles/layers/tag.css\nconst styles: ColorStyles[] = [\n {\n hue: 'red',\n bg: 'bg-red-bg',\n surface: 'bg-red-surface',\n fg: 'text-red-fg',\n text: 'text-red-text',\n border: 'border-red-border',\n },\n {\n hue: 'orange',\n bg: 'bg-orange-bg',\n surface: 'bg-orange-surface',\n fg: 'text-orange-fg',\n text: 'text-orange-text',\n border: 'border-orange-border',\n },\n {\n hue: 'amber',\n bg: 'bg-amber-bg',\n surface: 'bg-amber-surface',\n fg: 'text-amber-fg',\n text: 'text-amber-text',\n border: 'border-amber-border',\n },\n {\n hue: 'yellow',\n bg: 'bg-yellow-bg',\n surface: 'bg-yellow-surface',\n fg: 'text-yellow-fg',\n text: 'text-yellow-text',\n border: 'border-yellow-border',\n },\n {\n hue: 'lime',\n bg: 'bg-lime-bg',\n surface: 'bg-lime-surface',\n fg: 'text-lime-fg',\n text: 'text-lime-text',\n border: 'border-lime-border',\n },\n {\n hue: 'green',\n bg: 'bg-green-bg',\n surface: 'bg-green-surface',\n fg: 'text-green-fg',\n text: 'text-green-text',\n border: 'border-green-border',\n },\n {\n hue: 'emerald',\n bg: 'bg-emerald-bg',\n surface: 'bg-emerald-surface',\n fg: 'text-emerald-fg',\n text: 'text-emerald-text',\n border: 'border-emerald-border',\n },\n {\n hue: 'teal',\n bg: 'bg-teal-bg',\n surface: 'bg-teal-surface',\n fg: 'text-teal-fg',\n text: 'text-teal-text',\n border: 'border-teal-border',\n },\n {\n hue: 'cyan',\n bg: 'bg-cyan-bg',\n surface: 'bg-cyan-surface',\n fg: 'text-cyan-fg',\n text: 'text-cyan-text',\n border: 'border-cyan-border',\n },\n {\n hue: 'sky',\n bg: 'bg-sky-bg',\n surface: 'bg-sky-surface',\n fg: 'text-sky-fg',\n text: 'text-sky-text',\n border: 'border-sky-border',\n },\n {\n hue: 'blue',\n bg: 'bg-blue-bg',\n surface: 'bg-blue-surface',\n fg: 'text-blue-fg',\n text: 'text-blue-text',\n border: 'border-blue-border',\n },\n {\n hue: 'indigo',\n bg: 'bg-indigo-bg',\n surface: 'bg-indigo-surface',\n fg: 'text-indigo-fg',\n text: 'text-indigo-text',\n border: 'border-indigo-border',\n },\n {\n hue: 'violet',\n bg: 'bg-violet-bg',\n surface: 'bg-violet-surface',\n fg: 'text-violet-fg',\n text: 'text-violet-text',\n border: 'border-violet-border',\n },\n {\n hue: 'purple',\n bg: 'bg-purple-bg',\n surface: 'bg-purple-surface',\n fg: 'text-purple-fg',\n text: 'text-purple-text',\n border: 'border-purple-border',\n },\n {\n hue: 'fuchsia',\n bg: 'bg-fuchsia-bg',\n surface: 'bg-fuchsia-surface',\n fg: 'text-fuchsia-fg',\n text: 'text-fuchsia-text',\n border: 'border-fuchsia-border',\n },\n {\n hue: 'pink',\n bg: 'bg-pink-bg',\n surface: 'bg-pink-surface',\n fg: 'text-pink-fg',\n text: 'text-pink-text',\n border: 'border-pink-border',\n },\n {\n hue: 'rose',\n bg: 'bg-rose-bg',\n surface: 'bg-rose-surface',\n fg: 'text-rose-fg',\n text: 'text-rose-text',\n border: 'border-rose-border',\n },\n];\n\nexport const palette = {\n neutral,\n hues: styles,\n};\n\nconst validHues: ReadonlySet<Hue> = new Set<Hue>([neutral.hue, ...styles.map((s) => s.hue)]);\n\n/**\n * Normalise an arbitrary string into a known `Hue`, falling back to `'neutral'` when the\n * input doesn't match one of the catalogued palette entries. Useful when accepting hue\n * values from user-authored data (e.g. ECHO objects, plugin settings) that need to be\n * forwarded to a hue-keyed prop like `Tag`'s `palette`.\n */\nexport const toHue = (hue: string | undefined): Hue => (hue && validHues.has(hue as Hue) ? (hue as Hue) : 'neutral');\n\n// TODO(burdon): Rename getClassNames.\nexport const getStyles = (hue: string): ColorStyles => {\n return styles.find((color) => color.hue === hue) || neutral;\n};\n\n// TODO(thure): Reconcile with `to-fallback.ts` which exports `toHue` which overlaps a lot.\nexport const getHashStyles = (id: string | undefined): ColorStyles => {\n return getStyles(getHashHue(id));\n};\n\nexport const getHashHue = (id: string | undefined): Hue => {\n return id ? styles[getHash(id) % styles.length].hue : 'neutral';\n};\n\nconst getHash = (id: string): number => id.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { extendTailwindMerge, validators } from 'tailwind-merge';\n\ntype AdditionalClassGroups = 'density' | 'dx-focus-ring';\n\nexport const mx = extendTailwindMerge<AdditionalClassGroups>({\n extend: {\n classGroups: {\n 'font-family': ['font-body', 'font-mono'],\n 'font-weight': [\n // App weights\n 'font-thin',\n 'font-extralight',\n 'font-light',\n 'font-normal',\n 'font-medium',\n 'font-semibold',\n 'font-bold',\n 'font-extrabold',\n 'font-black',\n // Arbitrary numbers\n validators.isArbitraryNumber,\n ],\n\n density: ['dx-density-sm', 'dx-density-md', 'dx-density-lg'],\n\n 'dx-focus-ring': [\n 'dx-focus-ring',\n 'dx-focus-ring-inset',\n 'dx-focus-ring-always',\n 'dx-focus-ring-inset-always',\n 'dx-focus-ring-group',\n 'dx-focus-ring-group-x',\n 'dx-focus-ring-group-y',\n 'dx-focus-ring-group-always',\n 'dx-focus-ring-group-x-always',\n 'dx-focus-ring-group-y-always',\n 'dx-focus-ring-inset-over-all',\n 'dx-focus-ring-inset-over-all-always',\n 'dx-focus-ring-main',\n 'dx-focus-ring-main-always',\n ],\n },\n },\n});\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type CSSProperties } from 'react';\n\nimport { type Size } from '@dxos/ui-types';\n\nimport { mx } from '../util';\n\n// NOTE: Class names must be fully-specified string literals so Tailwind's static scanner can detect them.\nconst sizeMap: Record<string, { w: string; h: string }> = {\n 0: { w: 'w-0', h: 'h-0' },\n px: { w: 'w-px', h: 'h-px' },\n 0.5: { w: 'w-0.5', h: 'h-0.5' },\n 1: { w: 'w-1', h: 'h-1' },\n 1.5: { w: 'w-1.5', h: 'h-1.5' },\n 2: { w: 'w-2', h: 'h-2' },\n 2.5: { w: 'w-2.5', h: 'h-2.5' },\n 3: { w: 'w-3', h: 'h-3' },\n 3.5: { w: 'w-3.5', h: 'h-3.5' },\n 4: { w: 'w-4', h: 'h-4' },\n 5: { w: 'w-5', h: 'h-5' },\n 6: { w: 'w-6', h: 'h-6' },\n 7: { w: 'w-7', h: 'h-7' },\n 8: { w: 'w-8', h: 'h-8' },\n 9: { w: 'w-9', h: 'h-9' },\n 10: { w: 'w-10', h: 'h-10' },\n 11: { w: 'w-11', h: 'h-11' },\n 12: { w: 'w-12', h: 'h-12' },\n 14: { w: 'w-14', h: 'h-14' },\n 16: { w: 'w-16', h: 'h-16' },\n 20: { w: 'w-20', h: 'h-20' },\n 24: { w: 'w-24', h: 'h-24' },\n 28: { w: 'w-28', h: 'h-28' },\n 32: { w: 'w-32', h: 'h-32' },\n 36: { w: 'w-36', h: 'h-36' },\n 40: { w: 'w-40', h: 'h-40' },\n 44: { w: 'w-44', h: 'h-44' },\n 48: { w: 'w-48', h: 'h-48' },\n 52: { w: 'w-52', h: 'h-52' },\n 56: { w: 'w-56', h: 'h-56' },\n 60: { w: 'w-60', h: 'h-60' },\n 64: { w: 'w-64', h: 'h-64' },\n 72: { w: 'w-72', h: 'h-72' },\n 80: { w: 'w-80', h: 'h-80' },\n 96: { w: 'w-96', h: 'h-96' },\n};\n\nconst SIZE_VALUES: Size[] = Object.keys(sizeMap).map((key) => (key === 'px' ? 'px' : (Number(key) as Size)));\n\nexport const getHeight = (size: Size) => sizeMap[size]?.h;\nexport const getWidth = (size: Size) => sizeMap[size]?.w;\nexport const getSize = (size: Size) => mx(getHeight(size), getWidth(size));\n\nexport const sizeValue = (size: Size): number => (size === 'px' ? 1 : size);\nexport const sizeToRem = (size: Size): string => (size === 'px' ? '1px' : `${(size as number) * 0.25}rem`);\n\nexport const iconSize = (size: Size | null): CSSProperties =>\n ({ '--icon-size': size ? sizeToRem(size) : 'initial' }) as CSSProperties;\n\n/**\n * Snaps an arbitrary numeric value to the nearest valid Tailwind size token.\n *\n * The function tries progressively coarser series in order until a match is found:\n * 1. Exact match — returns the value as-is if it is already a valid `Size`.\n * 2. Zero or negative — clamps to `0`.\n * 3. Sub-half values (`< 0.5`) — maps to the `'px'` token (1 px).\n * 4. Half-step series (0.5 increments, e.g. 1.5, 2.5 …).\n * 5. Whole-number series (1, 2, 3 …).\n * 6. Double series (even numbers: 2, 4, 6 …).\n * 7. Quadruple series (multiples of 4: 4, 8, 12 …).\n * 8. Falls back to `defaultSize` if no series matches.\n *\n * @param value - Numeric size to snap (in Tailwind spacing units, where 1 unit = 0.25 rem).\n * @param defaultSize - Fallback `Size` token used when no series produces a valid match.\n * @returns The nearest valid `Size` token.\n */\nexport const snapSize = (value: number, defaultSize: Size): Size => {\n if (SIZE_VALUES.includes(value as Size)) {\n return value as Size;\n } else if (value <= 0) {\n return 0;\n } else if (value < 0.5) {\n return 'px';\n } else {\n const wholeSeries = Math.floor(value);\n const halfSeries = Math.floor(value * 2) / 2;\n const doubleSeries = Math.floor(value / 2) * 2;\n const quadrupleSeries = Math.floor(value / 4) * 4;\n if (SIZE_VALUES.includes(halfSeries as Size)) {\n return halfSeries as Size;\n } else if (SIZE_VALUES.includes(wholeSeries as Size)) {\n return wholeSeries as Size;\n } else if (SIZE_VALUES.includes(doubleSeries as Size)) {\n return doubleSeries as Size;\n } else if (SIZE_VALUES.includes(quadrupleSeries as Size)) {\n return quadrupleSeries as Size;\n } else {\n return defaultSize;\n }\n }\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type MessageValence } from '@dxos/ui-types';\n\nexport const textValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium text-success-text';\n case 'info':\n return 'font-medium text-info-text';\n case 'warning':\n return 'font-medium text-warning-text';\n case 'error':\n return 'font-medium text-error-text';\n default:\n return 'font-medium';\n }\n};\n\nexport const messageValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium border-success-text text-success-fg bg-success-surface';\n case 'info':\n return 'font-medium border-info-text text-info-fg bg-info-surface';\n case 'warning':\n return 'font-medium border-warning-text text-warning-fg bg-warning-surface';\n case 'error':\n return 'font-medium border-error-text text-error-fg bg-error-surface';\n default:\n return 'font-medium border-neutral-text text-neutral-fg bg-neutral-surface';\n }\n};\n\n/**\n * Classes for a Button rendered inside a Message.Root that should inherit the message's valence color.\n * Message.Root sets --dx-valence-bg / --dx-valence-bg-hover / --dx-valence-text on its DOM node.\n * Pass variant='valence' to the Button so button.css reads those variables.\n */\nexport const buttonValence = (_valence?: MessageValence): string =>\n 'text-(--dx-valence-text) bg-(--dx-valence-bg) hover:bg-(--dx-valence-bg-hover)';\n"],
|
|
5
|
-
"mappings": ";AASO,IAAMA,iBAAiB;AAKvB,IAAMC,OAA2B;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAMC,YAAY;EAAC;EAAI;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;;AAIpE,IAAMC,QAAQ;EAAC;EAAQ;EAAW;EAAc;EAAQ;;AAOxD,IAAMC,oBAAoB;AAC1B,IAAMC,wBAAwB;AAC9B,IAAMC,oBAAoB;AAC1B,IAAMC,mBAAmB;AACzB,IAAMC,mBAAmB;;;AC3ChC,IAA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IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;;AAGK,IAAME,UAAU;EACrBR;EACAS,MAAMF;AACR;AAEA,IAAMG,YAA8B,oBAAIC,IAAS;EAACX,QAAQC;KAAQM,OAAOK,IAAI,CAACC,MAAMA,EAAEZ,GAAG;CAAE;AAQpF,IAAMa,QAAQ,CAACb,QAAkCA,OAAOS,UAAUK,IAAId,GAAAA,IAAeA,MAAc;AAGnG,IAAMe,YAAY,CAACf,QAAAA;AACxB,SAAOM,OAAOU,KAAK,CAACC,UAAUA,MAAMjB,QAAQA,GAAAA,KAAQD;AACtD;AAGO,IAAMmB,gBAAgB,CAACC,OAAAA;AAC5B,SAAOJ,UAAUK,WAAWD,EAAAA,CAAAA;AAC9B;AAEO,IAAMC,aAAa,CAACD,OAAAA;AACzB,SAAOA,KAAKb,OAAOe,QAAQF,EAAAA,IAAMb,OAAOgB,MAAM,EAAEtB,MAAM;AACxD;AAEA,IAAMqB,UAAU,CAACF,OAAuBA,GAAGI,MAAM,EAAA,EAAIC,OAAO,CAACC,KAAKC,SAASD,MAAMC,KAAKC,WAAW,CAAA,GAAI,CAAA;;;ACnMrG,SAASC,qBAAqBC,kBAAkB
|
|
6
|
-
"names": ["osTranslations", "hues", "hueShades", "roles", "cardMinInlineSize", "cardDefaultInlineSize", "cardMaxInlineSize", "cardMinBlockSize", "cardMaxBlockSize", "lgBlockSize", "mdBlockSize", "smBlockSize", "xsBlockSize", "lgDimensions", "mdDimensions", "smDimensions", "xsDimensions", "densityDimensions", "density", "densityBlockSize", "staticDisabled", "dataDisabled", "ghostHover", "ghostFocusWithin", "hoverableControls", "groupHoverControlItemWithTransition", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "hoverableOpenControlItem", "hoverableControlItem", "descriptionMessage", "surfaceShadow", "elevation", "surfaceZIndex", "level", "neutral", "hue", "bg", "surface", "fg", "text", "border", "styles", "palette", "hues", "validHues", "Set", "map", "s", "toHue", "has", "getStyles", "find", "color", "getHashStyles", "id", "getHashHue", "getHash", "length", "split", "reduce", "acc", "char", "charCodeAt", "extendTailwindMerge", "validators", "mx", "extend", "classGroups", "
|
|
3
|
+
"sources": ["../../../src/defs.ts", "../../../src/fragments/density.ts", "../../../src/fragments/disabled.ts", "../../../src/fragments/hover.ts", "../../../src/fragments/text.ts", "../../../src/util/elevation.ts", "../../../src/util/hash-styles.ts", "../../../src/util/mx.ts", "../../../src/util/tw-merge-config.ts", "../../../src/util/size.ts", "../../../src/util/tv.ts", "../../../src/util/valence.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\n/**\n * Translation namespace for OS-level translations.\n */\nexport const osTranslations = 'org.dxos.i18n.os';\n\n/**\n * Available color hues for UI components.\n */\nexport const hues: ChromaticPalette[] = [\n 'red',\n 'orange',\n 'amber',\n 'yellow',\n 'lime',\n 'green',\n 'emerald',\n 'teal',\n 'cyan',\n 'sky',\n 'blue',\n 'indigo',\n 'violet',\n 'purple',\n 'fuchsia',\n 'pink',\n 'rose',\n] as const;\n\nexport const hueShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] as const;\n\n// NOTE: These are the JS-side style-API role keys (see ColorStyles in util/hash-styles.ts), kept\n// distinct from the renamed CSS custom-property suffixes (`-bg`/`-fg`).\nexport const roles = ['fill', 'surface', 'foreground', 'text', 'border'] as const;\n\n/**\n * Card size constants (Tailwind spacing units).\n * Cards should be no larger than 320px per WCAG 2.1 SC 1.4.10.\n */\n// TODO(burdon): Replace usage of these with semantic tokens.\nexport const cardMinInlineSize = 18;\nexport const cardDefaultInlineSize = 20; // 320px\nexport const cardMaxInlineSize = 22;\nexport const cardMinBlockSize = 18;\nexport const cardMaxBlockSize = 30;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Density } from '@dxos/ui-types';\n\nconst lgBlockSize = 'min-h-[2.5rem]';\nconst mdBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';\nconst smBlockSize = 'min-h-[1.75rem]';\nconst xsBlockSize = 'min-h-[1.5rem]';\n\nconst lgDimensions = `${lgBlockSize} px-3`;\nconst mdDimensions = `${mdBlockSize} px-2`;\nconst smDimensions = `${smBlockSize} px-1.5`;\nconst xsDimensions = `${xsBlockSize} px-1`;\n\nexport const densityDimensions = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgDimensions;\n case 'sm':\n return smDimensions;\n case 'xs':\n return xsDimensions;\n case 'md':\n default:\n return mdDimensions;\n }\n};\n\nexport const densityBlockSize = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgBlockSize;\n case 'sm':\n return smBlockSize;\n case 'xs':\n return xsBlockSize;\n case 'md':\n default:\n return mdBlockSize;\n }\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const staticDisabled = 'opacity-40 cursor-not-allowed shadow-none';\nexport const dataDisabled = 'data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const ghostHover = 'hover:bg-hover-surface';\nexport const ghostFocusWithin = 'focus-within:bg-hover-surface';\n\nexport const hoverableControls =\n '[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]';\n\nexport const groupHoverControlItemWithTransition = 'transition-opacity duration-200 opacity-0 group-hover:opacity-100';\n\nexport const hoverableFocusedKeyboardControls = 'focus-visible:[--controls-opacity:1]';\nexport const hoverableFocusedWithinControls = 'focus-within:[--controls-opacity:1]';\nexport const hoverableOpenControlItem = 'hover-hover:aria-[expanded=true]:[--controls-opacity:1]';\nexport const hoverableControlItem = 'opacity-(--controls-opacity)';\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(burdon): Replace with Message component.\nexport const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentFragment, type Elevation, type SurfaceLevel } from '@dxos/ui-types';\n\nexport const surfaceShadow: ComponentFragment<{ elevation?: Elevation }> = ({ elevation }) => [\n elevation === 'positioned'\n ? 'shadow-sm'\n : elevation === 'dialog' || elevation === 'toast'\n ? 'shadow-md'\n : 'shadow-none',\n];\n\nexport const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?: Elevation }> = ({\n level,\n elevation,\n}) => {\n switch (level) {\n case 'tooltip':\n return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-50'];\n case 'menu':\n return elevation === 'dialog' ? ['z-[52]'] : elevation === 'toast' ? ['z-[42]'] : ['z-20'];\n default:\n return elevation === 'dialog' ? ['z-[51]'] : elevation === 'toast' ? ['z-[41]'] : ['z-[1]'];\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\nexport type Hue = ChromaticPalette | 'neutral';\n\n/**\n * See theme.css\n */\nexport type ColorStyles = {\n hue: Hue;\n bg: string;\n surface: string;\n fg: string;\n text: string;\n border: string;\n};\n\nconst neutral: ColorStyles = {\n hue: 'neutral',\n bg: 'bg-neutral-bg',\n surface: 'bg-neutral-surface',\n fg: 'text-neutral-fg',\n text: 'text-neutral-text',\n border: 'border-neutral-border',\n};\n\n// NOTE: Coordinated with `tag.css`.\n// https://github.com/dxos/dxos/blob/main/packages/ui/react-ui-theme/src/styles/layers/tag.css\nconst styles: ColorStyles[] = [\n {\n hue: 'red',\n bg: 'bg-red-bg',\n surface: 'bg-red-surface',\n fg: 'text-red-fg',\n text: 'text-red-text',\n border: 'border-red-border',\n },\n {\n hue: 'orange',\n bg: 'bg-orange-bg',\n surface: 'bg-orange-surface',\n fg: 'text-orange-fg',\n text: 'text-orange-text',\n border: 'border-orange-border',\n },\n {\n hue: 'amber',\n bg: 'bg-amber-bg',\n surface: 'bg-amber-surface',\n fg: 'text-amber-fg',\n text: 'text-amber-text',\n border: 'border-amber-border',\n },\n {\n hue: 'yellow',\n bg: 'bg-yellow-bg',\n surface: 'bg-yellow-surface',\n fg: 'text-yellow-fg',\n text: 'text-yellow-text',\n border: 'border-yellow-border',\n },\n {\n hue: 'lime',\n bg: 'bg-lime-bg',\n surface: 'bg-lime-surface',\n fg: 'text-lime-fg',\n text: 'text-lime-text',\n border: 'border-lime-border',\n },\n {\n hue: 'green',\n bg: 'bg-green-bg',\n surface: 'bg-green-surface',\n fg: 'text-green-fg',\n text: 'text-green-text',\n border: 'border-green-border',\n },\n {\n hue: 'emerald',\n bg: 'bg-emerald-bg',\n surface: 'bg-emerald-surface',\n fg: 'text-emerald-fg',\n text: 'text-emerald-text',\n border: 'border-emerald-border',\n },\n {\n hue: 'teal',\n bg: 'bg-teal-bg',\n surface: 'bg-teal-surface',\n fg: 'text-teal-fg',\n text: 'text-teal-text',\n border: 'border-teal-border',\n },\n {\n hue: 'cyan',\n bg: 'bg-cyan-bg',\n surface: 'bg-cyan-surface',\n fg: 'text-cyan-fg',\n text: 'text-cyan-text',\n border: 'border-cyan-border',\n },\n {\n hue: 'sky',\n bg: 'bg-sky-bg',\n surface: 'bg-sky-surface',\n fg: 'text-sky-fg',\n text: 'text-sky-text',\n border: 'border-sky-border',\n },\n {\n hue: 'blue',\n bg: 'bg-blue-bg',\n surface: 'bg-blue-surface',\n fg: 'text-blue-fg',\n text: 'text-blue-text',\n border: 'border-blue-border',\n },\n {\n hue: 'indigo',\n bg: 'bg-indigo-bg',\n surface: 'bg-indigo-surface',\n fg: 'text-indigo-fg',\n text: 'text-indigo-text',\n border: 'border-indigo-border',\n },\n {\n hue: 'violet',\n bg: 'bg-violet-bg',\n surface: 'bg-violet-surface',\n fg: 'text-violet-fg',\n text: 'text-violet-text',\n border: 'border-violet-border',\n },\n {\n hue: 'purple',\n bg: 'bg-purple-bg',\n surface: 'bg-purple-surface',\n fg: 'text-purple-fg',\n text: 'text-purple-text',\n border: 'border-purple-border',\n },\n {\n hue: 'fuchsia',\n bg: 'bg-fuchsia-bg',\n surface: 'bg-fuchsia-surface',\n fg: 'text-fuchsia-fg',\n text: 'text-fuchsia-text',\n border: 'border-fuchsia-border',\n },\n {\n hue: 'pink',\n bg: 'bg-pink-bg',\n surface: 'bg-pink-surface',\n fg: 'text-pink-fg',\n text: 'text-pink-text',\n border: 'border-pink-border',\n },\n {\n hue: 'rose',\n bg: 'bg-rose-bg',\n surface: 'bg-rose-surface',\n fg: 'text-rose-fg',\n text: 'text-rose-text',\n border: 'border-rose-border',\n },\n];\n\nexport const palette = {\n neutral,\n hues: styles,\n};\n\nconst validHues: ReadonlySet<Hue> = new Set<Hue>([neutral.hue, ...styles.map((s) => s.hue)]);\n\n/**\n * Normalise an arbitrary string into a known `Hue`, falling back to `'neutral'` when the\n * input doesn't match one of the catalogued palette entries. Useful when accepting hue\n * values from user-authored data (e.g. ECHO objects, plugin settings) that need to be\n * forwarded to a hue-keyed prop like `Tag`'s `palette`.\n */\nexport const toHue = (hue: string | undefined): Hue => (hue && validHues.has(hue as Hue) ? (hue as Hue) : 'neutral');\n\n// TODO(burdon): Rename getClassNames.\nexport const getStyles = (hue: string): ColorStyles => {\n return styles.find((color) => color.hue === hue) || neutral;\n};\n\n// TODO(thure): Reconcile with `to-fallback.ts` which exports `toHue` which overlaps a lot.\nexport const getHashStyles = (id: string | undefined): ColorStyles => {\n return getStyles(getHashHue(id));\n};\n\nexport const getHashHue = (id: string | undefined): Hue => {\n return id ? styles[getHash(id) % styles.length].hue : 'neutral';\n};\n\nconst getHash = (id: string): number => id.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { extendTailwindMerge, validators } from 'tailwind-merge';\n\nimport { type AdditionalClassGroups, twMergeConfig } from './tw-merge-config';\n\nexport const mx = extendTailwindMerge<AdditionalClassGroups>({\n extend: {\n ...twMergeConfig.extend,\n classGroups: {\n ...twMergeConfig.extend.classGroups,\n // Arbitrary numeric font-weights require a validator (not expressible as a plain string token).\n 'font-weight': [...twMergeConfig.extend.classGroups['font-weight'], validators.isArbitraryNumber],\n },\n },\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\n/**\n * Shared tailwind-merge configuration. The single source for both {@link mx} (extendTailwindMerge)\n * and the {@link tv} instance (createTV `twMergeConfig`) so conflict resolution can't drift —\n * notably for dxos custom tokens (`text-base-fg`, density, focus-ring).\n */\nexport const twMergeConfig = {\n extend: {\n classGroups: {\n 'font-family': ['font-body', 'font-mono'],\n 'font-weight': [\n 'font-thin',\n 'font-extralight',\n 'font-light',\n 'font-normal',\n 'font-medium',\n 'font-semibold',\n 'font-bold',\n 'font-extrabold',\n 'font-black',\n ],\n 'density': ['dx-density-sm', 'dx-density-md', 'dx-density-lg'],\n 'dx-focus-ring': [\n 'dx-focus-ring',\n 'dx-focus-ring-inset',\n 'dx-focus-ring-always',\n 'dx-focus-ring-inset-always',\n 'dx-focus-ring-group',\n 'dx-focus-ring-group-x',\n 'dx-focus-ring-group-y',\n 'dx-focus-ring-group-always',\n 'dx-focus-ring-group-x-always',\n 'dx-focus-ring-group-y-always',\n 'dx-focus-ring-inset-over-all',\n 'dx-focus-ring-inset-over-all-always',\n 'dx-focus-ring-main',\n 'dx-focus-ring-main-always',\n ],\n },\n },\n} as const;\n\nexport type AdditionalClassGroups = 'density' | 'dx-focus-ring';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type CSSProperties } from 'react';\n\nimport { type Size } from '@dxos/ui-types';\n\nimport { mx } from '../util';\n\n// NOTE: Class names must be fully-specified string literals so Tailwind's static scanner can detect them.\nconst sizeMap: Record<string, { w: string; h: string }> = {\n 0: { w: 'w-0', h: 'h-0' },\n px: { w: 'w-px', h: 'h-px' },\n 0.5: { w: 'w-0.5', h: 'h-0.5' },\n 1: { w: 'w-1', h: 'h-1' },\n 1.5: { w: 'w-1.5', h: 'h-1.5' },\n 2: { w: 'w-2', h: 'h-2' },\n 2.5: { w: 'w-2.5', h: 'h-2.5' },\n 3: { w: 'w-3', h: 'h-3' },\n 3.5: { w: 'w-3.5', h: 'h-3.5' },\n 4: { w: 'w-4', h: 'h-4' },\n 5: { w: 'w-5', h: 'h-5' },\n 6: { w: 'w-6', h: 'h-6' },\n 7: { w: 'w-7', h: 'h-7' },\n 8: { w: 'w-8', h: 'h-8' },\n 9: { w: 'w-9', h: 'h-9' },\n 10: { w: 'w-10', h: 'h-10' },\n 11: { w: 'w-11', h: 'h-11' },\n 12: { w: 'w-12', h: 'h-12' },\n 14: { w: 'w-14', h: 'h-14' },\n 16: { w: 'w-16', h: 'h-16' },\n 20: { w: 'w-20', h: 'h-20' },\n 24: { w: 'w-24', h: 'h-24' },\n 28: { w: 'w-28', h: 'h-28' },\n 32: { w: 'w-32', h: 'h-32' },\n 36: { w: 'w-36', h: 'h-36' },\n 40: { w: 'w-40', h: 'h-40' },\n 44: { w: 'w-44', h: 'h-44' },\n 48: { w: 'w-48', h: 'h-48' },\n 52: { w: 'w-52', h: 'h-52' },\n 56: { w: 'w-56', h: 'h-56' },\n 60: { w: 'w-60', h: 'h-60' },\n 64: { w: 'w-64', h: 'h-64' },\n 72: { w: 'w-72', h: 'h-72' },\n 80: { w: 'w-80', h: 'h-80' },\n 96: { w: 'w-96', h: 'h-96' },\n};\n\nconst SIZE_VALUES: Size[] = Object.keys(sizeMap).map((key) => (key === 'px' ? 'px' : (Number(key) as Size)));\n\nexport const getHeight = (size: Size) => sizeMap[size]?.h;\nexport const getWidth = (size: Size) => sizeMap[size]?.w;\nexport const getSize = (size: Size) => mx(getHeight(size), getWidth(size));\n\nexport const sizeValue = (size: Size): number => (size === 'px' ? 1 : size);\nexport const sizeToRem = (size: Size): string => (size === 'px' ? '1px' : `${(size as number) * 0.25}rem`);\n\nexport const iconSize = (size: Size | null): CSSProperties =>\n ({ '--icon-size': size ? sizeToRem(size) : 'initial' }) as CSSProperties;\n\n/**\n * Snaps an arbitrary numeric value to the nearest valid Tailwind size token.\n *\n * The function tries progressively coarser series in order until a match is found:\n * 1. Exact match — returns the value as-is if it is already a valid `Size`.\n * 2. Zero or negative — clamps to `0`.\n * 3. Sub-half values (`< 0.5`) — maps to the `'px'` token (1 px).\n * 4. Half-step series (0.5 increments, e.g. 1.5, 2.5 …).\n * 5. Whole-number series (1, 2, 3 …).\n * 6. Double series (even numbers: 2, 4, 6 …).\n * 7. Quadruple series (multiples of 4: 4, 8, 12 …).\n * 8. Falls back to `defaultSize` if no series matches.\n *\n * @param value - Numeric size to snap (in Tailwind spacing units, where 1 unit = 0.25 rem).\n * @param defaultSize - Fallback `Size` token used when no series produces a valid match.\n * @returns The nearest valid `Size` token.\n */\nexport const snapSize = (value: number, defaultSize: Size): Size => {\n if (SIZE_VALUES.includes(value as Size)) {\n return value as Size;\n } else if (value <= 0) {\n return 0;\n } else if (value < 0.5) {\n return 'px';\n } else {\n const wholeSeries = Math.floor(value);\n const halfSeries = Math.floor(value * 2) / 2;\n const doubleSeries = Math.floor(value / 2) * 2;\n const quadrupleSeries = Math.floor(value / 4) * 4;\n if (SIZE_VALUES.includes(halfSeries as Size)) {\n return halfSeries as Size;\n } else if (SIZE_VALUES.includes(wholeSeries as Size)) {\n return wholeSeries as Size;\n } else if (SIZE_VALUES.includes(doubleSeries as Size)) {\n return doubleSeries as Size;\n } else if (SIZE_VALUES.includes(quadrupleSeries as Size)) {\n return quadrupleSeries as Size;\n } else {\n return defaultSize;\n }\n }\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createTV } from 'tailwind-variants';\n\nimport { type ClassNameArray, type ClassNameValue, type Theme } from '@dxos/ui-types';\n\nimport { twMergeConfig } from './tw-merge-config';\n\nexport type { VariantProps } from 'tailwind-variants';\n\n/**\n * Shared tailwind-variants instance bound to the dxos tailwind-merge config (see {@link twMergeConfig}),\n * so recipes resolve class conflicts identically to {@link mx}. All component theme recipes import this,\n * never the bare `tailwind-variants` package.\n */\nexport const tv = createTV({ twMerge: true, twMergeConfig });\n\ntype SlotsRecipe<P extends Record<string, any>, S extends string> = (\n props?: P,\n) => Record<S, (opts?: { class?: ClassNameValue }) => string>;\n\n/**\n * The {@link Theme} sub-tree produced by {@link bridgeTv}, with each slot's resolver explicitly typed\n * so call sites (and tests) stay fully typed instead of falling back to `any`.\n */\nexport type BridgedTheme<P extends Record<string, any>, S extends string> = Theme<P> & {\n [K in S]: (styleProps: P, ...etc: ClassNameArray) => string;\n};\n\n/**\n * Adapt a tailwind-variants slots recipe into the existing {@link Theme} shape (a map of\n * {@link import('@dxos/ui-types').ComponentFunction}) so it can register in the `tx` theme tree and be\n * consumed via `tx('component.slot', styleProps, ...classNames)`. Slots are enumerated explicitly (not\n * via Proxy) so unknown paths resolve to `undefined` exactly as `getDeep` does today, and the result is\n * a plain, inspectable object. Derive `slots` from `Object.keys(recipe())` at the call site.\n */\nexport const bridgeTv = <P extends Record<string, any>, S extends string>(\n recipe: SlotsRecipe<P, S>,\n slots: readonly S[],\n): BridgedTheme<P, S> =>\n Object.fromEntries(\n slots.map((slot) => [slot, (styleProps: P, ...etc: ClassNameArray) => recipe(styleProps)[slot]({ class: etc })]),\n ) as BridgedTheme<P, S>;\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type MessageValence } from '@dxos/ui-types';\n\nexport const textValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium text-success-text';\n case 'info':\n return 'font-medium text-info-text';\n case 'warning':\n return 'font-medium text-warning-text';\n case 'error':\n return 'font-medium text-error-text';\n default:\n return 'font-medium';\n }\n};\n\nexport const messageValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium border-success-text text-success-fg bg-success-surface';\n case 'info':\n return 'font-medium border-info-text text-info-fg bg-info-surface';\n case 'warning':\n return 'font-medium border-warning-text text-warning-fg bg-warning-surface';\n case 'error':\n return 'font-medium border-error-text text-error-fg bg-error-surface';\n default:\n return 'font-medium border-neutral-text text-neutral-fg bg-neutral-surface';\n }\n};\n\n/**\n * Classes for a Button rendered inside a Message.Root that should inherit the message's valence color.\n * Message.Root sets --dx-valence-bg / --dx-valence-bg-hover / --dx-valence-text on its DOM node.\n * Pass variant='valence' to the Button so button.css reads those variables.\n */\nexport const buttonValence = (_valence?: MessageValence): string =>\n 'text-(--dx-valence-text) bg-(--dx-valence-bg) hover:bg-(--dx-valence-bg-hover)';\n"],
|
|
5
|
+
"mappings": ";AASO,IAAMA,iBAAiB;AAKvB,IAAMC,OAA2B;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAMC,YAAY;EAAC;EAAI;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;;AAIpE,IAAMC,QAAQ;EAAC;EAAQ;EAAW;EAAc;EAAQ;;AAOxD,IAAMC,oBAAoB;AAC1B,IAAMC,wBAAwB;AAC9B,IAAMC,oBAAoB;AAC1B,IAAMC,mBAAmB;AACzB,IAAMC,mBAAmB;;;AC3ChC,IAAMC,cAAc;AACpB,IAAMC,cAAc;AACpB,IAAMC,cAAc;AACpB,IAAMC,cAAc;AAEpB,IAAMC,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AAEjB,IAAMK,oBAAoB,CAACC,UAAmB,SAAI;AACvD,UAAQA,SAAAA;IACN,KAAK;AACH,aAAOL;IACT,KAAK;AACH,aAAOE;IACT,KAAK;AACH,aAAOC;IACT,KAAK;IACL;AACE,aAAOF;EACX;AACF;AAEO,IAAMK,mBAAmB,CAACD,UAAmB,SAAI;AACtD,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AAA,GAA0B;AACxD,aAAOA;IACT,OAAO;AACL,aAAOP;IACT;EACF;AACF;;;AClGA,SAASQ,gBAAgB;AAalB,IAAMC,KAAKC,SAAS;EAAEC,SAAS;EAAMC;AAAc,CAAA;AAqBnD,IAAMC,WAAW,CACtBC,QACAC,UAEAC,OAAOC,YACLF,MAAMG,IAAI,CAACC,SAAS;EAACA;EAAM,CAACC,eAAkBC,QAAwBP,OAAOM,UAAAA,EAAYD,IAAAA,EAAM;IAAEG,OAAOD;EAAI,CAAA;CAAG,CAAA;;;ACrC5G,IAAME,cAAc,CAACC,YAAAA;AAC1B,UAAQA,SAAAA;IACN,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT;AACE,aAAO;EACX;AACF;AAEO,IAAMC,iBAAiB,CAACD,YAAAA;AAC7B,UAAQA,SAAAA;IACN,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT;AACE,aAAO;EACX;AACF;AAOO,IAAME,gBAAgB,CAACC,aAC5B;",
|
|
6
|
+
"names": ["osTranslations", "hues", "hueShades", "roles", "cardMinInlineSize", "cardDefaultInlineSize", "cardMaxInlineSize", "cardMinBlockSize", "cardMaxBlockSize", "lgBlockSize", "mdBlockSize", "smBlockSize", "xsBlockSize", "lgDimensions", "mdDimensions", "smDimensions", "xsDimensions", "densityDimensions", "density", "densityBlockSize", "staticDisabled", "dataDisabled", "ghostHover", "ghostFocusWithin", "hoverableControls", "groupHoverControlItemWithTransition", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "hoverableOpenControlItem", "hoverableControlItem", "descriptionMessage", "surfaceShadow", "elevation", "surfaceZIndex", "level", "neutral", "hue", "bg", "surface", "fg", "text", "border", "styles", "palette", "hues", "validHues", "Set", "map", "s", "toHue", "has", "getStyles", "find", "color", "getHashStyles", "id", "getHashHue", "getHash", "length", "split", "reduce", "acc", "char", "charCodeAt", "extendTailwindMerge", "validators", "twMergeConfig", "extend", "classGroups", "mx", "extendTailwindMerge", "extend", "twMergeConfig", "classGroups", "validators", "isArbitraryNumber", "sizeMap", "w", "h", "px", "SIZE_VALUES", "Object", "keys", "map", "key", "Number", "getHeight", "size", "getWidth", "getSize", "mx", "sizeValue", "sizeToRem", "iconSize", "snapSize", "value", "defaultSize", "includes", "wholeSeries", "Math", "floor", "halfSeries", "doubleSeries", "quadrupleSeries", "createTV", "tv", "createTV", "twMerge", "twMergeConfig", "bridgeTv", "recipe", "slots", "Object", "fromEntries", "map", "slot", "styleProps", "etc", "class", "textValence", "valence", "messageValence", "buttonValence", "_valence"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/defs.ts":{"bytes":3994,"imports":[],"format":"esm"},"src/fragments/density.ts":{"bytes":3504,"imports":[],"format":"esm"},"src/fragments/disabled.ts":{"bytes":808,"imports":[],"format":"esm"},"src/fragments/hover.ts":{"bytes":2576,"imports":[],"format":"esm"},"src/fragments/text.ts":{"bytes":740,"imports":[],"format":"esm"},"src/fragments/index.ts":{"bytes":749,"imports":[{"path":"src/fragments/density.ts","kind":"import-statement","original":"./density"},{"path":"src/fragments/disabled.ts","kind":"import-statement","original":"./disabled"},{"path":"src/fragments/hover.ts","kind":"import-statement","original":"./hover"},{"path":"src/fragments/text.ts","kind":"import-statement","original":"./text"}],"format":"esm"},"src/util/elevation.ts":{"bytes":3016,"imports":[],"format":"esm"},"src/util/hash-styles.ts":{"bytes":14739,"imports":[],"format":"esm"},"src/util/mx.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/defs.ts":{"bytes":3994,"imports":[],"format":"esm"},"src/fragments/density.ts":{"bytes":3504,"imports":[],"format":"esm"},"src/fragments/disabled.ts":{"bytes":808,"imports":[],"format":"esm"},"src/fragments/hover.ts":{"bytes":2576,"imports":[],"format":"esm"},"src/fragments/text.ts":{"bytes":740,"imports":[],"format":"esm"},"src/fragments/index.ts":{"bytes":749,"imports":[{"path":"src/fragments/density.ts","kind":"import-statement","original":"./density"},{"path":"src/fragments/disabled.ts","kind":"import-statement","original":"./disabled"},{"path":"src/fragments/hover.ts","kind":"import-statement","original":"./hover"},{"path":"src/fragments/text.ts","kind":"import-statement","original":"./text"}],"format":"esm"},"src/util/elevation.ts":{"bytes":3016,"imports":[],"format":"esm"},"src/util/hash-styles.ts":{"bytes":14739,"imports":[],"format":"esm"},"src/util/tw-merge-config.ts":{"bytes":4168,"imports":[],"format":"esm"},"src/util/mx.ts":{"bytes":2097,"imports":[{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"src/util/tw-merge-config.ts","kind":"import-statement","original":"./tw-merge-config"}],"format":"esm"},"src/util/size.ts":{"bytes":13347,"imports":[{"path":"src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"src/util/tv.ts":{"bytes":4621,"imports":[{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"src/util/tw-merge-config.ts","kind":"import-statement","original":"./tw-merge-config"}],"format":"esm"},"src/util/valence.ts":{"bytes":4284,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":894,"imports":[{"path":"src/util/elevation.ts","kind":"import-statement","original":"./elevation"},{"path":"src/util/hash-styles.ts","kind":"import-statement","original":"./hash-styles"},{"path":"src/util/mx.ts","kind":"import-statement","original":"./mx"},{"path":"src/util/size.ts","kind":"import-statement","original":"./size"},{"path":"src/util/tv.ts","kind":"import-statement","original":"./tv"},{"path":"src/util/tw-merge-config.ts","kind":"import-statement","original":"./tw-merge-config"},{"path":"src/util/valence.ts","kind":"import-statement","original":"./valence"}],"format":"esm"},"src/index.ts":{"bytes":537,"imports":[{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/fragments/index.ts","kind":"import-statement","original":"./fragments"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27637},"dist/lib/browser/index.mjs":{"imports":[{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true}],"exports":["bridgeTv","buttonValence","cardDefaultInlineSize","cardMaxBlockSize","cardMaxInlineSize","cardMinBlockSize","cardMinInlineSize","dataDisabled","densityBlockSize","densityDimensions","descriptionMessage","getHashHue","getHashStyles","getHeight","getSize","getStyles","getWidth","ghostFocusWithin","ghostHover","groupHoverControlItemWithTransition","hoverableControlItem","hoverableControls","hoverableFocusedKeyboardControls","hoverableFocusedWithinControls","hoverableOpenControlItem","hueShades","hues","iconSize","messageValence","mx","osTranslations","palette","roles","sizeToRem","sizeValue","snapSize","staticDisabled","surfaceShadow","surfaceZIndex","textValence","toHue","tv","twMergeConfig"],"entryPoint":"src/index.ts","inputs":{"src/defs.ts":{"bytesInOutput":557},"src/index.ts":{"bytesInOutput":0},"src/fragments/density.ts":{"bytesInOutput":846},"src/fragments/disabled.ts":{"bytesInOutput":150},"src/fragments/hover.ts":{"bytesInOutput":640},"src/fragments/text.ts":{"bytesInOutput":98},"src/util/elevation.ts":{"bytesInOutput":730},"src/util/hash-styles.ts":{"bytesInOutput":3647},"src/util/mx.ts":{"bytesInOutput":445},"src/util/tw-merge-config.ts":{"bytesInOutput":1009},"src/util/size.ts":{"bytesInOutput":2671},"src/util/tv.ts":{"bytesInOutput":264},"src/util/valence.ts":{"bytesInOutput":1024}},"bytes":13185}}}
|
|
@@ -302,7 +302,9 @@ var getHash = (id) => id.split("").reduce((acc, char) => acc + char.charCodeAt(0
|
|
|
302
302
|
|
|
303
303
|
// src/util/mx.ts
|
|
304
304
|
import { extendTailwindMerge, validators } from "tailwind-merge";
|
|
305
|
-
|
|
305
|
+
|
|
306
|
+
// src/util/tw-merge-config.ts
|
|
307
|
+
var twMergeConfig = {
|
|
306
308
|
extend: {
|
|
307
309
|
classGroups: {
|
|
308
310
|
"font-family": [
|
|
@@ -310,7 +312,6 @@ var mx = extendTailwindMerge({
|
|
|
310
312
|
"font-mono"
|
|
311
313
|
],
|
|
312
314
|
"font-weight": [
|
|
313
|
-
// App weights
|
|
314
315
|
"font-thin",
|
|
315
316
|
"font-extralight",
|
|
316
317
|
"font-light",
|
|
@@ -319,11 +320,9 @@ var mx = extendTailwindMerge({
|
|
|
319
320
|
"font-semibold",
|
|
320
321
|
"font-bold",
|
|
321
322
|
"font-extrabold",
|
|
322
|
-
"font-black"
|
|
323
|
-
// Arbitrary numbers
|
|
324
|
-
validators.isArbitraryNumber
|
|
323
|
+
"font-black"
|
|
325
324
|
],
|
|
326
|
-
density: [
|
|
325
|
+
"density": [
|
|
327
326
|
"dx-density-sm",
|
|
328
327
|
"dx-density-md",
|
|
329
328
|
"dx-density-lg"
|
|
@@ -346,6 +345,21 @@ var mx = extendTailwindMerge({
|
|
|
346
345
|
]
|
|
347
346
|
}
|
|
348
347
|
}
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
// src/util/mx.ts
|
|
351
|
+
var mx = extendTailwindMerge({
|
|
352
|
+
extend: {
|
|
353
|
+
...twMergeConfig.extend,
|
|
354
|
+
classGroups: {
|
|
355
|
+
...twMergeConfig.extend.classGroups,
|
|
356
|
+
// Arbitrary numeric font-weights require a validator (not expressible as a plain string token).
|
|
357
|
+
"font-weight": [
|
|
358
|
+
...twMergeConfig.extend.classGroups["font-weight"],
|
|
359
|
+
validators.isArbitraryNumber
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
}
|
|
349
363
|
});
|
|
350
364
|
|
|
351
365
|
// src/util/size.ts
|
|
@@ -526,6 +540,19 @@ var snapSize = (value, defaultSize) => {
|
|
|
526
540
|
}
|
|
527
541
|
};
|
|
528
542
|
|
|
543
|
+
// src/util/tv.ts
|
|
544
|
+
import { createTV } from "tailwind-variants";
|
|
545
|
+
var tv = createTV({
|
|
546
|
+
twMerge: true,
|
|
547
|
+
twMergeConfig
|
|
548
|
+
});
|
|
549
|
+
var bridgeTv = (recipe, slots) => Object.fromEntries(slots.map((slot) => [
|
|
550
|
+
slot,
|
|
551
|
+
(styleProps, ...etc) => recipe(styleProps)[slot]({
|
|
552
|
+
class: etc
|
|
553
|
+
})
|
|
554
|
+
]));
|
|
555
|
+
|
|
529
556
|
// src/util/valence.ts
|
|
530
557
|
var textValence = (valence) => {
|
|
531
558
|
switch (valence) {
|
|
@@ -557,6 +584,7 @@ var messageValence = (valence) => {
|
|
|
557
584
|
};
|
|
558
585
|
var buttonValence = (_valence) => "text-(--dx-valence-text) bg-(--dx-valence-bg) hover:bg-(--dx-valence-bg-hover)";
|
|
559
586
|
export {
|
|
587
|
+
bridgeTv,
|
|
560
588
|
buttonValence,
|
|
561
589
|
cardDefaultInlineSize,
|
|
562
590
|
cardMaxBlockSize,
|
|
@@ -596,6 +624,8 @@ export {
|
|
|
596
624
|
surfaceShadow,
|
|
597
625
|
surfaceZIndex,
|
|
598
626
|
textValence,
|
|
599
|
-
toHue
|
|
627
|
+
toHue,
|
|
628
|
+
tv,
|
|
629
|
+
twMergeConfig
|
|
600
630
|
};
|
|
601
631
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/defs.ts", "../../../src/fragments/density.ts", "../../../src/fragments/disabled.ts", "../../../src/fragments/hover.ts", "../../../src/fragments/text.ts", "../../../src/util/elevation.ts", "../../../src/util/hash-styles.ts", "../../../src/util/mx.ts", "../../../src/util/size.ts", "../../../src/util/valence.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\n/**\n * Translation namespace for OS-level translations.\n */\nexport const osTranslations = 'org.dxos.i18n.os';\n\n/**\n * Available color hues for UI components.\n */\nexport const hues: ChromaticPalette[] = [\n 'red',\n 'orange',\n 'amber',\n 'yellow',\n 'lime',\n 'green',\n 'emerald',\n 'teal',\n 'cyan',\n 'sky',\n 'blue',\n 'indigo',\n 'violet',\n 'purple',\n 'fuchsia',\n 'pink',\n 'rose',\n] as const;\n\nexport const hueShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] as const;\n\n// NOTE: These are the JS-side style-API role keys (see ColorStyles in util/hash-styles.ts), kept\n// distinct from the renamed CSS custom-property suffixes (`-bg`/`-fg`).\nexport const roles = ['fill', 'surface', 'foreground', 'text', 'border'] as const;\n\n/**\n * Card size constants (Tailwind spacing units).\n * Cards should be no larger than 320px per WCAG 2.1 SC 1.4.10.\n */\n// TODO(burdon): Replace usage of these with semantic tokens.\nexport const cardMinInlineSize = 18;\nexport const cardDefaultInlineSize = 20; // 320px\nexport const cardMaxInlineSize = 22;\nexport const cardMinBlockSize = 18;\nexport const cardMaxBlockSize = 30;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Density } from '@dxos/ui-types';\n\nconst lgBlockSize = 'min-h-[2.5rem]';\nconst mdBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';\nconst smBlockSize = 'min-h-[1.75rem]';\nconst xsBlockSize = 'min-h-[1.5rem]';\n\nconst lgDimensions = `${lgBlockSize} px-3`;\nconst mdDimensions = `${mdBlockSize} px-2`;\nconst smDimensions = `${smBlockSize} px-1.5`;\nconst xsDimensions = `${xsBlockSize} px-1`;\n\nexport const densityDimensions = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgDimensions;\n case 'sm':\n return smDimensions;\n case 'xs':\n return xsDimensions;\n case 'md':\n default:\n return mdDimensions;\n }\n};\n\nexport const densityBlockSize = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgBlockSize;\n case 'sm':\n return smBlockSize;\n case 'xs':\n return xsBlockSize;\n case 'md':\n default:\n return mdBlockSize;\n }\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const staticDisabled = 'opacity-40 cursor-not-allowed shadow-none';\nexport const dataDisabled = 'data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const ghostHover = 'hover:bg-hover-surface';\nexport const ghostFocusWithin = 'focus-within:bg-hover-surface';\n\nexport const hoverableControls =\n '[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]';\n\nexport const groupHoverControlItemWithTransition = 'transition-opacity duration-200 opacity-0 group-hover:opacity-100';\n\nexport const hoverableFocusedKeyboardControls = 'focus-visible:[--controls-opacity:1]';\nexport const hoverableFocusedWithinControls = 'focus-within:[--controls-opacity:1]';\nexport const hoverableOpenControlItem = 'hover-hover:aria-[expanded=true]:[--controls-opacity:1]';\nexport const hoverableControlItem = 'opacity-(--controls-opacity)';\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(burdon): Replace with Message component.\nexport const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentFragment, type Elevation, type SurfaceLevel } from '@dxos/ui-types';\n\nexport const surfaceShadow: ComponentFragment<{ elevation?: Elevation }> = ({ elevation }) => [\n elevation === 'positioned'\n ? 'shadow-sm'\n : elevation === 'dialog' || elevation === 'toast'\n ? 'shadow-md'\n : 'shadow-none',\n];\n\nexport const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?: Elevation }> = ({\n level,\n elevation,\n}) => {\n switch (level) {\n case 'tooltip':\n return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-50'];\n case 'menu':\n return elevation === 'dialog' ? ['z-[52]'] : elevation === 'toast' ? ['z-[42]'] : ['z-20'];\n default:\n return elevation === 'dialog' ? ['z-[51]'] : elevation === 'toast' ? ['z-[41]'] : ['z-[1]'];\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\nexport type Hue = ChromaticPalette | 'neutral';\n\n/**\n * See theme.css\n */\nexport type ColorStyles = {\n hue: Hue;\n bg: string;\n surface: string;\n fg: string;\n text: string;\n border: string;\n};\n\nconst neutral: ColorStyles = {\n hue: 'neutral',\n bg: 'bg-neutral-bg',\n surface: 'bg-neutral-surface',\n fg: 'text-neutral-fg',\n text: 'text-neutral-text',\n border: 'border-neutral-border',\n};\n\n// NOTE: Coordinated with `tag.css`.\n// https://github.com/dxos/dxos/blob/main/packages/ui/react-ui-theme/src/styles/layers/tag.css\nconst styles: ColorStyles[] = [\n {\n hue: 'red',\n bg: 'bg-red-bg',\n surface: 'bg-red-surface',\n fg: 'text-red-fg',\n text: 'text-red-text',\n border: 'border-red-border',\n },\n {\n hue: 'orange',\n bg: 'bg-orange-bg',\n surface: 'bg-orange-surface',\n fg: 'text-orange-fg',\n text: 'text-orange-text',\n border: 'border-orange-border',\n },\n {\n hue: 'amber',\n bg: 'bg-amber-bg',\n surface: 'bg-amber-surface',\n fg: 'text-amber-fg',\n text: 'text-amber-text',\n border: 'border-amber-border',\n },\n {\n hue: 'yellow',\n bg: 'bg-yellow-bg',\n surface: 'bg-yellow-surface',\n fg: 'text-yellow-fg',\n text: 'text-yellow-text',\n border: 'border-yellow-border',\n },\n {\n hue: 'lime',\n bg: 'bg-lime-bg',\n surface: 'bg-lime-surface',\n fg: 'text-lime-fg',\n text: 'text-lime-text',\n border: 'border-lime-border',\n },\n {\n hue: 'green',\n bg: 'bg-green-bg',\n surface: 'bg-green-surface',\n fg: 'text-green-fg',\n text: 'text-green-text',\n border: 'border-green-border',\n },\n {\n hue: 'emerald',\n bg: 'bg-emerald-bg',\n surface: 'bg-emerald-surface',\n fg: 'text-emerald-fg',\n text: 'text-emerald-text',\n border: 'border-emerald-border',\n },\n {\n hue: 'teal',\n bg: 'bg-teal-bg',\n surface: 'bg-teal-surface',\n fg: 'text-teal-fg',\n text: 'text-teal-text',\n border: 'border-teal-border',\n },\n {\n hue: 'cyan',\n bg: 'bg-cyan-bg',\n surface: 'bg-cyan-surface',\n fg: 'text-cyan-fg',\n text: 'text-cyan-text',\n border: 'border-cyan-border',\n },\n {\n hue: 'sky',\n bg: 'bg-sky-bg',\n surface: 'bg-sky-surface',\n fg: 'text-sky-fg',\n text: 'text-sky-text',\n border: 'border-sky-border',\n },\n {\n hue: 'blue',\n bg: 'bg-blue-bg',\n surface: 'bg-blue-surface',\n fg: 'text-blue-fg',\n text: 'text-blue-text',\n border: 'border-blue-border',\n },\n {\n hue: 'indigo',\n bg: 'bg-indigo-bg',\n surface: 'bg-indigo-surface',\n fg: 'text-indigo-fg',\n text: 'text-indigo-text',\n border: 'border-indigo-border',\n },\n {\n hue: 'violet',\n bg: 'bg-violet-bg',\n surface: 'bg-violet-surface',\n fg: 'text-violet-fg',\n text: 'text-violet-text',\n border: 'border-violet-border',\n },\n {\n hue: 'purple',\n bg: 'bg-purple-bg',\n surface: 'bg-purple-surface',\n fg: 'text-purple-fg',\n text: 'text-purple-text',\n border: 'border-purple-border',\n },\n {\n hue: 'fuchsia',\n bg: 'bg-fuchsia-bg',\n surface: 'bg-fuchsia-surface',\n fg: 'text-fuchsia-fg',\n text: 'text-fuchsia-text',\n border: 'border-fuchsia-border',\n },\n {\n hue: 'pink',\n bg: 'bg-pink-bg',\n surface: 'bg-pink-surface',\n fg: 'text-pink-fg',\n text: 'text-pink-text',\n border: 'border-pink-border',\n },\n {\n hue: 'rose',\n bg: 'bg-rose-bg',\n surface: 'bg-rose-surface',\n fg: 'text-rose-fg',\n text: 'text-rose-text',\n border: 'border-rose-border',\n },\n];\n\nexport const palette = {\n neutral,\n hues: styles,\n};\n\nconst validHues: ReadonlySet<Hue> = new Set<Hue>([neutral.hue, ...styles.map((s) => s.hue)]);\n\n/**\n * Normalise an arbitrary string into a known `Hue`, falling back to `'neutral'` when the\n * input doesn't match one of the catalogued palette entries. Useful when accepting hue\n * values from user-authored data (e.g. ECHO objects, plugin settings) that need to be\n * forwarded to a hue-keyed prop like `Tag`'s `palette`.\n */\nexport const toHue = (hue: string | undefined): Hue => (hue && validHues.has(hue as Hue) ? (hue as Hue) : 'neutral');\n\n// TODO(burdon): Rename getClassNames.\nexport const getStyles = (hue: string): ColorStyles => {\n return styles.find((color) => color.hue === hue) || neutral;\n};\n\n// TODO(thure): Reconcile with `to-fallback.ts` which exports `toHue` which overlaps a lot.\nexport const getHashStyles = (id: string | undefined): ColorStyles => {\n return getStyles(getHashHue(id));\n};\n\nexport const getHashHue = (id: string | undefined): Hue => {\n return id ? styles[getHash(id) % styles.length].hue : 'neutral';\n};\n\nconst getHash = (id: string): number => id.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { extendTailwindMerge, validators } from 'tailwind-merge';\n\ntype AdditionalClassGroups = 'density' | 'dx-focus-ring';\n\nexport const mx = extendTailwindMerge<AdditionalClassGroups>({\n extend: {\n classGroups: {\n 'font-family': ['font-body', 'font-mono'],\n 'font-weight': [\n // App weights\n 'font-thin',\n 'font-extralight',\n 'font-light',\n 'font-normal',\n 'font-medium',\n 'font-semibold',\n 'font-bold',\n 'font-extrabold',\n 'font-black',\n // Arbitrary numbers\n validators.isArbitraryNumber,\n ],\n\n density: ['dx-density-sm', 'dx-density-md', 'dx-density-lg'],\n\n 'dx-focus-ring': [\n 'dx-focus-ring',\n 'dx-focus-ring-inset',\n 'dx-focus-ring-always',\n 'dx-focus-ring-inset-always',\n 'dx-focus-ring-group',\n 'dx-focus-ring-group-x',\n 'dx-focus-ring-group-y',\n 'dx-focus-ring-group-always',\n 'dx-focus-ring-group-x-always',\n 'dx-focus-ring-group-y-always',\n 'dx-focus-ring-inset-over-all',\n 'dx-focus-ring-inset-over-all-always',\n 'dx-focus-ring-main',\n 'dx-focus-ring-main-always',\n ],\n },\n },\n});\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type CSSProperties } from 'react';\n\nimport { type Size } from '@dxos/ui-types';\n\nimport { mx } from '../util';\n\n// NOTE: Class names must be fully-specified string literals so Tailwind's static scanner can detect them.\nconst sizeMap: Record<string, { w: string; h: string }> = {\n 0: { w: 'w-0', h: 'h-0' },\n px: { w: 'w-px', h: 'h-px' },\n 0.5: { w: 'w-0.5', h: 'h-0.5' },\n 1: { w: 'w-1', h: 'h-1' },\n 1.5: { w: 'w-1.5', h: 'h-1.5' },\n 2: { w: 'w-2', h: 'h-2' },\n 2.5: { w: 'w-2.5', h: 'h-2.5' },\n 3: { w: 'w-3', h: 'h-3' },\n 3.5: { w: 'w-3.5', h: 'h-3.5' },\n 4: { w: 'w-4', h: 'h-4' },\n 5: { w: 'w-5', h: 'h-5' },\n 6: { w: 'w-6', h: 'h-6' },\n 7: { w: 'w-7', h: 'h-7' },\n 8: { w: 'w-8', h: 'h-8' },\n 9: { w: 'w-9', h: 'h-9' },\n 10: { w: 'w-10', h: 'h-10' },\n 11: { w: 'w-11', h: 'h-11' },\n 12: { w: 'w-12', h: 'h-12' },\n 14: { w: 'w-14', h: 'h-14' },\n 16: { w: 'w-16', h: 'h-16' },\n 20: { w: 'w-20', h: 'h-20' },\n 24: { w: 'w-24', h: 'h-24' },\n 28: { w: 'w-28', h: 'h-28' },\n 32: { w: 'w-32', h: 'h-32' },\n 36: { w: 'w-36', h: 'h-36' },\n 40: { w: 'w-40', h: 'h-40' },\n 44: { w: 'w-44', h: 'h-44' },\n 48: { w: 'w-48', h: 'h-48' },\n 52: { w: 'w-52', h: 'h-52' },\n 56: { w: 'w-56', h: 'h-56' },\n 60: { w: 'w-60', h: 'h-60' },\n 64: { w: 'w-64', h: 'h-64' },\n 72: { w: 'w-72', h: 'h-72' },\n 80: { w: 'w-80', h: 'h-80' },\n 96: { w: 'w-96', h: 'h-96' },\n};\n\nconst SIZE_VALUES: Size[] = Object.keys(sizeMap).map((key) => (key === 'px' ? 'px' : (Number(key) as Size)));\n\nexport const getHeight = (size: Size) => sizeMap[size]?.h;\nexport const getWidth = (size: Size) => sizeMap[size]?.w;\nexport const getSize = (size: Size) => mx(getHeight(size), getWidth(size));\n\nexport const sizeValue = (size: Size): number => (size === 'px' ? 1 : size);\nexport const sizeToRem = (size: Size): string => (size === 'px' ? '1px' : `${(size as number) * 0.25}rem`);\n\nexport const iconSize = (size: Size | null): CSSProperties =>\n ({ '--icon-size': size ? sizeToRem(size) : 'initial' }) as CSSProperties;\n\n/**\n * Snaps an arbitrary numeric value to the nearest valid Tailwind size token.\n *\n * The function tries progressively coarser series in order until a match is found:\n * 1. Exact match — returns the value as-is if it is already a valid `Size`.\n * 2. Zero or negative — clamps to `0`.\n * 3. Sub-half values (`< 0.5`) — maps to the `'px'` token (1 px).\n * 4. Half-step series (0.5 increments, e.g. 1.5, 2.5 …).\n * 5. Whole-number series (1, 2, 3 …).\n * 6. Double series (even numbers: 2, 4, 6 …).\n * 7. Quadruple series (multiples of 4: 4, 8, 12 …).\n * 8. Falls back to `defaultSize` if no series matches.\n *\n * @param value - Numeric size to snap (in Tailwind spacing units, where 1 unit = 0.25 rem).\n * @param defaultSize - Fallback `Size` token used when no series produces a valid match.\n * @returns The nearest valid `Size` token.\n */\nexport const snapSize = (value: number, defaultSize: Size): Size => {\n if (SIZE_VALUES.includes(value as Size)) {\n return value as Size;\n } else if (value <= 0) {\n return 0;\n } else if (value < 0.5) {\n return 'px';\n } else {\n const wholeSeries = Math.floor(value);\n const halfSeries = Math.floor(value * 2) / 2;\n const doubleSeries = Math.floor(value / 2) * 2;\n const quadrupleSeries = Math.floor(value / 4) * 4;\n if (SIZE_VALUES.includes(halfSeries as Size)) {\n return halfSeries as Size;\n } else if (SIZE_VALUES.includes(wholeSeries as Size)) {\n return wholeSeries as Size;\n } else if (SIZE_VALUES.includes(doubleSeries as Size)) {\n return doubleSeries as Size;\n } else if (SIZE_VALUES.includes(quadrupleSeries as Size)) {\n return quadrupleSeries as Size;\n } else {\n return defaultSize;\n }\n }\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type MessageValence } from '@dxos/ui-types';\n\nexport const textValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium text-success-text';\n case 'info':\n return 'font-medium text-info-text';\n case 'warning':\n return 'font-medium text-warning-text';\n case 'error':\n return 'font-medium text-error-text';\n default:\n return 'font-medium';\n }\n};\n\nexport const messageValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium border-success-text text-success-fg bg-success-surface';\n case 'info':\n return 'font-medium border-info-text text-info-fg bg-info-surface';\n case 'warning':\n return 'font-medium border-warning-text text-warning-fg bg-warning-surface';\n case 'error':\n return 'font-medium border-error-text text-error-fg bg-error-surface';\n default:\n return 'font-medium border-neutral-text text-neutral-fg bg-neutral-surface';\n }\n};\n\n/**\n * Classes for a Button rendered inside a Message.Root that should inherit the message's valence color.\n * Message.Root sets --dx-valence-bg / --dx-valence-bg-hover / --dx-valence-text on its DOM node.\n * Pass variant='valence' to the Button so button.css reads those variables.\n */\nexport const buttonValence = (_valence?: MessageValence): string =>\n 'text-(--dx-valence-text) bg-(--dx-valence-bg) hover:bg-(--dx-valence-bg-hover)';\n"],
|
|
5
|
-
"mappings": ";;;AASO,IAAMA,iBAAiB;AAKvB,IAAMC,OAA2B;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAMC,YAAY;EAAC;EAAI;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;;AAIpE,IAAMC,QAAQ;EAAC;EAAQ;EAAW;EAAc;EAAQ;;AAOxD,IAAMC,oBAAoB;AAC1B,IAAMC,wBAAwB;AAC9B,IAAMC,oBAAoB;AAC1B,IAAMC,mBAAmB;AACzB,IAAMC,mBAAmB;;;AC3ChC,IAAMC,cAAc;AACpB,IAAMC,cAAc;AACpB,IAAMC,cAAc;AACpB,IAAMC,cAAc;AAEpB,IAAMC,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AAEjB,IAAMK,oBAAoB,CAAC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,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;EACA;IACEL,KAAK;IACLC,IAAI;IACJC,SAAS;IACTC,IAAI;IACJC,MAAM;IACNC,QAAQ;EACV;;AAGK,IAAME,UAAU;EACrBR;EACAS,MAAMF;AACR;AAEA,IAAMG,YAA8B,oBAAIC,IAAS;EAACX,QAAQC;KAAQM,OAAOK,IAAI,CAACC,MAAMA,EAAEZ,GAAG;CAAE;AAQpF,IAAMa,QAAQ,CAACb,QAAkCA,OAAOS,UAAUK,IAAId,GAAAA,IAAeA,MAAc;AAGnG,IAAMe,YAAY,CAACf,QAAAA;AACxB,SAAOM,OAAOU,KAAK,CAACC,UAAUA,MAAMjB,QAAQA,GAAAA,KAAQD;AACtD;AAGO,IAAMmB,gBAAgB,CAACC,OAAAA;AAC5B,SAAOJ,UAAUK,WAAWD,EAAAA,CAAAA;AAC9B;AAEO,IAAMC,aAAa,CAACD,OAAAA;AACzB,SAAOA,KAAKb,OAAOe,QAAQF,EAAAA,IAAMb,OAAOgB,MAAM,EAAEtB,MAAM;AACxD;AAEA,IAAMqB,UAAU,CAACF,OAAuBA,GAAGI,MAAM,EAAA,EAAIC,OAAO,CAACC,KAAKC,SAASD,MAAMC,KAAKC,WAAW,CAAA,GAAI,CAAA;;;ACnMrG,SAASC,qBAAqBC,kBAAkB
|
|
6
|
-
"names": ["osTranslations", "hues", "hueShades", "roles", "cardMinInlineSize", "cardDefaultInlineSize", "cardMaxInlineSize", "cardMinBlockSize", "cardMaxBlockSize", "lgBlockSize", "mdBlockSize", "smBlockSize", "xsBlockSize", "lgDimensions", "mdDimensions", "smDimensions", "xsDimensions", "densityDimensions", "density", "densityBlockSize", "staticDisabled", "dataDisabled", "ghostHover", "ghostFocusWithin", "hoverableControls", "groupHoverControlItemWithTransition", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "hoverableOpenControlItem", "hoverableControlItem", "descriptionMessage", "surfaceShadow", "elevation", "surfaceZIndex", "level", "neutral", "hue", "bg", "surface", "fg", "text", "border", "styles", "palette", "hues", "validHues", "Set", "map", "s", "toHue", "has", "getStyles", "find", "color", "getHashStyles", "id", "getHashHue", "getHash", "length", "split", "reduce", "acc", "char", "charCodeAt", "extendTailwindMerge", "validators", "mx", "extend", "classGroups", "
|
|
3
|
+
"sources": ["../../../src/defs.ts", "../../../src/fragments/density.ts", "../../../src/fragments/disabled.ts", "../../../src/fragments/hover.ts", "../../../src/fragments/text.ts", "../../../src/util/elevation.ts", "../../../src/util/hash-styles.ts", "../../../src/util/mx.ts", "../../../src/util/tw-merge-config.ts", "../../../src/util/size.ts", "../../../src/util/tv.ts", "../../../src/util/valence.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\n/**\n * Translation namespace for OS-level translations.\n */\nexport const osTranslations = 'org.dxos.i18n.os';\n\n/**\n * Available color hues for UI components.\n */\nexport const hues: ChromaticPalette[] = [\n 'red',\n 'orange',\n 'amber',\n 'yellow',\n 'lime',\n 'green',\n 'emerald',\n 'teal',\n 'cyan',\n 'sky',\n 'blue',\n 'indigo',\n 'violet',\n 'purple',\n 'fuchsia',\n 'pink',\n 'rose',\n] as const;\n\nexport const hueShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] as const;\n\n// NOTE: These are the JS-side style-API role keys (see ColorStyles in util/hash-styles.ts), kept\n// distinct from the renamed CSS custom-property suffixes (`-bg`/`-fg`).\nexport const roles = ['fill', 'surface', 'foreground', 'text', 'border'] as const;\n\n/**\n * Card size constants (Tailwind spacing units).\n * Cards should be no larger than 320px per WCAG 2.1 SC 1.4.10.\n */\n// TODO(burdon): Replace usage of these with semantic tokens.\nexport const cardMinInlineSize = 18;\nexport const cardDefaultInlineSize = 20; // 320px\nexport const cardMaxInlineSize = 22;\nexport const cardMinBlockSize = 18;\nexport const cardMaxBlockSize = 30;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Density } from '@dxos/ui-types';\n\nconst lgBlockSize = 'min-h-[2.5rem]';\nconst mdBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';\nconst smBlockSize = 'min-h-[1.75rem]';\nconst xsBlockSize = 'min-h-[1.5rem]';\n\nconst lgDimensions = `${lgBlockSize} px-3`;\nconst mdDimensions = `${mdBlockSize} px-2`;\nconst smDimensions = `${smBlockSize} px-1.5`;\nconst xsDimensions = `${xsBlockSize} px-1`;\n\nexport const densityDimensions = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgDimensions;\n case 'sm':\n return smDimensions;\n case 'xs':\n return xsDimensions;\n case 'md':\n default:\n return mdDimensions;\n }\n};\n\nexport const densityBlockSize = (density: Density = 'md') => {\n switch (density) {\n case 'lg':\n return lgBlockSize;\n case 'sm':\n return smBlockSize;\n case 'xs':\n return xsBlockSize;\n case 'md':\n default:\n return mdBlockSize;\n }\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const staticDisabled = 'opacity-40 cursor-not-allowed shadow-none';\nexport const dataDisabled = 'data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const ghostHover = 'hover:bg-hover-surface';\nexport const ghostFocusWithin = 'focus-within:bg-hover-surface';\n\nexport const hoverableControls =\n '[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]';\n\nexport const groupHoverControlItemWithTransition = 'transition-opacity duration-200 opacity-0 group-hover:opacity-100';\n\nexport const hoverableFocusedKeyboardControls = 'focus-visible:[--controls-opacity:1]';\nexport const hoverableFocusedWithinControls = 'focus-within:[--controls-opacity:1]';\nexport const hoverableOpenControlItem = 'hover-hover:aria-[expanded=true]:[--controls-opacity:1]';\nexport const hoverableControlItem = 'opacity-(--controls-opacity)';\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(burdon): Replace with Message component.\nexport const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentFragment, type Elevation, type SurfaceLevel } from '@dxos/ui-types';\n\nexport const surfaceShadow: ComponentFragment<{ elevation?: Elevation }> = ({ elevation }) => [\n elevation === 'positioned'\n ? 'shadow-sm'\n : elevation === 'dialog' || elevation === 'toast'\n ? 'shadow-md'\n : 'shadow-none',\n];\n\nexport const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?: Elevation }> = ({\n level,\n elevation,\n}) => {\n switch (level) {\n case 'tooltip':\n return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-50'];\n case 'menu':\n return elevation === 'dialog' ? ['z-[52]'] : elevation === 'toast' ? ['z-[42]'] : ['z-20'];\n default:\n return elevation === 'dialog' ? ['z-[51]'] : elevation === 'toast' ? ['z-[41]'] : ['z-[1]'];\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ChromaticPalette } from '@dxos/ui-types';\n\nexport type Hue = ChromaticPalette | 'neutral';\n\n/**\n * See theme.css\n */\nexport type ColorStyles = {\n hue: Hue;\n bg: string;\n surface: string;\n fg: string;\n text: string;\n border: string;\n};\n\nconst neutral: ColorStyles = {\n hue: 'neutral',\n bg: 'bg-neutral-bg',\n surface: 'bg-neutral-surface',\n fg: 'text-neutral-fg',\n text: 'text-neutral-text',\n border: 'border-neutral-border',\n};\n\n// NOTE: Coordinated with `tag.css`.\n// https://github.com/dxos/dxos/blob/main/packages/ui/react-ui-theme/src/styles/layers/tag.css\nconst styles: ColorStyles[] = [\n {\n hue: 'red',\n bg: 'bg-red-bg',\n surface: 'bg-red-surface',\n fg: 'text-red-fg',\n text: 'text-red-text',\n border: 'border-red-border',\n },\n {\n hue: 'orange',\n bg: 'bg-orange-bg',\n surface: 'bg-orange-surface',\n fg: 'text-orange-fg',\n text: 'text-orange-text',\n border: 'border-orange-border',\n },\n {\n hue: 'amber',\n bg: 'bg-amber-bg',\n surface: 'bg-amber-surface',\n fg: 'text-amber-fg',\n text: 'text-amber-text',\n border: 'border-amber-border',\n },\n {\n hue: 'yellow',\n bg: 'bg-yellow-bg',\n surface: 'bg-yellow-surface',\n fg: 'text-yellow-fg',\n text: 'text-yellow-text',\n border: 'border-yellow-border',\n },\n {\n hue: 'lime',\n bg: 'bg-lime-bg',\n surface: 'bg-lime-surface',\n fg: 'text-lime-fg',\n text: 'text-lime-text',\n border: 'border-lime-border',\n },\n {\n hue: 'green',\n bg: 'bg-green-bg',\n surface: 'bg-green-surface',\n fg: 'text-green-fg',\n text: 'text-green-text',\n border: 'border-green-border',\n },\n {\n hue: 'emerald',\n bg: 'bg-emerald-bg',\n surface: 'bg-emerald-surface',\n fg: 'text-emerald-fg',\n text: 'text-emerald-text',\n border: 'border-emerald-border',\n },\n {\n hue: 'teal',\n bg: 'bg-teal-bg',\n surface: 'bg-teal-surface',\n fg: 'text-teal-fg',\n text: 'text-teal-text',\n border: 'border-teal-border',\n },\n {\n hue: 'cyan',\n bg: 'bg-cyan-bg',\n surface: 'bg-cyan-surface',\n fg: 'text-cyan-fg',\n text: 'text-cyan-text',\n border: 'border-cyan-border',\n },\n {\n hue: 'sky',\n bg: 'bg-sky-bg',\n surface: 'bg-sky-surface',\n fg: 'text-sky-fg',\n text: 'text-sky-text',\n border: 'border-sky-border',\n },\n {\n hue: 'blue',\n bg: 'bg-blue-bg',\n surface: 'bg-blue-surface',\n fg: 'text-blue-fg',\n text: 'text-blue-text',\n border: 'border-blue-border',\n },\n {\n hue: 'indigo',\n bg: 'bg-indigo-bg',\n surface: 'bg-indigo-surface',\n fg: 'text-indigo-fg',\n text: 'text-indigo-text',\n border: 'border-indigo-border',\n },\n {\n hue: 'violet',\n bg: 'bg-violet-bg',\n surface: 'bg-violet-surface',\n fg: 'text-violet-fg',\n text: 'text-violet-text',\n border: 'border-violet-border',\n },\n {\n hue: 'purple',\n bg: 'bg-purple-bg',\n surface: 'bg-purple-surface',\n fg: 'text-purple-fg',\n text: 'text-purple-text',\n border: 'border-purple-border',\n },\n {\n hue: 'fuchsia',\n bg: 'bg-fuchsia-bg',\n surface: 'bg-fuchsia-surface',\n fg: 'text-fuchsia-fg',\n text: 'text-fuchsia-text',\n border: 'border-fuchsia-border',\n },\n {\n hue: 'pink',\n bg: 'bg-pink-bg',\n surface: 'bg-pink-surface',\n fg: 'text-pink-fg',\n text: 'text-pink-text',\n border: 'border-pink-border',\n },\n {\n hue: 'rose',\n bg: 'bg-rose-bg',\n surface: 'bg-rose-surface',\n fg: 'text-rose-fg',\n text: 'text-rose-text',\n border: 'border-rose-border',\n },\n];\n\nexport const palette = {\n neutral,\n hues: styles,\n};\n\nconst validHues: ReadonlySet<Hue> = new Set<Hue>([neutral.hue, ...styles.map((s) => s.hue)]);\n\n/**\n * Normalise an arbitrary string into a known `Hue`, falling back to `'neutral'` when the\n * input doesn't match one of the catalogued palette entries. Useful when accepting hue\n * values from user-authored data (e.g. ECHO objects, plugin settings) that need to be\n * forwarded to a hue-keyed prop like `Tag`'s `palette`.\n */\nexport const toHue = (hue: string | undefined): Hue => (hue && validHues.has(hue as Hue) ? (hue as Hue) : 'neutral');\n\n// TODO(burdon): Rename getClassNames.\nexport const getStyles = (hue: string): ColorStyles => {\n return styles.find((color) => color.hue === hue) || neutral;\n};\n\n// TODO(thure): Reconcile with `to-fallback.ts` which exports `toHue` which overlaps a lot.\nexport const getHashStyles = (id: string | undefined): ColorStyles => {\n return getStyles(getHashHue(id));\n};\n\nexport const getHashHue = (id: string | undefined): Hue => {\n return id ? styles[getHash(id) % styles.length].hue : 'neutral';\n};\n\nconst getHash = (id: string): number => id.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { extendTailwindMerge, validators } from 'tailwind-merge';\n\nimport { type AdditionalClassGroups, twMergeConfig } from './tw-merge-config';\n\nexport const mx = extendTailwindMerge<AdditionalClassGroups>({\n extend: {\n ...twMergeConfig.extend,\n classGroups: {\n ...twMergeConfig.extend.classGroups,\n // Arbitrary numeric font-weights require a validator (not expressible as a plain string token).\n 'font-weight': [...twMergeConfig.extend.classGroups['font-weight'], validators.isArbitraryNumber],\n },\n },\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\n/**\n * Shared tailwind-merge configuration. The single source for both {@link mx} (extendTailwindMerge)\n * and the {@link tv} instance (createTV `twMergeConfig`) so conflict resolution can't drift —\n * notably for dxos custom tokens (`text-base-fg`, density, focus-ring).\n */\nexport const twMergeConfig = {\n extend: {\n classGroups: {\n 'font-family': ['font-body', 'font-mono'],\n 'font-weight': [\n 'font-thin',\n 'font-extralight',\n 'font-light',\n 'font-normal',\n 'font-medium',\n 'font-semibold',\n 'font-bold',\n 'font-extrabold',\n 'font-black',\n ],\n 'density': ['dx-density-sm', 'dx-density-md', 'dx-density-lg'],\n 'dx-focus-ring': [\n 'dx-focus-ring',\n 'dx-focus-ring-inset',\n 'dx-focus-ring-always',\n 'dx-focus-ring-inset-always',\n 'dx-focus-ring-group',\n 'dx-focus-ring-group-x',\n 'dx-focus-ring-group-y',\n 'dx-focus-ring-group-always',\n 'dx-focus-ring-group-x-always',\n 'dx-focus-ring-group-y-always',\n 'dx-focus-ring-inset-over-all',\n 'dx-focus-ring-inset-over-all-always',\n 'dx-focus-ring-main',\n 'dx-focus-ring-main-always',\n ],\n },\n },\n} as const;\n\nexport type AdditionalClassGroups = 'density' | 'dx-focus-ring';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type CSSProperties } from 'react';\n\nimport { type Size } from '@dxos/ui-types';\n\nimport { mx } from '../util';\n\n// NOTE: Class names must be fully-specified string literals so Tailwind's static scanner can detect them.\nconst sizeMap: Record<string, { w: string; h: string }> = {\n 0: { w: 'w-0', h: 'h-0' },\n px: { w: 'w-px', h: 'h-px' },\n 0.5: { w: 'w-0.5', h: 'h-0.5' },\n 1: { w: 'w-1', h: 'h-1' },\n 1.5: { w: 'w-1.5', h: 'h-1.5' },\n 2: { w: 'w-2', h: 'h-2' },\n 2.5: { w: 'w-2.5', h: 'h-2.5' },\n 3: { w: 'w-3', h: 'h-3' },\n 3.5: { w: 'w-3.5', h: 'h-3.5' },\n 4: { w: 'w-4', h: 'h-4' },\n 5: { w: 'w-5', h: 'h-5' },\n 6: { w: 'w-6', h: 'h-6' },\n 7: { w: 'w-7', h: 'h-7' },\n 8: { w: 'w-8', h: 'h-8' },\n 9: { w: 'w-9', h: 'h-9' },\n 10: { w: 'w-10', h: 'h-10' },\n 11: { w: 'w-11', h: 'h-11' },\n 12: { w: 'w-12', h: 'h-12' },\n 14: { w: 'w-14', h: 'h-14' },\n 16: { w: 'w-16', h: 'h-16' },\n 20: { w: 'w-20', h: 'h-20' },\n 24: { w: 'w-24', h: 'h-24' },\n 28: { w: 'w-28', h: 'h-28' },\n 32: { w: 'w-32', h: 'h-32' },\n 36: { w: 'w-36', h: 'h-36' },\n 40: { w: 'w-40', h: 'h-40' },\n 44: { w: 'w-44', h: 'h-44' },\n 48: { w: 'w-48', h: 'h-48' },\n 52: { w: 'w-52', h: 'h-52' },\n 56: { w: 'w-56', h: 'h-56' },\n 60: { w: 'w-60', h: 'h-60' },\n 64: { w: 'w-64', h: 'h-64' },\n 72: { w: 'w-72', h: 'h-72' },\n 80: { w: 'w-80', h: 'h-80' },\n 96: { w: 'w-96', h: 'h-96' },\n};\n\nconst SIZE_VALUES: Size[] = Object.keys(sizeMap).map((key) => (key === 'px' ? 'px' : (Number(key) as Size)));\n\nexport const getHeight = (size: Size) => sizeMap[size]?.h;\nexport const getWidth = (size: Size) => sizeMap[size]?.w;\nexport const getSize = (size: Size) => mx(getHeight(size), getWidth(size));\n\nexport const sizeValue = (size: Size): number => (size === 'px' ? 1 : size);\nexport const sizeToRem = (size: Size): string => (size === 'px' ? '1px' : `${(size as number) * 0.25}rem`);\n\nexport const iconSize = (size: Size | null): CSSProperties =>\n ({ '--icon-size': size ? sizeToRem(size) : 'initial' }) as CSSProperties;\n\n/**\n * Snaps an arbitrary numeric value to the nearest valid Tailwind size token.\n *\n * The function tries progressively coarser series in order until a match is found:\n * 1. Exact match — returns the value as-is if it is already a valid `Size`.\n * 2. Zero or negative — clamps to `0`.\n * 3. Sub-half values (`< 0.5`) — maps to the `'px'` token (1 px).\n * 4. Half-step series (0.5 increments, e.g. 1.5, 2.5 …).\n * 5. Whole-number series (1, 2, 3 …).\n * 6. Double series (even numbers: 2, 4, 6 …).\n * 7. Quadruple series (multiples of 4: 4, 8, 12 …).\n * 8. Falls back to `defaultSize` if no series matches.\n *\n * @param value - Numeric size to snap (in Tailwind spacing units, where 1 unit = 0.25 rem).\n * @param defaultSize - Fallback `Size` token used when no series produces a valid match.\n * @returns The nearest valid `Size` token.\n */\nexport const snapSize = (value: number, defaultSize: Size): Size => {\n if (SIZE_VALUES.includes(value as Size)) {\n return value as Size;\n } else if (value <= 0) {\n return 0;\n } else if (value < 0.5) {\n return 'px';\n } else {\n const wholeSeries = Math.floor(value);\n const halfSeries = Math.floor(value * 2) / 2;\n const doubleSeries = Math.floor(value / 2) * 2;\n const quadrupleSeries = Math.floor(value / 4) * 4;\n if (SIZE_VALUES.includes(halfSeries as Size)) {\n return halfSeries as Size;\n } else if (SIZE_VALUES.includes(wholeSeries as Size)) {\n return wholeSeries as Size;\n } else if (SIZE_VALUES.includes(doubleSeries as Size)) {\n return doubleSeries as Size;\n } else if (SIZE_VALUES.includes(quadrupleSeries as Size)) {\n return quadrupleSeries as Size;\n } else {\n return defaultSize;\n }\n }\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createTV } from 'tailwind-variants';\n\nimport { type ClassNameArray, type ClassNameValue, type Theme } from '@dxos/ui-types';\n\nimport { twMergeConfig } from './tw-merge-config';\n\nexport type { VariantProps } from 'tailwind-variants';\n\n/**\n * Shared tailwind-variants instance bound to the dxos tailwind-merge config (see {@link twMergeConfig}),\n * so recipes resolve class conflicts identically to {@link mx}. All component theme recipes import this,\n * never the bare `tailwind-variants` package.\n */\nexport const tv = createTV({ twMerge: true, twMergeConfig });\n\ntype SlotsRecipe<P extends Record<string, any>, S extends string> = (\n props?: P,\n) => Record<S, (opts?: { class?: ClassNameValue }) => string>;\n\n/**\n * The {@link Theme} sub-tree produced by {@link bridgeTv}, with each slot's resolver explicitly typed\n * so call sites (and tests) stay fully typed instead of falling back to `any`.\n */\nexport type BridgedTheme<P extends Record<string, any>, S extends string> = Theme<P> & {\n [K in S]: (styleProps: P, ...etc: ClassNameArray) => string;\n};\n\n/**\n * Adapt a tailwind-variants slots recipe into the existing {@link Theme} shape (a map of\n * {@link import('@dxos/ui-types').ComponentFunction}) so it can register in the `tx` theme tree and be\n * consumed via `tx('component.slot', styleProps, ...classNames)`. Slots are enumerated explicitly (not\n * via Proxy) so unknown paths resolve to `undefined` exactly as `getDeep` does today, and the result is\n * a plain, inspectable object. Derive `slots` from `Object.keys(recipe())` at the call site.\n */\nexport const bridgeTv = <P extends Record<string, any>, S extends string>(\n recipe: SlotsRecipe<P, S>,\n slots: readonly S[],\n): BridgedTheme<P, S> =>\n Object.fromEntries(\n slots.map((slot) => [slot, (styleProps: P, ...etc: ClassNameArray) => recipe(styleProps)[slot]({ class: etc })]),\n ) as BridgedTheme<P, S>;\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type MessageValence } from '@dxos/ui-types';\n\nexport const textValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium text-success-text';\n case 'info':\n return 'font-medium text-info-text';\n case 'warning':\n return 'font-medium text-warning-text';\n case 'error':\n return 'font-medium text-error-text';\n default:\n return 'font-medium';\n }\n};\n\nexport const messageValence = (valence?: MessageValence) => {\n switch (valence) {\n case 'success':\n return 'font-medium border-success-text text-success-fg bg-success-surface';\n case 'info':\n return 'font-medium border-info-text text-info-fg bg-info-surface';\n case 'warning':\n return 'font-medium border-warning-text text-warning-fg bg-warning-surface';\n case 'error':\n return 'font-medium border-error-text text-error-fg bg-error-surface';\n default:\n return 'font-medium border-neutral-text text-neutral-fg bg-neutral-surface';\n }\n};\n\n/**\n * Classes for a Button rendered inside a Message.Root that should inherit the message's valence color.\n * Message.Root sets --dx-valence-bg / --dx-valence-bg-hover / --dx-valence-text on its DOM node.\n * Pass variant='valence' to the Button so button.css reads those variables.\n */\nexport const buttonValence = (_valence?: MessageValence): string =>\n 'text-(--dx-valence-text) bg-(--dx-valence-bg) hover:bg-(--dx-valence-bg-hover)';\n"],
|
|
5
|
+
"mappings": ";;;AASO,IAAMA,iBAAiB;AAKvB,IAAMC,OAA2B;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAMC,YAAY;EAAC;EAAI;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;;AAIpE,IAAMC,QAAQ;EAAC;EAAQ;EAAW;EAAc;EAAQ;;AAOxD,IAAMC,oBAAoB;AAC1B,IAAMC,wBAAwB;AAC9B,IAAMC,oBAAoB;AAC1B,IAAMC,mBAAmB;AACzB,IAAMC,mBAAmB;;;AC3ChC,IAAMC,cAAc;AACpB,IAAMC,cAAc;AACpB,IAAMC,cAAc;AACpB,IAAMC,cAAc;AAEpB,IAAMC,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AACxB,IAAMK,eAAe,GAAGJ,WAAAA;AAEjB,IAAMK,oBAAoB,CAACC,UAAmB,SAAI;AACvD,UAAQA,SAAAA;IACN,KAAK;AACH,aAAOL;IACT,KAAK;AACH,aAAOE;IACT,KAAK;AACH,aAAOC;IACT,KAAK;IACL;AACE,aAAOF;EACX;AACF;AAEO,IAAMK,mBAAmB,CAACD,UAAmB,SAAI;AACtD,UAAQA,SAAAA;IACN,KAAK;AACH,aAAOT;IACT,KAAK;AACH,aAAOE;IACT,KAAK;AACH,aAAOC;IACT,KAAK;IACL;AACE,aAAOF;EACX;AACF;;;ACtCO,IAAMU,iBAAiB;AACvB,IAAMC,eAAe;;;ACDrB,IAAMC,aAAa;AACnB,IAAMC,mBAAmB;AAEzB,IAAMC,oBACX;AA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EAAM,CAACC,eAAkBC,QAAwBP,OAAOM,UAAAA,EAAYD,IAAAA,EAAM;IAAEG,OAAOD;EAAI,CAAA;CAAG,CAAA;;;ACrC5G,IAAME,cAAc,CAACC,YAAAA;AAC1B,UAAQA,SAAAA;IACN,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT;AACE,aAAO;EACX;AACF;AAEO,IAAMC,iBAAiB,CAACD,YAAAA;AAC7B,UAAQA,SAAAA;IACN,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT,KAAK;AACH,aAAO;IACT;AACE,aAAO;EACX;AACF;AAOO,IAAME,gBAAgB,CAACC,aAC5B;",
|
|
6
|
+
"names": ["osTranslations", "hues", "hueShades", "roles", "cardMinInlineSize", "cardDefaultInlineSize", "cardMaxInlineSize", "cardMinBlockSize", "cardMaxBlockSize", "lgBlockSize", "mdBlockSize", "smBlockSize", "xsBlockSize", "lgDimensions", "mdDimensions", "smDimensions", "xsDimensions", "densityDimensions", "density", "densityBlockSize", "staticDisabled", "dataDisabled", "ghostHover", "ghostFocusWithin", "hoverableControls", "groupHoverControlItemWithTransition", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "hoverableOpenControlItem", "hoverableControlItem", "descriptionMessage", "surfaceShadow", "elevation", "surfaceZIndex", "level", "neutral", "hue", "bg", "surface", "fg", "text", "border", "styles", "palette", "hues", "validHues", "Set", "map", "s", "toHue", "has", "getStyles", "find", "color", "getHashStyles", "id", "getHashHue", "getHash", "length", "split", "reduce", "acc", "char", "charCodeAt", "extendTailwindMerge", "validators", "twMergeConfig", "extend", "classGroups", "mx", "extendTailwindMerge", "extend", "twMergeConfig", "classGroups", "validators", "isArbitraryNumber", "sizeMap", "w", "h", "px", "SIZE_VALUES", "Object", "keys", "map", "key", "Number", "getHeight", "size", "getWidth", "getSize", "mx", "sizeValue", "sizeToRem", "iconSize", "snapSize", "value", "defaultSize", "includes", "wholeSeries", "Math", "floor", "halfSeries", "doubleSeries", "quadrupleSeries", "createTV", "tv", "createTV", "twMerge", "twMergeConfig", "bridgeTv", "recipe", "slots", "Object", "fromEntries", "map", "slot", "styleProps", "etc", "class", "textValence", "valence", "messageValence", "buttonValence", "_valence"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/defs.ts":{"bytes":3994,"imports":[],"format":"esm"},"src/fragments/density.ts":{"bytes":3504,"imports":[],"format":"esm"},"src/fragments/disabled.ts":{"bytes":808,"imports":[],"format":"esm"},"src/fragments/hover.ts":{"bytes":2576,"imports":[],"format":"esm"},"src/fragments/text.ts":{"bytes":740,"imports":[],"format":"esm"},"src/fragments/index.ts":{"bytes":749,"imports":[{"path":"src/fragments/density.ts","kind":"import-statement","original":"./density"},{"path":"src/fragments/disabled.ts","kind":"import-statement","original":"./disabled"},{"path":"src/fragments/hover.ts","kind":"import-statement","original":"./hover"},{"path":"src/fragments/text.ts","kind":"import-statement","original":"./text"}],"format":"esm"},"src/util/elevation.ts":{"bytes":3016,"imports":[],"format":"esm"},"src/util/hash-styles.ts":{"bytes":14739,"imports":[],"format":"esm"},"src/util/mx.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/defs.ts":{"bytes":3994,"imports":[],"format":"esm"},"src/fragments/density.ts":{"bytes":3504,"imports":[],"format":"esm"},"src/fragments/disabled.ts":{"bytes":808,"imports":[],"format":"esm"},"src/fragments/hover.ts":{"bytes":2576,"imports":[],"format":"esm"},"src/fragments/text.ts":{"bytes":740,"imports":[],"format":"esm"},"src/fragments/index.ts":{"bytes":749,"imports":[{"path":"src/fragments/density.ts","kind":"import-statement","original":"./density"},{"path":"src/fragments/disabled.ts","kind":"import-statement","original":"./disabled"},{"path":"src/fragments/hover.ts","kind":"import-statement","original":"./hover"},{"path":"src/fragments/text.ts","kind":"import-statement","original":"./text"}],"format":"esm"},"src/util/elevation.ts":{"bytes":3016,"imports":[],"format":"esm"},"src/util/hash-styles.ts":{"bytes":14739,"imports":[],"format":"esm"},"src/util/tw-merge-config.ts":{"bytes":4168,"imports":[],"format":"esm"},"src/util/mx.ts":{"bytes":2097,"imports":[{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"src/util/tw-merge-config.ts","kind":"import-statement","original":"./tw-merge-config"}],"format":"esm"},"src/util/size.ts":{"bytes":13347,"imports":[{"path":"src/util/index.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"src/util/tv.ts":{"bytes":4621,"imports":[{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"src/util/tw-merge-config.ts","kind":"import-statement","original":"./tw-merge-config"}],"format":"esm"},"src/util/valence.ts":{"bytes":4284,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":894,"imports":[{"path":"src/util/elevation.ts","kind":"import-statement","original":"./elevation"},{"path":"src/util/hash-styles.ts","kind":"import-statement","original":"./hash-styles"},{"path":"src/util/mx.ts","kind":"import-statement","original":"./mx"},{"path":"src/util/size.ts","kind":"import-statement","original":"./size"},{"path":"src/util/tv.ts","kind":"import-statement","original":"./tv"},{"path":"src/util/tw-merge-config.ts","kind":"import-statement","original":"./tw-merge-config"},{"path":"src/util/valence.ts","kind":"import-statement","original":"./valence"}],"format":"esm"},"src/index.ts":{"bytes":537,"imports":[{"path":"src/defs.ts","kind":"import-statement","original":"./defs"},{"path":"src/fragments/index.ts","kind":"import-statement","original":"./fragments"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27639},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true}],"exports":["bridgeTv","buttonValence","cardDefaultInlineSize","cardMaxBlockSize","cardMaxInlineSize","cardMinBlockSize","cardMinInlineSize","dataDisabled","densityBlockSize","densityDimensions","descriptionMessage","getHashHue","getHashStyles","getHeight","getSize","getStyles","getWidth","ghostFocusWithin","ghostHover","groupHoverControlItemWithTransition","hoverableControlItem","hoverableControls","hoverableFocusedKeyboardControls","hoverableFocusedWithinControls","hoverableOpenControlItem","hueShades","hues","iconSize","messageValence","mx","osTranslations","palette","roles","sizeToRem","sizeValue","snapSize","staticDisabled","surfaceShadow","surfaceZIndex","textValence","toHue","tv","twMergeConfig"],"entryPoint":"src/index.ts","inputs":{"src/defs.ts":{"bytesInOutput":557},"src/index.ts":{"bytesInOutput":0},"src/fragments/density.ts":{"bytesInOutput":846},"src/fragments/disabled.ts":{"bytesInOutput":150},"src/fragments/hover.ts":{"bytesInOutput":640},"src/fragments/text.ts":{"bytesInOutput":98},"src/util/elevation.ts":{"bytesInOutput":730},"src/util/hash-styles.ts":{"bytesInOutput":3647},"src/util/mx.ts":{"bytesInOutput":445},"src/util/tw-merge-config.ts":{"bytesInOutput":1009},"src/util/size.ts":{"bytesInOutput":2671},"src/util/tv.ts":{"bytesInOutput":264},"src/util/valence.ts":{"bytesInOutput":1024}},"bytes":13278}}}
|