@stacksjs/stx 0.2.152 → 0.2.153

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/stx.d.ts CHANGED
@@ -237,11 +237,19 @@ interface StxColorModeOptions {
237
237
  /** localStorage key holding the preference. @default 'stx-color-mode' */
238
238
  storageKey?: string
239
239
  /** Mode used when nothing valid is stored. @default 'auto' */
240
- initialMode?: 'light' | 'dark' | 'auto'
241
- /** Class applied to `<html>` when dark. @default 'dark' */
242
- darkClass?: string
243
- /** Attribute applied to `<html>` INSTEAD of the class, e.g. 'data-theme'. */
244
- attribute?: string
240
+ initialMode?: 'light' | 'dark' | 'auto' | 'system'
241
+ /**
242
+ * Class applied to `<html>` when dark. @default 'dark'
243
+ * Applied alongside `attribute`; pass `null` to opt out of the class.
244
+ */
245
+ darkClass?: string | null
246
+ /** Attribute set to the resolved mode on `<html>`, e.g. 'data-theme'. */
247
+ attribute?: string | null
248
+ /**
249
+ * Spelling written to storage for "follow the system".
250
+ * @default whatever is already stored, else 'auto'
251
+ */
252
+ autoValue?: 'auto' | 'system'
245
253
  /** Suppress CSS transitions across a mode switch. @default true */
246
254
  disableTransitions?: boolean
247
255
  }
@@ -257,7 +265,7 @@ declare function useColorMode(_options?: StxColorModeOptions): {
257
265
  /** User preference, which may be 'auto'. */
258
266
  readonly preference: 'light' | 'dark' | 'auto'
259
267
  readonly isDark: boolean
260
- set: (mode: 'light' | 'dark' | 'auto') => void
268
+ set: (mode: 'light' | 'dark' | 'auto' | 'system') => void
261
269
  toggle: () => void
262
270
  subscribe: (fn: (mode: 'light' | 'dark', preference: 'light' | 'dark' | 'auto') => void) => () => void
263
271
  }
@@ -242,6 +242,7 @@ export declare interface AppHeadConfig {
242
242
  link?: Array<Record<string, string>>
243
243
  script?: Array<{ src?: string, content?: string, [key: string]: any }>
244
244
  headRaw?: string
245
+ htmlAttrs?: Record<string, string>
245
246
  bodyClass?: string
246
247
  bodyAttrs?: Record<string, string>
247
248
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.152",
4
+ "version": "0.2.153",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -117,12 +117,12 @@
117
117
  "dependencies": {
118
118
  "@cwcss/crosswind": "^0.2.14",
119
119
  "@stacksjs/clapp": "^0.2.0",
120
- "@stacksjs/desktop": "0.2.152",
121
- "@stacksjs/sanitizer": "0.2.152",
120
+ "@stacksjs/desktop": "0.2.153",
121
+ "@stacksjs/sanitizer": "0.2.153",
122
122
  "@stacksjs/ts-i18n": "^0.1.11",
123
- "bun-plugin-stx": "0.2.152",
123
+ "bun-plugin-stx": "0.2.153",
124
124
  "bunfig": "^0.15.17",
125
- "stx-router": "0.2.152",
125
+ "stx-router": "0.2.153",
126
126
  "ts-broadcasting": "^0.0.9",
127
127
  "ts-images": "^0.1.9",
128
128
  "ts-syntax-highlighter": "^0.2.1"
package/stx.d.ts CHANGED
@@ -237,11 +237,19 @@ interface StxColorModeOptions {
237
237
  /** localStorage key holding the preference. @default 'stx-color-mode' */
238
238
  storageKey?: string
239
239
  /** Mode used when nothing valid is stored. @default 'auto' */
240
- initialMode?: 'light' | 'dark' | 'auto'
241
- /** Class applied to `<html>` when dark. @default 'dark' */
242
- darkClass?: string
243
- /** Attribute applied to `<html>` INSTEAD of the class, e.g. 'data-theme'. */
244
- attribute?: string
240
+ initialMode?: 'light' | 'dark' | 'auto' | 'system'
241
+ /**
242
+ * Class applied to `<html>` when dark. @default 'dark'
243
+ * Applied alongside `attribute`; pass `null` to opt out of the class.
244
+ */
245
+ darkClass?: string | null
246
+ /** Attribute set to the resolved mode on `<html>`, e.g. 'data-theme'. */
247
+ attribute?: string | null
248
+ /**
249
+ * Spelling written to storage for "follow the system".
250
+ * @default whatever is already stored, else 'auto'
251
+ */
252
+ autoValue?: 'auto' | 'system'
245
253
  /** Suppress CSS transitions across a mode switch. @default true */
246
254
  disableTransitions?: boolean
247
255
  }
@@ -257,7 +265,7 @@ declare function useColorMode(_options?: StxColorModeOptions): {
257
265
  /** User preference, which may be 'auto'. */
258
266
  readonly preference: 'light' | 'dark' | 'auto'
259
267
  readonly isDark: boolean
260
- set: (mode: 'light' | 'dark' | 'auto') => void
268
+ set: (mode: 'light' | 'dark' | 'auto' | 'system') => void
261
269
  toggle: () => void
262
270
  subscribe: (fn: (mode: 'light' | 'dark', preference: 'light' | 'dark' | 'auto') => void) => () => void
263
271
  }