@webority/ui-react 0.9.10 → 0.9.12

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.
@@ -0,0 +1,61 @@
1
+ import "@webority/ui-elements";
2
+ /**
3
+ * An in-product feedback affordance — a floating trigger pinned to a page corner that opens a
4
+ * small panel with a message box and, optionally, an email address.
5
+ *
6
+ * Wraps the shared `<wui-feedback>` element, which owns the panel, the keyboard and ARIA
7
+ * behaviour, and the busy/error/thank-you states. This wrapper owns exactly one thing: turning
8
+ * the element's `wui-feedback-submit` event into your `onSubmit`, and your promise's outcome
9
+ * back into the element's `submitted()` / `failed()`.
10
+ *
11
+ * `onSubmit` is REQUIRED and it is the whole contract — resolve and the person sees a
12
+ * thank-you, reject and they see an inline error with everything they typed still there. The
13
+ * library never posts anything itself: every product has its own endpoint, its own auth and its
14
+ * own idea of where feedback lands.
15
+ *
16
+ * ```jsx
17
+ * <AppFeedback
18
+ * surface="customer-portal"
19
+ * screen={location.pathname}
20
+ * collectEmail
21
+ * onSubmit={async ({ message, email, surface, screen }) => {
22
+ * await Api.Feedback.submit({ message, email, surface, screen });
23
+ * }}
24
+ * />
25
+ * ```
26
+ *
27
+ * To show your own failure copy rather than the element's default, reject with an error
28
+ * carrying a `userMessage` — an exception's own `message` is never shown, because it is written
29
+ * for a developer, not for the person reading it.
30
+ *
31
+ * @param {object} props
32
+ * @param {(payload: { message: string, email: string, surface: string, screen: string }) =>
33
+ * Promise<void>|void} props.onSubmit Required. Deliver the feedback; resolve on success,
34
+ * reject on failure.
35
+ * @param {string} [props.surface] Which product surface this came from, passed through to onSubmit.
36
+ * @param {string} [props.screen] Which screen/route it came from, passed through to onSubmit.
37
+ * @param {string} [props.heading='Share feedback'] Panel heading, and the dialog's accessible name.
38
+ * @param {string} [props.label='Feedback'] Trigger text beside the icon.
39
+ * @param {string} [props.placeholder] Placeholder for the message box.
40
+ * @param {boolean} [props.collectEmail=false] Also ask for an email address.
41
+ * @param {"bottom-right"|"bottom-left"} [props.position='bottom-right'] Which corner it pins to.
42
+ * @param {string} [props.className] Extra classes on the element.
43
+ * @param {import('react').CSSProperties} [props.style] Inline style; lands on the element with `className`.
44
+ */
45
+ export default function AppFeedback({ onSubmit, surface, screen, heading, label, placeholder, collectEmail, position, className, style, ...rest }: {
46
+ onSubmit: (payload: {
47
+ message: string;
48
+ email: string;
49
+ surface: string;
50
+ screen: string;
51
+ }) => Promise<void> | void;
52
+ surface?: string;
53
+ screen?: string;
54
+ heading?: string;
55
+ label?: string;
56
+ placeholder?: string;
57
+ collectEmail?: boolean;
58
+ position?: "bottom-right" | "bottom-left";
59
+ className?: string;
60
+ style?: import('react').CSSProperties;
61
+ }): import("react").JSX.Element;
@@ -42,6 +42,14 @@
42
42
  * on focus/fill. Opt-in variant; standalone only (no icon/unit/prefix in the same field).
43
43
  * @param {"bare"} [props.variant] Borderless variant — no border/background, inherits the
44
44
  * container's chrome (inline-rename, ⌘K).
45
+ * @param {boolean|object} [props.passwordRequirements=false] Only honoured when `type="password"`.
46
+ * Pass `true` for the default policy (≥8 chars, upper, lower, digit, special), or an object to
47
+ * configure it — `{ minLength, uppercase, lowercase, digit, special, uniqueChars, title }`. Shows
48
+ * a live "Password Requirements" checklist on focus that ticks each rule green as the user types
49
+ * (client-side, before any server validation). The rule set is the one shared with Razor via
50
+ * `@webority/ui-elements`, so both surfaces validate identically.
51
+ * @param {"auto"|"top"|"bottom"|"start"|"end"} [props.requirementsPlacement="auto"] Which side the
52
+ * requirements popover opens; `auto` flips to stay in view.
45
53
  * @param {import('react').Ref<HTMLInputElement>} [ref]
46
54
  */
47
55
  declare const AppInput: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -20,10 +20,12 @@
20
20
  * tone?: 'neutral'|'success'|'warning'|'danger'|'info',
21
21
  * status?: 'upcoming'|'current'|'done'|'on-hold'|'rejected'|'cancelled'|'skipped',
22
22
  * title: import('react').ReactNode, description?: import('react').ReactNode,
23
- * at?: string, by?: string, note?: string }[]} props.items
23
+ * at?: string, time?: string, by?: string, note?: string }[]} props.items
24
24
  * Feed variant: newest first. Progress variant: first stage first.
25
25
  * `status` drives the dot + rail in the progress variant; `description` is a
26
26
  * plain inline subtext under the title (distinct from the boxed `note`).
27
+ * `at` is the date and `time` an optional time-of-day shown beside it — both are
28
+ * pre-formatted strings the caller owns (IST, DD-MMM-YYYY / HH:mm); pass either or both.
27
29
  * @param {'feed'|'progress'} [props.variant] Layout mode. Defaults to `feed`.
28
30
  * @param {'vertical'|'horizontal'} [props.orientation] Rail direction — vertical (default) stacks
29
31
  * items top-to-bottom; horizontal lays dots in a row with the body beneath each. Orthogonal to
@@ -43,6 +45,7 @@ export default function AppTimeline({ items, variant, orientation, size, classNa
43
45
  title: import('react').ReactNode;
44
46
  description?: import('react').ReactNode;
45
47
  at?: string;
48
+ time?: string;
46
49
  by?: string;
47
50
  note?: string;
48
51
  }[];
@@ -25,6 +25,7 @@ export { default as AppDateRangePicker } from "./components/AppDateRangePicker.j
25
25
  export { default as AppDescriptions } from "./components/AppDescriptions.jsx";
26
26
  export { default as AppDropdown } from "./components/AppDropdown.jsx";
27
27
  export { default as AppEmptyState } from "./components/AppEmptyState.jsx";
28
+ export { default as AppFeedback } from "./components/AppFeedback.jsx";
28
29
  export { default as AppFileAttachment } from "./components/AppFileAttachment.jsx";
29
30
  export { default as AppFilePicker } from "./components/AppFilePicker.jsx";
30
31
  export { default as AppFloatingDock } from "./components/AppFloatingDock.jsx";