@stapel/search-react 0.4.0 → 0.7.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 (139) hide show
  1. package/CHANGELOG.md +151 -0
  2. package/README.md +1 -1
  3. package/dist/default/DegradationNotice.d.ts +7 -0
  4. package/dist/default/DegradationNotice.d.ts.map +1 -1
  5. package/dist/default/DegradationNotice.js +17 -6
  6. package/dist/default/DegradationNotice.js.map +1 -1
  7. package/dist/default/FacetPanelPane.d.ts +54 -3
  8. package/dist/default/FacetPanelPane.d.ts.map +1 -1
  9. package/dist/default/FacetPanelPane.js +119 -19
  10. package/dist/default/FacetPanelPane.js.map +1 -1
  11. package/dist/default/LanguageSelect.d.ts +9 -0
  12. package/dist/default/LanguageSelect.d.ts.map +1 -0
  13. package/dist/default/LanguageSelect.js +72 -0
  14. package/dist/default/LanguageSelect.js.map +1 -0
  15. package/dist/default/PageSizeSelect.d.ts +29 -0
  16. package/dist/default/PageSizeSelect.d.ts.map +1 -0
  17. package/dist/default/PageSizeSelect.js +25 -0
  18. package/dist/default/PageSizeSelect.js.map +1 -0
  19. package/dist/default/RangeFilterRow.d.ts +12 -0
  20. package/dist/default/RangeFilterRow.d.ts.map +1 -0
  21. package/dist/default/RangeFilterRow.js +75 -0
  22. package/dist/default/RangeFilterRow.js.map +1 -0
  23. package/dist/default/RankingDisclosurePane.d.ts +5 -0
  24. package/dist/default/RankingDisclosurePane.d.ts.map +1 -1
  25. package/dist/default/RankingDisclosurePane.js +15 -15
  26. package/dist/default/RankingDisclosurePane.js.map +1 -1
  27. package/dist/default/SearchBox.d.ts +13 -0
  28. package/dist/default/SearchBox.d.ts.map +1 -0
  29. package/dist/default/SearchBox.js +67 -0
  30. package/dist/default/SearchBox.js.map +1 -0
  31. package/dist/default/SearchPage.d.ts +54 -16
  32. package/dist/default/SearchPage.d.ts.map +1 -1
  33. package/dist/default/SearchPage.js +155 -8
  34. package/dist/default/SearchPage.js.map +1 -1
  35. package/dist/default/SearchResultCard.d.ts +19 -18
  36. package/dist/default/SearchResultCard.d.ts.map +1 -1
  37. package/dist/default/SearchResultCard.js +178 -5
  38. package/dist/default/SearchResultCard.js.map +1 -1
  39. package/dist/default/SearchResultsPane.d.ts +42 -3
  40. package/dist/default/SearchResultsPane.d.ts.map +1 -1
  41. package/dist/default/SearchResultsPane.js +38 -21
  42. package/dist/default/SearchResultsPane.js.map +1 -1
  43. package/dist/default/SortSelect.d.ts +10 -2
  44. package/dist/default/SortSelect.d.ts.map +1 -1
  45. package/dist/default/SortSelect.js +27 -24
  46. package/dist/default/SortSelect.js.map +1 -1
  47. package/dist/default/UrlIssueNotice.d.ts.map +1 -1
  48. package/dist/default/UrlIssueNotice.js +19 -1
  49. package/dist/default/UrlIssueNotice.js.map +1 -1
  50. package/dist/default/index.d.ts +32 -15
  51. package/dist/default/index.d.ts.map +1 -1
  52. package/dist/default/index.js +26 -12
  53. package/dist/default/index.js.map +1 -1
  54. package/dist/default/sortLabels.d.ts +5 -0
  55. package/dist/default/sortLabels.d.ts.map +1 -0
  56. package/dist/default/sortLabels.js +32 -0
  57. package/dist/default/sortLabels.js.map +1 -0
  58. package/dist/headless/FacetPanel.d.ts +17 -0
  59. package/dist/headless/FacetPanel.d.ts.map +1 -1
  60. package/dist/headless/FacetPanel.js +23 -2
  61. package/dist/headless/FacetPanel.js.map +1 -1
  62. package/dist/headless/useAppliedCount.d.ts +8 -0
  63. package/dist/headless/useAppliedCount.d.ts.map +1 -0
  64. package/dist/headless/useAppliedCount.js +30 -0
  65. package/dist/headless/useAppliedCount.js.map +1 -0
  66. package/dist/headless/useScorerNames.d.ts +4 -0
  67. package/dist/headless/useScorerNames.d.ts.map +1 -0
  68. package/dist/headless/useScorerNames.js +34 -0
  69. package/dist/headless/useScorerNames.js.map +1 -0
  70. package/dist/headless/useSearchBox.d.ts +44 -0
  71. package/dist/headless/useSearchBox.d.ts.map +1 -0
  72. package/dist/headless/useSearchBox.js +116 -0
  73. package/dist/headless/useSearchBox.js.map +1 -0
  74. package/dist/i18n/es.d.ts.map +1 -1
  75. package/dist/i18n/es.js +30 -4
  76. package/dist/i18n/es.js.map +1 -1
  77. package/dist/i18n/keys.d.ts +35 -0
  78. package/dist/i18n/keys.d.ts.map +1 -1
  79. package/dist/i18n/keys.js +72 -4
  80. package/dist/i18n/keys.js.map +1 -1
  81. package/dist/i18n/ru.d.ts.map +1 -1
  82. package/dist/i18n/ru.js +34 -4
  83. package/dist/i18n/ru.js.map +1 -1
  84. package/dist/index.d.ts +7 -2
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +5 -2
  87. package/dist/index.js.map +1 -1
  88. package/dist/model/queries.d.ts +26 -2
  89. package/dist/model/queries.d.ts.map +1 -1
  90. package/dist/model/queries.js +38 -1
  91. package/dist/model/queries.js.map +1 -1
  92. package/dist/state/limits.d.ts +44 -0
  93. package/dist/state/limits.d.ts.map +1 -0
  94. package/dist/state/limits.js +44 -0
  95. package/dist/state/limits.js.map +1 -0
  96. package/dist/state/ranges.d.ts +52 -0
  97. package/dist/state/ranges.d.ts.map +1 -0
  98. package/dist/state/ranges.js +108 -0
  99. package/dist/state/ranges.js.map +1 -0
  100. package/llms.txt +15 -4
  101. package/manifest.json +238 -21
  102. package/nav-manifest.json +1 -1
  103. package/package.json +15 -10
  104. package/src/analytics/generated/events.json +1 -1
  105. package/src/default/DegradationNotice.tsx +34 -12
  106. package/src/default/FacetPanelPane.tsx +343 -64
  107. package/src/default/LanguageSelect.tsx +93 -0
  108. package/src/default/PageSizeSelect.tsx +80 -0
  109. package/src/default/RangeFilterRow.tsx +148 -0
  110. package/src/default/RankingDisclosurePane.tsx +67 -35
  111. package/src/default/SearchBox.tsx +130 -0
  112. package/src/default/SearchPage.tsx +351 -44
  113. package/src/default/SearchResultCard.tsx +231 -24
  114. package/src/default/SearchResultsPane.tsx +120 -70
  115. package/src/default/SortSelect.tsx +50 -37
  116. package/src/default/UrlIssueNotice.tsx +21 -3
  117. package/src/default/index.ts +38 -15
  118. package/src/default/sortLabels.ts +34 -0
  119. package/src/headless/FacetPanel.tsx +30 -2
  120. package/src/headless/useAppliedCount.ts +41 -0
  121. package/src/headless/useScorerNames.ts +36 -0
  122. package/src/headless/useSearchBox.ts +189 -0
  123. package/src/i18n/es.ts +37 -4
  124. package/src/i18n/keys.ts +83 -4
  125. package/src/i18n/ru.ts +41 -4
  126. package/src/index.ts +22 -2
  127. package/src/model/queries.ts +51 -1
  128. package/src/state/limits.ts +50 -0
  129. package/src/state/ranges.ts +144 -0
  130. package/dist/default/ErrorAlert.d.ts +0 -9
  131. package/dist/default/ErrorAlert.d.ts.map +0 -1
  132. package/dist/default/ErrorAlert.js +0 -27
  133. package/dist/default/ErrorAlert.js.map +0 -1
  134. package/dist/default/theme.d.ts +0 -24
  135. package/dist/default/theme.d.ts.map +0 -1
  136. package/dist/default/theme.js +0 -39
  137. package/dist/default/theme.js.map +0 -1
  138. package/src/default/ErrorAlert.tsx +0 -46
  139. package/src/default/theme.tsx +0 -66
