@cratis/components 3.3.3 → 3.4.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.
- package/README.md +204 -129
- package/dist/esm/Common/Button.d.ts.map +1 -1
- package/dist/esm/Common/Button.js +4 -1
- package/dist/esm/Common/Button.js.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.js +5 -2
- package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
- package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableCore.js +1 -1
- package/dist/esm/DataTables/DataTableCore.js.map +1 -1
- package/dist/esm/Display/Message.d.ts +2 -1
- package/dist/esm/Display/Message.d.ts.map +1 -1
- package/dist/esm/Display/Message.js +14 -2
- package/dist/esm/Display/Message.js.map +1 -1
- package/dist/esm/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/Dropdown/Dropdown.js +12 -2
- package/dist/esm/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/Styled/CratisPreset.d.ts +2 -0
- package/dist/esm/Styled/CratisPreset.d.ts.map +1 -0
- package/dist/esm/Styled/CratisPreset.js +80 -0
- package/dist/esm/Styled/CratisPreset.js.map +1 -0
- package/dist/esm/Styled/index.d.ts +4 -0
- package/dist/esm/Styled/index.d.ts.map +1 -0
- package/dist/esm/Styled/index.js +4 -0
- package/dist/esm/Styled/index.js.map +1 -0
- package/dist/esm/Styled/primeReactStyles.d.ts +3 -0
- package/dist/esm/Styled/primeReactStyles.d.ts.map +1 -0
- package/dist/esm/Styled/primeReactStyles.js +202 -0
- package/dist/esm/Styled/primeReactStyles.js.map +1 -0
- package/dist/esm/Styled/styledMode.d.ts +12 -0
- package/dist/esm/Styled/styledMode.d.ts.map +1 -0
- package/dist/esm/Styled/styledMode.js +68 -0
- package/dist/esm/Styled/styledMode.js.map +1 -0
- package/dist/esm/primereact-v10-palette.css +242 -0
- package/dist/esm/styles.css +2 -2
- package/dist/esm/theme.css +30 -4
- package/dist/esm/tokens.css +18 -11
- package/package.json +16 -2
package/README.md
CHANGED
|
@@ -49,8 +49,8 @@ The other **peer dependencies** you provide are `react` / `react-dom` (**19+**),
|
|
|
49
49
|
`@cratis/arc*` packages (`>=20.3.1 <22` — Arc 20 and 21 both work), `reflect-metadata`
|
|
50
50
|
and `tsyringe`; you typically already have these in a Cratis app. `pixi.js`,
|
|
51
51
|
`framer-motion`, `allotment` and `react-icons` remain regular dependencies and are
|
|
52
|
-
installed for you.
|
|
53
|
-
|
|
52
|
+
installed for you. `@primereact/styles` and `@primeuix/themes` are **optional** peers,
|
|
53
|
+
needed only for PrimeReact's styled mode (see [Styling](#styling)).
|
|
54
54
|
|
|
55
55
|
### Stylesheets
|
|
56
56
|
|
|
@@ -76,12 +76,13 @@ packages it brings with it.
|
|
|
76
76
|
|---|---|---|
|
|
77
77
|
| `primereact` | MIT | PrimeUI commercial |
|
|
78
78
|
| `primeicons` | MIT (7.x) | PrimeUI commercial (8.x) |
|
|
79
|
-
| `@primereact/core`, `@primereact/headless` | — | PrimeUI commercial |
|
|
79
|
+
| `@primereact/core`, `@primereact/headless`, `@primereact/styles` | — | PrimeUI commercial |
|
|
80
80
|
| `@primeuix/themes`, `@primeuix/styled` | — | PrimeUI commercial |
|
|
81
81
|
|
|
82
82
|
`@cratis/components` itself remains **MIT**. The change is in what it depends on, and it is
|
|
83
83
|
yours to satisfy: PrimeReact is a peer dependency, so you install it and its license terms
|
|
84
|
-
apply to you directly.
|
|
84
|
+
apply to you directly. `@primereact/styles` and `@primeuix/themes` — the two styled mode
|
|
85
|
+
adds — are PrimeUI-licensed too.
|
|
85
86
|
|
|
86
87
|
### A key is required regardless of how you style
|
|
87
88
|
|
|
@@ -168,13 +169,15 @@ Components:
|
|
|
168
169
|
- `@cratis/components/SchemaEditor`
|
|
169
170
|
- `@cratis/components/TimeMachine`
|
|
170
171
|
- `@cratis/components/Toolbar`
|
|
172
|
+
- `@cratis/components/styled` — `styledMode`, `CratisPreset`, `primeReactStyles`, `primeReactCssLayer`, `primeReactCssLayerOrder`, `cratisDarkModeSelector`: PrimeReact's styled mode, wired for the provider (needs `@primereact/styles` + `@primeuix/themes`)
|
|
171
173
|
- `@cratis/components/types`
|
|
172
174
|
|
|
173
175
|
Stylesheets:
|
|
174
176
|
|
|
175
|
-
- `@cratis/components/theme` — the **Cratis baseline theme** (light + dark, Cratis-authored MIT CSS, no `@primeuix/themes` dependency); import it and add `class="cratis-theme"` to skin every component from the token layer
|
|
177
|
+
- `@cratis/components/theme` — the **Cratis baseline theme** (light + dark, Cratis-authored MIT CSS, no `@primereact/styles` / `@primeuix/themes` dependency); import it and add `class="cratis-theme"` to skin every component from the token layer
|
|
176
178
|
- `@cratis/components/styles` — **required**: every component stylesheet, the Tailwind utilities used inside the package, and the `allotment` rules `DataPage` needs, in one file
|
|
177
179
|
- `@cratis/components/tokens` — **required**: the `--cratis-*` CSS variable tokens every component reads from
|
|
180
|
+
- `@cratis/components/primereact-v10-palette` — the PrimeReact 10 theme variables (`--surface-*`, `--text-color`, `--primary-color`, the color scales, …) restored with the lara-blue values, for CSS already written against them
|
|
178
181
|
|
|
179
182
|
## Styling
|
|
180
183
|
|
|
@@ -198,24 +201,31 @@ much control you want, and the other layers stay invisible.
|
|
|
198
201
|
| Setup | When | Effort | Extra dependency | What you write |
|
|
199
202
|
|---|---|---|---|---|
|
|
200
203
|
| **Cratis baseline theme** | You want a polished default look without adding a theme package. | Lowest | None | `unstyled` + `import '@cratis/components/theme'` + `class="cratis-theme"` |
|
|
201
|
-
| **
|
|
202
|
-
| **A custom palette over a
|
|
204
|
+
| **PrimeReact's styled mode** | You want PrimeReact's own look — a `@primeuix/themes` preset painting PrimeReact's component styles. | Low | `@primereact/styles` + `@primeuix/themes` | `value={{ license, ...styledMode() }}` with `styledMode` from `@cratis/components/styled` |
|
|
205
|
+
| **A custom palette over a theme** | You want the theme's structure but your own colors. | Low | As above, or none | `--cratis-*` overrides on the baseline theme, or `styledMode({ preset: definePreset(CratisPreset, …) })` |
|
|
203
206
|
| **Fully unstyled** | You're integrating into a tightly controlled design system. | Highest | None | `unstyled: true` + a `pt` preset in CSS or Tailwind |
|
|
204
207
|
|
|
205
208
|
> **Why you need a theme, a baseline stylesheet, or a `pt` preset**
|
|
206
209
|
>
|
|
207
|
-
> PrimeReact 11 is **unstyled-first**: the
|
|
208
|
-
>
|
|
209
|
-
>
|
|
210
|
-
>
|
|
211
|
-
>
|
|
210
|
+
> PrimeReact 11 is **unstyled-first**: the `primereact` package is primitives
|
|
211
|
+
> that render structural markup with `data-scope` / `data-part` attributes,
|
|
212
|
+
> no built-in visuals and **no `p-*` class names**. The class names and the
|
|
213
|
+
> CSS behind them live in `@primereact/styles`; PrimeReact's own styled
|
|
214
|
+
> components (`@primereact/ui`) are just the primitives with those styles
|
|
215
|
+
> preset, and this library builds on the primitives. So a look comes from one
|
|
216
|
+
> of three sources — PrimeReact's styled mode (`styledMode()`: a
|
|
217
|
+
> `@primeuix/themes` preset **plus** PrimeReact's component styles), the
|
|
218
|
+
> Cratis baseline theme (`@cratis/components/theme`), or your own `pt`/CSS.
|
|
219
|
+
> Load none of them and the components render as their raw HTML primitives.
|
|
220
|
+
> **A preset alone is not one of the three** — `theme: { preset }` by itself
|
|
221
|
+
> emits `--p-*` tokens but styles nothing rendered here.
|
|
212
222
|
>
|
|
213
223
|
> The `--cratis-*` token layer is an **additive Cratis-scoped tint** for
|
|
214
224
|
> surfaces *our* wrappers own (validation error text, the FormElement addon,
|
|
215
225
|
> breadcrumb borders, etc.). It is not, by itself, enough to skin the
|
|
216
|
-
> PrimeReact widgets — pair it with the baseline theme,
|
|
217
|
-
> preset.
|
|
218
|
-
> you want the whole UI in your palette.
|
|
226
|
+
> PrimeReact widgets — pair it with the baseline theme, styled mode, or a `pt`
|
|
227
|
+
> preset. Derive the preset (styled mode) or override the `--cratis-*` tokens
|
|
228
|
+
> (baseline theme) when you want the whole UI in your palette.
|
|
219
229
|
|
|
220
230
|
All setups share the same one-line provider setup. You can change direction
|
|
221
231
|
later because the same provider, tokens, and `pt` hooks stay available.
|
|
@@ -245,7 +255,7 @@ export const App = () => (
|
|
|
245
255
|
required, not optional.
|
|
246
256
|
- `CratisComponentsProvider` is a thin wrapper over `@primereact/core`'s
|
|
247
257
|
`PrimeReactProvider` so Cratis has one place to layer in defaults (including
|
|
248
|
-
the optional `
|
|
258
|
+
the optional `...styledMode()` styled layer). Drop in the raw
|
|
249
259
|
`PrimeReactProvider` from `@primereact/core` if you'd rather.
|
|
250
260
|
|
|
251
261
|
The setups below differ only in **what else** you load on top of this
|
|
@@ -253,61 +263,62 @@ provider setup.
|
|
|
253
263
|
|
|
254
264
|
---
|
|
255
265
|
|
|
256
|
-
### Use
|
|
266
|
+
### Use PrimeReact's styled mode
|
|
257
267
|
|
|
258
268
|
PrimeReact 11 dropped the v10 `primereact/resources/themes/*/theme.css`
|
|
259
|
-
stylesheets
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
269
|
+
stylesheets. A theme is now handed to the provider at runtime, in two halves: a
|
|
270
|
+
`@primeuix/themes` **preset** (a token object `@primeuix/styled` turns into
|
|
271
|
+
`--p-*` custom properties) and PrimeReact's **component styles**
|
|
272
|
+
(`@primereact/styles` — the `p-*` class names and the CSS the tokens drive).
|
|
273
|
+
`styledMode()` from `@cratis/components/styled` returns both as
|
|
274
|
+
`{ theme, defaults }`; spread it into the provider `value` next to your
|
|
275
|
+
license key. The `defaults` are `primeReactStyles`, PrimeReact's component
|
|
276
|
+
styles keyed by primitive name, which the provider applies to **every**
|
|
277
|
+
primitive rendered under it — the ones this library renders and the ones your
|
|
278
|
+
app renders itself. That is what puts the `p-*` class names on the elements and
|
|
279
|
+
lets the preset paint them; the `--cratis-*` tokens follow the preset's `--p-*`
|
|
280
|
+
so Cratis-scoped surfaces stay in sync.
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
npm install @primereact/styles @primeuix/themes # optional peers, styled mode only
|
|
284
|
+
```
|
|
264
285
|
|
|
265
286
|
```tsx
|
|
266
|
-
import Aura from '@primeuix/themes/aura'; // or lara / nora / material
|
|
267
287
|
import 'primeicons/primeicons.css';
|
|
288
|
+
import '@cratis/components/tokens';
|
|
268
289
|
import '@cratis/components/styles';
|
|
269
|
-
|
|
270
290
|
import { CratisComponentsProvider } from '@cratis/components';
|
|
291
|
+
import { styledMode } from '@cratis/components/styled';
|
|
271
292
|
|
|
272
293
|
export const App = () => (
|
|
273
|
-
<CratisComponentsProvider value={{
|
|
294
|
+
<CratisComponentsProvider value={{ license: 'YOUR-PRIMEUI-KEY', ...styledMode() }}>
|
|
274
295
|
<YourApp />
|
|
275
296
|
</CratisComponentsProvider>
|
|
276
297
|
);
|
|
277
298
|
```
|
|
278
299
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
export const App = () => (
|
|
295
|
-
<CratisComponentsProvider value={{ unstyled: true }}>
|
|
296
|
-
<div className="cratis-theme"> {/* scope: put on <body>, app root, or a subtree */}
|
|
297
|
-
<YourApp />
|
|
298
|
-
</div>
|
|
299
|
-
</CratisComponentsProvider>
|
|
300
|
-
);
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Add `cratis-dark` to an ancestor for the dark palette. The theme defers to a
|
|
304
|
-
`@primeuix/themes` preset's `--p-*` tokens when one is present, so you can layer
|
|
305
|
-
it under a preset too, and every rule is overridable via your own CSS or `pt`.
|
|
300
|
+
The default preset is `CratisPreset` — Lara with the blue primary and gray
|
|
301
|
+
surfaces of PrimeReact 10's `lara-light-blue` / `lara-dark-blue`, with the dark
|
|
302
|
+
surface scale one step lighter so content sits above the page as it did there,
|
|
303
|
+
both color schemes.
|
|
304
|
+
Options: `preset` (any `@primeuix/themes` preset — Aura, Lara, Nora, Material —
|
|
305
|
+
or a `definePreset` result), `darkModeSelector` (default `.cratis-dark`, the
|
|
306
|
+
class the baseline theme uses too; `'system'` follows `prefers-color-scheme`),
|
|
307
|
+
`cssLayer` (default the `primereact` layer ordered between Tailwind's `base`
|
|
308
|
+
and `components`; `false` emits the theme unlayered).
|
|
309
|
+
|
|
310
|
+
> **A preset alone styles nothing.** `value={{ theme: { preset } }}` without the
|
|
311
|
+
> `defaults` emits the `--p-*` tokens, but the primitives keep rendering with no
|
|
312
|
+
> `p-*` class, so nothing rendered by this library is painted. Use
|
|
313
|
+
> `styledMode()`.
|
|
306
314
|
|
|
307
315
|
#### Override a single component with CSS
|
|
308
316
|
|
|
309
|
-
Plain CSS works fine on top of the theme.
|
|
310
|
-
names
|
|
317
|
+
Plain CSS works fine on top of the theme. In styled mode PrimeReact's elements
|
|
318
|
+
carry their `p-*` class names, and the theme is emitted into the `primereact`
|
|
319
|
+
cascade layer, so a plain unlayered rule in your own stylesheet wins — exactly
|
|
320
|
+
as it did against PrimeReact 10's `@layer primereact` stylesheets. Or target
|
|
321
|
+
your own `className`:
|
|
311
322
|
|
|
312
323
|
```css
|
|
313
324
|
/* yourApp.css */
|
|
@@ -322,7 +333,7 @@ names or your own `className`:
|
|
|
322
333
|
```
|
|
323
334
|
|
|
324
335
|
```tsx
|
|
325
|
-
<Button
|
|
336
|
+
<Button className="dangerous-button">Delete</Button>
|
|
326
337
|
```
|
|
327
338
|
|
|
328
339
|
#### Override a single component with Tailwind
|
|
@@ -338,72 +349,116 @@ Pass Tailwind utility classes through the wrapper's `className` prop:
|
|
|
338
349
|
</Dialog>
|
|
339
350
|
```
|
|
340
351
|
|
|
341
|
-
**Use this setup when:** you're prototyping, building internal tools,
|
|
342
|
-
happy with one of the prebuilt
|
|
352
|
+
**Use this setup when:** you're prototyping, building internal tools, want the
|
|
353
|
+
look Cratis apps had on PrimeReact 10, or are happy with one of the prebuilt
|
|
354
|
+
PrimeReact design systems.
|
|
355
|
+
|
|
356
|
+
### Use the Cratis baseline theme
|
|
357
|
+
|
|
358
|
+
Want a polished default look **without adding `@primereact/styles` and
|
|
359
|
+
`@primeuix/themes`**? Ship the components unstyled and import the Cratis baseline
|
|
360
|
+
theme — Cratis-authored MIT CSS that styles every component from the `--cratis-*`
|
|
361
|
+
layer. (You still need a PrimeUI key to run PrimeReact itself — see
|
|
362
|
+
[Licensing](#licensing).)
|
|
363
|
+
|
|
364
|
+
```tsx
|
|
365
|
+
import 'primeicons/primeicons.css';
|
|
366
|
+
import '@cratis/components/theme'; // the baseline theme
|
|
367
|
+
|
|
368
|
+
export const App = () => (
|
|
369
|
+
<CratisComponentsProvider value={{ unstyled: true }}>
|
|
370
|
+
<div className="cratis-theme"> {/* scope: put on <body>, app root, or a subtree */}
|
|
371
|
+
<YourApp />
|
|
372
|
+
</div>
|
|
373
|
+
</CratisComponentsProvider>
|
|
374
|
+
);
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Add `cratis-dark` to an ancestor for the dark palette. The theme defers to a
|
|
378
|
+
`@primeuix/themes` preset's `--p-*` tokens when one is present, so you can layer
|
|
379
|
+
it under styled mode too, and every rule is overridable via your own CSS or `pt`.
|
|
380
|
+
The baseline theme styles the unstyled primitives through their `[data-scope]`
|
|
381
|
+
attributes — there are no `p-*` class names outside styled mode — so target
|
|
382
|
+
those, or your own `className`, or the `--cratis-*` tokens:
|
|
383
|
+
|
|
384
|
+
```css
|
|
385
|
+
.cratis-theme [data-scope='button'] { border-radius: 999px; } /* pill buttons */
|
|
386
|
+
.dangerous { background: var(--cratis-red-500); color: white; }
|
|
387
|
+
```
|
|
343
388
|
|
|
344
389
|
---
|
|
345
390
|
|
|
346
391
|
### Use a custom palette on top of a PrimeReact theme
|
|
347
392
|
|
|
348
|
-
Keep a
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
393
|
+
Keep a theme as your **structural baseline** (so every widget gets its
|
|
394
|
+
padding, dialog frame, button shape, focus ring, etc.) and repaint it with your
|
|
395
|
+
own colors. Which knob you turn depends on the theme:
|
|
396
|
+
|
|
397
|
+
- **Cratis baseline theme** — override the `--cratis-*` tokens in CSS; the
|
|
398
|
+
theme paints the widgets from them, so one override repaints widgets and
|
|
399
|
+
Cratis-scoped surfaces alike.
|
|
400
|
+
- **PrimeReact's styled mode** — derive your own preset with `definePreset` and
|
|
401
|
+
hand it to `styledMode({ preset })`; the widgets read the preset's `--p-*`
|
|
402
|
+
tokens, and the `--cratis-*` tokens follow.
|
|
354
403
|
|
|
355
|
-
####
|
|
404
|
+
#### Baseline theme, plain CSS
|
|
356
405
|
|
|
357
406
|
```css
|
|
358
|
-
/* palette.override.css — imported once, after @cratis/components/
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
--surface-
|
|
362
|
-
--surface-
|
|
363
|
-
--surface-
|
|
364
|
-
--surface-
|
|
365
|
-
|
|
366
|
-
--
|
|
367
|
-
--
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
--
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
--
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
--highlight-bg: #1e40af;
|
|
377
|
-
--highlight-text-color: #ffffff;
|
|
378
|
-
|
|
379
|
-
--border-radius: 10px;
|
|
380
|
-
|
|
381
|
-
/* --cratis-* tokens default to var(--surface-*) etc. via tokens.css, so
|
|
382
|
-
the overrides above flow through automatically. Set these explicitly
|
|
383
|
-
only if you want Cratis-scoped surfaces tinted differently. */
|
|
384
|
-
--cratis-red-500: #ef4444;
|
|
385
|
-
--cratis-green-500: #22c55e;
|
|
407
|
+
/* palette.override.css — imported once, after @cratis/components/theme */
|
|
408
|
+
.cratis-theme {
|
|
409
|
+
--cratis-surface-section: #0f172a;
|
|
410
|
+
--cratis-surface-card: #1e293b;
|
|
411
|
+
--cratis-surface-overlay: #1e293b;
|
|
412
|
+
--cratis-surface-hover: #334155;
|
|
413
|
+
--cratis-surface-border: #334155;
|
|
414
|
+
|
|
415
|
+
--cratis-text-color: #f8fafc;
|
|
416
|
+
--cratis-text-color-secondary: #94a3b8;
|
|
417
|
+
|
|
418
|
+
--cratis-primary-color: #38bdf8;
|
|
419
|
+
--cratis-primary-color-text: #0b1220;
|
|
420
|
+
|
|
421
|
+
--cratis-highlight-bg: #1e40af;
|
|
422
|
+
--cratis-highlight-text-color: #ffffff;
|
|
423
|
+
|
|
424
|
+
--cratis-border-radius: 10px;
|
|
386
425
|
}
|
|
387
426
|
```
|
|
388
427
|
|
|
428
|
+
#### Styled mode, `definePreset`
|
|
429
|
+
|
|
430
|
+
```ts
|
|
431
|
+
// brand-preset.ts
|
|
432
|
+
import { definePreset } from '@primeuix/themes';
|
|
433
|
+
import { CratisPreset } from '@cratis/components/styled';
|
|
434
|
+
|
|
435
|
+
export const BrandPreset = definePreset(CratisPreset, {
|
|
436
|
+
semantic: {
|
|
437
|
+
primary: {
|
|
438
|
+
50: '{sky.50}', 100: '{sky.100}', 200: '{sky.200}',
|
|
439
|
+
300: '{sky.300}', 400: '{sky.400}', 500: '{sky.500}',
|
|
440
|
+
600: '{sky.600}', 700: '{sky.700}', 800: '{sky.800}',
|
|
441
|
+
900: '{sky.900}', 950: '{sky.950}',
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
});
|
|
445
|
+
```
|
|
446
|
+
|
|
389
447
|
```tsx
|
|
390
|
-
|
|
391
|
-
import 'primeicons/primeicons.css';
|
|
392
|
-
import '@cratis/components/styles';
|
|
393
|
-
// 2. Your palette overrides — must come after the styles so they win.
|
|
394
|
-
import './palette.override.css';
|
|
448
|
+
<CratisComponentsProvider value={{ license, ...styledMode({ preset: BrandPreset }) }}>
|
|
395
449
|
```
|
|
396
450
|
|
|
397
451
|
#### Scoped (dark-on-light, light-on-dark, etc.)
|
|
398
452
|
|
|
399
|
-
|
|
400
|
-
|
|
453
|
+
`--cratis-*` tokens cascade like any other CSS variable, so an ancestor scope
|
|
454
|
+
works under the baseline theme (in styled mode, region-scoped widget colors come
|
|
455
|
+
from the preset; the `--cratis-*` overrides still retint Cratis-scoped surfaces):
|
|
401
456
|
|
|
402
457
|
```css
|
|
403
458
|
.dark-zone {
|
|
404
|
-
--surface-card:
|
|
405
|
-
--text-color:
|
|
406
|
-
--primary-color: #60a5fa;
|
|
459
|
+
--cratis-surface-card: #0b1220;
|
|
460
|
+
--cratis-text-color: #f8fafc;
|
|
461
|
+
--cratis-primary-color: #60a5fa;
|
|
407
462
|
}
|
|
408
463
|
```
|
|
409
464
|
|
|
@@ -421,37 +476,54 @@ Tailwind handles cascade and dark mode:
|
|
|
421
476
|
```css
|
|
422
477
|
/* app.css */
|
|
423
478
|
@import "tailwindcss";
|
|
479
|
+
@import "@cratis/components/tokens";
|
|
424
480
|
@import "@cratis/components/styles";
|
|
425
481
|
|
|
426
482
|
@layer base {
|
|
427
483
|
:root {
|
|
428
|
-
--surface-card: theme('colors.slate.800');
|
|
429
|
-
--surface-border: theme('colors.slate.700');
|
|
430
|
-
--text-color: theme('colors.slate.50');
|
|
431
|
-
--primary-color: theme('colors.sky.400');
|
|
432
|
-
--cratis-red-500:
|
|
484
|
+
--cratis-surface-card: theme('colors.slate.800');
|
|
485
|
+
--cratis-surface-border: theme('colors.slate.700');
|
|
486
|
+
--cratis-text-color: theme('colors.slate.50');
|
|
487
|
+
--cratis-primary-color: theme('colors.sky.400');
|
|
488
|
+
--cratis-red-500: theme('colors.red.500');
|
|
433
489
|
}
|
|
434
490
|
|
|
435
|
-
.dark {
|
|
436
|
-
--surface-card: theme('colors.slate.900');
|
|
437
|
-
--text-color: theme('colors.slate.100');
|
|
491
|
+
.cratis-dark {
|
|
492
|
+
--cratis-surface-card: theme('colors.slate.900');
|
|
493
|
+
--cratis-text-color: theme('colors.slate.100');
|
|
438
494
|
}
|
|
439
495
|
}
|
|
440
496
|
```
|
|
441
497
|
|
|
498
|
+
#### CSS written against PrimeReact 10's variables
|
|
499
|
+
|
|
500
|
+
If your stylesheets still use the names a v10 theme published on `:root` —
|
|
501
|
+
`--surface-ground`, `--surface-card`, `--surface-border`, `--text-color`,
|
|
502
|
+
`--primary-color`, the `--surface-0…900` and color scales — import
|
|
503
|
+
`@cratis/components/primereact-v10-palette` after `tokens` and `styles`. It
|
|
504
|
+
restores every one of them with the `lara-light-blue` / `lara-dark-blue`
|
|
505
|
+
values: the semantic names follow the active preset's `--p-*` tokens where
|
|
506
|
+
v11 has an equivalent (Lara as the fallback), the numbered scales are the
|
|
507
|
+
lara-blue values verbatim (the v10 dark surface scale was inverted, so
|
|
508
|
+
`--p-surface-*` cannot stand in for it), and light/dark switch through
|
|
509
|
+
`light-dark()` keyed off `.cratis-dark`. It exists so what is already written
|
|
510
|
+
keeps working — write nothing new against those names; use `--cratis-*` (or
|
|
511
|
+
`--p-*`).
|
|
512
|
+
|
|
442
513
|
#### What `--cratis-*` tokens are for
|
|
443
514
|
|
|
444
|
-
PrimeReact widgets read
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
515
|
+
In styled mode PrimeReact widgets read the preset's `--p-*` design tokens
|
|
516
|
+
directly. Cratis wrappers add some surfaces of their own (inline validation
|
|
517
|
+
error text, the FormElement addon background, the breadcrumb bottom border,
|
|
518
|
+
etc.) — those use a parallel set of `--cratis-*` tokens that resolve the v11
|
|
519
|
+
token first and fall back to the v10 variable, via the cascade defined in
|
|
520
|
+
`tokens.css`. Under the baseline theme the widgets read the `--cratis-*` tokens
|
|
521
|
+
too.
|
|
450
522
|
|
|
451
523
|
The upshot:
|
|
452
524
|
|
|
453
|
-
-
|
|
454
|
-
- Override **`--cratis-*` tokens** when you specifically want Cratis surfaces to differ from PrimeReact widgets.
|
|
525
|
+
- Repaint the whole UI by deriving the **preset** (styled mode) or overriding the **`--cratis-*` tokens** (baseline theme).
|
|
526
|
+
- Override **`--cratis-*` tokens** in styled mode when you specifically want Cratis surfaces to differ from PrimeReact widgets.
|
|
455
527
|
|
|
456
528
|
#### `--cratis-*` token reference (Cratis-scoped surfaces)
|
|
457
529
|
|
|
@@ -465,8 +537,9 @@ The upshot:
|
|
|
465
537
|
| Geometry | `--cratis-border-radius` |
|
|
466
538
|
| Effects | `--cratis-focus-ring`, `--cratis-maskbg` |
|
|
467
539
|
|
|
468
|
-
Each
|
|
469
|
-
`--cratis-` prefix (e.g. `--cratis-surface-card`
|
|
540
|
+
Each resolves the v11 design token first and falls back to the v10 variable
|
|
541
|
+
with the same name minus the `--cratis-` prefix (e.g. `--cratis-surface-card`
|
|
542
|
+
→ `var(--p-content-background, var(--surface-card))`).
|
|
470
543
|
|
|
471
544
|
**Use this setup when:** you want a custom look without writing a PrimeReact
|
|
472
545
|
theme from scratch, you're shipping multiple palette variants (light/dark/
|
|
@@ -614,20 +687,22 @@ The styling options compose, so you don't have to choose one for the whole app:
|
|
|
614
687
|
```tsx
|
|
615
688
|
<Dialog title="Custom" unstyled pt={brandDialogPt}>…</Dialog>
|
|
616
689
|
```
|
|
617
|
-
- **Unstyled with one themed island** —
|
|
618
|
-
|
|
690
|
+
- **Unstyled with one themed island** — the baseline theme's rules are scoped
|
|
691
|
+
under `.cratis-theme`, so wrapping one element in the class themes just that
|
|
692
|
+
subtree:
|
|
619
693
|
```tsx
|
|
620
694
|
<CratisComponentsProvider value={{ unstyled: true, pt: globalPt }}>
|
|
621
695
|
<App />
|
|
622
|
-
<
|
|
623
|
-
<
|
|
624
|
-
</
|
|
696
|
+
<div className="cratis-theme">
|
|
697
|
+
<BaselineThemedSubtree />
|
|
698
|
+
</div>
|
|
625
699
|
</CratisComponentsProvider>
|
|
626
700
|
```
|
|
627
|
-
- **Dark mode** —
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
701
|
+
- **Dark mode** — toggle `cratis-dark` on the root element: the baseline
|
|
702
|
+
theme's dark palette, `styledMode()`'s dark scheme (its default
|
|
703
|
+
`darkModeSelector`) and the v10 palette all key off it, so PrimeReact widgets
|
|
704
|
+
and Cratis surfaces follow together. Scope any `--cratis-*` tokens you want
|
|
705
|
+
to diverge to `.cratis-dark` as well.
|
|
631
706
|
|
|
632
707
|
### Per-component `pt` cheat sheet
|
|
633
708
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../Common/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAW,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAG1D,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAKxG,MAAM,WAAW,WAAW;IAExB,KAAK,CAAC,EAAE,SAAS,CAAC;IAKlB,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,eAAe,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEpE,EAAE,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAE3B,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,QAAQ,GAA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AC,EAAE,cAAc,CAAC;IAE1B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAE/C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAkBD,eAAO,MAAM,MAAM,GAAI,sMAsBpB,WAAW,gCA6Bb,CAAC"}
|
|
@@ -12,10 +12,13 @@ const renderIcon = (icon) => typeof icon === 'string' ? jsx("i", { className: ic
|
|
|
12
12
|
* compiler* and silently ignored at runtime — a `<Button label="Save" />`
|
|
13
13
|
* typechecks and renders an empty button. This wrapper closes that trap once, for
|
|
14
14
|
* every application, rather than leaving each call site to be caught by eye.
|
|
15
|
+
*
|
|
16
|
+
* `severity` is also stamped as `data-severity` on the element: the Cratis theme colors
|
|
17
|
+
* by that attribute (as {@link Tag} does), and PrimeReact 11's button does not emit it.
|
|
15
18
|
*/
|
|
16
19
|
const Button = ({ label, icon, loading, tooltip, tooltipOptions, pt, text, link, outlined, rounded, severity, size, disabled, type = 'button', title, autoFocus, onClick, className, style, 'aria-label': ariaLabel, children }) => {
|
|
17
20
|
const variant = link ? 'link' : text ? 'text' : outlined ? 'outlined' : undefined;
|
|
18
|
-
const button = (jsxs(Button$1, { type: type, title: title, autoFocus: autoFocus, variant: variant, rounded: rounded, severity: severity, size: size, iconOnly: !!icon && label === undefined && !children, disabled: disabled || loading, onClick: onClick, className: className, style: style, "aria-label": ariaLabel, pt: pt, children: [loading ? jsx("i", { className: 'pi pi-spinner pi-spin', "aria-hidden": 'true' }) : renderIcon(icon), label, children] }));
|
|
21
|
+
const button = (jsxs(Button$1, { type: type, title: title, autoFocus: autoFocus, variant: variant, rounded: rounded, severity: severity, size: size, iconOnly: !!icon && label === undefined && !children, disabled: disabled || loading, onClick: onClick, className: className, style: style, "aria-label": ariaLabel, "data-severity": severity, pt: pt, children: [loading ? jsx("i", { className: 'pi pi-spinner pi-spin', "aria-hidden": 'true' }) : renderIcon(icon), label, children] }));
|
|
19
22
|
return tooltip
|
|
20
23
|
? jsx(Tooltip, { content: tooltip, position: tooltipOptions?.position, className: tooltipOptions?.className, children: button })
|
|
21
24
|
: button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../Common/Button.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","PrimeButton"],"mappings":";;;;AA8DA,MAAM,UAAU,GAAG,CAAC,IAAe,KAC/B,OAAO,IAAI,KAAK,QAAQ,GAAGA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,IAAI,EAAA,aAAA,EAAc,MAAM,EAAA,CAAG,GAAG,IAAI;AAE/E
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../Common/Button.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","PrimeButton"],"mappings":";;;;AA8DA,MAAM,UAAU,GAAG,CAAC,IAAe,KAC/B,OAAO,IAAI,KAAK,QAAQ,GAAGA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,IAAI,EAAA,aAAA,EAAc,MAAM,EAAA,CAAG,GAAG,IAAI;AAE/E;;;;;;;;;;;;AAYG;AACI,MAAM,MAAM,GAAG,CAAC,EACnB,KAAK,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,cAAc,EACd,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,GAAG,QAAQ,E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OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAQ9D,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9D,MAAM,WAAW,6BAA6B;IAK1C,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAO/B,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAEjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAUD,eAAO,MAAM,cAAc,EAAE,sBAA2B,CAAC;AAMzD,eAAO,MAAM,2BAA2B,GAAI,OAAO,sBAAsB,GAAG,SAAS,KAAG,sBACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"CratisComponentsProvider.d.ts","sourceRoot":"","sources":["../../../Common/CratisComponentsProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAQ9D,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9D,MAAM,WAAW,6BAA6B;IAK1C,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAO/B,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAEjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAUD,eAAO,MAAM,cAAc,EAAE,sBAA2B,CAAC;AAMzD,eAAO,MAAM,2BAA2B,GAAI,OAAO,sBAAsB,GAAG,SAAS,KAAG,sBACxB,CAAC;AAiCjE,eAAO,MAAM,wBAAwB,GAAI,8BAA8B,6BAA6B,sBASnG,CAAC"}
|
|
@@ -32,8 +32,11 @@ const mergeCratisComponentsConfig = (value) => merge(cratisDefaults, value ?? {}
|
|
|
32
32
|
* - **Unstyled (default posture):** pass nothing, or `value={{ unstyled: true }}`, and
|
|
33
33
|
* style the structural markup yourself through the `--cratis-*` token layer, your own
|
|
34
34
|
* CSS, Tailwind, or `pt` definitions.
|
|
35
|
-
* - **Styled:**
|
|
36
|
-
*
|
|
35
|
+
* - **Styled:** spread `styledMode()` from `@cratis/components/styled` into `value` -
|
|
36
|
+
* PrimeReact's own component styles for every primitive plus a `@primeuix/themes`
|
|
37
|
+
* preset (the Cratis preset by default, `styledMode({ preset: Aura })` for another).
|
|
38
|
+
* A preset on `theme` alone only emits design tokens; the primitives render without
|
|
39
|
+
* `p-*` classes until `defaults` gives them their styles, which is what `styledMode()` does.
|
|
37
40
|
* - Pass `value={{ pt, ptOptions }}` to apply global per-component pass-through.
|
|
38
41
|
*
|
|
39
42
|
* **PrimeUI license.** PrimeReact 11 is no longer MIT — its provider verifies a PrimeUI
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAkCA;;;;;;;AAOG;AACI,MAAM,cAAc,GAA2B;AAEtD;;;AAGG;AACI,MAAM,2BAA2B,GAAG,CAAC,KAAyC,KACjF,KAAK,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;AAErC
|
|
1
|
+
{"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAkCA;;;;;;;AAOG;AACI,MAAM,cAAc,GAA2B;AAEtD;;;AAGG;AACI,MAAM,2BAA2B,GAAG,CAAC,KAAyC,KACjF,KAAK,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,MAAM,wBAAwB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAiC,KAAI;AACpG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52
|
const handleRowClick = onRowClick
|
|
53
53
|
? (event) => onRowClick({ data: event.data, index: event.index })
|
|
54
54
|
: undefined;
|
|
55
|
-
return (jsxs(DataTable.Root, { data: data, dataKey: dataKey, removableSort: true, selectionMode: selectionMode ?? null, selectionKeys: selectionKeys, onSelectionChange: onSelectionChange ? handleSelectionChange : undefined, onRowClick: handleRowClick, filters: filters, onFilter: handleFilter, globalFilter: globalFilter || null, globalFilterFields: globalFilterFields, scrollable: scrollable, scrollHeight: scrollHeight, className: className, style: style, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: [showGlobalSearch && (jsx("div", { className: "cratis-datatable-search", children: jsx(InputText, { value: globalFilter, placeholder: globalSearchPlaceholder, className: "w-full", onChange: (event) => setGlobalFilter(event.target.value) }) })), jsx(DataTable.TableContainer, { children: jsxs(DataTable.Table, { children: [jsx(DataTable.THead, { children: jsx(DataTable.THeadRow, { children: columns.map((column, index) => (jsx(DataTable.THeadCell, { style: column.props.headerStyle ?? column.props.style, className: column.props.headerClassName, children: jsxs("div", { className: "cratis-datatable-header-cell", children: [column.props.sortable && column.props.field ? (jsxs(DataTable.Sort, { field: column.props.field, pt: { root: { 'aria-sort': undefined } }, children: [column.props.header, jsx(DataTable.SortIndicator, { match: "asc", children: " \u25B2" }), jsx(DataTable.SortIndicator, { match: "desc", children: " \u25BC" })] })) : (jsx(
|
|
55
|
+
return (jsxs(DataTable.Root, { data: data, dataKey: dataKey, removableSort: true, selectionMode: selectionMode ?? null, selectionKeys: selectionKeys, onSelectionChange: onSelectionChange ? handleSelectionChange : undefined, onRowClick: handleRowClick, filters: filters, onFilter: handleFilter, globalFilter: globalFilter || null, globalFilterFields: globalFilterFields, scrollable: scrollable, scrollHeight: scrollHeight, className: className, style: style, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: [showGlobalSearch && (jsx("div", { className: "cratis-datatable-search", children: jsx(InputText, { value: globalFilter, placeholder: globalSearchPlaceholder, className: "w-full", onChange: (event) => setGlobalFilter(event.target.value) }) })), jsx(DataTable.TableContainer, { children: jsxs(DataTable.Table, { children: [jsx(DataTable.THead, { children: jsx(DataTable.THeadRow, { children: columns.map((column, index) => (jsx(DataTable.THeadCell, { style: column.props.headerStyle ?? column.props.style, className: column.props.headerClassName, children: jsxs("div", { className: "cratis-datatable-header-cell", children: [column.props.sortable && column.props.field ? (jsxs(DataTable.Sort, { field: column.props.field, pt: { root: { 'aria-sort': undefined } }, children: [jsx(DataTable.THeadTitle, { children: column.props.header }), jsx(DataTable.SortIndicator, { match: "asc", children: " \u25B2" }), jsx(DataTable.SortIndicator, { match: "desc", children: " \u25BC" })] })) : (jsx(DataTable.THeadTitle, { children: column.props.header })), column.props.filter && (column.props.filterField ?? column.props.field) && (jsx(ColumnFilterMenu, { field: (column.props.filterField ?? column.props.field), dataType: column.props.dataType, placeholder: column.props.filterPlaceholder, showMatchModes: column.props.showFilterMatchModes }))] }) }, index))) }) }), jsx(DataTable.TBody, { children: ({ item, index }) => (jsx(DataTable.Row, { index: index, className: rowClassName?.(item), children: columns.map((column, columnIndex) => (jsx(DataTable.Cell, { style: { ...column.props.style, ...column.props.bodyStyle }, className: column.props.bodyClassName ?? column.props.className, children: column.props.selectionMode ? (jsx("input", { type: "radio", readOnly: true, "aria-label": selectionAriaLabel, checked: !!selection && keyOf(item) === keyOf(selection) })) : (renderCellContent(column.props, item)) }, columnIndex))) })) }), jsx(DataTable.EmptyTBody, { className: "p-datatable-tbody", children: jsx(DataTable.Row, { children: jsx(DataTable.Cell, { colSpan: Math.max(columns.length, 1), children: emptyMessage }) }) })] }) })] }));
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
export { DataTableCore };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableCore.js","sources":["../../../DataTables/DataTableCore.tsx"],"sourcesContent":[null],"names":["_jsxs","PrimeDataTable","_jsx"],"mappings":";;;;;;;AA8EA;AACA,MAAM,UAAU,GAAG,CAAC,QAAmB,KACnC,OAAO,CACH,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,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAAA,QAAA,EAAA,CACjB,gBAAgB,KACbC,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,yBAAyB,EAAA,QAAA,EACpCA,
|
|
1
|
+
{"version":3,"file":"DataTableCore.js","sources":["../../../DataTables/DataTableCore.tsx"],"sourcesContent":[null],"names":["_jsxs","PrimeDataTable","_jsx"],"mappings":";;;;;;;AA8EA;AACA,MAAM,UAAU,GAAG,CAAC,QAAmB,KACnC,OAAO,CACH,MAAM,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAA2C,EAC7G,CAAC,QAAQ,CAAC,CACb;AAEL,MAAM,iBAAiB,GAAG,CAAC,MAAwB,EAAE,GAAW,KAAe;IAC3E,IAAI,MAAM,CAAC,IAAI;AAAE,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACxC,IAAA,IAAI,MAAM,CAAC,KAAK,EAAE;QACd,MAAM,KAAK,GAAI,GAA+B,CAAC,MAAM,CAAC,KAAK,CAAC;AAC5D,QAAA,OAAO,KAAK,IAAI,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7C;AACA,IAAA,OAAO,IAAI;AACf,CAAC;AAED;;;;;;;;;;;;;AAaG;AACI,MAAM,aAAa,GAAG,CAAuB,EAChD,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,aAAa,EACb,kBAAkB,GAAG,YAAY,EACjC,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,GAAG,SAAS,EACnC,cAAc,EACd,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,EAAE,EACF,SAAS,EACT,QAAQ,GACgB,KAAI;AAC5B,IAAA,MAAM,OAAO,GAAG,U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CACK,CAAA,EAAA,CACd;AAE9B;;;;"}
|
|
@@ -5,6 +5,7 @@ export interface MessageProps {
|
|
|
5
5
|
text?: React.ReactNode;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
+
icon?: React.ReactNode | false;
|
|
8
9
|
}
|
|
9
|
-
export declare const Message: ({ severity, text, children, className }: MessageProps) => React.JSX.Element;
|
|
10
|
+
export declare const Message: ({ severity, text, children, className, icon }: MessageProps) => React.JSX.Element;
|
|
10
11
|
//# sourceMappingURL=Message.d.ts.map
|