@sylwellsoftware/fray 0.5.0 → 0.6.0

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.
Files changed (50) hide show
  1. package/README.md +34 -27
  2. package/colors/README.md +28 -13
  3. package/colors/gray/colors.css +54 -26
  4. package/colors/green/colors.css +54 -26
  5. package/colors/iceblue/colors.css +54 -26
  6. package/colors/ocean/colors.css +54 -26
  7. package/colors/orange/colors.css +54 -26
  8. package/colors/purple/colors.css +54 -26
  9. package/colors/red/colors.css +54 -26
  10. package/colors/yellow/colors.css +54 -26
  11. package/dist/Components/data/descriptionList.d.ts.map +1 -1
  12. package/dist/Components/data/listview/listview.d.ts.map +1 -1
  13. package/dist/Components/data/table/DataTable.d.ts.map +1 -1
  14. package/dist/Components/data/table/FilterPanel.d.ts.map +1 -1
  15. package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
  16. package/dist/Components/data/treeview/treeview.d.ts.map +1 -1
  17. package/dist/Components/dialog/dialog.d.ts.map +1 -1
  18. package/dist/Components/layout/panel.d.ts +0 -1
  19. package/dist/Components/layout/panel.d.ts.map +1 -1
  20. package/dist/Components/layout/sidebar.d.ts +0 -1
  21. package/dist/Components/layout/sidebar.d.ts.map +1 -1
  22. package/dist/Components/layout/tabpanel/tabline.d.ts.map +1 -1
  23. package/dist/Components/layout/tabpanel/tabpanel.d.ts.map +1 -1
  24. package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
  25. package/dist/Components/lineinputs/dropdown.d.ts.map +1 -1
  26. package/dist/Components/lineinputs/textbox.d.ts.map +1 -1
  27. package/dist/Components/lineinputs/toggle.d.ts.map +1 -1
  28. package/dist/Components/menu/toolbar.d.ts +0 -1
  29. package/dist/Components/menu/toolbar.d.ts.map +1 -1
  30. package/dist/Components/status/progressBar.d.ts.map +1 -1
  31. package/dist/Components/theme/stylesheetPicker.d.ts.map +1 -1
  32. package/dist/index.js +1214 -1409
  33. package/dist/index.js.map +1 -1
  34. package/dist/{jsx-dev-runtime-pzseD2Sz.js → jsx-dev-runtime-CqunwZ8j.js} +404 -486
  35. package/dist/jsx-dev-runtime-CqunwZ8j.js.map +1 -0
  36. package/dist/jsx-dev-runtime.js +1 -1
  37. package/dist/jsx-runtime.js +1 -1
  38. package/dist/styling/baseStyleDefinitions.d.ts +0 -82
  39. package/dist/styling/baseStyleDefinitions.d.ts.map +1 -1
  40. package/dist/styling/theme.d.ts +3 -3
  41. package/dist/styling/theme.d.ts.map +1 -1
  42. package/package.json +3 -3
  43. package/styles/structural.css +72 -413
  44. package/themes/README.md +68 -66
  45. package/themes/dark.css +48 -1
  46. package/themes/java/theme.css +410 -135
  47. package/themes/light.css +48 -1
  48. package/themes/minimal/theme.css +408 -125
  49. package/themes/shiny/theme.css +484 -294
  50. package/dist/jsx-dev-runtime-pzseD2Sz.js.map +0 -1
package/themes/README.md CHANGED
@@ -1,16 +1,15 @@
1
1
  # Fray structural, theme, and color CSS
2
2
 
3
- Fray deliberately separates three stylesheet responsibilities:
4
-
5
- 1. `@sylwellsoftware/fray/styles/structural.css` contains the generated layout,
6
- flow, accessibility mechanics, stable selectors, and custom-property uses
7
- for the default `fray-` component hosts.
8
- 2. `@sylwellsoftware/fray/themes/<name>/theme.css` supplies geometry, surface
9
- treatment, and semantic theme variables. Supported treatments are `shiny`,
10
- `java`, and `minimal`.
11
- 3. `@sylwellsoftware/fray/colors/<name>/colors.css` supplies palette and
12
- semantic color variables. Supported palettes are `iceblue`, `ocean`,
13
- `green`, `gray`, `orange`, `purple`, `red`, and `yellow`.
3
+ Fray separates three stylesheet responsibilities:
4
+
5
+ 1. `styles/structural.css` contains generated layout, flow, sizing,
6
+ positioning, overflow, interaction mechanics, and justified structural
7
+ hooks for the default component hosts.
8
+ 2. `themes/<name>/theme.css` contains typography, spacing, geometry, surfaces,
9
+ depth, native-element presentation, reusable trait presentation, and the
10
+ mapping from palette values to semantic UI variables.
11
+ 3. `colors/<name>/colors.css` contains primary, secondary, and neutral color
12
+ ramps and contrast/color primitives only.
14
13
 
