@scopetickets/checkout 0.1.2 → 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.
@@ -365,28 +365,6 @@ export declare function formatSlotRange(startTime: string, endTime: string | nul
365
365
  */
366
366
  export declare function formatWeekdayAndDate(day: string): string;
367
367
 
368
- /**
369
- * WHO THE TICKETS ARE FOR — the party step's rows, and the keys they are spent as.
370
- *
371
- * `AssignmentKey` IS NOT A USER TYPE. It identifies one ASSIGNMENT of a type to a product
372
- * on an event. Measured on sandbox 2026-09-10, TwinkleTown — 38 events × 2 products × 3
373
- * types — `EventInformation` answers with 228 entries and 228 distinct keys, 76 of them
374
- * named "Child". So de-duplicating on the key cannot help: every one is already distinct.
375
- * `Name` is the only field that identifies what a buyer is choosing.
376
- *
377
- * THE SAME NAME IS NOT THE SAME OFFER, which is why the assignments are not collapsed
378
- * away: Child is 550 off Peak and 450 off Off-Peak, and needs ID on one and not the other.
379
- * The type is what the buyer picks; the assignment is what it costs, and that is not
380
- * settled until a product is.
381
- *
382
- * WHICH IS WHY THE KEY IS RESOLVED LATE. `PARTY` runs before `DATE` and `TIME`, so when
383
- * the buyer picks "Child" there is no product for an assignment to belong to — the product
384
- * is `productForSession`, decided by the timeslot. Committing to a key there means sending
385
- * Peak's against an Off-Peak product, and a bulk add that refuses an unknown key leaves no
386
- * cart at all. So the composition is keyed by NAME and `assignmentFor` converts it once
387
- * `useCheckoutOrder` holds the product.
388
- */
389
-
390
368
  /**
391
369
  * THE DISTINCT TYPES, in the order the platform first names each — the organiser's own,
392
370
  * and re-sorting on every fetch would move the rows under the pointer.
@@ -511,20 +489,12 @@ export declare type PartyStepperProps = {
511
489
  readonly refused?: number | null;
512
490
  };
513
491
 
514
- /**
515
- * THE PARTY STEP — one stepper per user type, or a single line when the event offers
516
- * none.
517
- *
518
- * Controlled: the caller holds the counts, because the composition belongs to the order
519
- * rather than to the control that edits it. `max` is the ticket's ceiling and is the
520
- * caller's too — a row has no opinion about how many people a party may hold.
521
- */
522
492
  /** A user type the event offers, as the row needs it. */
523
493
  export declare type PartyUserTypeOption = {
524
494
  /**
525
495
  * WHAT THE COMPOSITION COUNTS UNDER. The platform's types are keyed by NAME, because an
526
- * assignment key belongs to a product no one has chosen yet — see `user-types`. A host
527
- * supplying its own may key them however it likes.
496
+ * assignment key belongs to a product no one has chosen yet — see this module's header.
497
+ * A host supplying its own may key them however it likes.
528
498
  */
529
499
  readonly key: string;
530
500
  /** Always present: an event with no discount types still offers a default. */
@@ -562,6 +532,34 @@ export declare type RingDirection = 'cw' | 'ccw';
562
532
  /** Whether two lists of slots say the same thing. */
563
533
  export declare function sameTimeslots(a: readonly Timeslot[], b: readonly Timeslot[]): boolean;
564
534
 
535
+ /** One way into a session: a band by the name a party is counted under, and its unit price. */
536
+ declare type SlotBand = {
537
+ readonly name: string;
538
+ readonly minorUnits: number;
539
+ };
540
+
541
+ /**
542
+ * WHAT A SESSION COSTS.
543
+ *
544
+ * `minorUnits` IS THE FLOOR — the cheapest single admission, which is what a row can say
545
+ * before anybody has said who is coming.
546
+ *
547
+ * `options` IS HOW IT BECOMES A TOTAL. One list of bands per product that sells the session,
548
+ * because the price of a party is not a property of the session alone: two Adults and a
549
+ * Child is a different number from three Adults, and the difference is only knowable once
550
+ * the party is. `priceComposition` spends this; nothing else needs to.
551
+ *
552
+ * ONE LIST PER PRODUCT AND NOT ONE MERGED LIST, because a composition has to be priced
553
+ * against a product that can serve ALL of it. Merging two tickets' bands would let a total
554
+ * be built out of an Adult from one and a Child from the other, at a price no single cart
555
+ * line could be filled at.
556
+ */
557
+ declare type SlotPrice = {
558
+ readonly minorUnits: number;
559
+ readonly currency: string;
560
+ readonly options?: readonly (readonly SlotBand[])[];
561
+ };
562
+
565
563
  /** The key the single line counts under when the event names no types. */
566
564
  export declare const SOLO_KEY = "default";
567
565
 
@@ -640,6 +638,11 @@ declare interface Ticket {
640
638
  UrgencyTags: string[];
641
639
  /** Nullable for the same reason as the run's — see `EventInfoResponse`. */
642
640
  UserTypes: UserType[] | null;
641
+ /**
642
+ * The events this product sells for. Only `TicketInformation` sends it, which is how a
643
+ * response spanning a whole series is split back into days.
644
+ */
645
+ EventKeys?: string[] | null;
643
646
  }
644
647
 
645
648
  /** The time it is right now on a given zone's clock, as `HH:MM`. */
@@ -705,11 +708,6 @@ export declare type TimeSelection = {
705
708
  readonly startTime: string | null;
706
709
  };
707
710
 
708
- /**
709
- * The times within one day that a ticket is sold for — the timeslot picker's whole
710
- * domain.
711
- */
712
-
713
711
  /** One slot a ticket is sold for. */
714
712
  export declare type Timeslot = {
715
713
  /**
@@ -724,6 +722,21 @@ export declare type Timeslot = {
724
722
  * reports it. Null where the slot does not say.
725
723
  */
726
724
  readonly remaining: number | null;
725
+ /**
726
+ * THE CHEAPEST WAY INTO THIS SESSION, where the host knows one. Absent draws no price,
727
+ * which is the default and what every existing caller gets.
728
+ *
729
+ * COMPUTED, NEVER READ. A slot carries no money on the wire — `EventTimeslot` is two
730
+ * times, a total and a remaining — so a price is reached through the TICKET that owns
731
+ * the slot, and the discount bands hang off that ticket too. `slot-price.ts` is the
732
+ * package's answer to all of that, and `runView` spends it for the schedule the widget
733
+ * builds itself; a host composing its own rows reaches the same functions.
734
+ *
735
+ * SO THIS IS A FIGURE AND NOT A RULE. The picker writes the word in front of it and
736
+ * formats the money — that is copy and presentation, which stay here — and takes no view
737
+ * on how the number was arrived at.
738
+ */
739
+ readonly fromPrice?: SlotPrice | null;
727
740
  };
728
741
 
729
742
  /** One slot, resolved: what it is, when it is, and what it can do. */
package/dist/pickers.d.ts CHANGED
@@ -365,28 +365,6 @@ export declare function formatSlotRange(startTime: string, endTime: string | nul
365
365
  */
366
366
  export declare function formatWeekdayAndDate(day: string): string;
367
367
 
368
- /**
369
- * WHO THE TICKETS ARE FOR — the party step's rows, and the keys they are spent as.
370
- *
371
- * `AssignmentKey` IS NOT A USER TYPE. It identifies one ASSIGNMENT of a type to a product
372
- * on an event. Measured on sandbox 2026-09-10, TwinkleTown — 38 events × 2 products × 3
373
- * types — `EventInformation` answers with 228 entries and 228 distinct keys, 76 of them
374
- * named "Child". So de-duplicating on the key cannot help: every one is already distinct.
375
- * `Name` is the only field that identifies what a buyer is choosing.
376
- *
377
- * THE SAME NAME IS NOT THE SAME OFFER, which is why the assignments are not collapsed
378
- * away: Child is 550 off Peak and 450 off Off-Peak, and needs ID on one and not the other.
379
- * The type is what the buyer picks; the assignment is what it costs, and that is not
380
- * settled until a product is.
381
- *
382
- * WHICH IS WHY THE KEY IS RESOLVED LATE. `PARTY` runs before `DATE` and `TIME`, so when
383
- * the buyer picks "Child" there is no product for an assignment to belong to — the product
384
- * is `productForSession`, decided by the timeslot. Committing to a key there means sending
385
- * Peak's against an Off-Peak product, and a bulk add that refuses an unknown key leaves no
386
- * cart at all. So the composition is keyed by NAME and `assignmentFor` converts it once
387
- * `useCheckoutOrder` holds the product.
388
- */
389
-
390
368
  /**
391
369
  * THE DISTINCT TYPES, in the order the platform first names each — the organiser's own,
392
370
  * and re-sorting on every fetch would move the rows under the pointer.
@@ -511,20 +489,12 @@ export declare type PartyStepperProps = {
511
489
  readonly refused?: number | null;
512
490
  };
513
491
 
514
- /**
515
- * THE PARTY STEP — one stepper per user type, or a single line when the event offers
516
- * none.
517
- *
518
- * Controlled: the caller holds the counts, because the composition belongs to the order
519
- * rather than to the control that edits it. `max` is the ticket's ceiling and is the
520
- * caller's too — a row has no opinion about how many people a party may hold.
521
- */
522
492
  /** A user type the event offers, as the row needs it. */
523
493
  export declare type PartyUserTypeOption = {
524
494
  /**
525
495
  * WHAT THE COMPOSITION COUNTS UNDER. The platform's types are keyed by NAME, because an
526
- * assignment key belongs to a product no one has chosen yet — see `user-types`. A host
527
- * supplying its own may key them however it likes.
496
+ * assignment key belongs to a product no one has chosen yet — see this module's header.
497
+ * A host supplying its own may key them however it likes.
528
498
  */
529
499
  readonly key: string;
530
500
  /** Always present: an event with no discount types still offers a default. */
@@ -562,6 +532,34 @@ export declare type RingDirection = 'cw' | 'ccw';
562
532
  /** Whether two lists of slots say the same thing. */
563
533
  export declare function sameTimeslots(a: readonly Timeslot[], b: readonly Timeslot[]): boolean;
564
534
 
535
+ /** One way into a session: a band by the name a party is counted under, and its unit price. */
536
+ declare type SlotBand = {
537
+ readonly name: string;
538
+ readonly minorUnits: number;
539
+ };
540
+
541
+ /**
542
+ * WHAT A SESSION COSTS.
543
+ *
544
+ * `minorUnits` IS THE FLOOR — the cheapest single admission, which is what a row can say
545
+ * before anybody has said who is coming.
546
+ *
547
+ * `options` IS HOW IT BECOMES A TOTAL. One list of bands per product that sells the session,
548
+ * because the price of a party is not a property of the session alone: two Adults and a
549
+ * Child is a different number from three Adults, and the difference is only knowable once
550
+ * the party is. `priceComposition` spends this; nothing else needs to.
551
+ *
552
+ * ONE LIST PER PRODUCT AND NOT ONE MERGED LIST, because a composition has to be priced
553
+ * against a product that can serve ALL of it. Merging two tickets' bands would let a total
554
+ * be built out of an Adult from one and a Child from the other, at a price no single cart
555
+ * line could be filled at.
556
+ */
557
+ declare type SlotPrice = {
558
+ readonly minorUnits: number;
559
+ readonly currency: string;
560
+ readonly options?: readonly (readonly SlotBand[])[];
561
+ };
562
+
565
563
  /** The key the single line counts under when the event names no types. */
566
564
  export declare const SOLO_KEY = "default";
567
565
 
@@ -640,6 +638,11 @@ declare interface Ticket {
640
638
  UrgencyTags: string[];
641
639
  /** Nullable for the same reason as the run's — see `EventInfoResponse`. */
642
640
  UserTypes: UserType[] | null;
641
+ /**
642
+ * The events this product sells for. Only `TicketInformation` sends it, which is how a
643
+ * response spanning a whole series is split back into days.
644
+ */
645
+ EventKeys?: string[] | null;
643
646
  }
644
647
 
645
648
  /** The time it is right now on a given zone's clock, as `HH:MM`. */
@@ -705,11 +708,6 @@ export declare type TimeSelection = {
705
708
  readonly startTime: string | null;
706
709
  };
707
710
 
708
- /**
709
- * The times within one day that a ticket is sold for — the timeslot picker's whole
710
- * domain.
711
- */
712
-
713
711
  /** One slot a ticket is sold for. */
714
712
  export declare type Timeslot = {
715
713
  /**
@@ -724,6 +722,21 @@ export declare type Timeslot = {
724
722
  * reports it. Null where the slot does not say.
725
723
  */
726
724
  readonly remaining: number | null;
725
+ /**
726
+ * THE CHEAPEST WAY INTO THIS SESSION, where the host knows one. Absent draws no price,
727
+ * which is the default and what every existing caller gets.
728
+ *
729
+ * COMPUTED, NEVER READ. A slot carries no money on the wire — `EventTimeslot` is two
730
+ * times, a total and a remaining — so a price is reached through the TICKET that owns
731
+ * the slot, and the discount bands hang off that ticket too. `slot-price.ts` is the
732
+ * package's answer to all of that, and `runView` spends it for the schedule the widget
733
+ * builds itself; a host composing its own rows reaches the same functions.
734
+ *
735
+ * SO THIS IS A FIGURE AND NOT A RULE. The picker writes the word in front of it and
736
+ * formats the money — that is copy and presentation, which stay here — and takes no view
737
+ * on how the number was arrived at.
738
+ */
739
+ readonly fromPrice?: SlotPrice | null;
727
740
  };
728
741
 
729
742
  /** One slot, resolved: what it is, when it is, and what it can do. */
package/dist/pickers.js CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  weeksInSeries,
56
56
  withSelectedDay,
57
57
  withSelectedTime
58
- } from "./chunk-4BOPQURW.js";
58
+ } from "./chunk-B7AHG2OO.js";
59
59
  export {
60
60
  CalendarGrainButton,
61
61
  ContentFlag,
package/dist/styles.css CHANGED
@@ -208,6 +208,7 @@
208
208
  --scopetickets-island-timeslot-base-height: calc( var(--scopetickets-island-timeslot-padding) * 2 + var(--scopetickets-island-leading-sm) );
209
209
  --scopetickets-island-timeslot-height: calc( var(--scopetickets-island-timeslot-base-height) + var(--scopetickets-island-day-accessory-gap) + var(--scopetickets-island-day-accessory-height) );
210
210
  --scopetickets-island-timeslot-times-gap: var(--scopetickets-island-space-1);
211
+ --scopetickets-island-timeslot-price-gap: var(--scopetickets-island-space-2);
211
212
  --scopetickets-island-timeslot-list-gap: var(--scopetickets-island-space-1);
212
213
  --scopetickets-island-timeslot-unavailable: 0.4;
213
214
  --scopetickets-island-timeslot-track: var(--scopetickets-island-surface-base);
@@ -731,15 +732,32 @@
731
732
  font-variant-numeric: tabular-nums;
732
733
  white-space: nowrap;
733
734
  }
734
- :is([data-scopetickets-picker], [data-scopetickets-island]) .scopetickets-island-timeslot__remaining {
735
+ :is([data-scopetickets-picker], [data-scopetickets-island]) .scopetickets-island-timeslot__trailing {
735
736
  display: flex;
736
737
  flex: 1 1 0;
737
738
  min-width: 0;
738
739
  align-items: center;
739
740
  justify-content: flex-end;
741
+ gap: var(--scopetickets-island-timeslot-price-gap);
742
+ }
743
+ :is([data-scopetickets-picker], [data-scopetickets-island]) .scopetickets-island-timeslot__price {
744
+ flex: 0 1 auto;
745
+ min-width: 0;
746
+ color: var(--scopetickets-island-text-muted);
747
+ font-size: var(--scopetickets-island-size-xs);
748
+ line-height: var(--scopetickets-island-leading-xs);
749
+ white-space: nowrap;
750
+ overflow: hidden;
751
+ text-overflow: ellipsis;
752
+ }
753
+ :is([data-scopetickets-picker], [data-scopetickets-island]) .scopetickets-island-timeslot__remaining {
754
+ display: flex;
755
+ flex: none;
756
+ align-items: center;
757
+ justify-content: flex-end;
740
758
  }
741
759
  :is([data-scopetickets-picker], [data-scopetickets-island]) .scopetickets-island-timeslot__soldout {
742
- flex: 1 1 0;
760
+ flex: 0 1 auto;
743
761
  min-width: 0;
744
762
  font-size: var(--scopetickets-island-size-sm);
745
763
  line-height: var(--scopetickets-island-leading-sm);
@@ -1496,6 +1514,19 @@
1496
1514
  gap: var(--scopetickets-island-space-2);
1497
1515
  width: 100%;
1498
1516
  }
1517
+ [data-scopetickets-island] .scopetickets-island-card__agreement {
1518
+ display: flex;
1519
+ align-items: center;
1520
+ justify-content: space-between;
1521
+ gap: var(--scopetickets-island-field-inset);
1522
+ min-height: var(--scopetickets-island-field-height);
1523
+ padding-inline: var(--scopetickets-island-field-inset);
1524
+ }
1525
+ [data-scopetickets-island] .scopetickets-island-card__agreement-label {
1526
+ color: var(--scopetickets-island-input-text-secondary);
1527
+ font-size: var(--scopetickets-island-size-md);
1528
+ line-height: var(--scopetickets-island-leading-md);
1529
+ }
1499
1530
  [data-scopetickets-island] .scopetickets-island-card__buttons {
1500
1531
  position: absolute;
1501
1532
  inset-inline: 0;
@@ -1569,7 +1600,10 @@
1569
1600
  font-size: var(--scopetickets-island-size-body);
1570
1601
  line-height: var(--scopetickets-island-leading-body);
1571
1602
  color: var(--scopetickets-island-secondary-text);
1572
- background: var(--scopetickets-island-secondary-bg);
1603
+ --scopetickets-island-button-fill: var(--scopetickets-island-secondary-bg);
1604
+ background: var(--scopetickets-island-button-fill);
1605
+ -webkit-backdrop-filter: blur(var(--scopetickets-island-button-blur));
1606
+ backdrop-filter: blur(var(--scopetickets-island-button-blur));
1573
1607
  }
1574
1608
  [data-scopetickets-island] .scopetickets-island-header-button__title[data-grain-short] {
1575
1609
  min-width: max-content;
@@ -1705,6 +1739,9 @@
1705
1739
  font-size: var(--scopetickets-island-size-body);
1706
1740
  line-height: var(--scopetickets-island-leading-body);
1707
1741
  cursor: pointer;
1742
+ background: var(--scopetickets-island-button-fill, none);
1743
+ -webkit-backdrop-filter: blur(var(--scopetickets-island-button-blur));
1744
+ backdrop-filter: blur(var(--scopetickets-island-button-blur));
1708
1745
  }
1709
1746
  [data-scopetickets-island] .scopetickets-island-button--block {
1710
1747
  width: 100%;
@@ -1712,16 +1749,16 @@
1712
1749
  [data-scopetickets-island] .scopetickets-island-button--action {
1713
1750
  font-weight: var(--scopetickets-island-weight-strong);
1714
1751
  color: var(--scopetickets-island-action-text);
1715
- background: var(--scopetickets-island-action-bg);
1752
+ --scopetickets-island-button-fill: var(--scopetickets-island-action-bg);
1716
1753
  }
1717
1754
  [data-scopetickets-island] .scopetickets-island-button--primary {
1718
- background: var(--scopetickets-island-primary-bg);
1755
+ --scopetickets-island-button-fill: var(--scopetickets-island-primary-bg);
1719
1756
  color: var(--scopetickets-island-primary-text);
1720
1757
  }
1721
1758
  [data-scopetickets-island] .scopetickets-island-button--secondary {
1722
1759
  font-weight: var(--scopetickets-island-weight-regular);
1723
1760
  color: var(--scopetickets-island-secondary-text);
1724
- background: var(--scopetickets-island-secondary-bg);
1761
+ --scopetickets-island-button-fill: var(--scopetickets-island-secondary-bg);
1725
1762
  }
1726
1763
  [data-scopetickets-island] .scopetickets-island-button--marked-separate {
1727
1764
  gap: var(--scopetickets-island-space-3);
@@ -1738,7 +1775,15 @@
1738
1775
  line-height: 1;
1739
1776
  }
1740
1777
  [data-scopetickets-island] .scopetickets-island-button:disabled,
1741
- [data-scopetickets-island] .scopetickets-island-button--disabled {
1778
+ [data-scopetickets-island] .scopetickets-island-button--disabled,
1779
+ [data-scopetickets-island] button.scopetickets-island-chrome-pill:disabled {
1780
+ background: color-mix(in srgb, var(--scopetickets-island-button-fill, transparent) calc(var(--scopetickets-island-disabled-opacity) * 100%), transparent);
1781
+ color: color-mix(in srgb, currentColor calc(var(--scopetickets-island-disabled-opacity) * 100%), transparent);
1782
+ border-color: color-mix(in srgb, var(--scopetickets-island-button-stroke) calc(var(--scopetickets-island-disabled-opacity) * 100%), transparent);
1783
+ }
1784
+ [data-scopetickets-island] .scopetickets-island-button:disabled .scopetickets-island-button__mark,
1785
+ [data-scopetickets-island] .scopetickets-island-button--disabled .scopetickets-island-button__mark,
1786
+ [data-scopetickets-island] button.scopetickets-island-chrome-pill:disabled > * {
1742
1787
  opacity: var(--scopetickets-island-disabled-opacity);
1743
1788
  }
1744
1789
  [data-scopetickets-island] .scopetickets-island-button:disabled {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scopetickets/checkout",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "ScopeTicketsCheckout — the embeddable checkout widget: the island, its motion, and the steps it mounts.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,6 +38,12 @@
38
38
  "engines": {
39
39
  "node": ">=20"
40
40
  },
41
+ "scripts": {
42
+ "build": "pnpm --filter @scopetickets/api --filter @scopetickets/checkout-core build && tsup && node scripts/verify-declarations.mjs",
43
+ "dev": "tsup --watch",
44
+ "typecheck": "tsc --noEmit",
45
+ "prepublishOnly": "node scripts/assert-packed-dist.mjs"
46
+ },
41
47
  "peerDependencies": {
42
48
  "react": "^18.0.0 || ^19.0.0"
43
49
  },
@@ -47,6 +53,8 @@
47
53
  },
48
54
  "devDependencies": {
49
55
  "@microsoft/api-extractor": "^7.59.1",
56
+ "@scopetickets/api": "workspace:*",
57
+ "@scopetickets/checkout-core": "workspace:*",
50
58
  "@testing-library/dom": "^10.4.0",
51
59
  "@testing-library/jest-dom": "^6.6.3",
52
60
  "@testing-library/react": "^16.1.0",
@@ -57,12 +65,6 @@
57
65
  "react": "^18.3.1",
58
66
  "react-dom": "^18.3.1",
59
67
  "tsup": "^8.3.5",
60
- "typescript": "^5.7.2",
61
- "@scopetickets/api": "0.1.0"
62
- },
63
- "scripts": {
64
- "build": "pnpm --filter @scopetickets/api build && tsup && node scripts/verify-declarations.mjs",
65
- "dev": "tsup --watch",
66
- "typecheck": "tsc --noEmit"
68
+ "typescript": "^5.7.2"
67
69
  }
68
- }
70
+ }