@astryxdesign/cli 0.7.9-canary.8258e93 → 0.7.9-canary.8fc907f

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 (61) hide show
  1. package/api/discover/_adapter.d.mts +1 -1
  2. package/api/docs/_adapter.d.mts +8 -2
  3. package/api/docs/_adapter.mjs +10 -4
  4. package/api/docs/detail/section/section.d.mts +5 -2
  5. package/api/docs/detail/section/section.mjs +6 -2
  6. package/api/docs/docs.mjs +7 -1
  7. package/api/search/_main-searcher.mjs +1 -1
  8. package/api/search/_result.d.mts +5 -5
  9. package/api/search/search.d.mts +1 -1
  10. package/assets/docs/tree/calendar-systems.doc.mjs +146 -0
  11. package/assets/docs/tree/calendars.doc.mjs +46 -0
  12. package/assets/docs/tree/i18n-calendars.doc.mjs +51 -0
  13. package/assets/docs/tree/internationalization.doc.mjs +3 -3
  14. package/assets/templates/blocks/components/PowerSearch/PowerSearchContentSearch.tsx +8 -7
  15. package/assets/templates/blocks/components/PowerSearch/PowerSearchFullFeatured.tsx +8 -7
  16. package/assets/templates/blocks/components/PowerSearch/PowerSearchPresetFilters.tsx +8 -7
  17. package/assets/templates/blocks/components/PowerSearch/PowerSearchSearchWithTable.tsx +12 -10
  18. package/assets/templates/blocks/components/PowerSearch/PowerSearchShowcase.tsx +8 -7
  19. package/assets/templates/blocks/components/Tokenizer/TokenizerClear.doc.mjs +2 -1
  20. package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +2 -2
  21. package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +0 -1
  22. package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +0 -1
  23. package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.doc.mjs +2 -1
  24. package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +0 -2
  25. package/assets/templates/pages/table-inbox/page.tsx +11 -8
  26. package/assets/templates/pages/work-item-detail/page.tsx +6 -2
  27. package/authoring/debug/parse.d.mts +2 -2
  28. package/clients/cli/index.mjs +11 -6
  29. package/foundation/agent-docs/agent-docs-target.d.mts +49 -0
  30. package/foundation/agent-docs/agent-docs-target.mjs +201 -0
  31. package/foundation/agent-docs/agent-docs.d.mts +1 -38
  32. package/foundation/agent-docs/agent-docs.mjs +16 -181
  33. package/foundation/config/config-path.d.mts +13 -0
  34. package/foundation/config/config-path.mjs +42 -0
  35. package/foundation/config/project.d.mts +1 -10
  36. package/foundation/config/project.mjs +4 -26
  37. package/foundation/discovery/component-discovery.mjs +39 -4
  38. package/foundation/discovery/component-loader.d.mts +1 -1
  39. package/foundation/discovery/icon-set-paths.d.mts +18 -0
  40. package/foundation/discovery/icon-set-paths.mjs +23 -0
  41. package/foundation/discovery/icon-set-writer.d.mts +2 -7
  42. package/foundation/discovery/icon-set-writer.mjs +3 -12
  43. package/foundation/fs/module-loader.d.mts +2 -8
  44. package/foundation/fs/module-loader.mjs +3 -12
  45. package/foundation/fs/present-files.d.mts +11 -0
  46. package/foundation/fs/present-files.mjs +25 -0
  47. package/foundation/integrations/autolink.d.mts +2 -21
  48. package/foundation/integrations/autolink.mjs +6 -42
  49. package/foundation/integrations/contribution-fixes.mjs +26 -3
  50. package/foundation/integrations/contribution-inventory.mjs +1 -1
  51. package/foundation/integrations/installed-package.d.mts +36 -0
  52. package/foundation/integrations/installed-package.mjs +57 -0
  53. package/foundation/integrations/integrations.d.mts +3 -75
  54. package/foundation/integrations/integrations.mjs +3 -16
  55. package/foundation/integrations/manifest-paths.d.mts +13 -0
  56. package/foundation/integrations/manifest-paths.mjs +31 -0
  57. package/foundation/release/cache.d.mts +11 -4
  58. package/foundation/release/cache.mjs +15 -7
  59. package/foundation/runtime/locked-versions.mjs +1 -1
  60. package/foundation/runtime/package-set.mjs +1 -1
  61. package/package.json +9 -9
@@ -216,7 +216,7 @@ export const OFFICIAL_LIST_FILE: string;
216
216
  */
217
217
  export const EXPERIMENTAL_KINDS: readonly ["icon-set"];
