@shoplix-ai/block-kit 5.0.0 → 5.17.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.
Files changed (99) hide show
  1. package/README.md +116 -13
  2. package/dist/account-links.d.ts +50 -1
  3. package/dist/account-links.d.ts.map +1 -1
  4. package/dist/account-links.js +61 -1
  5. package/dist/account-links.js.map +1 -1
  6. package/dist/address-list.d.ts +9 -8
  7. package/dist/address-list.d.ts.map +1 -1
  8. package/dist/address-list.js +5 -5
  9. package/dist/address-list.js.map +1 -1
  10. package/dist/buy-box.d.ts +8 -0
  11. package/dist/buy-box.d.ts.map +1 -1
  12. package/dist/buy-box.js +8 -0
  13. package/dist/buy-box.js.map +1 -1
  14. package/dist/capabilities.d.ts +4 -1
  15. package/dist/capabilities.d.ts.map +1 -1
  16. package/dist/capabilities.js.map +1 -1
  17. package/dist/category-grid.d.ts +92 -0
  18. package/dist/category-grid.d.ts.map +1 -0
  19. package/dist/category-grid.js +123 -0
  20. package/dist/category-grid.js.map +1 -0
  21. package/dist/color-choice.d.ts +4 -0
  22. package/dist/color-choice.d.ts.map +1 -0
  23. package/dist/color-choice.js +11 -0
  24. package/dist/color-choice.js.map +1 -0
  25. package/dist/content-direction.d.ts +10 -0
  26. package/dist/content-direction.d.ts.map +1 -0
  27. package/dist/content-direction.js +20 -0
  28. package/dist/content-direction.js.map +1 -0
  29. package/dist/description.d.ts +60 -0
  30. package/dist/description.d.ts.map +1 -0
  31. package/dist/description.js +332 -0
  32. package/dist/description.js.map +1 -0
  33. package/dist/index.d.ts +23 -12
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +14 -8
  36. package/dist/index.js.map +1 -1
  37. package/dist/listing-filters.d.ts +114 -0
  38. package/dist/listing-filters.d.ts.map +1 -0
  39. package/dist/listing-filters.js +195 -0
  40. package/dist/listing-filters.js.map +1 -0
  41. package/dist/listing-toolbar.d.ts +117 -0
  42. package/dist/listing-toolbar.d.ts.map +1 -0
  43. package/dist/listing-toolbar.js +130 -0
  44. package/dist/listing-toolbar.js.map +1 -0
  45. package/dist/money.d.ts +7 -0
  46. package/dist/money.d.ts.map +1 -1
  47. package/dist/money.js +15 -0
  48. package/dist/money.js.map +1 -1
  49. package/dist/navigation.d.ts +7 -5
  50. package/dist/navigation.d.ts.map +1 -1
  51. package/dist/orders.d.ts +87 -9
  52. package/dist/orders.d.ts.map +1 -1
  53. package/dist/orders.js +127 -13
  54. package/dist/orders.js.map +1 -1
  55. package/dist/product-card.d.ts +4 -0
  56. package/dist/product-card.d.ts.map +1 -1
  57. package/dist/product-card.js +4 -0
  58. package/dist/product-card.js.map +1 -1
  59. package/dist/product-gallery.d.ts +3 -0
  60. package/dist/product-gallery.d.ts.map +1 -1
  61. package/dist/product-gallery.js +3 -0
  62. package/dist/product-gallery.js.map +1 -1
  63. package/dist/product-specs.d.ts +33 -2
  64. package/dist/product-specs.d.ts.map +1 -1
  65. package/dist/product-specs.js +51 -2
  66. package/dist/product-specs.js.map +1 -1
  67. package/dist/product-summary.d.ts +12 -1
  68. package/dist/product-summary.d.ts.map +1 -1
  69. package/dist/product-summary.js +29 -0
  70. package/dist/product-summary.js.map +1 -1
  71. package/dist/profile-header.d.ts +8 -1
  72. package/dist/profile-header.d.ts.map +1 -1
  73. package/dist/profile-header.js +8 -1
  74. package/dist/profile-header.js.map +1 -1
  75. package/dist/sign-in.d.ts +3 -0
  76. package/dist/sign-in.d.ts.map +1 -1
  77. package/dist/sign-in.js +3 -0
  78. package/dist/sign-in.js.map +1 -1
  79. package/dist/store-header.d.ts +49 -6
  80. package/dist/store-header.d.ts.map +1 -1
  81. package/dist/store-header.js +59 -5
  82. package/dist/store-header.js.map +1 -1
  83. package/dist/variant-choice.d.ts +14 -0
  84. package/dist/variant-choice.d.ts.map +1 -1
  85. package/dist/variant-choice.js +36 -0
  86. package/dist/variant-choice.js.map +1 -1
  87. package/dist/variant-rows.d.ts +33 -0
  88. package/dist/variant-rows.d.ts.map +1 -0
  89. package/dist/variant-rows.js +52 -0
  90. package/dist/variant-rows.js.map +1 -0
  91. package/dist/version.d.ts +1 -1
  92. package/dist/version.d.ts.map +1 -1
  93. package/dist/version.js +1 -1
  94. package/dist/version.js.map +1 -1
  95. package/dist/words.d.ts +67 -2
  96. package/dist/words.d.ts.map +1 -1
  97. package/dist/words.js +180 -1
  98. package/dist/words.js.map +1 -1
  99. package/package.json +11 -2
