@tearleads/windowing 0.2.48 → 0.2.50

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  export function AppSwitch({ checked, className, icon: Icon, onChange, title, }) {
3
- return (_jsxs("label", { className: `display-properties-app-switch ${className}`, children: [Icon && (_jsx(Icon, { className: `${className}-icon`, "aria-hidden": "true", focusable: "false", size: 16 })), _jsx("span", { className: "display-properties-label", children: title }), _jsx("input", { "aria-checked": checked, checked: checked, className: "display-properties-switch", onChange: (event) => onChange(event.currentTarget.checked), role: "switch", type: "checkbox" })] }));
3
+ return (_jsxs("label", { className: `display-properties-app-switch ${className}`, children: [Icon && (_jsx(Icon, { className: `display-properties-app-switch-icon ${className}-icon`, "aria-hidden": "true", focusable: "false", size: 16 })), _jsx("span", { className: "display-properties-label", children: title }), _jsx("input", { "aria-checked": checked, checked: checked, className: "display-properties-switch", onChange: (event) => onChange(event.currentTarget.checked), role: "switch", type: "checkbox" })] }));
4
4
  }
5
5
  //# sourceMappingURL=AppSwitch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppSwitch.js","sourceRoot":"","sources":["../../../home/runner/work/tearleads/tearleads/packages/windowing/src/display/AppSwitch.tsx"],"names":[],"mappings":";AAUA,MAAM,UAAU,SAAS,CAAC,EACxB,OAAO,EACP,SAAS,EACT,IAAI,EAAE,IAAI,EACV,QAAQ,EACR,KAAK,GACU;IACf,OAAO,CACL,iBAAO,SAAS,EAAE,iCAAiC,SAAS,EAAE,aAC3D,IAAI,IAAI,CACP,KAAC,IAAI,IACH,SAAS,EAAE,GAAG,SAAS,OAAO,iBAClB,MAAM,EAClB,SAAS,EAAC,OAAO,EACjB,IAAI,EAAE,EAAE,GACR,CACH,EACD,eAAM,SAAS,EAAC,0BAA0B,YAAE,KAAK,GAAQ,EACzD,gCACgB,OAAO,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,2BAA2B,EACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAC1D,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,GACf,IACI,CACT,CAAC;AACJ,CAAC","sourcesContent":["import type { WindowingIcon } from \"../icons/windowingIcon\";\n\ninterface AppSwitchProps {\n checked: boolean;\n className: string;\n icon?: WindowingIcon | undefined;\n onChange: (checked: boolean) => void;\n title: string;\n}\n\nexport function AppSwitch({\n checked,\n className,\n icon: Icon,\n onChange,\n title,\n}: AppSwitchProps) {\n return (\n <label className={`display-properties-app-switch ${className}`}>\n {Icon && (\n <Icon\n className={`${className}-icon`}\n aria-hidden=\"true\"\n focusable=\"false\"\n size={16}\n />\n )}\n <span className=\"display-properties-label\">{title}</span>\n <input\n aria-checked={checked}\n checked={checked}\n className=\"display-properties-switch\"\n onChange={(event) => onChange(event.currentTarget.checked)}\n role=\"switch\"\n type=\"checkbox\"\n />\n </label>\n );\n}\n"]}
1
+ {"version":3,"file":"AppSwitch.js","sourceRoot":"","sources":["../../../home/runner/work/tearleads/tearleads/packages/windowing/src/display/AppSwitch.tsx"],"names":[],"mappings":";AAUA,MAAM,UAAU,SAAS,CAAC,EACxB,OAAO,EACP,SAAS,EACT,IAAI,EAAE,IAAI,EACV,QAAQ,EACR,KAAK,GACU;IACf,OAAO,CACL,iBAAO,SAAS,EAAE,iCAAiC,SAAS,EAAE,aAC3D,IAAI,IAAI,CACP,KAAC,IAAI,IACH,SAAS,EAAE,sCAAsC,SAAS,OAAO,iBACrD,MAAM,EAClB,SAAS,EAAC,OAAO,EACjB,IAAI,EAAE,EAAE,GACR,CACH,EACD,eAAM,SAAS,EAAC,0BAA0B,YAAE,KAAK,GAAQ,EACzD,gCACgB,OAAO,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,2BAA2B,EACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAC1D,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,UAAU,GACf,IACI,CACT,CAAC;AACJ,CAAC","sourcesContent":["import type { WindowingIcon } from \"../icons/windowingIcon\";\n\ninterface AppSwitchProps {\n checked: boolean;\n className: string;\n icon?: WindowingIcon | undefined;\n onChange: (checked: boolean) => void;\n title: string;\n}\n\nexport function AppSwitch({\n checked,\n className,\n icon: Icon,\n onChange,\n title,\n}: AppSwitchProps) {\n return (\n <label className={`display-properties-app-switch ${className}`}>\n {Icon && (\n <Icon\n className={`display-properties-app-switch-icon ${className}-icon`}\n aria-hidden=\"true\"\n focusable=\"false\"\n size={16}\n />\n )}\n <span className=\"display-properties-label\">{title}</span>\n <input\n aria-checked={checked}\n checked={checked}\n className=\"display-properties-switch\"\n onChange={(event) => onChange(event.currentTarget.checked)}\n role=\"switch\"\n type=\"checkbox\"\n />\n </label>\n );\n}\n"]}
@@ -146,8 +146,24 @@
146
146
  white-space: normal;