@@ -1,13 +1,24 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Empty, Flex, Spin, Typography } from "antd";
3
- import { errorCode, matchList, toFlowError, useDescribeFlowError, useT, useTPlural, } from "@stapel/core";
2
+ import { Flex, Typography } from "antd";
3
+ import { errorCode, useT, useTPlural } from "@stapel/core";
4
+ import { EmptyState, ErrorAlert, GatedButton, LoadList, SkinTheme, } from "@stapel/tokens-antd/skin";
5
+ import { spacing } from "@stapel/tokens";
4
6
  import { SearchResults } from "../headless/SearchResults.js";
7
+ import { useScorerNames } from "../headless/useScorerNames.js";
5
8
  import { SEARCH_WINDOW_EXCEEDED } from "../i18n/errorsMap.js";
6
9
  import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
7
10
  import { DegradationNotice } from "./DegradationNotice.js";
8
- import { ErrorAlert } from "./ErrorAlert.js";
9
11
  import { SearchResultCard } from "./SearchResultCard.js";
10
- import { SearchSkinTheme } from "./theme.js";
12
+ /**
13
+ * The widest a column of results is allowed to get.
14
+ *
15
+ * Off the spacing scale and named for it: it is a MEASURE, the reading-width
16
+ * decision every long page has to take. Without it the pane spread the full
17
+ * width of whatever it was dropped into — the visual pass measured a 2560px
18
+ * pane with four cards floating at the top of it and a status row 1350px from
19
+ * the buttons that act on it (class C-NOMAXW).
20
+ */
21
+ export const RESULTS_MAX_WIDTH = 1120;
11
22
  /**
12
23
  * The results grid. `auto-fill` + `minmax(280px, 1fr)`: as many columns as fit,
13
24
  * each at least a readable card and never wider than its share — a catalogue
@@ -19,7 +30,7 @@ import { SearchSkinTheme } from "./theme.js";
19
30
  const RESULTS_GRID = {
20
31
  display: "grid",
21
32
  gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
22
- gap: 12,
33
+ gap: spacing[3],
23
34
  alignItems: "stretch",
24
35
  };
25
36
  function Count(props) {
@@ -39,30 +50,36 @@ function Count(props) {
39
50
  ? tPlural(SEARCH_I18N_KEYS.resultsCountAtLeast, { count: page.count })
40
51
  : tPlural(SEARCH_I18N_KEYS.resultsCountExact, { count: page.count }) }));
41
52
  }
53
+ /**
54
+ * The keyset controls — rendered only when there IS another page.
55
+ *
56
+ * Keyset paging has no page numbers to jump to: there is a next, a previous,
57
+ * and a server-side depth cap. When neither direction exists the pager is not
58
+ * "disabled", it is absent — a control that can never do anything is not a
59
+ * control that needs explaining.
60
+ */
42
61
  function Pager(props) {
43
62
  const t = useT();
44
- const { prev, next, goPrev, goNext } = props.bag;
45
- return (_jsxs(Flex, { gap: 8, justify: "center", "data-testid": "search-pager", children: [_jsx(Button, { disabled: !prev.available, title: prev.available ? undefined : t(prev.block.code, prev.block.params), onClick: goPrev, "data-analytics": "none", "data-analytics-reason": "keyset paging is a read, not a flow step", "data-testid": "search-prev", children: t(SEARCH_I18N_KEYS.resultsPrev) }), _jsx(Button, { disabled: !next.available, title: next.available ? undefined : t(next.block.code, next.block.params), onClick: goNext, "data-analytics": "none", "data-analytics-reason": "keyset paging is a read, not a flow step", "data-testid": "search-next", children: t(SEARCH_I18N_KEYS.resultsNext) })] }));
63
+ const { page, prev, next, goPrev, goNext } = props.bag;
64
+ if (page === null || (!page.hasNext && !page.hasPrev))
65
+ return null;
66
+ return (_jsxs(Flex, { gap: spacing[2], justify: "center", wrap: true, "data-testid": "search-pager", children: [_jsx(GatedButton, { gate: prev, onClick: goPrev, testId: "search-prev", "data-analytics": "none", "data-analytics-reason": "keyset paging is a read, not a flow step", children: t(SEARCH_I18N_KEYS.resultsPrev) }), _jsx(GatedButton, { gate: next, onClick: goNext, testId: "search-next", "data-analytics": "none", "data-analytics-reason": "keyset paging is a read, not a flow step", children: t(SEARCH_I18N_KEYS.resultsNext) })] }));
46
67
  }
