@schematichq/schematic-components 2.34.0 → 2.34.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/dist/schematic-components-elements.cjs.js +150 -179
- package/dist/schematic-components-elements.esm.js +150 -179
- package/dist/schematic-components.browser.cjs.js +135 -38
- package/dist/schematic-components.browser.esm.js +135 -38
- package/dist/schematic-components.cjs.js +135 -38
- package/dist/schematic-components.d.ts +155 -4
- package/dist/schematic-components.esm.js +135 -38
- package/package.json +1 -1
|
@@ -31,7 +31,6 @@ var init_tokens = __esm({
|
|
|
31
31
|
SCHEMATIC_TOKENS = {
|
|
32
32
|
"--schematic-accent": ld("#194bfb", "#6f92ff"),
|
|
33
33
|
"--schematic-accent-contrast": ld("#ffffff", "#0a0a0a"),
|
|
34
|
-
// Tints the dialog's backdrop, which also blurs the page behind it.
|
|
35
34
|
"--schematic-backdrop": ld(
|
|
36
35
|
"hsla(0, 0%, 87.5%, 0.9)",
|
|
37
36
|
"hsla(0, 0%, 12.5%, 0.9)"
|
|
@@ -45,16 +44,11 @@ var init_tokens = __esm({
|
|
|
45
44
|
"hsla(0, 0%, 0%, 0.175)",
|
|
46
45
|
"hsla(0, 0%, 100%, 0.2)"
|
|
47
46
|
),
|
|
48
|
-
// 45px from a 750px viewport up; narrower screens give the content the
|
|
49
|
-
// room instead (about 22px on a 375px phone).
|
|
50
47
|
"--schematic-card-padding": "min(2.8125rem, 6vw)",
|
|
51
48
|
"--schematic-danger": ld("#d75a5c", "#ff6b6e"),
|
|
52
49
|
"--schematic-font-body": '"Public Sans", system-ui, sans-serif',
|
|
53
50
|
"--schematic-font-heading": '"Manrope", system-ui, sans-serif',
|
|
54
|
-
// Link buttons' face: Edit, Set default, Try again, and the rest.
|
|
55
51
|
"--schematic-font-link": '"Inter", system-ui, sans-serif',
|
|
56
|
-
// A lighter tint than the surface, for panels set into a card: a credit's
|
|
57
|
-
// grants, a plan's auto top-up.
|
|
58
52
|
"--schematic-inset": ld("hsla(0, 0%, 0%, 0.04)", "hsla(0, 0%, 100%, 0.06)"),
|
|
59
53
|
"--schematic-line-height": "1.375",
|
|
60
54
|
"--schematic-line-height-heading": "1.2",
|
|
@@ -63,10 +57,8 @@ var init_tokens = __esm({
|
|
|
63
57
|
"--schematic-primary": ld("#000000", "#ffffff"),
|
|
64
58
|
"--schematic-primary-contrast": ld("#ffffff", "#000000"),
|
|
65
59
|
"--schematic-radius": "0.625rem",
|
|
66
|
-
// `light-dark()` takes colours only, so it is applied per shadow layer.
|
|
67
60
|
"--schematic-shadow": `0px 1px 20px 0px ${ld("#1018280f", "#00000099")}, 0px 1px 3px 0px ${ld("#1018281a", "#0000007a")}`,
|
|
68
61
|
"--schematic-space": "1rem",
|
|
69
|
-
// A tint over the background: the payment method pill.
|
|
70
62
|
"--schematic-surface": ld(
|
|
71
63
|
"hsla(0, 0%, 0%, 0.0625)",
|
|
72
64
|
"hsla(0, 0%, 100%, 0.125)"
|
|
@@ -2439,6 +2431,45 @@ function defaultString(key, vars) {
|
|
|
2439
2431
|
return lookup(DEFAULT_STRINGS, key, vars) ?? DEFAULT_STRINGS[key] ?? key;
|
|
2440
2432
|
}
|
|
2441
2433
|
|
|
2434
|
+
// src/elements/styles/card-group.ts
|
|
2435
|
+
var cardGroupCss = `
|
|
2436
|
+
.schematic-card-group {
|
|
2437
|
+
background: var(--schematic-background);
|
|
2438
|
+
border-radius: var(--schematic-radius);
|
|
2439
|
+
box-shadow: var(--schematic-shadow);
|
|
2440
|
+
color: var(--schematic-text);
|
|
2441
|
+
display: flex;
|
|
2442
|
+
flex-direction: column;
|
|
2443
|
+
overflow: clip;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
.schematic-card-group .schematic-card,
|
|
2447
|
+
.schematic-card-group .schematic-element[data-state="pending"],
|
|
2448
|
+
.schematic-card-group .schematic-element[data-state="error"],
|
|
2449
|
+
.schematic-card-group .schematic-plan-manager {
|
|
2450
|
+
background: none;
|
|
2451
|
+
border-radius: 0;
|
|
2452
|
+
box-shadow: none;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
.schematic-card-group .schematic-metered-features__list,
|
|
2456
|
+
.schematic-card-group .schematic-credit-usage__credits,
|
|
2457
|
+
.schematic-card-group .schematic-plan-manager {
|
|
2458
|
+
gap: 0;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
.schematic-card-group > .schematic-element + .schematic-element,
|
|
2462
|
+
.schematic-card-group .schematic-card + .schematic-card {
|
|
2463
|
+
border-top: 1px solid var(--schematic-card-divider);
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
.schematic-card-group .schematic-element:not(.schematic-card) > .schematic-header {
|
|
2467
|
+
margin: 0;
|
|
2468
|
+
padding: calc(var(--schematic-card-padding) * 0.75)
|
|
2469
|
+
var(--schematic-card-padding) 0;
|
|
2470
|
+
}
|
|
2471
|
+
`;
|
|
2472
|
+
|
|
2442
2473
|
// src/elements/styles/credit-usage.ts
|
|
2443
2474
|
var creditUsageCss = `
|
|
2444
2475
|
.schematic-credit-usage__credits {
|
|
@@ -2447,8 +2478,6 @@ var creditUsageCss = `
|
|
|
2447
2478
|
gap: var(--schematic-space);
|
|
2448
2479
|
}
|
|
2449
2480
|
|
|
2450
|
-
/* Each credit draws its own card, so the root draws one only while pending
|
|
2451
|
-
or failed. */
|
|
2452
2481
|
.schematic-credit-usage[data-state="pending"],
|
|
2453
2482
|
.schematic-credit-usage[data-state="error"] {
|
|
2454
2483
|
background: var(--schematic-background);
|
|
@@ -2469,7 +2498,6 @@ var creditUsageCss = `
|
|
|
2469
2498
|
gap: calc(var(--schematic-space) * 1.5);
|
|
2470
2499
|
}
|
|
2471
2500
|
|
|
2472
|
-
/* Held even without a glyph, as the embed does, so names line up. */
|
|
2473
2501
|
.schematic-credit-usage__icon {
|
|
2474
2502
|
align-items: center;
|
|
2475
2503
|
background: var(--schematic-surface);
|
|
@@ -2486,8 +2514,6 @@ var creditUsageCss = `
|
|
|
2486
2514
|
color: var(--schematic-accent);
|
|
2487
2515
|
}
|
|
2488
2516
|
|
|
2489
|
-
/* The embed's spacing: the balance well clear of the name, the composition
|
|
2490
|
-
tucked close under the balance. */
|
|
2491
2517
|
.schematic-credit-usage__body {
|
|
2492
2518
|
display: flex;
|
|
2493
2519
|
flex-direction: column;
|
|
@@ -2543,7 +2569,6 @@ var creditUsageCss = `
|
|
|
2543
2569
|
margin-inline-start: -0.333rem;
|
|
2544
2570
|
}
|
|
2545
2571
|
|
|
2546
|
-
/* Opens above its toggle, as in the embed. */
|
|
2547
2572
|
.schematic-credit-usage__grants {
|
|
2548
2573
|
background: var(--schematic-inset);
|
|
2549
2574
|
border-radius: calc(var(--schematic-radius) * 0.8);
|
|
@@ -2563,8 +2588,6 @@ var creditUsageCss = `
|
|
|
2563
2588
|
padding: 0;
|
|
2564
2589
|
}
|
|
2565
2590
|
|
|
2566
|
-
/* Where the grant and its date do not fit on one line, the date wraps
|
|
2567
|
-
rather than overflowing the panel. */
|
|
2568
2591
|
.schematic-credit-usage__grant {
|
|
2569
2592
|
display: flex;
|
|
2570
2593
|
flex-wrap: wrap;
|
|
@@ -2595,7 +2618,6 @@ var creditUsageCss = `
|
|
|
2595
2618
|
|
|
2596
2619
|
// src/elements/styles/dialog.ts
|
|
2597
2620
|
var dialogCss = `
|
|
2598
|
-
/* Up to 768px wide, with a tighter radius than a card. */
|
|
2599
2621
|
.schematic-dialog {
|
|
2600
2622
|
background: var(--schematic-background);
|
|
2601
2623
|
border: 0;
|
|
@@ -2606,16 +2628,10 @@ var dialogCss = `
|
|
|
2606
2628
|
margin: auto;
|
|
2607
2629
|
max-height: calc(100vh - 2 * var(--schematic-space));
|
|
2608
2630
|
max-width: none;
|
|
2609
|
-
/* No padding of its own: a click on the backdrop lands on the dialog
|
|
2610
|
-
itself, and one inside lands on the header or body. */
|
|
2611
2631
|
padding: 0;
|
|
2612
|
-
/* Never wider than the screen, whatever it holds. */
|
|
2613
2632
|
width: min(48rem, calc(100vw - 2 * var(--schematic-space)));
|
|
2614
2633
|
}
|
|
2615
2634
|
|
|
2616
|
-
/* Centred by vw on a phone: a host page wider than the screen widens the
|
|
2617
|
-
layout viewport, and auto margins would centre the dialog half off the
|
|
2618
|
-
screen. Desktop keeps auto margins, as vw counts the scrollbar there. */
|
|
2619
2635
|
@media (max-width: 52rem) {
|
|
2620
2636
|
.schematic-dialog {
|
|
2621
2637
|
inset-inline: 0 auto;
|
|
@@ -2632,8 +2648,6 @@ var dialogCss = `
|
|
|
2632
2648
|
background: var(--schematic-backdrop);
|
|
2633
2649
|
}
|
|
2634
2650
|
|
|
2635
|
-
/* Narrow on the right, where the close control's own hit area makes up the
|
|
2636
|
-
rest. */
|
|
2637
2651
|
.schematic-dialog__header {
|
|
2638
2652
|
align-items: center;
|
|
2639
2653
|
border-bottom: 1px solid
|
|
@@ -2650,7 +2664,6 @@ var dialogCss = `
|
|
|
2650
2664
|
}
|
|
2651
2665
|
}
|
|
2652
2666
|
|
|
2653
|
-
/* Body text at 18px, not a heading face. */
|
|
2654
2667
|
.schematic-dialog__title {
|
|
2655
2668
|
font-family: var(--schematic-font-body);
|
|
2656
2669
|
font-size: 1.125rem;
|
|
@@ -3115,15 +3128,12 @@ var includedFeaturesCss = `
|
|
|
3115
3128
|
padding: 0;
|
|
3116
3129
|
}
|
|
3117
3130
|
|
|
3118
|
-
/* Icon, name and details; the usage drops beneath on a narrow card. */
|
|
3119
3131
|
.schematic-included-features__row {
|
|
3120
3132
|
column-gap: 0.5rem;
|
|
3121
3133
|
display: grid;
|
|
3122
3134
|
grid-template-columns: min-content 1fr;
|
|
3123
3135
|
}
|
|
3124
3136
|
|
|
3125
|
-
/* Two classes: the icon font's own rule comes later in the sheet and sets
|
|
3126
|
-
display, which would leave the glyph in the circle's corner. */
|
|
3127
3137
|
.schematic-included-features .schematic-included-features__icon {
|
|
3128
3138
|
align-items: center;
|
|
3129
3139
|
background: var(--schematic-surface);
|
|
@@ -3145,7 +3155,6 @@ var includedFeaturesCss = `
|
|
|
3145
3155
|
grid-column: 2;
|
|
3146
3156
|
}
|
|
3147
3157
|
|
|
3148
|
-
/* An item name, as add-ons and plan lines elsewhere. */
|
|
3149
3158
|
.schematic-included-features__name {
|
|
3150
3159
|
font-family: var(--schematic-font-heading);
|
|
3151
3160
|
font-size: 1.125rem;
|
|
@@ -3168,10 +3177,8 @@ var includedFeaturesCss = `
|
|
|
3168
3177
|
}
|
|
3169
3178
|
|
|
3170
3179
|
@container (min-width: 23.4375rem) {
|
|
3171
|
-
/* The usage takes the room it needs and wraps only when the name leaves
|
|
3172
|
-
it none. */
|
|
3173
3180
|
.schematic-included-features__row {
|
|
3174
|
-
grid-template-columns: min-content 1fr
|
|
3181
|
+
grid-template-columns: min-content 1fr 1fr;
|
|
3175
3182
|
}
|
|
3176
3183
|
|
|
3177
3184
|
.schematic-included-features__usage {
|
|
@@ -3243,7 +3250,6 @@ var invoicesCss = `
|
|
|
3243
3250
|
.schematic-invoices__amount {
|
|
3244
3251
|
cursor: help;
|
|
3245
3252
|
font-variant-numeric: tabular-nums;
|
|
3246
|
-
/* Keeps a lone amount at the end when the date is hidden. */
|
|
3247
3253
|
margin-inline-start: auto;
|
|
3248
3254
|
text-align: end;
|
|
3249
3255
|
}
|
|
@@ -3261,7 +3267,6 @@ var invoicesCss = `
|
|
|
3261
3267
|
gap: calc(var(--schematic-space) / 2);
|
|
3262
3268
|
}
|
|
3263
3269
|
|
|
3264
|
-
/* Cancels the glyph's side bearing, so the chevron sits flush. */
|
|
3265
3270
|
.schematic-invoices__chevron {
|
|
3266
3271
|
margin-inline-start: -0.333rem;
|
|
3267
3272
|
}
|
|
@@ -3290,7 +3295,6 @@ var meteredFeaturesCss = `
|
|
|
3290
3295
|
padding: 0;
|
|
3291
3296
|
}
|
|
3292
3297
|
|
|
3293
|
-
/* Each feature is a card; while pending or failed, the root is the card. */
|
|
3294
3298
|
.schematic-metered-features[data-state="pending"],
|
|
3295
3299
|
.schematic-metered-features[data-state="error"] {
|
|
3296
3300
|
background: var(--schematic-background);
|
|
@@ -3313,7 +3317,6 @@ var meteredFeaturesCss = `
|
|
|
3313
3317
|
gap: calc(var(--schematic-space) * 1.5);
|
|
3314
3318
|
}
|
|
3315
3319
|
|
|
3316
|
-
/* Kept without a glyph, as in the embed, so names line up. */
|
|
3317
3320
|
.schematic-metered-features__icon {
|
|
3318
3321
|
align-items: center;
|
|
3319
3322
|
background: var(--schematic-surface);
|
|
@@ -3327,8 +3330,6 @@ var meteredFeaturesCss = `
|
|
|
3327
3330
|
width: 2.75rem;
|
|
3328
3331
|
}
|
|
3329
3332
|
|
|
3330
|
-
/* The glyph takes the base text colour rather than inheriting, so the accent
|
|
3331
|
-
is set on it too. */
|
|
3332
3333
|
.schematic-metered-features__icon .schematic-icon {
|
|
3333
3334
|
color: var(--schematic-accent);
|
|
3334
3335
|
}
|
|
@@ -3362,8 +3363,6 @@ var meteredFeaturesCss = `
|
|
|
3362
3363
|
margin: 0;
|
|
3363
3364
|
}
|
|
3364
3365
|
|
|
3365
|
-
/* Beside the title when both fit, otherwise beneath it as in the embed,
|
|
3366
|
-
rather than wrapping in a narrow column. */
|
|
3367
3366
|
.schematic-metered-features__figures {
|
|
3368
3367
|
display: flex;
|
|
3369
3368
|
flex: 0 0 auto;
|
|
@@ -3386,7 +3385,6 @@ var meteredFeaturesCss = `
|
|
|
3386
3385
|
text-align: start;
|
|
3387
3386
|
}
|
|
3388
3387
|
|
|
3389
|
-
/* Too narrow to keep "1,300 GB of storage used" on one line. */
|
|
3390
3388
|
.schematic-metered-features__headline {
|
|
3391
3389
|
white-space: normal;
|
|
3392
3390
|
}
|
|
@@ -3401,7 +3399,6 @@ var meteredFeaturesCss = `
|
|
|
3401
3399
|
white-space: nowrap;
|
|
3402
3400
|
}
|
|
3403
3401
|
|
|
3404
|
-
/* Negative margins undo the card's padding so the footer bleeds to its edges. */
|
|
3405
3402
|
.schematic-metered-features__price-details {
|
|
3406
3403
|
align-items: center;
|
|
3407
3404
|
background: var(--schematic-surface);
|
|
@@ -3414,6 +3411,10 @@ var meteredFeaturesCss = `
|
|
|
3414
3411
|
var(--schematic-card-padding);
|
|
3415
3412
|
}
|
|
3416
3413
|
|
|
3414
|
+
.schematic-metered-features__price-cost {
|
|
3415
|
+
text-align: end;
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3417
3418
|
.schematic-metered-features .schematic-skeleton__cell[data-column="name"] {
|
|
3418
3419
|
width: 10rem;
|
|
3419
3420
|
}
|
|
@@ -3437,7 +3438,6 @@ var meteredFeaturesCss = `
|
|
|
3437
3438
|
background: color-mix(in srgb, var(--schematic-accent) 50%, transparent);
|
|
3438
3439
|
}
|
|
3439
3440
|
|
|
3440
|
-
/* Past the soft limit, the fill is the included share over a warning track. */
|
|
3441
3441
|
.schematic-meter--overage {
|
|
3442
3442
|
background: var(--schematic-warning);
|
|
3443
3443
|
}
|
|
@@ -3529,7 +3529,6 @@ var paymentMethodsCss = `
|
|
|
3529
3529
|
white-space: nowrap;
|
|
3530
3530
|
}
|
|
3531
3531
|
|
|
3532
|
-
/* The pill: the default method on the left, Edit or Add on the right. */
|
|
3533
3532
|
.schematic-payment-methods__current {
|
|
3534
3533
|
align-items: center;
|
|
3535
3534
|
background: var(--schematic-surface);
|
|
@@ -3540,8 +3539,6 @@ var paymentMethodsCss = `
|
|
|
3540
3539
|
padding: calc(var(--schematic-space) / 2.25) var(--schematic-space);
|
|
3541
3540
|
}
|
|
3542
3541
|
|
|
3543
|
-
/* One line: a label too long for the space truncates rather than wrapping
|
|
3544
|
-
"Card ending in" away from its digits or widening the dialog. */
|
|
3545
3542
|
.schematic-payment-methods__method {
|
|
3546
3543
|
align-items: center;
|
|
3547
3544
|
display: inline-flex;
|
|
@@ -3557,7 +3554,6 @@ var paymentMethodsCss = `
|
|
|
3557
3554
|
white-space: nowrap;
|
|
3558
3555
|
}
|
|
3559
3556
|
|
|
3560
|
-
/* The brand's mark before the label, in the label's colour. */
|
|
3561
3557
|
.schematic-payment-methods__icon {
|
|
3562
3558
|
color: currentColor;
|
|
3563
3559
|
flex-shrink: 0;
|
|
@@ -3580,15 +3576,10 @@ var paymentMethodsCss = `
|
|
|
3580
3576
|
white-space: nowrap;
|
|
3581
3577
|
}
|
|
3582
3578
|
|
|
3583
|
-
/* The toggle that reveals the other methods. Its chevron is a glyph per
|
|
3584
|
-
state, down while folded and up while unfolded, and the hover underline
|
|
3585
|
-
goes on the label alone, as on every toggle. */
|
|
3586
3579
|
.schematic-payment-methods__choose {
|
|
3587
3580
|
align-items: center;
|
|
3588
3581
|
align-self: flex-start;
|
|
3589
3582
|
display: inline-flex;
|
|
3590
|
-
/* A button centres its text; a label that wraps on a phone keeps to the
|
|
3591
|
-
start. */
|
|
3592
3583
|
text-align: start;
|
|
3593
3584
|
gap: calc(var(--schematic-space) / 2);
|
|
3594
3585
|
}
|
|
@@ -3601,9 +3592,6 @@ var paymentMethodsCss = `
|
|
|
3601
3592
|
text-decoration: underline;
|
|
3602
3593
|
}
|
|
3603
3594
|
|
|
3604
|
-
|
|
3605
|
-
/* A faintly tinted panel, roomier than the shared dialog body, with its
|
|
3606
|
-
parts spaced further apart. */
|
|
3607
3595
|
.schematic-payment-methods__dialog .schematic-dialog__body {
|
|
3608
3596
|
background: color-mix(in srgb, var(--schematic-text) 2.5%, transparent);
|
|
3609
3597
|
gap: calc(var(--schematic-space) * 2);
|
|
@@ -3616,9 +3604,6 @@ var paymentMethodsCss = `
|
|
|
3616
3604
|
}
|
|
3617
3605
|
}
|
|
3618
3606
|
|
|
3619
|
-
/* The list tucks up under its toggle, the heading sits a card's gap above
|
|
3620
|
-
the pill, and a failed write sits close under what it failed
|
|
3621
|
-
on. */
|
|
3622
3607
|
.schematic-payment-methods__dialog .schematic-payment-methods__list,
|
|
3623
3608
|
.schematic-payment-methods__dialog .schematic-payment-methods__current,
|
|
3624
3609
|
.schematic-payment-methods__dialog .schematic-payment-methods__error {
|
|
@@ -3633,8 +3618,6 @@ var paymentMethodsCss = `
|
|
|
3633
3618
|
padding: 0;
|
|
3634
3619
|
}
|
|
3635
3620
|
|
|
3636
|
-
/* The name on the left, the expiry and actions on the right; a narrow
|
|
3637
|
-
dialog wraps the actions under the name. */
|
|
3638
3621
|
.schematic-payment-methods__row {
|
|
3639
3622
|
align-items: center;
|
|
3640
3623
|
border-bottom: 1px solid var(--schematic-card-divider);
|
|
@@ -3644,8 +3627,6 @@ var paymentMethodsCss = `
|
|
|
3644
3627
|
padding: calc(var(--schematic-space) / 2) 0;
|
|
3645
3628
|
}
|
|
3646
3629
|
|
|
3647
|
-
/* The name takes the line's room first; the actions wrap under it before
|
|
3648
|
-
the name is cut short. */
|
|
3649
3630
|
.schematic-payment-methods__row .schematic-payment-methods__method {
|
|
3650
3631
|
flex: 1 1 10rem;
|
|
3651
3632
|
}
|
|
@@ -3698,7 +3679,6 @@ var paymentMethodsCss = `
|
|
|
3698
3679
|
width: 100%;
|
|
3699
3680
|
}
|
|
3700
3681
|
|
|
3701
|
-
/* Larger than the shared CTA: taller, with bigger type and radius. */
|
|
3702
3682
|
.schematic-payment-methods__add-new {
|
|
3703
3683
|
border-radius: 0.625rem;
|
|
3704
3684
|
font-size: 1.1875rem;
|
|
@@ -3710,7 +3690,6 @@ var paymentMethodsCss = `
|
|
|
3710
3690
|
align-self: flex-start;
|
|
3711
3691
|
}
|
|
3712
3692
|
|
|
3713
|
-
/* The failed write and its retry sit on one line at the foot of the dialog. */
|
|
3714
3693
|
.schematic-payment-methods__error {
|
|
3715
3694
|
align-items: center;
|
|
3716
3695
|
display: flex;
|
|
@@ -3723,8 +3702,6 @@ var paymentMethodsCss = `
|
|
|
3723
3702
|
white-space: nowrap;
|
|
3724
3703
|
}
|
|
3725
3704
|
|
|
3726
|
-
/* Spaced as the embed's form: 24px between parts, and a wider break before
|
|
3727
|
-
Save under the address. */
|
|
3728
3705
|
.schematic-payment-methods__form {
|
|
3729
3706
|
display: flex;
|
|
3730
3707
|
flex-direction: column;
|
|
@@ -3735,8 +3712,6 @@ var paymentMethodsCss = `
|
|
|
3735
3712
|
margin-bottom: calc(var(--schematic-space) * 2);
|
|
3736
3713
|
}
|
|
3737
3714
|
|
|
3738
|
-
/* The fields the checkout settings add beside Stripe's own, labelled as
|
|
3739
|
-
Stripe's are. */
|
|
3740
3715
|
.schematic-payment-methods__field {
|
|
3741
3716
|
display: flex;
|
|
3742
3717
|
flex-direction: column;
|
|
@@ -3746,7 +3721,6 @@ var paymentMethodsCss = `
|
|
|
3746
3721
|
.schematic-payment-methods__input {
|
|
3747
3722
|
background: var(--schematic-background);
|
|
3748
3723
|
border: 1px solid var(--schematic-border);
|
|
3749
|
-
/* The embed's 8px at the default radius; Stripe's fields take the same. */
|
|
3750
3724
|
border-radius: calc(var(--schematic-radius) * 0.8);
|
|
3751
3725
|
box-sizing: border-box;
|
|
3752
3726
|
color: var(--schematic-text);
|
|
@@ -3783,7 +3757,6 @@ var planManagerCss = `
|
|
|
3783
3757
|
gap: var(--schematic-space);
|
|
3784
3758
|
}
|
|
3785
3759
|
|
|
3786
|
-
/* While loading or failed there is no plan card, so the root draws one. */
|
|
3787
3760
|
.schematic-plan-manager[data-state="pending"],
|
|
3788
3761
|
.schematic-plan-manager[data-state="error"] {
|
|
3789
3762
|
background: var(--schematic-background);
|
|
@@ -3793,8 +3766,6 @@ var planManagerCss = `
|
|
|
3793
3766
|
var(--schematic-card-padding);
|
|
3794
3767
|
}
|
|
3795
3768
|
|
|
3796
|
-
/* As in the embed, a notice is a band across the top of the card: the
|
|
3797
|
-
root draws the card and the plan's own card goes flat. */
|
|
3798
3769
|
.schematic-plan-manager:has(.schematic-plan-manager__notice) {
|
|
3799
3770
|
background: var(--schematic-background);
|
|
3800
3771
|
border-radius: var(--schematic-radius);
|
|
@@ -3884,8 +3855,6 @@ var planManagerCss = `
|
|
|
3884
3855
|
padding: 0;
|
|
3885
3856
|
}
|
|
3886
3857
|
|
|
3887
|
-
/* Centred as in the embed; a plan credit's name and figure share a
|
|
3888
|
-
baseline above the line that explains them. */
|
|
3889
3858
|
.schematic-plan-manager__row,
|
|
3890
3859
|
.schematic-plan-manager__row-main {
|
|
3891
3860
|
align-items: center;
|
|
@@ -3978,8 +3947,6 @@ var tooltipCss = `
|
|
|
3978
3947
|
border: 0;
|
|
3979
3948
|
color: var(--schematic-muted);
|
|
3980
3949
|
cursor: help;
|
|
3981
|
-
/* A button keeps the browser's control font; the glyph is the embed's
|
|
3982
|
-
24px. */
|
|
3983
3950
|
font-size: 1.5rem;
|
|
3984
3951
|
line-height: 0;
|
|
3985
3952
|
padding: 0;
|
|
@@ -4171,7 +4138,7 @@ var upcomingBillCss = `
|
|
|
4171
4138
|
}
|
|
4172
4139
|
|
|
4173
4140
|
.schematic-upcoming-bill__discount {
|
|
4174
|
-
align-items:
|
|
4141
|
+
align-items: start;
|
|
4175
4142
|
display: inline-flex;
|
|
4176
4143
|
gap: calc(var(--schematic-space) / 2);
|
|
4177
4144
|
}
|
|
@@ -4199,6 +4166,7 @@ var rulesCss = `
|
|
|
4199
4166
|
color: var(--schematic-text);
|
|
4200
4167
|
font-family: var(--schematic-font-body);
|
|
4201
4168
|
line-height: var(--schematic-line-height);
|
|
4169
|
+
text-wrap: balance;
|
|
4202
4170
|
}
|
|
4203
4171
|
|
|
4204
4172
|
:where([class^="schematic-"]) *,
|
|
@@ -4211,7 +4179,6 @@ var rulesCss = `
|
|
|
4211
4179
|
margin: 0;
|
|
4212
4180
|
}
|
|
4213
4181
|
|
|
4214
|
-
/* Unit suffixes ("/mo", "/seat") sit on the baseline, as in the embed. */
|
|
4215
4182
|
:where([class^="schematic-"]) sub,
|
|
4216
4183
|
:where([class^="schematic-"]) sup {
|
|
4217
4184
|
line-height: 1;
|
|
@@ -4249,13 +4216,11 @@ var rulesCss = `
|
|
|
4249
4216
|
gap: var(--schematic-space);
|
|
4250
4217
|
}
|
|
4251
4218
|
|
|
4252
|
-
/* The message may run long; the action beside it stays one line. */
|
|
4253
4219
|
.schematic-status__retry {
|
|
4254
4220
|
flex-shrink: 0;
|
|
4255
4221
|
white-space: nowrap;
|
|
4256
4222
|
}
|
|
4257
4223
|
|
|
4258
|
-
/* Visually hidden, still read by assistive technology. */
|
|
4259
4224
|
.schematic-hidden {
|
|
4260
4225
|
border: 0;
|
|
4261
4226
|
clip-path: inset(50%);
|
|
@@ -4384,7 +4349,6 @@ var rulesCss = `
|
|
|
4384
4349
|
border-color: var(--schematic-primary);
|
|
4385
4350
|
}
|
|
4386
4351
|
|
|
4387
|
-
/* The embed's small button: 15px type, 40px tall. */
|
|
4388
4352
|
.schematic-cta--small {
|
|
4389
4353
|
border-radius: 0.375rem;
|
|
4390
4354
|
font-size: 0.9375rem;
|
|
@@ -4392,7 +4356,6 @@ var rulesCss = `
|
|
|
4392
4356
|
padding: 0.4375rem 1.25rem;
|
|
4393
4357
|
}
|
|
4394
4358
|
|
|
4395
|
-
/* The embed's ghost button, for secondary actions such as Try again. */
|
|
4396
4359
|
.schematic-cta--ghost {
|
|
4397
4360
|
background: transparent;
|
|
4398
4361
|
border-color: color-mix(in srgb, var(--schematic-text) 20%, transparent);
|
|
@@ -4420,19 +4383,15 @@ var rulesCss = `
|
|
|
4420
4383
|
text-decoration: underline;
|
|
4421
4384
|
}
|
|
4422
4385
|
|
|
4423
|
-
/* Every toggle's chevron: the 24px glyph, muted. */
|
|
4424
4386
|
.schematic-chevron {
|
|
4425
4387
|
color: var(--schematic-muted);
|
|
4426
4388
|
font-size: 1.5rem;
|
|
4427
4389
|
}
|
|
4428
4390
|
|
|
4429
|
-
/* A toggle underlines its label alone: a flex container hands its underline
|
|
4430
|
-
to every item, the chevron included, and an item cannot take it off. */
|
|
4431
4391
|
.schematic-link-button:has(.schematic-link-button__label):hover {
|
|
4432
4392
|
text-decoration: none;
|
|
4433
4393
|
}
|
|
4434
4394
|
|
|
4435
|
-
/* The reset colours every schematic- element; the label keeps the link's. */
|
|
4436
4395
|
.schematic-link-button__label {
|
|
4437
4396
|
color: inherit;
|
|
4438
4397
|
}
|
|
@@ -4533,7 +4492,6 @@ var rulesCss = `
|
|
|
4533
4492
|
margin: 0;
|
|
4534
4493
|
}
|
|
4535
4494
|
|
|
4536
|
-
/* A label on the left, its value on the right. */
|
|
4537
4495
|
.schematic-row {
|
|
4538
4496
|
align-items: flex-start;
|
|
4539
4497
|
display: flex;
|
|
@@ -4744,6 +4702,7 @@ ${meteredFeaturesCss}
|
|
|
4744
4702
|
${creditUsageCss}
|
|
4745
4703
|
${planManagerCss}
|
|
4746
4704
|
${unsubscribeCss}
|
|
4705
|
+
${cardGroupCss}
|
|
4747
4706
|
`;
|
|
4748
4707
|
var schematicStylesCss = withTokenDefaults(rulesCss) + iconsCss;
|
|
4749
4708
|
var SchematicStyles = () => /* @__PURE__ */ jsx("style", { "data-schematic-styles": "", children: schematicStylesCss });
|
|
@@ -4860,8 +4819,9 @@ var StatusFrame = ({
|
|
|
4860
4819
|
skeleton = /* @__PURE__ */ jsx2("div", { className: "schematic-skeleton" })
|
|
4861
4820
|
}) => {
|
|
4862
4821
|
useReportHiddenError(error, errorMessage);
|
|
4822
|
+
const root = cx("schematic-element", className);
|
|
4863
4823
|
if (error !== void 0 && !hasData) {
|
|
4864
|
-
return /* @__PURE__ */ jsx2("div", { className, "data-state": "error", children: /* @__PURE__ */ jsxs("div", { className: "schematic-status", role: "alert", children: [
|
|
4824
|
+
return /* @__PURE__ */ jsx2("div", { className: root, "data-state": "error", children: /* @__PURE__ */ jsxs("div", { className: "schematic-status", role: "alert", children: [
|
|
4865
4825
|
/* @__PURE__ */ jsx2("span", { className: "schematic-error schematic-status__message", children: errorMessage ?? error.message }),
|
|
4866
4826
|
onRetry !== void 0 && /* @__PURE__ */ jsx2(
|
|
4867
4827
|
"button",
|
|
@@ -4875,12 +4835,12 @@ var StatusFrame = ({
|
|
|
4875
4835
|
] }) });
|
|
4876
4836
|
}
|
|
4877
4837
|
if (isPending && !hasData) {
|
|
4878
|
-
return /* @__PURE__ */ jsxs("div", { "aria-busy": "true", className, "data-state": "pending", children: [
|
|
4838
|
+
return /* @__PURE__ */ jsxs("div", { "aria-busy": "true", className: root, "data-state": "pending", children: [
|
|
4879
4839
|
/* @__PURE__ */ jsx2("span", { className: "schematic-hidden", children: loadingLabel }),
|
|
4880
4840
|
skeleton
|
|
4881
4841
|
] });
|
|
4882
4842
|
}
|
|
4883
|
-
return /* @__PURE__ */ jsxs("div", { className, "data-state": "ready", children: [
|
|
4843
|
+
return /* @__PURE__ */ jsxs("div", { className: root, "data-state": "ready", children: [
|
|
4884
4844
|
children,
|
|
4885
4845
|
error !== void 0 && /* @__PURE__ */ jsx2("p", { className: "schematic-status-note schematic-error", role: "alert", children: errorMessage ?? error.message })
|
|
4886
4846
|
] });
|
|
@@ -6064,7 +6024,7 @@ function PriceDetails({
|
|
|
6064
6024
|
const period = details.period === null ? void 0 : shortPeriod(details.period, t);
|
|
6065
6025
|
if (details.kind === "overage") {
|
|
6066
6026
|
return /* @__PURE__ */ jsxs6("div", { className: "schematic-metered-features__price-details", children: [
|
|
6067
|
-
/* @__PURE__ */ jsxs6("span", { children: [
|
|
6027
|
+
/* @__PURE__ */ jsxs6("span", { className: "schematic-metered-features__price-label", children: [
|
|
6068
6028
|
t("meteredFeaturesAdditional"),
|
|
6069
6029
|
": ",
|
|
6070
6030
|
details.unitPrice,
|
|
@@ -6075,7 +6035,7 @@ function PriceDetails({
|
|
|
6075
6035
|
period !== void 0 && `/${period}`
|
|
6076
6036
|
] })
|
|
6077
6037
|
] }),
|
|
6078
|
-
/* @__PURE__ */ jsxs6("span", { children: [
|
|
6038
|
+
/* @__PURE__ */ jsxs6("span", { className: "schematic-metered-features__price-cost", children: [
|
|
6079
6039
|
details.overage.amount,
|
|
6080
6040
|
" ",
|
|
6081
6041
|
details.overage.units,
|
|
@@ -6089,7 +6049,7 @@ function PriceDetails({
|
|
|
6089
6049
|
] });
|
|
6090
6050
|
}
|
|
6091
6051
|
return /* @__PURE__ */ jsxs6("div", { className: "schematic-metered-features__price-details", children: [
|
|
6092
|
-
/* @__PURE__ */ jsxs6("span", { children: [
|
|
6052
|
+
/* @__PURE__ */ jsxs6("span", { className: "schematic-metered-features__price-label", children: [
|
|
6093
6053
|
t("meteredFeaturesTier"),
|
|
6094
6054
|
": ",
|
|
6095
6055
|
details.from,
|
|
@@ -6107,7 +6067,7 @@ function PriceDetails({
|
|
|
6107
6067
|
}
|
|
6108
6068
|
) })
|
|
6109
6069
|
] }),
|
|
6110
|
-
details.cost !== null && /* @__PURE__ */ jsxs6("span", { children: [
|
|
6070
|
+
details.cost !== null && /* @__PURE__ */ jsxs6("span", { className: "schematic-metered-features__price-cost", children: [
|
|
6111
6071
|
details.cost,
|
|
6112
6072
|
period !== void 0 && /* @__PURE__ */ jsxs6("sub", { children: [
|
|
6113
6073
|
"/",
|
|
@@ -7187,93 +7147,104 @@ function UnsubscribeButton({
|
|
|
7187
7147
|
onUnsubscribed?.();
|
|
7188
7148
|
};
|
|
7189
7149
|
const per = shortPeriod(view.period, t);
|
|
7190
|
-
return /* @__PURE__ */ jsxs10(
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7150
|
+
return /* @__PURE__ */ jsxs10(
|
|
7151
|
+
"div",
|
|
7152
|
+
{
|
|
7153
|
+
className: cx(
|
|
7154
|
+
"schematic-element",
|
|
7155
|
+
"schematic-card",
|
|
7156
|
+
"schematic-unsubscribe",
|
|
7157
|
+
className
|
|
7158
|
+
),
|
|
7159
|
+
children: [
|
|
7160
|
+
/* @__PURE__ */ jsx11(
|
|
7161
|
+
"button",
|
|
7162
|
+
{
|
|
7163
|
+
className: "schematic-cta schematic-unsubscribe__open",
|
|
7164
|
+
type: "button",
|
|
7165
|
+
onClick: () => {
|
|
7166
|
+
setFailed(false);
|
|
7167
|
+
setOpen(true);
|
|
7168
|
+
},
|
|
7169
|
+
children: t("unsubscribeButton")
|
|
7170
|
+
}
|
|
7171
|
+
),
|
|
7172
|
+
/* @__PURE__ */ jsx11(
|
|
7173
|
+
Dialog,
|
|
7174
|
+
{
|
|
7175
|
+
className: "schematic-unsubscribe__dialog",
|
|
7176
|
+
closeLabel: t("unsubscribeClose"),
|
|
7177
|
+
open,
|
|
7178
|
+
title: t("unsubscribeTitle"),
|
|
7179
|
+
onClose: close,
|
|
7180
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__columns", children: [
|
|
7181
|
+
/* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__summary", children: [
|
|
7182
|
+
/* @__PURE__ */ jsx11("p", { children: t("unsubscribeAccessUntil", { date: view.accessEndsOn }) }),
|
|
7183
|
+
/* @__PURE__ */ jsx11(
|
|
7184
|
+
ManagePlan,
|
|
7185
|
+
{
|
|
7186
|
+
onClick: onManagePlan,
|
|
7187
|
+
t,
|
|
7188
|
+
target: managePlanTarget,
|
|
7189
|
+
url: managePlanUrl
|
|
7190
|
+
}
|
|
7191
|
+
)
|
|
7192
|
+
] }),
|
|
7193
|
+
/* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__sidebar", children: [
|
|
7194
|
+
view.plan !== null && /* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__group", children: [
|
|
7195
|
+
/* @__PURE__ */ jsx11("span", { className: "schematic-muted schematic-small", children: t("unsubscribePlan") }),
|
|
7196
|
+
/* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__line", children: [
|
|
7197
|
+
/* @__PURE__ */ jsx11("span", { className: "schematic-unsubscribe__name", children: view.plan.name }),
|
|
7198
|
+
view.plan.price !== null && /* @__PURE__ */ jsxs10("span", { children: [
|
|
7199
|
+
view.plan.price,
|
|
7200
|
+
per !== void 0 && /* @__PURE__ */ jsxs10("sub", { children: [
|
|
7201
|
+
"/",
|
|
7202
|
+
per
|
|
7203
|
+
] })
|
|
7204
|
+
] })
|
|
7234
7205
|
] })
|
|
7235
|
-
] })
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7206
|
+
] }),
|
|
7207
|
+
view.addOns.length > 0 && /* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__group", children: [
|
|
7208
|
+
/* @__PURE__ */ jsx11("span", { className: "schematic-muted schematic-small", children: t("unsubscribeAddOns") }),
|
|
7209
|
+
view.addOns.map((addOn) => /* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__line", children: [
|
|
7210
|
+
/* @__PURE__ */ jsx11("span", { className: "schematic-unsubscribe__name", children: addOn.name }),
|
|
7211
|
+
/* @__PURE__ */ jsxs10("span", { children: [
|
|
7212
|
+
addOn.price,
|
|
7213
|
+
!addOn.oneTime && per !== void 0 && /* @__PURE__ */ jsxs10("sub", { children: [
|
|
7214
|
+
"/",
|
|
7215
|
+
per
|
|
7216
|
+
] })
|
|
7217
|
+
] })
|
|
7218
|
+
] }, addOn.id))
|
|
7219
|
+
] }),
|
|
7220
|
+
/* @__PURE__ */ jsxs10("div", { className: "schematic-unsubscribe__line schematic-unsubscribe__total", children: [
|
|
7221
|
+
/* @__PURE__ */ jsx11("span", { className: "schematic-muted", children: t(TOTAL_KEY[view.period] ?? "unsubscribeMonthlyTotal") }),
|
|
7222
|
+
/* @__PURE__ */ jsxs10("span", { children: [
|
|
7223
|
+
view.total,
|
|
7224
|
+
per !== void 0 && /* @__PURE__ */ jsxs10("sub", { children: [
|
|
7225
|
+
"/",
|
|
7226
|
+
per
|
|
7227
|
+
] })
|
|
7247
7228
|
] })
|
|
7248
|
-
] })
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7229
|
+
] }),
|
|
7230
|
+
/* @__PURE__ */ jsx11(
|
|
7231
|
+
"button",
|
|
7232
|
+
{
|
|
7233
|
+
className: "schematic-cta schematic-unsubscribe__confirm",
|
|
7234
|
+
disabled: isMutating,
|
|
7235
|
+
type: "button",
|
|
7236
|
+
onClick: () => void confirm(),
|
|
7237
|
+
children: t("unsubscribeConfirm")
|
|
7238
|
+
}
|
|
7239
|
+
),
|
|
7240
|
+
failed && /* @__PURE__ */ jsx11("p", { className: "schematic-error", role: "alert", children: t("unsubscribeFailed") })
|
|
7259
7241
|
] })
|
|
7260
|
-
] })
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
type: "button",
|
|
7267
|
-
onClick: () => void confirm(),
|
|
7268
|
-
children: t("unsubscribeConfirm")
|
|
7269
|
-
}
|
|
7270
|
-
),
|
|
7271
|
-
failed && /* @__PURE__ */ jsx11("p", { className: "schematic-error", role: "alert", children: t("unsubscribeFailed") })
|
|
7272
|
-
] })
|
|
7273
|
-
] })
|
|
7274
|
-
}
|
|
7275
|
-
)
|
|
7276
|
-
] });
|
|
7242
|
+
] })
|
|
7243
|
+
}
|
|
7244
|
+
)
|
|
7245
|
+
]
|
|
7246
|
+
}
|
|
7247
|
+
);
|
|
7277
7248
|
}
|
|
7278
7249
|
function ManagePlan({
|
|
7279
7250
|
onClick,
|