@bsuite/ui 0.1.0 → 0.2.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/Logo.d.ts +97 -0
- package/dist/Logo.d.ts.map +1 -0
- package/dist/Logo.js +129 -0
- package/dist/default-logo.d.ts +22 -0
- package/dist/default-logo.d.ts.map +1 -0
- package/dist/default-logo.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +18 -12
- package/src/assets/d2c-default-logo.svg +20 -0
package/dist/Logo.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export type LogoSlot = 'favicon' | 'sidebar' | 'auth' | 'marketing' | 'header';
|
|
2
|
+
export type LogoColorScheme = 'light' | 'dark' | 'auto';
|
|
3
|
+
export type AppSlug = 'crm7' | 'bsu' | 'conduit' | 'r80' | 'throughput' | 'braden';
|
|
4
|
+
/**
|
|
5
|
+
* Shape consumed by the resolver. Each field corresponds to a branding tier;
|
|
6
|
+
* `null` / `undefined` signals "not set at this tier — fall through".
|
|
7
|
+
*
|
|
8
|
+
* The Tier-0 sub-org walk happens server-side in
|
|
9
|
+
* `branding_json_for_tenant()` so by the time the client sees these values
|
|
10
|
+
* the parent_tenant_id chain has already collapsed into Tier 2/3 fields.
|
|
11
|
+
* The dedicated `app_*` fields keep Tier 3 (per-app override) distinct from
|
|
12
|
+
* Tier 2 (per-tenant) so the resolver can express the four-step precedence.
|
|
13
|
+
*/
|
|
14
|
+
export interface LogoBranding {
|
|
15
|
+
/** App-specific override logo URL (any scheme). */
|
|
16
|
+
app_logo_url?: string | null;
|
|
17
|
+
/** App-specific override logo URL for light mode. */
|
|
18
|
+
app_logo_light_url?: string | null;
|
|
19
|
+
/** App-specific override logo URL for dark mode. */
|
|
20
|
+
app_logo_dark_url?: string | null;
|
|
21
|
+
/** Tenant-level logo URL (any scheme). */
|
|
22
|
+
logo_url?: string | null;
|
|
23
|
+
/** Tenant-level logo URL for light mode. */
|
|
24
|
+
logo_light_url?: string | null;
|
|
25
|
+
/** Tenant-level logo URL for dark mode. */
|
|
26
|
+
logo_dark_url?: string | null;
|
|
27
|
+
/** Tenant-level favicon URL (square mark). */
|
|
28
|
+
favicon_url?: string | null;
|
|
29
|
+
/** Tenant-level mark / icon (square). */
|
|
30
|
+
mark_url?: string | null;
|
|
31
|
+
/** Platform default logo URL (any scheme). */
|
|
32
|
+
platform_logo_url?: string | null;
|
|
33
|
+
/** Platform default light-mode logo URL. */
|
|
34
|
+
platform_logo_light_url?: string | null;
|
|
35
|
+
/** Platform default dark-mode logo URL. */
|
|
36
|
+
platform_logo_dark_url?: string | null;
|
|
37
|
+
/** Platform default mark/icon URL. */
|
|
38
|
+
platform_mark_url?: string | null;
|
|
39
|
+
/** Platform default favicon URL. */
|
|
40
|
+
platform_favicon_url?: string | null;
|
|
41
|
+
/** Display name used as alt-text fallback when no `alt` prop is supplied. */
|
|
42
|
+
company_name?: string | null;
|
|
43
|
+
}
|
|
44
|
+
export interface ResolvedLogo {
|
|
45
|
+
/** Final URL, or `null` if every tier produced no candidate. */
|
|
46
|
+
src: string | null;
|
|
47
|
+
/** Which tier produced the URL — `'default'` means the SVG fallback. */
|
|
48
|
+
tier: 'app' | 'tenant' | 'platform' | 'default';
|
|
49
|
+
/** Resolved colour scheme (`'auto'` collapsed to concrete value). */
|
|
50
|
+
scheme: 'light' | 'dark';
|
|
51
|
+
}
|
|
52
|
+
export interface LogoProps {
|
|
53
|
+
/** Layout slot. Drives default dimensions. */
|
|
54
|
+
slot?: LogoSlot;
|
|
55
|
+
/** Colour scheme. `'auto'` reads `<html class="dark">` at render time. */
|
|
56
|
+
colorScheme?: LogoColorScheme;
|
|
57
|
+
/** Optional className for the rendered element. */
|
|
58
|
+
className?: string;
|
|
59
|
+
/** Image alt text. Defaults to `branding.company_name ?? 'BSuite'`. */
|
|
60
|
+
alt?: string;
|
|
61
|
+
/** Explicit width override (px). */
|
|
62
|
+
width?: number;
|
|
63
|
+
/** Explicit height override (px). */
|
|
64
|
+
height?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Fully-resolved 4-tier branding shape. Pass `null` / `undefined` to render
|
|
67
|
+
* the default SVG mark. Consumers typically wire this from their app-level
|
|
68
|
+
* `useBranding({tenantId, appSlug})` hook.
|
|
69
|
+
*/
|
|
70
|
+
branding?: LogoBranding | null;
|
|
71
|
+
/**
|
|
72
|
+
* Optional app slug — used as a tie-breaker when picking a Tier-1 platform
|
|
73
|
+
* default that may have app-specific entries in the future. Currently
|
|
74
|
+
* informational only (kept for forward-compat with bsuite#320 sub-org work).
|
|
75
|
+
*/
|
|
76
|
+
appSlug?: AppSlug;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Resolve the final logo URL across all four tiers.
|
|
80
|
+
*
|
|
81
|
+
* Pure function. Stable, deterministic, and tested for 100% branch coverage.
|
|
82
|
+
*
|
|
83
|
+
* @param branding — merged 4-tier branding shape (server-resolved sub-org chain).
|
|
84
|
+
* @param slot — layout slot. `favicon` prefers mark/favicon fields.
|
|
85
|
+
* @param scheme — concrete colour scheme (callers should pre-resolve `'auto'`).
|
|
86
|
+
*/
|
|
87
|
+
export declare function resolveLogoUrl(branding: LogoBranding | null | undefined, slot: LogoSlot, scheme: 'light' | 'dark'): ResolvedLogo;
|
|
88
|
+
/**
|
|
89
|
+
* Slot-aware, theme-aware, branding-aware logo component.
|
|
90
|
+
*
|
|
91
|
+
* Renders an `<img>` for resolved URLs and the inline D2C default SVG when
|
|
92
|
+
* no URL is available at any tier. Memoised because the same component
|
|
93
|
+
* frequently mounts in app shells (header, sidebar, auth gate) and the
|
|
94
|
+
* resolver inputs are stable.
|
|
95
|
+
*/
|
|
96
|
+
export declare const Logo: import("react").MemoExoticComponent<({ slot, colorScheme, className, alt, width, height, branding, appSlug, }: LogoProps) => import("react/jsx-runtime").JSX.Element>;
|
|
97
|
+
//# sourceMappingURL=Logo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../src/Logo.tsx"],"names":[],"mappings":"AAgCA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;AAC9E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AACvD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,YAAY,GAAG,QAAQ,CAAA;AAElF;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAE3B,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,qDAAqD;IACrD,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAGjC,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAGxB,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,4CAA4C;IAC5C,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,2CAA2C;IAC3C,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,oCAAoC;IACpC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAGpC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,wEAAwE;IACxE,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;IAC/C,qEAAqE;IACrE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,0EAA0E;IAC1E,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACzC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,OAAO,GAAG,MAAM,GACvB,YAAY,CA2Cd;AAaD;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,iHASd,SAAS,6CAuCV,CAAA"}
|
package/dist/Logo.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* <Logo /> — slot-aware, theme-aware, branding-aware logo for all BSuite apps.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the rendered image URL across **four tiers**, in order:
|
|
6
|
+
*
|
|
7
|
+
* Tier 0 sub-org — server-side walks parent_tenant_id chain via the
|
|
8
|
+
* `branding_json_for_tenant()` SECURITY DEFINER RPC,
|
|
9
|
+
* so by the time the value arrives client-side it has
|
|
10
|
+
* already been resolved through the sub-org chain
|
|
11
|
+
* and surfaces in the `app_*` / `logo_*` fields below.
|
|
12
|
+
* Tier 3 app override — `app_logo_url` / `app_logo_light_url` /
|
|
13
|
+
* `app_logo_dark_url` from `tenant_app_branding`
|
|
14
|
+
* (highest precedence when supplied).
|
|
15
|
+
* Tier 2 enterprise — `logo_url` / `logo_light_url` / `logo_dark_url`
|
|
16
|
+
* from `tenant_branding`.
|
|
17
|
+
* Tier 1 platform — `platform_logo_url` / variants from
|
|
18
|
+
* `platform_branding` (D2C defaults).
|
|
19
|
+
* Default — Inline D2C Neon Electric SVG (no asset dependency).
|
|
20
|
+
*
|
|
21
|
+
* The resolver is a pure function (`resolveLogoUrl`) — unit-tested for 100%
|
|
22
|
+
* branch coverage. The component is a thin shell that calls the resolver and
|
|
23
|
+
* picks the SVG default when the URL is null.
|
|
24
|
+
*
|
|
25
|
+
* To keep `@bsuite/ui` portable (it must work in BSU, CRM7, conduit, R80.3,
|
|
26
|
+
* throughput AND braden, which all have different branding hooks), the
|
|
27
|
+
* component itself does NOT call any `useBranding` hook. It reads from props.
|
|
28
|
+
* Each consumer wires its own hook in a thin wrapper (BSU's `BSULogo.tsx`).
|
|
29
|
+
*/
|
|
30
|
+
import { memo } from 'react';
|
|
31
|
+
import { D2CDefaultLogo } from './default-logo.js';
|
|
32
|
+
import { cn } from './utils.js';
|
|
33
|
+
/** Default dimensions per slot. Matches BSU's existing BSULogo contract. */
|
|
34
|
+
const SLOT_SIZES = {
|
|
35
|
+
favicon: { width: 32, height: 32 },
|
|
36
|
+
sidebar: { width: 112, height: 28 },
|
|
37
|
+
auth: { width: 160, height: 40 },
|
|
38
|
+
marketing: { width: 200, height: 50 },
|
|
39
|
+
header: { width: 120, height: 30 },
|
|
40
|
+
};
|
|
41
|
+
function pickFirstString(...candidates) {
|
|
42
|
+
for (const value of candidates) {
|
|
43
|
+
if (typeof value === 'string') {
|
|
44
|
+
const trimmed = value.trim();
|
|
45
|
+
if (trimmed.length > 0)
|
|
46
|
+
return trimmed;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolve the final logo URL across all four tiers.
|
|
53
|
+
*
|
|
54
|
+
* Pure function. Stable, deterministic, and tested for 100% branch coverage.
|
|
55
|
+
*
|
|
56
|
+
* @param branding — merged 4-tier branding shape (server-resolved sub-org chain).
|
|
57
|
+
* @param slot — layout slot. `favicon` prefers mark/favicon fields.
|
|
58
|
+
* @param scheme — concrete colour scheme (callers should pre-resolve `'auto'`).
|
|
59
|
+
*/
|
|
60
|
+
export function resolveLogoUrl(branding, slot, scheme) {
|
|
61
|
+
if (!branding) {
|
|
62
|
+
return { src: null, tier: 'default', scheme };
|
|
63
|
+
}
|
|
64
|
+
// Favicon slot has its own field family — mark/favicon, not the wordmark.
|
|
65
|
+
if (slot === 'favicon') {
|
|
66
|
+
const appTier = pickFirstString(branding.app_logo_url);
|
|
67
|
+
if (appTier)
|
|
68
|
+
return { src: appTier, tier: 'app', scheme };
|
|
69
|
+
const tenantTier = pickFirstString(branding.favicon_url, branding.mark_url, branding.logo_url);
|
|
70
|
+
if (tenantTier)
|
|
71
|
+
return { src: tenantTier, tier: 'tenant', scheme };
|
|
72
|
+
const platformTier = pickFirstString(branding.platform_favicon_url, branding.platform_mark_url, branding.platform_logo_url);
|
|
73
|
+
if (platformTier)
|
|
74
|
+
return { src: platformTier, tier: 'platform', scheme };
|
|
75
|
+
return { src: null, tier: 'default', scheme };
|
|
76
|
+
}
|
|
77
|
+
// Wordmark slots: prefer scheme-specific, then scheme-neutral, at each tier.
|
|
78
|
+
const appCandidates = scheme === 'dark'
|
|
79
|
+
? [branding.app_logo_dark_url, branding.app_logo_url, branding.app_logo_light_url]
|
|
80
|
+
: [branding.app_logo_light_url, branding.app_logo_url, branding.app_logo_dark_url];
|
|
81
|
+
const appTier = pickFirstString(...appCandidates);
|
|
82
|
+
if (appTier)
|
|
83
|
+
return { src: appTier, tier: 'app', scheme };
|
|
84
|
+
const tenantCandidates = scheme === 'dark'
|
|
85
|
+
? [branding.logo_dark_url, branding.logo_url, branding.logo_light_url]
|
|
86
|
+
: [branding.logo_light_url, branding.logo_url, branding.logo_dark_url];
|
|
87
|
+
const tenantTier = pickFirstString(...tenantCandidates);
|
|
88
|
+
if (tenantTier)
|
|
89
|
+
return { src: tenantTier, tier: 'tenant', scheme };
|
|
90
|
+
const platformCandidates = scheme === 'dark'
|
|
91
|
+
? [branding.platform_logo_dark_url, branding.platform_logo_url, branding.platform_logo_light_url]
|
|
92
|
+
: [branding.platform_logo_light_url, branding.platform_logo_url, branding.platform_logo_dark_url];
|
|
93
|
+
const platformTier = pickFirstString(...platformCandidates);
|
|
94
|
+
if (platformTier)
|
|
95
|
+
return { src: platformTier, tier: 'platform', scheme };
|
|
96
|
+
return { src: null, tier: 'default', scheme };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Collapse the `'auto'` colour scheme to a concrete value by reading the
|
|
100
|
+
* `dark` class on `<html>`. SSR-safe: returns `'light'` when document is
|
|
101
|
+
* undefined.
|
|
102
|
+
*/
|
|
103
|
+
function resolveAutoScheme(scheme) {
|
|
104
|
+
if (scheme !== 'auto')
|
|
105
|
+
return scheme;
|
|
106
|
+
if (typeof document === 'undefined')
|
|
107
|
+
return 'light';
|
|
108
|
+
return document.documentElement.classList.contains('dark') ? 'dark' : 'light';
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Slot-aware, theme-aware, branding-aware logo component.
|
|
112
|
+
*
|
|
113
|
+
* Renders an `<img>` for resolved URLs and the inline D2C default SVG when
|
|
114
|
+
* no URL is available at any tier. Memoised because the same component
|
|
115
|
+
* frequently mounts in app shells (header, sidebar, auth gate) and the
|
|
116
|
+
* resolver inputs are stable.
|
|
117
|
+
*/
|
|
118
|
+
export const Logo = memo(function Logo({ slot = 'sidebar', colorScheme = 'auto', className, alt, width, height, branding, appSlug, }) {
|
|
119
|
+
const resolvedScheme = resolveAutoScheme(colorScheme);
|
|
120
|
+
const { src, tier } = resolveLogoUrl(branding, slot, resolvedScheme);
|
|
121
|
+
const dims = SLOT_SIZES[slot];
|
|
122
|
+
const finalWidth = width ?? dims.width;
|
|
123
|
+
const finalHeight = height ?? dims.height;
|
|
124
|
+
const finalAlt = alt ?? (typeof branding?.company_name === 'string' ? branding.company_name : 'BSuite');
|
|
125
|
+
if (src) {
|
|
126
|
+
return (_jsx("img", { src: src, alt: finalAlt, width: finalWidth, height: finalHeight, className: cn('inline-block object-contain', className), style: { width: finalWidth, height: finalHeight }, loading: "eager", "data-slot": slot, "data-tier": tier, "data-scheme": resolvedScheme, "data-app": appSlug }));
|
|
127
|
+
}
|
|
128
|
+
return (_jsx(D2CDefaultLogo, { title: finalAlt, width: finalWidth, height: finalHeight, className: cn('inline-block', className), "data-slot": slot, "data-tier": tier, "data-scheme": resolvedScheme, "data-app": appSlug }));
|
|
129
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in D2C Neon Electric default mark.
|
|
3
|
+
*
|
|
4
|
+
* Inlined as a React SVG component so the package ships zero asset
|
|
5
|
+
* dependencies — no /public/ path required at the consumer site, no
|
|
6
|
+
* CDN, no broken `<img src>` if the consumer forgets to copy the asset.
|
|
7
|
+
*
|
|
8
|
+
* Source values are the canonical role tokens from @bsuite/theme:
|
|
9
|
+
* Electric Blue oklch(0.546 0.215 262.9)
|
|
10
|
+
* Electric Cyan oklch(0.769 0.132 191.7)
|
|
11
|
+
*
|
|
12
|
+
* The same shape is also available as a static SVG file at
|
|
13
|
+
* `assets/d2c-default-logo.svg` for non-React consumers (favicons,
|
|
14
|
+
* email templates, marketing surfaces).
|
|
15
|
+
*/
|
|
16
|
+
import type { SVGProps } from 'react';
|
|
17
|
+
export interface D2CDefaultLogoProps extends SVGProps<SVGSVGElement> {
|
|
18
|
+
/** Title for screen readers — defaults to "BSuite". */
|
|
19
|
+
title?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function D2CDefaultLogo({ title, width, height, role, 'aria-label': ariaLabel, ...rest }: D2CDefaultLogoProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=default-logo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-logo.d.ts","sourceRoot":"","sources":["../src/default-logo.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,WAAW,mBAAoB,SAAQ,QAAQ,CAAC,aAAa,CAAC;IAClE,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAgB,EAChB,KAAU,EACV,MAAW,EACX,IAAY,EACZ,YAAY,EAAE,SAAS,EACvB,GAAG,IAAI,EACR,EAAE,mBAAmB,2CAsBrB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function D2CDefaultLogo({ title = 'BSuite', width = 64, height = 64, role = 'img', 'aria-label': ariaLabel, ...rest }) {
|
|
3
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: width, height: height, role: role, "aria-label": ariaLabel ?? title, ...rest, children: [_jsx("title", { children: title }), _jsx("defs", { children: _jsxs("linearGradient", { id: "bsuite-d2c-ring", x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [_jsx("stop", { offset: "0%", stopColor: "oklch(0.546 0.215 262.9)" }), _jsx("stop", { offset: "100%", stopColor: "oklch(0.769 0.132 191.7)" })] }) }), _jsx("circle", { cx: "32", cy: "32", r: "26", fill: "none", stroke: "url(#bsuite-d2c-ring)", strokeWidth: "5" }), _jsx("circle", { cx: "32", cy: "32", r: "11", fill: "oklch(0.769 0.132 191.7)" })] }));
|
|
4
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { DotPattern, type DotPatternProps } from './dot-pattern.js';
|
|
2
2
|
export { cn } from './utils.js';
|
|
3
|
+
export { Logo, resolveLogoUrl, type LogoProps, type LogoSlot, type LogoColorScheme, type LogoBranding, type ResolvedLogo, type AppSlug, } from './Logo.js';
|
|
4
|
+
export { D2CDefaultLogo, type D2CDefaultLogoProps } from './default-logo.js';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAC/B,OAAO,EACL,IAAI,EACJ,cAAc,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,OAAO,GACb,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsuite/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
6
9
|
"description": "Shared UI primitives for the BSuite apps (D2C Neon Electric + Corporate brands).",
|
|
7
10
|
"repository": {
|
|
8
11
|
"type": "git",
|
|
@@ -10,7 +13,8 @@
|
|
|
10
13
|
"directory": "packages/ui"
|
|
11
14
|
},
|
|
12
15
|
"files": [
|
|
13
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"src/assets"
|
|
14
18
|
],
|
|
15
19
|
"main": "dist/index.js",
|
|
16
20
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +30,8 @@
|
|
|
26
30
|
"./utils": {
|
|
27
31
|
"import": "./dist/utils.js",
|
|
28
32
|
"types": "./dist/utils.d.ts"
|
|
29
|
-
}
|
|
33
|
+
},
|
|
34
|
+
"./assets/d2c-default-logo.svg": "./src/assets/d2c-default-logo.svg"
|
|
30
35
|
},
|
|
31
36
|
"scripts": {
|
|
32
37
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -35,7 +40,7 @@
|
|
|
35
40
|
},
|
|
36
41
|
"dependencies": {
|
|
37
42
|
"clsx": "^2.1.1",
|
|
38
|
-
"tailwind-merge": "^
|
|
43
|
+
"tailwind-merge": "^3.5.0"
|
|
39
44
|
},
|
|
40
45
|
"peerDependencies": {
|
|
41
46
|
"react": "^18.3.0 || ^19.0.0",
|
|
@@ -44,13 +49,14 @@
|
|
|
44
49
|
"devDependencies": {
|
|
45
50
|
"@testing-library/jest-dom": "^6.9.1",
|
|
46
51
|
"@testing-library/react": "^16.3.2",
|
|
47
|
-
"@types/react": "^
|
|
48
|
-
"@types/react-dom": "^
|
|
49
|
-
"@vitejs/plugin-react": "^
|
|
50
|
-
"jsdom": "^
|
|
51
|
-
"react": "^
|
|
52
|
-
"react-dom": "^
|
|
53
|
-
"typescript": "~5.
|
|
54
|
-
"
|
|
52
|
+
"@types/react": "^19.2.14",
|
|
53
|
+
"@types/react-dom": "^19.2.3",
|
|
54
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
55
|
+
"jsdom": "^29.1.1",
|
|
56
|
+
"react": "^19.2.5",
|
|
57
|
+
"react-dom": "^19.2.5",
|
|
58
|
+
"typescript": "~5.9.3",
|
|
59
|
+
"vite": "^8.0.10",
|
|
60
|
+
"vitest": "^4.1.5"
|
|
55
61
|
}
|
|
56
62
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="BSuite default mark">
|
|
3
|
+
<title>BSuite</title>
|
|
4
|
+
<!--
|
|
5
|
+
D2C Neon Electric default mark.
|
|
6
|
+
Electric Blue ring + Electric Cyan inner accent.
|
|
7
|
+
Values are the canonical role tokens from @bsuite/theme:
|
|
8
|
+
Electric Blue oklch(0.546 0.215 262.9)
|
|
9
|
+
Electric Cyan oklch(0.769 0.132 191.7)
|
|
10
|
+
Inline as raw SVG so the package has no runtime asset dependency.
|
|
11
|
+
-->
|
|
12
|
+
<defs>
|
|
13
|
+
<linearGradient id="bsuite-d2c-ring" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
14
|
+
<stop offset="0%" stop-color="oklch(0.546 0.215 262.9)" />
|
|
15
|
+
<stop offset="100%" stop-color="oklch(0.769 0.132 191.7)" />
|
|
16
|
+
</linearGradient>
|
|
17
|
+
</defs>
|
|
18
|
+
<circle cx="32" cy="32" r="26" fill="none" stroke="url(#bsuite-d2c-ring)" stroke-width="5" />
|
|
19
|
+
<circle cx="32" cy="32" r="11" fill="oklch(0.769 0.132 191.7)" />
|
|
20
|
+
</svg>
|