@datatechsolutions/tympan 0.4.0 → 0.4.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/dist/styles.css CHANGED
@@ -1,5 +1,6 @@
1
1
  /* @datatechsolutions/tympan stylesheet entry (FSL-1.1-ALv2). Everything lives in @layer tympan.*. */
2
2
  @layer tympan.tokens, tympan.base, tympan.components;
3
+ @import '@datatechsolutions/tympan-tokens/fonts.css';
3
4
 
4
5
  /* @datatechsolutions/tympan-tokens/tokens.css */
5
6
  /* @datatechsolutions/tympan-tokens (FSL-1.1-ALv2): generated by scripts/build.mjs from src/base/*.tokens.json, src/presets.ts and src/flow.ts. Do not edit. */
@@ -17853,9 +17854,12 @@
17853
17854
  gap: var(--ty-space-1);
17854
17855
  outline: none;
17855
17856
  }
17857
+ /* Columns follow the surface's width, not the viewport's: a dialog is
17858
+ narrower than the window, and three viewport-driven columns squeezed
17859
+ names such as "Español" into the code beside them. */
17856
17860
  .ty-locale-picker__list[data-layout='grid'] {
17857
17861
  display: grid;
17858
- grid-template-columns: repeat(2, minmax(0, 1fr));
17862
+ grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
17859
17863
  }
17860
17864
  .ty-locale-picker__option {
17861
17865
  display: flex;
@@ -17891,6 +17895,7 @@
17891
17895
  min-inline-size: 0;
17892
17896
  }
17893
17897
  .ty-locale-picker__code {
17898
+ flex: none;
17894
17899
  color: var(--ty-ink-3);
17895
17900
  font-family: var(--ty-font-mono);
17896
17901
  font-size: var(--ty-font-size-meta);
@@ -17910,12 +17915,6 @@
17910
17915
  line-height: var(--ty-font-line-height-meta);
17911
17916
  }
17912
17917
 
17913
- @media (min-width: 640px) {
17914
- .ty-locale-picker__list[data-layout='grid'] {
17915
- grid-template-columns: repeat(3, minmax(0, 1fr));
17916
- }
17917
- }
17918
-
17919
17918
  @media (forced-colors: active) {
17920
17919
  .ty-locale-picker__option[data-selected] {
17921
17920
  background: Highlight;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datatechsolutions/tympan",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Tympan: accessible React components (React 18.3 or 19) on React Aria Components, styled with --ty-* CSS custom properties in @layer tympan. The flow and provenance canvas (graph viewer, DAG editor, run inspection) ships as the @datatechsolutions/tympan/flow subpath. Generated avatars (DiceBear, CC0/MIT styles only) ship as the /avatars subpath and country and region flags as the /flags subpath.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "author": "Natalia Mesquita",
@@ -154,7 +154,7 @@
154
154
  },
155
155
  "dependencies": {
156
156
  "@dagrejs/dagre": "^3.1.1",
157
- "@datatechsolutions/tympan-tokens": "^0.4.0",
157
+ "@datatechsolutions/tympan-tokens": "^0.4.1",
158
158
  "@dicebear/core": "^9.4.3",
159
159
  "@internationalized/date": "^3.12.4",
160
160
  "@types/d3-array": "^3.2.2",
@@ -15,9 +15,12 @@
15
15
  gap: var(--ty-space-1);
16
16
  outline: none;
17
17
  }
18
+ /* Columns follow the surface's width, not the viewport's: a dialog is
19
+ narrower than the window, and three viewport-driven columns squeezed
20
+ names such as "Español" into the code beside them. */
18
21
  .ty-locale-picker__list[data-layout='grid'] {
19
22
  display: grid;
20
- grid-template-columns: repeat(2, minmax(0, 1fr));
23
+ grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
21
24
  }
22
25
  .ty-locale-picker__option {
23
26
  display: flex;
@@ -53,6 +56,7 @@
53
56
  min-inline-size: 0;
54
57
  }
55
58
  .ty-locale-picker__code {
59
+ flex: none;
56
60
  color: var(--ty-ink-3);
57
61
  font-family: var(--ty-font-mono);
58
62
  font-size: var(--ty-font-size-meta);
@@ -72,12 +76,6 @@
72
76
  line-height: var(--ty-font-line-height-meta);
73
77
  }
74
78
 
75
- @media (min-width: 640px) {
76
- .ty-locale-picker__list[data-layout='grid'] {
77
- grid-template-columns: repeat(3, minmax(0, 1fr));
78
- }
79
- }
80
-
81
79
  @media (forced-colors: active) {
82
80
  .ty-locale-picker__option[data-selected] {
83
81
  background: Highlight;
@@ -42,10 +42,13 @@ export interface ThemeProviderProps {
42
42
  */
43
43
  storageKey?: string
44
44
  /**
45
- * Font stylesheet per theme name (for example `printThemeFontUrls` from
46
- * the tokens package). The URL of the current theme is added as a
47
- * `<link rel="stylesheet">` (in `<head>` for `document`, inside the wrapper
48
- * for `scope`); themes without an entry load nothing.
45
+ * Extra font stylesheet per theme name, for the host's own themes. The
46
+ * fonts of every built-in and print theme are bundled with
47
+ * `@font-face` in the token sheets, so this is optional and empty by
48
+ * default (nothing is fetched from a third party). The URL of the current
49
+ * theme is added as a `<link rel="stylesheet">` (in `<head>` for
50
+ * `document`, inside the wrapper for `scope`); themes without an entry
51
+ * load nothing.
49
52
  */
50
53
  fonts?: Readonly<Record<string, string>>
51
54
  className?: string
@@ -171,7 +174,7 @@ export function useTheme(): ThemeState {
171
174
  */
172
175
  export function themeInitScript(storageKey = 'ty-theme', defaults: Stored = {}, options: { fonts?: Readonly<Record<string, string>> } = {}): string {
173
176
  const d = JSON.stringify({ theme: defaults.theme ?? 'tympan', mode: defaults.mode ?? 'system', density: defaults.density ?? 'default' })
174
- // Optional: the font stylesheet of the stored theme, added before first paint (same link ThemeProvider `fonts` manages).
177
+ // Optional: a host font stylesheet for the stored theme, added before first paint (same link ThemeProvider `fonts` manages). Built-in and print theme fonts are bundled and need none.
175
178
  const fonts = options.fonts && Object.keys(options.fonts).length
176
179
  ? `var f=${JSON.stringify(options.fonts).replace(/</g, '\\u003c')}[t];if(f){var l=document.createElement('link');l.rel='stylesheet';l.href=f;l.setAttribute('data-ty-theme-fonts','');document.head.appendChild(l);}`
177
180
  : ''