@prismora/react 0.0.0-stage → 0.1.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 (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -2
  3. package/dist/components/Accordion.d.ts +19 -0
  4. package/dist/components/Accordion.js +4 -0
  5. package/dist/components/AccordionItem.d.ts +24 -0
  6. package/dist/components/AccordionItem.js +4 -0
  7. package/dist/components/Alert.d.ts +28 -0
  8. package/dist/components/Alert.js +4 -0
  9. package/dist/components/Avatar.d.ts +27 -0
  10. package/dist/components/Avatar.js +4 -0
  11. package/dist/components/AvatarGroup.d.ts +23 -0
  12. package/dist/components/AvatarGroup.js +4 -0
  13. package/dist/components/BackToTop.d.ts +25 -0
  14. package/dist/components/BackToTop.js +4 -0
  15. package/dist/components/Badge.d.ts +23 -0
  16. package/dist/components/Badge.js +4 -0
  17. package/dist/components/Banner.d.ts +30 -0
  18. package/dist/components/Banner.js +4 -0
  19. package/dist/components/Breadcrumb.d.ts +23 -0
  20. package/dist/components/Breadcrumb.js +4 -0
  21. package/dist/components/BreadcrumbItem.d.ts +21 -0
  22. package/dist/components/BreadcrumbItem.js +4 -0
  23. package/dist/components/Button.d.ts +49 -0
  24. package/dist/components/Button.js +4 -0
  25. package/dist/components/ButtonGroup.d.ts +19 -0
  26. package/dist/components/ButtonGroup.js +4 -0
  27. package/dist/components/Calendar.d.ts +34 -0
  28. package/dist/components/Calendar.js +4 -0
  29. package/dist/components/Card.d.ts +25 -0
  30. package/dist/components/Card.js +4 -0
  31. package/dist/components/Carousel.d.ts +32 -0
  32. package/dist/components/Carousel.js +4 -0
  33. package/dist/components/Cascader.d.ts +42 -0
  34. package/dist/components/Cascader.js +4 -0
  35. package/dist/components/Chart.d.ts +42 -0
  36. package/dist/components/Chart.js +4 -0
  37. package/dist/components/Chat.d.ts +19 -0
  38. package/dist/components/Chat.js +4 -0
  39. package/dist/components/ChatMessage.d.ts +31 -0
  40. package/dist/components/ChatMessage.js +4 -0
  41. package/dist/components/Checkbox.d.ts +43 -0
  42. package/dist/components/Checkbox.js +4 -0
  43. package/dist/components/CheckboxGroup.d.ts +47 -0
  44. package/dist/components/CheckboxGroup.js +4 -0
  45. package/dist/components/Choice.d.ts +15 -0
  46. package/dist/components/Choice.js +4 -0
  47. package/dist/components/CodeBlock.d.ts +32 -0
  48. package/dist/components/CodeBlock.js +4 -0
  49. package/dist/components/ColorPicker.d.ts +49 -0
  50. package/dist/components/ColorPicker.js +4 -0
  51. package/dist/components/Combobox.d.ts +73 -0
  52. package/dist/components/Combobox.js +4 -0
  53. package/dist/components/Command.d.ts +50 -0
  54. package/dist/components/Command.js +4 -0
  55. package/dist/components/CommandItem.d.ts +21 -0
  56. package/dist/components/CommandItem.js +4 -0
  57. package/dist/components/Composer.d.ts +34 -0
  58. package/dist/components/Composer.js +4 -0
  59. package/dist/components/ContextMenu.d.ts +16 -0
  60. package/dist/components/ContextMenu.js +4 -0
  61. package/dist/components/CopyButton.d.ts +35 -0
  62. package/dist/components/CopyButton.js +4 -0
  63. package/dist/components/Countdown.d.ts +28 -0
  64. package/dist/components/Countdown.js +4 -0
  65. package/dist/components/DataTable.d.ts +90 -0
  66. package/dist/components/DataTable.js +4 -0
  67. package/dist/components/DatePicker.d.ts +58 -0
  68. package/dist/components/DatePicker.js +4 -0
  69. package/dist/components/DescriptionItem.d.ts +19 -0
  70. package/dist/components/DescriptionItem.js +4 -0
  71. package/dist/components/DescriptionList.d.ts +25 -0
  72. package/dist/components/DescriptionList.js +4 -0
  73. package/dist/components/Dialog.d.ts +33 -0
  74. package/dist/components/Dialog.js +4 -0
  75. package/dist/components/Divider.d.ts +19 -0
  76. package/dist/components/Divider.js +4 -0
  77. package/dist/components/Drawer.d.ts +35 -0
  78. package/dist/components/Drawer.js +4 -0
  79. package/dist/components/Editor.d.ts +33 -0
  80. package/dist/components/Editor.js +4 -0
  81. package/dist/components/EmptyState.d.ts +27 -0
  82. package/dist/components/EmptyState.js +4 -0
  83. package/dist/components/FileUpload.d.ts +41 -0
  84. package/dist/components/FileUpload.js +4 -0
  85. package/dist/components/Form.d.ts +15 -0
  86. package/dist/components/Form.js +4 -0
  87. package/dist/components/FormatNumber.d.ts +31 -0
  88. package/dist/components/FormatNumber.js +4 -0
  89. package/dist/components/Icon.d.ts +25 -0
  90. package/dist/components/Icon.js +4 -0
  91. package/dist/components/Image.d.ts +39 -0
  92. package/dist/components/Image.js +4 -0
  93. package/dist/components/Indicator.d.ts +35 -0
  94. package/dist/components/Indicator.js +4 -0
  95. package/dist/components/InlineEdit.d.ts +31 -0
  96. package/dist/components/InlineEdit.js +4 -0
  97. package/dist/components/Input.d.ts +74 -0
  98. package/dist/components/Input.js +4 -0
  99. package/dist/components/Kbd.d.ts +19 -0
  100. package/dist/components/Kbd.js +4 -0
  101. package/dist/components/List.d.ts +23 -0
  102. package/dist/components/List.js +4 -0
  103. package/dist/components/ListItem.d.ts +39 -0
  104. package/dist/components/ListItem.js +4 -0
  105. package/dist/components/Menu.d.ts +12 -0
  106. package/dist/components/Menu.js +4 -0
  107. package/dist/components/Menubar.d.ts +11 -0
  108. package/dist/components/Menubar.js +4 -0
  109. package/dist/components/Meter.d.ts +39 -0
  110. package/dist/components/Meter.js +4 -0
  111. package/dist/components/Nav.d.ts +27 -0
  112. package/dist/components/Nav.js +4 -0
  113. package/dist/components/NavGroup.d.ts +19 -0
  114. package/dist/components/NavGroup.js +4 -0
  115. package/dist/components/NavItem.d.ts +38 -0
  116. package/dist/components/NavItem.js +4 -0
  117. package/dist/components/NumberInput.d.ts +49 -0
  118. package/dist/components/NumberInput.js +4 -0
  119. package/dist/components/Pagination.d.ts +40 -0
  120. package/dist/components/Pagination.js +4 -0
  121. package/dist/components/PinInput.d.ts +48 -0
  122. package/dist/components/PinInput.js +4 -0
  123. package/dist/components/Popover.d.ts +17 -0
  124. package/dist/components/Popover.js +4 -0
  125. package/dist/components/Progress.d.ts +31 -0
  126. package/dist/components/Progress.js +4 -0
  127. package/dist/components/PullRefresh.d.ts +26 -0
  128. package/dist/components/PullRefresh.js +4 -0
  129. package/dist/components/QrCode.d.ts +27 -0
  130. package/dist/components/QrCode.js +4 -0
  131. package/dist/components/Radio.d.ts +15 -0
  132. package/dist/components/Radio.js +4 -0
  133. package/dist/components/RadioGroup.d.ts +43 -0
  134. package/dist/components/RadioGroup.js +4 -0
  135. package/dist/components/RangeSlider.d.ts +45 -0
  136. package/dist/components/RangeSlider.js +4 -0
  137. package/dist/components/Rating.d.ts +40 -0
  138. package/dist/components/Rating.js +4 -0
  139. package/dist/components/RelativeTime.d.ts +29 -0
  140. package/dist/components/RelativeTime.js +4 -0
  141. package/dist/components/Scheduler.d.ts +40 -0
  142. package/dist/components/Scheduler.js +4 -0
  143. package/dist/components/Segment.d.ts +23 -0
  144. package/dist/components/Segment.js +4 -0
  145. package/dist/components/Segmented.d.ts +36 -0
  146. package/dist/components/Segmented.js +4 -0
  147. package/dist/components/Select.d.ts +57 -0
  148. package/dist/components/Select.js +4 -0
  149. package/dist/components/ShareButton.d.ts +35 -0
  150. package/dist/components/ShareButton.js +4 -0
  151. package/dist/components/Signature.d.ts +36 -0
  152. package/dist/components/Signature.js +4 -0
  153. package/dist/components/Skeleton.d.ts +25 -0
  154. package/dist/components/Skeleton.js +4 -0
  155. package/dist/components/Slider.d.ts +53 -0
  156. package/dist/components/Slider.js +4 -0
  157. package/dist/components/Sortable.d.ts +14 -0
  158. package/dist/components/Sortable.js +4 -0
  159. package/dist/components/Sparkline.d.ts +23 -0
  160. package/dist/components/Sparkline.js +4 -0
  161. package/dist/components/Spinner.d.ts +21 -0
  162. package/dist/components/Spinner.js +4 -0
  163. package/dist/components/Splitter.d.ts +30 -0
  164. package/dist/components/Splitter.js +4 -0
  165. package/dist/components/Stat.d.ts +33 -0
  166. package/dist/components/Stat.js +4 -0
  167. package/dist/components/Step.d.ts +27 -0
  168. package/dist/components/Step.js +4 -0
  169. package/dist/components/Steps.d.ts +26 -0
  170. package/dist/components/Steps.js +4 -0
  171. package/dist/components/Switch.d.ts +43 -0
  172. package/dist/components/Switch.js +4 -0
  173. package/dist/components/Tab.d.ts +21 -0
  174. package/dist/components/Tab.js +4 -0
  175. package/dist/components/TabPanel.d.ts +9 -0
  176. package/dist/components/TabPanel.js +4 -0
  177. package/dist/components/Table.d.ts +43 -0
  178. package/dist/components/Table.js +4 -0
  179. package/dist/components/Tabs.d.ts +29 -0
  180. package/dist/components/Tabs.js +4 -0
  181. package/dist/components/Tag.d.ts +35 -0
  182. package/dist/components/Tag.js +4 -0
  183. package/dist/components/Textarea.d.ts +51 -0
  184. package/dist/components/Textarea.js +4 -0
  185. package/dist/components/ThemeSwitch.d.ts +26 -0
  186. package/dist/components/ThemeSwitch.js +4 -0
  187. package/dist/components/TimePicker.d.ts +53 -0
  188. package/dist/components/TimePicker.js +4 -0
  189. package/dist/components/Timeline.d.ts +19 -0
  190. package/dist/components/Timeline.js +4 -0
  191. package/dist/components/TimelineItem.d.ts +25 -0
  192. package/dist/components/TimelineItem.js +4 -0
  193. package/dist/components/Toaster.d.ts +17 -0
  194. package/dist/components/Toaster.js +4 -0
  195. package/dist/components/Toggle.d.ts +30 -0
  196. package/dist/components/Toggle.js +4 -0
  197. package/dist/components/ToggleGroup.d.ts +40 -0
  198. package/dist/components/ToggleGroup.js +4 -0
  199. package/dist/components/Toolbar.d.ts +13 -0
  200. package/dist/components/Toolbar.js +4 -0
  201. package/dist/components/Tooltip.d.ts +11 -0
  202. package/dist/components/Tooltip.js +4 -0
  203. package/dist/components/Tour.d.ts +16 -0
  204. package/dist/components/Tour.js +4 -0
  205. package/dist/components/Transfer.d.ts +42 -0
  206. package/dist/components/Transfer.js +4 -0
  207. package/dist/components/Tree.d.ts +45 -0
  208. package/dist/components/Tree.js +4 -0
  209. package/dist/components/TreeItem.d.ts +38 -0
  210. package/dist/components/TreeItem.js +4 -0
  211. package/dist/components/TreeSelect.d.ts +46 -0
  212. package/dist/components/TreeSelect.js +4 -0
  213. package/dist/components/VirtualList.d.ts +31 -0
  214. package/dist/components/VirtualList.js +4 -0
  215. package/dist/create-component.d.ts +9 -0
  216. package/dist/create-component.js +51 -0
  217. package/dist/index.d.ts +113 -0
  218. package/dist/index.js +109 -0
  219. package/package.json +41 -4
@@ -0,0 +1,26 @@
1
+ import type * as React from 'react';
2
+ import type { PmThemeSwitch } from '@prismora/elements/theme-switch';
3
+ /** Light / dark / system switch. — `<pm-theme-switch>` */
4
+ export interface ThemeSwitchProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** segmented (default: light, dark, system) or toggle (one button, light ↔ dark). */
6
+ variant?: 'segmented' | 'toggle';
7
+ /** Size: xs, sm, md (default), lg or xl. */
8
+ size?: 'sm' | 'md';
9
+ /** Accessible name (default "Colour mode"). */
10
+ label?: string;
11
+ /** Show the words next to the icons. */
12
+ showLabels?: boolean;
13
+ /** Colour role. Inherited by descendants unless they set their own. */
14
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
15
+ /** Surface style override for this component (and its descendants). */
16
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
17
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
18
+ density?: 'compact' | 'comfortable' | 'spacious';
19
+ motion?: 'none' | 'reduced' | 'full';
20
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
21
+ onPmChange?: (event: CustomEvent) => void;
22
+ children?: React.ReactNode;
23
+ }
24
+ export declare const ThemeSwitch: React.ForwardRefExoticComponent<ThemeSwitchProps & {
25
+ children?: React.ReactNode;
26
+ } & React.RefAttributes<PmThemeSwitch>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const ThemeSwitch = /* @__PURE__ */ createComponent('pm-theme-switch', { onPmChange: 'pm-change' }, () => import('@prismora/elements/theme-switch'));
@@ -0,0 +1,53 @@
1
+ import type * as React from 'react';
2
+ import type { PmTimePicker } from '@prismora/elements/time-picker';
3
+ /** Time picker: type a time ("14:30", "2:30 pm") or pick hours and minutes from a popup. — `<pm-time-picker>` */
4
+ export interface TimePickerProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Native mobile pattern on phones: opens as a swipeable bottom sheet (inherits from ancestors such as `<html mobile>`; `mobile="false"` opts out). */
6
+ mobile?: boolean;
7
+ /** Earliest time, "HH:MM". */
8
+ min?: string;
9
+ /** Latest time, "HH:MM". */
10
+ max?: string;
11
+ /** Minute step in the popup (1–60). Typed values may be any minute. */
12
+ step?: number;
13
+ /** BCP 47 locale for formatting (default: the page language). */
14
+ locale?: string;
15
+ /** Force 12- or 24-hour display. */
16
+ hourCycle?: '12' | '24';
17
+ /** Hint text shown while empty (not a replacement for `label`). */
18
+ placeholder?: string;
19
+ /** Form field name: the value is submitted under it. */
20
+ name?: string;
21
+ /** Current value (submitted with the form). */
22
+ value?: string;
23
+ /** Visible label (required for accessibility; use `hide-label` to visually hide it). */
24
+ label?: string;
25
+ /** Help text under the field, linked to it for screen readers. */
26
+ hint?: string;
27
+ /** Custom error message. Setting it marks the control invalid. */
28
+ error?: string;
29
+ /** Control size. */
30
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
31
+ /** The form cannot be submitted until this has a value. */
32
+ required?: boolean;
33
+ /** Not interactive and not submitted. */
34
+ disabled?: boolean;
35
+ /** Focusable and submitted, but not editable. */
36
+ readonly?: boolean;
37
+ /** Hide the label visually; it stays the accessible name. */
38
+ hideLabel?: boolean;
39
+ /** Colour role. Inherited by descendants unless they set their own. */
40
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
41
+ /** Surface style override for this component (and its descendants). */
42
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
43
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
44
+ density?: 'compact' | 'comfortable' | 'spacious';
45
+ motion?: 'none' | 'reduced' | 'full';
46
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
47
+ onPmInput?: (event: CustomEvent) => void;
48
+ onPmChange?: (event: CustomEvent) => void;
49
+ children?: React.ReactNode;
50
+ }
51
+ export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & {
52
+ children?: React.ReactNode;
53
+ } & React.RefAttributes<PmTimePicker>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const TimePicker = /* @__PURE__ */ createComponent('pm-time-picker', { onPmInput: 'pm-input', onPmChange: 'pm-change' }, () => import('@prismora/elements/time-picker'));
@@ -0,0 +1,19 @@
1
+ import type * as React from 'react';
2
+ import type { PmTimeline } from '@prismora/elements/timeline';
3
+ /** Vertical timeline (activity feeds, order history, changelogs). — `<pm-timeline>` */
4
+ export interface TimelineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Accessible name (and visible label where the component shows one). */
6
+ label?: string;
7
+ /** Colour role. Inherited by descendants unless they set their own. */
8
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
9
+ /** Surface style override for this component (and its descendants). */
10
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
11
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
12
+ density?: 'compact' | 'comfortable' | 'spacious';
13
+ motion?: 'none' | 'reduced' | 'full';
14
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
15
+ children?: React.ReactNode;
16
+ }
17
+ export declare const Timeline: React.ForwardRefExoticComponent<TimelineProps & {
18
+ children?: React.ReactNode;
19
+ } & React.RefAttributes<PmTimeline>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Timeline = /* @__PURE__ */ createComponent('pm-timeline', {}, () => import('@prismora/elements/timeline'));
@@ -0,0 +1,25 @@
1
+ import type * as React from 'react';
2
+ import type { PmTimelineItem } from '@prismora/elements/timeline';
3
+ /** One entry in a `<pm-timeline>`: a heading, time and details. — `<pm-timeline-item>` */
4
+ export interface TimelineItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Registered icon name (see `registerIcons`); an `icon` slot overrides it. */
6
+ icon?: string;
7
+ /** Title text. */
8
+ heading?: string;
9
+ /** Display time, e.g. "2 min ago". */
10
+ time?: string;
11
+ /** Machine-readable time for `<time datetime>`. */
12
+ datetime?: string;
13
+ /** Colour role. Inherited by descendants unless they set their own. */
14
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
15
+ /** Surface style override for this component (and its descendants). */
16
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
17
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
18
+ density?: 'compact' | 'comfortable' | 'spacious';
19
+ motion?: 'none' | 'reduced' | 'full';
20
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
21
+ children?: React.ReactNode;
22
+ }
23
+ export declare const TimelineItem: React.ForwardRefExoticComponent<TimelineItemProps & {
24
+ children?: React.ReactNode;
25
+ } & React.RefAttributes<PmTimelineItem>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const TimelineItem = /* @__PURE__ */ createComponent('pm-timeline-item', {}, () => import('@prismora/elements/timeline'));
@@ -0,0 +1,17 @@
1
+ import type * as React from 'react';
2
+ import type { PmToaster } from '@prismora/elements/toaster';
3
+ /** Where toasts appear and how many stack. Optional: `toast()` works without it. — `<pm-toaster>` */
4
+ export interface ToasterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Where toasts stack (default bottom-end). */
6
+ position?: 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
7
+ /** Most toasts shown at once; older ones leave first (default 4). */
8
+ max?: number;
9
+ /** Keep `position` on phones instead of centring. */
10
+ 'keep-position'?: boolean;
11
+ /** Accessible name of the region (default "Notifications"). */
12
+ label?: string;
13
+ children?: React.ReactNode;
14
+ }
15
+ export declare const Toaster: React.ForwardRefExoticComponent<ToasterProps & {
16
+ children?: React.ReactNode;
17
+ } & React.RefAttributes<PmToaster>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Toaster = /* @__PURE__ */ createComponent('pm-toaster', {}, () => import('@prismora/elements/toaster'));
@@ -0,0 +1,30 @@
1
+ import type * as React from 'react';
2
+ import type { PmToggle } from '@prismora/elements/toggle-group';
3
+ /** One toggle button (aria-pressed). Use inside `pm-toggle-group`, or standalone as an on/off button. — `<pm-toggle>` */
4
+ export interface ToggleProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Current value. */
6
+ value?: string;
7
+ /** Accessible name for icon-only toggles. */
8
+ label?: string;
9
+ /** Whether the toggle is on. */
10
+ pressed?: boolean;
11
+ /** Not interactive (and not submitted, for form controls). */
12
+ disabled?: boolean;
13
+ /** Size: xs, sm, md (default), lg or xl. */
14
+ size?: 'sm' | 'md' | 'lg';
15
+ /** Visual style. */
16
+ variant?: 'outline' | 'ghost' | 'soft';
17
+ /** Colour role. Inherited by descendants unless they set their own. */
18
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
19
+ /** Surface style override for this component (and its descendants). */
20
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
21
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
22
+ density?: 'compact' | 'comfortable' | 'spacious';
23
+ motion?: 'none' | 'reduced' | 'full';
24
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
25
+ onPmChange?: (event: CustomEvent) => void;
26
+ children?: React.ReactNode;
27
+ }
28
+ export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & {
29
+ children?: React.ReactNode;
30
+ } & React.RefAttributes<PmToggle>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Toggle = /* @__PURE__ */ createComponent('pm-toggle', { onPmChange: 'pm-change' }, () => import('@prismora/elements/toggle-group'));
@@ -0,0 +1,40 @@
1
+ import type * as React from 'react';
2
+ import type { PmToggleGroup } from '@prismora/elements/toggle-group';
3
+ /** Toggle button group (text formatting, filters, view options). — `<pm-toggle-group>` */
4
+ export interface ToggleGroupProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Help text under the field, linked to it for screen readers. */
6
+ hint?: string;
7
+ /** Custom error message. Setting it marks the field invalid. */
8
+ error?: string;
9
+ /** Pressed value(s); comma-separated with `multiple`. */
10
+ value?: string;
11
+ /** Form field name: the value is submitted under it. */
12
+ name?: string;
13
+ /** Accessible name of the group. */
14
+ label?: string;
15
+ /** Allow more than one value. */
16
+ multiple?: boolean;
17
+ /** Single mode: keep one toggle pressed (cannot clear). */
18
+ required?: boolean;
19
+ /** Size: xs, sm, md (default), lg or xl. */
20
+ size?: 'sm' | 'md' | 'lg';
21
+ /** Visual style. */
22
+ variant?: 'outline' | 'ghost' | 'soft';
23
+ /** Layout and arrow-key direction: horizontal or vertical. */
24
+ orientation?: 'horizontal' | 'vertical';
25
+ /** Not interactive (and not submitted, for form controls). */
26
+ disabled?: boolean;
27
+ /** Colour role. Inherited by descendants unless they set their own. */
28
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
29
+ /** Surface style override for this component (and its descendants). */
30
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
31
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
32
+ density?: 'compact' | 'comfortable' | 'spacious';
33
+ motion?: 'none' | 'reduced' | 'full';
34
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
35
+ onPmChange?: (event: CustomEvent) => void;
36
+ children?: React.ReactNode;
37
+ }
38
+ export declare const ToggleGroup: React.ForwardRefExoticComponent<ToggleGroupProps & {
39
+ children?: React.ReactNode;
40
+ } & React.RefAttributes<PmToggleGroup>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const ToggleGroup = /* @__PURE__ */ createComponent('pm-toggle-group', { onPmChange: 'pm-change' }, () => import('@prismora/elements/toggle-group'));
@@ -0,0 +1,13 @@
1
+ import type * as React from 'react';
2
+ import type { PmToolbar } from '@prismora/elements/toolbar';
3
+ /** Toolbar that groups related controls into one Tab stop, moved through with the arrow keys. — `<pm-toolbar>` */
4
+ export interface ToolbarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Accessible name of the toolbar. */
6
+ label?: string;
7
+ /** Arrow-key direction and layout. */
8
+ orientation?: 'horizontal' | 'vertical';
9
+ children?: React.ReactNode;
10
+ }
11
+ export declare const Toolbar: React.ForwardRefExoticComponent<ToolbarProps & {
12
+ children?: React.ReactNode;
13
+ } & React.RefAttributes<PmToolbar>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Toolbar = /* @__PURE__ */ createComponent('pm-toolbar', {}, () => import('@prismora/elements/toolbar'));
@@ -0,0 +1,11 @@
1
+ import type * as React from 'react';
2
+ import type { PmTooltip } from '@prismora/elements/tooltip';
3
+ /** Tooltip for a trigger referenced by `for`. — `<pm-tooltip>` */
4
+ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** id of the trigger element. */
6
+ for?: string;
7
+ children?: React.ReactNode;
8
+ }
9
+ export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & {
10
+ children?: React.ReactNode;
11
+ } & React.RefAttributes<PmTooltip>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Tooltip = /* @__PURE__ */ createComponent('pm-tooltip', {}, () => import('@prismora/elements/tooltip'));
@@ -0,0 +1,16 @@
1
+ import type * as React from 'react';
2
+ import type { PmTour } from '@prismora/elements/tour';
3
+ /** Product tour: a card that points at one part of the page at a time, with Back, Next and Skip. — `<pm-tour>` */
4
+ export interface TourProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** JSON array of `{ target, title, text }` (also a property). */
6
+ steps?: string;
7
+ /** Accessible name of the tour (default "Tour"). */
8
+ label?: string;
9
+ onPmStep?: (event: CustomEvent) => void;
10
+ onPmFinish?: (event: CustomEvent) => void;
11
+ onPmSkip?: (event: CustomEvent) => void;
12
+ children?: React.ReactNode;
13
+ }
14
+ export declare const Tour: React.ForwardRefExoticComponent<TourProps & {
15
+ children?: React.ReactNode;
16
+ } & React.RefAttributes<PmTour>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Tour = /* @__PURE__ */ createComponent('pm-tour', { onPmStep: 'pm-step', onPmFinish: 'pm-finish', onPmSkip: 'pm-skip' }, () => import('@prismora/elements/tour'));
@@ -0,0 +1,42 @@
1
+ import type * as React from 'react';
2
+ import type { PmTransfer } from '@prismora/elements/transfer';
3
+ /** Transfer list: move items between "available" and "selected" (assign permissions, pick table columns). — `<pm-transfer>` */
4
+ export interface TransferProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Every item that can be chosen. */
6
+ options?: unknown[];
7
+ /** Values of the selected items, in the order they were added. */
8
+ value?: string[];
9
+ /** Form field name: the value is submitted under it. */
10
+ name?: string;
11
+ /** Accessible name (and visible label where the component shows one). */
12
+ label?: string;
13
+ /** Help text under the lists. */
14
+ hint?: string;
15
+ /** Custom error message. Setting it marks the field invalid. */
16
+ error?: string;
17
+ /** At least one item must be selected. */
18
+ required?: boolean;
19
+ /** Not interactive (and not submitted, for form controls). */
20
+ disabled?: boolean;
21
+ /** Show a filter box above each list. */
22
+ searchable?: boolean;
23
+ /** Heading of the left list (default "Available"). */
24
+ sourceLabel?: string;
25
+ /** Heading of the right list (default "Selected"). */
26
+ targetLabel?: string;
27
+ /** Height of the lists: any CSS length (default 14rem). */
28
+ height?: string;
29
+ /** Colour role. Inherited by descendants unless they set their own. */
30
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
31
+ /** Surface style override for this component (and its descendants). */
32
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
33
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
34
+ density?: 'compact' | 'comfortable' | 'spacious';
35
+ motion?: 'none' | 'reduced' | 'full';
36
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
37
+ onPmChange?: (event: CustomEvent) => void;
38
+ children?: React.ReactNode;
39
+ }
40
+ export declare const Transfer: React.ForwardRefExoticComponent<TransferProps & {
41
+ children?: React.ReactNode;
42
+ } & React.RefAttributes<PmTransfer>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Transfer = /* @__PURE__ */ createComponent('pm-transfer', { onPmChange: 'pm-change' }, () => import('@prismora/elements/transfer'));
@@ -0,0 +1,45 @@
1
+ import type * as React from 'react';
2
+ import type { PmTree } from '@prismora/elements/tree';
3
+ /** Tree view (file browsers, nested navigation). — `<pm-tree>` */
4
+ export interface TreeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Accessible name (and visible label where the component shows one). */
6
+ label?: string;
7
+ /** Value of the selected item. */
8
+ value?: string;
9
+ /** `single` (default) or `checkbox` (tri-state, cascading). */
10
+ selection?: 'single' | 'checkbox';
11
+ /** Show only items whose label contains this text (plus their ancestors). */
12
+ filter?: string;
13
+ /** Shown when the filter matches nothing. */
14
+ emptyText?: string;
15
+ /** URL for an item's children; `{value}` is replaced with the expanded item's value. Response: JSON. */
16
+ src?: string;
17
+ /** Where the list is in the response (dotted path; empty = the response itself). */
18
+ childrenPath?: string;
19
+ /** Item field for the label (default `label`, then `name`, then `title`). */
20
+ labelKey?: string;
21
+ /** Item field for the value (default `value`, then `id`). */
22
+ valueKey?: string;
23
+ /** Item field that says it has children to load on expand (default `lazy`, then `hasChildren`). */
24
+ lazyKey?: string;
25
+ /** Item field with a registered icon name (default `icon`). */
26
+ iconKey?: string;
27
+ /** Item field with nested child items (default `children`). */
28
+ childrenKey?: string;
29
+ /** Colour role. Inherited by descendants unless they set their own. */
30
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
31
+ /** Surface style override for this component (and its descendants). */
32
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
33
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
34
+ density?: 'compact' | 'comfortable' | 'spacious';
35
+ motion?: 'none' | 'reduced' | 'full';
36
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
37
+ onPmSelect?: (event: CustomEvent) => void;
38
+ onPmCheck?: (event: CustomEvent) => void;
39
+ onPmLoad?: (event: CustomEvent) => void;
40
+ onPmLoadError?: (event: CustomEvent) => void;
41
+ children?: React.ReactNode;
42
+ }
43
+ export declare const Tree: React.ForwardRefExoticComponent<TreeProps & {
44
+ children?: React.ReactNode;
45
+ } & React.RefAttributes<PmTree>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const Tree = /* @__PURE__ */ createComponent('pm-tree', { onPmSelect: 'pm-select', onPmCheck: 'pm-check', onPmLoad: 'pm-load', onPmLoadError: 'pm-load-error' }, () => import('@prismora/elements/tree'));
@@ -0,0 +1,38 @@
1
+ import type * as React from 'react';
2
+ import type { PmTreeItem } from '@prismora/elements/tree';
3
+ /** Tree node. Nest `pm-tree-item`s inside to make a branch. — `<pm-tree-item>` */
4
+ export interface TreeItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Registered icon name (see `registerIcons`); an `icon` slot overrides it. */
6
+ icon?: string;
7
+ /** Accessible name (and visible label where the component shows one). */
8
+ label?: string;
9
+ /** Current value. */
10
+ value?: string;
11
+ /** Whether its children are shown. */
12
+ expanded?: boolean;
13
+ /** Whether this item is selected. */
14
+ selected?: boolean;
15
+ /** Not interactive (and not submitted, for form controls). */
16
+ disabled?: boolean;
17
+ /** Checkbox state (tree `selection="checkbox"`). */
18
+ checked?: boolean;
19
+ /** Some (not all) children are checked. Set by the tree. */
20
+ indeterminate?: boolean;
21
+ /** Has children that load on first expand (`pm-load` on the tree). */
22
+ lazy?: boolean;
23
+ /** Children are loading (cleared when they arrive). */
24
+ loading?: boolean;
25
+ /** Colour role. Inherited by descendants unless they set their own. */
26
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
27
+ /** Surface style override for this component (and its descendants). */
28
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
29
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
30
+ density?: 'compact' | 'comfortable' | 'spacious';
31
+ motion?: 'none' | 'reduced' | 'full';
32
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
33
+ onPmToggle?: (event: CustomEvent) => void;
34
+ children?: React.ReactNode;
35
+ }
36
+ export declare const TreeItem: React.ForwardRefExoticComponent<TreeItemProps & {
37
+ children?: React.ReactNode;
38
+ } & React.RefAttributes<PmTreeItem>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const TreeItem = /* @__PURE__ */ createComponent('pm-tree-item', { onPmToggle: 'pm-toggle' }, () => import('@prismora/elements/tree'));
@@ -0,0 +1,46 @@
1
+ import type * as React from 'react';
2
+ import type { PmTreeSelect } from '@prismora/elements/tree-select';
3
+ /** Tree select: choose from a hierarchy shown as an expandable tree in a dropdown (folders, departments, categories). — `<pm-tree-select>` */
4
+ export interface TreeSelectProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** Nested options: `{ value, label, children? }`. Values must be unique across all levels. */
6
+ options?: unknown[];
7
+ /** The chosen value (single choice). */
8
+ value?: string;
9
+ /** The ticked values (with `multiple`): the items without children. */
10
+ values?: string[];
11
+ /** Allow several choices, with tick boxes. */
12
+ multiple?: boolean;
13
+ /** Form field name: the value is submitted under it. */
14
+ name?: string;
15
+ /** Accessible name (and visible label where the component shows one). */
16
+ label?: string;
17
+ /** Hint text shown while empty (not a replacement for `label`). */
18
+ placeholder?: string;
19
+ /** Help text under the field. */
20
+ hint?: string;
21
+ /** Custom error message. Setting it marks the field invalid. */
22
+ error?: string;
23
+ /** Size: xs, sm, md (default), lg or xl. */
24
+ size?: 'sm' | 'md' | 'lg';
25
+ /** The form cannot be submitted until this has a value. */
26
+ required?: boolean;
27
+ /** Not interactive (and not submitted, for form controls). */
28
+ disabled?: boolean;
29
+ /** Show a search box that filters the tree. */
30
+ searchable?: boolean;
31
+ /** Start with every branch open. */
32
+ expandAll?: boolean;
33
+ /** Colour role. Inherited by descendants unless they set their own. */
34
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
35
+ /** Surface style override for this component (and its descendants). */
36
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
37
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
38
+ density?: 'compact' | 'comfortable' | 'spacious';
39
+ motion?: 'none' | 'reduced' | 'full';
40
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
41
+ onPmChange?: (event: CustomEvent) => void;
42
+ children?: React.ReactNode;
43
+ }
44
+ export declare const TreeSelect: React.ForwardRefExoticComponent<TreeSelectProps & {
45
+ children?: React.ReactNode;
46
+ } & React.RefAttributes<PmTreeSelect>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const TreeSelect = /* @__PURE__ */ createComponent('pm-tree-select', { onPmChange: 'pm-change' }, () => import('@prismora/elements/tree-select'));
@@ -0,0 +1,31 @@
1
+ import type * as React from 'react';
2
+ import type { PmVirtualList } from '@prismora/elements/virtual-list';
3
+ /** List for thousands of rows: only the rows in view exist in the page, so scrolling stays fast. — `<pm-virtual-list>` */
4
+ export interface VirtualListProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
5
+ /** The rows: strings, numbers or objects (objects need `renderItem`, or have a `label`). */
6
+ items?: unknown[];
7
+ /** Height of every row in pixels (default 40). */
8
+ itemHeight?: number;
9
+ /** Height of the list: any CSS length (default 20rem). */
10
+ height?: string;
11
+ /** Accessible name of the list. */
12
+ label?: string;
13
+ /** Extra rows kept above and below the visible ones (default 4). */
14
+ overscan?: number;
15
+ /** Shown when there are no items. */
16
+ emptyText?: string;
17
+ /** Colour role. Inherited by descendants unless they set their own. */
18
+ tone?: 'accent' | 'secondary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
19
+ /** Surface style override for this component (and its descendants). */
20
+ surface?: 'flat' | 'outline' | 'gradient' | 'glass' | 'neumorphic';
21
+ radius?: 'none' | 'sharp' | 'rounded' | 'soft' | 'pill';
22
+ density?: 'compact' | 'comfortable' | 'spacious';
23
+ motion?: 'none' | 'reduced' | 'full';
24
+ elevation?: '0' | '1' | '2' | '3' | '4' | '5';
25
+ onPmEnd?: (event: CustomEvent) => void;
26
+ onPmSelect?: (event: CustomEvent) => void;
27
+ children?: React.ReactNode;
28
+ }
29
+ export declare const VirtualList: React.ForwardRefExoticComponent<VirtualListProps & {
30
+ children?: React.ReactNode;
31
+ } & React.RefAttributes<PmVirtualList>>;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import { createComponent } from '../create-component.js';
4
+ export const VirtualList = /* @__PURE__ */ createComponent('pm-virtual-list', { onPmEnd: 'pm-end', onPmSelect: 'pm-select' }, () => import('@prismora/elements/virtual-list'));
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Wrap a custom element as a React component: forwards refs, maps camelCase `onPmX` props
4
+ * to DOM event listeners, and passes everything else through (React 19 sets properties).
5
+ * `load` imports only this element's module, on the client (SSR-safe, tree-shakable).
6
+ */
7
+ export declare function createComponent<E extends HTMLElement, P extends object>(tag: string, events: Record<string, string>, load: () => Promise<unknown>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P & {
8
+ children?: React.ReactNode;
9
+ }> & React.RefAttributes<E>>;
@@ -0,0 +1,51 @@
1
+ // Generated by tools/codegen-wrappers.ts from components.json — do not edit.
2
+ 'use client';
3
+ import * as React from 'react';
4
+ /**
5
+ * Wrap a custom element as a React component: forwards refs, maps camelCase `onPmX` props
6
+ * to DOM event listeners, and passes everything else through (React 19 sets properties).
7
+ * `load` imports only this element's module, on the client (SSR-safe, tree-shakable).
8
+ */
9
+ export function createComponent(tag, events, load) {
10
+ let loaded = false;
11
+ const Component = React.forwardRef(function PrismoraComponent(props, forwarded) {
12
+ const local = React.useRef(null);
13
+ const handlers = {};
14
+ const rest = {};
15
+ for (const [k, v] of Object.entries(props)) {
16
+ if (k in events)
17
+ handlers[events[k]] = v;
18
+ else if (v === false)
19
+ continue; // omit false booleans so attributes are absent
20
+ else
21
+ rest[k] = v;
22
+ }
23
+ const latest = React.useRef(handlers);
24
+ latest.current = handlers;
25
+ React.useEffect(() => {
26
+ if (!loaded) {
27
+ loaded = true;
28
+ void load();
29
+ }
30
+ const el = local.current;
31
+ if (!el)
32
+ return;
33
+ const names = Object.values(events);
34
+ const listener = (e) => latest.current[e.type]?.(e);
35
+ for (const n of names)
36
+ el.addEventListener(n, listener);
37
+ return () => { for (const n of names)
38
+ el.removeEventListener(n, listener); };
39
+ }, []);
40
+ const setRef = React.useCallback((el) => {
41
+ local.current = el;
42
+ if (typeof forwarded === 'function')
43
+ forwarded(el);
44
+ else if (forwarded)
45
+ forwarded.current = el;
46
+ }, [forwarded]);
47
+ return React.createElement(tag, { ...rest, ref: setRef }, props.children);
48
+ });
49
+ Component.displayName = tag;
50
+ return Component;
51
+ }