@skdx/react-blocks 0.34.0 → 0.36.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.
- package/dist/chat-composer/ChatComposer.cjs +2 -0
- package/dist/chat-composer/ChatComposer.d.cts +20 -0
- package/dist/chat-composer/ChatComposer.d.ts +20 -0
- package/dist/chat-composer/ChatComposer.js +2 -0
- package/dist/chat-composer/index.d.cts +2 -0
- package/dist/chat-composer/index.d.ts +2 -0
- package/dist/chat-composer/types.d.cts +96 -0
- package/dist/chat-composer/types.d.ts +96 -0
- package/dist/chat-message/ChatMessage.cjs +2 -0
- package/dist/chat-message/ChatMessage.d.cts +23 -0
- package/dist/chat-message/ChatMessage.d.ts +23 -0
- package/dist/chat-message/ChatMessage.js +2 -0
- package/dist/chat-message/index.d.cts +2 -0
- package/dist/chat-message/index.d.ts +2 -0
- package/dist/chat-message/types.d.cts +57 -0
- package/dist/chat-message/types.d.ts +57 -0
- package/dist/comment/Comment.cjs +2 -0
- package/dist/comment/Comment.d.cts +22 -0
- package/dist/comment/Comment.d.ts +22 -0
- package/dist/comment/Comment.js +2 -0
- package/dist/comment/index.d.cts +2 -0
- package/dist/comment/index.d.ts +2 -0
- package/dist/comment/types.d.cts +47 -0
- package/dist/comment/types.d.ts +47 -0
- package/dist/comment-thread/CommentThread.cjs +2 -0
- package/dist/comment-thread/CommentThread.d.cts +21 -0
- package/dist/comment-thread/CommentThread.d.ts +21 -0
- package/dist/comment-thread/CommentThread.js +2 -0
- package/dist/comment-thread/index.d.cts +2 -0
- package/dist/comment-thread/index.d.ts +2 -0
- package/dist/comment-thread/types.d.cts +46 -0
- package/dist/comment-thread/types.d.ts +46 -0
- package/dist/confirm-dialog/ConfirmDialog.cjs +2 -0
- package/dist/confirm-dialog/ConfirmDialog.d.cts +31 -0
- package/dist/confirm-dialog/ConfirmDialog.d.ts +31 -0
- package/dist/confirm-dialog/ConfirmDialog.js +2 -0
- package/dist/confirm-dialog/index.d.cts +2 -0
- package/dist/confirm-dialog/index.d.ts +2 -0
- package/dist/confirm-dialog/types.d.cts +114 -0
- package/dist/confirm-dialog/types.d.ts +114 -0
- package/dist/conversation-list/ConversationList.cjs +2 -0
- package/dist/conversation-list/ConversationList.d.cts +20 -0
- package/dist/conversation-list/ConversationList.d.ts +20 -0
- package/dist/conversation-list/ConversationList.js +2 -0
- package/dist/conversation-list/index.d.cts +2 -0
- package/dist/conversation-list/index.d.ts +2 -0
- package/dist/conversation-list/types.d.cts +94 -0
- package/dist/conversation-list/types.d.ts +94 -0
- package/dist/empty-state/EmptyState.cjs +2 -0
- package/dist/empty-state/EmptyState.d.cts +21 -0
- package/dist/empty-state/EmptyState.d.ts +21 -0
- package/dist/empty-state/EmptyState.js +2 -0
- package/dist/empty-state/index.d.cts +2 -0
- package/dist/empty-state/index.d.ts +2 -0
- package/dist/empty-state/types.d.cts +36 -0
- package/dist/empty-state/types.d.ts +36 -0
- package/dist/filter-bar/FilterBar.cjs +2 -0
- package/dist/filter-bar/FilterBar.d.cts +23 -0
- package/dist/filter-bar/FilterBar.d.ts +23 -0
- package/dist/filter-bar/FilterBar.js +2 -0
- package/dist/filter-bar/index.d.cts +2 -0
- package/dist/filter-bar/index.d.ts +2 -0
- package/dist/filter-bar/types.d.cts +81 -0
- package/dist/filter-bar/types.d.ts +81 -0
- package/dist/forgot-password-page/ForgotPasswordPage.cjs +2 -0
- package/dist/forgot-password-page/ForgotPasswordPage.d.cts +20 -0
- package/dist/forgot-password-page/ForgotPasswordPage.d.ts +20 -0
- package/dist/forgot-password-page/ForgotPasswordPage.js +2 -0
- package/dist/forgot-password-page/index.d.cts +2 -0
- package/dist/forgot-password-page/index.d.ts +2 -0
- package/dist/forgot-password-page/types.d.cts +54 -0
- package/dist/forgot-password-page/types.d.ts +54 -0
- package/dist/form-section/FormSection.cjs +2 -0
- package/dist/form-section/FormSection.d.cts +22 -0
- package/dist/form-section/FormSection.d.ts +22 -0
- package/dist/form-section/FormSection.js +2 -0
- package/dist/form-section/index.d.cts +2 -0
- package/dist/form-section/index.d.ts +2 -0
- package/dist/form-section/types.d.cts +27 -0
- package/dist/form-section/types.d.ts +27 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1 -1
- package/dist/internal/AuthPanel.d.cts +54 -0
- package/dist/internal/AuthPanel.d.ts +54 -0
- package/dist/internal/Region.d.cts +17 -0
- package/dist/internal/Region.d.ts +17 -0
- package/dist/internal/formValue.d.cts +6 -0
- package/dist/internal/formValue.d.ts +6 -0
- package/dist/notification-center/NotificationCenter.cjs +2 -0
- package/dist/notification-center/NotificationCenter.d.cts +21 -0
- package/dist/notification-center/NotificationCenter.d.ts +21 -0
- package/dist/notification-center/NotificationCenter.js +2 -0
- package/dist/notification-center/index.d.cts +2 -0
- package/dist/notification-center/index.d.ts +2 -0
- package/dist/notification-center/types.d.cts +104 -0
- package/dist/notification-center/types.d.ts +104 -0
- package/dist/onboarding-checklist/OnboardingChecklist.cjs +2 -0
- package/dist/onboarding-checklist/OnboardingChecklist.d.cts +25 -0
- package/dist/onboarding-checklist/OnboardingChecklist.d.ts +25 -0
- package/dist/onboarding-checklist/OnboardingChecklist.js +2 -0
- package/dist/onboarding-checklist/index.d.cts +2 -0
- package/dist/onboarding-checklist/index.d.ts +2 -0
- package/dist/onboarding-checklist/types.d.cts +67 -0
- package/dist/onboarding-checklist/types.d.ts +67 -0
- package/dist/reset-password-page/ResetPasswordPage.cjs +2 -0
- package/dist/reset-password-page/ResetPasswordPage.d.cts +20 -0
- package/dist/reset-password-page/ResetPasswordPage.d.ts +20 -0
- package/dist/reset-password-page/ResetPasswordPage.js +2 -0
- package/dist/reset-password-page/index.d.cts +2 -0
- package/dist/reset-password-page/index.d.ts +2 -0
- package/dist/reset-password-page/types.d.cts +64 -0
- package/dist/reset-password-page/types.d.ts +64 -0
- package/dist/sign-in-page/SignInPage.cjs +1 -1
- package/dist/sign-in-page/SignInPage.d.cts +1 -1
- package/dist/sign-in-page/SignInPage.d.ts +1 -1
- package/dist/sign-in-page/SignInPage.js +1 -1
- package/dist/sign-up-page/SignUpPage.cjs +2 -0
- package/dist/sign-up-page/SignUpPage.d.cts +21 -0
- package/dist/sign-up-page/SignUpPage.d.ts +21 -0
- package/dist/sign-up-page/SignUpPage.js +2 -0
- package/dist/sign-up-page/index.d.cts +2 -0
- package/dist/sign-up-page/index.d.ts +2 -0
- package/dist/sign-up-page/types.d.cts +100 -0
- package/dist/sign-up-page/types.d.ts +100 -0
- package/dist/stat-card/StatCard.cjs +2 -0
- package/dist/stat-card/StatCard.d.cts +22 -0
- package/dist/stat-card/StatCard.d.ts +22 -0
- package/dist/stat-card/StatCard.js +2 -0
- package/dist/stat-card/index.d.cts +2 -0
- package/dist/stat-card/index.d.ts +2 -0
- package/dist/stat-card/types.d.cts +71 -0
- package/dist/stat-card/types.d.ts +71 -0
- package/dist/usage-card/UsageCard.cjs +2 -0
- package/dist/usage-card/UsageCard.d.cts +17 -0
- package/dist/usage-card/UsageCard.d.ts +17 -0
- package/dist/usage-card/UsageCard.js +2 -0
- package/dist/usage-card/index.d.cts +2 -0
- package/dist/usage-card/index.d.ts +2 -0
- package/dist/usage-card/types.d.cts +50 -0
- package/dist/usage-card/types.d.ts +50 -0
- package/dist/usage-card/usage.d.cts +18 -0
- package/dist/usage-card/usage.d.ts +18 -0
- package/dist/user-menu/UserMenu.cjs +2 -0
- package/dist/user-menu/UserMenu.d.cts +19 -0
- package/dist/user-menu/UserMenu.d.ts +19 -0
- package/dist/user-menu/UserMenu.js +2 -0
- package/dist/user-menu/index.d.cts +2 -0
- package/dist/user-menu/index.d.ts +2 -0
- package/dist/user-menu/types.d.cts +89 -0
- package/dist/user-menu/types.d.ts +89 -0
- package/dist/verification-page/VerificationPage.cjs +2 -0
- package/dist/verification-page/VerificationPage.d.cts +20 -0
- package/dist/verification-page/VerificationPage.d.ts +20 -0
- package/dist/verification-page/VerificationPage.js +2 -0
- package/dist/verification-page/index.d.cts +2 -0
- package/dist/verification-page/index.d.ts +2 -0
- package/dist/verification-page/types.d.cts +89 -0
- package/dist/verification-page/types.d.ts +89 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.cjs +2 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.d.cts +25 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.d.ts +25 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.js +2 -0
- package/dist/workspace-switcher/index.d.cts +2 -0
- package/dist/workspace-switcher/index.d.ts +2 -0
- package/dist/workspace-switcher/types.d.cts +151 -0
- package/dist/workspace-switcher/types.d.ts +151 -0
- package/package.json +194 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { DateInput } from '@skdx/react';
|
|
3
|
+
/** One conversation or thread row rendered by the {@link ConversationList} block. */
|
|
4
|
+
export interface ConversationListItem {
|
|
5
|
+
/** Identifier committed as the list's selected value when this row is chosen. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Primary line of the row, and the text the list's typeahead matches on. */
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Secondary line under the title, clamped by the skin to two lines.
|
|
11
|
+
* @default undefined — no preview line renders in the row.
|
|
12
|
+
*/
|
|
13
|
+
preview?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Instant rendered as a relative timestamp in the row's meta column.
|
|
16
|
+
* @default undefined — no timestamp renders in the row.
|
|
17
|
+
*/
|
|
18
|
+
timestamp?: DateInput | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Marks the row as not yet read, mirrored to `data-unread` on the option.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
unread?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Short count or status text rendered into a small badge beside the timestamp.
|
|
26
|
+
* @default undefined — no badge renders in the row.
|
|
27
|
+
*/
|
|
28
|
+
badge?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Heading this row belongs under; rows sharing it render inside one group.
|
|
31
|
+
* @default undefined — the row renders ungrouped, ahead of every group.
|
|
32
|
+
*/
|
|
33
|
+
group?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Excludes this row from selection and from keyboard and typeahead navigation.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean | undefined;
|
|
39
|
+
}
|
|
40
|
+
/** Props for the {@link ConversationList} block. */
|
|
41
|
+
export interface ConversationListProps extends React.ComponentPropsWithRef<'div'> {
|
|
42
|
+
/** The conversations to render, in order, each one a selectable listbox option. */
|
|
43
|
+
items: ReadonlyArray<ConversationListItem>;
|
|
44
|
+
/**
|
|
45
|
+
* Selected conversation's id for controlled usage, paired with `onValueChange`.
|
|
46
|
+
* @default undefined — uncontrolled, tracking the selected id internally.
|
|
47
|
+
*/
|
|
48
|
+
value?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Conversation selected on first render, for uncontrolled usage of the list.
|
|
51
|
+
* @default undefined — no conversation is selected until one is chosen.
|
|
52
|
+
*/
|
|
53
|
+
defaultValue?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Fires with the newly selected conversation's id whenever the selection moves.
|
|
56
|
+
* @default undefined — the selection change is not reported anywhere.
|
|
57
|
+
*/
|
|
58
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Accessible name of the listbox holding the conversation rows.
|
|
61
|
+
* @default 'Conversations'
|
|
62
|
+
*/
|
|
63
|
+
label?: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Visually hidden text appended to an unread row's title, so the mark is spoken.
|
|
66
|
+
* @default 'Unread'
|
|
67
|
+
*/
|
|
68
|
+
unreadLabel?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Heading of the empty state shown when `items` is empty and nothing is loading.
|
|
71
|
+
* @default 'No conversations'
|
|
72
|
+
*/
|
|
73
|
+
emptyTitle?: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Supporting copy rendered under the empty state's heading, explaining the gap.
|
|
76
|
+
* @default undefined — the empty state renders its heading alone.
|
|
77
|
+
*/
|
|
78
|
+
emptyDescription?: string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Replaces the rows with decorative placeholder lines and marks the root `aria-busy`.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
loading?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Reference instant the relative timestamps are measured from, to control re-renders.
|
|
86
|
+
* @default undefined — each timestamp reads the clock as it renders.
|
|
87
|
+
*/
|
|
88
|
+
now?: Date | number | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Renders a decorative leading region for a row, such as an avatar or a status dot.
|
|
91
|
+
* @default undefined — no leading region renders in any row.
|
|
92
|
+
*/
|
|
93
|
+
renderLeading?: ((item: ConversationListItem) => React.ReactNode) | undefined;
|
|
94
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var g=Object.create;var d=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},c=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of v(t))!P.call(e,s)&&s!==a&&d(e,s,{get:()=>t[s],enumerable:!(r=k(t,s))||r.enumerable});return e};var $=(e,t,a)=>(a=e!=null?g(S(e)):{},c(t||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),b=e=>c(d({},"__esModule",{value:!0}),e);var R={};E(R,{EmptyState:()=>m});module.exports=b(R);var y=$(require("react"),1),p=require("@skdx/react");function N(...e){let t="";for(let a of e)a&&(t=t?`${t} ${a}`:a);return t}function n(e,t,a){let r=t==="root",s=r?`skdx-${e}`:`skdx-${e}__${t}`,o={className:N(s,a),"data-part":t};return r&&(o["data-skdx-component"]=e),o}var i=require("react/jsx-runtime"),m=({title:e,description:t,icon:a,actions:r,headingLevel:s=3,size:o,align:x="center",children:u,...l})=>{let f=y.useId();return(0,i.jsxs)("div",{"data-size":o,"data-align":x,...l,...n("empty-state","root",l.className),children:[a?(0,i.jsx)("div",{"aria-hidden":"true",...n("empty-state","icon"),children:a}):null,(0,i.jsx)(p.Heading,{as:`h${s}`,id:f,...n("empty-state","title"),children:e}),t?(0,i.jsx)(p.Text,{as:"p",tone:"muted",...n("empty-state","description"),children:t}):null,u?(0,i.jsx)("div",{...n("empty-state","content"),children:u}):null,r?(0,i.jsx)("div",{...n("empty-state","actions"),children:r}):null]})};m.displayName="EmptyState";0&&(module.exports={EmptyState});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { EmptyStateProps } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Placeholder block for a region with nothing to show — no content yet, no
|
|
5
|
+
* results, first use, or disconnected — composing a Heading, a Text
|
|
6
|
+
* description and consumer-supplied icon and actions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <EmptyState
|
|
11
|
+
* icon={<InboxIcon />}
|
|
12
|
+
* title="No invoices yet"
|
|
13
|
+
* description="Invoices you create will show up here."
|
|
14
|
+
* actions={<Button>Create invoice</Button>}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const EmptyState: {
|
|
19
|
+
({ title, description, icon, actions, headingLevel, size, align, children, ...props }: EmptyStateProps): React.ReactNode;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { EmptyStateProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Placeholder block for a region with nothing to show — no content yet, no
|
|
5
|
+
* results, first use, or disconnected — composing a Heading, a Text
|
|
6
|
+
* description and consumer-supplied icon and actions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <EmptyState
|
|
11
|
+
* icon={<InboxIcon />}
|
|
12
|
+
* title="No invoices yet"
|
|
13
|
+
* description="Invoices you create will show up here."
|
|
14
|
+
* actions={<Button>Create invoice</Button>}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const EmptyState: {
|
|
19
|
+
({ title, description, icon, actions, headingLevel, size, align, children, ...props }: EmptyStateProps): React.ReactNode;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import*as m from"react";import{Heading as x,Text as f}from"@skdx/react";function y(...a){let t="";for(let e of a)e&&(t=t?`${t} ${e}`:e);return t}function s(a,t,e){let r=t==="root",o=r?`skdx-${a}`:`skdx-${a}__${t}`,n={className:y(o,e),"data-part":t};return r&&(n["data-skdx-component"]=a),n}import{jsx as i,jsxs as g}from"react/jsx-runtime";var u=({title:a,description:t,icon:e,actions:r,headingLevel:o=3,size:n,align:l="center",children:d,...p})=>{let c=m.useId();return g("div",{"data-size":n,"data-align":l,...p,...s("empty-state","root",p.className),children:[e?i("div",{"aria-hidden":"true",...s("empty-state","icon"),children:e}):null,i(x,{as:`h${o}`,id:c,...s("empty-state","title"),children:a}),t?i(f,{as:"p",tone:"muted",...s("empty-state","description"),children:t}):null,d?i("div",{...s("empty-state","content"),children:d}):null,r?i("div",{...s("empty-state","actions"),children:r}):null]})};u.displayName="EmptyState";export{u as EmptyState};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/** Props for the {@link EmptyState} block. */
|
|
3
|
+
export interface EmptyStateProps extends React.ComponentPropsWithRef<'div'> {
|
|
4
|
+
/** Heading text naming the empty region, rendered into a derived Heading. */
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* Supporting copy rendered below the title, explaining why the region is empty.
|
|
8
|
+
* @default undefined — no description region renders.
|
|
9
|
+
*/
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Decorative illustration or glyph rendered above the title; always `aria-hidden`.
|
|
13
|
+
* @default undefined — no icon region renders.
|
|
14
|
+
*/
|
|
15
|
+
icon?: React.ReactNode | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Primary and secondary controls the consumer supplies, rendered below the content.
|
|
18
|
+
* @default undefined — no actions region renders.
|
|
19
|
+
*/
|
|
20
|
+
actions?: React.ReactNode | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Outline level of the derived title heading, from `1` down to `6`.
|
|
23
|
+
* @default 3
|
|
24
|
+
*/
|
|
25
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Visual size rung, mirrored to `data-size`; the skin scales the icon, spacing and title by it.
|
|
28
|
+
* @default undefined — the skin's own default size.
|
|
29
|
+
*/
|
|
30
|
+
size?: 'sm' | 'md' | 'lg' | (string & {}) | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Text and content alignment rung, mirrored to `data-align`.
|
|
33
|
+
* @default 'center'
|
|
34
|
+
*/
|
|
35
|
+
align?: 'center' | 'start' | (string & {}) | undefined;
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/** Props for the {@link EmptyState} block. */
|
|
3
|
+
export interface EmptyStateProps extends React.ComponentPropsWithRef<'div'> {
|
|
4
|
+
/** Heading text naming the empty region, rendered into a derived Heading. */
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* Supporting copy rendered below the title, explaining why the region is empty.
|
|
8
|
+
* @default undefined — no description region renders.
|
|
9
|
+
*/
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Decorative illustration or glyph rendered above the title; always `aria-hidden`.
|
|
13
|
+
* @default undefined — no icon region renders.
|
|
14
|
+
*/
|
|
15
|
+
icon?: React.ReactNode | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Primary and secondary controls the consumer supplies, rendered below the content.
|
|
18
|
+
* @default undefined — no actions region renders.
|
|
19
|
+
*/
|
|
20
|
+
actions?: React.ReactNode | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Outline level of the derived title heading, from `1` down to `6`.
|
|
23
|
+
* @default 3
|
|
24
|
+
*/
|
|
25
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Visual size rung, mirrored to `data-size`; the skin scales the icon, spacing and title by it.
|
|
28
|
+
* @default undefined — the skin's own default size.
|
|
29
|
+
*/
|
|
30
|
+
size?: 'sm' | 'md' | 'lg' | (string & {}) | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Text and content alignment rung, mirrored to `data-align`.
|
|
33
|
+
* @default 'center'
|
|
34
|
+
*/
|
|
35
|
+
align?: 'center' | 'start' | (string & {}) | undefined;
|
|
36
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var c=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var R=(r,t)=>{for(var e in t)c(r,e,{get:t[e],enumerable:!0})},T=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of A(t))!N.call(r,i)&&i!==e&&c(r,i,{get:()=>t[i],enumerable:!(s=h(t,i))||s.enumerable});return r};var $=r=>T(c({},"__esModule",{value:!0}),r);var S={};R(S,{FilterBar:()=>p});module.exports=$(S);var o=require("@skdx/react"),f=require("@skdx/react/primitives/text-field");function C(...r){let t="";for(let e of r)e&&(t=t?`${t} ${e}`:e);return t}function l(r,t,e){let s=t==="root",i=s?`skdx-${r}`:`skdx-${r}__${t}`,n={className:C(i,e),"data-part":t};return s&&(n["data-skdx-component"]=r),n}var a=require("react/jsx-runtime"),p=({label:r="Filters",searchLabel:t,searchPlaceholder:e,searchValue:s,defaultSearchValue:i="",onSearchValueChange:n,clearSearchLabel:F="Clear search",activeFilters:k,activeFiltersLabel:B="Active filters",onRemoveFilter:y,onClear:x,clearLabel:P="Clear filters",actions:m,children:b,...v})=>{let u=k??[];return(0,a.jsxs)("div",{"aria-label":r,...v,...l("filter-bar","root",v.className),children:[t?(0,a.jsx)("div",{...l("filter-bar","search"),children:(0,a.jsxs)(o.TextField,{value:s,defaultValue:i,onValueChange:n,children:[(0,a.jsx)(f.TextFieldInput,{type:"search","aria-label":t,placeholder:e}),(0,a.jsx)(f.TextFieldClearButton,{label:F})]})}):null,b?(0,a.jsx)("div",{...l("filter-bar","filters"),children:b}):null,m?(0,a.jsx)("div",{...l("filter-bar","actions"),children:m}):null,u.length>0?(0,a.jsxs)("div",{...l("filter-bar","active"),children:[(0,a.jsx)(o.TagGroup,{"aria-label":B,tags:u.map(d=>({value:d.id,label:d.label})),onRemove:d=>{let g=u[d.index];g&&y?.(g)},...l("filter-bar","tags")}),x?(0,a.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:x,...l("filter-bar","clear"),children:P}):null]}):null]})};p.displayName="FilterBar";0&&(module.exports={FilterBar});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { FilterBarProps } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Filtering surface above a table, list, card grid or report: a search field,
|
|
5
|
+
* the consumer's filter controls, the applied filters as removable tags, and
|
|
6
|
+
* a clear action. Composes TextField, TagGroup and Button.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <FilterBar
|
|
11
|
+
* searchLabel="Search invoices"
|
|
12
|
+
* activeFilters={[{ id: 'status', label: 'Status: Overdue' }]}
|
|
13
|
+
* onRemoveFilter={(filter) => removeFilter(filter.id)}
|
|
14
|
+
* onClear={() => clearFilters()}
|
|
15
|
+
* >
|
|
16
|
+
* <Select aria-label="Status" />
|
|
17
|
+
* </FilterBar>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const FilterBar: {
|
|
21
|
+
({ label, searchLabel, searchPlaceholder, searchValue, defaultSearchValue, onSearchValueChange, clearSearchLabel, activeFilters, activeFiltersLabel, onRemoveFilter, onClear, clearLabel, actions, children, ...props }: FilterBarProps): React.ReactNode;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { FilterBarProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Filtering surface above a table, list, card grid or report: a search field,
|
|
5
|
+
* the consumer's filter controls, the applied filters as removable tags, and
|
|
6
|
+
* a clear action. Composes TextField, TagGroup and Button.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <FilterBar
|
|
11
|
+
* searchLabel="Search invoices"
|
|
12
|
+
* activeFilters={[{ id: 'status', label: 'Status: Overdue' }]}
|
|
13
|
+
* onRemoveFilter={(filter) => removeFilter(filter.id)}
|
|
14
|
+
* onClear={() => clearFilters()}
|
|
15
|
+
* >
|
|
16
|
+
* <Select aria-label="Status" />
|
|
17
|
+
* </FilterBar>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const FilterBar: {
|
|
21
|
+
({ label, searchLabel, searchPlaceholder, searchValue, defaultSearchValue, onSearchValueChange, clearSearchLabel, activeFilters, activeFiltersLabel, onRemoveFilter, onClear, clearLabel, actions, children, ...props }: FilterBarProps): React.ReactNode;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Button as P,TagGroup as h,TextField as A}from"@skdx/react";import{TextFieldClearButton as N,TextFieldInput as R}from"@skdx/react/primitives/text-field";function y(...e){let t="";for(let a of e)a&&(t=t?`${t} ${a}`:a);return t}function r(e,t,a){let l=t==="root",n=l?`skdx-${e}`:`skdx-${e}__${t}`,s={className:y(n,a),"data-part":t};return l&&(s["data-skdx-component"]=e),s}import{jsx as i,jsxs as f}from"react/jsx-runtime";var b=({label:e="Filters",searchLabel:t,searchPlaceholder:a,searchValue:l,defaultSearchValue:n="",onSearchValueChange:s,clearSearchLabel:v="Clear search",activeFilters:g,activeFiltersLabel:F="Active filters",onRemoveFilter:k,onClear:u,clearLabel:B="Clear filters",actions:c,children:p,...x})=>{let d=g??[];return f("div",{"aria-label":e,...x,...r("filter-bar","root",x.className),children:[t?i("div",{...r("filter-bar","search"),children:f(A,{value:l,defaultValue:n,onValueChange:s,children:[i(R,{type:"search","aria-label":t,placeholder:a}),i(N,{label:v})]})}):null,p?i("div",{...r("filter-bar","filters"),children:p}):null,c?i("div",{...r("filter-bar","actions"),children:c}):null,d.length>0?f("div",{...r("filter-bar","active"),children:[i(h,{"aria-label":F,tags:d.map(o=>({value:o.id,label:o.label})),onRemove:o=>{let m=d[o.index];m&&k?.(m)},...r("filter-bar","tags")}),u?i(P,{variant:"ghost",size:"sm",onClick:u,...r("filter-bar","clear"),children:B}):null]}):null]})};b.displayName="FilterBar";export{b as FilterBar};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/** One applied filter rendered as a removable tag by the {@link FilterBar} block. */
|
|
3
|
+
export interface FilterBarFilter {
|
|
4
|
+
/** Unique identifier, passed back to `onRemoveFilter` and used as the tag's key. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Text rendered on the tag and read by its remove control's accessible name. */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
/** Props for the {@link FilterBar} block. */
|
|
10
|
+
export interface FilterBarProps extends React.ComponentPropsWithRef<'div'> {
|
|
11
|
+
/**
|
|
12
|
+
* Accessible name of the root region, written to `aria-label`.
|
|
13
|
+
* @default 'Filters'
|
|
14
|
+
*/
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Accessible name of the search field; providing it renders the search region.
|
|
18
|
+
* @default undefined — no search region renders.
|
|
19
|
+
*/
|
|
20
|
+
searchLabel?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Placeholder shown in the empty search field.
|
|
23
|
+
* @default undefined — no placeholder renders.
|
|
24
|
+
*/
|
|
25
|
+
searchPlaceholder?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Current search text, for controlled usage; pair with `onSearchValueChange`.
|
|
28
|
+
* @default undefined — uncontrolled, tracks its own value internally.
|
|
29
|
+
*/
|
|
30
|
+
searchValue?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Initial search text, for uncontrolled usage — seeds the internally-tracked value.
|
|
33
|
+
* @default ''
|
|
34
|
+
*/
|
|
35
|
+
defaultSearchValue?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Fires with the new text whenever the search field changes, controlled or not.
|
|
38
|
+
* @default undefined — no-op.
|
|
39
|
+
*/
|
|
40
|
+
onSearchValueChange?: ((value: string) => void) | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Accessible name of the search field's clear button.
|
|
43
|
+
* @default 'Clear search'
|
|
44
|
+
*/
|
|
45
|
+
clearSearchLabel?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The applied filters, in display order, rendered as removable tags; an empty or omitted list renders no active region.
|
|
48
|
+
* @default undefined — no active region renders.
|
|
49
|
+
*/
|
|
50
|
+
activeFilters?: ReadonlyArray<FilterBarFilter> | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Accessible name of the active-filters tag list.
|
|
53
|
+
* @default 'Active filters'
|
|
54
|
+
*/
|
|
55
|
+
activeFiltersLabel?: string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Fires with the removed filter when its tag's remove control is activated.
|
|
58
|
+
* @default undefined — no-op.
|
|
59
|
+
*/
|
|
60
|
+
onRemoveFilter?: ((filter: FilterBarFilter) => void) | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Fires when the clear-filters button is activated; providing it renders the button while filters are active.
|
|
63
|
+
* @default undefined — no clear button renders.
|
|
64
|
+
*/
|
|
65
|
+
onClear?: (() => void) | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Text rendered on the clear-filters button.
|
|
68
|
+
* @default 'Clear filters'
|
|
69
|
+
*/
|
|
70
|
+
clearLabel?: string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Controls rendered at the end of the bar, such as a "Save view" button.
|
|
73
|
+
* @default undefined — no actions region renders.
|
|
74
|
+
*/
|
|
75
|
+
actions?: React.ReactNode | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The consumer's filter controls (Select, DatePicker, Combobox…), laid out in the filters region.
|
|
78
|
+
* @default undefined — no filters region renders.
|
|
79
|
+
*/
|
|
80
|
+
children?: React.ReactNode | undefined;
|
|
81
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/** One applied filter rendered as a removable tag by the {@link FilterBar} block. */
|
|
3
|
+
export interface FilterBarFilter {
|
|
4
|
+
/** Unique identifier, passed back to `onRemoveFilter` and used as the tag's key. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Text rendered on the tag and read by its remove control's accessible name. */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
/** Props for the {@link FilterBar} block. */
|
|
10
|
+
export interface FilterBarProps extends React.ComponentPropsWithRef<'div'> {
|
|
11
|
+
/**
|
|
12
|
+
* Accessible name of the root region, written to `aria-label`.
|
|
13
|
+
* @default 'Filters'
|
|
14
|
+
*/
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Accessible name of the search field; providing it renders the search region.
|
|
18
|
+
* @default undefined — no search region renders.
|
|
19
|
+
*/
|
|
20
|
+
searchLabel?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Placeholder shown in the empty search field.
|
|
23
|
+
* @default undefined — no placeholder renders.
|
|
24
|
+
*/
|
|
25
|
+
searchPlaceholder?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Current search text, for controlled usage; pair with `onSearchValueChange`.
|
|
28
|
+
* @default undefined — uncontrolled, tracks its own value internally.
|
|
29
|
+
*/
|
|
30
|
+
searchValue?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Initial search text, for uncontrolled usage — seeds the internally-tracked value.
|
|
33
|
+
* @default ''
|
|
34
|
+
*/
|
|
35
|
+
defaultSearchValue?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Fires with the new text whenever the search field changes, controlled or not.
|
|
38
|
+
* @default undefined — no-op.
|
|
39
|
+
*/
|
|
40
|
+
onSearchValueChange?: ((value: string) => void) | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Accessible name of the search field's clear button.
|
|
43
|
+
* @default 'Clear search'
|
|
44
|
+
*/
|
|
45
|
+
clearSearchLabel?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The applied filters, in display order, rendered as removable tags; an empty or omitted list renders no active region.
|
|
48
|
+
* @default undefined — no active region renders.
|
|
49
|
+
*/
|
|
50
|
+
activeFilters?: ReadonlyArray<FilterBarFilter> | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Accessible name of the active-filters tag list.
|
|
53
|
+
* @default 'Active filters'
|
|
54
|
+
*/
|
|
55
|
+
activeFiltersLabel?: string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Fires with the removed filter when its tag's remove control is activated.
|
|
58
|
+
* @default undefined — no-op.
|
|
59
|
+
*/
|
|
60
|
+
onRemoveFilter?: ((filter: FilterBarFilter) => void) | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Fires when the clear-filters button is activated; providing it renders the button while filters are active.
|
|
63
|
+
* @default undefined — no clear button renders.
|
|
64
|
+
*/
|
|
65
|
+
onClear?: (() => void) | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Text rendered on the clear-filters button.
|
|
68
|
+
* @default 'Clear filters'
|
|
69
|
+
*/
|
|
70
|
+
clearLabel?: string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Controls rendered at the end of the bar, such as a "Save view" button.
|
|
73
|
+
* @default undefined — no actions region renders.
|
|
74
|
+
*/
|
|
75
|
+
actions?: React.ReactNode | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The consumer's filter controls (Select, DatePicker, Combobox…), laid out in the filters region.
|
|
78
|
+
* @default undefined — no filters region renders.
|
|
79
|
+
*/
|
|
80
|
+
children?: React.ReactNode | undefined;
|
|
81
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var h=Object.create;var u=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)u(t,r,{get:e[r],enumerable:!0})},x=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!$.call(t,o)&&o!==r&&u(t,o,{get:()=>e[o],enumerable:!(s=v(e,o))||s.enumerable});return t};var E=(t,e,r)=>(r=t!=null?h(T(t)):{},x(e||!t||!t.__esModule?u(r,"default",{value:t,enumerable:!0}):r,t)),H=t=>x(u({},"__esModule",{value:!0}),t);var q={};D(q,{ForgotPasswordPage:()=>m});module.exports=H(q);var a=require("@skdx/react"),w=require("@skdx/react/primitives/text-field");var A=E(require("react"),1),f=require("@skdx/react"),d=require("react/jsx-runtime"),g=({parts:t,title:e,error:r,footer:s,children:o,...l})=>{let p=A.useId();return(0,d.jsx)("section",{"aria-labelledby":p,...l,...t.root,children:(0,d.jsxs)("div",{...t.panel,children:[(0,d.jsx)(f.Heading,{as:"h1",id:p,...t.title,children:e}),r?(0,d.jsx)(f.Alert,{status:"danger",...t.error,children:r}):null,o,s&&t.footer?(0,d.jsx)("div",{...t.footer,children:s}):null]})})};g.displayName="AuthPanel";function b(t,e){let r=t.get(e);return typeof r=="string"?r:""}function I(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function i(t,e,r){let s=e==="root",o=s?`skdx-${t}`:`skdx-${t}__${e}`,l={className:I(o,r),"data-part":e};return s&&(l["data-skdx-component"]=t),l}var n=require("react/jsx-runtime"),m=({title:t="Reset your password",description:e,error:r,success:s,pending:o=!1,emailLabel:l="Email",submitLabel:p="Send reset link",footer:F,onRequestReset:k,children:y,...P})=>{let R=c=>{c.preventDefault();let S=new FormData(c.currentTarget);k?.({email:b(S,"email")})};return(0,n.jsxs)(g,{...P,parts:{root:i("forgot-password-page","root",P.className),panel:i("forgot-password-page","panel"),title:i("forgot-password-page","title"),error:i("forgot-password-page","error"),footer:i("forgot-password-page","footer")},title:t,error:r,footer:F,children:[e?(0,n.jsx)(a.Text,{as:"p",tone:"muted",...i("forgot-password-page","description"),children:e}):null,s?(0,n.jsx)(a.Alert,{status:"success",...i("forgot-password-page","success"),children:s}):(0,n.jsxs)(a.Form,{onSubmit:R,...i("forgot-password-page","form"),children:[(0,n.jsx)(a.Field,{label:l,required:!0,...i("forgot-password-page","field"),children:(0,n.jsx)(a.TextField,{name:"email",required:!0,children:(0,n.jsx)(w.TextFieldInput,{type:"email",autoComplete:"email"})})}),y,(0,n.jsx)(a.Button,{type:"submit",loading:o,disabled:o,...i("forgot-password-page","submit"),children:p})]})]})};m.displayName="ForgotPasswordPage";0&&(module.exports={ForgotPasswordPage});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ForgotPasswordPageProps } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Forgot-password block: a description, an email field and a submit button that
|
|
5
|
+
* reports the address through `onRequestReset`, replaced by a success alert once
|
|
6
|
+
* the consumer sets `success`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <ForgotPasswordPage
|
|
11
|
+
* description="We will email you a link to choose a new password."
|
|
12
|
+
* success={sent ? 'Check your inbox.' : undefined}
|
|
13
|
+
* onRequestReset={({ email }) => void requestReset(email)}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const ForgotPasswordPage: {
|
|
18
|
+
({ title, description, error, success, pending, emailLabel, submitLabel, footer, onRequestReset, children, ...props }: ForgotPasswordPageProps): React.ReactNode;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ForgotPasswordPageProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Forgot-password block: a description, an email field and a submit button that
|
|
5
|
+
* reports the address through `onRequestReset`, replaced by a success alert once
|
|
6
|
+
* the consumer sets `success`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <ForgotPasswordPage
|
|
11
|
+
* description="We will email you a link to choose a new password."
|
|
12
|
+
* success={sent ? 'Check your inbox.' : undefined}
|
|
13
|
+
* onRequestReset={({ email }) => void requestReset(email)}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const ForgotPasswordPage: {
|
|
18
|
+
({ title, description, error, success, pending, emailLabel, submitLabel, footer, onRequestReset, children, ...props }: ForgotPasswordPageProps): React.ReactNode;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{Alert as h,Button as v,Field as N,Form as T,Text as $,TextField as D}from"@skdx/react";import{TextFieldInput as E}from"@skdx/react/primitives/text-field";import*as g from"react";import{Alert as k,Heading as y}from"@skdx/react";import{jsx as l,jsxs as R}from"react/jsx-runtime";var p=({parts:t,title:e,error:r,footer:a,children:s,...i})=>{let d=g.useId();return l("section",{"aria-labelledby":d,...i,...t.root,children:R("div",{...t.panel,children:[l(y,{as:"h1",id:d,...t.title,children:e}),r?l(k,{status:"danger",...t.error,children:r}):null,s,a&&t.footer?l("div",{...t.footer,children:a}):null]})})};p.displayName="AuthPanel";function m(t,e){let r=t.get(e);return typeof r=="string"?r:""}function S(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function o(t,e,r){let a=e==="root",s=a?`skdx-${t}`:`skdx-${t}__${e}`,i={className:S(s,r),"data-part":e};return a&&(i["data-skdx-component"]=t),i}import{jsx as n,jsxs as P}from"react/jsx-runtime";var c=({title:t="Reset your password",description:e,error:r,success:a,pending:s=!1,emailLabel:i="Email",submitLabel:d="Send reset link",footer:x,onRequestReset:A,children:b,...u})=>{let w=f=>{f.preventDefault();let F=new FormData(f.currentTarget);A?.({email:m(F,"email")})};return P(p,{...u,parts:{root:o("forgot-password-page","root",u.className),panel:o("forgot-password-page","panel"),title:o("forgot-password-page","title"),error:o("forgot-password-page","error"),footer:o("forgot-password-page","footer")},title:t,error:r,footer:x,children:[e?n($,{as:"p",tone:"muted",...o("forgot-password-page","description"),children:e}):null,a?n(h,{status:"success",...o("forgot-password-page","success"),children:a}):P(T,{onSubmit:w,...o("forgot-password-page","form"),children:[n(N,{label:i,required:!0,...o("forgot-password-page","field"),children:n(D,{name:"email",required:!0,children:n(E,{type:"email",autoComplete:"email"})})}),b,n(v,{type:"submit",loading:s,disabled:s,...o("forgot-password-page","submit"),children:d})]})]})};c.displayName="ForgotPasswordPage";export{c as ForgotPasswordPage};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/** What {@link ForgotPasswordPageProps.onRequestReset} is called with when the form is submitted. */
|
|
3
|
+
export interface ForgotPasswordDetail {
|
|
4
|
+
/** The address the reset link should be sent to, as typed. */
|
|
5
|
+
email: string;
|
|
6
|
+
}
|
|
7
|
+
/** Props for the {@link ForgotPasswordPage} block. */
|
|
8
|
+
export interface ForgotPasswordPageProps extends React.ComponentPropsWithRef<'section'> {
|
|
9
|
+
/**
|
|
10
|
+
* Heading text, rendered into a derived `<h1>` that names the section.
|
|
11
|
+
* @default 'Reset your password'
|
|
12
|
+
*/
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Supporting copy rendered below the title, explaining what the reset link does.
|
|
16
|
+
* @default undefined — no description region renders.
|
|
17
|
+
*/
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Message rendered into a derived error Alert above the form; the block never clears it.
|
|
21
|
+
* @default undefined — no error region renders.
|
|
22
|
+
*/
|
|
23
|
+
error?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Confirmation rendered into a derived success Alert that replaces the form entirely.
|
|
26
|
+
* @default undefined — the form renders instead.
|
|
27
|
+
*/
|
|
28
|
+
success?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Marks the request in flight, making the submit button busy and unusable while the field stays editable.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
pending?: boolean | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Label of the email field the reset link is requested for.
|
|
36
|
+
* @default 'Email'
|
|
37
|
+
*/
|
|
38
|
+
emailLabel?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Text of the form's submit button.
|
|
41
|
+
* @default 'Send reset link'
|
|
42
|
+
*/
|
|
43
|
+
submitLabel?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Navigation rendered below the form, such as a link back to the sign-in page.
|
|
46
|
+
* @default undefined — no footer region renders.
|
|
47
|
+
*/
|
|
48
|
+
footer?: React.ReactNode | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Fires when the form is submitted with a valid address, carrying that address.
|
|
51
|
+
* @default undefined — no-op if omitted.
|
|
52
|
+
*/
|
|
53
|
+
onRequestReset?: ((detail: ForgotPasswordDetail) => void) | undefined;
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/** What {@link ForgotPasswordPageProps.onRequestReset} is called with when the form is submitted. */
|
|
3
|
+
export interface ForgotPasswordDetail {
|
|
4
|
+
/** The address the reset link should be sent to, as typed. */
|
|
5
|
+
email: string;
|
|
6
|
+
}
|
|
7
|
+
/** Props for the {@link ForgotPasswordPage} block. */
|
|
8
|
+
export interface ForgotPasswordPageProps extends React.ComponentPropsWithRef<'section'> {
|
|
9
|
+
/**
|
|
10
|
+
* Heading text, rendered into a derived `<h1>` that names the section.
|
|
11
|
+
* @default 'Reset your password'
|
|
12
|
+
*/
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Supporting copy rendered below the title, explaining what the reset link does.
|
|
16
|
+
* @default undefined — no description region renders.
|
|
17
|
+
*/
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Message rendered into a derived error Alert above the form; the block never clears it.
|
|
21
|
+
* @default undefined — no error region renders.
|
|
22
|
+
*/
|
|
23
|
+
error?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Confirmation rendered into a derived success Alert that replaces the form entirely.
|
|
26
|
+
* @default undefined — the form renders instead.
|
|
27
|
+
*/
|
|
28
|
+
success?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Marks the request in flight, making the submit button busy and unusable while the field stays editable.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
pending?: boolean | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Label of the email field the reset link is requested for.
|
|
36
|
+
* @default 'Email'
|
|
37
|
+
*/
|
|
38
|
+
emailLabel?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Text of the form's submit button.
|
|
41
|
+
* @default 'Send reset link'
|
|
42
|
+
*/
|
|
43
|
+
submitLabel?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Navigation rendered below the form, such as a link back to the sign-in page.
|
|
46
|
+
* @default undefined — no footer region renders.
|
|
47
|
+
*/
|
|
48
|
+
footer?: React.ReactNode | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Fires when the form is submitted with a valid address, carrying that address.
|
|
51
|
+
* @default undefined — no-op if omitted.
|
|
52
|
+
*/
|
|
53
|
+
onRequestReset?: ((detail: ForgotPasswordDetail) => void) | undefined;
|
|
54
|
+
}
|