@primereact/mcp 11.0.0 → 11.2.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/data/llms/headless/components/accordion/api.json +9 -9
- package/data/llms/headless/components/animateonscroll/api.json +2 -2
- package/data/llms/headless/components/autocomplete/api.json +33 -33
- package/data/llms/headless/components/avatar/api.json +1 -1
- package/data/llms/headless/components/carousel/api.json +15 -15
- package/data/llms/headless/components/checkbox/api.json +18 -18
- package/data/llms/headless/components/collapsible/api.json +14 -14
- package/data/llms/headless/components/compare/api.json +3 -3
- package/data/llms/headless/components/contextmenu/api.json +2 -2
- package/data/llms/headless/components/datatable/api.json +19 -19
- package/data/llms/headless/components/dataview/api.json +3 -3
- package/data/llms/headless/components/datepicker/api.json +43 -43
- package/data/llms/headless/components/dialog/api.json +19 -19
- package/data/llms/headless/components/divider/api.json +3 -3
- package/data/llms/headless/components/drawer/api.json +13 -13
- package/data/llms/headless/components/fieldset/api.json +9 -9
- package/data/llms/headless/components/fileupload/api.json +5 -5
- package/data/llms/headless/components/focustrap/api.json +4 -4
- package/data/llms/headless/components/gallery/api.json +23 -23
- package/data/llms/headless/components/inplace/api.json +3 -3
- package/data/llms/headless/components/inputcolor/api.json +6 -6
- package/data/llms/headless/components/inputcolor.md +0 -1
- package/data/llms/headless/components/inputnumber/api.json +8 -8
- package/data/llms/headless/components/inputotp/api.json +7 -7
- package/data/llms/headless/components/inputpassword/api.json +4 -4
- package/data/llms/headless/components/inputpassword.md +3 -3
- package/data/llms/headless/components/inputtags/api.json +8 -8
- package/data/llms/headless/components/inputtext/api.json +1 -1
- package/data/llms/headless/components/knob/api.json +18 -18
- package/data/llms/headless/components/listbox/api.json +27 -27
- package/data/llms/headless/components/menu/api.json +10 -10
- package/data/llms/headless/components/message/api.json +1 -1
- package/data/llms/headless/components/metergroup/api.json +3 -3
- package/data/llms/headless/components/motion/api.json +1 -1
- package/data/llms/headless/components/navigationmenu/api.json +5 -5
- package/data/llms/headless/components/orderlist/api.json +5 -5
- package/data/llms/headless/components/organizationchart/api.json +6 -6
- package/data/llms/headless/components/paginator/api.json +5 -5
- package/data/llms/headless/components/panel/api.json +9 -9
- package/data/llms/headless/components/picklist/api.json +5 -5
- package/data/llms/headless/components/popover/api.json +16 -16
- package/data/llms/headless/components/positioner/api.json +7 -7
- package/data/llms/headless/components/progressbar/api.json +3 -3
- package/data/llms/headless/components/progressspinner/api.json +3 -3
- package/data/llms/headless/components/radiobutton/api.json +16 -16
- package/data/llms/headless/components/rating/api.json +5 -5
- package/data/llms/headless/components/scrollarea/api.json +6 -6
- package/data/llms/headless/components/select/api.json +34 -34
- package/data/llms/headless/components/sidebar/api.json +1116 -141
- package/data/llms/headless/components/sidebar.md +4 -2
- package/data/llms/headless/components/slider/api.json +3 -3
- package/data/llms/headless/components/speeddial/api.json +4 -4
- package/data/llms/headless/components/splitter/api.json +5 -5
- package/data/llms/headless/components/stepper/api.json +13 -13
- package/data/llms/headless/components/styleclass/api.json +1 -1
- package/data/llms/headless/components/tabs/api.json +17 -17
- package/data/llms/headless/components/terminal/api.json +1 -1
- package/data/llms/headless/components/toast/api.json +4 -4
- package/data/llms/headless/components/togglebutton/api.json +27 -3
- package/data/llms/headless/components/toggleswitch/api.json +3 -3
- package/data/llms/headless/components/tooltip/api.json +17 -17
- package/data/llms/headless/components/tree/api.json +20 -20
- package/data/llms/headless/components/tree.md +1 -0
- package/data/llms/headless/components/treetable/api.json +19 -19
- package/data/llms/headless/guides/misc/internationalization.md +282 -0
- package/data/llms/hooks/use-filter.md +2 -2
- package/data/llms/hooks/use-tree-filter.md +3 -1
- package/data/llms/llms-full.txt +10444 -1743
- package/data/llms/llms.txt +15 -0
- package/data/llms/primitive/components/accordion/api.json +39 -39
- package/data/llms/primitive/components/animateonscroll/api.json +5 -5
- package/data/llms/primitive/components/autocomplete/api.json +105 -105
- package/data/llms/primitive/components/avatar/api.json +14 -14
- package/data/llms/primitive/components/badge/api.json +6 -6
- package/data/llms/primitive/components/breadcrumb/api.json +27 -27
- package/data/llms/primitive/components/button/api.json +8 -8
- package/data/llms/primitive/components/buttongroup/api.json +3 -3
- package/data/llms/primitive/components/card/api.json +24 -24
- package/data/llms/primitive/components/carousel/api.json +28 -28
- package/data/llms/primitive/components/checkbox/api.json +14 -14
- package/data/llms/primitive/components/checkboxgroup/api.json +5 -5
- package/data/llms/primitive/components/chip/api.json +19 -19
- package/data/llms/primitive/components/collapsible/api.json +18 -18
- package/data/llms/primitive/components/compare/api.json +18 -18
- package/data/llms/primitive/components/contextmenu/api.json +150 -1141
- package/data/llms/primitive/components/datatable/api.json +215 -164
- package/data/llms/primitive/components/dataview/api.json +17 -17
- package/data/llms/primitive/components/datepicker/api.json +230 -230
- package/data/llms/primitive/components/dialog/api.json +63 -63
- package/data/llms/primitive/components/divider/api.json +3 -3
- package/data/llms/primitive/components/drawer/api.json +47 -47
- package/data/llms/primitive/components/fieldset/api.json +31 -31
- package/data/llms/primitive/components/fileupload/api.json +53 -53
- package/data/llms/primitive/components/floatlabel/api.json +3 -3
- package/data/llms/primitive/components/focustrap/api.json +7 -7
- package/data/llms/primitive/components/gallery/api.json +91 -91
- package/data/llms/primitive/components/iconfield/api.json +7 -7
- package/data/llms/primitive/components/iftalabel/api.json +3 -3
- package/data/llms/primitive/components/inplace/api.json +18 -18
- package/data/llms/primitive/components/inputcolor/api.json +51 -51
- package/data/llms/primitive/components/inputnumber/api.json +10 -10
- package/data/llms/primitive/components/inputotp/api.json +12 -12
- package/data/llms/primitive/components/inputpassword/api.json +7 -7
- package/data/llms/primitive/components/inputtags/api.json +6 -6
- package/data/llms/primitive/components/inputtext/api.json +4 -4
- package/data/llms/primitive/components/knob/api.json +19 -19
- package/data/llms/primitive/components/label/api.json +3 -3
- package/data/llms/primitive/components/listbox/api.json +57 -57
- package/data/llms/primitive/components/menu/api.json +87 -279
- package/data/llms/primitive/components/message/api.json +22 -22
- package/data/llms/primitive/components/metergroup/api.json +27 -27
- package/data/llms/primitive/components/navigationmenu/api.json +8 -8
- package/data/llms/primitive/components/paginator/api.json +43 -43
- package/data/llms/primitive/components/panel/api.json +34 -34
- package/data/llms/primitive/components/popover/api.json +67 -67
- package/data/llms/primitive/components/portal/api.json +4 -4
- package/data/llms/primitive/components/progressbar/api.json +22 -22
- package/data/llms/primitive/components/progressspinner/api.json +18 -18
- package/data/llms/primitive/components/radiobutton/api.json +16 -16
- package/data/llms/primitive/components/rating/api.json +20 -20
- package/data/llms/primitive/components/scrollarea/api.json +23 -23
- package/data/llms/primitive/components/select/api.json +95 -95
- package/data/llms/primitive/components/sidebar/api.json +215 -121
- package/data/llms/primitive/components/sidebar.md +2 -1
- package/data/llms/primitive/components/skeleton/api.json +3 -3
- package/data/llms/primitive/components/slider/api.json +22 -22
- package/data/llms/primitive/components/speeddial/api.json +22 -22
- package/data/llms/primitive/components/splitter/api.json +18 -18
- package/data/llms/primitive/components/stepper/api.json +64 -64
- package/data/llms/primitive/components/tabs/api.json +51 -51
- package/data/llms/primitive/components/tag/api.json +3 -3
- package/data/llms/primitive/components/terminal/api.json +44 -44
- package/data/llms/primitive/components/textarea/api.json +4 -4
- package/data/llms/primitive/components/timeline/api.json +27 -27
- package/data/llms/primitive/components/toast/api.json +48 -48
- package/data/llms/primitive/components/togglebutton/api.json +10 -10
- package/data/llms/primitive/components/togglebuttongroup/api.json +5 -5
- package/data/llms/primitive/components/toggleswitch/api.json +12 -12
- package/data/llms/primitive/components/toolbar/api.json +15 -15
- package/data/llms/primitive/components/tooltip/api.json +52 -52
- package/data/llms/primitive/components/tree/api.json +73 -73
- package/data/llms/primitive/components/visuallyhidden/api.json +3 -3
- package/data/llms/primitive/guides/migration/updating-to-v11.md +2219 -0
- package/data/llms/primitive/guides/misc/internationalization.md +287 -0
- package/data/llms/styled/add-ons/designer/ci.md +273 -0
- package/data/llms/styled/add-ons/designer/guide.md +99 -0
- package/data/llms/styled/add-ons/designer/overview.md +194 -0
- package/data/llms/styled/add-ons/uikit/guide/v3.md +182 -0
- package/data/llms/styled/add-ons/uikit/guide/v4.md +163 -0
- package/data/llms/styled/add-ons/uikit/overview.md +204 -0
- package/data/llms/styled/components/button/api.json +8 -8
- package/data/llms/styled/components/carousel.md +65 -0
- package/data/llms/styled/components/datatable.md +101 -88
- package/data/llms/styled/components/floatlabel/api.json +3 -3
- package/data/llms/styled/components/fluid/api.json +3 -3
- package/data/llms/styled/components/iconfield/api.json +7 -7
- package/data/llms/styled/components/iftalabel/api.json +3 -3
- package/data/llms/styled/components/inputcolor.md +3 -0
- package/data/llms/styled/components/inputgroup/api.json +7 -7
- package/data/llms/styled/components/label/api.json +3 -3
- package/data/llms/styled/components/menu.md +39 -41
- package/data/llms/styled/components/organizationchart/api.json +33 -33
- package/data/llms/styled/components/rating/api.json +11 -11
- package/data/llms/styled/components/select.md +6 -0
- package/data/llms/styled/components/sidebar.md +12 -8
- package/data/llms/styled/components/tree.md +5 -0
- package/data/llms/styled/components/treetable.md +171 -62
- package/data/llms/styled/guides/configuration.md +223 -0
- package/data/llms/styled/guides/form/formik.md +448 -0
- package/data/llms/styled/guides/form/react-hook-form.md +503 -0
- package/data/llms/styled/guides/form/tanstack.md +502 -0
- package/data/llms/styled/guides/migration/updating-to-v11.md +2219 -0
- package/data/llms/styled/guides/misc/internationalization.md +379 -0
- package/data/llms/styled/guides/theming/tailwind.md +25 -0
- package/data/llms/tailwind/components/button/api.json +8 -8
- package/data/llms/tailwind/components/datatable.md +33 -42
- package/data/llms/tailwind/components/inputgroup.md +0 -1
- package/data/llms/tailwind/components/menu.md +5 -5
- package/data/llms/tailwind/components/select.md +3 -0
- package/data/llms/tailwind/components/sidebar.md +16 -11
- package/data/llms/tailwind/components/tooltip.md +4 -13
- package/data/llms/tailwind/guides/misc/internationalization.md +287 -0
- package/data/manifest.json +1089 -779
- package/data/mcp-data.json +263 -32
- package/dist/index.d.ts +7 -2
- package/dist/index.js +1 -1
- package/package.json +9 -8
- package/data/llms/styled/guides/installation/configuration.md +0 -135
- package/data/llms/tailwind/guides/theming/guide.md +0 -179
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primereact/mcp",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"author": "PrimeTek Informatics",
|
|
5
5
|
"description": "Model Context Protocol (MCP) server for PrimeReact component library",
|
|
6
6
|
"homepage": "https://primereact.dev",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/primefaces/primereact-nextchapter.git",
|
|
11
|
+
"directory": "packages/mcp"
|
|
12
|
+
},
|
|
8
13
|
"bugs": {
|
|
9
14
|
"url": "https://support.primeui.dev"
|
|
10
15
|
},
|
|
@@ -50,16 +55,12 @@
|
|
|
50
55
|
"engines": {
|
|
51
56
|
"node": ">=22.0.0"
|
|
52
57
|
},
|
|
53
|
-
"repository": {
|
|
54
|
-
"type": "git",
|
|
55
|
-
"url": "git+https://github.com/primefaces/primereact-nextchapter.git",
|
|
56
|
-
"directory": "packages/mcp"
|
|
57
|
-
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "NODE_ENV=production INPUT_DIR=src/ OUTPUT_DIR=dist/ pnpm run build:package",
|
|
60
|
-
"build:package": "pnpm run
|
|
60
|
+
"build:package": "pnpm run test && tsup",
|
|
61
61
|
"build:prebuild": "node ./scripts/prebuild.mjs",
|
|
62
|
-
"test": "vitest run --config=./vitest.config.ts",
|
|
62
|
+
"test": "pnpm run build:prebuild && vitest run --config=./vitest.config.ts",
|
|
63
|
+
"test:watch": "vitest --config=./vitest.config.ts",
|
|
63
64
|
"test:extracted": "node ./scripts/extracted-smoke.mjs",
|
|
64
65
|
"dev:link": "pnpm link --global && npm link"
|
|
65
66
|
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
# Configuration
|
|
2
|
-
|
|
3
|
-
Application wide configuration for PrimeReact.
|
|
4
|
-
|
|
5
|
-
## Provider
|
|
6
|
-
|
|
7
|
-
Wrap your app with `PrimeReactProvider` in your main file (like `main.tsx` or `App.tsx`). This enables PrimeReact features everywhere in your app:
|
|
8
|
-
|
|
9
|
-
```tsx showLineNumbers {10, 12}
|
|
10
|
-
import { StrictMode } from 'react'
|
|
11
|
-
import { createRoot } from 'react-dom/client'
|
|
12
|
-
import App from './App.tsx'
|
|
13
|
-
import { PrimeReactProvider } from "@primereact/core";
|
|
14
|
-
|
|
15
|
-
...
|
|
16
|
-
|
|
17
|
-
createRoot(document.getElementById('root')!).render(
|
|
18
|
-
<StrictMode>
|
|
19
|
-
<PrimeReactProvider>
|
|
20
|
-
<App />
|
|
21
|
-
</PrimeReactProvider>
|
|
22
|
-
</StrictMode>,
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Theme
|
|
28
|
-
|
|
29
|
-
Style mode offers theming based on a design token based architecture. See the [styled mode](/docs/theming/styled) documentation for details such as building your own theme.
|
|
30
|
-
|
|
31
|
-
```tsx full showLineNumbers {2,5-12,16}
|
|
32
|
-
...
|
|
33
|
-
import Aura from '@primeuix/themes/aura';
|
|
34
|
-
import { PrimeReactProvider } from '@primereact/core';
|
|
35
|
-
|
|
36
|
-
const theme = {
|
|
37
|
-
preset: Aura,
|
|
38
|
-
options: {
|
|
39
|
-
prefix: 'p',
|
|
40
|
-
darkModeSelector: 'system',
|
|
41
|
-
cssLayer: false
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
46
|
-
<React.StrictMode>
|
|
47
|
-
<PrimeReactProvider theme={theme}>
|
|
48
|
-
<App />
|
|
49
|
-
</PrimeReactProvider>
|
|
50
|
-
</React.StrictMode>
|
|
51
|
-
);
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Unstyled
|
|
55
|
-
|
|
56
|
-
Unstyled mode instructs the components not to add any built-in style classes so that they can be styled using custom css or libraries like Tailwind and Bootstrap. Visit Unstyled mode documentation for more information.
|
|
57
|
-
|
|
58
|
-
```tsx showLineNumbers {6}
|
|
59
|
-
import { PrimeReactProvider } from '@primereact/core';
|
|
60
|
-
...
|
|
61
|
-
|
|
62
|
-
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
63
|
-
<React.StrictMode>
|
|
64
|
-
<PrimeReactProvider unstyled>
|
|
65
|
-
<App />
|
|
66
|
-
</PrimeReactProvider>
|
|
67
|
-
</React.StrictMode>
|
|
68
|
-
);
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## PassThrough
|
|
72
|
-
|
|
73
|
-
Defines the shared pass through properties per component type. Visit the [Pass Through Props](/docs/passthrough) documentation for more information.
|
|
74
|
-
|
|
75
|
-
```tsx showLineNumbers {4-8,12}
|
|
76
|
-
import { PrimeReactProvider } from '@primereact/core';
|
|
77
|
-
...
|
|
78
|
-
|
|
79
|
-
const pt = {
|
|
80
|
-
slider: {
|
|
81
|
-
handle: { className: 'bg-primary text-primary-contrast' }
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
86
|
-
<React.StrictMode>
|
|
87
|
-
<PrimeReactProvider pt={pt}>
|
|
88
|
-
<App />
|
|
89
|
-
</PrimeReactProvider>
|
|
90
|
-
</React.StrictMode>
|
|
91
|
-
);
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## PassThrough Options
|
|
95
|
-
|
|
96
|
-
Used to configure the `ptOptions` properties of components. The `mergeSections` defines whether the sections from the main configuration gets added and the `mergeProps` controls whether to override or merge the defined props.
|
|
97
|
-
Defaults are `true` for `mergeSections` and `false` for `mergeProps`.
|
|
98
|
-
|
|
99
|
-
```tsx showLineNumbers {4-7,11}
|
|
100
|
-
import { PrimeReactProvider } from '@primereact/core';
|
|
101
|
-
...
|
|
102
|
-
|
|
103
|
-
const ptOptions = {
|
|
104
|
-
mergeSections: true,
|
|
105
|
-
mergeProps: false
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
109
|
-
<React.StrictMode>
|
|
110
|
-
<PrimeReactProvider ptOptions={ptOptions}>
|
|
111
|
-
<App />
|
|
112
|
-
</PrimeReactProvider>
|
|
113
|
-
</React.StrictMode>
|
|
114
|
-
);
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## InputVariant
|
|
118
|
-
|
|
119
|
-
Input fields come in two styles, default is `outlined` with borders around the field whereas `filled` alternative adds a background color to the field.
|
|
120
|
-
Applying `p-variant-filled` to an ancestor of an input enables the filled style. If you prefer to use filled inputs in the entire application, use a global container such as the document body or the application element to apply the style class.
|
|
121
|
-
Note that in case you add it to the application element, components that are teleported to the document body such as Dialog will not be able to display filled inputs as they are not a descendant of the application root element in the DOM tree,
|
|
122
|
-
to resolve this case set inputVariant to `filled` at PrimeReactProvider as well.
|
|
123
|
-
|
|
124
|
-
```tsx showLineNumbers {6}
|
|
125
|
-
import { PrimeReactProvider } from '@primereact/core';
|
|
126
|
-
...
|
|
127
|
-
|
|
128
|
-
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
129
|
-
<React.StrictMode>
|
|
130
|
-
<PrimeReactProvider inputVariant="filled">
|
|
131
|
-
<App />
|
|
132
|
-
</PrimeReactProvider>
|
|
133
|
-
</React.StrictMode>
|
|
134
|
-
);
|
|
135
|
-
```
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
# Theming
|
|
2
|
-
|
|
3
|
-
Theme PrimeReact's Tailwind components with CSS variables and the tailwindcss-primeui plugin.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Like shadcn/ui, the Tailwind components are themed entirely through **CSS variables**, design tokens defined on `:root`. The [`tailwindcss-primeui`](https://github.com/primefaces/tailwindcss-primeui) plugin maps those tokens to Tailwind utilities (`bg-primary`, `text-muted-color`, `border-surface`, …) that every component is built with, so editing a single variable re-themes the whole UI.
|
|
8
|
-
|
|
9
|
-
## How it works
|
|
10
|
-
|
|
11
|
-
Two pieces work together:
|
|
12
|
-
|
|
13
|
-
- **CSS variables**, PrimeUI design tokens (`--p-primary-*`, `--p-surface-*`, and semantic tokens) added to your global stylesheet's `:root`.
|
|
14
|
-
- **tailwindcss-primeui**, a Tailwind plugin that turns those tokens into utility classes (`bg-primary`, `text-surface-500`, `text-color`, `text-muted-color`, `border-surface`, `rounded-border`, …) and a dark-mode variant. Install it during [installation](/docs/tailwind/guides/installation) and import it in your global CSS:
|
|
15
|
-
|
|
16
|
-
```css title="app/globals.css"
|
|
17
|
-
@import 'tailwindcss';
|
|
18
|
-
|
|
19
|
-
@import 'tailwindcss-primeui';
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## CSS Variables
|
|
23
|
-
|
|
24
|
-
The PrimeReact registry ships as a `registry:style`, so when you set it up these tokens are written to your global stylesheet. This is the default theme:
|
|
25
|
-
|
|
26
|
-
```css title="app/globals.css"
|
|
27
|
-
:root {
|
|
28
|
-
--p-primary-50: oklch(98.5% 0 0);
|
|
29
|
-
--p-primary-100: oklch(97% 0 0);
|
|
30
|
-
--p-primary-200: oklch(92.2% 0 0);
|
|
31
|
-
--p-primary-300: oklch(87% 0 0);
|
|
32
|
-
--p-primary-400: oklch(70.8% 0 0);
|
|
33
|
-
--p-primary-500: oklch(55.6% 0 0);
|
|
34
|
-
--p-primary-600: oklch(43.9% 0 0);
|
|
35
|
-
--p-primary-700: oklch(37.1% 0 0);
|
|
36
|
-
--p-primary-800: oklch(26.9% 0 0);
|
|
37
|
-
--p-primary-900: oklch(20.5% 0 0);
|
|
38
|
-
--p-primary-950: oklch(14.5% 0 0);
|
|
39
|
-
--p-surface-0: oklch(100% 0 0);
|
|
40
|
-
--p-surface-50: oklch(98.5% 0 0);
|
|
41
|
-
--p-surface-100: oklch(97% 0 0);
|
|
42
|
-
--p-surface-200: oklch(92.2% 0 0);
|
|
43
|
-
--p-surface-300: oklch(87% 0 0);
|
|
44
|
-
--p-surface-400: oklch(70.8% 0 0);
|
|
45
|
-
--p-surface-500: oklch(55.6% 0 0);
|
|
46
|
-
--p-surface-600: oklch(43.9% 0 0);
|
|
47
|
-
--p-surface-700: oklch(37.1% 0 0);
|
|
48
|
-
--p-surface-800: oklch(26.9% 0 0);
|
|
49
|
-
--p-surface-900: oklch(20.5% 0 0);
|
|
50
|
-
--p-surface-950: oklch(14.5% 0 0);
|
|
51
|
-
--p-content-border-radius: 6px;
|
|
52
|
-
--p-primary-color: var(--p-primary-500);
|
|
53
|
-
--p-primary-contrast-color: var(--p-surface-0);
|
|
54
|
-
--p-primary-hover-color: var(--p-primary-600);
|
|
55
|
-
--p-primary-active-color: var(--p-primary-700);
|
|
56
|
-
--p-content-border-color: var(--p-surface-200);
|
|
57
|
-
--p-content-hover-background: var(--p-surface-100);
|
|
58
|
-
--p-content-hover-color: var(--p-surface-800);
|
|
59
|
-
--p-highlight-background: var(--p-primary-50);
|
|
60
|
-
--p-highlight-color: var(--p-primary-700);
|
|
61
|
-
--p-highlight-focus-background: var(--p-primary-100);
|
|
62
|
-
--p-highlight-focus-color: var(--p-primary-800);
|
|
63
|
-
--p-text-color: var(--p-surface-700);
|
|
64
|
-
--p-text-hover-color: var(--p-surface-800);
|
|
65
|
-
--p-text-muted-color: var(--p-surface-500);
|
|
66
|
-
--p-text-hover-muted-color: var(--p-surface-600);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@media (prefers-color-scheme: dark) {
|
|
70
|
-
:root {
|
|
71
|
-
--p-primary-color: var(--p-primary-400);
|
|
72
|
-
--p-primary-contrast-color: var(--p-surface-900);
|
|
73
|
-
--p-primary-hover-color: var(--p-primary-300);
|
|
74
|
-
--p-primary-active-color: var(--p-primary-200);
|
|
75
|
-
--p-content-border-color: var(--p-surface-700);
|
|
76
|
-
--p-content-hover-background: var(--p-surface-800);
|
|
77
|
-
--p-content-hover-color: var(--p-surface-0);
|
|
78
|
-
--p-highlight-background: color-mix(in srgb, var(--p-primary-400), transparent 84%);
|
|
79
|
-
--p-highlight-color: rgba(255, 255, 255, 0.87);
|
|
80
|
-
--p-highlight-focus-background: color-mix(in srgb, var(--p-primary-400), transparent 76%);
|
|
81
|
-
--p-highlight-focus-color: rgba(255, 255, 255, 0.87);
|
|
82
|
-
--p-text-color: var(--p-surface-0);
|
|
83
|
-
--p-text-hover-color: var(--p-surface-0);
|
|
84
|
-
--p-text-muted-color: var(--p-surface-400);
|
|
85
|
-
--p-text-hover-muted-color: var(--p-surface-300);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Token groups
|
|
91
|
-
|
|
92
|
-
- **Primary scale**, `--p-primary-50` … `--p-primary-950`, the accent ramp (neutral gray by default).
|
|
93
|
-
- **Surface scale**, `--p-surface-0` … `--p-surface-950`, the neutrals used for backgrounds, borders and text.
|
|
94
|
-
- **Semantic tokens**, resolve to the scales and are what components actually reference: `--p-primary-color`, `--p-primary-contrast-color`, `--p-primary-hover-color`, `--p-primary-active-color`, `--p-text-color`, `--p-text-muted-color`, `--p-content-border-color`, `--p-content-hover-background`, `--p-highlight-background` / `--p-highlight-color`, and `--p-content-border-radius` for rounding.
|
|
95
|
-
|
|
96
|
-
## Customizing the theme
|
|
97
|
-
|
|
98
|
-
### Primary color
|
|
99
|
-
|
|
100
|
-
The default primary ramp is neutral gray. Point it at any palette, for example Tailwind's built-in `blue`, whose tokens are exposed as `--color-*` variables in Tailwind v4:
|
|
101
|
-
|
|
102
|
-
```css title="app/globals.css"
|
|
103
|
-
:root {
|
|
104
|
-
--p-primary-50: var(--color-blue-50);
|
|
105
|
-
--p-primary-100: var(--color-blue-100);
|
|
106
|
-
--p-primary-200: var(--color-blue-200);
|
|
107
|
-
--p-primary-300: var(--color-blue-300);
|
|
108
|
-
--p-primary-400: var(--color-blue-400);
|
|
109
|
-
--p-primary-500: var(--color-blue-500);
|
|
110
|
-
--p-primary-600: var(--color-blue-600);
|
|
111
|
-
--p-primary-700: var(--color-blue-700);
|
|
112
|
-
--p-primary-800: var(--color-blue-800);
|
|
113
|
-
--p-primary-900: var(--color-blue-900);
|
|
114
|
-
--p-primary-950: var(--color-blue-950);
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
The semantic tokens (`--p-primary-color`, hover, active, contrast) follow the ramp automatically, so every component updates at once.
|
|
119
|
-
|
|
120
|
-
### Surface color
|
|
121
|
-
|
|
122
|
-
Remap `--p-surface-*` the same way to change the neutral tone, for example to one of Tailwind's neutral palettes like `zinc` (or `slate`, `stone`, `neutral`). Note `--p-surface-0` is pure white, so map it to `--color-white`:
|
|
123
|
-
|
|
124
|
-
```css title="app/globals.css"
|
|
125
|
-
:root {
|
|
126
|
-
--p-surface-0: var(--color-white);
|
|
127
|
-
--p-surface-50: var(--color-zinc-50);
|
|
128
|
-
--p-surface-100: var(--color-zinc-100);
|
|
129
|
-
--p-surface-200: var(--color-zinc-200);
|
|
130
|
-
--p-surface-300: var(--color-zinc-300);
|
|
131
|
-
--p-surface-400: var(--color-zinc-400);
|
|
132
|
-
--p-surface-500: var(--color-zinc-500);
|
|
133
|
-
--p-surface-600: var(--color-zinc-600);
|
|
134
|
-
--p-surface-700: var(--color-zinc-700);
|
|
135
|
-
--p-surface-800: var(--color-zinc-800);
|
|
136
|
-
--p-surface-900: var(--color-zinc-900);
|
|
137
|
-
--p-surface-950: var(--color-zinc-950);
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Border radius
|
|
142
|
-
|
|
143
|
-
`--p-content-border-radius` controls how rounded the components are:
|
|
144
|
-
|
|
145
|
-
```css title="app/globals.css"
|
|
146
|
-
:root {
|
|
147
|
-
--p-content-border-radius: 10px;
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Dark mode
|
|
152
|
-
|
|
153
|
-
By default the dark tokens apply under `@media (prefers-color-scheme: dark)`, following the user's system setting. To toggle dark mode yourself, move the dark overrides into a class selector and add that class to your `<html>` element:
|
|
154
|
-
|
|
155
|
-
```css title="app/globals.css"
|
|
156
|
-
.dark {
|
|
157
|
-
--p-primary-color: var(--p-primary-400);
|
|
158
|
-
--p-primary-contrast-color: var(--p-surface-900);
|
|
159
|
-
/* …rest of the dark overrides… */
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
```tsx
|
|
164
|
-
<html className="dark">...</html>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
## Using tokens in your own markup
|
|
168
|
-
|
|
169
|
-
Because the tokens are exposed as utilities by `tailwindcss-primeui`, you can style your own elements to match the components:
|
|
170
|
-
|
|
171
|
-
```tsx
|
|
172
|
-
<div className="bg-surface-0 text-color border border-surface rounded-border p-4">
|
|
173
|
-
<span className="text-primary">Themed with the same tokens</span>
|
|
174
|
-
</div>
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
## Reference
|
|
178
|
-
|
|
179
|
-
- [tailwindcss-primeui](https://github.com/primefaces/tailwindcss-primeui), the Tailwind plugin and the full list of utilities it generates.
|