@olwiba/ui 0.2.1 → 0.2.3
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.d.ts +5 -1
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/app/AppShell.tsx +12 -5
- package/src/marketing/PricingSection.tsx +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olwiba/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@content-collections/mdx": "^0.2.2",
|
|
66
|
-
"@olwiba/cn": "0.1.
|
|
67
|
-
"@olwiba/docs": "0.1.
|
|
66
|
+
"@olwiba/cn": "0.1.26",
|
|
67
|
+
"@olwiba/docs": "0.1.35",
|
|
68
68
|
"@tailwindcss/vite": "^4.1.18",
|
|
69
69
|
"@tanstack/react-router": "1.154.8",
|
|
70
70
|
"@tanstack/react-router-devtools": "1.154.8",
|
package/src/app/AppShell.tsx
CHANGED
|
@@ -127,7 +127,7 @@ function NavUser({ user }: { user: AppShellUser }) {
|
|
|
127
127
|
<DropdownMenuTrigger asChild>
|
|
128
128
|
<SidebarMenuButton
|
|
129
129
|
size="lg"
|
|
130
|
-
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
130
|
+
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!min-w-8 group-data-[collapsible=icon]:!max-w-8 group-data-[collapsible=icon]:!p-0"
|
|
131
131
|
>
|
|
132
132
|
<Avatar mode={avatarMode} size="sm" className="grayscale">
|
|
133
133
|
{user.avatar && <AvatarImage src={user.avatar} alt={user.name} />}
|
|
@@ -218,20 +218,27 @@ function ShellSidebar({
|
|
|
218
218
|
|
|
219
219
|
return (
|
|
220
220
|
<Sidebar side={side} collapsible={collapsible} sidebarPosition={sidebarPosition}>
|
|
221
|
-
<SidebarHeader>
|
|
221
|
+
<SidebarHeader className="py-3">
|
|
222
222
|
<SidebarMenu>
|
|
223
223
|
<SidebarMenuItem>
|
|
224
|
-
<SidebarMenuButton
|
|
224
|
+
<SidebarMenuButton
|
|
225
|
+
asChild
|
|
226
|
+
size="lg"
|
|
227
|
+
tooltip={typeof brand.name === 'string' ? brand.name : undefined}
|
|
228
|
+
className="group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!min-w-8 group-data-[collapsible=icon]:!max-w-8 group-data-[collapsible=icon]:!p-0"
|
|
229
|
+
>
|
|
225
230
|
{renderLink({
|
|
226
231
|
href: brand.href ?? '#',
|
|
227
232
|
children: (
|
|
228
233
|
<>
|
|
229
234
|
{brand.logo ? (
|
|
230
|
-
|
|
235
|
+
// Neutral slot: the consumer's logo owns its own chrome
|
|
236
|
+
// (background, radius). Sized to fill the collapsed icon rail.
|
|
237
|
+
<span className="flex size-8 shrink-0 items-center justify-center [&>svg]:size-5">
|
|
231
238
|
{brand.logo}
|
|
232
239
|
</span>
|
|
233
240
|
) : (
|
|
234
|
-
<span className="flex size-
|
|
241
|
+
<span className="flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary text-sm font-semibold text-primary-foreground">
|
|
235
242
|
{fallbackLogo}
|
|
236
243
|
</span>
|
|
237
244
|
)}
|
|
@@ -35,6 +35,10 @@ export interface PricingSectionProps {
|
|
|
35
35
|
footnote?: string;
|
|
36
36
|
mode?: 'subscription' | 'one-time';
|
|
37
37
|
foundingDeadline?: string;
|
|
38
|
+
/** Symbol prepended to the computed price. Ignored by plans with `priceDisplay`. */
|
|
39
|
+
currency?: string;
|
|
40
|
+
/** Badge label for `highlighted` plans with no active `foundingDeadline` countdown. Pass '' to show no badge. */
|
|
41
|
+
highlightedBadgeLabel?: string;
|
|
38
42
|
/** Rendered below each plan's CTA button (e.g. a "Get notified" link). */
|
|
39
43
|
renderPlanFooter?: (plan: PricingPlan) => React.ReactNode;
|
|
40
44
|
}
|
|
@@ -54,6 +58,8 @@ export function PricingSection({
|
|
|
54
58
|
footnote,
|
|
55
59
|
mode = 'subscription',
|
|
56
60
|
foundingDeadline,
|
|
61
|
+
currency = '$',
|
|
62
|
+
highlightedBadgeLabel = 'Founding member',
|
|
57
63
|
renderPlanFooter,
|
|
58
64
|
}: PricingSectionProps) {
|
|
59
65
|
const [annual, setAnnual] = React.useState(false);
|
|
@@ -122,7 +128,7 @@ export function PricingSection({
|
|
|
122
128
|
<StaggerChildren className="mt-10 grid gap-4 lg:grid-cols-3">
|
|
123
129
|
{plans.map((plan) => {
|
|
124
130
|
const rawPrice = isOneTime ? plan.monthly : (annual ? plan.annual : plan.monthly);
|
|
125
|
-
const price = plan.priceDisplay ??
|
|
131
|
+
const price = plan.priceDisplay ?? `${currency}${rawPrice}`;
|
|
126
132
|
const period = plan.periodDisplay ?? (isOneTime ? 'one-time' : (rawPrice > 0 ? '/mo' : ''));
|
|
127
133
|
const badge = plan.highlighted && foundingDeadline
|
|
128
134
|
? (
|
|
@@ -130,8 +136,8 @@ export function PricingSection({
|
|
|
130
136
|
<CountdownTimer deadline={foundingDeadline} compact />
|
|
131
137
|
</span>
|
|
132
138
|
)
|
|
133
|
-
: plan.highlighted
|
|
134
|
-
?
|
|
139
|
+
: plan.highlighted && highlightedBadgeLabel
|
|
140
|
+
? highlightedBadgeLabel
|
|
135
141
|
: undefined;
|
|
136
142
|
return (
|
|
137
143
|
<PricingCard
|