47
68
  export function SearchResultsPane(props) {
48
69
  const t = useT();
49
- const describe = useDescribeFlowError();
50
70
  const { renderCard, renderResults } = props;
51
- return (_jsx(SearchSkinTheme, { ...(props.mode !== undefined ? { mode: props.mode } : {}), children: _jsx(SearchResults, { ...(props.enabled !== undefined ? { enabled: props.enabled } : {}), children: (bag) => (_jsxs(Flex, { vertical: true, gap: 16, children: [_jsxs(Flex, { justify: "space-between", align: "center", wrap: true, gap: 8, children: [_jsx(Typography.Title, { level: 4, style: { margin: 0 }, children: t(SEARCH_I18N_KEYS.resultsTitle) }), _jsxs(Flex, { align: "center", wrap: true, gap: 12, children: [_jsx(Count, { bag: bag }), props.toolbar] })] }), _jsx(DegradationNotice, { degradations: bag.degradations, variant: props.degradationNotice ?? "banner" }), matchList(bag.state, {
52
- loading: () => (_jsx(Flex, { justify: "center", style: { padding: 24 }, children: _jsx(Spin, { "data-testid": "search-loading" }) })),
53
- failed: (error) => {
71
+ const scorerName = useScorerNames();
72
+ const maxWidth = props.maxWidth === undefined ? RESULTS_MAX_WIDTH : props.maxWidth;
73
+ return (_jsx(SkinTheme, { surface: "base", ...(props.mode !== undefined ? { mode: props.mode } : {}), style: {
74
+ width: "100%",
75
+ ...(maxWidth !== null ? { maxWidth } : {}),
76
+ }, children: _jsx(SearchResults, { ...(props.enabled !== undefined ? { enabled: props.enabled } : {}), children: (bag) => (_jsxs(Flex, { vertical: true, gap: spacing[4], children: [_jsxs(Flex, { justify: "space-between", align: "center", wrap: true, gap: spacing[2], children: [_jsx(Typography.Title, { level: 4, style: { margin: 0 }, "data-testid": "search-results-heading", children: props.heading ?? t(SEARCH_I18N_KEYS.resultsTitle) }), _jsxs(Flex, { align: "center", wrap: true, gap: spacing[3], children: [_jsx(Count, { bag: bag }), props.toolbar] })] }), _jsx(DegradationNotice, { degradations: bag.degradations, variant: props.degradationNotice ?? "banner", scorerName: scorerName }), _jsx(LoadList, { state: bag.state, testId: "search", skeletonRows: 6, onRetry: bag.refetch, empty: _jsx(EmptyState, { title: t(SEARCH_I18N_KEYS.resultsEmpty), testId: "search-empty" }), failed: (error) => {
54
77
  // The window refusal is a DIFFERENT sentence from a failed
55
78
  // search, and both are different from "nothing found".
56
79
  const isWindow = errorCode(error) === SEARCH_WINDOW_EXCEEDED;
57
- return (_jsx(ErrorAlert, { testId: isWindow ? "search-window-exceeded" : "search-failed", error: {
58
- ...describe(toFlowError(error)),
59
- message: t(isWindow
60
- ? SEARCH_I18N_KEYS.resultsWindowExceeded
61
- : SEARCH_I18N_KEYS.resultsLoadFailed),
62
- }, action: _jsx(Button, { size: "small", onClick: bag.refetch, "data-analytics": "none", "data-analytics-reason": "retry of a failed read; no flow to step", children: t(SEARCH_I18N_KEYS.resultsRetry) }) }));
63
- },
64
- empty: () => (_jsx(Empty, { "data-testid": "search-empty", description: t(SEARCH_I18N_KEYS.resultsEmpty) })),
65
- ready: (items) => (_jsx("div", { "data-testid": "search-results", children: renderResults !== undefined ? (renderResults(items)) : (_jsx("div", { style: RESULTS_GRID, "data-testid": "search-results-grid", children: items.map((item) => (_jsx("div", { children: renderCard !== undefined ? (renderCard(item)) : (_jsx(SearchResultCard, { item: item })) }, item.key))) })) })),
66
- }), _jsx(Pager, { bag: bag }), props.footer] })) }) }));
80
+ return (_jsx(ErrorAlert, { testId: isWindow ? "search-window-exceeded" : "search-failed", thrown: error, message: t(isWindow
81
+ ? SEARCH_I18N_KEYS.resultsWindowExceeded
82
+ : SEARCH_I18N_KEYS.resultsLoadFailed), retryLabel: t(SEARCH_I18N_KEYS.resultsRetry), onRetry: bag.refetch }));
83
+ }, children: (items) => (_jsx("div", { "data-testid": "search-results", children: renderResults !== undefined ? (renderResults(items)) : (_jsx("div", { style: RESULTS_GRID, "data-testid": "search-results-grid", children: items.map((item) => (_jsx("div", { children: renderCard !== undefined ? (renderCard(item)) : (_jsx(SearchResultCard, { item: item })) }, item.key))) })) })) }), _jsx(Pager, { bag: bag }), props.footer] })) }) }));
67
84
  }