218
218
  /** The item kinds every project reads: the catalog kinds, less experimental ones. */
219
- export const STABLE_KINDS: ("template" | "component" | "theme" | "codemod" | "agent-doc" | "doc" | "icon-set")[];
219
+ export const STABLE_KINDS: ("template" | "component" | "doc" | "theme" | "codemod" | "agent-doc" | "icon-set")[];
220
220
  /** The list and detail entry fields for each item kind, in display order. */
221
221
  export const KIND_FIELDS: readonly [readonly ["component", "components"], readonly ["template", "templates"], readonly ["doc", "docs"], readonly ["theme", "themes"], readonly ["codemod", "codemods"], readonly ["agent-doc", "agentDocs"], readonly ["icon-set", "iconSets"]];
222
222
  export type ScannedPackage = import("./_package-scanner.mjs").ScannedPackage;
@@ -274,6 +274,11 @@ export function topicLinks(catalog: DocsCatalog, entry: import("../../foundation
274
274
  * decides.
275
275
  * @param {unknown} topic
276
276
  * @param {{cwd?: string}} [options]
277
+ * @param {DocsCatalog} [loaded] internal: a catalog the read already loaded,
278
+ * so the read and every part of it share one snapshot of the project's docs
279
+ * (and its memoized lowering) instead of loading the project again for each
280
+ * part. It is a separate argument, never an option, so no caller of the
281
+ * public `docs()` can set it
277
282
  * @returns {Promise<
278
283
  * | {kind: 'topic', catalog: DocsCatalog, entry: import('../../foundation/discovery/docs-discovery.mjs').DocsTopicEntry}
279
284
  * | {kind: 'node', catalog: DocsCatalog, tree: import('../../foundation/doc-compiler/tree.mjs').DocsTree, node: import('../../foundation/doc-compiler/tree.mjs').TreeNode}
@@ -282,7 +287,7 @@ export function topicLinks(catalog: DocsCatalog, entry: import("../../foundation
282
287
  */
283
288
  export function resolveDocsArgument(topic: unknown, { cwd }?: {
284
289
  cwd?: string;
285
- }): Promise<{
290
+ }, loaded?: DocsCatalog): Promise<{
286
291
  kind: "topic";
287
292
  catalog: DocsCatalog;
288
293
  entry: import("../../foundation/discovery/docs-discovery.mjs").DocsTopicEntry;
@@ -358,13 +363,14 @@ export function notLoaded(catalog: DocsCatalog): string;
358
363
  * and lower it for the topic readers.
359
364
  * @param {unknown} topic
360
365
  * @param {{lang?: string | null, zh?: boolean, dense?: boolean, cwd?: string}} [options]
366
+ * @param {DocsCatalog} [loaded] internal, as {@link resolveDocsArgument}
361
367
  */
362
368
  export function resolveTopicDocs(topic: unknown, options?: {
363
369
  lang?: string | null;
364
370
  zh?: boolean;
365
371
  dense?: boolean;
366
372
  cwd?: string;
367
- }): Promise<{
373
+ }, loaded?: DocsCatalog): Promise<{
368
374
  catalog: DocsCatalog;
369
375
  node: import("../../foundation/doc-compiler/compile.mjs").CompiledReferenceNode;
370
376
  lang: string | null;
@@ -1721,14 +1721,19 @@ export async function topicLinks(catalog, entry) {
1721
1721
  * decides.
1722
1722
  * @param {unknown} topic
1723
1723
  * @param {{cwd?: string}} [options]
1724
+ * @param {DocsCatalog} [loaded] internal: a catalog the read already loaded,
1725
+ * so the read and every part of it share one snapshot of the project's docs
1726
+ * (and its memoized lowering) instead of loading the project again for each
1727
+ * part. It is a separate argument, never an option, so no caller of the
1728
+ * public `docs()` can set it
1724
1729
  * @returns {Promise<
1725
1730
  * | {kind: 'topic', catalog: DocsCatalog, entry: import('../../foundation/discovery/docs-discovery.mjs').DocsTopicEntry}
1726
1731
  * | {kind: 'node', catalog: DocsCatalog, tree: import('../../foundation/doc-compiler/tree.mjs').DocsTree, node: import('../../foundation/doc-compiler/tree.mjs').TreeNode}
1727
1732
  * | {kind: 'unknown', catalog: DocsCatalog}
1728
1733
  * >}
1729
1734
  */
1730
- export async function resolveDocsArgument(topic, {cwd} = {}) {
1731
- const catalog = await loadDocsCatalog(cwd);
1735
+ export async function resolveDocsArgument(topic, {cwd} = {}, loaded) {
1736
+ const catalog = loaded ?? (await loadDocsCatalog(cwd));
1732
1737
  if (typeof topic !== 'string' || topic === '')
1733
1738
  return {kind: 'unknown', catalog};
1734
1739
  const tree = await projectTree(catalog);
@@ -1942,13 +1947,14 @@ export function notLoaded(catalog) {
1942
1947
  * and lower it for the topic readers.
1943
1948
  * @param {unknown} topic
1944
1949
  * @param {{lang?: string | null, zh?: boolean, dense?: boolean, cwd?: string}} [options]
1950
+ * @param {DocsCatalog} [loaded] internal, as {@link resolveDocsArgument}
1945
1951
  */
1946
- export async function resolveTopicDocs(topic, options = {}) {
1952
+ export async function resolveTopicDocs(topic, options = {}, loaded) {
1947
1953
  const {lang = null, zh = false, dense = false, cwd} = options;
1948
1954
  const effectiveLang = lang || (dense ? 'dense' : zh ? 'zh' : null);
1949
1955
  // A public API caller could pass a non-string topic; it lands on the same
1950
1956
  // stable code as an unknown name rather than a raw TypeError.
1951
- const found = await resolveDocsArgument(topic, {cwd});
1957
+ const found = await resolveDocsArgument(topic, {cwd}, loaded);
1952
1958
  if (found.kind !== 'topic') {
1953
1959
  throw found.kind === 'node'
1954
1960
  ? new AstryxError(
@@ -30,14 +30,17 @@ export function section(topic: string, sectionName: string, options?: {
30
30
  * with the section its own section read returns for the query; when that
31
31
  * section's key (its `id`, else the key its title derives) is the query in
32
32
  * some guides, those guides answer first. No guide, or several, fail with ERR_UNKNOWN_SECTION, naming
33
- * the guides to read instead.
33
+ * the guides to read instead. Every guide is read from `catalog`, the one the
34
+ * namespace read loaded, so the read loads the project once, not once per
35
+ * guide below the namespace.
36
+ * @param {import('../../../../foundation/discovery/docs-discovery.mjs').DocsCatalog} catalog
34
37
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').DocsTree} tree
35
38
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').TreeNode} namespace
36
39
  * @param {string} sectionName
37
40
  * @param {object} [options] as {@link section}
38
41
  * @returns {Promise<import('../../docs.type.mjs').DocsDetailSectionResponse>}
39
42
  */
40
- export function namespaceSection(tree: import("../../../../foundation/doc-compiler/tree.mjs").DocsTree, namespace: import("../../../../foundation/doc-compiler/tree.mjs").TreeNode, sectionName: string, options?: object): Promise<import("../../docs.type.mjs").DocsDetailSectionResponse>;
43
+ export function namespaceSection(catalog: import("../../../../foundation/discovery/docs-discovery.mjs").DocsCatalog, tree: import("../../../../foundation/doc-compiler/tree.mjs").DocsTree, namespace: import("../../../../foundation/doc-compiler/tree.mjs").TreeNode, sectionName: string, options?: object): Promise<import("../../docs.type.mjs").DocsDetailSectionResponse>;
41
44
  /**
42
45
  * The guide a namespace section read answers from, or null to ask. When the
43
46
  * query matches sections in several guides, the read asks the reader which
@@ -130,7 +130,10 @@ async function sectionResponse({catalog, node, lang, entry}, sections, match) {
130
130
  * with the section its own section read returns for the query; when that
131
131
  * section's key (its `id`, else the key its title derives) is the query in
132
132
  * some guides, those guides answer first. No guide, or several, fail with ERR_UNKNOWN_SECTION, naming
133
- * the guides to read instead.
133
+ * the guides to read instead. Every guide is read from `catalog`, the one the
134
+ * namespace read loaded, so the read loads the project once, not once per
135
+ * guide below the namespace.
136
+ * @param {import('../../../../foundation/discovery/docs-discovery.mjs').DocsCatalog} catalog
134
137
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').DocsTree} tree
135
138
  * @param {import('../../../../foundation/doc-compiler/tree.mjs').TreeNode} namespace
136
139
  * @param {string} sectionName
@@ -138,6 +141,7 @@ async function sectionResponse({catalog, node, lang, entry}, sections, match) {
138
141
  * @returns {Promise<import('../../docs.type.mjs').DocsDetailSectionResponse>}
139
142
  */
140
143
  export async function namespaceSection(
144
+ catalog,
141
145
  tree,
142
146
  namespace,
143
147
  sectionName,
@@ -148,7 +152,7 @@ export async function namespaceSection(
148
152
  /** @type {Omit<GuideMatch, 'match'>[]} */
149
153
  const reads = [];
150
154
  for (const guide of guides) {
151
- const resolved = await resolveTopicDocs(guide.route, options);
155
+ const resolved = await resolveTopicDocs(guide.route, options, catalog);
152
156
  reads.push({guide, resolved, sections: readerSections(resolved.node)});
153
157
  }
154
158
 
package/api/docs/docs.mjs CHANGED
@@ -155,7 +155,13 @@ async function docsRead(topic, section, options = {}) {
155
155
  // A namespace answers a section read from the one guide below it that
156
156
  // has the section (spec:AST-046 FR6). A typed doc is one read.
157
157
  if (found.node.kind === 'namespace') {
158
- return namespaceSection(found.tree, found.node, section, options);
158
+ return namespaceSection(
159
+ found.catalog,
160
+ found.tree,
161
+ found.node,
162
+ section,
163
+ options,
164
+ );
159
165
  }
160
166
  throw new AstryxError(
161
167
  `"${found.node.route}" has no sections. Read it whole: ${formatCliCommand(`docs ${found.node.route}`)}.`,
@@ -8,7 +8,7 @@
8
8
  * domain the query wants. Its weights are static numbers in
9
9
  * _main-searcher.weights.json.
10
10
  * @input {query, options} and the gathered catalog with its static data
11
- * @output the search response, the lexical response's shape and size
11
+ * @output the search response, the lexical response's shape and count
12
12
  * @position api/search; a child of the root dispatcher in tree.mjs
13
13
  */
14
14
 
@@ -17,7 +17,7 @@
17
17
  * (spec AST-081 FR3).
18
18
  */
19
19
  export function toResult(c: Candidate, score: number, reason: string, matchedTerms: number, queryTerms: number, outside?: boolean): {
20
- domain: "template" | "component" | "hook" | "theme" | "doc";
20
+ domain: "template" | "component" | "doc" | "theme" | "hook";
21
21
  name: string;
22
22
  package: string | undefined;
23
23
  score: number;
@@ -27,7 +27,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
27
27
  deprecated?: import("../../authoring/index.js").ComponentDeprecation | undefined;
28
28
  import: string | undefined;
29
29
  command: string;
30
- domain: "template" | "component" | "hook" | "theme" | "doc";
30
+ domain: "template" | "component" | "doc" | "theme" | "hook";
31
31
  name: string;
32
32
  package: string | undefined;
33
33
  score: number;
@@ -39,7 +39,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
39
39
  command: string;
40
40
  section?: string | undefined;
41
41
  name: string;
42
- domain: "template" | "component" | "hook" | "theme" | "doc";
42
+ domain: "template" | "component" | "doc" | "theme" | "hook";
43
43
  package: string | undefined;
44
44
  score: number;
45
45
  reason: string;
@@ -48,7 +48,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
48
48
  displayName: string | undefined;
49
49
  kind: "page" | "block" | undefined;
50
50
  command: string;
51
- domain: "template" | "component" | "hook" | "theme" | "doc";
51
+ domain: "template" | "component" | "doc" | "theme" | "hook";
52
52
  name: string;
53
53
  package: string | undefined;
54
54
  score: number;
@@ -57,7 +57,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
57
57
  } | {
58
58
  displayName: string | undefined;
59
59
  command: string;
60
- domain: "template" | "component" | "hook" | "theme" | "doc";
60
+ domain: "template" | "component" | "doc" | "theme" | "hook";
61
61
  name: string;
62
62
  package: string | undefined;
63
63
  score: number;
@@ -13,7 +13,7 @@
13
13
  */
14
14
  export function search(query: string, options?: {
15
15
  cwd?: string | undefined;
16
- type?: "template" | "component" | "hook" | "theme" | "doc" | undefined;
16
+ type?: "template" | "component" | "doc" | "theme" | "hook" | undefined;
17
17
  limit?: number | undefined;
18
18
  }): Promise<import("./search.type.mjs").SearchResponse>;
19
19
  /**
@@ -0,0 +1,146 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs calendars/calendar-systems`: choosing a calendar, the
5
+ * supported calendars, loading Temporal on the server and in the browser, the
6
+ * lunisolar calendars, and week numbers.
7
+ */
8
+
9
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
+
11
+ export const docs = {
12
+ type: 'generic',
13
+ name: 'calendar-systems',
14
+ title: 'Calendar systems',
15
+ placement: {
16
+ parent: 'namespace:calendars',
17
+ slot: 'guides',
18
+ order: 10,
19
+ },
20
+ category: 'guide',
21
+ description:
22
+ 'Choosing a calendar, which calendars need Temporal, server rendering, the lunisolar calendars, and week numbers.',
23
+
24
+ sections: [
25
+ {
26
+ title: 'Choose a calendar',
27
+ content: [
28
+ {
29
+ type: 'prose',
30
+ text: '`Calendar` shows the Gregorian calendar unless you choose another one. Pass `calendar` to `<InternationalizationProvider>` to set it for a subtree. A locale on its own never changes the calendar: `fa-IR` shows Gregorian dates in Persian until you pass `calendar="persian"`. A locale with a `-u-ca-` keyword, such as `th-TH-u-ca-buddhist`, keeps Gregorian dates too; set `calendar` to choose one.',
31
+ },
32
+ {
33
+ type: 'code',
34
+ lang: 'tsx',
35
+ label: 'Persian dates in a Persian interface',
36
+ code: `import {InternationalizationProvider} from '@astryxdesign/core/i18n';
37
+ import {Calendar} from '@astryxdesign/core/Calendar';
38
+
39
+ <InternationalizationProvider locale="fa-IR" calendar="persian">
40
+ {/* shows Aban 1405; value and onChange stay '2026-10-30' */}
41
+ <Calendar value={date} onChange={setDate} />
42
+ </InternationalizationProvider>;`,
43
+ },
44
+ {
45
+ type: 'prose',
46
+ text: 'Calendar and language are independent: `locale="en" calendar="hebrew"` shows Hebrew dates in English. `Calendar` also takes its own `calendar`, which wins over the provider. Use it when one screen shows two calendars side by side.',
47
+ },
48
+ {
49
+ type: 'prose',
50
+ text: 'Values never change with the calendar. `value`, `defaultValue`, `onChange`, `min`, and `max` stay Gregorian ISO dates (`YYYY-MM-DD`) in every calendar, so your data, server code, and existing handlers keep working.',
51
+ },
52
+ ],
53
+ },
54
+ {
55
+ title: 'Supported calendars',
56
+ content: [
57
+ {
58
+ type: 'table',
59
+ headers: ['Calendar', 'Identifiers', 'Needs Temporal'],
60
+ rows: [
61
+ ['Gregorian', '`gregory`, `iso8601`', 'No'],
62
+ ['Buddhist (Thai)', '`buddhist`', 'No'],
63
+ ['Minguo', '`roc`', 'No'],
64
+ ['Japanese (eras)', '`japanese`', 'No'],
65
+ ['Persian (Solar Hijri)', '`persian`', 'Yes'],
66
+ ['Indian national (Saka)', '`indian`', 'Yes'],
67
+ ['Hebrew', '`hebrew`', 'Yes'],
68
+ [
69
+ 'Islamic (Hijri)',
70
+ '`islamic-umalqura`, `islamic-civil`, `islamic-tbla`',
71
+ 'Yes',
72
+ ],
73
+ ['Lunisolar', '`chinese`, `dangi`', 'Yes'],
74
+ ['Coptic', '`coptic`', 'Yes'],
75
+ ['Ethiopian', '`ethiopic`, `ethioaa`', 'Yes'],
76
+ ],
77
+ },
78
+ {
79
+ type: 'prose',
80
+ text: 'Any other identifier, such as `islamic`, shows Gregorian dates and warns once in development.',
81
+ },
82
+ ],
83
+ },
84
+ {
85
+ title: 'Load Temporal where the runtime lacks it',
86
+ content: [
87
+ {
88
+ type: 'prose',
89
+ text: "Calendars whose months are not Gregorian use the runtime's `Temporal` for their month lengths, leap months, and years. Chrome and Edge 144 and later, Firefox 139 and later, and Node.js 26 and later ship it. Safari and older runtimes do not. Astryx bundles no polyfill, so Gregorian applications pay nothing.",
90
+ },
91
+ {
92
+ type: 'prose',
93
+ text: 'Where `Temporal` is missing, load the full build of `temporal-polyfill` before your app renders. The default build has no non-ISO calendars. Load it only where `Temporal` is missing: a native implementation is more accurate for the lunisolar calendars.',
94
+ },
95
+ {
96
+ type: 'code',
97
+ lang: 'ts',
98
+ label: 'Load the polyfill only where Temporal is missing',
99
+ code: `// temporal-setup.ts: import before your app renders, on the server and in the browser
100
+ if (!('Temporal' in globalThis)) {
101
+ await import('temporal-polyfill/full/global');
102
+ }`,
103
+ },
104
+ {
105
+ type: 'prose',
106
+ text: 'If you render on the server, load it there too. `Calendar` resolves its calendar during render, so a server without `Temporal` renders Gregorian dates, and a browser with it renders Persian ones: hydration then fails. When both have `Temporal`, or both lack it, they render the same markup.',
107
+ },
108
+ {
109
+ type: 'prose',
110
+ text: 'Without a `Temporal` that supports it, a calendar that needs one shows Gregorian dates and warns once in development, on the server and in the browser. The Gregorian-aligned calendars (`buddhist`, `roc`, `japanese`) work everywhere without it.',
111
+ },
112
+ ],
113
+ },
114
+ {
115
+ title: 'Lunisolar calendars',
116
+ content: [
117
+ {
118
+ type: 'prose',
119
+ text: "In the lunisolar calendars, months start on new moons computed from astronomy, and runtimes do not all agree on a few of them. Astryx follows the runtime's `Temporal` and does not correct it.",
120
+ },
121
+ {
122
+ type: 'list',
123
+ style: 'unordered',
124
+ items: [
125
+ 'Native `Temporal` in Chrome, Edge, Firefox, and Node.js 26 agrees with official observatory data from 1900 through 2100.',
126
+ "A polyfill reads the platform's `Intl` data instead. Under a polyfill, Node.js 24 starts nine `chinese` and four `dangi` months in that range one day apart from the native result: the first month of the 2027 `chinese` year starts on February 6 with native `Temporal` and on February 7 under the polyfill. Safari uses the same kind of `Intl` data, so expect the same differences there.",
127
+ 'Within one browser, the day numbers a person sees, the dates a screen reader announces, and the value they pick agree. Only two different runtimes can disagree.',
128
+ ],
129
+ },
130
+ {
131
+ type: 'prose',
132
+ text: 'If you render on the server, a server and a browser that use different implementations can disagree on one of these month starts. The browser then renders that month differently from the server markup, and React renders that part again on the client during hydration. The `temporal-polyfill/full/global` import keeps a native `Temporal` where one exists, so on its own it leaves Chrome, Edge, and Firefox on native `Temporal` and a Node.js 24 server on the polyfill. When identical server and browser markup for these calendars matters more than matching official data, call `installImplementation()` from `temporal-polyfill/full/shim` on the server and in the browser before rendering: it installs the polyfill even over a native `Temporal`. A server runtime with native `Temporal`, such as Node.js 26, also matches native browsers. Otherwise, do not replace a native `Temporal`: that makes native environments less accurate.',
133
+ },
134
+ ],
135
+ },
136
+ {
137
+ title: 'Week numbers',
138
+ content: [
139
+ {
140
+ type: 'prose',
141
+ text: "`Calendar`'s `hasWeekNumbers` shows ISO 8601 week numbers in every calendar. Temporal defines week numbering only for the ISO calendar.",
142
+ },
143
+ ],
144
+ },
145
+ ],
146
+ };
@@ -0,0 +1,46 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs calendars`: calendar systems in detail. Which calendars
5
+ * date components show, how to load Temporal, server rendering, and the
6
+ * lunisolar calendars. The `internationalization/i18n-calendars` guide has the
7
+ * short version.
8
+ */
9
+
10
+ /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
11
+ export const docs = {
12
+ type: 'namespace',
13
+ name: 'calendars',
14
+ // The docsite lists guide pages by title, so this one sorts directly below
15
+ // Internationalization, the page that links here.
16
+ title: 'Internationalization: calendars',
17
+ summary:
18
+ 'Show dates in the Persian, Hebrew, Islamic, Buddhist, Japanese, lunisolar, and other calendars while values stay Gregorian ISO dates.',
19
+ keywords: [
20
+ 'calendar',
21
+ 'calendar system',
22
+ 'Persian',
23
+ 'Jalali',
24
+ 'Hebrew',
25
+ 'Hijri',
26
+ 'Islamic',
27
+ 'Buddhist',
28
+ 'Japanese era',
29
+ 'lunisolar',
30
+ 'chinese',
31
+ 'dangi',
32
+ 'Ethiopian',
33
+ 'Temporal',
34
+ 'polyfill',
35
+ 'u-ca',
36
+ ],
37
+ slots: {
38
+ guides: {title: 'Guides', accepts: {kinds: ['generic']}},
39
+ },
40
+ blocks: [
41
+ {
42
+ type: 'prose',
43
+ text: '`Calendar` shows the Gregorian calendar unless the application chooses another one; DateInput, DateRangeInput, and DateTimeInput stay Gregorian. Values never change with the calendar: they stay Gregorian ISO dates. {@link generic:i18n-calendars} has the short version.',
44
+ },
45
+ ],
46
+ };
@@ -0,0 +1,51 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs internationalization/i18n-calendars`: the short version of
5
+ * showing dates in another calendar. The `calendars` namespace holds the
6
+ * detail.
7
+ */
8
+
9
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
+
11
+ export const docs = {
12
+ type: 'generic',
13
+ name: 'i18n-calendars',
14
+ title: 'Other calendars',
15
+ placement: {
16
+ parent: 'namespace:internationalization',
17
+ slot: 'guides',
18
+ order: 25,
19
+ },
20
+ category: 'guide',
21
+ description:
22
+ 'Show dates in the Persian, Hebrew, Islamic, Buddhist, Japanese, and other calendars while values stay Gregorian ISO dates.',
23
+
24
+ sections: [
25
+ {
26
+ title: 'Show dates in another calendar',
27
+ content: [
28
+ {
29
+ type: 'prose',
30
+ text: 'Set `calendar` on `<InternationalizationProvider>` for a subtree, or on `Calendar` itself; without it, `Calendar` is Gregorian. Values stay Gregorian ISO dates (`YYYY-MM-DD`) in every calendar.',
31
+ },
32
+ {
33
+ type: 'code',
34
+ lang: 'tsx',
35
+ label: 'Persian dates in a Persian interface',
36
+ code: `import {InternationalizationProvider} from '@astryxdesign/core/i18n';
37
+ import {Calendar} from '@astryxdesign/core/Calendar';
38
+
39
+ <InternationalizationProvider locale="fa-IR" calendar="persian">
40
+ {/* shows Aban 1405; value and onChange stay '2026-10-30' */}
41
+ <Calendar value={date} onChange={setDate} />
42
+ </InternationalizationProvider>;`,
43
+ },
44
+ {
45
+ type: 'prose',
46
+ text: "Most calendars need the runtime's `Temporal`. Safari and older runtimes lack it: load `temporal-polyfill/full/global` there, on the server and in the browser. Without it, those calendars show Gregorian dates. See {@link namespace:calendars} for the supported calendars, server rendering, and the lunisolar calendars.",
47
+ },
48
+ ],
49
+ },
50
+ ],
51
+ };
@@ -2,8 +2,8 @@
2
2
 
3
3
  /**
4
4
  * @file `astryx docs internationalization`: the internationalization namespace.
5
- * Groups guides for quick-start locale setup, library integration, and
6
- * RTL + testing.
5
+ * Groups guides for quick-start locale setup, library integration, calendars,
6
+ * and RTL + testing.
7
7
  */
8
8
 
9
9
  /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
@@ -12,7 +12,7 @@ export const docs = {
12
12
  name: 'internationalization',
13
13
  title: 'Internationalization',
14
14
  summary:
15
- 'Set the active locale, load catalogs, coexist with your own i18n library, handle RTL, and test translations.',
15
+ 'Set the active locale, load catalogs, coexist with your own i18n library, show other calendars, handle RTL, and test translations.',
16
16
  keywords: [
17
17
  'i18n',
18
18
  'internationalization',
@@ -66,12 +66,13 @@ export default function PowerSearchContentSearch() {
66
66
  const [filters, setFilters] = useState<PowerSearchFilter[]>([]);
67
67
 
68
68
  return (
69
- <PowerSearch
70
- style={{width: 300}}
71
- config={config}
72
- filters={filters}
73
- onChange={newFilters => setFilters([...newFilters])}
74
- placeholder="Type to search by title, or pick a field..."
75
- />
69
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 300px)'}}>
70
+ <PowerSearch
71
+ config={config}
72
+ filters={filters}
73
+ onChange={newFilters => setFilters([...newFilters])}
74
+ placeholder="Type to search by title, or pick a field..."
75
+ />
76
+ </div>
76
77
  );
77
78
  }
@@ -94,12 +94,13 @@ export default function PowerSearchFullFeatured() {
94
94
  const [filters, setFilters] = useState<PowerSearchFilter[]>([]);
95
95
 
96
96
  return (
97
- <PowerSearch
98
- style={{width: 300}}
99
- config={config}
100
- filters={filters}
101
- onChange={newFilters => setFilters([...newFilters])}
102
- placeholder="Search..."
103
- />
97
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 300px)'}}>
98
+ <PowerSearch
99
+ config={config}
100
+ filters={filters}
101
+ onChange={newFilters => setFilters([...newFilters])}
102
+ placeholder="Search..."
103
+ />
104
+ </div>
104
105
  );
105
106
  }
@@ -69,12 +69,13 @@ export default function PowerSearchPresetFilters() {
69
69
  ]);
70
70
 
71
71
  return (
72
- <PowerSearch
73
- style={{width: 360}}
74
- config={config}
75
- filters={filters}
76
- onChange={newFilters => setFilters([...newFilters])}
77
- placeholder="Add more filters..."
78
- />
72
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 360px)'}}>
73
+ <PowerSearch
74
+ config={config}
75
+ filters={filters}
76
+ onChange={newFilters => setFilters([...newFilters])}
77
+ placeholder="Add more filters..."
78
+ />
79
+ </div>
79
80
  );
80
81
  }
@@ -92,15 +92,17 @@ export default function PowerSearchSearchWithTable() {
92
92
  const filteredBooks = applyFilters(filters, books);
93
93
 
94
94
  return (
95
- <VStack gap={4} width="100%" style={{maxWidth: 500}}>
96
- <PowerSearch
97
- config={config}
98
- filters={filters}
99
- onChange={newFilters => setFilters([...newFilters])}
100
- placeholder="Filter books by title, author, year, genre..."
101
- resultCount={filteredBooks.length}
102
- />
103
- <Table data={filteredBooks} columns={columns} idKey="id" hasHover />
104
- </VStack>
95
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 500px)'}}>
96
+ <VStack gap={4}>
97
+ <PowerSearch
98
+ config={config}
99
+ filters={filters}
100
+ onChange={newFilters => setFilters([...newFilters])}
101
+ placeholder="Filter books by title, author, year, genre..."
102
+ resultCount={filteredBooks.length}
103
+ />
104
+ <Table data={filteredBooks} columns={columns} idKey="id" hasHover />
105
+ </VStack>
106
+ </div>
105
107
  );
106
108
  }
@@ -55,12 +55,13 @@ export default function PowerSearchShowcase() {
55
55
  const [filters, setFilters] = useState<PowerSearchFilter[]>(initialFilters);
56
56
 
57
57
  return (
58
- <PowerSearch
59
- style={{width: 400}}
60
- config={config}
61
- filters={filters}
62
- onChange={newFilters => setFilters([...newFilters])}
63
- placeholder="Search by status, title..."
64
- />
58
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
59
+ <PowerSearch
60
+ config={config}
61
+ filters={filters}
62
+ onChange={newFilters => setFilters([...newFilters])}
63
+ placeholder="Search by status, title..."
64
+ />
65
+ </div>
65
66
  );
66
67
  }
@@ -6,7 +6,8 @@ export const doc = {
6
6
  exampleFor: 'Tokenizer',
7
7
  name: 'Tokenizer \u2014 Clear',
8
8
  displayName: 'Tokenizer \u2014 Clear',
9
- description: 'Tokenizer with a built-in clear-all button for bulk removal of all selected tokens.',
9
+ description:
10
+ "Tokenizer with a built-in clear-all button for bulk removal of all selected tokens. On touch screens, clear through the sheet's Clear all.",
10
11
  isReady: true,
11
12
  aspectRatio: 16 / 9,
12
13
  componentsUsed: ['Tokenizer', 'Layout', 'Text'],
@@ -29,7 +29,8 @@ export default function TokenizerClear() {
29
29
  <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
30
30
  <Stack direction="vertical" gap={2}>
31
31
  <Text type="supporting" color="secondary">
32
- Clear-all button appears when tokens are selected
32
+ Clear-all button appears when tokens are selected; on touch screens,
33
+ clear through the sheet's Clear all
33
34
  </Text>
34
35
  <Tokenizer
35
36
  label="Team Members"
@@ -38,7 +39,6 @@ export default function TokenizerClear() {
38
39
  value={value}
39
40
  onChange={items => setValue(items)}
40
41
  hasClear
41
- presentation="popover"
42
42
  />
43
43
  </Stack>
44
44
  </div>
@@ -59,7 +59,6 @@ export default function TokenizerCreatable() {
59
59
  hasCreate
60
60
  hasEntriesOnFocus
61
61
  placeholder="Search or type a new name..."
62
- presentation="popover"
63
62
  />
64
63
  </Stack>
65
64
  </Stack>