15
14
  Load the three artifacts independently:
16
15
 
@@ -20,65 +19,68 @@ import '@sylwellsoftware/fray/colors/ocean/colors.css'
20
19
  import '@sylwellsoftware/fray/themes/shiny/theme.css'
21
20
  ```
22
21
 
23
- `ThemePicker` and `ColorPicker` use the exported `frayThemeOptions` and
24
- `frayColorOptions` catalogs by default. Each picker updates a separate
25
- `<link data-fray-stylesheet>` element and the corresponding
26
- `data-fray-theme`/`data-fray-color` root attribute. Applications may supply
27
- their own option catalogs and URLs. The defaults resolve against Fray's
28
- published package layout and therefore work for direct ESM/CDN loading. A
29
- bundler cannot expose a universal runtime URL for package CSS; bundled
30
- applications should import or emit each CSS asset as a URL and pass remapped
31
- options to the pickers.
32
-
33
- ## Variable hierarchy
34
-
35
- The public contract is exported as the machine-readable
36
- `frayThemeVariableCatalog`. Every entry records its layer, family, value kind,
37
- description, and optional fallback.
38
-
39
- | Level | Representative variables | Purpose |
40
- | --- | --- | --- |
41
- | Palette | `--fray-color-primary`, `--fray-color-surface`, `--fray-color-text`, `--fray-color-border`, `--fray-color-focus` | Replaceable color-scheme primitives and semantic colors |
42
- | Global theme | `--fray-font-*`, `--fray-space-*`, `--fray-radius-*`, `--fray-ui-*` | Shared typography, rhythm, shape, and surface treatment |
43
- | Generic families | `--fray-header-*`, `--fray-button-*`, `--fray-input-*`, `--fray-panel-*`, `--fray-selection-*` | Defaults inherited by related controls |
44
- | Family variants | `--fray-table-header-*`, `--fray-panel-header-*`, `--fray-toggle-button-*`, `--fray-tab-button-*`, `--fray-dropdown-trigger-*` | Optional narrow overrides for a theme that differentiates one family member |
45
- | Component escape hatches | `--fray-checkbox-*`, `--fray-progress-*`, `--fray-dialog-*` | Behavior that is not meaningfully shared with a broader family |
46
-
47
- Structural rules use the most-specific variable and fall back through the
48
- family. A custom table-like component can follow the same pattern:
22
+ `ThemePicker` and `ColorPicker` replace separate
23
+ `link[data-fray-stylesheet]` elements and update the `data-theme` and
24
+ `data-color` root attributes. The link metadata retains its Fray prefix because
25
+ it is operational/diagnostic metadata rather than theme vocabulary.
49
26
 
50
- ```css
51
- my-grid > header {
52
- color: var(
53
- --my-grid-header-color,
54
- var(--fray-table-header-color, var(--fray-header-color))
55
- );
56
- background: var(
57
- --my-grid-header-background,
58
- var(--fray-table-header-background, var(--fray-header-background))
59
- );
60
- }
27
+ ## Selectors and scope
28
+
29
+ Themes target native elements directly and expose reusable prefix-free traits:
30
+
31
+ ```text
32
+ buttonlike inputlike datacomponentlike
33
+ headerlike coloredlike panellike
34
+ toolbarlike selectshell
35
+
36
+ buttonshell buttoninner
37
+ inputshell inputinner
38
+ datacomponentshell datacomponentinner
39
+ headershell headerinner
40
+ panelshell panelinner
41
+ toolbarshell toolbarinner
42
+ coloredshell coloredinner
61
43
  ```
62
44
 
63
- The component now adopts every compatible Fray theme without the theme knowing
64
- its selector. A theme can still specialize it by assigning
65
- `--my-grid-header-*` on the component host.
45
+ `like` means a complete single-node treatment. `shell` means an independently
46
+ rendered outer region; `inner` means an independently rendered content region.
47
+ Components do not add wrappers solely to obtain these traits.
48
+
49
+ Every theme uses a named cascade layer. A zero-specificity boundary rule seeds
50
+ its inherited variables on `:root` or the matching `[data-theme]`. Presentation
51
+ selectors live in `@scope`; nested theme roots and `[data-theme-exclude]` stop
52
+ the outer theme's selectors. This separation is deliberate because scope
53
+ limits do not stop custom-property inheritance. Low-specificity `:where()`
54
+ groups let application CSS override both kinds of rule.
66
55
 