68
85
  //# sourceMappingURL=SearchResultsPane.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResultsPane.js","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,oBAAoB,EACpB,IAAI,EACJ,UAAU,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAc7C;;;;;;;GAOG;AACH,MAAM,YAAY,GAAkB;IAClC,OAAO,EAAE,MAAM;IACf,mBAAmB,E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AAO,oBACL,MAAM,2BACC,yCAAyC,YAE9D,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAC1B,GAEX,CACH,CAAC;wBACJ,CAAC;wBACD,KAAK,EAAE,GAAG,EAAE,CAAC,CACX,KAAC,KAAK,mBACQ,cAAc,EAC1B,WAAW,EAAE,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAC7C,CACH;wBACD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAChB,6BAAiB,gBAAgB,YAC9B,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAC7B,aAAa,CAAC,KAAK,CAAC,CACrB,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAE,YAAY,iBAAc,qBAAqB,YACxD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAgB,EAAE,EAAE,CAAC,CAC/B,wBACG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAC1B,UAAU,CAAC,IAAI,CAAC,CACjB,CAAC,CAAC,CAAC,CACF,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,GAAI,CACjC,IALO,IAAI,CAAC,GAAG,CAMZ,CACP,CAAC,GACE,CACP,GACG,CACP;qBACF,CAAC,EAEF,KAAC,KAAK,IAAC,GAAG,EAAE,GAAG,GAAI,EAClB,KAAK,CAAC,MAAM,IACR,CACR,GACa,GACA,CACnB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"SearchResultsPane.js","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":";AA2BA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,GACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,C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P,GACG,CACP,GACQ,EAEX,KAAC,KAAK,IAAC,GAAG,EAAE,GAAG,GAAI,EAClB,KAAK,CAAC,MAAM,IACR,CACR,GACa,GACN,CACb,CAAC;AACJ,CAAC"}
@@ -10,10 +10,18 @@
10
10
  *
11
11
  * `sort=distance` needs a centre — the server answers
12
12
  * `error.400.search_sort_needs_center` without one. The option is therefore
13
- * DISABLED with the reason named when no geo centre is set, rather than
14
- * offered and then refused.
13
+ * DISABLED when no geo centre is set, and the REASON is rendered beside the
14
+ * control through `GatedControl`, not in a `title=` a phone can never surface.
15
+ * That is the whole defect this file used to carry: the one sort a person
16
+ * would most want on a phone was greyed out with its explanation in a hover.
15
17
  */
16
18
  import type { ReactElement } from "react";
