@cratis/components 3.3.4 → 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.
Files changed (35) hide show
  1. package/README.md +204 -129
  2. package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
  3. package/dist/esm/Common/CratisComponentsProvider.js +5 -2
  4. package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
  5. package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
  6. package/dist/esm/DataTables/DataTableCore.js +1 -1
  7. package/dist/esm/DataTables/DataTableCore.js.map +1 -1
  8. package/dist/esm/Display/Message.d.ts +2 -1
  9. package/dist/esm/Display/Message.d.ts.map +1 -1
  10. package/dist/esm/Display/Message.js +14 -2
  11. package/dist/esm/Display/Message.js.map +1 -1
  12. package/dist/esm/Dropdown/Dropdown.d.ts.map +1 -1
  13. package/dist/esm/Dropdown/Dropdown.js +12 -2
  14. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  15. package/dist/esm/Styled/CratisPreset.d.ts +2 -0
  16. package/dist/esm/Styled/CratisPreset.d.ts.map +1 -0
  17. package/dist/esm/Styled/CratisPreset.js +80 -0
  18. package/dist/esm/Styled/CratisPreset.js.map +1 -0
  19. package/dist/esm/Styled/index.d.ts +4 -0
  20. package/dist/esm/Styled/index.d.ts.map +1 -0
  21. package/dist/esm/Styled/index.js +4 -0
  22. package/dist/esm/Styled/index.js.map +1 -0
  23. package/dist/esm/Styled/primeReactStyles.d.ts +3 -0
  24. package/dist/esm/Styled/primeReactStyles.d.ts.map +1 -0
  25. package/dist/esm/Styled/primeReactStyles.js +202 -0
  26. package/dist/esm/Styled/primeReactStyles.js.map +1 -0
  27. package/dist/esm/Styled/styledMode.d.ts +12 -0
  28. package/dist/esm/Styled/styledMode.d.ts.map +1 -0
  29. package/dist/esm/Styled/styledMode.js +68 -0
  30. package/dist/esm/Styled/styledMode.js.map +1 -0
  31. package/dist/esm/primereact-v10-palette.css +242 -0
  32. package/dist/esm/styles.css +2 -2
  33. package/dist/esm/theme.css +30 -4
  34. package/dist/esm/tokens.css +18 -11
  35. package/package.json +16 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAOlG,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,OAAO;IAE5C,KAAK,EAAE,CAAC,CAAC;IAGT,aAAa,CAAC,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;CAC3D;AAOD,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IAEtC,KAAK,CAAC,EAAE,CAAC,CAAC;IAGV,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IAGpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAGnB,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAGnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAG5B,EAAE,CAAC,EAAE,MAAM,CAAC;IAGZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAA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EAAE,MAAM,CAAC;IAGd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAGnD,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAG9C,EAAE,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAG3B,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IAGzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AA2BD,eAAO,MAAM,QAAQ;KAAI,CAAC,qQAuBvB,aAAa,CAAC,CAAC,CAAC;;CA0ClB,CAAC"}
@@ -15,8 +15,18 @@ import { Select } from 'primereact/select';
15
15
  * modal dialogs via PrimeReact 11's overlay manager — the v10 `appendTo` /
16
16
  * manual z-index workaround is no longer required.
17
17
  */
