@prioticket/design-system-react 1.7.0-beta.2 → 1.8.0-beta.2
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 +7 -3
- package/dist/components/pd-date-picker.d.ts +3 -0
- package/dist/components/pd-date-picker.js +13 -0
- package/dist/components/pd-time-picker.d.ts +3 -0
- package/dist/components/pd-time-picker.js +13 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -8,7 +8,9 @@ Official React bindings for the `@prioticket/design-system-web` component librar
|
|
|
8
8
|
npm install @prioticket/design-system-react @prioticket/design-system-web
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
The
|
|
11
|
+
The core web component bundle is a **peer dependency**: install both packages at the same version, as above. Only one copy of `@prioticket/design-system-web` may exist in your dependency tree, because every component registers itself with `customElements.define` and a second copy throws. Check with `npm ls @prioticket/design-system-web`; a single entry is correct.
|
|
12
|
+
|
|
13
|
+
Most projects also import one of the distributed theme stylesheets:
|
|
12
14
|
|
|
13
15
|
```tsx
|
|
14
16
|
import '@prioticket/design-system-web/theme-with-fonts.css';
|
|
@@ -35,18 +37,20 @@ export function App() {
|
|
|
35
37
|
|
|
36
38
|
return (
|
|
37
39
|
<PdDialog onPrimaryAction={(event) => console.log(event.detail)}>
|
|
38
|
-
<PdButton slot="
|
|
40
|
+
<PdButton slot="actions">Continue</PdButton>
|
|
39
41
|
</PdDialog>
|
|
40
42
|
);
|
|
41
43
|
}
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
All wrappers render a custom element under the hood, so slots, attributes, and properties behave exactly like the base web component.
|
|
46
|
+
All wrappers render a custom element under the hood, so slots, attributes, and properties behave exactly like the base web component. `pd-dialog` exposes two slots: the default slot for content and `actions` for footer buttons. The title is the `headline` property, not a slot.
|
|
45
47
|
|
|
46
48
|
## Event Handling
|
|
47
49
|
|
|
48
50
|
Events emitted by the web components are exposed as camel-cased React props that start with `on`. For example, the `pd-dialog` events `primary-action` and `secondary-action` become `onPrimaryAction` and `onSecondaryAction`. Each handler receives the original `CustomEvent`, preserving its `detail` payload.
|
|
49
51
|
|
|
52
|
+
The prop name is derived by splitting the event name on hyphens only, so an event without hyphens keeps its casing: `pd-segmented-button` emits `selectionchange`, which becomes `onSelectionchange`, not `onSelectionChange`. A wrong prop name is silently ignored. The full list of generated prop names is in `CLAUDE.md`, shipped with the web package at `node_modules/@prioticket/design-system-web/CLAUDE.md`, section "React event props".
|
|
53
|
+
|
|
50
54
|
## Theming Utilities
|
|
51
55
|
|
|
52
56
|
The core package exposes helpers under `@prioticket/design-system-web/theming`. Use `initialize` to apply a theme at app start or `applyTheme` to update tokens later. The helpers are framework agnostic and can be called from any React effect or data loader.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { PdDatePicker as PdDatePickerElementClass } from '@prioticket/design-system-web/components/pd-date-picker';
|
|
4
|
+
const componentConfig = {
|
|
5
|
+
displayName: 'PdDatePicker',
|
|
6
|
+
react: React,
|
|
7
|
+
tagName: 'pd-date-picker',
|
|
8
|
+
elementClass: PdDatePickerElementClass,
|
|
9
|
+
events: {
|
|
10
|
+
onPdDateChange: 'pd-date-change'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const PdDatePicker = createComponent(componentConfig);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { PdTimePicker as PdTimePickerElementClass } from '@prioticket/design-system-web/components/pd-time-picker';
|
|
4
|
+
const componentConfig = {
|
|
5
|
+
displayName: 'PdTimePicker',
|
|
6
|
+
react: React,
|
|
7
|
+
tagName: 'pd-time-picker',
|
|
8
|
+
elementClass: PdTimePickerElementClass,
|
|
9
|
+
events: {
|
|
10
|
+
onPdTimeChange: 'pd-time-change'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const PdTimePicker = createComponent(componentConfig);
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { PdCheckbox } from './components/pd-checkbox.js';
|
|
|
8
8
|
export type { PdCheckboxElement } from './components/pd-checkbox.js';
|
|
9
9
|
export { PdChip } from './components/pd-chip.js';
|
|
10
10
|
export type { PdChipElement } from './components/pd-chip.js';
|
|
11
|
+
export { PdDatePicker } from './components/pd-date-picker.js';
|
|
12
|
+
export type { PdDatePickerElement } from './components/pd-date-picker.js';
|
|
11
13
|
export { PdDateRangePicker } from './components/pd-date-range-picker.js';
|
|
12
14
|
export type { PdDateRangePickerElement } from './components/pd-date-range-picker.js';
|
|
13
15
|
export { PdDialog } from './components/pd-dialog.js';
|
|
@@ -60,3 +62,5 @@ export { PdTabs } from './components/pd-tabs.js';
|
|
|
60
62
|
export type { PdTabsElement } from './components/pd-tabs.js';
|
|
61
63
|
export { PdTextField } from './components/pd-text-field.js';
|
|
62
64
|
export type { PdTextFieldElement } from './components/pd-text-field.js';
|
|
65
|
+
export { PdTimePicker } from './components/pd-time-picker.js';
|
|
66
|
+
export type { PdTimePickerElement } from './components/pd-time-picker.js';
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { PdButton } from './components/pd-button.js';
|
|
|
4
4
|
export { PdCard } from './components/pd-card.js';
|
|
5
5
|
export { PdCheckbox } from './components/pd-checkbox.js';
|
|
6
6
|
export { PdChip } from './components/pd-chip.js';
|
|
7
|
+
export { PdDatePicker } from './components/pd-date-picker.js';
|
|
7
8
|
export { PdDateRangePicker } from './components/pd-date-range-picker.js';
|
|
8
9
|
export { PdDialog } from './components/pd-dialog.js';
|
|
9
10
|
export { PdExpandableCard } from './components/pd-expandable-card.js';
|
|
@@ -30,3 +31,4 @@ export { PdTab } from './components/pd-tab.js';
|
|
|
30
31
|
export { PdTable } from './components/pd-table.js';
|
|
31
32
|
export { PdTabs } from './components/pd-tabs.js';
|
|
32
33
|
export { PdTextField } from './components/pd-text-field.js';
|
|
34
|
+
export { PdTimePicker } from './components/pd-time-picker.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prioticket/design-system-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-beta.2",
|
|
4
4
|
"description": "React wrappers for the Prioticket Design System web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"clean": "rimraf dist"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
+
"@prioticket/design-system-web": "^1.8.0-beta.2",
|
|
34
35
|
"react": ">=17",
|
|
35
36
|
"react-dom": ">=17"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@lit/react": "^1.0.3"
|
|
39
|
-
"@prioticket/design-system-web": "1.3.0"
|
|
39
|
+
"@lit/react": "^1.0.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"rimraf": "^6.0.0"
|