19
+ /**
20
+ * The select's floor width. Off the spacing scale on purpose and named for it:
21
+ * it is the width of the longest shipped sort label ("Price: low to high") at
22
+ * the default type step, so the control does not resize as the choice changes.
23
+ */
24
+ export declare const SORT_SELECT_MIN_WIDTH = 200;
17
25
  export interface SortSelectProps {
18
26
  /** The sort the SERVER applied, shown when the URL names none. Omitted, it
19
27
  * is read from the page already in cache — see {@link useAppliedSort}. */
@@ -1 +1 @@
1
- {"version":3,"file":"SortSelect.d.ts","sourceRoot":"","sources":["../../src/default/SortSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAgB1C,MAAM,WAAW,eAAe;IAC9B;8EAC0E;IAC1E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAgD/D"}
1
+ {"version":3,"file":"SortSelect.d.ts","sourceRoot":"","sources":["../../src/default/SortSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAY1C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B;8EAC0E;IAC1E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAwD/D"}
@@ -1,17 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Flex, Select, Typography } from "antd";
3
- import { useT } from "@stapel/core";
3
+ import { actionAvailable, actionBlocked, useT } from "@stapel/core";
4
+ import { GatedControl } from "@stapel/tokens-antd/skin";
5
+ import { spacing } from "@stapel/tokens";
4
6
  import { SEARCH_SORTS } from "../api/types.js";
5
7
  import { useAppliedSort } from "../headless/useAppliedSort.js";
6
8
  import { useSearchState } from "../headless/SearchStateProvider.js";
7
9
  import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
8
- const SORT_LABEL_KEY = {
9
- relevance: SEARCH_I18N_KEYS.sortRelevance,
10
- newest: SEARCH_I18N_KEYS.sortNewest,
11
- price_asc: SEARCH_I18N_KEYS.sortPriceAsc,
12
- price_desc: SEARCH_I18N_KEYS.sortPriceDesc,
13
- distance: SEARCH_I18N_KEYS.sortDistance,
14
- };
10
+ import { sortLabelKey } from "./sortLabels.js";
11
+ /**
12
+ * The select's floor width. Off the spacing scale on purpose and named for it:
13
+ * it is the width of the longest shipped sort label ("Price: low to high") at
14
+ * the default type step, so the control does not resize as the choice changes.
15
+ */
16
+ export const SORT_SELECT_MIN_WIDTH = 200;
15
17
  export function SortSelect(props) {
16
18
  const t = useT();
17
19
  const { state, setSort } = useSearchState();
@@ -28,21 +30,22 @@ export function SortSelect(props) {
28
30
  const values = active !== undefined && !known.has(active)
29
31
  ? [...SEARCH_SORTS, active]
30
32
  : SEARCH_SORTS;
31
- return (_jsxs(Flex, { gap: 8, align: "center", children: [_jsx(Typography.Text, { type: "secondary", children: t(SEARCH_I18N_KEYS.sortLabel) }), _jsx(Select, { "data-testid": "search-sort", style: { minWidth: 180 }, value: active ?? null, onChange: (next) => {
32
- setSort(next);
33
- }, options: values.map((value) => {
34
- const key = SORT_LABEL_KEY[value];
35
- const needsCentre = value === "distance" && !hasCentre;
36
- return {
37
- value,
38
- label: key !== undefined ? t(key) : value,
39
- disabled: needsCentre,
40
- // A disabled control states its reason (the ActionAvailability
41
- // canon), even inside a select.
42
- ...(needsCentre
43
- ? { title: t("error.400.search_sort_needs_center") }
44
- : {}),
45
- };
46
- }) })] }));
33
+ // The gate is about ONE option, not the whole control so the binding's
34
+ // `aria-describedby` is spread onto the select (a screen reader hears the
35
+ // reason with the control) and its `disabled` deliberately is not: the other
36
+ // four sorts work perfectly well without a location.
37
+ const distance = hasCentre
38
+ ? actionAvailable()
39
+ : actionBlocked("error.400.search_sort_needs_center");
40
+ return (_jsx(GatedControl, { gate: distance, testId: "search-sort-gate", children: (bind) => (_jsxs(Flex, { gap: spacing[2], align: "center", children: [_jsx(Typography.Text, { type: "secondary", "aria-hidden": "true", children: t(SEARCH_I18N_KEYS.sortLabel) }), _jsx(Select, { "data-testid": "search-sort", "aria-label": t(SEARCH_I18N_KEYS.sortLabel), "aria-describedby": bind["aria-describedby"], style: { minWidth: SORT_SELECT_MIN_WIDTH }, value: active ?? null, onChange: (next) => {
41
+ setSort(next);
42
+ }, options: values.map((value) => {
43
+ const key = sortLabelKey(value);
44
+ return {
45
+ value,
46
+ label: key !== undefined ? t(key) : value,
47
+ disabled: value === "distance" && !hasCentre,
48
+ };
49
+ }) })] })) }));
47
50
  }
48
51
  //# sourceMappingURL=SortSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SortSelect.js","sourceRoot":"","sources":["../../src/default/SortSelect.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,O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OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAC,QAAQ,aACnC,KAAC,UAAU,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,iBAAa,MAAM,YACjD,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,GACd,EAClB,KAAC,MAAM,mBACO,aAAa,gBACb,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,sBACvB,IAAI,CAAC,kBAAkB,CAAC,EAC1C,KAAK,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,EAC1C,KAAK,EAAE,MAAM,IAAI,IAAI,EACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;wBACjB,OAAO,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC,EACD,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;wBAC5B,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;wBAChC,OAAO;4BACL,KAAK;4BACL,KAAK,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;4BACzC,QAAQ,EAAE,KAAK,KAAK,UAAU,IAAI,CAAC,SAAS;yBAC7C,CAAC;oBACJ,CAAC,CAAC,GACF,IACG,CACR,GACY,CAChB,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"UrlIssueNotice.d.ts","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,wBAAgB,cAAc,IAAI,YAAY,GAAG,IAAI,CAqBpD"}
1
+ {"version":3,"file":"UrlIssueNotice.d.ts","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAwB1C,wBAAgB,cAAc,IAAI,YAAY,GAAG,IAAI,CAqBpD"}
@@ -1,13 +1,31 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Alert } from "antd";
3
+ import { spacing } from "@stapel/tokens";
3
4
  import { useT } from "@stapel/core";
5
+ import { FILTER_PREFIX, RANGE_PREFIX } from "../state/urlState.js";
4
6
  import { useSearchState } from "../headless/SearchStateProvider.js";
5
7
  import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
8
+ /**
9
+ * The parameter as a person can recognise it.
10
+ *
11
+ * The codec reports the WIRE name, which for a facet or a range carries the
12
+ * prefix that tells the backend which family it belongs to (`r.price`,
13
+ * `f.brand`). That prefix is a protocol detail: the sentence is read by
14
+ * somebody who followed a link, and "price" is the part of `r.price` they
15
+ * have any chance of recognising.
16
+ */
17
+ function readableParam(param) {
18
+ for (const prefix of [RANGE_PREFIX, FILTER_PREFIX]) {
19
+ if (param.startsWith(prefix))
20
+ return param.slice(prefix.length);
21
+ }
22
+ return param;
23
+ }
6
24
  export function UrlIssueNotice() {
7
25
  const t = useT();
8
26
  const { issues } = useSearchState();
9
27
  if (issues.length === 0)
10
28
  return null;
11
- return (_jsx(Alert, { type: "warning", showIcon: true, "data-testid": "search-url-issues", message: t(SEARCH_I18N_KEYS.urlIssuesTitle), description: _jsx("ul", { style: { margin: 0, paddingInlineStart: 20 }, children: issues.map((issue) => (_jsx("li", { children: t(issue.messageKey, { param: issue.param }) }, `${issue.param}:${issue.code}`))) }) }));
29
+ return (_jsx(Alert, { type: "warning", showIcon: true, "data-testid": "search-url-issues", title: t(SEARCH_I18N_KEYS.urlIssuesTitle), description: _jsx("ul", { style: { margin: 0, paddingInlineStart: spacing[5] }, children: issues.map((issue) => (_jsx("li", { children: t(issue.messageKey, { param: readableParam(issue.param) }) }, `${issue.param}:${issue.code}`))) }) }));
12
30
  }
13
31
  //# sourceMappingURL=UrlIssueNotice.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UrlIssueNotice.js","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IACpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,CACL,KAAC,KAAK,IACJ,IAAI,EAAC,SAAS,EACd,QAAQ,uBACI,mBAAmB,EAC/B,OAAO,EAAE,CAAC,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAC3C,WAAW,EACT,aAAI,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,kBAAkB,EAAE,EAAE,EAAE,YAC7C,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,uBACG,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,IADrC,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAElC,CACN,CAAC,GACC,GAEP,CACH,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"UrlIssueNotice.js","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;GAQG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,KAAK,MAAM,MAAM,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IACpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,CACL,KAAC,KAAK,IACJ,IAAI,EAAC,SAAS,EACd,QAAQ,uBACI,mBAAmB,EAC/B,KAAK,EAAE,CAAC,CAAC,gBAAgB,CAAC,cAAc,CAAC,EACzC,WAAW,EACT,aAAI,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,YACrD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,uBACG,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IADpD,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAElC,CACN,CAAC,GACC,GAEP,CACH,CAAC;AACJ,CAAC"}
@@ -6,37 +6,54 @@
6
6
  * never pays for this bundle (enforced by size-limit and the bundle-purity
7
7
  * test).
8
8
  *
9
- * Three override levers, none of which requires forking anything:
9
+ * Five override levers, none of which requires forking anything:
10
10
  *
11
11
  * 1. **`renderCard`** — the card slot. A storefront passes
12
12
  * `<ListingCard>` from `@stapel/listings-react/default`; the generic card
13
13
  * here is the documented default, not the intended end state (spec §3.7).
14
14
  * `renderResults` is the level above it: the whole layout, for a container
15
15
  * whose arrangement is not "cards in a grid".
16
- * 2. **`categoryFeatures`** — the facet-label slot. The server sends
17
- * `{value: count}` and no labels; the schema that names them lives in
18
- * categories, and the container hands it in (spec §6.2 item 2).
19
- * 3. **retheming through the §68 token JSON** — every surface wraps itself
20
- * in `<SearchSkinTheme>`, so a host's regenerated `--stapel-*` custom
16
+ * 2. **`categoryFeatures`** — the facet-label slot, and the source of which
17
+ * slugs get a numeric range row. The server sends `{value: count}` and no
18
+ * labels; the schema that names them lives in categories, and the
19
+ * container hands it in (spec §6.2 item 2).
20
+ * 3. **`renderCategoryFilter`** the catalogue picker. `categories-react`
21
+ * owns walking the tree; this pair owns the `category` parameter.
22
+ * 4. **`renderGeoFilter`** — the location control. `geo-react` owns the map
23
+ * and the geocoder; this pair owns `lat`/`lon`/`radius_km`/`bbox`, and
24
+ * keeps the controls that WIDEN a location a link already carries.
25
+ * 5. **retheming through the §68 token JSON** — every surface wraps itself
26
+ * in the shared `SkinTheme`, so a host's regenerated `--stapel-*` custom
21
27
  * properties reach this skin with zero code.
28
+ *
29
+ * The pair's own `theme.tsx` and `ErrorAlert.tsx` are GONE as of 0.6.0: both
30
+ * were copies of a decision now stated once in `@stapel/tokens-antd/skin`
31
+ * (`SkinTheme`, `ErrorAlert`). A host that imported `SearchSkinTheme` imports
32
+ * `SkinTheme` from the substrate instead — same props, one implementation, and
33
+ * a runtime `data-theme` flip actually repaints it.
22
34
  */
23
35
  export { SearchPage } from "./SearchPage.js";
24
- export type { SearchPageProps } from "./SearchPage.js";
25
- export { SearchResultsPane } from "./SearchResultsPane.js";
36
+ export type { SearchPageProps, SearchFiltersLayout } from "./SearchPage.js";
37
+ export { SearchResultsPane, RESULTS_MAX_WIDTH } from "./SearchResultsPane.js";
26
38
  export type { SearchResultsPaneProps, SearchResultsRenderer, } from "./SearchResultsPane.js";
27
39
  export { FacetPanelPane } from "./FacetPanelPane.js";
28
- export type { FacetPanelPaneProps } from "./FacetPanelPane.js";
29
- export { RankingDisclosurePane } from "./RankingDisclosurePane.js";
40
+ export type { FacetPanelPaneProps, CategoryFilterSlotProps, GeoFilterSlotProps, } from "./FacetPanelPane.js";
41
+ export { RankingDisclosurePane, RANKING_MAX_WIDTH } from "./RankingDisclosurePane.js";
30
42
  export type { RankingDisclosurePaneProps } from "./RankingDisclosurePane.js";
43
+ export { SearchBox } from "./SearchBox.js";
44
+ export type { SearchBoxProps } from "./SearchBox.js";
45
+ export { SortSelect, SORT_SELECT_MIN_WIDTH } from "./SortSelect.js";
46
+ export type { SortSelectProps } from "./SortSelect.js";
47
+ export { PageSizeSelect, SEARCH_PAGE_SIZES } from "./PageSizeSelect.js";
48
+ export type { PageSizeSelectProps } from "./PageSizeSelect.js";
49
+ export { LanguageSelect } from "./LanguageSelect.js";
50
+ export type { LanguageSelectProps } from "./LanguageSelect.js";
31
51
  export { SearchResultCard, GENERIC_CARD_FIELDS } from "./SearchResultCard.js";
32
52
  export type { SearchCardProps, SearchCardRenderer } from "./SearchResultCard.js";
33
53
  export { DegradationNotice } from "./DegradationNotice.js";
34
54
  export type { DegradationNoticeProps, DegradationNoticeVariant, } from "./DegradationNotice.js";
35
55
  export { UrlIssueNotice } from "./UrlIssueNotice.js";
36
- export { SortSelect } from "./SortSelect.js";
37
- export type { SortSelectProps } from "./SortSelect.js";
38
- export { ErrorAlert } from "./ErrorAlert.js";
39
- export { SearchSkinTheme } from "./theme.js";
40
- export type { SearchSkinThemeProps } from "./theme.js";
56
+ export { RangeFilterRow } from "./RangeFilterRow.js";
57
+ export type { RangeFilterRowProps } from "./RangeFilterRow.js";
41
58
  export type { ThemeModeProp } from "./types.js";
42
59
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAG7E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;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AAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -6,31 +6,45 @@
6
6
  * never pays for this bundle (enforced by size-limit and the bundle-purity
7
7
  * test).
8
8
  *
9
- * Three override levers, none of which requires forking anything:
9
+ * Five override levers, none of which requires forking anything:
10
10
  *
11
11
  * 1. **`renderCard`** — the card slot. A storefront passes
12
12
  * `<ListingCard>` from `@stapel/listings-react/default`; the generic card
13
13
  * here is the documented default, not the intended end state (spec §3.7).
14
14
  * `renderResults` is the level above it: the whole layout, for a container
15
15
  * whose arrangement is not "cards in a grid".
16
- * 2. **`categoryFeatures`** — the facet-label slot. The server sends
17
- * `{value: count}` and no labels; the schema that names them lives in
18
- * categories, and the container hands it in (spec §6.2 item 2).
19
- * 3. **retheming through the §68 token JSON** — every surface wraps itself
20
- * in `<SearchSkinTheme>`, so a host's regenerated `--stapel-*` custom
16
+ * 2. **`categoryFeatures`** — the facet-label slot, and the source of which
17
+ * slugs get a numeric range row. The server sends `{value: count}` and no
18
+ * labels; the schema that names them lives in categories, and the
19
+ * container hands it in (spec §6.2 item 2).
20
+ * 3. **`renderCategoryFilter`** the catalogue picker. `categories-react`
21
+ * owns walking the tree; this pair owns the `category` parameter.
22
+ * 4. **`renderGeoFilter`** — the location control. `geo-react` owns the map
23
+ * and the geocoder; this pair owns `lat`/`lon`/`radius_km`/`bbox`, and
24
+ * keeps the controls that WIDEN a location a link already carries.
25
+ * 5. **retheming through the §68 token JSON** — every surface wraps itself
26
+ * in the shared `SkinTheme`, so a host's regenerated `--stapel-*` custom
21
27
  * properties reach this skin with zero code.
28
+ *
29
+ * The pair's own `theme.tsx` and `ErrorAlert.tsx` are GONE as of 0.6.0: both
30
+ * were copies of a decision now stated once in `@stapel/tokens-antd/skin`
31
+ * (`SkinTheme`, `ErrorAlert`). A host that imported `SearchSkinTheme` imports
32
+ * `SkinTheme` from the substrate instead — same props, one implementation, and
33
+ * a runtime `data-theme` flip actually repaints it.
22
34
  */
23
35
  // ── surfaces ────────────────────────────────────────────────────────────────
24
36
  export { SearchPage } from "./SearchPage.js";
25
- export { SearchResultsPane } from "./SearchResultsPane.js";
37
+ export { SearchResultsPane, RESULTS_MAX_WIDTH } from "./SearchResultsPane.js";
26
38
  export { FacetPanelPane } from "./FacetPanelPane.js";
27
- export { RankingDisclosurePane } from "./RankingDisclosurePane.js";
39
+ export { RankingDisclosurePane, RANKING_MAX_WIDTH } from "./RankingDisclosurePane.js";
40
+ // ── controls, exported so a host can compose its own layout ─────────────────
41
+ export { SearchBox } from "./SearchBox.js";
42
+ export { SortSelect, SORT_SELECT_MIN_WIDTH } from "./SortSelect.js";
43
+ export { PageSizeSelect, SEARCH_PAGE_SIZES } from "./PageSizeSelect.js";
44
+ export { LanguageSelect } from "./LanguageSelect.js";
28
45
  // ── parts, exported so a host can compose or wrap one ───────────────────────
29
46
  export { SearchResultCard, GENERIC_CARD_FIELDS } from "./SearchResultCard.js";
30
47
  export { DegradationNotice } from "./DegradationNotice.js";
31
48
  export { UrlIssueNotice } from "./UrlIssueNotice.js";
32
- export { SortSelect } from "./SortSelect.js";
33
- export { ErrorAlert } from "./ErrorAlert.js";
34
- // ── theming ─────────────────────────────────────────────────────────────────
35
- export { SearchSkinTheme } from "./theme.js";
49
+ export { RangeFilterRow } from "./RangeFilterRow.js";
36
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+EAA+E;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,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AAK3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** The i18n key for a shipped sort, or `undefined` for a deployment's own. */
2
+ export declare function sortLabelKey(sort: string): string | undefined;
3
+ /** The sort's name for a reader, falling back to the slug. */
4
+ export declare function sortLabel(t: (key: string) => string, sort: string): string;
5
+ //# sourceMappingURL=sortLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortLabels.d.ts","sourceRoot":"","sources":["../../src/default/sortLabels.ts"],"names":[],"mappings":"AAwBA,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG1E"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * A sort SLUG as the skin names it, in one place.
3
+ *
4
+ * `relevance`, `price_asc`, `distance` are wire values: the URL carries them,
5
+ * the envelope reports them, and the ranking disclosure lists them per scorer.
6
+ * The sort SELECT translated them and the disclosure did not, so the same page
7
+ * offered "Most relevant" in the control and stamped "Applies to: relevance"
8
+ * under every parameter — the registry's word, in a statutory text, next to
9
+ * the human word for the same thing.
10
+ *
11
+ * A slug the pair does not ship is returned as it is. Deployments register
12
+ * their own scorers and sorts, and an unknown one is a real value that belongs
13
+ * on screen; only an invented label would be worse.
14
+ */
15
+ import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
16
+ const SORT_LABEL_KEY = {
17
+ relevance: SEARCH_I18N_KEYS.sortRelevance,
18
+ newest: SEARCH_I18N_KEYS.sortNewest,
19
+ price_asc: SEARCH_I18N_KEYS.sortPriceAsc,
20
+ price_desc: SEARCH_I18N_KEYS.sortPriceDesc,
21
+ distance: SEARCH_I18N_KEYS.sortDistance,
22
+ };
23
+ /** The i18n key for a shipped sort, or `undefined` for a deployment's own. */
24
+ export function sortLabelKey(sort) {
25
+ return SORT_LABEL_KEY[sort];
26
+ }
27
+ /** The sort's name for a reader, falling back to the slug. */
28
+ export function sortLabel(t, sort) {
29
+ const key = SORT_LABEL_KEY[sort];
30
+ return key === undefined ? sort : t(key);
31
+ }
32
+ //# sourceMappingURL=sortLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortLabels.js","sourceRoot":"","sources":["../../src/default/sortLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,cAAc,GAAqC;IACvD,SAAS,EAAE,gBAAgB,CAAC,aAAa;IACzC,MAAM,EAAE,gBAAgB,CAAC,UAAU;IACnC,SAAS,EAAE,gBAAgB,CAAC,YAAY;IACxC,UAAU,EAAE,gBAAgB,CAAC,aAAa;IAC1C,QAAQ,EAAE,gBAAgB,CAAC,YAAY;CACxC,CAAC;AAEF,8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CAAC,CAA0B,EAAE,IAAY;IAChE,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC"}
@@ -58,4 +58,21 @@ export declare function FacetPanel(props: {
58
58
  enabled?: boolean;
59
59
  children: (bag: FacetPanelBag) => ReactNode;
60
60
  }): ReactNode;
61
+ /**
62
+ * The same bag, as a hook — for a caller that has to know what the panel WILL
63
+ * render before it renders it.
64
+ *
65
+ * The one real caller is `<SearchPage>`: a facet column is a quarter of a
66
+ * catalogue page, and on a deployment whose plan has no facets at all it was
67
+ * a quarter of every results page spent on an empty-state illustration
68
+ * repeating "no filters for this search". Whether to lay out that column is a
69
+ * LAYOUT decision, and layout is decided by the component that owns the grid
70
+ * — which therefore has to be able to ask. A render prop cannot answer a
71
+ * question asked one level up.
72
+ */
73
+ export declare function useFacetPanel(props?: {
74
+ categoryFeatures?: readonly FeatureDef[];
75
+ locale?: string;
76
+ enabled?: boolean;
77
+ }): FacetPanelBag;
61
78
  //# sourceMappingURL=FacetPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FacetPanel.d.ts","sourceRoot":"","sources":["../../src/headless/FacetPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,oDAAoD;AACpD,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,UAAU,EAAE,CAAC,CAAC;IACjD;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,+BAA+B;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IA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,UAAU,EAAE,MAAM,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;IACxD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,IAAI,IAAI,CAAC;CAClB;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,SAAS,CAAC;CAC7C,GAAG,SAAS,CAUZ;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,GAAE;IACnC,gBAAgB,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,GAAG,aAAa,CAuCrB"}
@@ -24,6 +24,27 @@ const EMPTY_META = {
24
24
  * blanks.
25
25
  */
26
26
  export function FacetPanel(props) {
27
+ return props.children(useFacetPanel({
28
+ ...(props.categoryFeatures !== undefined
29
+ ? { categoryFeatures: props.categoryFeatures }
30
+ : {}),
31
+ ...(props.locale !== undefined ? { locale: props.locale } : {}),
32
+ ...(props.enabled !== undefined ? { enabled: props.enabled } : {}),
33
+ }));
34
+ }
35
+ /**
36
+ * The same bag, as a hook — for a caller that has to know what the panel WILL
37
+ * render before it renders it.
38
+ *
39
+ * The one real caller is `<SearchPage>`: a facet column is a quarter of a
40
+ * catalogue page, and on a deployment whose plan has no facets at all it was
41
+ * a quarter of every results page spent on an empty-state illustration
42
+ * repeating "no filters for this search". Whether to lay out that column is a
43
+ * LAYOUT decision, and layout is decided by the component that owns the grid
44
+ * — which therefore has to be able to ask. A render prop cannot answer a
45
+ * question asked one level up.
46
+ */
47
+ export function useFacetPanel(props = {}) {
27
48
  const { state: searchState, setFilter, setRange, clearAll, toggleFilter, activeFilters } = useSearchState();
28
49
  const t = useT();
29
50
  const query = useSearchQuery(searchState, props.enabled !== undefined ? { enabled: props.enabled } : undefined);
@@ -39,7 +60,7 @@ export function FacetPanel(props) {
39
60
  t,
40
61
  ...(props.locale !== undefined ? { locale: props.locale } : {}),
41
62
  }));
42
- return props.children({
63
+ return {
43
64
  state: groups,
44
65
  approximate: meta.approximate,
45
66
  skipped: meta.skipped,
@@ -52,6 +73,6 @@ export function FacetPanel(props) {
52
73
  setFilter(slug, []);
53
74
  },
54
75
  clearAll,
55
- });
76
+ };
56
77
  }
57
78
  //# sourceMappingURL=FacetPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FacetPanel.js","sourceRoot":"","sources":["../../src/headless/FacetPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAoC1D,MAAM,UAAU,GAAc;IAC5B,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,UAAU,CAAC,KAO1B;IACC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EA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;QACb,MAAM,EAAE,YAAY;QACpB,QAAQ;QACR,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;YACd,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACtB,CAAC;QACD,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { SearchCountKind } from "../state/degradations.js";
2
+ export interface AppliedCount {
3
+ /** `null` when the engine cannot say — never rendered as `0`. */
4
+ readonly count: number | null;
5
+ readonly kind: SearchCountKind;
6
+ }
7
+ export declare function useAppliedCount(): AppliedCount;
8
+ //# sourceMappingURL=useAppliedCount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAppliedCount.d.ts","sourceRoot":"","sources":["../../src/headless/useAppliedCount.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAChC;AAED,wBAAgB,eAAe,IAAI,YAAY,CAc9C"}