@shoplix-ai/block-kit 3.3.0 → 3.4.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.
@@ -0,0 +1,17 @@
1
+ import { type ThemeStyle } from '@shoplix-ai/sdui-schema';
2
+ /** The parts of the collection tile, each with the theme role it draws unless a component token names another. */
3
+ declare const COLLECTION_TILE_ROLES: {
4
+ readonly artwork: "sunken";
5
+ readonly label: "text";
6
+ };
7
+ export type CollectionTilePart = keyof typeof COLLECTION_TILE_ROLES;
8
+ export type CollectionTileColors = Readonly<Record<CollectionTilePart, string>>;
9
+ /**
10
+ * Every colour the collection tile draws, one per part: the theme role behind
11
+ * it, with a per component token at `collection_tile.<part>` as the escape
12
+ * hatch over it. The three collection blocks and their web twins read this one
13
+ * table, so a circle and a card cannot disagree on what a merchant's theme means.
14
+ */
15
+ export declare function collectionTileColors(theme: ThemeStyle): CollectionTileColors;
16
+ export {};
17
+ //# sourceMappingURL=collection-tile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-tile.d.ts","sourceRoot":"","sources":["../src/collection-tile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE/E,kHAAkH;AAClH,QAAA,MAAM,qBAAqB;;;CAGoC,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,oBAAoB,CAO5E"}
@@ -0,0 +1,21 @@
1
+ import { componentTokenValue } from '@shoplix-ai/sdui-schema';
2
+ /** The parts of the collection tile, each with the theme role it draws unless a component token names another. */
3
+ const COLLECTION_TILE_ROLES = {
4
+ artwork: 'sunken',
5
+ label: 'text',
6
+ };
7
+ /**
8
+ * Every colour the collection tile draws, one per part: the theme role behind
9
+ * it, with a per component token at `collection_tile.<part>` as the escape
10
+ * hatch over it. The three collection blocks and their web twins read this one
11
+ * table, so a circle and a card cannot disagree on what a merchant's theme means.
12
+ */
13
+ export function collectionTileColors(theme) {
14
+ const colors = {};
15
+ for (const part of Object.keys(COLLECTION_TILE_ROLES)) {
16
+ const role = theme.colors[COLLECTION_TILE_ROLES[part]];
17
+ colors[part] = componentTokenValue(theme, `collection_tile.${part}`, role);
18
+ }
19
+ return colors;
20
+ }
21
+ //# sourceMappingURL=collection-tile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-tile.js","sourceRoot":"","sources":["../src/collection-tile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,yBAAyB,CAAC;AAE/E,kHAAkH;AAClH,MAAM,qBAAqB,GAAG;IAC5B,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,MAAM;CACgD,CAAC;AAMhE;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAiB;IACpD,MAAM,MAAM,GAAG,EAAwC,CAAC;IACxD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAyB,EAAE,CAAC;QAC9E,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ export { CONTRACT_MAJOR, CONTRACT_VERSION } from './version.js';
13
13
  export { resolveToken } from './tokens.js';
14
14
  export { productCardColors } from './product-card.js';
15
15
  export type { ProductCardColors, ProductCardPart } from './product-card.js';
16
+ export { collectionTileColors } from './collection-tile.js';
17
+ export type { CollectionTileColors, CollectionTilePart } from './collection-tile.js';
16
18
  export { discountPercent, formatMoney, moneyAmount, moneyParts, moneyText } from './money.js';
17
19
  export type { MoneyParts } from './money.js';
18
20
  export { imageSourceFor } from './renditions.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,YAAY,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE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RACT_MAJOR, CONTRACT_VERSION } from './version.js';
7
7
  export { resolveToken } from './tokens.js';
8
8
  export { productCardColors } from './product-card.js';
9
+ export { collectionTileColors } from './collection-tile.js';
9
10
  export { discountPercent, formatMoney, moneyAmount, moneyParts, moneyText } from './money.js';
10
11
  export { imageSourceFor } from './renditions.js';
11
12
  export { localize, pickLocale, textDirection } from './locale.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAY7F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAgB5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG/D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAY7F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAgB5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG/D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
package/dist/version.d.ts CHANGED
@@ -4,6 +4,6 @@
4
4
  * The major is the compatibility line: a Shop package built against another
5
5
  * major never meets this runtime, and a major bump is an announced event.
6
6
  */
7
- export declare const CONTRACT_VERSION = "3.3.0";
7
+ export declare const CONTRACT_VERSION = "3.4.0";
8
8
  export declare const CONTRACT_MAJOR = 3;
9
9
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -4,6 +4,6 @@
4
4
  * The major is the compatibility line: a Shop package built against another
5
5
  * major never meets this runtime, and a major bump is an announced event.
6
6
  */
7
- export const CONTRACT_VERSION = '3.3.0';
7
+ export const CONTRACT_VERSION = '3.4.0';
8
8
  export const CONTRACT_MAJOR = 3;
9
9
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplix-ai/block-kit",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "The renderer contract every Block Type renderer is written against: what a renderer receives, how a Block Type is registered with its owner, the closed capability set, and the small helpers renderers share. Contract only, no renderers.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@shoplix-ai/sdui-schema": "1.11.0"
29
+ "@shoplix-ai/sdui-schema": "1.13.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=19.0.0"