@webority/ui-react 0.3.0 → 0.5.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 (64) hide show
  1. package/README.md +23 -0
  2. package/dist/types/components/ActionIcon.d.ts +27 -0
  3. package/dist/types/components/AppAccordion.d.ts +27 -0
  4. package/dist/types/components/AppAlert.d.ts +21 -0
  5. package/dist/types/components/AppAutocomplete.d.ts +48 -0
  6. package/dist/types/components/AppAvatar.d.ts +13 -0
  7. package/dist/types/components/AppBadge.d.ts +19 -0
  8. package/dist/types/components/AppButton.d.ts +13 -0
  9. package/dist/types/components/AppCallout.d.ts +19 -0
  10. package/dist/types/components/AppCard.d.ts +29 -0
  11. package/dist/types/components/AppCheckbox.d.ts +17 -0
  12. package/dist/types/components/AppChip.d.ts +37 -0
  13. package/dist/types/components/AppChoiceCard.d.ts +42 -0
  14. package/dist/types/components/AppChoiceChip.d.ts +26 -0
  15. package/dist/types/components/AppColorField.d.ts +35 -0
  16. package/dist/types/components/AppCompareTable.d.ts +32 -0
  17. package/dist/types/components/AppConfirmDialog.d.ts +27 -0
  18. package/dist/types/components/AppDataTable.d.ts +48 -0
  19. package/dist/types/components/AppDatePicker.d.ts +43 -0
  20. package/dist/types/components/AppDropdown.d.ts +11 -0
  21. package/dist/types/components/AppEmptyState.d.ts +31 -0
  22. package/dist/types/components/AppFileAttachment.d.ts +36 -0
  23. package/dist/types/components/AppFilePicker.d.ts +27 -0
  24. package/dist/types/components/AppInfoList.d.ts +24 -0
  25. package/dist/types/components/AppInfoTip.d.ts +4 -0
  26. package/dist/types/components/AppInput.d.ts +31 -0
  27. package/dist/types/components/AppKpiTile.d.ts +22 -0
  28. package/dist/types/components/AppLogoPicker.d.ts +31 -0
  29. package/dist/types/components/AppModal.d.ts +35 -0
  30. package/dist/types/components/AppMultiSelect.d.ts +38 -0
  31. package/dist/types/components/AppPageHeader.d.ts +22 -0
  32. package/dist/types/components/AppPhoneNumberInput.d.ts +13 -0
  33. package/dist/types/components/AppPricingCard.d.ts +38 -0
  34. package/dist/types/components/AppRadio.d.ts +17 -0
  35. package/dist/types/components/AppRepeater.d.ts +40 -0
  36. package/dist/types/components/AppResourceCard.d.ts +28 -0
  37. package/dist/types/components/AppSearch.d.ts +20 -0
  38. package/dist/types/components/AppSegmented.d.ts +35 -0
  39. package/dist/types/components/AppSelect.d.ts +19 -0
  40. package/dist/types/components/AppSelectMini.d.ts +11 -0
  41. package/dist/types/components/AppShell.d.ts +52 -0
  42. package/dist/types/components/AppSidebarMenu.d.ts +19 -0
  43. package/dist/types/components/AppSkeleton.d.ts +21 -0
  44. package/dist/types/components/AppSpinner.d.ts +17 -0
  45. package/dist/types/components/AppSplash.d.ts +25 -0
  46. package/dist/types/components/AppStatusBadge.d.ts +15 -0
  47. package/dist/types/components/AppStepper.d.ts +35 -0
  48. package/dist/types/components/AppSwitch.d.ts +17 -0
  49. package/dist/types/components/AppTableEmptyState.d.ts +15 -0
  50. package/dist/types/components/AppTablePagination.d.ts +31 -0
  51. package/dist/types/components/AppTabs.d.ts +30 -0
  52. package/dist/types/components/AppTextarea.d.ts +22 -0
  53. package/dist/types/components/AppTimeline.d.ts +26 -0
  54. package/dist/types/components/Icon.d.ts +7 -0
  55. package/dist/types/components/ModalIcons.d.ts +33 -0
  56. package/dist/types/components/RequiredMark.d.ts +7 -0
  57. package/dist/types/components/toast.d.ts +3 -0
  58. package/dist/types/index.d.ts +56 -0
  59. package/dist/types/lib/useListboxMenu.d.ts +46 -0
  60. package/dist/types/lib/usePagination.d.ts +11 -0
  61. package/dist/types/lib/usePopover.d.ts +7 -0
  62. package/dist/types/lib/useTableSort.d.ts +25 -0
  63. package/dist/ui-react.js +1243 -896
  64. package/package.json +13 -10
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @webority/ui-react
2
+
3
+ Webority's internal React component library — the `App*` primitives, built on
4
+ `@webority/theme`.
5
+
6
+ Published publicly so `npm install` needs no private registry. Built for Webority
7
+ products; no support commitment outside them.
8
+
9
+ ## Use
10
+
11
+ ```bash
12
+ npm install @webority/ui-react @webority/theme bootstrap react-bootstrap
13
+ ```
14
+
15
+ Import the theme once (see `@webority/theme` for the SCSS chain), then:
16
+
17
+ ```jsx
18
+ import { AppButton } from '@webority/ui-react';
19
+
20
+ <AppButton variant="primary">Save changes</AppButton>;
21
+ ```
22
+
23
+ Component catalogue: <https://ui.webority.dev>
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The icon-only action button used in table rows and toolbars — edit, delete,
3
+ * download. A real <button> on the theme's `.u-action` disc, so the hit area,
4
+ * hover tint and disabled state come from the design system rather than each
5
+ * screen re-inventing a bare icon button.
6
+ *
7
+ * `label` is required: an icon-only control with no accessible name is
8
+ * unusable with a screen reader, and it doubles as the hover tooltip.
9
+ *
10
+ * @param {object} props
11
+ * @param {string} props.icon glyph name (see Icon)
12
+ * @param {string} props.label accessible name + tooltip
13
+ * @param {boolean} [props.danger] destructive tint
14
+ * @param {boolean} [props.disabled]
15
+ * @param {number} [props.size=20]
16
+ * @param {() => void} [props.onClick]
17
+ * @param {string} [props.className]
18
+ */
19
+ export default function ActionIcon({ icon, label, danger, disabled, size, onClick, className, ...rest }: {
20
+ icon: string;
21
+ label: string;
22
+ danger?: boolean;
23
+ disabled?: boolean;
24
+ size?: number;
25
+ onClick?: () => void;
26
+ className?: string;
27
+ }): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Collapsible panes — an FAQ list, a set of grouped settings, a "more detail"
3
+ * disclosure. Renders the theme's `.faq-list` markup, the same as the Razor
4
+ * `<app-accordion>`.
5
+ *
6
+ * Height animates through `grid-template-rows: 0fr -> 1fr` in CSS, so a pane
7
+ * opens to its natural height with no measuring and no max-height guess. This
8
+ * component only tracks which panes are open.
9
+ *
10
+ * @param {object} props
11
+ * @param {{ key?: string, title: import('react').ReactNode, content: import('react').ReactNode, open?: boolean }[]} props.items
12
+ * @param {boolean} [props.multiple=false] Allow more than one pane open at a time.
13
+ * @param {string} [props.id] Prefix for the generated pane ids. Set it when a pane
14
+ * needs a stable anchor to deep-link to; otherwise a unique one is generated.
15
+ * @param {string} [props.className]
16
+ */
17
+ export default function AppAccordion({ items, multiple, id, className }: {
18
+ items: {
19
+ key?: string;
20
+ title: import('react').ReactNode;
21
+ content: import('react').ReactNode;
22
+ open?: boolean;
23
+ }[];
24
+ multiple?: boolean;
25
+ id?: string;
26
+ className?: string;
27
+ }): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The shared status banner — wraps react-bootstrap <Alert> (same `.alert` /
3
+ * `.alert-{variant}` classes Bootstrap + the theme already style). Screens must
4
+ * use this instead of raw `className="alert alert-…"`.
5
+ *
6
+ * @param {object} props
7
+ * @param {"info"|"success"|"warning"|"danger"} [props.variant="info"]
8
+ * @param {import('react').ReactNode} props.children
9
+ * @param {string} [props.className]
10
+ * @param {() => void} [props.onClose] Called when dismissed
11
+ * @param {boolean} [props.dismissible] Show the close button (defaults to true when onClose is set)
12
+ * @param {"alert"|"status"} [props.role="alert"] Use "status" for non-assertive notices
13
+ */
14
+ export default function AppAlert({ variant, children, className, onClose, dismissible, role, ...rest }: {
15
+ variant?: "info" | "success" | "warning" | "danger";
16
+ children: import('react').ReactNode;
17
+ className?: string;
18
+ onClose?: () => void;
19
+ dismissible?: boolean;
20
+ role?: "alert" | "status";
21
+ }): import("react").JSX.Element;
@@ -0,0 +1,48 @@
1
+ import '@webority/ui-elements';
2
+ /**
3
+ * Searchable autocomplete over the shared `<wui-autocomplete>` element.
4
+ *
5
+ * Two modes:
6
+ * - **static** — pass `options` (`[{ value, label }]`); filtering is client-side.
7
+ * - **remote** — pass an async `loadOptions(query) => Promise<options>`; the field
8
+ * debounces typing, shows a spinner while your promise is in flight, then lists the
9
+ * results. You own the fetch; the component owns the UX.
10
+ *
11
+ * @param {object} props
12
+ * @param {string} [props.value] Selected option value.
13
+ * @param {(value: string) => void} [props.onChange]
14
+ * @param {{value: string, label: string}[]} [props.options] Static options.
15
+ * @param {(query: string) => Promise<{value: string, label: string}[]>} [props.loadOptions] Remote loader.
16
+ * @param {string} [props.placeholder]
17
+ * @param {number} [props.minChars] Min chars before a remote search fires (default 1 in remote mode).
18
+ * @param {number} [props.debounce] Debounce ms for remote search (default 250).
19
+ * @param {boolean} [props.disabled]
20
+ * @param {string} [props.name]
21
+ * @param {import('react').ReactNode} [props.label]
22
+ * @param {string} [props.error]
23
+ * @param {string} [props.hint]
24
+ * @param {boolean} [props.required]
25
+ * @param {string} [props.fieldClassName]
26
+ */
27
+ export default function AppAutocomplete({ value, onChange, options, loadOptions, placeholder, minChars, debounce, disabled, name, label, error, hint, required, fieldClassName, }: {
28
+ value?: string;
29
+ onChange?: (value: string) => void;
30
+ options?: {
31
+ value: string;
32
+ label: string;
33
+ }[];
34
+ loadOptions?: (query: string) => Promise<{
35
+ value: string;
36
+ label: string;
37
+ }[]>;
38
+ placeholder?: string;
39
+ minChars?: number;
40
+ debounce?: number;
41
+ disabled?: boolean;
42
+ name?: string;
43
+ label?: import('react').ReactNode;
44
+ error?: string;
45
+ hint?: string;
46
+ required?: boolean;
47
+ fieldClassName?: string;
48
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Profile photo or initials.
3
+ *
4
+ * @param {object} props
5
+ * @param {string} [props.name]
6
+ * @param {string} [props.src]
7
+ * @param {string} [props.className]
8
+ */
9
+ export default function AppAvatar({ name, src, className }: {
10
+ name?: string;
11
+ src?: string;
12
+ className?: string;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The shared tag/chip — wraps react-bootstrap <Badge> with theme `.badge-*` classes.
3
+ * AppStatusBadge stays on `.status-label` — a different visual taxonomy.
4
+ *
5
+ * `tone` (semantic colour), not `variant` — `variant` is reserved across the
6
+ * library for emphasis/structure (see AppButton), `tone` for semantic colour.
7
+ *
8
+ * @param {object} props
9
+ * @param {import('react').ReactNode} props.children
10
+ * @param {"primary"|"success"|"warn"|"danger"|"info"} [props.tone]
11
+ * @param {boolean} [props.dot=false]
12
+ * @param {string} [props.className]
13
+ */
14
+ export default function AppBadge({ children, tone, dot, className, ...rest }: {
15
+ children: import('react').ReactNode;
16
+ tone?: "primary" | "success" | "warn" | "danger" | "info";
17
+ dot?: boolean;
18
+ className?: string;
19
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export default function AppButton({ children, variant, size, type, loading, disabled, block, leftIcon, rightIcon, className, ...rest }: {
2
+ [x: string]: any;
3
+ block?: boolean;
4
+ children: any;
5
+ className?: string;
6
+ disabled?: boolean;
7
+ leftIcon?: any;
8
+ loading?: boolean;
9
+ rightIcon?: any;
10
+ size?: string;
11
+ type?: string;
12
+ variant?: string;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A soft branded aside that EXPLAINS something — how a calculation works, what a
3
+ * setting affects, what happens next in a flow.
4
+ *
5
+ * Distinct from `AppAlert`, and the difference is not cosmetic: an alert reports a
6
+ * *state* ("we couldn't save", "your trial ends in 3 days") and goes away when that
7
+ * state does. A callout is part of the page's content and stays regardless. Using an
8
+ * alert for guidance teaches users to ignore alerts.
9
+ *
10
+ * @param {object} props
11
+ * @param {import('react').ReactNode} props.children The explanation. `<strong>` is styled.
12
+ * @param {string} [props.icon='info'] Leading glyph. Pass `null` for none.
13
+ * @param {string} [props.className]
14
+ */
15
+ export default function AppCallout({ children, icon, className }: {
16
+ children: import('react').ReactNode;
17
+ icon?: string;
18
+ className?: string;
19
+ }): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The shared surface card — wraps react-bootstrap <Card>.
3
+ *
4
+ * @param {object} props
5
+ * @param {import('react').ReactNode} [props.title]
6
+ * @param {string} [props.titleClassName]
7
+ * @param {import('react').ReactNode} [props.header]
8
+ * @param {import('react').ReactNode} [props.headerExtra]
9
+ * @param {import('react').ReactNode} [props.headerActions]
10
+ * @param {import('react').ReactNode} props.children
11
+ * @param {string} [props.className]
12
+ * @param {string} [props.bodyClassName]
13
+ * @param {string} [props.headerClassName]
14
+ * @param {boolean} [props.body=true]
15
+ * @param {boolean} [props.lifted=false] Raised/hover treatment (.card-lifted).
16
+ */
17
+ export default function AppCard({ title, titleClassName, header, headerExtra, headerActions, children, className, bodyClassName, headerClassName, body, lifted, ...rest }: {
18
+ title?: import('react').ReactNode;
19
+ titleClassName?: string;
20
+ header?: import('react').ReactNode;
21
+ headerExtra?: import('react').ReactNode;
22
+ headerActions?: import('react').ReactNode;
23
+ children: import('react').ReactNode;
24
+ className?: string;
25
+ bodyClassName?: string;
26
+ headerClassName?: string;
27
+ body?: boolean;
28
+ lifted?: boolean;
29
+ }): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared checkbox on the Bootstrap `.form-check` markup — the same structure the
3
+ * Razor <app-checkbox> emits, so both surfaces render identically.
4
+ *
5
+ * The label is bound to the input with id/htmlFor rather than react-bootstrap's
6
+ * `label` prop: that rendered a <label> with no `for`, so clicking the text did
7
+ * nothing and screen readers never announced the name.
8
+ *
9
+ * @param {object} props
10
+ * @param {import('react').ReactNode} [props.label]
11
+ * @param {string} [props.id]
12
+ * @param {string} [props.name]
13
+ * @param {string} [props.className]
14
+ * @param {import('react').Ref} [ref]
15
+ */
16
+ declare const AppCheckbox: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
17
+ export default AppCheckbox;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Token / tag chip — a compact labelled token, optionally with a leading icon or
3
+ * avatar and a dismiss button. Distinct from `AppChoiceChip` (a *selectable* pill):
4
+ * `AppChip` is a *display / removable* token — the thing a multi-select renders for
5
+ * each chosen value, a filter tag, or a removable label.
6
+ *
7
+ * Behaviour follows the props present:
8
+ * - `onRemove` → renders a trailing dismiss ✕ (a removable token).
9
+ * - `onClick` → the chip body is a button (a clickable filter chip).
10
+ * - neither → a static, presentational chip.
11
+ *
12
+ * @param {object} props
13
+ * @param {import('react').ReactNode} [props.label] Chip text (or use `children`).
14
+ * @param {import('react').ReactNode} [props.children]
15
+ * @param {"neutral"|"primary"|"success"|"warning"|"danger"|"info"} [props.tone="neutral"]
16
+ * @param {"sm"|"md"} [props.size="md"]
17
+ * @param {string} [props.leadingIcon] Iconsax/Bootstrap icon name for a leading glyph.
18
+ * @param {string|import('react').ReactNode} [props.avatar] Leading avatar — an image URL or a node.
19
+ * @param {() => void} [props.onRemove] Present → shows the dismiss ✕.
20
+ * @param {() => void} [props.onClick] Present → the chip body is clickable.
21
+ * @param {boolean} [props.disabled=false]
22
+ * @param {string} [props.removeLabel] aria-label for the dismiss button.
23
+ * @param {string} [props.className]
24
+ */
25
+ export default function AppChip({ label, children, tone, size, leadingIcon, avatar, onRemove, onClick, disabled, removeLabel, className, }: {
26
+ label?: import('react').ReactNode;
27
+ children?: import('react').ReactNode;
28
+ tone?: "neutral" | "primary" | "success" | "warning" | "danger" | "info";
29
+ size?: "sm" | "md";
30
+ leadingIcon?: string;
31
+ avatar?: string | import('react').ReactNode;
32
+ onRemove?: () => void;
33
+ onClick?: () => void;
34
+ disabled?: boolean;
35
+ removeLabel?: string;
36
+ className?: string;
37
+ }): import("react").JSX.Element;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Radio choice *card* (structure picker). Not a dropdown.
3
+ *
4
+ * @param {object} props
5
+ * @param {string} props.name
6
+ * @param {boolean} [props.multiple=false] Render as a checkbox (multi-select) rather than a radio.
7
+ * @param {string} props.value
8
+ * @param {boolean} props.checked
9
+ * @param {(e: import('react').ChangeEvent<HTMLInputElement>) => void} props.onChange
10
+ * @param {string} [props.icon]
11
+ * @param {import('react').ReactNode} [props.iconNode]
12
+ * @param {number} [props.iconSize=18]
13
+ * @param {string} [props.image] Image URL — renders an image-forward card (overrides `icon`).
14
+ * @param {string} [props.imageAlt]
15
+ * @param {import('react').ReactNode} [props.children] Custom body, overriding title/description.
16
+ * @param {import('react').ReactNode} props.title
17
+ * @param {import('react').ReactNode} [props.description]
18
+ * @param {string} [props.checkIcon="check"]
19
+ * @param {number} [props.checkSize=12]
20
+ * @param {string} [props.className]
21
+ */
22
+ export default function AppChoiceCard({ name, multiple, value, checked, onChange, icon, iconNode, // custom icon element; overrides the `icon` name when provided
23
+ iconSize, image, // image URL — renders an image-forward card (overrides icon)
24
+ imageAlt, children, // custom body template — overrides title/description when provided
25
+ title, description, checkIcon, checkSize, className, }: {
26
+ name: string;
27
+ multiple?: boolean;
28
+ value: string;
29
+ checked: boolean;
30
+ onChange: (e: import('react').ChangeEvent<HTMLInputElement>) => void;
31
+ icon?: string;
32
+ iconNode?: import('react').ReactNode;
33
+ iconSize?: number;
34
+ image?: string;
35
+ imageAlt?: string;
36
+ children?: import('react').ReactNode;
37
+ title: import('react').ReactNode;
38
+ description?: import('react').ReactNode;
39
+ checkIcon?: string;
40
+ checkSize?: number;
41
+ className?: string;
42
+ }): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Selectable chip for multi/single-select pills (.choice-chip).
3
+ *
4
+ * @param {object} props
5
+ * @param {boolean} [props.multiple=true] Checkbox (multi-select) when true, radio when false.
6
+ * @param {import('react').ReactNode} [props.label] Chip text (or use `children`).
7
+ * @param {string} [props.name]
8
+ * @param {string} [props.value]
9
+ * @param {boolean} props.checked
10
+ * @param {(e: import('react').ChangeEvent<HTMLInputElement>) => void} props.onChange
11
+ * @param {import('react').ReactNode} props.children
12
+ * @param {import('react').ReactNode} [props.count] A matching-row count, e.g. "Active 12".
13
+ * Shown as a small badge that inverts when the chip is selected.
14
+ * @param {string} [props.className]
15
+ */
16
+ export default function AppChoiceChip({ multiple, label, name, value, checked, onChange, children, count, className, }: {
17
+ multiple?: boolean;
18
+ label?: import('react').ReactNode;
19
+ name?: string;
20
+ value?: string;
21
+ checked: boolean;
22
+ onChange: (e: import('react').ChangeEvent<HTMLInputElement>) => void;
23
+ children: import('react').ReactNode;
24
+ count?: import('react').ReactNode;
25
+ className?: string;
26
+ }): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * A colour picker field — the native swatch beside a hex text input, kept in sync.
3
+ * Used for brand/accent settings, chart series colours, tag colours.
4
+ *
5
+ * Both halves edit the same value: the swatch opens the OS picker, the text box
6
+ * takes a pasted hex. The text box is the accessible path — a colour input alone
7
+ * cannot be typed into, so a keyboard or screen-reader user would be stuck.
8
+ *
9
+ * The swatch only accepts a full 6-digit hex, so it is updated from the text box
10
+ * once the value is complete rather than on every keystroke.
11
+ *
12
+ * @param {object} props
13
+ * @param {string} props.value Hex colour, e.g. "#4F46E5".
14
+ * @param {(hex: string) => void} props.onChange
15
+ * @param {import('react').ReactNode} [props.label]
16
+ * @param {boolean} [props.required=false]
17
+ * @param {string} [props.error]
18
+ * @param {string} [props.hint]
19
+ * @param {string} [props.name]
20
+ * @param {string} [props.id]
21
+ * @param {boolean} [props.disabled=false]
22
+ * @param {string} [props.className]
23
+ */
24
+ export default function AppColorField({ value, onChange, label, required, error, hint, name, id, disabled, className, }: {
25
+ value: string;
26
+ onChange: (hex: string) => void;
27
+ label?: import('react').ReactNode;
28
+ required?: boolean;
29
+ error?: string;
30
+ hint?: string;
31
+ name?: string;
32
+ id?: string;
33
+ disabled?: boolean;
34
+ className?: string;
35
+ }): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * A feature-comparison table — one row per capability, one column per option, with
3
+ * the recommended column tinted so it reads without a legend. The marketing
4
+ * "us vs them" table and a plan-feature matrix are the same shape.
5
+ *
6
+ * A cell value of `true`/`false` renders a tick or a dash; anything else renders
7
+ * as-is, so a column can mix "yes/no" with "5 GB".
8
+ *
9
+ * For tabular DATA (sortable, paginated rows of records) use `AppDataTable` —
10
+ * this is an editorial comparison, not a grid.
11
+ *
12
+ * @param {object} props
13
+ * @param {{ label: string, highlight?: boolean }[]} props.columns The first column is
14
+ * the feature-name column and normally has an empty label.
15
+ * @param {{ key?: string, label: string, values: (boolean|import('react').ReactNode)[] }[]} props.rows
16
+ * `values` aligns with `columns` after the first (feature-name) column.
17
+ * @param {string} [props.caption] Accessible description of what is being compared.
18
+ * @param {string} [props.className]
19
+ */
20
+ export default function AppCompareTable({ columns, rows, caption, className }: {
21
+ columns: {
22
+ label: string;
23
+ highlight?: boolean;
24
+ }[];
25
+ rows: {
26
+ key?: string;
27
+ label: string;
28
+ values: (boolean | import('react').ReactNode)[];
29
+ }[];
30
+ caption?: string;
31
+ className?: string;
32
+ }): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Destructive/confirm step built on AppModal.
3
+ *
4
+ * @param {object} props
5
+ * @param {boolean} props.open
6
+ * @param {string} props.title
7
+ * @param {import('react').ReactNode} [props.message]
8
+ * @param {string} [props.confirmLabel="Confirm"]
9
+ * @param {boolean} [props.danger=false]
10
+ * @param {string} [props.tone]
11
+ * @param {string} [props.confirmPhrase]
12
+ * @param {() => void} props.onConfirm
13
+ * @param {string} [props.cancelLabel="Cancel"]
14
+ * @param {() => void} props.onClose
15
+ */
16
+ export default function AppConfirmDialog({ open, title, message, confirmLabel, cancelLabel, danger, tone, confirmPhrase, onConfirm, onClose, }: {
17
+ open: boolean;
18
+ title: string;
19
+ message?: import('react').ReactNode;
20
+ confirmLabel?: string;
21
+ danger?: boolean;
22
+ tone?: string;
23
+ confirmPhrase?: string;
24
+ onConfirm: () => void;
25
+ cancelLabel?: string;
26
+ onClose: () => void;
27
+ }): import("react").JSX.Element;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Shared ledger table (sort headers, skeleton, empty, optional pagination).
3
+ *
4
+ * @param {object} props
5
+ * @param {object[]} props.columns
6
+ * @param {object[]} props.rows
7
+ * @param {(row: object) => string|number} [props.rowKey]
8
+ * @param {{ key: string, dir: "asc"|"desc" }} [props.sort]
9
+ * @param {(key: string) => void} [props.onSort]
10
+ * @param {boolean} [props.loading=false]
11
+ * @param {number} [props.skeletonRows=5]
12
+ * @param {import('react').ReactNode} [props.empty]
13
+ * @param {import('react').ReactNode} [props.emptyFiltered]
14
+ * @param {number} [props.sourceCount]
15
+ * @param {(row: object) => import('react').ReactNode} [props.rowActions]
16
+ * @param {string} [props.rowActionsLabel]
17
+ * @param {object} [props.pagination]
18
+ * @param {string} [props.ariaLabel]
19
+ * @param {string} [props.className]
20
+ * @param {boolean} [props.selectable=false] Render a leading checkbox column.
21
+ * @param {Set<string|number>} [props.selectedIds] Currently selected row keys.
22
+ * @param {(id: string|number) => void} [props.onToggleRow]
23
+ * @param {(checked: boolean) => void} [props.onToggleAll] Toggle all current rows.
24
+ */
25
+ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, selectable, selectedIds, onToggleRow, onToggleAll, }: {
26
+ columns: object[];
27
+ rows: object[];
28
+ rowKey?: (row: object) => string | number;
29
+ sort?: {
30
+ key: string;
31
+ dir: "asc" | "desc";
32
+ };
33
+ onSort?: (key: string) => void;
34
+ loading?: boolean;
35
+ skeletonRows?: number;
36
+ empty?: import('react').ReactNode;
37
+ emptyFiltered?: import('react').ReactNode;
38
+ sourceCount?: number;
39
+ rowActions?: (row: object) => import('react').ReactNode;
40
+ rowActionsLabel?: string;
41
+ pagination?: object;
42
+ ariaLabel?: string;
43
+ className?: string;
44
+ selectable?: boolean;
45
+ selectedIds?: Set<string | number>;
46
+ onToggleRow?: (id: string | number) => void;
47
+ onToggleAll?: (checked: boolean) => void;
48
+ }): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import '@webority/ui-elements';
2
+ /**
3
+ * Thin React wrapper over the shared `<wui-datepicker>` element (single
4
+ * implementation, so React and Razor render the same control).
5
+ *
6
+ * Wraps it in the standard `.field` shell — label / required mark / hint /
7
+ * error — the same as `<app-date-picker>` and every other field primitive.
8
+ * Without that a caller had to hand-roll the label, which is exactly the
9
+ * per-screen divergence this library exists to prevent. The shell is omitted
10
+ * entirely when there is nothing to render around the control.
11
+ *
12
+ * @param {object} props
13
+ * @param {string} [props.value] ISO date string
14
+ * @param {(value: string) => void} [props.onChange]
15
+ * @param {string} [props.label]
16
+ * @param {boolean} [props.required]
17
+ * @param {string} [props.hint]
18
+ * @param {string} [props.error]
19
+ * @param {string} [props.name]
20
+ * @param {string} [props.min]
21
+ * @param {string} [props.max]
22
+ * @param {string} [props.placeholder="Enter Date"]
23
+ * @param {boolean} [props.disabled]
24
+ * @param {string} [props.id]
25
+ * @param {string} [props.ariaLabel]
26
+ * @param {string} [props.className]
27
+ */
28
+ export default function AppDatePicker({ value, onChange, label, required, hint, error, name, min, max, placeholder, disabled, id, ariaLabel, className, }: {
29
+ value?: string;
30
+ onChange?: (value: string) => void;
31
+ label?: string;
32
+ required?: boolean;
33
+ hint?: string;
34
+ error?: string;
35
+ name?: string;
36
+ min?: string;
37
+ max?: string;
38
+ placeholder?: string;
39
+ disabled?: boolean;
40
+ id?: string;
41
+ ariaLabel?: string;
42
+ className?: string;
43
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export default function AppDropdown({ icon, iconSize, toggleClassName, label, ariaLabel, align, items, menuClassName, linkComponent, }: {
2
+ align?: string;
3
+ ariaLabel: any;
4
+ icon: any;
5
+ iconSize: any;
6
+ items?: any[];
7
+ label: any;
8
+ linkComponent: any;
9
+ menuClassName?: string;
10
+ toggleClassName?: string;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The standalone empty / placeholder block a card or section shows when it has
3
+ * nothing to display: an icon bubble, a title, optional body text, and an optional
4
+ * action. Same `.empty-state` markup as before — zero visual change.
5
+ *
6
+ * For the empty body of a AppDataTable use `AppTableEmptyState` instead (a different
7
+ * `.tbl-empty` design); this is the card / section version.
8
+ *
9
+ * `size` picks the type scale: "md" (default) is the page/card empty state; "sm" is
10
+ * the tighter widget/tile variant (smaller title + text).
11
+ *
12
+ * @param {object} props
13
+ * @param {string} props.icon Iconsax name for the bubble
14
+ * @param {number} [props.iconSize=24]
15
+ * @param {"md"|"sm"} [props.size="md"]
16
+ * @param {import('react').ReactNode} props.title
17
+ * @param {import('react').ReactNode} [props.text]
18
+ * @param {import('react').ReactNode} [props.action] usually an AppButton
19
+ * @param {string} [props.className]
20
+ * @param {import('react').CSSProperties} [props.style]
21
+ */
22
+ export default function AppEmptyState({ icon, iconSize, size, title, text, action, className, style, }: {
23
+ icon: string;
24
+ iconSize?: number;
25
+ size?: "md" | "sm";
26
+ title: import('react').ReactNode;
27
+ text?: import('react').ReactNode;
28
+ action?: import('react').ReactNode;
29
+ className?: string;
30
+ style?: import('react').CSSProperties;
31
+ }): import("react").JSX.Element;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Compact image attachment field — a browse row that swaps to a thumbnail + filename/size
3
+ * once a file is chosen (× to remove). Self-manages the preview object URL and validates
4
+ * type + size, reporting the choice via onChange(file | null).
5
+ *
6
+ * Distinct from AppFilePicker (a tall visual image dropzone): this is for attaching a file
7
+ * to something (a ticket, a message) where the file's name/size matters more than a big preview.
8
+ *
9
+ * @param {object} props
10
+ * @param {string} [props.label="Attachment"]
11
+ * @param {File|{ url: string, name?: string }|null} [props.value]
12
+ * @param {string} [props.name] Form field name, so an uncontrolled form can post the file.
13
+ * @param {(file: File|null) => void} props.onChange
14
+ * @param {string} [props.accept]
15
+ * @param {number} [props.maxSizeMb=5]
16
+ * @param {boolean} [props.optional=false]
17
+ * @param {string} [props.error]
18
+ * @param {string} [props.id]
19
+ */
20
+ export default function AppFileAttachment({ label, value, // File | { url, name } | null
21
+ name, onChange, // (file | null) => void
22
+ accept, maxSizeMb, optional, error, // external error, shown alongside internal validation errors
23
+ id, }: {
24
+ label?: string;
25
+ value?: File | {
26
+ url: string;
27
+ name?: string;
28
+ } | null;
29
+ name?: string;
30
+ onChange: (file: File | null) => void;
31
+ accept?: string;
32
+ maxSizeMb?: number;
33
+ optional?: boolean;
34
+ error?: string;
35
+ id?: string;
36
+ }): import("react").JSX.Element;