@slyxup/ui 0.2.0 → 0.2.1
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/dist/components/BillingPortal/BillingPortal.d.ts +22 -0
- package/dist/components/BillingPortal/BillingPortal.d.ts.map +1 -0
- package/dist/components/BillingPortal/BillingPortal.js +59 -0
- package/dist/components/BillingPortal/BillingPortal.js.map +1 -0
- package/dist/components/PricingTable/PricingTable.d.ts +19 -0
- package/dist/components/PricingTable/PricingTable.d.ts.map +1 -0
- package/dist/components/PricingTable/PricingTable.js +52 -0
- package/dist/components/PricingTable/PricingTable.js.map +1 -0
- package/dist/components/SignIn/SignIn.d.ts.map +1 -1
- package/dist/components/SignIn/SignIn.js +13 -2
- package/dist/components/SignIn/SignIn.js.map +1 -1
- package/dist/components/SignUp/SignUp.d.ts.map +1 -1
- package/dist/components/SignUp/SignUp.js +13 -2
- package/dist/components/SignUp/SignUp.js.map +1 -1
- package/dist/styles.d.ts +3 -2
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +37 -16
- package/dist/styles.js.map +1 -1
- package/package.json +13 -9
- package/src/components/BillingPortal/BillingPortal.tsx +182 -0
- package/src/components/PricingTable/PricingTable.tsx +155 -0
- package/src/components/SignIn/SignIn.tsx +26 -1
- package/src/components/SignUp/SignUp.tsx +26 -1
- package/src/styles.ts +38 -16
- package/test/components.test.tsx +135 -0
- package/test/icons.test.tsx +32 -0
- package/test/styles.test.ts +47 -0
- package/vitest.config.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @slyxup/ui
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2011599`](https://github.com/slyxup/stack/commit/2011599a9c989560e34bcea3147c18923e15962d) - UI polish: black buttons in light mode, better card vs page contrast, inline missing-key banner in SignIn/SignUp, provider warns on missing publishableKey.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`2011599`](https://github.com/slyxup/stack/commit/2011599a9c989560e34bcea3147c18923e15962d), [`2011599`](https://github.com/slyxup/stack/commit/2011599a9c989560e34bcea3147c18923e15962d)]:
|
|
10
|
+
- @slyxup/core@0.2.1
|
|
11
|
+
- @slyxup/react@0.2.1
|
|
12
|
+
|
|
3
13
|
## 0.2.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SlyxUp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface Subscription {
|
|
2
|
+
id: string;
|
|
3
|
+
status: string;
|
|
4
|
+
currentPeriodEnd: string | null;
|
|
5
|
+
cancelAtPeriodEnd: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface Invoice {
|
|
8
|
+
id: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
status: 'paid' | 'pending' | 'overdue' | 'refunded';
|
|
12
|
+
billedAt: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface BillingPortalProps {
|
|
15
|
+
subscription: Subscription | null;
|
|
16
|
+
invoices: Invoice[];
|
|
17
|
+
onCancel?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/** Current plan + invoices table */
|
|
20
|
+
export declare function BillingPortal({ subscription, invoices, onCancel, }: BillingPortalProps): import("react").JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=BillingPortal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BillingPortal.d.ts","sourceRoot":"","sources":["../../../src/components/BillingPortal/BillingPortal.tsx"],"names":[],"mappings":"AAIA,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AACD,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IACpD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,oCAAoC;AACpC,wBAAgB,aAAa,CAAC,EAC5B,YAAY,EACZ,QAAQ,EACR,QAAQ,GACT,EAAE,kBAAkB,+BAwJpB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/** Current plan + invoices table */
|
|
4
|
+
export function BillingPortal({ subscription, invoices, onCancel, }) {
|
|
5
|
+
if (!subscription) {
|
|
6
|
+
return (_jsxs("div", { className: "slx-card", children: [_jsx("h3", { style: { fontSize: 16, fontWeight: 600 }, children: "No active subscription" }), _jsx("p", { style: { fontSize: 13.5, color: 'var(--slx-muted)', marginTop: 6 }, children: "You don't have a subscription yet. Choose a plan to get started." })] }));
|
|
7
|
+
}
|
|
8
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 18 }, children: [_jsx("div", { className: "slx-card", children: _jsxs("div", { style: {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
justifyContent: 'space-between',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
}, children: [_jsxs("div", { children: [_jsx("h3", { style: { fontSize: 15, fontWeight: 600 }, children: "Current plan" }), _jsxs("p", { style: { fontSize: 13, color: 'var(--slx-muted)', marginTop: 4 }, children: ["Status:", ' ', _jsx("span", { style: {
|
|
13
|
+
fontWeight: 650,
|
|
14
|
+
color: subscription.status === 'active' ||
|
|
15
|
+
subscription.status === 'trialing'
|
|
16
|
+
? '#34d399'
|
|
17
|
+
: subscription.status === 'past_due'
|
|
18
|
+
? 'var(--slx-danger)'
|
|
19
|
+
: 'var(--slx-muted)',
|
|
20
|
+
}, children: subscription.status })] }), subscription.currentPeriodEnd && (_jsxs("p", { style: {
|
|
21
|
+
fontSize: 12.5,
|
|
22
|
+
color: 'var(--slx-muted)',
|
|
23
|
+
marginTop: 4,
|
|
24
|
+
}, children: ["Renews", ' ', new Date(subscription.currentPeriodEnd).toLocaleDateString(), subscription.cancelAtPeriodEnd
|
|
25
|
+
? ' (cancels at period end)'
|
|
26
|
+
: ''] }))] }), subscription.status !== 'canceled' &&
|
|
27
|
+
!subscription.cancelAtPeriodEnd &&
|
|
28
|
+
onCancel && (_jsx("button", { type: "button", onClick: onCancel, style: {
|
|
29
|
+
fontSize: 13,
|
|
30
|
+
fontWeight: 550,
|
|
31
|
+
background: 'transparent',
|
|
32
|
+
border: '1px solid var(--slx-border)',
|
|
33
|
+
borderRadius: 'var(--slx-radius)',
|
|
34
|
+
padding: '8px 14px',
|
|
35
|
+
cursor: 'pointer',
|
|
36
|
+
color: 'var(--slx-danger)',
|
|
37
|
+
}, children: "Cancel" }))] }) }), invoices.length > 0 && (_jsxs("div", { className: "slx-card", children: [_jsx("h3", { style: { fontSize: 15, fontWeight: 600, marginBottom: 12 }, children: "Invoices" }), _jsxs("table", { style: { width: '100%', fontSize: 13, borderCollapse: 'collapse' }, children: [_jsx("thead", { children: _jsxs("tr", { style: {
|
|
38
|
+
borderBottom: '1px solid var(--slx-border)',
|
|
39
|
+
textAlign: 'left',
|
|
40
|
+
}, children: [_jsx("th", { style: { padding: '6px 0', fontWeight: 550 }, children: "Date" }), _jsx("th", { style: { padding: '6px 0', fontWeight: 550 }, children: "Amount" }), _jsx("th", { style: { padding: '6px 0', fontWeight: 550 }, children: "Status" })] }) }), _jsx("tbody", { children: invoices.map((inv) => (_jsxs("tr", { style: { borderBottom: '1px solid var(--slx-border)' }, children: [_jsx("td", { style: { padding: '8px 0' }, children: inv.billedAt
|
|
41
|
+
? new Date(inv.billedAt).toLocaleDateString()
|
|
42
|
+
: '—' }), _jsxs("td", { style: { padding: '8px 0' }, children: ["$", (inv.amount / 100).toFixed(2), " ", inv.currency] }), _jsx("td", { style: { padding: '8px 0' }, children: _jsx("span", { style: {
|
|
43
|
+
fontSize: 11.5,
|
|
44
|
+
fontWeight: 600,
|
|
45
|
+
padding: '2px 8px',
|
|
46
|
+
borderRadius: 999,
|
|
47
|
+
background: inv.status === 'paid'
|
|
48
|
+
? 'rgba(52,211,153,.1)'
|
|
49
|
+
: inv.status === 'overdue'
|
|
50
|
+
? 'rgba(214,69,80,.1)'
|
|
51
|
+
: 'rgba(108,108,232,.08)',
|
|
52
|
+
color: inv.status === 'paid'
|
|
53
|
+
? '#34d399'
|
|
54
|
+
: inv.status === 'overdue'
|
|
55
|
+
? 'var(--slx-danger)'
|
|
56
|
+
: 'var(--slx-accent)',
|
|
57
|
+
}, children: inv.status }) })] }, inv.id))) })] })] }))] }));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=BillingPortal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BillingPortal.js","sourceRoot":"","sources":["../../../src/components/BillingPortal/BillingPortal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAwBb,oCAAoC;AACpC,MAAM,UAAU,aAAa,CAAC,EAC5B,YAAY,EACZ,QAAQ,EACR,QAAQ,GACW;IACnB,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,CACL,eAAK,SAAS,EAAC,UAAU,aACvB,aAAI,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,uCAEvC,EACL,YAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,CAAC,EAAE,iFAEjE,IACA,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,aAE/D,cAAK,SAAS,EAAC,UAAU,YACvB,eACE,KAAK,EAAE;wBACL,OAAO,EAAE,MAAM;wBACf,cAAc,EAAE,eAAe;wBAC/B,UAAU,EAAE,QAAQ;qBACrB,aAED,0BACE,aAAI,KAAK,EAAE,EAAE,QAAQ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AE,SAAS;oDAClB,YAAY,EAAE,GAAG;oDACjB,UAAU,EACR,GAAG,CAAC,MAAM,KAAK,MAAM;wDACnB,CAAC,CAAC,qBAAqB;wDACvB,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS;4DACxB,CAAC,CAAC,oBAAoB;4DACtB,CAAC,CAAC,uBAAuB;oDAC/B,KAAK,EACH,GAAG,CAAC,MAAM,KAAK,MAAM;wDACnB,CAAC,CAAC,SAAS;wDACX,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS;4DACxB,CAAC,CAAC,mBAAmB;4DACrB,CAAC,CAAC,mBAAmB;iDAC5B,YAEA,GAAG,CAAC,MAAM,GACN,GACJ,KAlCA,GAAG,CAAC,EAAE,CAmCR,CACN,CAAC,GACI,IACF,IACJ,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface Plan {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
amount: number;
|
|
5
|
+
currency: string;
|
|
6
|
+
interval: 'month' | 'year';
|
|
7
|
+
trialDays: number | null;
|
|
8
|
+
features: string[] | null;
|
|
9
|
+
isPopular: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface PricingTableProps {
|
|
12
|
+
plans: Plan[];
|
|
13
|
+
onSelect?: (plan: Plan) => void;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Clean pricing grid with popular badge */
|
|
17
|
+
export declare function PricingTable({ plans, onSelect, loading }: PricingTableProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=PricingTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PricingTable.d.ts","sourceRoot":"","sources":["../../../src/components/PricingTable/PricingTable.tsx"],"names":[],"mappings":"AAIA,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,iBAAiB,+BAoI3E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/** Clean pricing grid with popular badge */
|
|
4
|
+
export function PricingTable({ plans, onSelect, loading }) {
|
|
5
|
+
if (loading) {
|
|
6
|
+
return (_jsx("div", { className: "slx-pricing", style: {
|
|
7
|
+
display: 'grid',
|
|
8
|
+
gridTemplateColumns: `repeat(${Math.min(plans.length, 3)}, 1fr)`,
|
|
9
|
+
gap: 16,
|
|
10
|
+
}, children: [1, 2, 3].map((i) => (_jsx("div", { className: "slx-card", style: { minHeight: 320 }, "aria-busy": "true" }, i))) }));
|
|
11
|
+
}
|
|
12
|
+
return (_jsx("div", { style: {
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gridTemplateColumns: `repeat(${Math.min(plans.length, 3)}, 1fr)`,
|
|
15
|
+
gap: 16,
|
|
16
|
+
}, children: plans.map((plan) => (_jsxs("div", { className: `slx-card${plan.isPopular ? ' slx-card-popular' : ''}`, style: {
|
|
17
|
+
position: plan.isPopular ? 'relative' : undefined,
|
|
18
|
+
borderColor: plan.isPopular ? 'var(--slx-accent)' : undefined,
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flexDirection: 'column',
|
|
21
|
+
}, children: [plan.isPopular && (_jsx("span", { style: {
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
top: -11,
|
|
24
|
+
right: 20,
|
|
25
|
+
fontSize: 10.5,
|
|
26
|
+
fontFamily: 'var(--slx-mono)',
|
|
27
|
+
background: 'linear-gradient(135deg, var(--slx-accent), #8b5cf6)',
|
|
28
|
+
color: '#fff',
|
|
29
|
+
padding: '3px 10px',
|
|
30
|
+
borderRadius: 999,
|
|
31
|
+
}, children: "POPULAR" })), _jsx("h3", { style: { fontSize: 15, fontWeight: 550, color: 'var(--slx-muted)' }, children: plan.name }), _jsxs("div", { style: { margin: '8px 0 2px' }, children: [_jsxs("span", { style: {
|
|
32
|
+
fontSize: 38,
|
|
33
|
+
fontWeight: 750,
|
|
34
|
+
letterSpacing: '-0.03em',
|
|
35
|
+
fontFamily: '"Space Grotesk",sans-serif',
|
|
36
|
+
}, children: ["$", (plan.amount / 100).toFixed(0)] }), _jsxs("span", { style: { fontSize: 14, color: 'var(--slx-muted)' }, children: ["/", plan.interval] })] }), plan.trialDays ? (_jsxs("p", { style: {
|
|
37
|
+
fontSize: 12,
|
|
38
|
+
color: 'var(--slx-accent)',
|
|
39
|
+
marginBottom: 4,
|
|
40
|
+
}, children: [plan.trialDays, " day free trial"] })) : (_jsx("p", { style: { fontSize: 12, color: 'transparent', marginBottom: 4 }, children: "\u00A0" })), _jsx("ul", { style: { listStyle: 'none', margin: '14px 0 22px', flex: 1 }, children: (plan.features ?? []).map((f) => (_jsxs("li", { style: {
|
|
41
|
+
fontSize: 13.5,
|
|
42
|
+
color: 'var(--slx-ink)',
|
|
43
|
+
padding: '5px 0 5px 24px',
|
|
44
|
+
position: 'relative',
|
|
45
|
+
}, children: [_jsx("span", { style: {
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
left: 0,
|
|
48
|
+
color: '#34d399',
|
|
49
|
+
fontWeight: 700,
|
|
50
|
+
}, children: "\u2713" }), ' ', f] }, f))) }), _jsx("button", { type: "button", className: "slx-btn", onClick: () => onSelect?.(plan), disabled: loading, children: "Get started" })] }, plan.id))) }));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=PricingTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PricingTable.js","sourceRoot":"","sources":["../../../src/components/PricingTable/PricingTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAqBb,4CAA4C;AAC5C,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAqB;IAC1E,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,cACE,SAAS,EAAC,aAAa,EACvB,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,mBAAmB,EAAE,UAAU,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ;gBAChE,GAAG,EAAE,EAAE;aACR,YAEA,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACpB,cAEE,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,eACf,MAAM,IAHX,CAAC,CAIN,CACH,CAAC,GACE,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,cACE,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,mBAAmB,EAAE,UAAU,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ;YAChE,GAAG,EAAE,EAAE;SACR,YAEA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,eAEE,SAAS,EAAE,WAAW,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,E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;CAC5B;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,EACrB,MAAa,EACb,SAAS,EACT,aAAa,GACd,EAAE,WAAW,+
|
|
1
|
+
{"version":3,"file":"SignIn.d.ts","sourceRoot":"","sources":["../../../src/components/SignIn/SignIn.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,wBAAwB;IACxB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,EACrB,MAAa,EACb,SAAS,EACT,aAAa,GACd,EAAE,WAAW,+BAoJb"}
|
|
@@ -5,7 +5,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
5
5
|
import { GitHubIcon, GoogleIcon, KeyholeMark } from '../../icons';
|
|
6
6
|
/** Email/password + OAuth sign-in card. */
|
|
7
7
|
export function SignIn({ social = true, onSuccess, onSignUpClick, }) {
|
|
8
|
-
const { signIn } = useAuth();
|
|
8
|
+
const { signIn, client } = useAuth();
|
|
9
9
|
const [email, setEmail] = useState('');
|
|
10
10
|
const [password, setPassword] = useState('');
|
|
11
11
|
const [busy, setBusy] = useState(false);
|
|
@@ -37,6 +37,17 @@ export function SignIn({ social = true, onSuccess, onSignUpClick, }) {
|
|
|
37
37
|
function oauth(provider) {
|
|
38
38
|
window.location.href = `/v1/oauth/${provider}`;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
const missingKey = !client.publishableKey ||
|
|
41
|
+
client.publishableKey === 'pk_test_missing' ||
|
|
42
|
+
client.publishableKey.includes('REPLACE');
|
|
43
|
+
return (_jsxs("div", { ref: cardRef, className: `slx-card${error ? ' slx-card-error' : ''}`, children: [missingKey && (_jsxs("p", { style: {
|
|
44
|
+
fontSize: 12,
|
|
45
|
+
background: '#fff3cd',
|
|
46
|
+
border: '1px solid #ffe69c',
|
|
47
|
+
borderRadius: 8,
|
|
48
|
+
padding: '8px 10px',
|
|
49
|
+
marginBottom: 14,
|
|
50
|
+
lineHeight: 1.4,
|
|
51
|
+
}, children: [_jsx("strong", { children: "Setup:" }), " Add", ' ', _jsx("code", { children: "NEXT_PUBLIC_SLYXUP_PUBLISHABLE_KEY" }), " to", ' ', _jsx("code", { children: ".env.local" }), " \u2014 run ", _jsx("code", { children: "npx @slyxup/cli keys create" })] })), _jsx("div", { className: "slx-mark", children: _jsx(KeyholeMark, {}) }), _jsx("h1", { className: "slx-title", children: "Sign in" }), _jsx("p", { className: "slx-subtitle", children: "Welcome back. Enter your details to continue." }), social && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "slx-social", children: [_jsxs("button", { type: "button", className: "slx-social-btn", onClick: () => oauth('google'), children: [_jsx(GoogleIcon, {}), " Continue with Google"] }), _jsxs("button", { type: "button", className: "slx-social-btn", onClick: () => oauth('github'), children: [_jsx(GitHubIcon, {}), " Continue with GitHub"] })] }), _jsx("div", { className: "slx-divider", children: "or" })] })), error && (_jsx("p", { className: "slx-error-text", role: "alert", children: error })), _jsxs("form", { onSubmit: onSubmit, noValidate: false, children: [_jsxs("div", { className: "slx-field", children: [_jsx("label", { className: "slx-label", htmlFor: "slx-signin-email", children: "Email" }), _jsx("input", { id: "slx-signin-email", className: "slx-input", type: "email", autoComplete: "email", placeholder: "you@example.com", value: email, onChange: (e) => setEmail(e.target.value), required: true })] }), _jsxs("div", { className: "slx-field", children: [_jsx("label", { className: "slx-label", htmlFor: "slx-signin-password", children: "Password" }), _jsx("input", { id: "slx-signin-password", className: "slx-input", type: "password", autoComplete: "current-password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", value: password, onChange: (e) => setPassword(e.target.value), required: true, minLength: 8 })] }), _jsxs("button", { className: "slx-btn", type: "submit", disabled: busy, children: [busy && _jsx("span", { className: "slx-spinner", "aria-hidden": "true" }), busy ? 'Signing in…' : 'Sign in'] })] }), onSignUpClick && (_jsxs("p", { className: "slx-footer", children: ["Don't have an account?", ' ', _jsx("button", { type: "button", className: "slx-link", onClick: onSignUpClick, children: "Sign up" })] }))] }));
|
|
41
52
|
}
|
|
42
53
|
//# sourceMappingURL=SignIn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignIn.js","sourceRoot":"","sources":["../../../src/components/SignIn/SignIn.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAkB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAWlE,2CAA2C;AAC3C,MAAM,UAAU,MAAM,CAAC,EACrB,MAAM,GAAG,IAAI,EACb,SAAS,EACT,aAAa,GACD;IACZ,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"SignIn.js","sourceRoot":"","sources":["../../../src/components/SignIn/SignIn.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAkB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAWlE,2CAA2C;AAC3C,MAAM,UAAU,MAAM,CAAC,EACrB,MAAM,GAAG,IAAI,EACb,SAAS,EACT,aAAa,GACD;IACZ,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAGjC,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,E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|
-
{"version":3,"file":"SignUp.d.ts","sourceRoot":"","sources":["../../../src/components/SignUp/SignUp.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,EACrB,MAAa,EACb,SAAS,EACT,aAAa,GACd,EAAE,WAAW,+
|
|
1
|
+
{"version":3,"file":"SignUp.d.ts","sourceRoot":"","sources":["../../../src/components/SignUp/SignUp.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,EACrB,MAAa,EACb,SAAS,EACT,aAAa,GACd,EAAE,WAAW,+BAoKb"}
|
|
@@ -5,7 +5,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
5
5
|
import { GitHubIcon, GoogleIcon, KeyholeMark } from '../../icons';
|
|
6
6
|
/** Email/password + OAuth sign-up card. */
|
|
7
7
|
export function SignUp({ social = true, onSuccess, onSignInClick, }) {
|
|
8
|
-
const { signUp } = useAuth();
|
|
8
|
+
const { signUp, client } = useAuth();
|
|
9
9
|
const [firstName, setFirstName] = useState('');
|
|
10
10
|
const [email, setEmail] = useState('');
|
|
11
11
|
const [password, setPassword] = useState('');
|
|
@@ -38,6 +38,17 @@ export function SignUp({ social = true, onSuccess, onSignInClick, }) {
|
|
|
38
38
|
function oauth(provider) {
|
|
39
39
|
window.location.href = `/v1/oauth/${provider}`;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
const missingKey = !client.publishableKey ||
|
|
42
|
+
client.publishableKey === 'pk_test_missing' ||
|
|
43
|
+
client.publishableKey.includes('REPLACE');
|
|
44
|
+
return (_jsxs("div", { ref: cardRef, className: `slx-card${error ? ' slx-card-error' : ''}`, children: [missingKey && (_jsxs("p", { style: {
|
|
45
|
+
fontSize: 12,
|
|
46
|
+
background: '#fff3cd',
|
|
47
|
+
border: '1px solid #ffe69c',
|
|
48
|
+
borderRadius: 8,
|
|
49
|
+
padding: '8px 10px',
|
|
50
|
+
marginBottom: 14,
|
|
51
|
+
lineHeight: 1.4,
|
|
52
|
+
}, children: [_jsx("strong", { children: "Setup:" }), " Add", ' ', _jsx("code", { children: "NEXT_PUBLIC_SLYXUP_PUBLISHABLE_KEY" }), " \u2014 run", ' ', _jsx("code", { children: "npx @slyxup/cli keys create" })] })), _jsx("div", { className: "slx-mark", children: _jsx(KeyholeMark, {}) }), _jsx("h1", { className: "slx-title", children: "Create your account" }), _jsx("p", { className: "slx-subtitle", children: "A minute to set up. Sign in forever after." }), social && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "slx-social", children: [_jsxs("button", { type: "button", className: "slx-social-btn", onClick: () => oauth('google'), children: [_jsx(GoogleIcon, {}), " Continue with Google"] }), _jsxs("button", { type: "button", className: "slx-social-btn", onClick: () => oauth('github'), children: [_jsx(GitHubIcon, {}), " Continue with GitHub"] })] }), _jsx("div", { className: "slx-divider", children: "or" })] })), error && (_jsx("p", { className: "slx-error-text", role: "alert", children: error })), _jsxs("form", { onSubmit: onSubmit, children: [_jsxs("div", { className: "slx-field", children: [_jsx("label", { className: "slx-label", htmlFor: "slx-signup-name", children: "First name" }), _jsx("input", { id: "slx-signup-name", className: "slx-input", type: "text", autoComplete: "given-name", placeholder: "Ada", value: firstName, onChange: (e) => setFirstName(e.target.value) })] }), _jsxs("div", { className: "slx-field", children: [_jsx("label", { className: "slx-label", htmlFor: "slx-signup-email", children: "Email" }), _jsx("input", { id: "slx-signup-email", className: "slx-input", type: "email", autoComplete: "email", placeholder: "you@example.com", value: email, onChange: (e) => setEmail(e.target.value), required: true })] }), _jsxs("div", { className: "slx-field", children: [_jsx("label", { className: "slx-label", htmlFor: "slx-signup-password", children: "Password" }), _jsx("input", { id: "slx-signup-password", className: "slx-input", type: "password", autoComplete: "new-password", placeholder: "At least 8 characters", value: password, onChange: (e) => setPassword(e.target.value), required: true, minLength: 8 }), _jsx("p", { className: "slx-hint", children: "Use 8+ characters with a mix of letters and numbers." })] }), _jsxs("button", { className: "slx-btn", type: "submit", disabled: busy, children: [busy && _jsx("span", { className: "slx-spinner", "aria-hidden": "true" }), busy ? 'Creating account…' : 'Create account'] })] }), onSignInClick && (_jsxs("p", { className: "slx-footer", children: ["Already have an account?", ' ', _jsx("button", { type: "button", className: "slx-link", onClick: onSignInClick, children: "Sign in" })] }))] }));
|
|
42
53
|
}
|
|
43
54
|
//# sourceMappingURL=SignUp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUp.js","sourceRoot":"","sources":["../../../src/components/SignUp/SignUp.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAkB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQlE,2CAA2C;AAC3C,MAAM,UAAU,MAAM,CAAC,EACrB,MAAM,GAAG,IAAI,EACb,SAAS,EACT,aAAa,GACD;IACZ,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"SignUp.js","sourceRoot":"","sources":["../../../src/components/SignUp/SignUp.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAkB,SAAS,EAAE,MAAM,E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EAAC,OAAO,EAAC,qBAAqB,yBAElD,EACR,gBACE,EAAE,EAAC,qBAAqB,EACxB,SAAS,EAAC,WAAW,EACrB,IAAI,EAAC,UAAU,EACf,YAAY,EAAC,cAAc,EAC3B,WAAW,EAAC,uBAAuB,EACnC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,QAAQ,QACR,SAAS,EAAE,CAAC,GACZ,EACF,YAAG,SAAS,EAAC,UAAU,qEAEnB,IACA,EACN,kBAAQ,SAAS,EAAC,SAAS,EAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,IAAI,aACrD,IAAI,IAAI,eAAM,SAAS,EAAC,aAAa,iBAAa,MAAM,GAAG,EAC3D,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,gBAAgB,IACvC,IACJ,EAEN,aAAa,IAAI,CAChB,aAAG,SAAS,EAAC,YAAY,yCACE,GAAG,EAC5B,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,UAAU,EAAC,OAAO,EAAE,aAAa,wBAExD,IACP,CACL,IACG,CACP,CAAC;AACJ,CAAC"}
|
package/dist/styles.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* SlyxUp UI — design tokens + stylesheet.
|
|
3
3
|
* Injected once via <SlyxUpStyles />. Theme with CSS variables on :root or .slyxup-scope.
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
5
|
+
export declare const FONT_LINK = "<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\"><link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin><link href=\"https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Space+Grotesk:wght@400;500;600;700&display=swap\" rel=\"stylesheet\">";
|
|
6
|
+
export declare const CSS = "\n@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Space+Grotesk:wght@400;500;600;700&display=swap');\n\n.slyxup-root {\n --slx-accent: #5b5bd6;\n --slx-accent-hover: #4c4cc4;\n --slx-accent-soft: rgba(91, 91, 214, 0.14);\n --slx-bg: #ffffff;\n --slx-bg-page: #e9eaf6;\n --slx-ink: #16161d;\n --slx-muted: #6f6f7b;\n --slx-border: #d8d8e8;\n --slx-danger: #d64550;\n --slx-radius: 12px;\n --slx-font: \"DM Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --slx-display: \"Space Grotesk\", \"DM Sans\", sans-serif;\n --slx-mono: ui-monospace, SFMono-Regular, Menlo, monospace;\n\n font-family: var(--slx-font);\n color: var(--slx-ink);\n -webkit-font-smoothing: antialiased;\n}\n@media (prefers-color-scheme: dark) {\n .slyxup-root:not(.slyxup-light) {\n --slx-accent: #8484f2;\n --slx-accent-hover: #9696f5;\n --slx-accent-soft: rgba(132, 132, 242, 0.14);\n --slx-bg: #191920;\n --slx-bg-page: #121218;\n --slx-ink: #f2f2f5;\n --slx-muted: #9a9aa6;\n --slx-border: #2c2c36;\n --slx-danger: #f0737d;\n }\n}\n\n@keyframes slx-shake {\n 10%, 90% { transform: translateX(-1px); }\n 20%, 80% { transform: translateX(2px); }\n 30%, 50%, 70% { transform: translateX(-4px); }\n 40%, 60% { transform: translateX(4px); }\n}\n@keyframes slx-spin { to { transform: rotate(360deg); } }\n@media (prefers-reduced-motion: reduce) {\n .slyxup-root * { animation: none !important; transition: none !important; }\n}\n\n/* \u2500\u2500 Card \u2500\u2500 */\n.slx-card {\n width: 100%;\n max-width: 380px;\n background: var(--slx-bg);\n border: 1px solid var(--slx-border);\n border-radius: calc(var(--slx-radius) + 4px);\n padding: 32px;\n box-shadow: 0 4px 12px rgba(16,16,29,.08), 0 16px 40px rgba(16,16,29,.12), 0 0 0 1px rgba(16,16,29,.04);\n box-sizing: border-box;\n}\n.slyxup-root .slx-card { background: #ffffff; }\n.slx-card-error { animation: slx-shake .45s cubic-bezier(.36,.07,.19,.97) both; }\n\n/* \u2500\u2500 Header / keyhole mark \u2500\u2500 */\n.slx-mark {\n width: 44px; height: 44px; border-radius: 12px;\n display: flex; align-items: center; justify-content: center;\n background: linear-gradient(135deg, var(--slx-accent), #9a6cf0);\n margin-bottom: 18px;\n}\n.slx-mark svg { display: block; }\n.slx-title { font-family: var(--slx-display); font-size: 20px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 6px; }\n.slx-subtitle { font-size: 13.5px; color: var(--slx-muted); margin: 0 0 22px; line-height: 1.5; }\n\n/* \u2500\u2500 Fields \u2500\u2500 */\n.slx-field { margin-bottom: 14px; }\n.slx-label { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 6px; letter-spacing: 0.01em; }\n.slx-input {\n width: 100%; box-sizing: border-box;\n font: inherit; font-size: 14px; color: var(--slx-ink);\n background: transparent;\n border: 1px solid var(--slx-border);\n border-radius: var(--slx-radius);\n padding: 10px 12px;\n outline: none;\n transition: border-color .15s, box-shadow .15s;\n}\n.slx-input::placeholder { color: var(--slx-muted); opacity: .75; }\n.slx-input:focus-visible {\n border-color: var(--slx-accent);\n box-shadow: 0 0 0 3px var(--slx-accent-soft);\n}\n.slx-hint { font-size: 12px; color: var(--slx-muted); margin-top: 5px; }\n.slx-error-text {\n font-size: 13px; color: var(--slx-danger);\n background: color-mix(in srgb, var(--slx-danger) 9%, transparent);\n border-radius: 8px; padding: 9px 11px; margin: 0 0 14px; line-height: 1.4;\n}\n\n/* \u2500\u2500 Button \u2500\u2500 */\n.slx-btn {\n width: 100%; box-sizing: border-box;\n font-family: var(--slx-font); font-size: 14px; font-weight: 600; letter-spacing: 0.01em;\n color: #fff; background: #0a0a0f;\n border: 1px solid #0a0a0f; border-radius: var(--slx-radius);\n padding: 11px 14px; cursor: pointer;\n display: inline-flex; align-items: center; justify-content: center; gap: 8px;\n transition: background .15s, transform .06s, border-color .15s;\n}\n.slx-btn:hover { background: #1a1a23; border-color: #1a1a23; }\n.slx-btn:active { transform: scale(.985); background: #000; }\n.slx-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(10,10,15,.14), 0 0 0 1px #0a0a0f; }\n.slx-btn[disabled] { opacity: .6; cursor: not-allowed; }\n@media (prefers-color-scheme: dark) {\n .slyxup-root:not(.slyxup-light) .slx-btn { background: #f2f2f5; color: #0a0a0f; border-color: #f2f2f5; }\n .slyxup-root:not(.slyxup-light) .slx-btn:hover { background: #e6e6eb; border-color: #e6e6eb; }\n}\n.slx-spinner {\n width: 15px; height: 15px; flex: none;\n border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;\n border-radius: 50%; animation: slx-spin .7s linear infinite;\n}\n\n/* \u2500\u2500 Social \u2500\u2500 */\n.slx-social { display: grid; gap: 10px; margin-bottom: 16px; }\n.slx-social-btn {\n width: 100%; box-sizing: border-box;\n font: inherit; font-size: 13.5px; font-weight: 550;\n color: var(--slx-ink); background: var(--slx-bg);\n border: 1px solid var(--slx-border); border-radius: var(--slx-radius);\n padding: 10px 14px; cursor: pointer;\n display: inline-flex; align-items: center; justify-content: center; gap: 10px;\n transition: background .15s, border-color .15s;\n}\n.slx-social-btn:hover { background: color-mix(in srgb, var(--slx-ink) 4%, var(--slx-bg)); }\n.slx-social-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--slx-accent-soft); }\n\n/* \u2500\u2500 Divider & footer \u2500\u2500 */\n.slx-divider {\n display: flex; align-items: center; gap: 12px;\n color: var(--slx-muted); font-size: 12px;\n margin: 18px 0;\n}\n.slx-divider::before, .slx-divider::after {\n content: \"\"; height: 1px; flex: 1; background: var(--slx-border);\n}\n.slx-footer { font-size: 13px; color: var(--slx-muted); margin-top: 20px; text-align: center; }\n.slx-link {\n color: var(--slx-accent); font-weight: 600; text-decoration: none; cursor: pointer;\n background: none; border: none; font: inherit; font-size: inherit;\n padding: 0; margin: 0;\n}\n.slx-link:hover { text-decoration: underline; color: var(--slx-accent-hover); }\n.slx-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--slx-accent-soft); border-radius: 4px; }\n\n/* \u2500\u2500 Success state \u2500\u2500 */\n.slx-success-icon {\n width: 46px; height: 46px; border-radius: 50%;\n display: flex; align-items: center; justify-content: center;\n background: color-mix(in srgb, #34a853 12%, transparent);\n color: #34a853; margin: 4px auto 18px;\n}\n\n/* \u2500\u2500 User button \u2500\u2500 */\n.slx-userbtn-wrap { position: relative; display: inline-block; }\n.slx-userbtn-avatar {\n width: 36px; height: 36px; border-radius: 50%;\n border: 1px solid var(--slx-border); cursor: pointer;\n display: flex; align-items: center; justify-content: center;\n font-size: 14px; font-weight: 650; color: #fff;\n background: linear-gradient(135deg, var(--slx-accent), #9a6cf0);\n padding: 0; overflow: hidden;\n}\n.slx-userbtn-avatar img { width: 100%; height: 100%; object-fit: cover; }\n.slx-userbtn-avatar:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--slx-accent-soft); }\n.slx-menu {\n position: absolute; right: 0; top: calc(100% + 8px);\n min-width: 230px;\n background: var(--slx-bg);\n border: 1px solid var(--slx-border);\n border-radius: var(--slx-radius);\n box-shadow: 0 8px 30px rgba(10,10,20,.14);\n overflow: hidden; z-index: 1000;\n}\n.slx-menu-header { padding: 14px 16px; border-bottom: 1px solid var(--slx-border); }\n.slx-menu-name { font-size: 14px; font-weight: 600; margin: 0 0 2px; }\n.slx-menu-email { font-size: 12.5px; color: var(--slx-muted); margin: 0; word-break: break-all; }\n.slx-menu-item {\n display: block; width: 100%; text-align: left; box-sizing: border-box;\n font: inherit; font-size: 13.5px; color: var(--slx-ink);\n background: none; border: none; padding: 10px 16px; cursor: pointer;\n}\n.slx-menu-item:hover { background: color-mix(in srgb, var(--slx-ink) 5%, transparent); }\n.slx-menu-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--slx-accent-soft); }\n.slx-menu-item-danger { color: var(--slx-danger); }\n";
|
|
7
|
+
/** Inject the SlyxUp stylesheet + DM Sans font once per document. */
|
|
7
8
|
export declare function injectStyles(): void;
|
|
8
9
|
//# sourceMappingURL=styles.d.ts.map
|
package/dist/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,SAAS,4VAAgV,CAAC;AAEvW,eAAO,MAAM,GAAG,4iQAiMf,CAAC;AAIF,qEAAqE;AACrE,wBAAgB,YAAY,IAAI,IAAI,CAenC"}
|
package/dist/styles.js
CHANGED
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
* SlyxUp UI — design tokens + stylesheet.
|
|
3
3
|
* Injected once via <SlyxUpStyles />. Theme with CSS variables on :root or .slyxup-scope.
|
|
4
4
|
*/
|
|
5
|
+
export const FONT_LINK = `<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">`;
|
|
5
6
|
export const CSS = `
|
|
7
|
+
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Space+Grotesk:wght@400;500;600;700&display=swap');
|
|
8
|
+
|
|
6
9
|
.slyxup-root {
|
|
7
10
|
--slx-accent: #5b5bd6;
|
|
8
11
|
--slx-accent-hover: #4c4cc4;
|
|
9
|
-
--slx-accent-soft: rgba(91, 91, 214, 0.
|
|
12
|
+
--slx-accent-soft: rgba(91, 91, 214, 0.14);
|
|
10
13
|
--slx-bg: #ffffff;
|
|
11
|
-
--slx-bg-page: #
|
|
14
|
+
--slx-bg-page: #e9eaf6;
|
|
12
15
|
--slx-ink: #16161d;
|
|
13
16
|
--slx-muted: #6f6f7b;
|
|
14
|
-
--slx-border: #
|
|
17
|
+
--slx-border: #d8d8e8;
|
|
15
18
|
--slx-danger: #d64550;
|
|
16
19
|
--slx-radius: 12px;
|
|
17
|
-
--slx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
20
|
+
--slx-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
21
|
+
--slx-display: "Space Grotesk", "DM Sans", sans-serif;
|
|
18
22
|
--slx-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
19
23
|
|
|
20
24
|
font-family: var(--slx-font);
|
|
@@ -54,9 +58,10 @@ export const CSS = `
|
|
|
54
58
|
border: 1px solid var(--slx-border);
|
|
55
59
|
border-radius: calc(var(--slx-radius) + 4px);
|
|
56
60
|
padding: 32px;
|
|
57
|
-
box-shadow: 0
|
|
61
|
+
box-shadow: 0 4px 12px rgba(16,16,29,.08), 0 16px 40px rgba(16,16,29,.12), 0 0 0 1px rgba(16,16,29,.04);
|
|
58
62
|
box-sizing: border-box;
|
|
59
63
|
}
|
|
64
|
+
.slyxup-root .slx-card { background: #ffffff; }
|
|
60
65
|
.slx-card-error { animation: slx-shake .45s cubic-bezier(.36,.07,.19,.97) both; }
|
|
61
66
|
|
|
62
67
|
/* ── Header / keyhole mark ── */
|
|
@@ -67,7 +72,7 @@ export const CSS = `
|
|
|
67
72
|
margin-bottom: 18px;
|
|
68
73
|
}
|
|
69
74
|
.slx-mark svg { display: block; }
|
|
70
|
-
.slx-title { font-size:
|
|
75
|
+
.slx-title { font-family: var(--slx-display); font-size: 20px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 6px; }
|
|
71
76
|
.slx-subtitle { font-size: 13.5px; color: var(--slx-muted); margin: 0 0 22px; line-height: 1.5; }
|
|
72
77
|
|
|
73
78
|
/* ── Fields ── */
|
|
@@ -98,17 +103,21 @@ export const CSS = `
|
|
|
98
103
|
/* ── Button ── */
|
|
99
104
|
.slx-btn {
|
|
100
105
|
width: 100%; box-sizing: border-box;
|
|
101
|
-
font:
|
|
102
|
-
color: #fff; background:
|
|
103
|
-
border:
|
|
106
|
+
font-family: var(--slx-font); font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
|
|
107
|
+
color: #fff; background: #0a0a0f;
|
|
108
|
+
border: 1px solid #0a0a0f; border-radius: var(--slx-radius);
|
|
104
109
|
padding: 11px 14px; cursor: pointer;
|
|
105
110
|
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
|
|
106
|
-
transition: background .15s, transform .06s;
|
|
111
|
+
transition: background .15s, transform .06s, border-color .15s;
|
|
107
112
|
}
|
|
108
|
-
.slx-btn:hover { background:
|
|
109
|
-
.slx-btn:active { transform: scale(.985); }
|
|
110
|
-
.slx-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px
|
|
113
|
+
.slx-btn:hover { background: #1a1a23; border-color: #1a1a23; }
|
|
114
|
+
.slx-btn:active { transform: scale(.985); background: #000; }
|
|
115
|
+
.slx-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(10,10,15,.14), 0 0 0 1px #0a0a0f; }
|
|
111
116
|
.slx-btn[disabled] { opacity: .6; cursor: not-allowed; }
|
|
117
|
+
@media (prefers-color-scheme: dark) {
|
|
118
|
+
.slyxup-root:not(.slyxup-light) .slx-btn { background: #f2f2f5; color: #0a0a0f; border-color: #f2f2f5; }
|
|
119
|
+
.slyxup-root:not(.slyxup-light) .slx-btn:hover { background: #e6e6eb; border-color: #e6e6eb; }
|
|
120
|
+
}
|
|
112
121
|
.slx-spinner {
|
|
113
122
|
width: 15px; height: 15px; flex: none;
|
|
114
123
|
border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
|
|
@@ -139,8 +148,12 @@ export const CSS = `
|
|
|
139
148
|
content: ""; height: 1px; flex: 1; background: var(--slx-border);
|
|
140
149
|
}
|
|
141
150
|
.slx-footer { font-size: 13px; color: var(--slx-muted); margin-top: 20px; text-align: center; }
|
|
142
|
-
.slx-link {
|
|
143
|
-
|
|
151
|
+
.slx-link {
|
|
152
|
+
color: var(--slx-accent); font-weight: 600; text-decoration: none; cursor: pointer;
|
|
153
|
+
background: none; border: none; font: inherit; font-size: inherit;
|
|
154
|
+
padding: 0; margin: 0;
|
|
155
|
+
}
|
|
156
|
+
.slx-link:hover { text-decoration: underline; color: var(--slx-accent-hover); }
|
|
144
157
|
.slx-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--slx-accent-soft); border-radius: 4px; }
|
|
145
158
|
|
|
146
159
|
/* ── Success state ── */
|
|
@@ -185,10 +198,18 @@ export const CSS = `
|
|
|
185
198
|
.slx-menu-item-danger { color: var(--slx-danger); }
|
|
186
199
|
`;
|
|
187
200
|
let injected = false;
|
|
188
|
-
/** Inject the SlyxUp stylesheet once per document. */
|
|
201
|
+
/** Inject the SlyxUp stylesheet + DM Sans font once per document. */
|
|
189
202
|
export function injectStyles() {
|
|
190
203
|
if (injected || typeof document === 'undefined')
|
|
191
204
|
return;
|
|
205
|
+
// DM Sans font link
|
|
206
|
+
if (!document.querySelector('link[href*="DM+Sans"]')) {
|
|
207
|
+
const fontLink = document.createElement('link');
|
|
208
|
+
fontLink.rel = 'stylesheet';
|
|
209
|
+
fontLink.href =
|
|
210
|
+
'https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Space+Grotesk:wght@400;500;600;700&display=swap';
|
|
211
|
+
document.head.appendChild(fontLink);
|
|
212
|
+
}
|
|
192
213
|
const style = document.createElement('style');
|
|
193
214
|
style.setAttribute('data-slyxup', 'styles');
|
|
194
215
|
style.textContent = CSS;
|
package/dist/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,6UAA6U,CAAC;AAEvW,MAAM,CAAC,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiMlB,CAAC;AAEF,IAAI,QAAQ,GAAG,KAAK,CAAC;AAErB,qEAAqE;AACrE,MAAM,UAAU,YAAY;IAC1B,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IACxD,oBAAoB;IACpB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACrD,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAChD,QAAQ,CAAC,GAAG,GAAG,YAAY,CAAC;QAC5B,QAAQ,CAAC,IAAI;YACX,+KAA+K,CAAC;QAClL,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC5C,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slyxup/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "@slyxup/ui — SlyxUp SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "tsc -p tsconfig.json",
|
|
10
|
-
"typecheck": "tsc --noEmit"
|
|
11
|
-
},
|
|
12
8
|
"repository": {
|
|
13
9
|
"type": "git",
|
|
14
10
|
"url": "git+https://github.com/slyxup/stack.git",
|
|
@@ -27,11 +23,19 @@
|
|
|
27
23
|
"react": "^18 || ^19"
|
|
28
24
|
},
|
|
29
25
|
"dependencies": {
|
|
30
|
-
"@slyxup/core": "
|
|
31
|
-
"@slyxup/react": "
|
|
26
|
+
"@slyxup/core": "0.2.1",
|
|
27
|
+
"@slyxup/react": "0.2.1"
|
|
32
28
|
},
|
|
33
29
|
"devDependencies": {
|
|
34
30
|
"@types/node": "^26.2.0",
|
|
35
|
-
"@types/react": "^18"
|
|
31
|
+
"@types/react": "^18",
|
|
32
|
+
"react": "^18.3.1",
|
|
33
|
+
"react-dom": "^18.3.1",
|
|
34
|
+
"vitest": "^4.1.11"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"test": "vitest run --passWithNoTests"
|
|
36
40
|
}
|
|
37
|
-
}
|
|
41
|
+
}
|