@seeqdev/qomponents 0.0.247-beta.1ab24b167f.20261008 → 0.0.247-beta.3f92cc4ece.20261020
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/README-internal.md +278 -0
- package/README.md +14 -13
- package/dist/example/{.eslintrc.js → .eslintrc.cjs} +2 -1
- package/dist/example/.gitignore +24 -0
- package/dist/example/README.md +3 -1
- package/dist/example/package.json +5 -7
- package/dist/example/src/Example.tsx +79 -96
- package/dist/example/src/index.css +132 -3
- package/dist/example/tsconfig.json +3 -2
- package/dist/example/vite.config.ts +12 -7
- package/dist/index.esm.js +29 -298
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +23 -484
- package/dist/index.js.map +1 -1
- package/dist/src/Accordion/Accordion.d.ts +3 -2
- package/dist/src/Accordion/Accordion.types.d.ts +5 -0
- package/dist/src/Alert/Alert.d.ts +3 -2
- package/dist/src/Alert/Alert.types.d.ts +3 -0
- package/dist/src/Badge/Badge.d.ts +5 -10
- package/dist/src/Badge/Badge.types.d.ts +3 -0
- package/dist/src/Button/Button.d.ts +5 -2
- package/dist/src/Button/Button.styles.d.ts +131 -0
- package/dist/src/Button/Button.types.d.ts +5 -0
- package/dist/src/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/dist/src/ButtonGroup/ButtonGroup.types.d.ts +3 -0
- package/dist/src/ButtonWithDropdown/ButtonWithDropdown.d.ts +5 -3
- package/dist/src/ButtonWithDropdown/ButtonWithDropdown.types.d.ts +10 -0
- package/dist/src/ButtonWithPopover/ButtonWithPopover.d.ts +4 -2
- package/dist/src/ButtonWithPopover/ButtonWithPopover.types.d.ts +6 -0
- package/dist/src/Carousel/Carousel.d.ts +4 -2
- package/dist/src/Carousel/Carousel.types.d.ts +5 -0
- package/dist/src/Checkbox/Checkbox.d.ts +2 -2
- package/dist/src/Checkbox/Checkbox.types.d.ts +7 -0
- package/dist/src/Collapse/Collapse.d.ts +2 -2
- package/dist/src/ColorPickerControl/ColorPickerControl.d.ts +4 -2
- package/dist/src/ColorPickerControl/ColorPickerControl.types.d.ts +6 -0
- package/dist/src/ColorSwatch/ColorSwatch.types.d.ts +4 -0
- package/dist/src/EditorPanel/EditorPanel.d.ts +3 -2
- package/dist/src/EditorPanel/EditorPanel.types.d.ts +3 -0
- package/dist/src/ExternalLink/ExternalLink.d.ts +4 -5
- package/dist/src/ExternalLink/ExternalLink.types.d.ts +4 -4
- package/dist/src/Icon/Icon.types.d.ts +3 -0
- package/dist/src/LoadingIndicator/LoadingIndicator.d.ts +3 -2
- package/dist/src/LoadingIndicator/LoadingIndicator.types.d.ts +5 -2
- package/dist/src/Modal/Modal.d.ts +3 -2
- package/dist/src/Modal/Modal.types.d.ts +4 -0
- package/dist/src/Paginator/Paginator.d.ts +11 -3
- package/dist/src/Paginator/Paginator.styles.d.ts +130 -0
- package/dist/src/Paginator/Paginator.types.d.ts +1 -6
- package/dist/src/Paginator/Paginator.utilities.d.ts +2 -14
- package/dist/src/Pill/Pill.d.ts +4 -3
- package/dist/src/Pill/Pill.types.d.ts +3 -0
- package/dist/src/ProgressBar/ProgressBar.d.ts +3 -2
- package/dist/src/ProgressBar/ProgressBar.types.d.ts +7 -0
- package/dist/src/SeeqActionDropdown/SeeqActionDropdown.d.ts +4 -2
- package/dist/src/SeeqActionDropdown/SeeqActionDropdown.types.d.ts +10 -0
- package/dist/src/SeeqActionDropdown/variants.d.ts +4 -4
- package/dist/src/SegmentedControl/SegmentedControl.d.ts +3 -2
- package/dist/src/SegmentedControl/SegmentedControl.types.d.ts +4 -0
- package/dist/src/Select/Select.d.ts +5 -2
- package/dist/src/Select/Select.types.d.ts +8 -0
- package/dist/src/Slider/Slider.d.ts +6 -2
- package/dist/src/Slider/Slider.types.d.ts +11 -0
- package/dist/src/SvgIcon/SvgIcon.d.ts +3 -2
- package/dist/src/SvgIcon/SvgIcon.types.d.ts +3 -0
- package/dist/src/Tabs/Tabs.d.ts +3 -2
- package/dist/src/Tabs/Tabs.types.d.ts +9 -0
- package/dist/src/TextArea/TextArea.types.d.ts +3 -0
- package/dist/src/TextField/TextField.d.ts +2 -0
- package/dist/src/TextField/TextField.types.d.ts +4 -1
- package/dist/src/ToolbarButton/ToolbarButton.d.ts +7 -2
- package/dist/src/ToolbarButton/ToolbarButton.types.d.ts +18 -0
- package/dist/src/Tooltip/Qtip.d.ts +2 -2
- package/dist/src/Tooltip/Tooltip.d.ts +2 -2
- package/dist/src/TriggerWithDropdown/TriggerWithDropdown.d.ts +2 -2
- package/dist/src/TriggerWithDropdown/TriggerWithDropdown.types.d.ts +6 -1
- package/dist/src/index.build.d.ts +3 -2
- package/dist/src/index.d.ts +3 -2
- package/dist/src/styles/controls.d.ts +24 -0
- package/dist/src/styles/overlays.d.ts +119 -0
- package/dist/src/theme/colors.stylex.d.ts +250 -0
- package/dist/src/theme/controls.stylex.d.ts +21 -0
- package/dist/src/theme/palette.stylex.d.ts +32 -0
- package/dist/src/theme/themes.d.ts +2458 -0
- package/dist/src/types.d.ts +2 -2
- package/dist/styles.css +144 -3535
- package/package.json +6 -10
- package/dist/src/Paginator/Paginator.constants.d.ts +0 -35
- package/dist/src/utils/fieldStyleClasses.d.ts +0 -4
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Qomponents
|
|
2
|
+
|
|
3
|
+
WARNING: Any change to files under `src/` will be published publicly to the
|
|
4
|
+
`@seeqdev/qomponents` package on npm. Review changes carefully and follow the
|
|
5
|
+
release process.
|
|
6
|
+
|
|
7
|
+
Qomponents is the UI component library used at Seeq. It's built with React, StyleX, and headless UI component
|
|
8
|
+
libraries to codify the design standards of Seeq's web assets.
|
|
9
|
+
|
|
10
|
+
## StyleX styling and themes
|
|
11
|
+
|
|
12
|
+
The migration keeps qomponents a conventional StyleX library: named token exports in `.stylex.ts` modules,
|
|
13
|
+
`createTheme` overrides, and component styles composed with `stylex.props`. Legacy CSS names, Tailwind mappings,
|
|
14
|
+
and old theme selectors belong in a webserver compatibility adapter, not the permanent token API.
|
|
15
|
+
|
|
16
|
+
### Shared control styles
|
|
17
|
+
|
|
18
|
+
`TextField`, `TextArea`, `Select`, and `Checkbox` compose the shared border, hover/focus, invalid, and disabled
|
|
19
|
+
styles in `src/styles/controls.ts`. Fixed border widths, radii, dimensions, and typography use `defineConsts`, so
|
|
20
|
+
compiled CSS contains literal values. Components retain their own layout and native behavior. Checkbox and radio
|
|
21
|
+
borders now use the same neutral/hover/disabled color contract as the other controls.
|
|
22
|
+
|
|
23
|
+
### StyleX token modules
|
|
24
|
+
|
|
25
|
+
- `src/theme/colors.stylex.ts` defines one color contract for the UI, including neutral colors and product accents.
|
|
26
|
+
Add future semantic color roles to this contract rather than introducing independently applied sub-themes.
|
|
27
|
+
- `src/theme/controls.stylex.ts` contains fixed control dimensions and typography as compile-time constants.
|
|
28
|
+
Monorepo consumers can import them from the source-only `@seeqdev/qomponents/stylex` subpath.
|
|
29
|
+
This subpath is not published; external consumers use the compiled components and exported `themes`.
|
|
30
|
+
- `src/theme/palette.stylex.ts` shares literal product accent values with the temporary webserver adapter.
|
|
31
|
+
- `src/theme/themes.ts` exports `themes[product][mode]`, a complete theme for each product and light/dark mode.
|
|
32
|
+
Apply one theme with `stylex.props` at each boundary, including portal roots. Nested themes reset the whole
|
|
33
|
+
color contract; adding colors does not add more theme classes to the boundary.
|
|
34
|
+
|
|
35
|
+
These modules use ordinary StyleX-generated variable names. Import definitions directly from their `.stylex`
|
|
36
|
+
module; do not add a legacy-name token API or hardcode generated identifiers. Webserver's temporary
|
|
37
|
+
[`legacyTheme.utilities.ts`](../webserver/app/src/styles/legacyTheme.utilities.ts) applies a complete product/mode
|
|
38
|
+
theme alongside its existing `color_*`, `tw-dark`, and `light` classes. Its main switcher, standalone page roots,
|
|
39
|
+
and local home screen dark boundaries use the adapter. Standalone page updates remove stale theme classes while
|
|
40
|
+
preserving unrelated body classes. Portals mounted under `body` inherit the global theme; components that portal out
|
|
41
|
+
of a local boundary must explicitly carry that boundary's theme during their migration.
|
|
42
|
+
|
|
43
|
+
The adapter preserves legacy palette variables; it does not globally remap broad tokens such as disabled-gray,
|
|
44
|
+
whose meanings differ across existing controls. Add role-specific Tailwind aliases only with the consumers that
|
|
45
|
+
need them. Delete the class adapter once webserver's legacy theme selectors have no consumers.
|
|
46
|
+
|
|
47
|
+
Components use these tokens and shared state styles. Colors use `defineVars` for theme switching; fixed
|
|
48
|
+
dimensions and typography use `defineConsts` so generated CSS contains readable literal values. `themes` is exported from the
|
|
49
|
+
public component barrel and compiled into the published package. Definitions for authoring new StyleX styles still
|
|
50
|
+
come directly from the workspace `.stylex` modules.
|
|
51
|
+
|
|
52
|
+
TextField keeps its current dimensions, font sizes, joined edges, placeholder colors, native disabled/read-only
|
|
53
|
+
behavior, and number-input handling. Light fields inherit their containing surface; dark fields use the dark control
|
|
54
|
+
surface. `fieldBackground` defaults to CSS `initial`, and `firstThatWorks` supplies the `inherit` fallback. Webserver's
|
|
55
|
+
adapter overrides this token to white in light mode, preserving its legacy forms reset without coupling the library
|
|
56
|
+
to that reset.
|
|
57
|
+
|
|
58
|
+
`showError` also sets `aria-invalid` on the input. Consumer validation tests should assert invalid state
|
|
59
|
+
(`toBeInvalid()`) rather than styling classes. When testing
|
|
60
|
+
whether an error is surfaced before validation (for example, during loading), check `aria-invalid` directly:
|
|
61
|
+
`toBeInvalid()` also checks native constraints such as `required`.
|
|
62
|
+
|
|
63
|
+
Use `xstyle` for StyleX overrides; it is composed after the field's built-in styles. `extraClassNames` remains available
|
|
64
|
+
for layout utilities, test hooks, and legacy CSS. Class-string order does not determine precedence. During migration,
|
|
65
|
+
webserver declares its layer order before importing Tailwind: `theme, base, components, stylex, utilities`.
|
|
66
|
+
This temporary host-side bridge preserves existing utility overrides while keeping resets below component styles.
|
|
67
|
+
It does not change the library's generated CSS or StyleX composition API. Remove the bridge after webserver's
|
|
68
|
+
utility overrides are migrated; new StyleX overrides should use `xstyle`.
|
|
69
|
+
The existing `inputWidth` and `inputHeight` props remain explicit dimension overrides and preserve dynamic `xstyle`
|
|
70
|
+
custom properties.
|
|
71
|
+
|
|
72
|
+
For nested elements, use the component’s explicit StyleX slots instead of descendant selectors. For example,
|
|
73
|
+
`Button.iconXstyle` styles its icon and composes after the icon’s built-in styles; the component’s root `xstyle`
|
|
74
|
+
does not target its children.
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import * as stylex from '@stylexjs/stylex';
|
|
78
|
+
import { TextField, themes } from '@seeqdev/qomponents';
|
|
79
|
+
|
|
80
|
+
<div {...stylex.props(themes.analysis.dark)}>
|
|
81
|
+
<TextField placeholder="Name" />
|
|
82
|
+
</div>;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Selecting these compiled themes requires only the StyleX runtime, not a compiler. Import the published `styles.css`
|
|
86
|
+
as usual. Authoring new styles with `stylex.create` still requires a StyleX compiler.
|
|
87
|
+
|
|
88
|
+
The shared `src/styles/controls.ts` definitions compose as base, invalid (when applicable), then disabled.
|
|
89
|
+
Invalid and disabled styles replace every hover/focus/active border override as well as the default border.
|
|
90
|
+
Components retain their own layout, shape, native disabled/read-only behavior, and focus accessibility treatment.
|
|
91
|
+
TextField, TextArea, Select, and Checkbox share these definitions.
|
|
92
|
+
|
|
93
|
+
Qomponents' source test projects compile StyleX locally. Browser tests use runtime injection because Vitest disables
|
|
94
|
+
Vite HMR, which the compiler uses to refresh extracted development CSS. The published-package smoke test checks
|
|
95
|
+
extracted default styles and an exported theme. Other
|
|
96
|
+
workspace packages' Vitest pipelines are unchanged; webserver's Jest adapter now compiles StyleX before SWC.
|
|
97
|
+
|
|
98
|
+
### Verification and legacy compatibility
|
|
99
|
+
|
|
100
|
+
The component migration is complete. Qomponents' source, stories, Ladle, tests, published bundle, and example no
|
|
101
|
+
longer need Tailwind. `src/styles.css` retains ordinary base typography, icon-font assets, and legacy font-icon
|
|
102
|
+
support; `src/styles.build.css` adds the StyleX extraction marker for published builds and source previews.
|
|
103
|
+
PostCSS remains a build-only dependency to resolve ordinary CSS imports before extraction; it generates no utilities.
|
|
104
|
+
|
|
105
|
+
Webserver still uses Tailwind. Its temporary `app/src/styles/qomponentsLegacyTheme.css` owns the legacy CSS
|
|
106
|
+
variables and utility aliases that previously came from qomponents. The existing `legacyTheme.utilities.ts`
|
|
107
|
+
continues to apply StyleX themes alongside legacy selectors. Remove those adapters when their webserver consumers
|
|
108
|
+
are migrated, not when publishing qomponents.
|
|
109
|
+
|
|
110
|
+
Run the component/browser tests, type checks, lint, and `pnpm test:build`. The latter consumes the actual
|
|
111
|
+
`dist/index.esm.js` and `dist/styles.css` in Chromium without a StyleX or Tailwind compiler. Check Ladle as well:
|
|
112
|
+
a successful source transform cannot prove extracted CSS is delivered to its preview. Migration commits include
|
|
113
|
+
webserver consumer-test updates; assertions should describe invalid, selected, or variant state rather than utility
|
|
114
|
+
classes or StyleX hashes.
|
|
115
|
+
|
|
116
|
+
## Local Development
|
|
117
|
+
|
|
118
|
+
Note: ensure your local machine has updated dependencies first by running
|
|
119
|
+
`gradlew :client:packages-qomponents:npmInstall`.
|
|
120
|
+
|
|
121
|
+
Ladle is a component playground web application that takes our components' stories and lets you interact with them
|
|
122
|
+
in a web browser. To start the Ladle server, run: `pnpm dev`.
|
|
123
|
+
|
|
124
|
+
The shared Ladle Vite config preserves StyleX token imports through React's SWC transform so CSS extraction can
|
|
125
|
+
load their definitions. Qomponents uses the `@stylex` marker in `src/styles.build.css` to deliver extracted CSS through
|
|
126
|
+
Vite's normal CSS pipeline. Its shared Ladle and Vitest configs set `tailwind: false`. The standalone StyleX CSS
|
|
127
|
+
endpoint is incompatible with Ladle's Koa middleware server.
|
|
128
|
+
|
|
129
|
+
- Add or update components under `src/`.
|
|
130
|
+
- Export public components and types from `src/index.ts`.
|
|
131
|
+
- Components and stories use StyleX; themeable colors belong in the shared color contract.
|
|
132
|
+
- Verify changes in both light and dark mode and across themes when applicable.
|
|
133
|
+
|
|
134
|
+
### Ladle providers
|
|
135
|
+
|
|
136
|
+
Other packages can import `QomponentsLadleProvider` from `@seeqdev/qomponents/ladle` into their `.ladle/components.tsx` to allow Qomponents to work properly.
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
import { QomponentsLadleProvider } from '@seeqdev/qomponents/ladle';
|
|
140
|
+
|
|
141
|
+
export const Provider = ({ children }) => <QomponentsLadleProvider>{children}</QomponentsLadleProvider>;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If your package also needs Ladle i18n integration, wrap `QomponentsLadleProvider` with `LadleProvider`:
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
import { LadleProvider, createLadleI18n } from '@seeqdev/tools/ladle';
|
|
148
|
+
import { QomponentsLadleProvider } from '@seeqdev/qomponents/ladle';
|
|
149
|
+
|
|
150
|
+
export const Provider = ({ children }) => (
|
|
151
|
+
<LadleProvider i18n={myI18nInstance}>
|
|
152
|
+
<QomponentsLadleProvider>{children}</QomponentsLadleProvider>
|
|
153
|
+
</LadleProvider>
|
|
154
|
+
);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Typecheck
|
|
158
|
+
|
|
159
|
+
To run `tsgo` on Qomponents, use: `gradlew :client:packages-qomponents:tsc`.
|
|
160
|
+
|
|
161
|
+
## Format
|
|
162
|
+
|
|
163
|
+
Format code with: `gradlew :client:packages-qomponents:pnpmLint`
|
|
164
|
+
|
|
165
|
+
## Testing
|
|
166
|
+
|
|
167
|
+
Vitest is split into projects:
|
|
168
|
+
|
|
169
|
+
- `unit`: `src/**/*.unit.test.{ts,tsx}` (node fastest)
|
|
170
|
+
- `component`: `src/**/*.test.{ts,tsx}` (happy-dom fast)
|
|
171
|
+
- `browser`: `src/**/*.test.{ts,tsx}` with the browser runner (Playwright + Chromium, headless by default, slowest)
|
|
172
|
+
|
|
173
|
+
You can run the full check suite by using: `gradlew :client:packages-qomponents:check`
|
|
174
|
+
|
|
175
|
+
### Run a subset of tests
|
|
176
|
+
|
|
177
|
+
Use these when iterating quickly on a specific test category.
|
|
178
|
+
|
|
179
|
+
- Run the runtime test suite (unit + component + browser, excludes build verification) when you want fast feedback on
|
|
180
|
+
component behavior without rebuilding `dist/`: `gradlew :client:packages-qomponents:test`
|
|
181
|
+
- Run unit tests only when you want the fastest feedback and no DOM simulation overhead (pure Node): `pnpm test:unit`
|
|
182
|
+
- Run component tests only when you need DOM rendering via happy-dom but don't need real browser behavior:
|
|
183
|
+
`pnpm test:component`
|
|
184
|
+
- Run browser tests only when validating real browser behavior (Playwright/Chromium headless): `pnpm test:browser`
|
|
185
|
+
- Run browser tests with a visible browser when debugging flaky UI interactions: `pnpm test:browser:ui`
|
|
186
|
+
- Watch mode for rapid iteration while editing tests or components: `pnpm test:watch`
|
|
187
|
+
- Collect test coverage when you need signal on what code paths are exercised: `pnpm test:coverage`
|
|
188
|
+
|
|
189
|
+
### Run build verification tests
|
|
190
|
+
|
|
191
|
+
You can validate the built `dist/` output (bundles, types, assets, example app) by running:
|
|
192
|
+
`gradlew :client:packages-qomponents:testBuild`
|
|
193
|
+
|
|
194
|
+
## Icons
|
|
195
|
+
|
|
196
|
+
Qomponents uses the `@seeqdev/icons` package for SVG icons. Icons are tree-shakeable (a.k.a. only imported icons are in the final web app bundle).
|
|
197
|
+
|
|
198
|
+
The `Icon` component and icon-accepting props (like `<Button icon>`) support two formats:
|
|
199
|
+
|
|
200
|
+
1. **IconDefinition objects** (recommended): Import from `@seeqdev/icons/*` sub-paths
|
|
201
|
+
2. **Legacy string format**: Font Awesome class names like `"fa-solid fa-check"`
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
import { Icon, Button } from '@seeqdev/qomponents';
|
|
205
|
+
import { fcDelete, fcMagGlass } from '@seeqdev/icons/seeq';
|
|
206
|
+
|
|
207
|
+
<Icon icon={fcDelete} />
|
|
208
|
+
<Button icon={fcMagGlass} label="Search" />
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
See `client/packages/icons/README.md` for the full list of available sub-paths and how to add new Seeq icons.
|
|
212
|
+
|
|
213
|
+
## Styles and theming
|
|
214
|
+
|
|
215
|
+
Qomponents supports Seeq themes and dark mode. Many recent changes target visual polish, so validate styling in
|
|
216
|
+
light/dark and in relevant themes before publishing.
|
|
217
|
+
|
|
218
|
+
## Publishing
|
|
219
|
+
|
|
220
|
+
Publishing is handled by the Gradle task. This cannot be run locally unless you have `NPM_TOKEN` set to a valid NPM
|
|
221
|
+
token.
|
|
222
|
+
|
|
223
|
+
```sh
|
|
224
|
+
gradlew :client:packages-qomponents:npmPublish
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Notes:
|
|
228
|
+
|
|
229
|
+
- The package version is read from `client/packages/qomponents/package.json`.
|
|
230
|
+
- `package.json` only publishes `dist/` (via `files`), but `README.md` is always included by npm.
|
|
231
|
+
- The build produces ESM/CJS bundles, CSS, and type declarations under `dist/`, and copies icon fonts plus the
|
|
232
|
+
`example/` app into `dist/example` so consumers can run a working sample aligned to the published package.
|
|
233
|
+
|
|
234
|
+
## CI publishing and version checks
|
|
235
|
+
|
|
236
|
+
Publishing runs in CI. The checked-in `client/packages/qomponents/package.json` provides the base version, and the CI
|
|
237
|
+
publish step will append a [prerelease](https://semver.org/#spec-item-9) suffix to distinguish published versions:
|
|
238
|
+
`-beta.{10-char-sha}.YYYYMMDD`
|
|
239
|
+
|
|
240
|
+
For the full internal process, see:
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
https://seeq.atlassian.net/wiki/spaces/SQ/pages/3416031265/How+To+Add+or+Modify+a+Qomponent+Seeq+Component+Library
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## StyleX build support
|
|
247
|
+
|
|
248
|
+
The build compiles component styles, token defaults, and exported themes together.
|
|
249
|
+
|
|
250
|
+
Inside the monorepo, consumers compile qomponents source using the shared Rust/SWC `@seeqdev/tools/stylex` configuration.
|
|
251
|
+
Named token definitions in `src/theme/<name>.stylex.ts` are directly importable from
|
|
252
|
+
`@seeqdev/qomponents/theme/<name>.stylex`. Keep theme overrides in ordinary `.ts` modules and include public themes in
|
|
253
|
+
the library's export graph so the publish build emits their CSS.
|
|
254
|
+
|
|
255
|
+
The `@stylex;` marker in `src/styles.build.css` receives minified extracted CSS during publication.
|
|
256
|
+
Published consumers use compiled JavaScript and import `@seeqdev/qomponents/styles.css`; no StyleX compiler is required.
|
|
257
|
+
The source-only theme subpath is not published. Supporting external StyleX compilation of shared definitions will
|
|
258
|
+
need an explicit module-identity and export contract before it is enabled.
|
|
259
|
+
|
|
260
|
+
StyleX emits atomic CSS by default. Shared compiler options enable native CSS layers to coexist with existing styles;
|
|
261
|
+
normal unlayered CSS still takes precedence. See [the build documentation](../tools/src/stylex/README.md) for the
|
|
262
|
+
layer ordering, migration constraints and test commands. The published CSS keeps the stable `styles.css` filename.
|
|
263
|
+
|
|
264
|
+
### Build artifact tests
|
|
265
|
+
|
|
266
|
+
`pnpm test:build` builds once and runs both artifact checks: `build.test.ts` checks files, exports, and copied
|
|
267
|
+
resources in Node/happy-dom; `build.browser.test.tsx` checks the built JavaScript and CSS in Chromium. The browser
|
|
268
|
+
project intentionally has no StyleX or Tailwind compiler, so it detects missing published styles and token defaults.
|
|
269
|
+
The two files share the build test configuration but need separate runtimes: happy-dom cannot validate the CSS
|
|
270
|
+
cascade, and Chromium cannot run the filesystem checks.
|
|
271
|
+
|
|
272
|
+
Locally themed dropdowns pass the same theme to `contentXstyle` so the portaled menu and submenus receive it:
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
<ButtonWithDropdown contentXstyle={themes.topic.dark} dropdownItems={items} />
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
A theme applied to `body` is inherited by portals automatically.
|
package/README.md
CHANGED
|
@@ -89,22 +89,23 @@ If you're using webpack + scss be sure to include a <code>~</code> as part of th
|
|
|
89
89
|
|
|
90
90
|
<h3>2) How do I get my Button to be green?</h3>
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Themes are applied by adding the class of the desired theme to a wrapper of your application. The theme class can
|
|
95
|
-
also be applied to the body tag.
|
|
92
|
+
Themes are selected with `themes[product][mode]` and applied to an application wrapper using `stylex.props`.
|
|
93
|
+
Without an explicit theme, components use Topic light colors.
|
|
96
94
|
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
```tsx
|
|
96
|
+
import * as stylex from '@stylexjs/stylex';
|
|
97
|
+
import { Button, themes } from '@seeqdev/qomponents';
|
|
98
|
+
import '@seeqdev/qomponents/styles.css';
|
|
100
99
|
|
|
101
|
-
|
|
100
|
+
<div {...stylex.props(themes.analysis.light)}>
|
|
101
|
+
<Button label="Save" />
|
|
102
|
+
</div>;
|
|
103
|
+
```
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
| DataLab | orange | color_datalab | class="color_datalab" |
|
|
105
|
+
Available products are `topic`, `analysis`, `datalab`, `vantage`, and `insights`; each supports `light` and `dark`.
|
|
106
|
+
Use `themes.analysis.dark` for the dark Analysis theme. Selecting a compiled theme requires the StyleX runtime,
|
|
107
|
+
but no consumer-side StyleX compiler. Apply the same theme to portal roots when they are outside the themed wrapper.
|
|
108
|
+
The former `color_*` classes are no longer part of the published stylesheet.
|
|
108
109
|
|
|
109
110
|
<h3>3) How do I use Fontawesome Icons?</h3>
|
|
110
111
|
Before you can use Fontawesome icons you must install FontAwesome.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
node_modules
|
|
11
|
+
dist
|
|
12
|
+
dist-ssr
|
|
13
|
+
*.local
|
|
14
|
+
|
|
15
|
+
# Editor directories and files
|
|
16
|
+
.vscode/*
|
|
17
|
+
!.vscode/extensions.json
|
|
18
|
+
.idea
|
|
19
|
+
.DS_Store
|
|
20
|
+
*.suo
|
|
21
|
+
*.ntvs*
|
|
22
|
+
*.njsproj
|
|
23
|
+
*.sln
|
|
24
|
+
*.sw?
|
package/dist/example/README.md
CHANGED
|
@@ -12,7 +12,9 @@ This application is built using [vite](https://vitejs.dev/).
|
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
This example uses the compiled qomponents bundle next to it, without a StyleX or Tailwind compiler.
|
|
16
|
+
When running from the source repository, first run `pnpm build` in the qomponents package. The example included
|
|
17
|
+
in a published package already has that bundle. Then install the example's React and Vite dependencies:
|
|
16
18
|
|
|
17
19
|
```sh
|
|
18
20
|
npm install
|
|
@@ -11,15 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@fortawesome/fontawesome-free": "^6.4.0",
|
|
14
|
-
"@
|
|
15
|
-
"
|
|
16
|
-
"react": "
|
|
17
|
-
"react-dom": "18.2.0",
|
|
18
|
-
"tailwindcss": "4.1.8"
|
|
14
|
+
"@stylexjs/stylex": "0.19.1",
|
|
15
|
+
"react": "19.2.0",
|
|
16
|
+
"react-dom": "19.2.0"
|
|
19
17
|
},
|
|
20
18
|
"devDependencies": {
|
|
21
|
-
"@types/react": "
|
|
22
|
-
"@types/react-dom": "
|
|
19
|
+
"@types/react": "19.2.10",
|
|
20
|
+
"@types/react-dom": "19.2.3",
|
|
23
21
|
"@typescript-eslint/eslint-plugin": "5.59.0",
|
|
24
22
|
"@typescript-eslint/parser": "5.59.0",
|
|
25
23
|
"@vitejs/plugin-react": "4.5.1",
|