@webority/ui-react 0.9.9 → 0.9.11

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.
@@ -21,9 +21,10 @@
21
21
  * @param {boolean} [props.disabled=false]
22
22
  * @param {"sm"|"md"|"lg"} [props.size="md"] Control size — sm/lg opt out of the shared height,
23
23
  * resizing both the swatch and the hex box together.
24
- * @param {string} [props.className]
24
+ * @param {string} [props.className] Applied to the hex text input (the control).
25
+ * @param {string} [props.fieldClassName] Applied to the `.field` wrapper.
25
26
  */
26
- export default function AppColorField({ value, onChange, label, required, error, hint, name, id, disabled, size, className, ...rest }: {
27
+ export default function AppColorField({ value, onChange, label, required, error, hint, name, id, disabled, size, className, fieldClassName, ...rest }: {
27
28
  value: string;
28
29
  onChange: (hex: string) => void;
29
30
  label?: import('react').ReactNode;
@@ -35,4 +36,5 @@ export default function AppColorField({ value, onChange, label, required, error,
35
36
  disabled?: boolean;
36
37
  size?: "sm" | "md" | "lg";
37
38
  className?: string;
39
+ fieldClassName?: string;
38
40
  }): import("react").JSX.Element;
@@ -25,7 +25,8 @@ import "@webority/ui-elements";
25
25
  * @param {0|1|2|3|4|5|6} [props.firstDay=0] First weekday of the calendar — 0 Sun (default), 1 Mon…
26
26
  * @param {string} [props.id]
27
27
  * @param {string} [props.ariaLabel]
28
- * @param {string} [props.className]
28
+ * @param {string} [props.className] Classes for the `<wui-datepicker>` control itself.
29
+ * @param {string} [props.fieldClassName] Classes for the `.field` wrapper (label/hint/error shell).
29
30
  * @param {import('react').Ref<HTMLElement>} [ref]
30
31
  */
31
32
  declare const AppDatePicker: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -26,7 +26,8 @@ import "@webority/ui-elements";
26
26
  * @param {0|1|2|3|4|5|6} [props.firstDay=0] First weekday of the calendar — 0 Sun (default), 1 Mon…
27
27
  * @param {string} [props.id]
28
28
  * @param {string} [props.ariaLabel]
29
- * @param {string} [props.className]
29
+ * @param {string} [props.className] Class to apply to the control element.
30
+ * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
30
31
  * @param {import('react').Ref<HTMLElement>} [ref]
31
32
  */
32
33
  declare const AppDateRangePicker: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -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;
@@ -19,9 +19,11 @@
19
19
  * @param {number} [props.maxSizeMb=5]
20
20
  * @param {boolean} [props.required]
21
21
  * @param {string} [props.error]
22
- * @param {string} [props.className] Extra class on the field wrapper — e.g. a `file-w-*` width preset.
22
+ * @param {string} [props.className] Class to apply to the control element — the preview or dropzone shell.
23
+ * @param {string} [props.fieldClassName] Class to apply to the wrapper field div — e.g. a `file-w-*` width preset.
24
+ * @param {object} [props.style] Inline style; lands on the control with `className`.
23
25
  */
24
- export default function AppFilePicker({ label, value, name, onPick, multiple, maxFiles, accept, maxSizeMb, required, error, className, ...rest }: {
26
+ export default function AppFilePicker({ label, value, name, onPick, multiple, maxFiles, accept, maxSizeMb, required, error, className, fieldClassName, style, ...rest }: {
25
27
  label?: string;
26
28
  value?: File | {
27
29
  url: string;
@@ -39,4 +41,6 @@ export default function AppFilePicker({ label, value, name, onPick, multiple, ma
39
41
  required?: boolean;
40
42
  error?: string;
41
43
  className?: string;
44
+ fieldClassName?: string;
45
+ style?: object;
42
46
  }): 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>>;
@@ -40,7 +40,8 @@ import "@webority/ui-elements";
40
40
  * @param {boolean} [props.disabled=false]
41
41
  * @param {string} [props.name]
42
42
  * @param {string} [props.id]
43
- * @param {string} [props.className]
43
+ * @param {string} [props.className] Class to apply to the control element.
44
+ * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
44
45
  * @param {import('react').Ref<HTMLElement>} [ref]
45
46
  */
46
47
  declare const AppOtpInput: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -1,3 +1,8 @@
1
1
  import "@webority/ui-elements";
2
+ /**
3
+ * @param {object} props
4
+ * @param {string} [props.className] Class to apply to the control element.
5
+ * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
6
+ */
2
7
  declare const AppSelect: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
3
8
  export default AppSelect;
@@ -30,7 +30,8 @@ import "@webority/ui-elements";
30
30
  * @param {string} [props.unit] Suffix for the value label (e.g. '%')
31
31
  * @param {string} [props.id]
32
32
  * @param {string} [props.ariaLabel]
33
- * @param {string} [props.className]
33
+ * @param {string} [props.className] Class to apply to the control element.
34
+ * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
34
35
  * @param {import('react').Ref<HTMLElement>} [ref]
35
36
  */
36
37
  declare const AppSlider: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -26,7 +26,8 @@ import "@webority/ui-elements";
26
26
  * @param {'sm'|'md'|'lg'} [props.size] Control height tier, matching AppInput
27
27
  * @param {string} [props.id]
28
28
  * @param {string} [props.ariaLabel]
29
- * @param {string} [props.className]
29
+ * @param {string} [props.className] Class to apply to the control element.
30
+ * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
30
31
  * @param {import('react').Ref<HTMLElement>} [ref]
31
32
  */
32
33
  declare const AppTimePicker: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
@@ -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";