18
- const Dropdown = ({ value, options, optionLabel, optionValue, placeholder, filter, multiple, showClear, invalid, disabled, className, style, id, name, tabIndex, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, onChange, onBlur, pt, ptOptions, unstyled, }) => {
19
- return (jsx("span", { onBlur: onBlur, children: jsxs(Select.Root, { value: value, options: options, optionLabel: optionLabel, optionValue: optionValue, multiple: multiple, invalid: invalid, disabled: disabled, className: className, style: style, id: id, name: name, tabIndex: tabIndex, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, onValueChange: (event) => onChange?.({ value: event.value, originalEvent: event.originalEvent }), pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: [jsxs(Select.Trigger, { children: [jsx(Select.Value, { placeholder: placeholder }), showClear && jsx(Select.Clear, {}), jsx(Select.Arrow, {})] }), jsx(Select.Portal, { children: jsx(Select.Positioner, { children: jsxs(Select.Popup, { children: [filter && jsx(Select.Filter, { placeholder: placeholder }), jsx(Select.List, {})] }) }) })] }) }));
18
+ /**
19
+ * PrimeReact 10's `Dropdown` read `label` and `value` off option objects when no
20
+ * `optionLabel` / `optionValue` was given; v11's `Select` compares the option object
21
+ * itself against the value instead, so `[{ label, value }]` options with a scalar
22
+ * `value` never match. Resolve the v10 convention here so those call sites keep working.
23
+ */
24
+ const conventionalField = (options, field) => {
25
+ const first = options?.[0];
26
+ return first !== null && typeof first === 'object' && field in first ? field : undefined;
27
+ };
28
+ const Dropdown = ({ value, options, optionLabel = conventionalField(options, 'label'), optionValue = conventionalField(options, 'value'), placeholder, filter, multiple, showClear, invalid, disabled, className, style, id, name, tabIndex, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, onChange, onBlur, pt, ptOptions, unstyled, }) => {
29
+ return (jsx("span", { onBlur: onBlur, children: jsxs(Select.Root, { value: value, options: options, optionLabel: optionLabel, optionValue: optionValue, multiple: multiple, invalid: invalid, disabled: disabled, className: className, style: style, id: id, name: name, tabIndex: tabIndex, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, onValueChange: (event) => onChange?.({ value: event.value, originalEvent: event.originalEvent }), pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: [jsxs(Select.Trigger, { children: [jsx(Select.Value, { placeholder: placeholder }), showClear && jsx(Select.Clear, { children: jsx("i", { className: "pi pi-times" }) }), jsx(Select.Indicator, { children: jsx("i", { className: "pi pi-chevron-down" }) })] }), jsx(Select.Portal, { children: jsx(Select.Positioner, { children: jsxs(Select.Popup, { children: [filter && jsx(Select.Filter, { placeholder: placeholder }), jsx(Select.List, {})] }) }) })] }) }));
20
30
  };
21
31
  Dropdown.displayName = 'Dropdown';
22
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","sources":["../../../Dropdown/Dropdown.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;AA6FA;;;;;;;;;;;;;AAaG;AACI,MAAM,QAAQ,GAAG,CAAe,EACnC,KAA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ACC,GACR,CAAA,EAAA,CACN,EAAA,CACX;AAEf;AAEA,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
@@ -0,0 +1,2 @@
1
+ export declare const CratisPreset: import("@primeuix/themes").Preset<import("@primeuix/themes/types/base").BaseDesignTokens>;
2
+ //# sourceMappingURL=CratisPreset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CratisPreset.d.ts","sourceRoot":"","sources":["../../../Styled/CratisPreset.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,YAAY,2FA4CvB,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { definePreset } from '@primeuix/themes';
2
+ import Lara from '@primeuix/themes/lara';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /**
7
+ * A `@primeuix/themes` preset with the look Cratis applications had on PrimeReact 10.
8
+ *
9
+ * Every Cratis application shipped `lara-dark-blue` (and `lara-light-blue` where a light
10
+ * scheme was offered). Lara is still PrimeReact's design system in version 11, so this
11
+ * starts from it and moves the palette back to what those themes used: a blue primary
12
+ * over gray surfaces.
13
+ *
14
+ * The dark surface scale is shifted one step lighter than the light one. Lara's dark
15
+ * scheme places content on `surface.900`, form fields and the page on `surface.950`, and
16
+ * borders and hovers on `surface.800`; the v10 dark theme had cards, tables, dialogs and
17
+ * dropdown panels on `#1f2937` (gray 800) over a `#111827` (gray 900) page, with inputs on
18
+ * the page tone. Mapping dark `surface.900` to gray 800 and `surface.950` to gray 900
19
+ * reproduces exactly that through Lara's own component tokens, without overriding any
20
+ * of them — so borders, hovers and selection stay one visible step apart from the
21
+ * surfaces they sit on.
22
+ *
23
+ * Both color schemes are carried; which one applies follows the provider's
24
+ * `darkModeSelector`. Extend it the way you would any preset:
25
+ *
26
+ * ```ts
27
+ * import { definePreset } from '@primeuix/themes';
28
+ * import { CratisPreset } from '@cratis/components/styled';
29
+ *
30
+ * const MyPreset = definePreset(CratisPreset, { semantic: { primary: { ... } } });
31
+ * ```
32
+ */
33
+ const CratisPreset = definePreset(Lara, {
34
+ semantic: {
35
+ primary: {
36
+ 50: '{blue.50}',
37
+ 100: '{blue.100}',
38
+ 200: '{blue.200}',
39
+ 300: '{blue.300}',
40
+ 400: '{blue.400}',
41
+ 500: '{blue.500}',
42
+ 600: '{blue.600}',
43
+ 700: '{blue.700}',
44
+ 800: '{blue.800}',
45
+ 900: '{blue.900}',
46
+ 950: '{blue.950}',
47
+ },
48
+ surface: {
49
+ 0: '#ffffff',
50
+ 50: '{gray.50}',
51
+ 100: 'light-dark({gray.100}, {gray.50})',
52
+ 200: 'light-dark({gray.200}, {gray.100})',
53
+ 300: 'light-dark({gray.300}, {gray.200})',
54
+ 400: 'light-dark({gray.400}, {gray.300})',
55
+ 500: 'light-dark({gray.500}, {gray.400})',
56
+ 600: 'light-dark({gray.600}, {gray.500})',
57
+ 700: 'light-dark({gray.700}, {gray.600})',
58
+ 800: 'light-dark({gray.800}, {gray.700})',
59
+ 900: 'light-dark({gray.900}, {gray.800})',
60
+ 950: 'light-dark({gray.950}, {gray.900})',
61
+ },
62
+ },
63
+ components: {
64
+ // Lara raises a table's head and foot one step above its rows; the v10 dark theme
65
+ // kept them on the row tone and told them apart by weight and a border, as the
66
+ // Workbench and Studio tables were designed around.
67
+ datatable: {
68
+ header: { background: 'light-dark({surface.50}, {content.background})' },
69
+ headerCell: {
70
+ background: 'light-dark({surface.50}, {content.background})',
71
+ selectedBackground: 'light-dark({surface.50}, {content.background})',
72
+ },
73
+ footer: { background: 'light-dark({surface.50}, {content.background})' },
74
+ footerCell: { background: 'light-dark({surface.50}, {content.background})' },
75
+ },
76
+ },
77
+ });
78
+
79
+ export { CratisPreset };
80
+ //# sourceMappingURL=CratisPreset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CratisPreset.js","sources":["../../../Styled/CratisPreset.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;AACA;AAKA;;;;;;;;;;;;;;;;;;;;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ACJ,CAAA;;;;"}
@@ -0,0 +1,4 @@
1
+ export * from './CratisPreset';
2
+ export * from './primeReactStyles';
3
+ export * from './styledMode';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Styled/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { CratisPreset } from './CratisPreset.js';
2
+ export { primeReactStyles } from './primeReactStyles.js';
3
+ export { cratisDarkModeSelector, primeReactCssLayer, primeReactCssLayerOrder, styledMode } from './styledMode.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,3 @@
1
+ import type { ComponentDefaults } from '@primereact/types/core';
2
+ export declare const primeReactStyles: ComponentDefaults;
3
+ //# sourceMappingURL=primeReactStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primeReactStyles.d.ts","sourceRoot":"","sources":["../../../Styled/primeReactStyles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAgHhE,eAAO,MAAM,gBAAgB,EAAE,iBAwF9B,CAAC"}
@@ -0,0 +1,202 @@
1
+ import { styles as styles$19 } from '@primereact/styles/accordion';
2
+ import { styles as styles$18 } from '@primereact/styles/autocomplete';
3
+ import { styles as styles$17 } from '@primereact/styles/avatar';
4
+ import { styles as styles$16 } from '@primereact/styles/avatargroup';
5
+ import { styles as styles$15 } from '@primereact/styles/badge';
6
+ import { styles as styles$14 } from '@primereact/styles/breadcrumb';
7
+ import { styles as styles$13 } from '@primereact/styles/button';
8
+ import { styles as styles$12 } from '@primereact/styles/buttongroup';
9
+ import { styles as styles$11 } from '@primereact/styles/card';
10
+ import { styles as styles$10 } from '@primereact/styles/carousel';
11
+ import { styles as styles$$ } from '@primereact/styles/checkbox';
12
+ import { styles as styles$_ } from '@primereact/styles/checkboxgroup';
13
+ import { styles as styles$Z } from '@primereact/styles/chip';
14
+ import { styles as styles$Y } from '@primereact/styles/compare';
15
+ import { styles as styles$X } from '@primereact/styles/contextmenu';
16
+ import { styles as styles$W } from '@primereact/styles/datatable';
17
+ import { styles as styles$V } from '@primereact/styles/dataview';
18
+ import { styles as styles$U } from '@primereact/styles/datepicker';
19
+ import { styles as styles$T } from '@primereact/styles/dialog';
20
+ import { styles as styles$S } from '@primereact/styles/divider';
21
+ import { styles as styles$R } from '@primereact/styles/drawer';
22
+ import { styles as styles$Q } from '@primereact/styles/fieldset';
23
+ import { styles as styles$P } from '@primereact/styles/fileupload';
24
+ import { styles as styles$O } from '@primereact/styles/floatlabel';
25
+ import { styles as styles$N } from '@primereact/styles/fluid';
26
+ import { styles as styles$M } from '@primereact/styles/gallery';
27
+ import { styles as styles$L } from '@primereact/styles/iconfield';
28
+ import { styles as styles$K } from '@primereact/styles/iftalabel';
29
+ import { styles as styles$J } from '@primereact/styles/inplace';
30
+ import { styles as styles$I } from '@primereact/styles/inputcolor';
31
+ import { styles as styles$H } from '@primereact/styles/inputgroup';
32
+ import { styles as styles$G } from '@primereact/styles/inputnumber';
33
+ import { styles as styles$F } from '@primereact/styles/inputotp';
34
+ import { styles as styles$D } from '@primereact/styles/inputtags';
35
+ import { styles as styles$C } from '@primereact/styles/inputtext';
36
+ import { styles as styles$B } from '@primereact/styles/knob';
37
+ import { styles as styles$A } from '@primereact/styles/label';
38
+ import { styles as styles$z } from '@primereact/styles/listbox';
39
+ import { styles as styles$y } from '@primereact/styles/menu';
40
+ import { styles as styles$x } from '@primereact/styles/message';
41
+ import { styles as styles$w } from '@primereact/styles/metergroup';
42
+ import { styles as styles$v } from '@primereact/styles/navigationmenu';
43
+ import { styles as styles$u } from '@primereact/styles/organizationchart';
44
+ import { styles as styles$t } from '@primereact/styles/overlaybadge';
45
+ import { styles as styles$s } from '@primereact/styles/paginator';
46
+ import { styles as styles$r } from '@primereact/styles/panel';
47
+ import { styles as styles$E } from '@primereact/styles/password';
48
+ import { styles as styles$q } from '@primereact/styles/popover';
49
+ import { styles as styles$p } from '@primereact/styles/progressbar';
50
+ import { styles as styles$o } from '@primereact/styles/progressspinner';
51
+ import { styles as styles$n } from '@primereact/styles/radiobutton';
52
+ import { styles as styles$m } from '@primereact/styles/radiobuttongroup';
53
+ import { styles as styles$l } from '@primereact/styles/rating';
54
+ import { styles as styles$k } from '@primereact/styles/scrollarea';
55
+ import { styles as styles$j } from '@primereact/styles/select';
56
+ import { layoutStyles, styles as styles$i } from '@primereact/styles/sidebar';
57
+ import { styles as styles$h } from '@primereact/styles/skeleton';
58
+ import { styles as styles$g } from '@primereact/styles/slider';
59
+ import { styles as styles$f } from '@primereact/styles/speeddial';
60
+ import { styles as styles$e } from '@primereact/styles/splitter';
61
+ import { styles as styles$d } from '@primereact/styles/stepper';
62
+ import { styles as styles$c } from '@primereact/styles/tabs';
63
+ import { styles as styles$b } from '@primereact/styles/tag';
64
+ import { styles as styles$a } from '@primereact/styles/terminal';
65
+ import { styles as styles$9 } from '@primereact/styles/textarea';
66
+ import { styles as styles$8 } from '@primereact/styles/timeline';
67
+ import { styles as styles$7 } from '@primereact/styles/toast';
68
+ import { styles as styles$6 } from '@primereact/styles/toaster';
69
+ import { styles as styles$5 } from '@primereact/styles/togglebutton';
70
+ import { styles as styles$4 } from '@primereact/styles/togglebuttongroup';
71
+ import { styles as styles$3 } from '@primereact/styles/toggleswitch';
72
+ import { styles as styles$2 } from '@primereact/styles/toolbar';
73
+ import { styles as styles$1 } from '@primereact/styles/tooltip';
74
+ import { styles } from '@primereact/styles/tree';
75
+
76
+ // Copyright (c) Cratis. All rights reserved.
77
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
78
+ /**
79
+ * The names PrimeReact's motion hook uses for the enter/leave classes of an overlay or
80
+ * collapsible part. `@primereact/ui` hands these to the same primitives when it composes
81
+ * its styled components; the theme's transitions key off them.
82
+ */
83
+ const anchoredOverlay = 'p-anchored-overlay';
84
+ const collapsible = 'p-collapsible';
85
+ const overlayMask = 'p-overlay-mask';
86
+ /** A root that carries a component's `styles`, optionally with the motion its parts animate through. */
87
+ const styled = (styles, motion) => ({ props: motion ? { styles, motionProps: { name: motion } } : { styles } });
88
+ /** A part that only needs its motion name — its classes come from the root's `styles`. */
89
+ const motion = (name) => ({ props: { motionProps: { name } } });
90
+ /**
91
+ * PrimeReact 11's own component styles, keyed by primitive component name, ready to be
92
+ * handed to the provider as `defaults`.
93
+ *
94
+ * PrimeReact 11 splits every component in two: the `primereact/*` primitives, which own
95
+ * behavior and render structural markup with `data-scope` / `data-part` attributes and no
96
+ * class names, and `@primereact/styles/*`, which holds the `p-*` class names and the CSS
97
+ * that a `@primeuix/themes` preset drives. `@primereact/ui/*` is nothing more than the two
98
+ * glued together: each styled component is the primitive with its `styles` prop preset.
99
+ *
100
+ * `@cratis/components` builds on the primitives, so a preset alone leaves it unstyled.
101
+ * PrimeReact's provider accepts default props per component name (`defaults`), and
102
+ * `styles` is a public prop on every primitive, so this map performs the same gluing
103
+ * `@primereact/ui` does — for every primitive rendered under the provider, whether by
104
+ * this library or by the application. Together with a preset it is styled mode. Prefer
105
+ * {@link styledMode}, which combines the two.
106
+ *
107
+ * Every entry keys the primitive's *root* name (`Dialog.Root`, `Button`), because the
108
+ * parts read their class names from the root's styles. The overlay/collapsible parts
109
+ * that animate are also listed, with the motion name the theme's transitions expect.
110
+ */
111
+ const primeReactStyles = {
112
+ 'Accordion.Root': styled(styles$19, collapsible),
113
+ 'AutoComplete.Root': styled(styles$18),
114
+ 'AutoComplete.Popup': motion(anchoredOverlay),
115
+ 'Avatar.Root': styled(styles$17),
116
+ 'AvatarGroup': styled(styles$16),
117
+ 'Badge': styled(styles$15),
118
+ 'Breadcrumb.Root': styled(styles$14),
119
+ 'Button': styled(styles$13),
120
+ 'ButtonGroup': styled(styles$12),
121
+ 'Card.Root': styled(styles$11),
122
+ 'Carousel.Root': styled(styles$10),
123
+ 'Checkbox.Root': styled(styles$$),
124
+ 'CheckboxGroup': styled(styles$_),
125
+ 'Chip.Root': styled(styles$Z),
126
+ 'Compare.Root': styled(styles$Y),
127
+ 'ContextMenu.Root': styled(styles$X),
128
+ 'ContextMenu.Popup': motion(anchoredOverlay),
129
+ 'DataTable.Root': styled(styles$W),
130
+ 'DataView.Root': styled(styles$V),
131
+ 'DatePicker.Root': styled(styles$U),
132
+ 'DatePicker.Popup': motion(anchoredOverlay),
133
+ 'Dialog.Root': styled(styles$T),
134
+ 'Dialog.Backdrop': motion(overlayMask),
135
+ 'Dialog.Popup': motion('p-dialog'),
136
+ 'Divider': styled(styles$S),
137
+ 'Drawer.Root': styled(styles$R),
138
+ 'Drawer.Backdrop': motion(overlayMask),
139
+ 'Drawer.Popup': motion('p-drawer'),
140
+ 'Fieldset.Root': styled(styles$Q, collapsible),
141
+ 'FileUpload.Root': styled(styles$P),
142
+ 'FloatLabel': styled(styles$O),
143
+ 'Fluid': styled(styles$N),
144
+ 'Gallery.Root': styled(styles$M),
145
+ 'IconField.Root': styled(styles$L),
146
+ 'IftaLabel': styled(styles$K),
147
+ 'Inplace.Root': styled(styles$J),
148
+ 'InputColor.Root': styled(styles$I),
149
+ 'InputGroup.Root': styled(styles$H),
150
+ 'InputNumber.Root': styled(styles$G),
151
+ 'InputOtp.Root': styled(styles$F),
152
+ 'InputPassword': styled(styles$E),
153
+ 'InputTags.Root': styled(styles$D),
154
+ 'InputText': styled(styles$C),
155
+ 'Knob.Root': styled(styles$B),
156
+ 'Label': styled(styles$A),
157
+ 'Listbox.Root': styled(styles$z),
158
+ 'Menu.Root': styled(styles$y),
159
+ 'Menu.Popup': motion(anchoredOverlay),
160
+ 'Message.Root': styled(styles$x),
161
+ 'MeterGroup.Root': styled(styles$w),
162
+ 'NavigationMenu': styled(styles$v),
163
+ 'OrganizationChart.Root': styled(styles$u),
164
+ 'OverlayBadge': styled(styles$t),
165
+ 'Paginator.Root': styled(styles$s),
166
+ 'Panel.Root': styled(styles$r, collapsible),
167
+ 'Popover.Root': styled(styles$q),
168
+ 'Popover.Popup': motion(anchoredOverlay),
169
+ 'ProgressBar.Root': styled(styles$p),
170
+ 'ProgressSpinner.Root': styled(styles$o),
171
+ 'RadioButton.Root': styled(styles$n),
172
+ 'RadioButtonGroup': styled(styles$m),
173
+ 'Rating.Root': styled(styles$l),
174
+ 'ScrollArea.Root': styled(styles$k),
175
+ 'Select.Root': styled(styles$j),
176
+ 'Select.Popup': motion(anchoredOverlay),
177
+ 'Sidebar.Root': styled(styles$i),
178
+ 'Sidebar.Layout': styled(layoutStyles),
179
+ 'Sidebar.Backdrop': motion(overlayMask),
180
+ 'Skeleton': styled(styles$h),
181
+ 'Slider.Root': styled(styles$g),
182
+ 'SpeedDial.Root': styled(styles$f),
183
+ 'Splitter.Root': styled(styles$e),
184
+ 'Stepper.Root': styled(styles$d, collapsible),
185
+ 'Tabs.Root': styled(styles$c),
186
+ 'Tag': styled(styles$b),
187
+ 'Terminal.Root': styled(styles$a),
188
+ 'Textarea': styled(styles$9),
189
+ 'Timeline.Root': styled(styles$8),
190
+ 'Toast.Root': styled(styles$7),
191
+ 'Toaster.Root': styled(styles$6),
192
+ 'ToggleButton.Root': styled(styles$5),
193
+ 'ToggleButtonGroup': styled(styles$4),
194
+ 'ToggleSwitch.Root': styled(styles$3),
195
+ 'Toolbar.Root': styled(styles$2),
196
+ 'Tooltip.Root': styled(styles$1),
197
+ 'Tooltip.Popup': motion('p-tooltip'),
198
+ 'Tree.Root': styled(styles),
199
+ };
200
+
201
+ export { primeReactStyles };
202
+ //# sourceMappingURL=primeReactStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primeReactStyles.js","sources":["../../../Styled/primeReactStyles.ts"],"sourcesContent":[null],"names":["accordion","autocomplete","avatar","avatarGroup","badge","breadcrumb","button","buttonGroup","card","carousel","checkbox","checkboxGroup","chip","compare","contextMenu","dataTable","dataView","datePicker","dialog","divider","drawer","fieldset","fileUpload","floatLabel","fluid","gallery","iconField","iftaLabel","inplace","inputColor","inputGroup","inputNumber","inputOtp","password","inputTags","inputText","knob","label","listbox","menu","message","meterGroup","navigationMenu","organizationChart","overlayBadge","paginator","panel","popover","progressBar","progressSpinner","radioButton","radioButtonGroup","rating","scrollArea","select","sidebar","sidebarLayout","skeleton","slider","speedDial","splitter","stepper","tabs","tag","terminal","textarea","timeline","toast","toaster","toggleButton","toggleButtonGroup","toggleSwitch","toolbar","tooltip","tree"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AA8EA;;;;AAIG;AACH,MAAM,eAAe,GAAG,oBAAoB;AAC5C,MAAM,WAAW,GAAG,eAAe;AACnC,MAAM,WAAW,GAAG,gBAAgB;AAEpC;AACA,MAAM,MAAM,GAAG,CAAC,MAAe,EAAE,MAAe,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;AAEjI;AACA,MAAM,MAAM,GAAG,CAAC,IAAY,MAAM,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;AAoBG;AACI,MAAM,gBAAgB,GAAsB;AAC/C,IAAA,gBAAgB,EAAE,MAAM,CAACA,SAAS,EAAE,WAAW,CAAC;AAChD,IAAA,mBAAmB,EAAE,MAAM,CAACC,SAAY,CAAC;AACzC,IAAA,oBAAoB,EAAE,MAAM,CAAC,eAAe,CAAC;AAC7C,IAAA,aAAa,EAAE,MAAM,CAACC,SAAM,CAAC;AAC7B,IAAA,aAAa,EAAE,MAAM,CAACC,SAAW,CAAC;AAClC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AC;AAC3B,IAAA,cAAc,EAAE,MAAM,CAACC,QAAO,CAAC;AAC/B,IAAA,mBAAmB,EAAE,MAAM,CAACC,QAAY,CAAC;AACzC,IAAA,mBAAmB,EAAE,MAAM,CAACC,QAAiB,CAAC;AAC9C,IAAA,mBAAmB,EAAE,MAAM,CAACC,QAAY,CAAC;AACzC,IAAA,cAAc,EAAE,MAAM,CAACC,QAAO,CAAC;AAC/B,IAAA,cAAc,EAAE,MAAM,CAACC,QAAO,CAAC;AAC/B,IAAA,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC;AACpC,IAAA,WAAW,EAAE,MAAM,CAACC,MAAI,CAAC;;;;;"}
@@ -0,0 +1,12 @@
1
+ import type { CSSLayer, ThemeOptions } from '@primereact/types/core';
2
+ import type { CratisComponentsConfig } from '../Common/CratisComponentsProvider';
3
+ export declare const primeReactCssLayer = "primereact";
4
+ export declare const primeReactCssLayerOrder = "theme, base, primereact, components, utilities";
5
+ export declare const cratisDarkModeSelector = ".cratis-dark";
6
+ export interface StyledModeOptions {
7
+ preset?: unknown;
8
+ darkModeSelector?: ThemeOptions['darkModeSelector'];
9
+ cssLayer?: false | string | CSSLayer;
10
+ }
11
+ export declare const styledMode: (options?: StyledModeOptions) => Pick<CratisComponentsConfig, "theme" | "defaults">;
12
+ //# sourceMappingURL=styledMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styledMode.d.ts","sourceRoot":"","sources":["../../../Styled/styledMode.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAWjF,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAU/C,eAAO,MAAM,uBAAuB,mDAAmD,CAAC;AAOxF,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAM9B,MAAM,CAAC,EAAE,OAAO,CAAC;IAOjB,gBAAgB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAUpD,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;CACxC;AAsBD,eAAO,MAAM,UAAU,GAAI,UAAS,iBAAsB,KAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,UAAU,CAiB7G,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { CratisPreset } from './CratisPreset.js';
2
+ import { primeReactStyles } from './primeReactStyles.js';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /**
7
+ * The cascade layer PrimeReact's theme is emitted into by default. Rules in a layer lose
8
+ * to unlayered rules regardless of specificity or order, which is what lets an
9
+ * application's own stylesheet override the theme with a plain selector — exactly the
10
+ * relationship PrimeReact 10's stylesheet themes had, since they were wrapped in
11
+ * `@layer primereact` too.
12
+ */
13
+ const primeReactCssLayer = 'primereact';
14
+ /**
15
+ * The layer order declared with the theme by default. PrimeReact writes its `@layer`
16
+ * statement ahead of every other stylesheet, so this is what fixes the order — and it
17
+ * has to name Tailwind's layers, which `@cratis/components/styles` declares in every
18
+ * consumer: the theme sits above `base`, so Tailwind's preflight reset does not strip the
19
+ * padding and borders the theme gives a table cell or an input, and below `components`
20
+ * and `utilities`, so a utility class on a PrimeReact element still wins.
21
+ */
22
+ const primeReactCssLayerOrder = 'theme, base, primereact, components, utilities';
23
+ /**
24
+ * The selector that switches the theme to its dark scheme by default. It is the class
25
+ * the Cratis baseline theme keys its dark palette off as well, so one `class="cratis-dark"`
26
+ * on the body serves both.
27
+ */
28
+ const cratisDarkModeSelector = '.cratis-dark';
29
+ /**
30
+ * Configures {@link CratisComponentsProvider} for PrimeReact 11's styled mode: a
31
+ * `@primeuix/themes` preset for the design tokens, and PrimeReact's own component styles
32
+ * ({@link primeReactStyles}) so every primitive — those rendered by this library and those
33
+ * the application renders itself — carries the `p-*` class names that preset paints.
34
+ *
35
+ * Spread the result into the provider's `value`, next to the license key and anything
36
+ * else the application configures:
37
+ *
38
+ * ```tsx
39
+ * import { CratisComponentsProvider } from '@cratis/components';
40
+ * import { styledMode } from '@cratis/components/styled';
41
+ *
42
+ * <CratisComponentsProvider value={{ license, ...styledMode() }}>
43
+ * ```
44
+ *
45
+ * The theme goes into the `primereact` cascade layer, so a plain `.p-button { … }` in the
46
+ * application's own stylesheet overrides it just as it did on PrimeReact 10 — see
47
+ * {@link primeReactCssLayerOrder} for where that layer sits relative to Tailwind's.
48
+ */
49
+ const styledMode = (options = {}) => {
50
+ const cssLayer = options.cssLayer === undefined
51
+ ? { name: primeReactCssLayer, order: primeReactCssLayerOrder }
52
+ : typeof options.cssLayer === 'string'
53
+ ? { name: options.cssLayer, order: primeReactCssLayerOrder.replace(primeReactCssLayer, options.cssLayer) }
54
+ : options.cssLayer;
55
+ return {
56
+ theme: {
57
+ preset: options.preset ?? CratisPreset,
58
+ options: {
59
+ darkModeSelector: options.darkModeSelector ?? cratisDarkModeSelector,
60
+ cssLayer,
61
+ },
62
+ },
63
+ defaults: primeReactStyles,
64
+ };
65
+ };
66
+
67
+ export { cratisDarkModeSelector, primeReactCssLayer, primeReactCssLayerOrder, styledMode };
68
+ //# sourceMappingURL=styledMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styledMode.js","sources":["../../../Styled/styledMode.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;AACA;AAOA;;;;;;AAMG;AACI,MAAM,kBAAkB,GAAG;AAElC;;;;;;;AAOG;AACI,MAAM,uBAAuB,GAAG;AAEvC;;;;AAIG;AACI,MAAM,sBAAsB,GAAG;AA4BtC;;;;;;;;;;;;;;;;;;;AAmBG;MACU,UAAU,GAAG,CAAC,OAAA,GAA6B,EAAE,KAAwD;AAC9G,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK;UAChC,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,uBAAuB;AAC5D,UAAE,OAAO,OAAO,CAAC,QAAQ,KAAK;cACxB,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,QAAQ,CAAC;AACxG,cAAE,OAAO,CAAC,QAAQ;IAE1B,OAAO;AACH,QAAA,KAAK,EAAE;AACH,YAAA,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,YAAY;AACtC,YAAA,OAAO,EAAE;AACL,gBAAA,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,sBAAsB;gBACpE,QAAQ;AACX,aAAA;AACJ,SAAA;AACD,QAAA,QAAQ,EAAE,gBAAgB;KAC7B;AACL;;;;"}