67
- ## Selector exceptions
56
+ Themes do not select `data-fray-component` or `data-part`. The former is
57
+ diagnostic metadata. The latter is restricted to component-owned structural
58
+ or behavioral mechanics that cannot be expressed through native structure,
59
+ roles, ARIA state, or a justified public trait.
68
60
 
69
- Variables are preferred but not exclusive. A treatment may target stable
70
- `data-fray-component`, `data-part`, role, and ARIA-state hooks for effects that
71
- custom properties cannot create alone. Shiny uses scoped pseudo-elements and
72
- native progress/select pseudo-parts for layered highlights, dropdown arrows,
73
- checkbox surfaces, headers, and button-like controls. Those decorations use
74
- `pointer-events: none`, preserve native/ARIA state, and are disabled or reduced
75
- under forced-colors where the browser's representation is safer.
61
+ ## Variables
62
+
63
+ The active color file supplies only `--palette-*`. The active theme maps those
64
+ values to prefix-free semantic families such as `--ui-*`, `--header-*`,
65
+ `--button-*`, `--input-*`, `--panel-*`, and `--selection-*`. Generated
66
+ structural CSS may consume these variables where configurable host names make
67
+ a direct theme selector inappropriate.
68
+
69
+ Custom colored content can set:
70
+
71
+ ```css
72
+ .severity-block {
73
+ --colored-light: #ffd7d2;
74
+ --colored-base: #c8332a;
75
+ --colored-dark: #721710;
76
+ --colored-contrast: white;
77
+ }
78
+ ```
76
79
 
77
- Theme authors should not target application classes, generated IDs, or
78
- incidental DOM depth. Color values should remain in `colors.css` whenever
79
- practical; translucent white/black lighting used to construct a treatment is
80
- permitted in `theme.css`.
80
+ An element carrying `coloredlike`, `coloredshell`, or `coloredinner` then lets
81
+ each theme decide whether to use a flat fill, gradient, other treatment, or no
82
+ special polish. When no values are supplied, the primary palette is used.
81
83
 
82
- The top-level `themes/light.css` and `themes/dark.css` exports are retained as
83
- legacy compatibility bundles. New integrations should use the separated paths
84
- above.
84
+ `frayThemeVariableCatalog` publishes the palette and theme variable contract.
85
+ The top-level `themes/light.css` and `themes/dark.css` files remain temporary
86
+ compatibility bundles; new integrations use the separated files.
package/themes/dark.css CHANGED
@@ -1,4 +1,7 @@
1
- :where(:root), [data-fray-theme="dark"] {
1
+ @charset "utf-8";
2
+
3
+ @layer theme {
4
+ :where(:root:not([data-theme]), [data-theme="dark"]) {
2
5
  color-scheme: dark;
3
6
  --ui-text-color: #edf3f8;
4
7
  --ui-input-bg: #202b36;
@@ -36,4 +39,48 @@
36
39
  --error-color: #ff8b9d;
37
40
  --cbx-o-border: 1px solid #a9b6c3;
38
41
  --cbx-border-radius: 0.2rem;
42
+ }
43
+
44
+ @scope (:root:not([data-theme]), [data-theme="dark"]) to ([data-theme], [data-theme-exclude]) {
45
+
46
+ :where(button) {
47
+ min-height: 2rem;
48
+ padding: 0.25rem 0.5rem;
49
+ color: var(--button-color);
50
+ background: var(--button-background);
51
+ border: var(--button-border);
52
+ border-radius: var(--ui-border-radius, 0.375rem);
53
+ box-shadow: var(--button-shadow);
54
+ font: inherit;
55
+ font-size: var(--ui-font-size, inherit);
56
+ }
57
+
58
+ :where(button):hover:not(:disabled) {
59
+ background: var(--button-background-hover);
60
+ }
61
+
62
+ :where(button):disabled {
63
+ color: var(--ui-input-text-color-disabled);
64
+ background: var(--button-background-disabled);
65
+ border: var(--button-border-disabled);
66
+ }
67
+
68
+ :where(input, select, textarea) {
69
+ min-height: 2rem;
70
+ padding: 0.25rem 0.5rem;
71
+ color: var(--ui-text-color);
72
+ background: var(--ui-input-bg);
73
+ border: var(--ui-input-border);
74
+ border-radius: var(--ui-border-radius, 0.375rem);
75
+ box-shadow: var(--input-shadow);
76
+ box-sizing: border-box;
77
+ font: inherit;
78
+ font-size: var(--ui-font-size, inherit);
79
+ }
80
+
81
+ :where(button, input, select, textarea):focus-visible {
82
+ outline: 2px solid var(--ui-accent-color);
83
+ outline-offset: 1px;
84
+ }
85
+ }
39
86
  }