@vantageos/mosaic-blocks 0.2.2-alpha → 0.2.4-alpha
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/index.cjs +71 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +113 -17
- package/dist/index.d.ts +113 -17
- package/dist/index.js +71 -28
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +71 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +30 -0
- package/dist/server.d.ts +30 -0
- package/dist/server.js +68 -0
- package/dist/server.js.map +1 -0
- package/package.json +6 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
2
|
import { Button } from '@base-ui/react/button';
|
|
4
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { buttonVariants, badgeVariants } from './server.cjs';
|
|
5
5
|
import { Avatar } from '@base-ui/react/avatar';
|
|
6
6
|
import { Input } from '@base-ui/react/input';
|
|
7
7
|
import { Field } from '@base-ui/react/field';
|
|
8
8
|
import { Switch } from '@base-ui/react/switch';
|
|
9
|
+
import 'class-variance-authority/types';
|
|
9
10
|
|
|
10
11
|
declare const version = "0.1.0-alpha.1";
|
|
11
12
|
|
|
@@ -18,10 +19,17 @@ interface PlaceholderProps {
|
|
|
18
19
|
}
|
|
19
20
|
declare function Placeholder({ label }: PlaceholderProps): React.JSX.Element;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/**
|
|
23
|
+
* MosaicButton — @base-ui/react Button primitive
|
|
24
|
+
*
|
|
25
|
+
* Ported from heyfabrika/styleui (MIT) with namespace and import adaptations.
|
|
26
|
+
* Source: https://github.com/heyfabrika/styleui/blob/main/components/ui/button.tsx
|
|
27
|
+
*
|
|
28
|
+
* Uses @base-ui/react/button as the headless base per ADR-0001.
|
|
29
|
+
* Styling: Tailwind v4 + cva variants. No tailwind-merge needed (single source).
|
|
30
|
+
* API: data-slot="button" attribution, ref as regular prop (React 19).
|
|
31
|
+
*/
|
|
32
|
+
|
|
25
33
|
interface MosaicButtonProps extends Omit<Button.Props, "ref">, VariantProps<typeof buttonVariants> {
|
|
26
34
|
className?: string;
|
|
27
35
|
/** ref is typed as HTMLElement to preserve the original public API surface */
|
|
@@ -802,9 +810,15 @@ declare namespace MosaicCardFooter {
|
|
|
802
810
|
var displayName: string;
|
|
803
811
|
}
|
|
804
812
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
813
|
+
/**
|
|
814
|
+
* MosaicBadge — style-only badge atom
|
|
815
|
+
*
|
|
816
|
+
* Renders a <span> with cva variants: default, secondary, destructive, outline.
|
|
817
|
+
* data-slot="badge" for composability.
|
|
818
|
+
*
|
|
819
|
+
* Design tokens: Tailwind v4 semantic classes only. No hardcoded colors.
|
|
820
|
+
*/
|
|
821
|
+
|
|
808
822
|
interface MosaicBadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
809
823
|
className?: string;
|
|
810
824
|
ref?: React.Ref<HTMLSpanElement>;
|
|
@@ -1624,6 +1638,18 @@ declare namespace MosaicQuickActionCard {
|
|
|
1624
1638
|
*/
|
|
1625
1639
|
|
|
1626
1640
|
type MosaicActivityStatus = "active" | "completed" | "archived";
|
|
1641
|
+
/**
|
|
1642
|
+
* Participant shape.
|
|
1643
|
+
*
|
|
1644
|
+
* Two forms accepted (union, both backward-compat):
|
|
1645
|
+
* - `string` — plain label, rendered as initials avatar (original API)
|
|
1646
|
+
* - `{ actor?: string; excerpt?: string }` — structured form (VP ActivityEvent shape)
|
|
1647
|
+
* `actor` is used as the avatar label; `excerpt` is surfaced as a sub-line when rendering.
|
|
1648
|
+
*/
|
|
1649
|
+
type MosaicActivityParticipant = string | {
|
|
1650
|
+
actor?: string;
|
|
1651
|
+
excerpt?: string;
|
|
1652
|
+
};
|
|
1627
1653
|
interface MosaicActivity {
|
|
1628
1654
|
/** Stable unique identifier */
|
|
1629
1655
|
id: string;
|
|
@@ -1631,12 +1657,35 @@ interface MosaicActivity {
|
|
|
1631
1657
|
type: string;
|
|
1632
1658
|
title: string;
|
|
1633
1659
|
description?: string;
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1660
|
+
/**
|
|
1661
|
+
* Timestamp label. Accepts:
|
|
1662
|
+
* - `string` — display-ready label or ISO string (original API)
|
|
1663
|
+
* - `number` — Unix ms epoch (VP `updatedAt` numeric form)
|
|
1664
|
+
*/
|
|
1665
|
+
timestamp: string | number;
|
|
1666
|
+
/**
|
|
1667
|
+
* Activity status. Accepts the canonical `MosaicActivityStatus` values
|
|
1668
|
+
* (`"active" | "completed" | "archived"`) OR any free string from upstream
|
|
1669
|
+
* systems (e.g. VP `ActivityEvent.status`). Known values receive accent styling;
|
|
1670
|
+
* unknown strings fall back to the "archived" (neutral) style.
|
|
1671
|
+
*
|
|
1672
|
+
* Using `MosaicActivityStatus | (string & {})` preserves IDE autocomplete
|
|
1673
|
+
* for the well-known values while accepting arbitrary strings at runtime.
|
|
1674
|
+
*/
|
|
1675
|
+
status: MosaicActivityStatus | (string & {});
|
|
1676
|
+
/**
|
|
1677
|
+
* Participant list. Accepts:
|
|
1678
|
+
* - `string[]` — plain labels rendered as initials avatars (original API)
|
|
1679
|
+
* - `MosaicActivityParticipant[]` — union shape also accepting `{ actor?, excerpt? }` objects
|
|
1680
|
+
*/
|
|
1681
|
+
participants?: MosaicActivityParticipant[];
|
|
1638
1682
|
/** Number of messages/events in this activity */
|
|
1639
1683
|
messages?: number;
|
|
1684
|
+
/**
|
|
1685
|
+
* Optional excerpt / summary text (VP ActivityEvent field).
|
|
1686
|
+
* Shown below description when present.
|
|
1687
|
+
*/
|
|
1688
|
+
excerpt?: string;
|
|
1640
1689
|
}
|
|
1641
1690
|
interface MosaicActivityFeedProps {
|
|
1642
1691
|
activities: MosaicActivity[];
|
|
@@ -2932,20 +2981,38 @@ interface MosaicSignInLayoutProps {
|
|
|
2932
2981
|
clerkSignIn: React.ComponentType<{
|
|
2933
2982
|
appearance?: Record<string, unknown>;
|
|
2934
2983
|
signUpUrl?: string;
|
|
2984
|
+
signInUrl?: string;
|
|
2935
2985
|
fallbackRedirectUrl?: string;
|
|
2986
|
+
forceRedirectUrl?: string;
|
|
2987
|
+
routing?: "hash" | "path" | "virtual";
|
|
2988
|
+
path?: string;
|
|
2936
2989
|
[key: string]: unknown;
|
|
2937
2990
|
}>;
|
|
2938
2991
|
/** URL for sign-up page */
|
|
2939
2992
|
signUpUrl?: string;
|
|
2940
|
-
/** URL to
|
|
2993
|
+
/** URL for sign-in page (passed to the Clerk widget as signInUrl) */
|
|
2994
|
+
signInUrl?: string;
|
|
2995
|
+
/** URL to redirect after successful sign-in (Clerk v7 fallbackRedirectUrl) */
|
|
2941
2996
|
afterSignInUrl?: string;
|
|
2997
|
+
/** Force redirect URL — overrides query-param-based redirects (Clerk v7) */
|
|
2998
|
+
forceRedirectUrl?: string;
|
|
2999
|
+
/**
|
|
3000
|
+
* Clerk routing mode for catch-all routes.
|
|
3001
|
+
* Required for [[...sign-in]] App Router pages. Defaults to "path" when path is set.
|
|
3002
|
+
*/
|
|
3003
|
+
routing?: "hash" | "path" | "virtual";
|
|
3004
|
+
/**
|
|
3005
|
+
* Base path for "path" routing (e.g. "/sign-in").
|
|
3006
|
+
* Required when routing="path".
|
|
3007
|
+
*/
|
|
3008
|
+
path?: string;
|
|
2942
3009
|
/** Optional headline above the Clerk widget */
|
|
2943
3010
|
headline?: string;
|
|
2944
3011
|
/** Optional sub-headline */
|
|
2945
3012
|
subheadline?: string;
|
|
2946
3013
|
className?: string;
|
|
2947
3014
|
}
|
|
2948
|
-
declare function MosaicSignInLayout({ clerkSignIn: ClerkSignIn, signUpUrl, afterSignInUrl, headline, subheadline, className, }: MosaicSignInLayoutProps): React.JSX.Element;
|
|
3015
|
+
declare function MosaicSignInLayout({ clerkSignIn: ClerkSignIn, signUpUrl, signInUrl, afterSignInUrl, forceRedirectUrl, routing, path, headline, subheadline, className, }: MosaicSignInLayoutProps): React.JSX.Element;
|
|
2949
3016
|
declare namespace MosaicSignInLayout {
|
|
2950
3017
|
var displayName: string;
|
|
2951
3018
|
}
|
|
@@ -2966,20 +3033,38 @@ interface MosaicSignUpLayoutProps {
|
|
|
2966
3033
|
clerkSignUp: React.ComponentType<{
|
|
2967
3034
|
appearance?: Record<string, unknown>;
|
|
2968
3035
|
signInUrl?: string;
|
|
3036
|
+
signUpUrl?: string;
|
|
2969
3037
|
fallbackRedirectUrl?: string;
|
|
3038
|
+
forceRedirectUrl?: string;
|
|
3039
|
+
routing?: "hash" | "path" | "virtual";
|
|
3040
|
+
path?: string;
|
|
2970
3041
|
[key: string]: unknown;
|
|
2971
3042
|
}>;
|
|
2972
3043
|
/** URL for sign-in page */
|
|
2973
3044
|
signInUrl?: string;
|
|
2974
|
-
/** URL to
|
|
3045
|
+
/** URL for sign-up page (passed to the Clerk widget as signUpUrl) */
|
|
3046
|
+
signUpUrl?: string;
|
|
3047
|
+
/** URL to redirect after successful sign-up (Clerk v7 fallbackRedirectUrl) */
|
|
2975
3048
|
afterSignUpUrl?: string;
|
|
3049
|
+
/** Force redirect URL — overrides query-param-based redirects (Clerk v7) */
|
|
3050
|
+
forceRedirectUrl?: string;
|
|
3051
|
+
/**
|
|
3052
|
+
* Clerk routing mode for catch-all routes.
|
|
3053
|
+
* Required for [[...sign-up]] App Router pages. Defaults to "path" when path is set.
|
|
3054
|
+
*/
|
|
3055
|
+
routing?: "hash" | "path" | "virtual";
|
|
3056
|
+
/**
|
|
3057
|
+
* Base path for "path" routing (e.g. "/sign-up").
|
|
3058
|
+
* Required when routing="path".
|
|
3059
|
+
*/
|
|
3060
|
+
path?: string;
|
|
2976
3061
|
/** Optional headline above the Clerk widget */
|
|
2977
3062
|
headline?: string;
|
|
2978
3063
|
/** Optional sub-headline */
|
|
2979
3064
|
subheadline?: string;
|
|
2980
3065
|
className?: string;
|
|
2981
3066
|
}
|
|
2982
|
-
declare function MosaicSignUpLayout({ clerkSignUp: ClerkSignUp, signInUrl, afterSignUpUrl, headline, subheadline, className, }: MosaicSignUpLayoutProps): React.JSX.Element;
|
|
3067
|
+
declare function MosaicSignUpLayout({ clerkSignUp: ClerkSignUp, signInUrl, signUpUrl, afterSignUpUrl, forceRedirectUrl, routing, path, headline, subheadline, className, }: MosaicSignUpLayoutProps): React.JSX.Element;
|
|
2983
3068
|
declare namespace MosaicSignUpLayout {
|
|
2984
3069
|
var displayName: string;
|
|
2985
3070
|
}
|
|
@@ -3008,6 +3093,7 @@ interface MosaicClerkOrgSwitcherProps {
|
|
|
3008
3093
|
appearance?: Record<string, unknown>;
|
|
3009
3094
|
afterCreateOrganizationUrl?: string;
|
|
3010
3095
|
afterSelectOrganizationUrl?: string;
|
|
3096
|
+
afterSelectPersonalUrl?: string;
|
|
3011
3097
|
afterLeaveOrganizationUrl?: string;
|
|
3012
3098
|
hidePersonal?: boolean;
|
|
3013
3099
|
[key: string]: unknown;
|
|
@@ -3016,13 +3102,23 @@ interface MosaicClerkOrgSwitcherProps {
|
|
|
3016
3102
|
afterCreateOrganizationUrl?: string;
|
|
3017
3103
|
/** URL to redirect after selecting an org */
|
|
3018
3104
|
afterSelectOrganizationUrl?: string;
|
|
3105
|
+
/**
|
|
3106
|
+
* URL to redirect after selecting the personal workspace.
|
|
3107
|
+
* Required for VP patterns where personal workspace has a distinct landing page.
|
|
3108
|
+
*/
|
|
3109
|
+
afterSelectPersonalUrl?: string;
|
|
3019
3110
|
/** URL to redirect after leaving an org */
|
|
3020
3111
|
afterLeaveOrganizationUrl?: string;
|
|
3021
3112
|
/** Hide personal workspace from the switcher */
|
|
3022
3113
|
hidePersonal?: boolean;
|
|
3114
|
+
/**
|
|
3115
|
+
* data-testid forwarded onto the root wrapper div.
|
|
3116
|
+
* Allows e2e selectors (e.g. Playwright `getByTestId("org-switcher")`).
|
|
3117
|
+
*/
|
|
3118
|
+
"data-testid"?: string;
|
|
3023
3119
|
className?: string;
|
|
3024
3120
|
}
|
|
3025
|
-
declare function MosaicClerkOrgSwitcher({ clerkOrgSwitcher: ClerkOrgSwitcher, afterCreateOrganizationUrl, afterSelectOrganizationUrl, afterLeaveOrganizationUrl, hidePersonal, className, }: MosaicClerkOrgSwitcherProps): React.JSX.Element;
|
|
3121
|
+
declare function MosaicClerkOrgSwitcher({ clerkOrgSwitcher: ClerkOrgSwitcher, afterCreateOrganizationUrl, afterSelectOrganizationUrl, afterSelectPersonalUrl, afterLeaveOrganizationUrl, hidePersonal, "data-testid": dataTestId, className, }: MosaicClerkOrgSwitcherProps): React.JSX.Element;
|
|
3026
3122
|
declare namespace MosaicClerkOrgSwitcher {
|
|
3027
3123
|
var displayName: string;
|
|
3028
3124
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
2
|
import { Button } from '@base-ui/react/button';
|
|
4
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { buttonVariants, badgeVariants } from './server.js';
|
|
5
5
|
import { Avatar } from '@base-ui/react/avatar';
|
|
6
6
|
import { Input } from '@base-ui/react/input';
|
|
7
7
|
import { Field } from '@base-ui/react/field';
|
|
8
8
|
import { Switch } from '@base-ui/react/switch';
|
|
9
|
+
import 'class-variance-authority/types';
|
|
9
10
|
|
|
10
11
|
declare const version = "0.1.0-alpha.1";
|
|
11
12
|
|
|
@@ -18,10 +19,17 @@ interface PlaceholderProps {
|
|
|
18
19
|
}
|
|
19
20
|
declare function Placeholder({ label }: PlaceholderProps): React.JSX.Element;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/**
|
|
23
|
+
* MosaicButton — @base-ui/react Button primitive
|
|
24
|
+
*
|
|
25
|
+
* Ported from heyfabrika/styleui (MIT) with namespace and import adaptations.
|
|
26
|
+
* Source: https://github.com/heyfabrika/styleui/blob/main/components/ui/button.tsx
|
|
27
|
+
*
|
|
28
|
+
* Uses @base-ui/react/button as the headless base per ADR-0001.
|
|
29
|
+
* Styling: Tailwind v4 + cva variants. No tailwind-merge needed (single source).
|
|
30
|
+
* API: data-slot="button" attribution, ref as regular prop (React 19).
|
|
31
|
+
*/
|
|
32
|
+
|
|
25
33
|
interface MosaicButtonProps extends Omit<Button.Props, "ref">, VariantProps<typeof buttonVariants> {
|
|
26
34
|
className?: string;
|
|
27
35
|
/** ref is typed as HTMLElement to preserve the original public API surface */
|
|
@@ -802,9 +810,15 @@ declare namespace MosaicCardFooter {
|
|
|
802
810
|
var displayName: string;
|
|
803
811
|
}
|
|
804
812
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
813
|
+
/**
|
|
814
|
+
* MosaicBadge — style-only badge atom
|
|
815
|
+
*
|
|
816
|
+
* Renders a <span> with cva variants: default, secondary, destructive, outline.
|
|
817
|
+
* data-slot="badge" for composability.
|
|
818
|
+
*
|
|
819
|
+
* Design tokens: Tailwind v4 semantic classes only. No hardcoded colors.
|
|
820
|
+
*/
|
|
821
|
+
|
|
808
822
|
interface MosaicBadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
809
823
|
className?: string;
|
|
810
824
|
ref?: React.Ref<HTMLSpanElement>;
|
|
@@ -1624,6 +1638,18 @@ declare namespace MosaicQuickActionCard {
|
|
|
1624
1638
|
*/
|
|
1625
1639
|
|
|
1626
1640
|
type MosaicActivityStatus = "active" | "completed" | "archived";
|
|
1641
|
+
/**
|
|
1642
|
+
* Participant shape.
|
|
1643
|
+
*
|
|
1644
|
+
* Two forms accepted (union, both backward-compat):
|
|
1645
|
+
* - `string` — plain label, rendered as initials avatar (original API)
|
|
1646
|
+
* - `{ actor?: string; excerpt?: string }` — structured form (VP ActivityEvent shape)
|
|
1647
|
+
* `actor` is used as the avatar label; `excerpt` is surfaced as a sub-line when rendering.
|
|
1648
|
+
*/
|
|
1649
|
+
type MosaicActivityParticipant = string | {
|
|
1650
|
+
actor?: string;
|
|
1651
|
+
excerpt?: string;
|
|
1652
|
+
};
|
|
1627
1653
|
interface MosaicActivity {
|
|
1628
1654
|
/** Stable unique identifier */
|
|
1629
1655
|
id: string;
|
|
@@ -1631,12 +1657,35 @@ interface MosaicActivity {
|
|
|
1631
1657
|
type: string;
|
|
1632
1658
|
title: string;
|
|
1633
1659
|
description?: string;
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1660
|
+
/**
|
|
1661
|
+
* Timestamp label. Accepts:
|
|
1662
|
+
* - `string` — display-ready label or ISO string (original API)
|
|
1663
|
+
* - `number` — Unix ms epoch (VP `updatedAt` numeric form)
|
|
1664
|
+
*/
|
|
1665
|
+
timestamp: string | number;
|
|
1666
|
+
/**
|
|
1667
|
+
* Activity status. Accepts the canonical `MosaicActivityStatus` values
|
|
1668
|
+
* (`"active" | "completed" | "archived"`) OR any free string from upstream
|
|
1669
|
+
* systems (e.g. VP `ActivityEvent.status`). Known values receive accent styling;
|
|
1670
|
+
* unknown strings fall back to the "archived" (neutral) style.
|
|
1671
|
+
*
|
|
1672
|
+
* Using `MosaicActivityStatus | (string & {})` preserves IDE autocomplete
|
|
1673
|
+
* for the well-known values while accepting arbitrary strings at runtime.
|
|
1674
|
+
*/
|
|
1675
|
+
status: MosaicActivityStatus | (string & {});
|
|
1676
|
+
/**
|
|
1677
|
+
* Participant list. Accepts:
|
|
1678
|
+
* - `string[]` — plain labels rendered as initials avatars (original API)
|
|
1679
|
+
* - `MosaicActivityParticipant[]` — union shape also accepting `{ actor?, excerpt? }` objects
|
|
1680
|
+
*/
|
|
1681
|
+
participants?: MosaicActivityParticipant[];
|
|
1638
1682
|
/** Number of messages/events in this activity */
|
|
1639
1683
|
messages?: number;
|
|
1684
|
+
/**
|
|
1685
|
+
* Optional excerpt / summary text (VP ActivityEvent field).
|
|
1686
|
+
* Shown below description when present.
|
|
1687
|
+
*/
|
|
1688
|
+
excerpt?: string;
|
|
1640
1689
|
}
|
|
1641
1690
|
interface MosaicActivityFeedProps {
|
|
1642
1691
|
activities: MosaicActivity[];
|
|
@@ -2932,20 +2981,38 @@ interface MosaicSignInLayoutProps {
|
|
|
2932
2981
|
clerkSignIn: React.ComponentType<{
|
|
2933
2982
|
appearance?: Record<string, unknown>;
|
|
2934
2983
|
signUpUrl?: string;
|
|
2984
|
+
signInUrl?: string;
|
|
2935
2985
|
fallbackRedirectUrl?: string;
|
|
2986
|
+
forceRedirectUrl?: string;
|
|
2987
|
+
routing?: "hash" | "path" | "virtual";
|
|
2988
|
+
path?: string;
|
|
2936
2989
|
[key: string]: unknown;
|
|
2937
2990
|
}>;
|
|
2938
2991
|
/** URL for sign-up page */
|
|
2939
2992
|
signUpUrl?: string;
|
|
2940
|
-
/** URL to
|
|
2993
|
+
/** URL for sign-in page (passed to the Clerk widget as signInUrl) */
|
|
2994
|
+
signInUrl?: string;
|
|
2995
|
+
/** URL to redirect after successful sign-in (Clerk v7 fallbackRedirectUrl) */
|
|
2941
2996
|
afterSignInUrl?: string;
|
|
2997
|
+
/** Force redirect URL — overrides query-param-based redirects (Clerk v7) */
|
|
2998
|
+
forceRedirectUrl?: string;
|
|
2999
|
+
/**
|
|
3000
|
+
* Clerk routing mode for catch-all routes.
|
|
3001
|
+
* Required for [[...sign-in]] App Router pages. Defaults to "path" when path is set.
|
|
3002
|
+
*/
|
|
3003
|
+
routing?: "hash" | "path" | "virtual";
|
|
3004
|
+
/**
|
|
3005
|
+
* Base path for "path" routing (e.g. "/sign-in").
|
|
3006
|
+
* Required when routing="path".
|
|
3007
|
+
*/
|
|
3008
|
+
path?: string;
|
|
2942
3009
|
/** Optional headline above the Clerk widget */
|
|
2943
3010
|
headline?: string;
|
|
2944
3011
|
/** Optional sub-headline */
|
|
2945
3012
|
subheadline?: string;
|
|
2946
3013
|
className?: string;
|
|
2947
3014
|
}
|
|
2948
|
-
declare function MosaicSignInLayout({ clerkSignIn: ClerkSignIn, signUpUrl, afterSignInUrl, headline, subheadline, className, }: MosaicSignInLayoutProps): React.JSX.Element;
|
|
3015
|
+
declare function MosaicSignInLayout({ clerkSignIn: ClerkSignIn, signUpUrl, signInUrl, afterSignInUrl, forceRedirectUrl, routing, path, headline, subheadline, className, }: MosaicSignInLayoutProps): React.JSX.Element;
|
|
2949
3016
|
declare namespace MosaicSignInLayout {
|
|
2950
3017
|
var displayName: string;
|
|
2951
3018
|
}
|
|
@@ -2966,20 +3033,38 @@ interface MosaicSignUpLayoutProps {
|
|
|
2966
3033
|
clerkSignUp: React.ComponentType<{
|
|
2967
3034
|
appearance?: Record<string, unknown>;
|
|
2968
3035
|
signInUrl?: string;
|
|
3036
|
+
signUpUrl?: string;
|
|
2969
3037
|
fallbackRedirectUrl?: string;
|
|
3038
|
+
forceRedirectUrl?: string;
|
|
3039
|
+
routing?: "hash" | "path" | "virtual";
|
|
3040
|
+
path?: string;
|
|
2970
3041
|
[key: string]: unknown;
|
|
2971
3042
|
}>;
|
|
2972
3043
|
/** URL for sign-in page */
|
|
2973
3044
|
signInUrl?: string;
|
|
2974
|
-
/** URL to
|
|
3045
|
+
/** URL for sign-up page (passed to the Clerk widget as signUpUrl) */
|
|
3046
|
+
signUpUrl?: string;
|
|
3047
|
+
/** URL to redirect after successful sign-up (Clerk v7 fallbackRedirectUrl) */
|
|
2975
3048
|
afterSignUpUrl?: string;
|
|
3049
|
+
/** Force redirect URL — overrides query-param-based redirects (Clerk v7) */
|
|
3050
|
+
forceRedirectUrl?: string;
|
|
3051
|
+
/**
|
|
3052
|
+
* Clerk routing mode for catch-all routes.
|
|
3053
|
+
* Required for [[...sign-up]] App Router pages. Defaults to "path" when path is set.
|
|
3054
|
+
*/
|
|
3055
|
+
routing?: "hash" | "path" | "virtual";
|
|
3056
|
+
/**
|
|
3057
|
+
* Base path for "path" routing (e.g. "/sign-up").
|
|
3058
|
+
* Required when routing="path".
|
|
3059
|
+
*/
|
|
3060
|
+
path?: string;
|
|
2976
3061
|
/** Optional headline above the Clerk widget */
|
|
2977
3062
|
headline?: string;
|
|
2978
3063
|
/** Optional sub-headline */
|
|
2979
3064
|
subheadline?: string;
|
|
2980
3065
|
className?: string;
|
|
2981
3066
|
}
|
|
2982
|
-
declare function MosaicSignUpLayout({ clerkSignUp: ClerkSignUp, signInUrl, afterSignUpUrl, headline, subheadline, className, }: MosaicSignUpLayoutProps): React.JSX.Element;
|
|
3067
|
+
declare function MosaicSignUpLayout({ clerkSignUp: ClerkSignUp, signInUrl, signUpUrl, afterSignUpUrl, forceRedirectUrl, routing, path, headline, subheadline, className, }: MosaicSignUpLayoutProps): React.JSX.Element;
|
|
2983
3068
|
declare namespace MosaicSignUpLayout {
|
|
2984
3069
|
var displayName: string;
|
|
2985
3070
|
}
|
|
@@ -3008,6 +3093,7 @@ interface MosaicClerkOrgSwitcherProps {
|
|
|
3008
3093
|
appearance?: Record<string, unknown>;
|
|
3009
3094
|
afterCreateOrganizationUrl?: string;
|
|
3010
3095
|
afterSelectOrganizationUrl?: string;
|
|
3096
|
+
afterSelectPersonalUrl?: string;
|
|
3011
3097
|
afterLeaveOrganizationUrl?: string;
|
|
3012
3098
|
hidePersonal?: boolean;
|
|
3013
3099
|
[key: string]: unknown;
|
|
@@ -3016,13 +3102,23 @@ interface MosaicClerkOrgSwitcherProps {
|
|
|
3016
3102
|
afterCreateOrganizationUrl?: string;
|
|
3017
3103
|
/** URL to redirect after selecting an org */
|
|
3018
3104
|
afterSelectOrganizationUrl?: string;
|
|
3105
|
+
/**
|
|
3106
|
+
* URL to redirect after selecting the personal workspace.
|
|
3107
|
+
* Required for VP patterns where personal workspace has a distinct landing page.
|
|
3108
|
+
*/
|
|
3109
|
+
afterSelectPersonalUrl?: string;
|
|
3019
3110
|
/** URL to redirect after leaving an org */
|
|
3020
3111
|
afterLeaveOrganizationUrl?: string;
|
|
3021
3112
|
/** Hide personal workspace from the switcher */
|
|
3022
3113
|
hidePersonal?: boolean;
|
|
3114
|
+
/**
|
|
3115
|
+
* data-testid forwarded onto the root wrapper div.
|
|
3116
|
+
* Allows e2e selectors (e.g. Playwright `getByTestId("org-switcher")`).
|
|
3117
|
+
*/
|
|
3118
|
+
"data-testid"?: string;
|
|
3023
3119
|
className?: string;
|
|
3024
3120
|
}
|
|
3025
|
-
declare function MosaicClerkOrgSwitcher({ clerkOrgSwitcher: ClerkOrgSwitcher, afterCreateOrganizationUrl, afterSelectOrganizationUrl, afterLeaveOrganizationUrl, hidePersonal, className, }: MosaicClerkOrgSwitcherProps): React.JSX.Element;
|
|
3121
|
+
declare function MosaicClerkOrgSwitcher({ clerkOrgSwitcher: ClerkOrgSwitcher, afterCreateOrganizationUrl, afterSelectOrganizationUrl, afterSelectPersonalUrl, afterLeaveOrganizationUrl, hidePersonal, "data-testid": dataTestId, className, }: MosaicClerkOrgSwitcherProps): React.JSX.Element;
|
|
3026
3122
|
declare namespace MosaicClerkOrgSwitcher {
|
|
3027
3123
|
var displayName: string;
|
|
3028
3124
|
}
|
package/dist/index.js
CHANGED
|
@@ -18,9 +18,6 @@ var version = "0.1.0-alpha.1";
|
|
|
18
18
|
function Placeholder({ label = "mosaic-blocks placeholder" }) {
|
|
19
19
|
return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
|
|
20
20
|
}
|
|
21
|
-
function cn(...classes) {
|
|
22
|
-
return classes.filter(Boolean).join(" ");
|
|
23
|
-
}
|
|
24
21
|
var buttonVariants = cva(
|
|
25
22
|
// Base classes — identical to styleui base (adapted for Tailwind v4)
|
|
26
23
|
[
|
|
@@ -59,6 +56,9 @@ var buttonVariants = cva(
|
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
58
|
);
|
|
59
|
+
function cn(...classes) {
|
|
60
|
+
return classes.filter(Boolean).join(" ");
|
|
61
|
+
}
|
|
62
62
|
function MosaicButton({ className, variant, size, ref, ...props }) {
|
|
63
63
|
return /* @__PURE__ */ jsx(
|
|
64
64
|
Button,
|
|
@@ -1055,9 +1055,6 @@ function MosaicCardFooter({ className, ref, ...props }) {
|
|
|
1055
1055
|
);
|
|
1056
1056
|
}
|
|
1057
1057
|
MosaicCardFooter.displayName = "MosaicCardFooter";
|
|
1058
|
-
function cn14(...classes) {
|
|
1059
|
-
return classes.filter(Boolean).join(" ");
|
|
1060
|
-
}
|
|
1061
1058
|
var badgeVariants = cva(
|
|
1062
1059
|
[
|
|
1063
1060
|
"inline-flex items-center justify-center",
|
|
@@ -1081,6 +1078,9 @@ var badgeVariants = cva(
|
|
|
1081
1078
|
}
|
|
1082
1079
|
}
|
|
1083
1080
|
);
|
|
1081
|
+
function cn14(...classes) {
|
|
1082
|
+
return classes.filter(Boolean).join(" ");
|
|
1083
|
+
}
|
|
1084
1084
|
function MosaicBadge({ className, variant, ref, ...props }) {
|
|
1085
1085
|
return /* @__PURE__ */ jsx(
|
|
1086
1086
|
"span",
|
|
@@ -2697,6 +2697,18 @@ var STATUS_CLASSES = {
|
|
|
2697
2697
|
completed: "bg-blue-500/10 text-blue-600 border border-blue-500/20 dark:text-blue-400",
|
|
2698
2698
|
archived: "bg-gray-500/10 text-gray-600 border border-gray-500/20 dark:text-gray-400"
|
|
2699
2699
|
};
|
|
2700
|
+
var STATUS_FALLBACK = "bg-gray-500/10 text-gray-600 border border-gray-500/20 dark:text-gray-400";
|
|
2701
|
+
function getStatusClass(status) {
|
|
2702
|
+
return STATUS_CLASSES[status] ?? STATUS_FALLBACK;
|
|
2703
|
+
}
|
|
2704
|
+
function participantLabel(p) {
|
|
2705
|
+
if (typeof p === "string") return p;
|
|
2706
|
+
return p.actor ?? "";
|
|
2707
|
+
}
|
|
2708
|
+
function formatTimestamp(ts) {
|
|
2709
|
+
if (typeof ts === "string") return ts;
|
|
2710
|
+
return new Date(ts).toLocaleString();
|
|
2711
|
+
}
|
|
2700
2712
|
function ClockIcon2() {
|
|
2701
2713
|
return /* @__PURE__ */ jsxs(
|
|
2702
2714
|
"svg",
|
|
@@ -2753,20 +2765,24 @@ function MosaicActivityItem({ activity, icon, className }) {
|
|
|
2753
2765
|
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-medium text-foreground", children: activity.title }),
|
|
2754
2766
|
activity.description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-sm text-muted-foreground line-clamp-1", children: activity.description }),
|
|
2755
2767
|
activity.participants && activity.participants.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
2756
|
-
/* @__PURE__ */ jsx("div", { className: "flex -space-x-2", children: activity.participants.slice(0, 3).map((p) =>
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
"
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2768
|
+
/* @__PURE__ */ jsx("div", { className: "flex -space-x-2", children: activity.participants.slice(0, 3).map((p) => {
|
|
2769
|
+
const label = participantLabel(p);
|
|
2770
|
+
return /* @__PURE__ */ jsx(
|
|
2771
|
+
"div",
|
|
2772
|
+
{
|
|
2773
|
+
"aria-label": label,
|
|
2774
|
+
className: "flex h-6 w-6 items-center justify-center rounded-full border-2 border-background bg-muted text-[10px] font-medium text-muted-foreground",
|
|
2775
|
+
children: label.slice(0, 2).toUpperCase()
|
|
2776
|
+
},
|
|
2777
|
+
label
|
|
2778
|
+
);
|
|
2779
|
+
}) }),
|
|
2765
2780
|
activity.messages !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
2766
2781
|
activity.messages,
|
|
2767
2782
|
" messages"
|
|
2768
2783
|
] })
|
|
2769
|
-
] })
|
|
2784
|
+
] }),
|
|
2785
|
+
activity.excerpt && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground line-clamp-1", children: activity.excerpt })
|
|
2770
2786
|
] }),
|
|
2771
2787
|
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-col items-end gap-1.5", children: [
|
|
2772
2788
|
/* @__PURE__ */ jsx(
|
|
@@ -2774,12 +2790,12 @@ function MosaicActivityItem({ activity, icon, className }) {
|
|
|
2774
2790
|
{
|
|
2775
2791
|
className: cn29(
|
|
2776
2792
|
"rounded-full px-2 py-0.5 text-xs font-medium",
|
|
2777
|
-
|
|
2793
|
+
getStatusClass(activity.status)
|
|
2778
2794
|
),
|
|
2779
2795
|
children: activity.status
|
|
2780
2796
|
}
|
|
2781
2797
|
),
|
|
2782
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: activity.timestamp })
|
|
2798
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: formatTimestamp(activity.timestamp) })
|
|
2783
2799
|
] })
|
|
2784
2800
|
] }) })
|
|
2785
2801
|
]
|
|
@@ -8733,7 +8749,11 @@ var clerkAppearance = {
|
|
|
8733
8749
|
function MosaicSignInLayout({
|
|
8734
8750
|
clerkSignIn: ClerkSignIn,
|
|
8735
8751
|
signUpUrl = "/sign-up",
|
|
8752
|
+
signInUrl,
|
|
8736
8753
|
afterSignInUrl = "/",
|
|
8754
|
+
forceRedirectUrl,
|
|
8755
|
+
routing,
|
|
8756
|
+
path,
|
|
8737
8757
|
headline,
|
|
8738
8758
|
subheadline,
|
|
8739
8759
|
className
|
|
@@ -8757,7 +8777,11 @@ function MosaicSignInLayout({
|
|
|
8757
8777
|
{
|
|
8758
8778
|
appearance: clerkAppearance,
|
|
8759
8779
|
signUpUrl,
|
|
8760
|
-
|
|
8780
|
+
...signInUrl !== void 0 && { signInUrl },
|
|
8781
|
+
fallbackRedirectUrl: afterSignInUrl,
|
|
8782
|
+
...forceRedirectUrl !== void 0 && { forceRedirectUrl },
|
|
8783
|
+
...routing !== void 0 && { routing },
|
|
8784
|
+
...path !== void 0 && { path }
|
|
8761
8785
|
}
|
|
8762
8786
|
) })
|
|
8763
8787
|
]
|
|
@@ -8792,7 +8816,11 @@ var clerkAppearance2 = {
|
|
|
8792
8816
|
function MosaicSignUpLayout({
|
|
8793
8817
|
clerkSignUp: ClerkSignUp,
|
|
8794
8818
|
signInUrl = "/sign-in",
|
|
8819
|
+
signUpUrl,
|
|
8795
8820
|
afterSignUpUrl = "/",
|
|
8821
|
+
forceRedirectUrl,
|
|
8822
|
+
routing,
|
|
8823
|
+
path,
|
|
8796
8824
|
headline,
|
|
8797
8825
|
subheadline,
|
|
8798
8826
|
className
|
|
@@ -8816,7 +8844,11 @@ function MosaicSignUpLayout({
|
|
|
8816
8844
|
{
|
|
8817
8845
|
appearance: clerkAppearance2,
|
|
8818
8846
|
signInUrl,
|
|
8819
|
-
|
|
8847
|
+
...signUpUrl !== void 0 && { signUpUrl },
|
|
8848
|
+
fallbackRedirectUrl: afterSignUpUrl,
|
|
8849
|
+
...forceRedirectUrl !== void 0 && { forceRedirectUrl },
|
|
8850
|
+
...routing !== void 0 && { routing },
|
|
8851
|
+
...path !== void 0 && { path }
|
|
8820
8852
|
}
|
|
8821
8853
|
) })
|
|
8822
8854
|
]
|
|
@@ -8845,20 +8877,31 @@ function MosaicClerkOrgSwitcher({
|
|
|
8845
8877
|
clerkOrgSwitcher: ClerkOrgSwitcher,
|
|
8846
8878
|
afterCreateOrganizationUrl = "/",
|
|
8847
8879
|
afterSelectOrganizationUrl = "/",
|
|
8880
|
+
afterSelectPersonalUrl,
|
|
8848
8881
|
afterLeaveOrganizationUrl = "/",
|
|
8849
8882
|
hidePersonal = false,
|
|
8883
|
+
"data-testid": dataTestId,
|
|
8850
8884
|
className
|
|
8851
8885
|
}) {
|
|
8852
|
-
return /* @__PURE__ */ jsx(
|
|
8853
|
-
|
|
8886
|
+
return /* @__PURE__ */ jsx(
|
|
8887
|
+
"div",
|
|
8854
8888
|
{
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8889
|
+
"data-slot": "clerk-org-switcher",
|
|
8890
|
+
...dataTestId !== void 0 && { "data-testid": dataTestId },
|
|
8891
|
+
className,
|
|
8892
|
+
children: /* @__PURE__ */ jsx(
|
|
8893
|
+
ClerkOrgSwitcher,
|
|
8894
|
+
{
|
|
8895
|
+
appearance: clerkAppearance3,
|
|
8896
|
+
afterCreateOrganizationUrl,
|
|
8897
|
+
afterSelectOrganizationUrl,
|
|
8898
|
+
...afterSelectPersonalUrl !== void 0 && { afterSelectPersonalUrl },
|
|
8899
|
+
afterLeaveOrganizationUrl,
|
|
8900
|
+
hidePersonal
|
|
8901
|
+
}
|
|
8902
|
+
)
|
|
8860
8903
|
}
|
|
8861
|
-
)
|
|
8904
|
+
);
|
|
8862
8905
|
}
|
|
8863
8906
|
MosaicClerkOrgSwitcher.displayName = "MosaicClerkOrgSwitcher";
|
|
8864
8907
|
var clerkAppearance4 = {
|