@openviking/react 0.1.7 → 0.1.8-beta.10.1.g8e5299efeb0a

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 (113) hide show
  1. package/README.md +11 -1
  2. package/dist/1~0.js +57 -0
  3. package/dist/3~0.js +171 -5
  4. package/dist/5~0.js +181 -0
  5. package/dist/6~0.js +48 -0
  6. package/dist/components/agent-connect/style.css +4 -2
  7. package/dist/components/api-key-login-form/api-key-login-form.d.ts +2 -0
  8. package/dist/components/api-key-login-form/index.d.ts +3 -0
  9. package/dist/components/api-key-login-form/style.css +438 -0
  10. package/dist/components/api-key-login-form/style.js +0 -0
  11. package/dist/components/api-key-login-form/types.d.ts +7 -0
  12. package/dist/components/api-key-login-form.js +1 -0
  13. package/dist/components/directory-tour/directory-tour-intro.d.ts +3 -0
  14. package/dist/components/directory-tour/index.d.ts +2 -1
  15. package/dist/components/directory-tour/style.css +154 -26
  16. package/dist/components/directory-tour/tour-card.d.ts +14 -0
  17. package/dist/components/directory-tour/types.d.ts +24 -1
  18. package/dist/components/directory-tour/use-tour-anchor.d.ts +1 -0
  19. package/dist/components/directory-tour/use-tour-position.d.ts +4 -1
  20. package/dist/components/directory-tour/use-tour-theme.d.ts +2 -0
  21. package/dist/components/directory-tour.js +52 -1
  22. package/dist/components/email-login-form/email-login-form.d.ts +2 -0
  23. package/dist/components/email-login-form/index.d.ts +3 -0
  24. package/dist/components/email-login-form/style.css +438 -0
  25. package/dist/components/email-login-form/style.js +0 -0
  26. package/dist/components/email-login-form/types.d.ts +11 -0
  27. package/dist/components/email-login-form.js +1 -0
  28. package/dist/components/experience-dashboard/experience-impact.d.ts +3 -1
  29. package/dist/components/experience-dashboard/style.css +4 -2
  30. package/dist/components/file-browser-entries/style.css +12 -6
  31. package/dist/components/file-preview/file-preview-header.d.ts +4 -21
  32. package/dist/components/file-preview/file-preview-toolbar.d.ts +7 -0
  33. package/dist/components/file-preview/locales/en-US.d.ts +9 -0
  34. package/dist/components/file-preview/locales/zh-CN.d.ts +9 -0
  35. package/dist/components/file-preview/style.css +116 -2
  36. package/dist/components/file-preview/types.d.ts +14 -21
  37. package/dist/components/file-tree/style.css +4 -2
  38. package/dist/components/invitation-confirmation/index.d.ts +3 -0
  39. package/dist/components/invitation-confirmation/invitation-confirmation.d.ts +2 -0
  40. package/dist/components/invitation-confirmation/style.css +438 -0
  41. package/dist/components/invitation-confirmation/style.js +0 -0
  42. package/dist/components/invitation-confirmation/types.d.ts +20 -0
  43. package/dist/components/invitation-confirmation.js +1 -0
  44. package/dist/components/login-method-selector/index.d.ts +2 -0
  45. package/dist/components/login-method-selector/login-method-selector.d.ts +2 -0
  46. package/dist/components/login-method-selector/style.css +438 -0
  47. package/dist/components/login-method-selector/style.js +0 -0
  48. package/dist/components/login-method-selector/types.d.ts +14 -0
  49. package/dist/components/login-method-selector.js +1 -0
  50. package/dist/components/password-reset-request-form/index.d.ts +3 -0
  51. package/dist/components/password-reset-request-form/password-reset-request-form.d.ts +2 -0
  52. package/dist/components/password-reset-request-form/style.css +438 -0
  53. package/dist/components/password-reset-request-form/style.js +0 -0
  54. package/dist/components/password-reset-request-form/types.d.ts +13 -0
  55. package/dist/components/password-reset-request-form.js +1 -0
  56. package/dist/components/password-setup-form/index.d.ts +3 -0
  57. package/dist/components/password-setup-form/password-setup-form.d.ts +2 -0
  58. package/dist/components/password-setup-form/style.css +438 -0
  59. package/dist/components/password-setup-form/style.js +0 -0
  60. package/dist/components/password-setup-form/types.d.ts +10 -0
  61. package/dist/components/password-setup-form.js +1 -0
  62. package/dist/components/scope-switcher/style.css +4 -2
  63. package/dist/components/scope-switcher.js +1 -1
  64. package/dist/components/style.css +2966 -58
  65. package/dist/components/tui/style.css +8 -4
  66. package/dist/components/viking-bot/style.css +12 -6
  67. package/dist/components/wiki-dashboard/index.d.ts +1 -1
  68. package/dist/components/wiki-dashboard/style.css +16 -4
  69. package/dist/components/wiki-dashboard/types.d.ts +12 -16
  70. package/dist/components/wiki-dashboard/wiki-action-button.d.ts +2 -9
  71. package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +3 -10
  72. package/dist/d~0.js +28 -0
  73. package/dist/ep~0.js +281 -133
  74. package/dist/fi~0.js +339 -0
  75. package/dist/fj~0.js +32 -67
  76. package/dist/fl~0.js +3 -2
  77. package/dist/f~0.js +63 -326
  78. package/dist/g~0.js +135 -0
  79. package/dist/icons/index.d.ts +2 -0
  80. package/dist/icons.js +1 -1
  81. package/dist/index.d.ts +12 -0
  82. package/dist/index.js +8 -2
  83. package/dist/k~0.js +44 -4
  84. package/dist/l5~0.js +3813 -0
  85. package/dist/lk~0.js +1 -1
  86. package/dist/l~0.js +54 -3811
  87. package/dist/modules/console/style.css +28 -14
  88. package/dist/modules/file-browser/file-browser-detail-icons.d.ts +0 -6
  89. package/dist/modules/file-browser/file-browser-detail.d.ts +2 -23
  90. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  91. package/dist/modules/file-browser/fs-file-editing.d.ts +4 -0
  92. package/dist/modules/file-browser/fs-preview-images.d.ts +3 -0
  93. package/dist/modules/file-browser/fs-read-file.d.ts +1 -1
  94. package/dist/modules/file-browser/style.css +156 -70
  95. package/dist/modules/file-browser/types.d.ts +2 -0
  96. package/dist/modules/file-browser/use-file-browser-acl.d.ts +1 -0
  97. package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +2 -4
  98. package/dist/modules/file-browser.js +1 -1
  99. package/dist/modules/scope-cascade/style.css +4 -2
  100. package/dist/modules/style.css +192 -88
  101. package/dist/n~0.js +1 -1
  102. package/dist/p0~0.js +27 -0
  103. package/dist/p~0.js +34 -25
  104. package/dist/shared/auth/agreements.d.ts +10 -0
  105. package/dist/shared/auth/fields.d.ts +15 -0
  106. package/dist/shared/auth/form-frame.d.ts +12 -0
  107. package/dist/shared/auth/locales/en-US.d.ts +24 -0
  108. package/dist/shared/auth/locales/zh-CN.d.ts +24 -0
  109. package/dist/shared/auth/types.d.ts +61 -0
  110. package/dist/shared/auth/use-auth-labels.d.ts +3 -0
  111. package/dist/shared/auth/use-form.d.ts +8 -0
  112. package/dist/style.css +3364 -350
  113. package/package.json +32 -2