147
147
  }
148
148
 
149
- .display-properties-app-switch svg {
149
+ /* The app's glyph leads the row the way a menu item's or a host's list row's
150
+ * does: drawn at the shared muted `--opacity-icon`, so the label carries the
151
+ * row and the switch carries its state. */
152
+ .display-properties-app-switch-icon {
150
153
  flex: 0 0 auto;
154
+ opacity: var(--opacity-icon);
155
+ }
156
+
157
+ /* Touch (routed): the same 44px row and 24px glyph as the launcher, menus,
158
+ * and a host's list rows, so this list does not read denser than the rest.
159
+ * Author CSS outranks the icon's `size={16}` attributes. */
160
+ :root[data-navigation-mode="routed"] .display-properties-app-switch {
161
+ min-height: var(--control-height);
162
+ }
163
+
164
+ :root[data-navigation-mode="routed"] .display-properties-app-switch-icon {
165
+ width: var(--control-icon-size);
166
+ height: var(--control-icon-size);
151
167
  }
152
168
 
153
169
  /* A checkbox drawn as a sliding switch: a pill track and a round thumb that
@@ -171,7 +171,9 @@ the host writes overrides it. Tearleads overrides them with its own themes in
171
171
  [`packages/app/src/shell/layout/AppChrome.css`][app-chrome].
172
172
  The routed shell also reads the screen's safe areas (`--safe-area-*`) and, under
173
173
  `:root[data-navigation-mode="routed"]`, a 44px `--control-height` and 24px
174
- `--control-icon-size`, which [`tokens.css`][tokens] defines the same way.
174
+ `--control-icon-size`, which [`tokens.css`][tokens] defines the same way. Menus
175
+ and `DisplayProperties`' app switches size their rows and glyphs from the same
176
+ two tokens, so they match a host's list rows that read them.
175
177
 
176
178
  Several defaults derive from `--color-dark`, the foreground: the window edge
177
179
  (`--border-strong-color`), the hover and selection chip (`--emphasis-surface`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tearleads/windowing",
3
- "version": "0.2.48",
3
+ "version": "0.2.50",
4
4
  "description": "App-agnostic window management for React: window state, window chrome, and the menu and sidebar primitives it renders with.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -282,11 +282,10 @@
282
282
 
283
283
  /*
284
284
  * Release the form measure on this tier. The mobile shell is single-column and
285
- * deliberately edge-to-edge — its tab strip even bleeds past the root's inline
286
- * padding to both screen edges (see MiniAppTabs.css) — but the tier runs all the
287
- * way to 759px, well past the 34rem cap, so between those widths the cap would
288
- * pull the column in and strand that bleed short of the screen (asserted by
289
- * e2e/mobile-chrome.spec.ts). `100%` rather than `none` because consumers also
285
+ * deliberately edge-to-edge, but the tier runs all the way to 759px, well past
286
+ * the 34rem cap, so between those widths the cap would pull the column in and
287
+ * leave the pane empty beside it (asserted by e2e/form-measure.spec.ts).
288
+ * `100%` rather than `none` because consumers also
290
289
  * read the token inside `min()`, where a keyword would invalidate the whole
291
290
  * declaration; every capped element is already within its container's width, so
292
291
  * this reads as "no cap" for all of them.
package/tokens.css CHANGED
@@ -81,10 +81,19 @@
81
81
  }
82
82
 
83
83
  /*
84
- * A dark theme (see ThemeProvider) darkens the browser's own controls, such as
85
- * form fields. Zero specificity, so a theme that sets its own wins.
84
+ * The active theme's scheme (see ThemeProvider) draws the browser's own
85
+ * controls, such as radios, form fields, and scrollbars, light or dark. Unlike
86
+ * the tokens above these outrank a bare `:root`: any stylesheet may declare
87
+ * `:root { color-scheme: light dark }` (pdf.js's viewer CSS does), and against
88
+ * a zero-specificity rule it won, so a light theme on a dark-mode OS drew every
89
+ * native control dark, filling unchecked radios solid. A theme's own
90
+ * `color-scheme` still applies before the provider stamps the attribute.
86
91
  */
87
- :where(:root[data-theme-scheme="dark"]) {
92
+ :root[data-theme-scheme="light"] {
93
+ color-scheme: light;
94
+ }
95
+
96
+ :root[data-theme-scheme="dark"] {
88
97
  color-scheme: dark;
89
98
  }
90
99
 
@@ -30,9 +30,17 @@
30
30
  overflow: hidden;
31
31
  }
32
32
 
33
+ /*
34
+ * `--window-content-inset` publishes this padding to the content, so chrome
35
+ * that should run edge to edge (a host's tab strip, say) can cancel exactly
36
+ * it. Only this scroller pads; a window with a sidebar does not, so the
37
+ * property is unset there.
38
+ */
33
39
  .window-body-content-scroll {
40
+ --window-content-inset: var(--space-md);
41
+
34
42
  height: 100%;
35
- padding: var(--space-md);
43
+ padding: var(--window-content-inset);
36
44
  overflow: auto;
37
45
  scrollbar-gutter: var(--scrollbar-gutter);
38
46
  }