@@ -0,0 +1,130 @@
1
+ import { LISTING_TOOLBAR_DEFAULTS, listingSortsOf, } from '@shoplix-ai/sdui-schema';
2
+ import { readable } from './locale.js';
3
+ import { partColors } from './part-colors.js';
4
+ import { readableInk } from './readable.js';
5
+ import { countedWord, platformWords } from './words.js';
6
+ /** The parts of the listing toolbar, each with the theme role it draws unless a component token names another. */
7
+ const LISTING_TOOLBAR_ROLES = {
8
+ count: 'text',
9
+ count_word: 'muted',
10
+ bar: 'elevated',
11
+ bar_stroke: 'border',
12
+ bar_ink: 'text',
13
+ track: 'sunken',
14
+ cell: 'elevated',
15
+ cell_ink: 'text',
16
+ cell_idle: 'subtle',
17
+ divider: 'border',
18
+ badge: 'accent',
19
+ chip: 'sunken',
20
+ chip_stroke: 'border',
21
+ chip_ink: 'text',
22
+ chip_remove: 'subtle',
23
+ clear_all: 'accent',
24
+ };
25
+ /**
26
+ * Every colour the listing toolbar draws: the count and its word, the bar
27
+ * that opens the sorts and the filters with its stroke, its words and the line
28
+ * between its halves, the badge that counts the filters on, the switch's track
29
+ * with the cell of the layout on show and the idle one, and the chips under the
30
+ * bar with their stroke, words and remove button, and "clear all". A role the
31
+ * merchant chose for the bar, its stroke, its words, the track, the badge or
32
+ * the chips wins; every other part is its role with `listing_toolbar.<part>`
33
+ * over it, and the badge and the remove button write in whichever ink reads on
34
+ * them. The phone and its web twin read this one table.
35
+ */
36
+ export function listingToolbarColors(theme, settings = {}) {
37
+ const table = partColors(theme, 'listing_toolbar', LISTING_TOOLBAR_ROLES);
38
+ const chosen = (role, fallback) => role === undefined ? fallback : theme.colors[role];
39
+ const badge = chosen(settings.badge, table.badge);
40
+ return {
41
+ ...table,
42
+ bar: chosen(settings.surface, table.bar),
43
+ bar_stroke: chosen(settings.stroke, table.bar_stroke),
44
+ bar_ink: chosen(settings.ink, table.bar_ink),
45
+ track: chosen(settings.track, table.track),
46
+ badge,
47
+ badge_ink: readableInk(badge),
48
+ chip: chosen(settings.chipSurface, table.chip),
49
+ chip_stroke: chosen(settings.chipStroke, table.chip_stroke),
50
+ chip_ink: chosen(settings.chipInk, table.chip_ink),
51
+ chip_remove_ink: readableInk(table.chip_remove),
52
+ };
53
+ }
54
+ /**
55
+ * The toolbar as the mot design measures it: the count at 15 over a word at
56
+ * 13, the switch's two 34 by 30 cells on a track padded by 3, the bar at the
57
+ * merchant's height and corner with its words at 12.5 beside a 16 point
58
+ * glyph, the badge an 18 point circle with its number at 10.5, and each chip
59
+ * 32 tall at the merchant's corner with its words at 12.5 and an 18 point
60
+ * remove button, 8 apart. The merchant switches each part off and sets the bar.
61
+ */
62
+ export function listingToolbarLook(settings) {
63
+ return {
64
+ count: settings.count ?? LISTING_TOOLBAR_DEFAULTS.count,
65
+ layoutSwitch: settings.layoutSwitch ?? LISTING_TOOLBAR_DEFAULTS.layoutSwitch,
66
+ sort: settings.sort ?? LISTING_TOOLBAR_DEFAULTS.sort,
67
+ filter: settings.filter ?? LISTING_TOOLBAR_DEFAULTS.filter,
68
+ chips: settings.chips ?? LISTING_TOOLBAR_DEFAULTS.chips,
69
+ height: settings.height ?? LISTING_TOOLBAR_DEFAULTS.height,
70
+ radius: settings.radius ?? LISTING_TOOLBAR_DEFAULTS.radius,
71
+ countSize: 15,
72
+ wordSize: 13,
73
+ labelSize: 12.5,
74
+ iconSize: 16,
75
+ switchCell: { width: 34, height: 30, radius: 6 },
76
+ switchPad: 3,
77
+ badge: { size: 18, text: 10.5 },
78
+ chip: {
79
+ height: 32,
80
+ radius: settings.chipRadius ?? LISTING_TOOLBAR_DEFAULTS.chipRadius,
81
+ text: 12.5,
82
+ remove: 18,
83
+ gap: 8,
84
+ },
85
+ };
86
+ }
87
+ /**
88
+ * The count a listing shows: the products it has loaded, "24+" while Shopify
89
+ * names a next page, and the full number once the last page is in. The
90
+ * Storefront gives a collection no total, so the app never claims one.
91
+ */
92
+ export function listingCount(count, more, language, defaultLanguage) {
93
+ return {
94
+ number: more ? `${count}+` : String(count),
95
+ word: countedWord('listing.products', count, language, defaultLanguage),
96
+ };
97
+ }
98
+ /**
99
+ * The words of one sort: the merchant's own where they wrote some in a
100
+ * language the buyer reads, and the catalog's otherwise, so a sort the
101
+ * Binding opens in that the toolbar does not list is still named.
102
+ */
103
+ export function listingSortLabel(settings, key, language, defaultLanguage) {
104
+ const own = listingSortsOf(settings).find((choice) => choice.key === key)?.label;
105
+ const written = own === undefined ? undefined : readable(own, language, defaultLanguage);
106
+ return written ?? platformWords(language, defaultLanguage).own(`listing.sort.${key}`);
107
+ }
108
+ /** The sorts the sheet offers, in the merchant's order and words. */
109
+ export function listingSortRows(settings, language, defaultLanguage) {
110
+ return listingSortsOf(settings).map(({ key }) => ({
111
+ key,
112
+ label: listingSortLabel(settings, key, language, defaultLanguage),
113
+ }));
114
+ }
115
+ /**
116
+ * The row a product takes in a list, as mot-mobile draws it: the picture
117
+ * square at 104 beside the title in two lines and the price, and the add
118
+ * button, a 40 point square on the theme's corner, at the reading end, inside
119
+ * a card padded by 10 with 12 between its parts.
120
+ */
121
+ export const PRODUCT_ROW_LOOK = {
122
+ picture: 104,
123
+ padding: 10,
124
+ gap: 12,
125
+ button: 40,
126
+ titleSize: 13.5,
127
+ titleLines: 2,
128
+ priceSize: 17,
129
+ };
130
+ //# sourceMappingURL=listing-toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listing-toolbar.js","sourceRoot":"","sources":["../src/listing-toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,cAAc,GAMf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QA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A2B;IAE3B,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QAChD,GAAG;QACH,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,CAAC;KAClE,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,EAAE;IACX,GAAG,EAAE,EAAE;IACP,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,EAAE;CACL,CAAC"}
package/dist/money.d.ts CHANGED
@@ -32,6 +32,13 @@ export declare function moneyText(money: DisplayMoney, language: string, style?:
32
32
  * where the saving does not round to a percent worth drawing.
33
33
  */
34
34
  export declare function discountPercent(price: DisplayMoney, compareAt: DisplayMoney | undefined): number | null;
35
+ /**
36
+ * The struck price a product draws beside its own: the compare-at in the style
37
+ * the theme chose, where Shopify sent one in the same currency above the price,
38
+ * and none otherwise. A compare-at that carries no amount is drawn as Shopify
39
+ * wrote it.
40
+ */
41
+ export declare function compareAtParts(price: DisplayMoney, compareAt: DisplayMoney | undefined, language: string, style?: MoneyStyle): MoneyParts | null;
35
42
  /**
36
43
  * A figure a block worked out for itself, written the way every other price on
37
44
  * the screen is written: through the same style, from a decimal amount, never
@@ -1 +1 @@
1
- {"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../src/money.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAajC;;;GAGG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAYf;AAoDD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AACrF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAI1E;AAyCD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,UAAgC,GACtC,UAAU,CAQZ;AAED,2DAA2D;AAC3D,wBAAgB,SAAS,CACvB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,UAAgC,GACtC,MAAM,CAGR;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,YAAY,GAAG,SAAS,GAClC,MAAM,GAAG,IAAI,CAOf;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,YAAY,GAAG,SAAS,EACnC,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,UAAgC,GACtC,UAAU,GAAG,IAAI,CAMnB;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,UAAgC,GACtC,UAAU,CAWZ;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,UAAgC,GACtC,UAAU,CAGZ"}
package/dist/money.js CHANGED
@@ -154,6 +154,21 @@ export function discountPercent(price, compareAt) {
154
154
  const percent = Math.round((1 - now / was) * 100);
155
155
  return percent === 0 ? null : percent;
156
156
  }
157
+ /**
158
+ * The struck price a product draws beside its own: the compare-at in the style
159
+ * the theme chose, where Shopify sent one in the same currency above the price,
160
+ * and none otherwise. A compare-at that carries no amount is drawn as Shopify
161
+ * wrote it.
162
+ */
163
+ export function compareAtParts(price, compareAt, language, style = DEFAULT_MONEY_STYLE) {
164
+ if (compareAt === undefined || compareAt.currencyCode !== price.currencyCode)
165
+ return null;
166
+ const now = moneyAmount(price);
167
+ const was = moneyAmount(compareAt);
168
+ if (now !== null && was !== null && was <= now)
169
+ return null;
170
+ return moneyParts(compareAt, language, style);
171
+ }
157
172
  /** Past every currency's own places, so the style rounds the derived amount rather than this line. */
158
173
  const DERIVED_PLACES = 6;
159
174
  /**
package/dist/money.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"money.js","sourceRoot":"","sources":["../src/money.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAIpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,aAAa,GAAG,YAAY,CAAC;AAEnC,mEAAmE;AACnE,MAAM,OAAO,GAAG,eAAe,CAAC;AAEhC,uEAAuE;AACvE,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,MAAuB,EACvB,YAAoB,EACpB,QAAgB;IAEhB,MAAM,KAAK,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC1F,OAAO,IAAI,CAAC;IACd,CAAC;IACD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MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACpG,CAAC"}
@@ -3,11 +3,12 @@ import type { Action } from '@shoplix-ai/sdui-schema';
3
3
  * The only way a renderer moves the buyer, and it is as closed as the
4
4
  * capability set: the action the document itself carries, and the implicit
5
5
  * taps a block owns by its own kind — a card opening its entity, a search bar
6
- * opening search, a row of the orders opening its order, the order opening
7
- * the page Shopify hosts for it, a saved address opening the Address Sheet on
8
- * itself. A renderer never sees a route, never a screen the document did not
9
- * name, and never the router that owns them. The last three are absent on a
10
- * host written before them, so a renderer calls each only where it is there.
6
+ * opening search, a row of the orders opening its order or its tracking, the
7
+ * order opening the page Shopify hosts for it, a saved address opening the
8
+ * Address Sheet on itself. A renderer never sees a route, never a screen the
9
+ * document did not name, and never the router that owns them. The last four
10
+ * are absent on a host written before them, so a renderer calls each only
11
+ * where it is there.
11
12
  */
12
13
  export interface BlockNavigation {
13
14
  readonly run: (action: Action) => void;
@@ -16,6 +17,7 @@ export interface BlockNavigation {
16
17
  readonly openSearch: () => void;
17
18
  readonly openAccount: () => void;
18
19
  readonly openOrder?: (orderId: string) => void;
20
+ readonly openOrderTracking?: (orderId: string) => void;
19
21
  readonly openOrderPage?: (url: string) => void;
20
22
  readonly openAddress?: (addressId: string) => void;
21
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,KAA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{ type DisplayMoney, type FulfillmentDisplay, type FulfillmentEventStatus, type FulfillmentStatus, type LocaleCode, type OrderDisplay, type ThemeStyle } from '@shoplix-ai/sdui-schema';
1
+ import { type DisplayMoney, type FulfillmentDisplay, type FulfillmentEventStatus, type FulfillmentStatus, type LocaleCode, type OrderDisplay, type OrderLineDisplay, type OrderLinesBlock, type OrderListBlock, type OrderSummaryBlock, type StatusTokenName, type ThemeStyle } from '@shoplix-ai/sdui-schema';
2
2
  import type { WordKey } from './words.js';
3
3
  /**
4
4
  * How a pill reads at a glance: a state still moving, one that ended well,
@@ -12,8 +12,9 @@ export interface OrderPill {
12
12
  }
13
13
  /**
14
14
  * Where the shipping of an order stands. A cancelled order says so whatever
15
- * its shipping state was. Delivered is read off the shipments, so only the
16
- * opened order can say it: a row of the list carries no shipment.
15
+ * its shipping state was. Delivered is read off the newest event of every
16
+ * live shipment, which the opened order and a row of the list both carry; a
17
+ * row that carries no shipment says what the fulfillment state says.
17
18
  */
18
19
  export declare function fulfillmentPillOf(order: OrderDisplay): OrderPill;
19
20
  /** Where the payment of an order stands. */
@@ -23,11 +24,16 @@ export interface OrderPillColors {
23
24
  readonly surface: string;
24
25
  }
25
26
  /**
26
- * The ink and the surface of a pill. No theme role is a red and none is a
27
- * tint, so a stopped pill draws the warning role on the sunken well until a
28
- * design names `order.pill_<tone>` and `order.pill_<tone>_surface`.
27
+ * The ink and the surface of a pill: the label and the surface the theme
28
+ * names for the pill's state at `status.<state>`. A theme written before those
29
+ * draws what it drew then: `order.pill_<tone>` and `order.pill_<tone>_surface`
30
+ * where it names them, and the tone's role on the sunken well behind those.
31
+ * No theme role is a red and none is a tint, so a stopped pill of a theme
32
+ * that names nothing draws the warning role.
29
33
  */
30
34
  export declare function orderPillColors(theme: ThemeStyle, tone: OrderPillTone): OrderPillColors;
35
+ /** The pair each of the three states is drawn in, as a pill of that state would draw it. */
36
+ export declare function orderStatusColors(theme: ThemeStyle): Readonly<Record<StatusTokenName, OrderPillColors>>;
31
37
  /** The four steps of the progress rail, in the order a parcel passes them. */
32
38
  export declare const SHIPMENT_STEPS: readonly ["confirmed", "in_transit", "out_for_delivery", "delivered"];
33
39
  export type ShipmentStep = (typeof SHIPMENT_STEPS)[number];
@@ -39,8 +45,12 @@ export type ShipmentStep = (typeof SHIPMENT_STEPS)[number];
39
45
  export declare function shipmentStepReached(shipment: FulfillmentDisplay): number;
40
46
  /** The platform's word for one step of a shipment's way, which is also the word under a step of the rail. */
41
47
  export declare function fulfillmentEventWord(status: FulfillmentEventStatus): WordKey;
42
- /** The platform's word for the state of one shipment. */
43
- export declare function shipmentWord(status: FulfillmentStatus): WordKey;
48
+ /**
49
+ * The platform's word for the state of one shipment: Delivered where its
50
+ * newest event says it arrived, the word of the state Shopify holds it in
51
+ * otherwise. Handed a state alone, the word of that state.
52
+ */
53
+ export declare function shipmentWord(shipmentOrState: FulfillmentDisplay | FulfillmentStatus): WordKey;
44
54
  /** One money row of the order summary: the platform's word and Shopify's amount. */
45
55
  export interface OrderMoneyRow {
46
56
  readonly key: 'subtotal' | 'discount' | 'shipping' | 'tax';
@@ -56,7 +66,9 @@ export declare function orderTime(iso: string, language: LocaleCode, timeZone?:
56
66
  /**
57
67
  * The parts the order blocks share, each with the theme role it draws unless a
58
68
  * component token names another. The eight blocks read one table, so a design
59
- * names the stroke of an order card once.
69
+ * names the stroke of an order card once. The summary's inks are parts of
70
+ * their own, so a design can give the summary its near-blacks without moving
71
+ * the other blocks.
60
72
  */
61
73
  declare const ORDER_ROLES: {
62
74
  readonly card: "surface";
@@ -73,6 +85,13 @@ declare const ORDER_ROLES: {
73
85
  readonly link: "action";
74
86
  readonly button: "action";
75
87
  readonly chevron: "muted";
88
+ readonly chip: "sunken";
89
+ readonly chip_ink: "muted";
90
+ readonly chip_stroke: "border";
91
+ readonly summary_title: "text";
92
+ readonly summary_row: "text";
93
+ readonly summary_total: "text";
94
+ readonly summary_amount: "text";
76
95
  };
77
96
  export type OrderPart = keyof typeof ORDER_ROLES;
78
97
  export type OrderColors = Readonly<Record<OrderPart, string>>;
@@ -80,5 +99,64 @@ export type OrderColors = Readonly<Record<OrderPart, string>>;
80
99
  export declare function orderColors(theme: ThemeStyle): OrderColors;
81
100
  /** The corner an order card is cut with: the merchant's own, with `order.radius` over it. */
82
101
  export declare function orderRadius(theme: ThemeStyle): number;
102
+ /** The card one line of an order stands on: its surface, its corner and the corner of its picture. */
103
+ export interface OrderLineCard {
104
+ readonly surface: string;
105
+ readonly radius: number;
106
+ readonly pictureRadius: number;
107
+ }
108
+ /** The card one row of the orders list stands on: the line around it, its corner and its inner space. */
109
+ export interface OrderRowCard {
110
+ readonly stroke: string;
111
+ readonly radius: number;
112
+ readonly padding: number;
113
+ }
114
+ export interface OrderListCards {
115
+ readonly row: OrderRowCard;
116
+ readonly line: OrderLineCard;
117
+ }
118
+ /**
119
+ * The card one line of an order stands on, in the list and on the order
120
+ * screen alike: what the merchant set, and the order blocks' own surface and
121
+ * corner where they set nothing. The corner of the picture is
122
+ * `order.picture_radius`, the theme's corner behind it.
123
+ */
124
+ export declare function orderLineCard(theme: ThemeStyle, lineCard: OrderLinesBlock['props']['lineCard']): OrderLineCard;
125
+ /**
126
+ * The two cards of a row of the orders list: what the merchant set, and for
127
+ * every part they left out the look the list had before the cards were
128
+ * settings: the order blocks' stroke and corner, twelve points inside, and
129
+ * under the first line the card a line of the order screen stands on.
130
+ */
131
+ export declare function orderListCards(theme: ThemeStyle, settings: OrderListBlock['props']): OrderListCards;
132
+ /** The box the money rows stand in: its surface, the line under each row and its corner. */
133
+ export interface OrderSummaryBox {
134
+ readonly surface: string;
135
+ readonly divider: string;
136
+ readonly radius: number;
137
+ }
138
+ /**
139
+ * The summary box as the merchant set it, and the look it had before these
140
+ * were settings where they set nothing: the order blocks' summary surface and
141
+ * rule, and the theme's corner.
142
+ */
143
+ export declare function orderSummaryBox(theme: ThemeStyle, settings: OrderSummaryBlock['props']): OrderSummaryBox;
144
+ /** What a row of the list draws of an order's lines. A count Shopify did not hand in full is null. */
145
+ export interface OrderItems {
146
+ readonly firstLine: OrderLineDisplay | null;
147
+ readonly otherLines: number | null;
148
+ readonly itemCount: number | null;
149
+ }
150
+ /**
151
+ * The first line of an order, how many lines follow it and how many items it
152
+ * holds: what a row of a page carries, or what the lines of a whole order add
153
+ * up to. A row whose lines Shopify did not hand in full knows neither count.
154
+ */
155
+ export declare function orderItemsOf(order: OrderDisplay): OrderItems;
156
+ /**
157
+ * Whether Shopify holds a shipment of the order, the one thing its tracking
158
+ * can show: the shipments a whole order carries, or what a row of a page says.
159
+ */
160
+ export declare function orderHasShipments(order: OrderDisplay): boolean;
83
161
  export {};
84
162
  //# sourceMappingURL=orders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../src/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,YAAY,EAGjB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtE,2FAA2F;AAC3F,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B;AAkCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAOhE;AAED,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAE5D;AASD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM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AiB,CAAC,OAAO,CAAC,GACnC,eAAe,CAOjB;AAED,sGAAsG;AACtG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAU5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAG9D"}
package/dist/orders.js CHANGED
@@ -1,4 +1,5 @@
1
- import { componentTokenValue, } from '@shoplix-ai/sdui-schema';
1
+ import { componentTokenValue, statusTokenPath, } from '@shoplix-ai/sdui-schema';
2
+ import { colorChoiceOf } from './color-choice.js';
2
3
  import { partColors } from './part-colors.js';
3
4
  const CANCELLED = { word: 'order.cancelled', tone: 'stopped' };
4
5
  const DELIVERED = { word: 'order.delivered', tone: 'done' };
@@ -24,13 +25,19 @@ const PAYMENT_PILLS = {
24
25
  voided: { word: 'order.payment.voided', tone: 'stopped' },
25
26
  };
26
27
  const ARRIVED = new Set(['delivered', 'picked_up']);
28
+ /**
29
+ * Whether a live shipment reached the shopper: its newest event, the first of
30
+ * the events Shopify hands newest first, says it was delivered or picked up.
31
+ */
27
32
  function arrived(shipment) {
28
- return (shipment.events ?? []).some((event) => ARRIVED.has(event.status));
33
+ const newest = shipment.events?.[0];
34
+ return shipment.status === 'success' && newest !== undefined && ARRIVED.has(newest.status);
29
35
  }
30
36
  /**
31
37
  * Where the shipping of an order stands. A cancelled order says so whatever
32
- * its shipping state was. Delivered is read off the shipments, so only the
33
- * opened order can say it: a row of the list carries no shipment.
38
+ * its shipping state was. Delivered is read off the newest event of every
39
+ * live shipment, which the opened order and a row of the list both carry; a
40
+ * row that carries no shipment says what the fulfillment state says.
34
41
  */
35
42
  export function fulfillmentPillOf(order) {
36
43
  if (order.cancelledAt !== undefined)
@@ -51,15 +58,38 @@ const PILL_ROLES = {
51
58
  stopped: 'warning',
52
59
  quiet: 'muted',
53
60
  };
61
+ /** The state a tone is drawn in: the three states a theme names colours for, and the quiet tone none. */
62
+ const STATE_OF_TONE = {
63
+ progress: 'pending',
64
+ done: 'delivered',
65
+ stopped: 'cancelled',
66
+ quiet: null,
67
+ };
54
68
  /**
55
- * The ink and the surface of a pill. No theme role is a red and none is a
56
- * tint, so a stopped pill draws the warning role on the sunken well until a
57
- * design names `order.pill_<tone>` and `order.pill_<tone>_surface`.
69
+ * The ink and the surface of a pill: the label and the surface the theme
70
+ * names for the pill's state at `status.<state>`. A theme written before those
71
+ * draws what it drew then: `order.pill_<tone>` and `order.pill_<tone>_surface`
72
+ * where it names them, and the tone's role on the sunken well behind those.
73
+ * No theme role is a red and none is a tint, so a stopped pill of a theme
74
+ * that names nothing draws the warning role.
58
75
  */
59
76
  export function orderPillColors(theme, tone) {
77
+ const ink = componentTokenValue(theme, `order.pill_${tone}`, theme.colors[PILL_ROLES[tone]]);
78
+ const surface = componentTokenValue(theme, `order.pill_${tone}_surface`, theme.colors.sunken);
79
+ const state = STATE_OF_TONE[tone];
80
+ if (state === null)
81
+ return { ink, surface };
82
+ return {
83
+ ink: componentTokenValue(theme, statusTokenPath(state, 'label'), ink),
84
+ surface: componentTokenValue(theme, statusTokenPath(state, 'surface'), surface),
85
+ };
86
+ }
87
+ /** The pair each of the three states is drawn in, as a pill of that state would draw it. */
88
+ export function orderStatusColors(theme) {
60
89
  return {
61
- ink: componentTokenValue(theme, `order.pill_${tone}`, theme.colors[PILL_ROLES[tone]]),
62
- surface: componentTokenValue(theme, `order.pill_${tone}_surface`, theme.colors.sunken),
90
+ pending: orderPillColors(theme, 'progress'),
91
+ delivered: orderPillColors(theme, 'done'),
92
+ cancelled: orderPillColors(theme, 'stopped'),
63
93
  };
64
94
  }
65
95
  /** The four steps of the progress rail, in the order a parcel passes them. */
@@ -117,9 +147,15 @@ const SHIPMENT_WORDS = {
117
147
  pending: 'order.fulfillment.pending_fulfillment',
118
148
  success: 'order.fulfillment.fulfilled',
119
149
  };
120
- /** The platform's word for the state of one shipment. */
121
- export function shipmentWord(status) {
122
- return SHIPMENT_WORDS[status];
150
+ /**
151
+ * The platform's word for the state of one shipment: Delivered where its
152
+ * newest event says it arrived, the word of the state Shopify holds it in
153
+ * otherwise. Handed a state alone, the word of that state.
154
+ */
155
+ export function shipmentWord(shipmentOrState) {
156
+ if (typeof shipmentOrState === 'string')
157
+ return SHIPMENT_WORDS[shipmentOrState];
158
+ return arrived(shipmentOrState) ? DELIVERED.word : SHIPMENT_WORDS[shipmentOrState.status];
123
159
  }
124
160
  const MONEY_ROWS = [
125
161
  ['subtotal', 'cart.subtotal'],
@@ -159,7 +195,9 @@ export function orderTime(iso, language, timeZone) {
159
195
  /**
160
196
  * The parts the order blocks share, each with the theme role it draws unless a
161
197
  * component token names another. The eight blocks read one table, so a design
162
- * names the stroke of an order card once.
198
+ * names the stroke of an order card once. The summary's inks are parts of
199
+ * their own, so a design can give the summary its near-blacks without moving
200
+ * the other blocks.
163
201
  */
164
202
  const ORDER_ROLES = {
165
203
  card: 'surface',
@@ -176,6 +214,13 @@ const ORDER_ROLES = {
176
214
  link: 'action',
177
215
  button: 'action',
178
216
  chevron: 'muted',
217
+ chip: 'sunken',
218
+ chip_ink: 'muted',
219
+ chip_stroke: 'border',
220
+ summary_title: 'text',
221
+ summary_row: 'text',
222
+ summary_total: 'text',
223
+ summary_amount: 'text',
179
224
  };
180
225
  /** Every colour the order blocks draw beside the pills, one per part, with `order.<part>` over each theme role. */
181
226
  export function orderColors(theme) {
@@ -185,4 +230,73 @@ export function orderColors(theme) {
185
230
  export function orderRadius(theme) {
186
231
  return componentTokenValue(theme, 'order.radius', theme.radius);
187
232
  }
233
+ /** The inner space of an order card where the merchant set none. */
234
+ const CARD_PADDING = 12;
235
+ /**
236
+ * The card one line of an order stands on, in the list and on the order
237
+ * screen alike: what the merchant set, and the order blocks' own surface and
238
+ * corner where they set nothing. The corner of the picture is
239
+ * `order.picture_radius`, the theme's corner behind it.
240
+ */
241
+ export function orderLineCard(theme, lineCard) {
242
+ return {
243
+ surface: colorChoiceOf(theme, lineCard?.surface) ?? orderColors(theme).card,
244
+ radius: lineCard?.radius ?? orderRadius(theme),
245
+ pictureRadius: componentTokenValue(theme, 'order.picture_radius', theme.radius),
246
+ };
247
+ }
248
+ /**
249
+ * The two cards of a row of the orders list: what the merchant set, and for
250
+ * every part they left out the look the list had before the cards were
251
+ * settings: the order blocks' stroke and corner, twelve points inside, and
252
+ * under the first line the card a line of the order screen stands on.
253
+ */
254
+ export function orderListCards(theme, settings) {
255
+ const card = settings.card ?? {};
256
+ return {
257
+ row: {
258
+ stroke: colorChoiceOf(theme, card.stroke) ?? orderColors(theme).border,
259
+ radius: card.radius ?? orderRadius(theme),
260
+ padding: card.padding ?? CARD_PADDING,
261
+ },
262
+ line: orderLineCard(theme, settings.lineCard),
263
+ };
264
+ }
265
+ /**
266
+ * The summary box as the merchant set it, and the look it had before these
267
+ * were settings where they set nothing: the order blocks' summary surface and
268
+ * rule, and the theme's corner.
269
+ */
270
+ export function orderSummaryBox(theme, settings) {
271
+ const colors = orderColors(theme);
272
+ return {
273
+ surface: colorChoiceOf(theme, settings.surface) ?? colors.summary,
274
+ divider: colorChoiceOf(theme, settings.divider) ?? colors.rule,
275
+ radius: settings.radius ?? theme.radius,
276
+ };
277
+ }
278
+ /**
279
+ * The first line of an order, how many lines follow it and how many items it
280
+ * holds: what a row of a page carries, or what the lines of a whole order add
281
+ * up to. A row whose lines Shopify did not hand in full knows neither count.
282
+ */
283
+ export function orderItemsOf(order) {
284
+ const lines = order.lines;
285
+ const lineCount = order.lineCount ?? lines?.length ?? null;
286
+ const itemCount = order.itemCount ?? lines?.reduce((items, line) => items + line.quantity, 0) ?? null;
287
+ return {
288
+ firstLine: order.firstLine ?? lines?.[0] ?? null,
289
+ otherLines: lineCount === null ? null : Math.max(0, lineCount - 1),
290
+ itemCount,
291
+ };
292
+ }
293
+ /**
294
+ * Whether Shopify holds a shipment of the order, the one thing its tracking
295
+ * can show: the shipments a whole order carries, or what a row of a page says.
296
+ */
297
+ export function orderHasShipments(order) {
298
+ if (order.fulfillments !== undefined)
299
+ return order.fulfillments.length > 0;
300
+ return order.hasShipments === true;
301
+ }
188
302
  //# sourceMappingURL=orders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orders.js","sourceRoot":"","sources":["../src/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAUpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAe9C,MAAM,SAAS,GAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC1E,MAAM,SAAS,GAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAEvE,MAAM,iBAAiB,GAAwD;IAC7E,SAAS,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,MAAM,EAAE;IAChE,WAAW,EAAE,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,UAAU,EAAE;IACxE,OAAO,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE,IAAI,EAAE,UAAU,EAAE;IAChE,IAAI,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,UAAU,EAAE;IAC1D,mBAAmB,EAAE,EAAE,IAAI,EAAE,uCAAuC,EAAE,IAAI,EAAE,UAAU,EAAE;IACxF,mBAAmB,EAAE,EAAE,IAAI,EAAE,uCAAuC,EAAE,IAAI,EAAE,UAAU,EAAE;IACxF,SAAS,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,SAAS,EAAE;IACnE,SAAS,EAAE,EAAE,IAAI,EAAE,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