package/dist/p~0.js CHANGED
@@ -1,27 +1,36 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import "react";
3
- const SvgSearch = (props)=>/*#__PURE__*/ jsx("svg", {
4
- xmlns: "http://www.w3.org/2000/svg",
5
- width: 16,
6
- height: 16,
7
- fill: "none",
8
- viewBox: "0 0 16 16",
9
- ...props,
10
- children: /*#__PURE__*/ jsxs("g", {
11
- stroke: "currentColor",
12
- strokeWidth: 1.2,
13
- children: [
14
- /*#__PURE__*/ jsx("circle", {
15
- cx: 7.167,
16
- cy: 7.167,
17
- r: 4.667
18
- }),
19
- /*#__PURE__*/ jsx("path", {
20
- strokeLinecap: "round",
21
- d: "m10.667 10.667 3 3"
22
- })
23
- ]
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import { useAuthLabels, Field } from "./g~0.js";
4
+ import { useForm, FormFrame } from "./5~0.js";
5
+ function ApiKeyLoginForm({ alternateLogin, onSubmit, locale, labels: overrides, ...options }) {
6
+ const id = useId();
7
+ const labels = useAuthLabels(locale, overrides);
8
+ const form = useForm({
9
+ apiKey: ''
10
+ }, ({ apiKey })=>({
11
+ apiKey: apiKey.trim() ? void 0 : {
12
+ key: 'required'
13
+ }
14
+ }));
15
+ return /*#__PURE__*/ jsx(FormFrame, {
16
+ ...options,
17
+ labels: labels,
18
+ submitLabel: labels.login,
19
+ validate: form.validate,
20
+ secondaryAction: alternateLogin,
21
+ onSubmit: ()=>onSubmit?.({
22
+ apiKey: form.values.apiKey
23
+ }),
24
+ children: /*#__PURE__*/ jsx(Field, {
25
+ id: `${id}-key`,
26
+ label: labels.apiKey,
27
+ labels: labels,
28
+ value: form.values.apiKey,
29
+ secret: true,
30
+ autoComplete: "off",
31
+ error: form.errors.apiKey,
32
+ onChange: (value)=>form.update('apiKey', value)
24
33
  })
25
34
  });
26
- const searchreact = SvgSearch;
27
- export { searchreact };
35
+ }
36
+ export { ApiKeyLoginForm };
@@ -0,0 +1,10 @@
1
+ import type { AuthAgreements, AuthLabels } from './types.js';
2
+ export declare function AgreementLinks({ agreements }: {
3
+ agreements: AuthAgreements;
4
+ }): import("react").JSX.Element;
5
+ export declare function AgreementDialog({ agreements, labels, onCancel, onAgree, }: {
6
+ agreements: AuthAgreements;
7
+ labels: AuthLabels;
8
+ onCancel: () => void;
9
+ onAgree: () => void;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { InputHTMLAttributes } from 'react';
2
+ import type { AuthAction, AuthIssue, AuthLabels } from './types.js';
3
+ export declare function Action({ action }: {
4
+ action?: AuthAction;
5
+ }): import("react").JSX.Element | null;
6
+ interface FieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
7
+ label: string;
8
+ error?: AuthIssue;
9
+ secret?: boolean;
10
+ labels: AuthLabels;
11
+ action?: AuthAction;
12
+ onChange: (value: string) => void;
13
+ }
14
+ export declare function Field({ label, error, secret, labels, action, onChange, id, ...input }: FieldProps): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { AuthAction, AuthFormOptions, AuthLabels } from './types.js';
3
+ interface Props extends AuthFormOptions {
4
+ children: ReactNode;
5
+ labels: AuthLabels;
6
+ submitLabel: string;
7
+ validate: () => boolean;
8
+ onSubmit: () => void;
9
+ secondaryAction?: AuthAction;
10
+ }
11
+ export declare function FormFrame({ children, labels, submitLabel, validate, onSubmit, secondaryAction, ...options }: Props): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1,24 @@
1
+ declare const messages: {
2
+ email: string;
3
+ password: string;
4
+ apiKey: string;
5
+ newPassword: string;
6
+ confirmation: string;
7
+ showPassword: string;
8
+ hidePassword: string;
9
+ required: string;
10
+ invalidEmail: string;
11
+ mismatch: string;
12
+ login: string;
13
+ send: string;
14
+ resend: string;
15
+ confirm: string;
16
+ agreementPrefix: string;
17
+ agreementTitle: string;
18
+ agreementDescription: string;
19
+ agree: string;
20
+ cancel: string;
21
+ account: string;
22
+ acceptInvitation: string;
23
+ };
24
+ export default messages;
@@ -0,0 +1,24 @@
1
+ declare const messages: {
2
+ email: string;
3
+ password: string;
4
+ apiKey: string;
5
+ newPassword: string;
6
+ confirmation: string;
7
+ showPassword: string;
8
+ hidePassword: string;
9
+ required: string;
10
+ invalidEmail: string;
11
+ mismatch: string;
12
+ login: string;
13
+ send: string;
14
+ resend: string;
15
+ confirm: string;
16
+ agreementPrefix: string;
17
+ agreementTitle: string;
18
+ agreementDescription: string;
19
+ agree: string;
20
+ cancel: string;
21
+ account: string;
22
+ acceptInvitation: string;
23
+ };
24
+ export default messages;
@@ -0,0 +1,61 @@
1
+ import type { Locale } from '../locale.js';
2
+ import type { ReactNode } from 'react';
3
+ export interface AuthAction {
4
+ label: string;
5
+ onClick?: () => void;
6
+ }
7
+ export interface AuthAgreements {
8
+ items: readonly {
9
+ label: string;
10
+ href: string;
11
+ }[];
12
+ confirmation?: {
13
+ title?: string;
14
+ description?: string;
15
+ confirmText?: string;
16
+ cancelText?: string;
17
+ };
18
+ }
19
+ export interface AuthLabels {
20
+ email: string;
21
+ password: string;
22
+ apiKey: string;
23
+ newPassword: string;
24
+ confirmation: string;
25
+ showPassword: string;
26
+ hidePassword: string;
27
+ required: string;
28
+ invalidEmail: string;
29
+ mismatch: string;
30
+ login: string;
31
+ send: string;
32
+ resend: string;
33
+ confirm: string;
34
+ agreementPrefix: string;
35
+ agreementTitle: string;
36
+ agreementDescription: string;
37
+ agree: string;
38
+ cancel: string;
39
+ account: string;
40
+ }
41
+ export interface AuthFormOptions {
42
+ loading?: boolean;
43
+ error?: ReactNode;
44
+ disabled?: boolean;
45
+ agreements?: AuthAgreements;
46
+ back?: AuthAction;
47
+ className?: string;
48
+ title?: ReactNode;
49
+ description?: ReactNode;
50
+ locale?: Locale;
51
+ labels?: Partial<AuthLabels>;
52
+ }
53
+ export interface AuthMessages extends AuthLabels {
54
+ acceptInvitation: string;
55
+ }
56
+ /** Store a validation issue independently of its localized display text. */
57
+ export type AuthIssue = {
58
+ key: 'required' | 'invalidEmail' | 'mismatch';
59
+ } | {
60
+ message: string;
61
+ };
@@ -0,0 +1,3 @@
1
+ import { type Locale } from '../locale.js';
2
+ import type { AuthLabels, AuthMessages } from './types.js';
3
+ export declare function useAuthLabels(locale?: Locale, labels?: Partial<AuthLabels>): AuthMessages;
@@ -0,0 +1,8 @@
1
+ import type { AuthIssue } from './types.js';
2
+ export declare function useForm<T extends Record<string, string>>(initial: T, validate: (values: T) => Partial<Record<keyof T, AuthIssue>>): {
3
+ values: T;
4
+ errors: Partial<Record<keyof T, AuthIssue>>;
5
+ update: (key: keyof T, value: string) => void;
6
+ validate: () => boolean;
7
+ };
8
+ export declare const validEmail: (value: string) => boolean;