@duro-app/ui 0.35.0 → 0.35.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duro-app/ui",
3
- "version": "0.35.0",
3
+ "version": "0.35.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,7 +54,7 @@
54
54
  }
55
55
  },
56
56
  "dependencies": {
57
- "@duro-app/tokens": "^0.35.0"
57
+ "@duro-app/tokens": "^0.35.1"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@babel/preset-typescript": "^7.28.0",
@@ -3,27 +3,17 @@ import {css, html} from 'react-strict-dom'
3
3
  import {colors} from '@duro-app/tokens/tokens/colors.css'
4
4
  import {lightTheme, lightShadows} from '@duro-app/tokens/themes/light.css'
5
5
  import {highContrastTheme, highContrastShadows} from '@duro-app/tokens/themes/high-contrast.css'
6
- import {
7
- landscapeTheme,
8
- landscapeShadows,
9
- landscapeTypography,
10
- } from '@duro-app/tokens/themes/landscape.css'
11
6
 
12
- export type ThemeName = 'dark' | 'light' | 'high-contrast' | 'landscape'
7
+ export type ThemeName = 'dark' | 'light' | 'high-contrast'
13
8
 
14
9
  interface ThemeProviderProps {
15
10
  theme?: ThemeName
16
11
  children: ReactNode
17
12
  }
18
13
 
19
- // A theme is a list of createTheme() overrides (colors + shadows, and
20
- // optionally typography — e.g. landscape carries its editorial font stack).
21
- // Loosely typed: each entry themes a DIFFERENT VarGroup (colors / shadows /
22
- // typography), and the array is cast to the style prop's type at the use site.
23
- const themeMap: Partial<Record<ThemeName, readonly unknown[]>> = {
14
+ const themeMap: Partial<Record<ThemeName, readonly [typeof lightTheme, typeof lightShadows]>> = {
24
15
  light: [lightTheme, lightShadows],
25
16
  'high-contrast': [highContrastTheme, highContrastShadows],
26
- landscape: [landscapeTheme, landscapeShadows, landscapeTypography],
27
17
  }
28
18
 
29
19
  const styles = css.create({
@@ -59,7 +49,7 @@ export function usePortalMount(): HTMLElement | null {
59
49
 
60
50
  export function ThemeProvider({theme = 'dark', children}: ThemeProviderProps) {
61
51
  const overrides = themeMap[theme]
62
- const themeStyles = [...(overrides ?? []), styles.root] as DivStyle
52
+ const themeStyles = [overrides?.[0], overrides?.[1], styles.root] as DivStyle
63
53
  const [mount, setMount] = useState<HTMLElement | null>(null)
64
54
 
65
55
  return (