@streamoid/settings 0.3.7 → 0.3.8
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/README.md +27 -1
- package/dist/index.d.mts +64 -22
- package/dist/index.d.ts +64 -22
- package/dist/index.js +1173 -961
- package/dist/index.mjs +1171 -952
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,7 +58,9 @@ function MySettingsPage() {
|
|
|
58
58
|
revokeToken: (id) => fetch(`/tokens/${id}`, { method: "DELETE" }).then(() => undefined),
|
|
59
59
|
},
|
|
60
60
|
navigation: {
|
|
61
|
-
|
|
61
|
+
// `replace` matters once you wire up `onClose` below — otherwise a
|
|
62
|
+
// history-based close walks back through every tab the user visited.
|
|
63
|
+
navigateToTab: (tab) => router.replace(`/settings/${TAB_TO_URL[tab]}`),
|
|
62
64
|
openExternal: (url) => window.open(url, "_blank", "noopener"),
|
|
63
65
|
},
|
|
64
66
|
toast: {
|
|
@@ -75,11 +77,35 @@ function MySettingsPage() {
|
|
|
75
77
|
<SettingsContent
|
|
76
78
|
activeTab={resolveSettingsTabFromPath(location.pathname)}
|
|
77
79
|
adapters={adapters}
|
|
80
|
+
onClose={() => router.back()}
|
|
78
81
|
/>
|
|
79
82
|
);
|
|
80
83
|
}
|
|
81
84
|
```
|
|
82
85
|
|
|
86
|
+
## Closing settings
|
|
87
|
+
|
|
88
|
+
Settings is a full page in every host, so the package cannot decide what
|
|
89
|
+
"closed" means — pass `onClose` (or `adapters.navigation.close`) and the shell
|
|
90
|
+
renders a × button in the header and dismisses on `Escape`. Pass neither and no
|
|
91
|
+
close affordance appears.
|
|
92
|
+
|
|
93
|
+
Escape defers to anything stacked on top of the panel. `overlay-registry.ts`
|
|
94
|
+
keeps an ordered stack of open modals — only the frontmost one acts on a press,
|
|
95
|
+
and the shell acts only once the stack is empty. The billing **Plans** sub-view
|
|
96
|
+
steps back to billing before the panel itself closes.
|
|
97
|
+
|
|
98
|
+
Modals added to this package should call `useOverlayOpen(open, onClose)` at the
|
|
99
|
+
top of the component. That is what registers them in the stack; skip it and
|
|
100
|
+
Escape will close the whole panel out from under the modal.
|
|
101
|
+
|
|
102
|
+
## Explaining the tabs
|
|
103
|
+
|
|
104
|
+
Every sub-nav destination carries a hover/focus tooltip sourced from the
|
|
105
|
+
exported `TAB_DESCRIPTIONS` map. Override the copy in your host by rendering
|
|
106
|
+
your own nav, or edit the map here so all hosts stay consistent — the latter is
|
|
107
|
+
usually what you want.
|
|
108
|
+
|
|
83
109
|
## Adapter surface
|
|
84
110
|
|
|
85
111
|
| Adapter | Purpose |
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { SVGProps, ReactNode } from 'react';
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { SVGProps, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Settings tab identifiers and URL mapping helpers.
|
|
@@ -16,6 +16,13 @@ declare const TAB_TO_URL: Record<SettingsTab, string>;
|
|
|
16
16
|
declare const URL_TO_TAB: Record<string, SettingsTab>;
|
|
17
17
|
/** Human-readable label for each tab (used for breadcrumbs etc.). */
|
|
18
18
|
declare const TAB_LABELS: Record<SettingsTab, string>;
|
|
19
|
+
/**
|
|
20
|
+
* One-line explanation of what each destination is for, shown on hover over the
|
|
21
|
+
* settings sub-nav. Kept next to `TAB_LABELS` so a new tab can't get a label
|
|
22
|
+
* without also getting an explanation — `Record<SettingsTab, string>` makes
|
|
23
|
+
* omitting one a type error.
|
|
24
|
+
*/
|
|
25
|
+
declare const TAB_DESCRIPTIONS: Record<SettingsTab, string>;
|
|
19
26
|
/**
|
|
20
27
|
* Resolve a `SettingsTab` from a URL pathname. Looks for the last segment that
|
|
21
28
|
* matches a known slug; falls back to `"profile"` (the default Account tab).
|
|
@@ -702,6 +709,13 @@ interface SettingsNavigationAdapter {
|
|
|
702
709
|
getCheckoutReturnUrl?: (kind: "success" | "cancel") => string;
|
|
703
710
|
/** Imperative navigate to another settings tab. */
|
|
704
711
|
navigateToTab: (tab: SettingsTab) => void;
|
|
712
|
+
/**
|
|
713
|
+
* Leave settings entirely. Supplying this makes the shell render a close (×)
|
|
714
|
+
* button and dismiss on Escape. Hosts that would rather pass a callback
|
|
715
|
+
* directly can use the `onClose` prop on `<SettingsContent>` instead — it
|
|
716
|
+
* takes precedence over this.
|
|
717
|
+
*/
|
|
718
|
+
close?: () => void;
|
|
705
719
|
/** External-link navigate (e.g. for "What's new" or referral promo links). */
|
|
706
720
|
openExternal: (url: string) => void;
|
|
707
721
|
}
|
|
@@ -729,7 +743,7 @@ type WorkspaceInfo = SettingsWorkspaceListItem & {
|
|
|
729
743
|
plan?: string;
|
|
730
744
|
ownerEmail?: string;
|
|
731
745
|
};
|
|
732
|
-
declare function ProfileTab():
|
|
746
|
+
declare function ProfileTab(): react.JSX.Element;
|
|
733
747
|
declare function WorkspaceTab({ workspaces, loading, onCreateClick: _onCreateClick, onEditClick, onSwitchClick, onLeaveClick, }: {
|
|
734
748
|
workspaces: WorkspaceInfo[];
|
|
735
749
|
loading: boolean;
|
|
@@ -737,21 +751,31 @@ declare function WorkspaceTab({ workspaces, loading, onCreateClick: _onCreateCli
|
|
|
737
751
|
onEditClick: (ws: WorkspaceInfo) => void;
|
|
738
752
|
onSwitchClick: (ws: WorkspaceInfo) => void;
|
|
739
753
|
onLeaveClick: (ws: WorkspaceInfo) => void;
|
|
740
|
-
}):
|
|
741
|
-
declare function ReferralTab():
|
|
754
|
+
}): react.JSX.Element;
|
|
755
|
+
declare function ReferralTab(): react.JSX.Element;
|
|
742
756
|
interface SettingsContentProps {
|
|
743
757
|
adapters: SettingsAdapters;
|
|
744
758
|
/** Currently active tab. The host owns routing and resolves this from the URL. */
|
|
745
759
|
activeTab?: SettingsTab;
|
|
760
|
+
/**
|
|
761
|
+
* Leave settings. When supplied, the shell renders a close (×) button in the
|
|
762
|
+
* header and dismisses on Escape; the host decides where "closed" goes
|
|
763
|
+
* (settings is a full route in most hosts, not an overlay).
|
|
764
|
+
*
|
|
765
|
+
* Falls back to `adapters.navigation.close` so hosts that already build an
|
|
766
|
+
* adapter object don't have to thread a second prop through. Omit both and
|
|
767
|
+
* no close affordance is rendered — that is the pre-0.3.8 behaviour.
|
|
768
|
+
*/
|
|
769
|
+
onClose?: () => void;
|
|
746
770
|
}
|
|
747
|
-
declare function SettingsContent({ adapters, activeTab }: SettingsContentProps):
|
|
771
|
+
declare function SettingsContent({ adapters, activeTab, onClose, }: SettingsContentProps): react.JSX.Element;
|
|
748
772
|
|
|
749
773
|
type IconProps = Omit<SVGProps<SVGSVGElement>, 'color' | 'strokeWidth' | 'width' | 'height'> & {
|
|
750
774
|
color?: string;
|
|
751
775
|
strokeWidth?: number | string;
|
|
752
776
|
size?: number | string;
|
|
753
777
|
};
|
|
754
|
-
declare const SiconKey: ({ color, strokeWidth, size, ...props }: IconProps) =>
|
|
778
|
+
declare const SiconKey: ({ color, strokeWidth, size, ...props }: IconProps) => react.JSX.Element;
|
|
755
779
|
|
|
756
780
|
declare function BillingContent({ embedded, showPlans: showPlansProp, onShowPlansChange, }?: {
|
|
757
781
|
embedded?: boolean;
|
|
@@ -759,19 +783,19 @@ declare function BillingContent({ embedded, showPlans: showPlansProp, onShowPlan
|
|
|
759
783
|
* wrapper) owns it so it can hide the sub-nav + show the Plans breadcrumb. */
|
|
760
784
|
showPlans?: boolean;
|
|
761
785
|
onShowPlansChange?: (open: boolean) => void;
|
|
762
|
-
}):
|
|
786
|
+
}): react__default.JSX.Element;
|
|
763
787
|
|
|
764
788
|
declare function TeamsContent({ embedded, onInviteOpen, onInviteOpenChange, }?: {
|
|
765
789
|
embedded?: boolean;
|
|
766
790
|
onInviteOpen?: boolean;
|
|
767
791
|
onInviteOpenChange?: (open: boolean) => void;
|
|
768
|
-
}):
|
|
792
|
+
}): react.JSX.Element;
|
|
769
793
|
|
|
770
794
|
declare function OrganizationContent({ embedded, onInviteOpen, onInviteOpenChange, }?: {
|
|
771
795
|
embedded?: boolean;
|
|
772
796
|
onInviteOpen?: boolean;
|
|
773
797
|
onInviteOpenChange?: (open: boolean) => void;
|
|
774
|
-
}):
|
|
798
|
+
}): react.JSX.Element;
|
|
775
799
|
|
|
776
800
|
declare function TokensContent({ embedded, showRevokedOverride, onShowRevokedChange: _onShowRevokedChange, createOpenOverride, onCreateOpenChange, }?: {
|
|
777
801
|
embedded?: boolean;
|
|
@@ -779,7 +803,7 @@ declare function TokensContent({ embedded, showRevokedOverride, onShowRevokedCha
|
|
|
779
803
|
onShowRevokedChange?: (v: boolean) => void;
|
|
780
804
|
createOpenOverride?: boolean;
|
|
781
805
|
onCreateOpenChange?: (v: boolean) => void;
|
|
782
|
-
}):
|
|
806
|
+
}): react.JSX.Element;
|
|
783
807
|
|
|
784
808
|
interface ProfileAvatarProps {
|
|
785
809
|
name: string;
|
|
@@ -792,7 +816,25 @@ interface ProfileAvatarProps {
|
|
|
792
816
|
* Renders a profile/workspace avatar using ScDp.
|
|
793
817
|
* Automatically shows image or initials fallback.
|
|
794
818
|
*/
|
|
795
|
-
declare function ProfileAvatar({ name, profileImage, size, initialsClassName, borderRadius, }: ProfileAvatarProps):
|
|
819
|
+
declare function ProfileAvatar({ name, profileImage, size, initialsClassName, borderRadius, }: ProfileAvatarProps): react.JSX.Element;
|
|
820
|
+
|
|
821
|
+
type SettingsTooltipPlacement = "right" | "top" | "bottom";
|
|
822
|
+
interface SettingsTooltipProps {
|
|
823
|
+
/** Explanation shown on hover / keyboard focus. Falsy renders the child bare. */
|
|
824
|
+
content?: ReactNode;
|
|
825
|
+
/** Preferred side. Flips to the opposite side when it would overflow. */
|
|
826
|
+
placement?: SettingsTooltipPlacement;
|
|
827
|
+
/** Milliseconds to hover before the tooltip opens. Closing is immediate. */
|
|
828
|
+
delay?: number;
|
|
829
|
+
children: ReactNode;
|
|
830
|
+
className?: string;
|
|
831
|
+
/**
|
|
832
|
+
* The wrapper defaults to `display: block` so full-width nav rows keep their
|
|
833
|
+
* width. Set this for triggers that sit inside a flex row (buttons, chips).
|
|
834
|
+
*/
|
|
835
|
+
inline?: boolean;
|
|
836
|
+
}
|
|
837
|
+
declare function SettingsTooltip({ content, placement, delay, children, className, inline, }: SettingsTooltipProps): react.JSX.Element;
|
|
796
838
|
|
|
797
839
|
interface WorkspaceData {
|
|
798
840
|
id: string;
|
|
@@ -815,7 +857,7 @@ interface WorkspaceModalProps {
|
|
|
815
857
|
onLeave?: () => void | boolean | Promise<void | boolean>;
|
|
816
858
|
onDelete?: () => void | boolean | Promise<void | boolean>;
|
|
817
859
|
}
|
|
818
|
-
declare function WorkspaceModal({ open, mode, workspace, onClose, onCreate, onUpdate, onLeave, onDelete, }: WorkspaceModalProps):
|
|
860
|
+
declare function WorkspaceModal({ open, mode, workspace, onClose, onCreate, onUpdate, onLeave, onDelete, }: WorkspaceModalProps): react.JSX.Element | null;
|
|
819
861
|
|
|
820
862
|
interface OrganizationData {
|
|
821
863
|
id: string;
|
|
@@ -835,7 +877,7 @@ interface OrganizationModalProps {
|
|
|
835
877
|
onUpdate?: (name: string, imageFile: File | null, imageRemoved: boolean) => void | boolean | Promise<void | boolean>;
|
|
836
878
|
onDelete?: () => void | boolean | Promise<void | boolean>;
|
|
837
879
|
}
|
|
838
|
-
declare function OrganizationModal({ open, mode, organization, onClose, onCreate, onUpdate, onDelete, }: OrganizationModalProps):
|
|
880
|
+
declare function OrganizationModal({ open, mode, organization, onClose, onCreate, onUpdate, onDelete, }: OrganizationModalProps): react.JSX.Element | null;
|
|
839
881
|
|
|
840
882
|
type ModalMode$1 = "invite" | "update";
|
|
841
883
|
interface OrganizationInviteModalProps {
|
|
@@ -864,7 +906,7 @@ interface OrganizationInviteModalProps {
|
|
|
864
906
|
}) => void;
|
|
865
907
|
onRemove?: () => void;
|
|
866
908
|
}
|
|
867
|
-
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps):
|
|
909
|
+
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps): react.JSX.Element | null;
|
|
868
910
|
|
|
869
911
|
interface ConfirmLeaveModalProps {
|
|
870
912
|
open: boolean;
|
|
@@ -876,7 +918,7 @@ interface ConfirmLeaveModalProps {
|
|
|
876
918
|
/** Called when user clicks "Go to Teams" in the sole admin variant */
|
|
877
919
|
onGoToTeams?: () => void;
|
|
878
920
|
}
|
|
879
|
-
declare function ConfirmLeaveModal({ open, workspaceName, isSoleAdmin, onClose, onConfirm, onGoToTeams, }: ConfirmLeaveModalProps):
|
|
921
|
+
declare function ConfirmLeaveModal({ open, workspaceName, isSoleAdmin, onClose, onConfirm, onGoToTeams, }: ConfirmLeaveModalProps): react.JSX.Element | null;
|
|
880
922
|
|
|
881
923
|
interface ConfirmDeleteModalProps {
|
|
882
924
|
open: boolean;
|
|
@@ -884,7 +926,7 @@ interface ConfirmDeleteModalProps {
|
|
|
884
926
|
onClose: () => void;
|
|
885
927
|
onConfirm: () => void | Promise<void>;
|
|
886
928
|
}
|
|
887
|
-
declare function ConfirmDeleteModal({ open, workspaceName, onClose, onConfirm, }: ConfirmDeleteModalProps):
|
|
929
|
+
declare function ConfirmDeleteModal({ open, workspaceName, onClose, onConfirm, }: ConfirmDeleteModalProps): react.JSX.Element | null;
|
|
888
930
|
|
|
889
931
|
interface BuyCreditsModalProps {
|
|
890
932
|
currencySymbol?: string;
|
|
@@ -892,7 +934,7 @@ interface BuyCreditsModalProps {
|
|
|
892
934
|
onClose: () => void;
|
|
893
935
|
onBuy: (credits: number, price: number) => void;
|
|
894
936
|
}
|
|
895
|
-
declare function BuyCreditsModal({ currencySymbol, country, onClose, onBuy, }: BuyCreditsModalProps):
|
|
937
|
+
declare function BuyCreditsModal({ currencySymbol, country, onClose, onBuy, }: BuyCreditsModalProps): react.JSX.Element;
|
|
896
938
|
|
|
897
939
|
interface UserPermissions {
|
|
898
940
|
artifax: boolean;
|
|
@@ -940,19 +982,19 @@ interface InviteUpdateModalProps {
|
|
|
940
982
|
/** Called only in invite mode; receives (permissions, email) */
|
|
941
983
|
onInvite?: (permissions: UserPermissions, email: string) => void;
|
|
942
984
|
}
|
|
943
|
-
declare function InviteUpdateModal({ open, mode, userEmail, stores, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, onInvite, }: InviteUpdateModalProps):
|
|
985
|
+
declare function InviteUpdateModal({ open, mode, userEmail, stores, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
944
986
|
|
|
945
987
|
interface ExportDateModalProps {
|
|
946
988
|
title: string;
|
|
947
989
|
onClose: () => void;
|
|
948
990
|
onExport: (startDate: Date, endDate: Date) => void;
|
|
949
991
|
}
|
|
950
|
-
declare function ExportDateModal({ title, onClose, onExport, }: ExportDateModalProps):
|
|
992
|
+
declare function ExportDateModal({ title, onClose, onExport, }: ExportDateModalProps): react.JSX.Element;
|
|
951
993
|
|
|
952
994
|
declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
953
995
|
adapters: SettingsAdapters;
|
|
954
996
|
children: ReactNode;
|
|
955
|
-
}):
|
|
997
|
+
}): react.JSX.Element;
|
|
956
998
|
/**
|
|
957
999
|
* Read the host-provided adapters from anywhere inside <SettingsContent>.
|
|
958
1000
|
* Throws at runtime if used outside the provider — which only happens if a
|
|
@@ -960,4 +1002,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
|
960
1002
|
*/
|
|
961
1003
|
declare function useSettingsAdapters(): SettingsAdapters;
|
|
962
1004
|
|
|
963
|
-
export { type ApiToken, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsTab, type SettingsToastAdapter, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_LABELS, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserPermissions, type WorkspaceData, type WorkspaceInvite, type WorkspaceMember, WorkspaceModal, WorkspaceTab, resolveSettingsTabFromPath, useSettingsAdapters };
|
|
1005
|
+
export { type ApiToken, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserPermissions, type WorkspaceData, type WorkspaceInvite, type WorkspaceMember, WorkspaceModal, WorkspaceTab, resolveSettingsTabFromPath, useSettingsAdapters };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { SVGProps, ReactNode } from 'react';
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { SVGProps, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Settings tab identifiers and URL mapping helpers.
|
|
@@ -16,6 +16,13 @@ declare const TAB_TO_URL: Record<SettingsTab, string>;
|
|
|
16
16
|
declare const URL_TO_TAB: Record<string, SettingsTab>;
|
|
17
17
|
/** Human-readable label for each tab (used for breadcrumbs etc.). */
|
|
18
18
|
declare const TAB_LABELS: Record<SettingsTab, string>;
|
|
19
|
+
/**
|
|
20
|
+
* One-line explanation of what each destination is for, shown on hover over the
|
|
21
|
+
* settings sub-nav. Kept next to `TAB_LABELS` so a new tab can't get a label
|
|
22
|
+
* without also getting an explanation — `Record<SettingsTab, string>` makes
|
|
23
|
+
* omitting one a type error.
|
|
24
|
+
*/
|
|
25
|
+
declare const TAB_DESCRIPTIONS: Record<SettingsTab, string>;
|
|
19
26
|
/**
|
|
20
27
|
* Resolve a `SettingsTab` from a URL pathname. Looks for the last segment that
|
|
21
28
|
* matches a known slug; falls back to `"profile"` (the default Account tab).
|
|
@@ -702,6 +709,13 @@ interface SettingsNavigationAdapter {
|
|
|
702
709
|
getCheckoutReturnUrl?: (kind: "success" | "cancel") => string;
|
|
703
710
|
/** Imperative navigate to another settings tab. */
|
|
704
711
|
navigateToTab: (tab: SettingsTab) => void;
|
|
712
|
+
/**
|
|
713
|
+
* Leave settings entirely. Supplying this makes the shell render a close (×)
|
|
714
|
+
* button and dismiss on Escape. Hosts that would rather pass a callback
|
|
715
|
+
* directly can use the `onClose` prop on `<SettingsContent>` instead — it
|
|
716
|
+
* takes precedence over this.
|
|
717
|
+
*/
|
|
718
|
+
close?: () => void;
|
|
705
719
|
/** External-link navigate (e.g. for "What's new" or referral promo links). */
|
|
706
720
|
openExternal: (url: string) => void;
|
|
707
721
|
}
|
|
@@ -729,7 +743,7 @@ type WorkspaceInfo = SettingsWorkspaceListItem & {
|
|
|
729
743
|
plan?: string;
|
|
730
744
|
ownerEmail?: string;
|
|
731
745
|
};
|
|
732
|
-
declare function ProfileTab():
|
|
746
|
+
declare function ProfileTab(): react.JSX.Element;
|
|
733
747
|
declare function WorkspaceTab({ workspaces, loading, onCreateClick: _onCreateClick, onEditClick, onSwitchClick, onLeaveClick, }: {
|
|
734
748
|
workspaces: WorkspaceInfo[];
|
|
735
749
|
loading: boolean;
|
|
@@ -737,21 +751,31 @@ declare function WorkspaceTab({ workspaces, loading, onCreateClick: _onCreateCli
|
|
|
737
751
|
onEditClick: (ws: WorkspaceInfo) => void;
|
|
738
752
|
onSwitchClick: (ws: WorkspaceInfo) => void;
|
|
739
753
|
onLeaveClick: (ws: WorkspaceInfo) => void;
|
|
740
|
-
}):
|
|
741
|
-
declare function ReferralTab():
|
|
754
|
+
}): react.JSX.Element;
|
|
755
|
+
declare function ReferralTab(): react.JSX.Element;
|
|
742
756
|
interface SettingsContentProps {
|
|
743
757
|
adapters: SettingsAdapters;
|
|
744
758
|
/** Currently active tab. The host owns routing and resolves this from the URL. */
|
|
745
759
|
activeTab?: SettingsTab;
|
|
760
|
+
/**
|
|
761
|
+
* Leave settings. When supplied, the shell renders a close (×) button in the
|
|
762
|
+
* header and dismisses on Escape; the host decides where "closed" goes
|
|
763
|
+
* (settings is a full route in most hosts, not an overlay).
|
|
764
|
+
*
|
|
765
|
+
* Falls back to `adapters.navigation.close` so hosts that already build an
|
|
766
|
+
* adapter object don't have to thread a second prop through. Omit both and
|
|
767
|
+
* no close affordance is rendered — that is the pre-0.3.8 behaviour.
|
|
768
|
+
*/
|
|
769
|
+
onClose?: () => void;
|
|
746
770
|
}
|
|
747
|
-
declare function SettingsContent({ adapters, activeTab }: SettingsContentProps):
|
|
771
|
+
declare function SettingsContent({ adapters, activeTab, onClose, }: SettingsContentProps): react.JSX.Element;
|
|
748
772
|
|
|
749
773
|
type IconProps = Omit<SVGProps<SVGSVGElement>, 'color' | 'strokeWidth' | 'width' | 'height'> & {
|
|
750
774
|
color?: string;
|
|
751
775
|
strokeWidth?: number | string;
|
|
752
776
|
size?: number | string;
|
|
753
777
|
};
|
|
754
|
-
declare const SiconKey: ({ color, strokeWidth, size, ...props }: IconProps) =>
|
|
778
|
+
declare const SiconKey: ({ color, strokeWidth, size, ...props }: IconProps) => react.JSX.Element;
|
|
755
779
|
|
|
756
780
|
declare function BillingContent({ embedded, showPlans: showPlansProp, onShowPlansChange, }?: {
|
|
757
781
|
embedded?: boolean;
|
|
@@ -759,19 +783,19 @@ declare function BillingContent({ embedded, showPlans: showPlansProp, onShowPlan
|
|
|
759
783
|
* wrapper) owns it so it can hide the sub-nav + show the Plans breadcrumb. */
|
|
760
784
|
showPlans?: boolean;
|
|
761
785
|
onShowPlansChange?: (open: boolean) => void;
|
|
762
|
-
}):
|
|
786
|
+
}): react__default.JSX.Element;
|
|
763
787
|
|
|
764
788
|
declare function TeamsContent({ embedded, onInviteOpen, onInviteOpenChange, }?: {
|
|
765
789
|
embedded?: boolean;
|
|
766
790
|
onInviteOpen?: boolean;
|
|
767
791
|
onInviteOpenChange?: (open: boolean) => void;
|
|
768
|
-
}):
|
|
792
|
+
}): react.JSX.Element;
|
|
769
793
|
|
|
770
794
|
declare function OrganizationContent({ embedded, onInviteOpen, onInviteOpenChange, }?: {
|
|
771
795
|
embedded?: boolean;
|
|
772
796
|
onInviteOpen?: boolean;
|
|
773
797
|
onInviteOpenChange?: (open: boolean) => void;
|
|
774
|
-
}):
|
|
798
|
+
}): react.JSX.Element;
|
|
775
799
|
|
|
776
800
|
declare function TokensContent({ embedded, showRevokedOverride, onShowRevokedChange: _onShowRevokedChange, createOpenOverride, onCreateOpenChange, }?: {
|
|
777
801
|
embedded?: boolean;
|
|
@@ -779,7 +803,7 @@ declare function TokensContent({ embedded, showRevokedOverride, onShowRevokedCha
|
|
|
779
803
|
onShowRevokedChange?: (v: boolean) => void;
|
|
780
804
|
createOpenOverride?: boolean;
|
|
781
805
|
onCreateOpenChange?: (v: boolean) => void;
|
|
782
|
-
}):
|
|
806
|
+
}): react.JSX.Element;
|
|
783
807
|
|
|
784
808
|
interface ProfileAvatarProps {
|
|
785
809
|
name: string;
|
|
@@ -792,7 +816,25 @@ interface ProfileAvatarProps {
|
|
|
792
816
|
* Renders a profile/workspace avatar using ScDp.
|
|
793
817
|
* Automatically shows image or initials fallback.
|
|
794
818
|
*/
|
|
795
|
-
declare function ProfileAvatar({ name, profileImage, size, initialsClassName, borderRadius, }: ProfileAvatarProps):
|
|
819
|
+
declare function ProfileAvatar({ name, profileImage, size, initialsClassName, borderRadius, }: ProfileAvatarProps): react.JSX.Element;
|
|
820
|
+
|
|
821
|
+
type SettingsTooltipPlacement = "right" | "top" | "bottom";
|
|
822
|
+
interface SettingsTooltipProps {
|
|
823
|
+
/** Explanation shown on hover / keyboard focus. Falsy renders the child bare. */
|
|
824
|
+
content?: ReactNode;
|
|
825
|
+
/** Preferred side. Flips to the opposite side when it would overflow. */
|
|
826
|
+
placement?: SettingsTooltipPlacement;
|
|
827
|
+
/** Milliseconds to hover before the tooltip opens. Closing is immediate. */
|
|
828
|
+
delay?: number;
|
|
829
|
+
children: ReactNode;
|
|
830
|
+
className?: string;
|
|
831
|
+
/**
|
|
832
|
+
* The wrapper defaults to `display: block` so full-width nav rows keep their
|
|
833
|
+
* width. Set this for triggers that sit inside a flex row (buttons, chips).
|
|
834
|
+
*/
|
|
835
|
+
inline?: boolean;
|
|
836
|
+
}
|
|
837
|
+
declare function SettingsTooltip({ content, placement, delay, children, className, inline, }: SettingsTooltipProps): react.JSX.Element;
|
|
796
838
|
|
|
797
839
|
interface WorkspaceData {
|
|
798
840
|
id: string;
|
|
@@ -815,7 +857,7 @@ interface WorkspaceModalProps {
|
|
|
815
857
|
onLeave?: () => void | boolean | Promise<void | boolean>;
|
|
816
858
|
onDelete?: () => void | boolean | Promise<void | boolean>;
|
|
817
859
|
}
|
|
818
|
-
declare function WorkspaceModal({ open, mode, workspace, onClose, onCreate, onUpdate, onLeave, onDelete, }: WorkspaceModalProps):
|
|
860
|
+
declare function WorkspaceModal({ open, mode, workspace, onClose, onCreate, onUpdate, onLeave, onDelete, }: WorkspaceModalProps): react.JSX.Element | null;
|
|
819
861
|
|
|
820
862
|
interface OrganizationData {
|
|
821
863
|
id: string;
|
|
@@ -835,7 +877,7 @@ interface OrganizationModalProps {
|
|
|
835
877
|
onUpdate?: (name: string, imageFile: File | null, imageRemoved: boolean) => void | boolean | Promise<void | boolean>;
|
|
836
878
|
onDelete?: () => void | boolean | Promise<void | boolean>;
|
|
837
879
|
}
|
|
838
|
-
declare function OrganizationModal({ open, mode, organization, onClose, onCreate, onUpdate, onDelete, }: OrganizationModalProps):
|
|
880
|
+
declare function OrganizationModal({ open, mode, organization, onClose, onCreate, onUpdate, onDelete, }: OrganizationModalProps): react.JSX.Element | null;
|
|
839
881
|
|
|
840
882
|
type ModalMode$1 = "invite" | "update";
|
|
841
883
|
interface OrganizationInviteModalProps {
|
|
@@ -864,7 +906,7 @@ interface OrganizationInviteModalProps {
|
|
|
864
906
|
}) => void;
|
|
865
907
|
onRemove?: () => void;
|
|
866
908
|
}
|
|
867
|
-
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps):
|
|
909
|
+
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps): react.JSX.Element | null;
|
|
868
910
|
|
|
869
911
|
interface ConfirmLeaveModalProps {
|
|
870
912
|
open: boolean;
|
|
@@ -876,7 +918,7 @@ interface ConfirmLeaveModalProps {
|
|
|
876
918
|
/** Called when user clicks "Go to Teams" in the sole admin variant */
|
|
877
919
|
onGoToTeams?: () => void;
|
|
878
920
|
}
|
|
879
|
-
declare function ConfirmLeaveModal({ open, workspaceName, isSoleAdmin, onClose, onConfirm, onGoToTeams, }: ConfirmLeaveModalProps):
|
|
921
|
+
declare function ConfirmLeaveModal({ open, workspaceName, isSoleAdmin, onClose, onConfirm, onGoToTeams, }: ConfirmLeaveModalProps): react.JSX.Element | null;
|
|
880
922
|
|
|
881
923
|
interface ConfirmDeleteModalProps {
|
|
882
924
|
open: boolean;
|
|
@@ -884,7 +926,7 @@ interface ConfirmDeleteModalProps {
|
|
|
884
926
|
onClose: () => void;
|
|
885
927
|
onConfirm: () => void | Promise<void>;
|
|
886
928
|
}
|
|
887
|
-
declare function ConfirmDeleteModal({ open, workspaceName, onClose, onConfirm, }: ConfirmDeleteModalProps):
|
|
929
|
+
declare function ConfirmDeleteModal({ open, workspaceName, onClose, onConfirm, }: ConfirmDeleteModalProps): react.JSX.Element | null;
|
|
888
930
|
|
|
889
931
|
interface BuyCreditsModalProps {
|
|
890
932
|
currencySymbol?: string;
|
|
@@ -892,7 +934,7 @@ interface BuyCreditsModalProps {
|
|
|
892
934
|
onClose: () => void;
|
|
893
935
|
onBuy: (credits: number, price: number) => void;
|
|
894
936
|
}
|
|
895
|
-
declare function BuyCreditsModal({ currencySymbol, country, onClose, onBuy, }: BuyCreditsModalProps):
|
|
937
|
+
declare function BuyCreditsModal({ currencySymbol, country, onClose, onBuy, }: BuyCreditsModalProps): react.JSX.Element;
|
|
896
938
|
|
|
897
939
|
interface UserPermissions {
|
|
898
940
|
artifax: boolean;
|
|
@@ -940,19 +982,19 @@ interface InviteUpdateModalProps {
|
|
|
940
982
|
/** Called only in invite mode; receives (permissions, email) */
|
|
941
983
|
onInvite?: (permissions: UserPermissions, email: string) => void;
|
|
942
984
|
}
|
|
943
|
-
declare function InviteUpdateModal({ open, mode, userEmail, stores, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, onInvite, }: InviteUpdateModalProps):
|
|
985
|
+
declare function InviteUpdateModal({ open, mode, userEmail, stores, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
944
986
|
|
|
945
987
|
interface ExportDateModalProps {
|
|
946
988
|
title: string;
|
|
947
989
|
onClose: () => void;
|
|
948
990
|
onExport: (startDate: Date, endDate: Date) => void;
|
|
949
991
|
}
|
|
950
|
-
declare function ExportDateModal({ title, onClose, onExport, }: ExportDateModalProps):
|
|
992
|
+
declare function ExportDateModal({ title, onClose, onExport, }: ExportDateModalProps): react.JSX.Element;
|
|
951
993
|
|
|
952
994
|
declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
953
995
|
adapters: SettingsAdapters;
|
|
954
996
|
children: ReactNode;
|
|
955
|
-
}):
|
|
997
|
+
}): react.JSX.Element;
|
|
956
998
|
/**
|
|
957
999
|
* Read the host-provided adapters from anywhere inside <SettingsContent>.
|
|
958
1000
|
* Throws at runtime if used outside the provider — which only happens if a
|
|
@@ -960,4 +1002,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
|
960
1002
|
*/
|
|
961
1003
|
declare function useSettingsAdapters(): SettingsAdapters;
|
|
962
1004
|
|
|
963
|
-
export { type ApiToken, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsTab, type SettingsToastAdapter, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_LABELS, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserPermissions, type WorkspaceData, type WorkspaceInvite, type WorkspaceMember, WorkspaceModal, WorkspaceTab, resolveSettingsTabFromPath, useSettingsAdapters };
|
|
1005
|
+
export { type ApiToken, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, ExportDateModal, InviteUpdateModal, type InvoicePdfResponse, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationInvite, OrganizationInviteModal, type OrganizationInviteModalProps, type OrganizationJoinRequest, type OrganizationMember, OrganizationModal, type OrganizationWorkspaceItem, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, type UserPermissions, type WorkspaceData, type WorkspaceInvite, type WorkspaceMember, WorkspaceModal, WorkspaceTab, resolveSettingsTabFromPath, useSettingsAdapters };
|