@antscorp/ui 0.1.2 → 0.1.3

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 (195) hide show
  1. package/README.md +1 -1
  2. package/dist/atoms/AddButton.d.ts +1 -1
  3. package/dist/atoms/AddButton.doc.d.ts +21 -0
  4. package/dist/atoms/AddGlyph.doc.d.ts +16 -0
  5. package/dist/atoms/Chip.doc.d.ts +29 -0
  6. package/dist/atoms/ChipSkeletons.doc.d.ts +21 -0
  7. package/dist/atoms/FieldHeading.doc.d.ts +15 -0
  8. package/dist/atoms/HoverSwap.doc.d.ts +25 -0
  9. package/dist/atoms/InfoTip.doc.d.ts +25 -0
  10. package/dist/atoms/InfoTip.js +2 -0
  11. package/dist/atoms/JointLabel.doc.d.ts +15 -0
  12. package/dist/atoms/LabeledDivider.d.ts +1 -1
  13. package/dist/atoms/LabeledDivider.doc.d.ts +21 -0
  14. package/dist/atoms/LogoImage.doc.d.ts +21 -0
  15. package/dist/atoms/PanelSearchInput.d.ts +1 -1
  16. package/dist/atoms/PanelSearchInput.doc.d.ts +25 -0
  17. package/dist/atoms/PathMark.doc.d.ts +16 -0
  18. package/dist/atoms/RemoveButton.doc.d.ts +16 -0
  19. package/dist/atoms/RowSkeletons.doc.d.ts +25 -0
  20. package/dist/atoms/TextAction.d.ts +3 -3
  21. package/dist/atoms/TextAction.doc.d.ts +25 -0
  22. package/dist/atoms/TruncatedOption.d.ts +1 -1
  23. package/dist/atoms/TruncatedOption.doc.d.ts +24 -0
  24. package/dist/atoms/TruncatedText.doc.d.ts +15 -0
  25. package/dist/cli.js +248 -0
  26. package/dist/doc/schema.d.ts +34 -0
  27. package/dist/doc/schema.js +33 -0
  28. package/dist/docs.json +1 -0
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.js +53 -51
  31. package/dist/lib/useLoadingShown.d.ts +1 -1
  32. package/dist/molecules/AccentCard.d.ts +2 -3
  33. package/dist/molecules/AccentCard.doc.d.ts +25 -0
  34. package/dist/molecules/CheckGroup.doc.d.ts +25 -0
  35. package/dist/molecules/CheckRow.d.ts +1 -1
  36. package/dist/molecules/CheckRow.doc.d.ts +25 -0
  37. package/dist/molecules/ChoiceDialog.doc.d.ts +21 -0
  38. package/dist/molecules/ChoiceTiles.d.ts +1 -1
  39. package/dist/molecules/ChoiceTiles.doc.d.ts +21 -0
  40. package/dist/molecules/CommitTextField.doc.d.ts +29 -0
  41. package/dist/molecules/ConfirmDialog.doc.d.ts +21 -0
  42. package/dist/molecules/DateTimeInput.doc.d.ts +25 -0
  43. package/dist/molecules/DurationInput.doc.d.ts +25 -0
  44. package/dist/molecules/FieldGroup.d.ts +1 -1
  45. package/dist/molecules/FieldGroup.doc.d.ts +25 -0
  46. package/dist/molecules/FieldRow.d.ts +1 -1
  47. package/dist/molecules/FieldRow.doc.d.ts +24 -0
  48. package/dist/molecules/FieldSkeleton.doc.d.ts +25 -0
  49. package/dist/molecules/FrequencyLimitRow.doc.d.ts +25 -0
  50. package/dist/molecules/InlineEditableText.doc.d.ts +25 -0
  51. package/dist/molecules/LoadMoreRow.doc.d.ts +21 -0
  52. package/dist/molecules/LoadState.doc.d.ts +21 -0
  53. package/dist/molecules/MetaTable.d.ts +1 -1
  54. package/dist/molecules/MetaTable.doc.d.ts +25 -0
  55. package/dist/molecules/PercentRow.doc.d.ts +25 -0
  56. package/dist/molecules/PhoneFrame.d.ts +1 -1
  57. package/dist/molecules/PhoneFrame.doc.d.ts +21 -0
  58. package/dist/molecules/ProblemsButton.doc.d.ts +25 -0
  59. package/dist/molecules/RemovableRow.d.ts +1 -1
  60. package/dist/molecules/RemovableRow.doc.d.ts +25 -0
  61. package/dist/molecules/RevealRadioGroup.doc.d.ts +25 -0
  62. package/dist/molecules/RevealSwitch.doc.d.ts +25 -0
  63. package/dist/molecules/RuleRow.doc.d.ts +25 -0
  64. package/dist/molecules/Select.d.ts +2 -2
  65. package/dist/molecules/Select.doc.d.ts +30 -0
  66. package/dist/molecules/Select.js +27 -27
  67. package/dist/molecules/SideLabelRow.d.ts +1 -1
  68. package/dist/molecules/SideLabelRow.doc.d.ts +20 -0
  69. package/dist/molecules/SplitButton.d.ts +1 -1
  70. package/dist/molecules/SplitButton.doc.d.ts +25 -0
  71. package/dist/molecules/StatusButton.doc.d.ts +25 -0
  72. package/dist/molecules/TagSelect.d.ts +2 -2
  73. package/dist/molecules/TagSelect.doc.d.ts +25 -0
  74. package/dist/molecules/ToggleGrid.doc.d.ts +25 -0
  75. package/dist/molecules/TokenTextField.doc.d.ts +29 -0
  76. package/dist/molecules/TransferLayout.d.ts +1 -1
  77. package/dist/molecules/TransferLayout.doc.d.ts +25 -0
  78. package/dist/molecules/TreeOptions.d.ts +1 -1
  79. package/dist/molecules/TreeOptions.doc.d.ts +25 -0
  80. package/dist/organisms/ChipListAddPopover.doc.d.ts +25 -0
  81. package/dist/organisms/HourOfDayRow.doc.d.ts +25 -0
  82. package/dist/organisms/HourOfWeekGrid.doc.d.ts +25 -0
  83. package/dist/organisms/RepeatableList.doc.d.ts +21 -0
  84. package/dist/organisms/ResizableDrawer.doc.d.ts +25 -0
  85. package/dist/organisms/RuleGroups.d.ts +3 -3
  86. package/dist/organisms/RuleGroups.doc.d.ts +21 -0
  87. package/dist/organisms/RuleList.doc.d.ts +25 -0
  88. package/dist/organisms/SearchableGroupedList.d.ts +1 -1
  89. package/dist/organisms/SearchableGroupedList.doc.d.ts +25 -0
  90. package/dist/organisms/TokenPickerDialog.doc.d.ts +21 -0
  91. package/dist/organisms/TransferPicker.d.ts +1 -1
  92. package/dist/organisms/TransferPicker.doc.d.ts +29 -0
  93. package/dist/organisms/TreeSearchPanel.doc.d.ts +25 -0
  94. package/dist/organisms/TreeSelect.d.ts +3 -3
  95. package/dist/organisms/TreeSelect.doc.d.ts +29 -0
  96. package/dist/theme/AntsomiTheme.doc.d.ts +15 -0
  97. package/dist/theme/AntsomiTheme.doc.js +22 -0
  98. package/package.json +17 -6
  99. package/src/atoms/AddButton.doc.ts +36 -0
  100. package/src/atoms/AddButton.tsx +1 -1
  101. package/src/atoms/AddGlyph.doc.ts +26 -0
  102. package/src/atoms/Chip.doc.ts +45 -0
  103. package/src/atoms/Chip.tsx +2 -2
  104. package/src/atoms/ChipSkeletons.doc.ts +31 -0
  105. package/src/atoms/FieldHeading.doc.ts +22 -0
  106. package/src/atoms/HoverSwap.doc.ts +39 -0
  107. package/src/atoms/InfoTip.doc.ts +37 -0
  108. package/src/atoms/InfoTip.tsx +2 -2
  109. package/src/atoms/JointLabel.doc.ts +23 -0
  110. package/src/atoms/LabeledDivider.doc.ts +35 -0
  111. package/src/atoms/LabeledDivider.tsx +1 -1
  112. package/src/atoms/LogoImage.doc.ts +42 -0
  113. package/src/atoms/PanelSearchInput.doc.ts +41 -0
  114. package/src/atoms/PanelSearchInput.tsx +1 -1
  115. package/src/atoms/PathMark.doc.ts +25 -0
  116. package/src/atoms/RemoveButton.doc.ts +26 -0
  117. package/src/atoms/RowSkeletons.doc.ts +43 -0
  118. package/src/atoms/TextAction.doc.ts +40 -0
  119. package/src/atoms/TextAction.tsx +4 -4
  120. package/src/atoms/TruncatedOption.doc.ts +39 -0
  121. package/src/atoms/TruncatedOption.tsx +1 -1
  122. package/src/atoms/TruncatedText.doc.ts +22 -0
  123. package/src/doc/schema.ts +67 -0
  124. package/src/index.ts +2 -0
  125. package/src/lib/useLoadMore.ts +1 -2
  126. package/src/lib/useLoadingShown.ts +1 -1
  127. package/src/molecules/AccentCard.doc.ts +43 -0
  128. package/src/molecules/AccentCard.tsx +7 -8
  129. package/src/molecules/CheckGroup.doc.ts +40 -0
  130. package/src/molecules/CheckRow.doc.ts +43 -0
  131. package/src/molecules/CheckRow.tsx +1 -1
  132. package/src/molecules/ChoiceDialog.doc.ts +48 -0
  133. package/src/molecules/ChoiceTiles.doc.ts +42 -0
  134. package/src/molecules/ChoiceTiles.tsx +3 -3
  135. package/src/molecules/CommitTextField.doc.ts +41 -0
  136. package/src/molecules/ConfirmDialog.doc.ts +43 -0
  137. package/src/molecules/DateTimeInput.doc.ts +48 -0
  138. package/src/molecules/DurationInput.doc.ts +36 -0
  139. package/src/molecules/DurationInput.tsx +2 -2
  140. package/src/molecules/FieldGroup.doc.ts +41 -0
  141. package/src/molecules/FieldGroup.tsx +1 -1
  142. package/src/molecules/FieldRow.doc.ts +36 -0
  143. package/src/molecules/FieldRow.tsx +1 -1
  144. package/src/molecules/FieldSkeleton.doc.ts +38 -0
  145. package/src/molecules/FrequencyLimitRow.doc.ts +48 -0
  146. package/src/molecules/FrequencyLimitRow.tsx +1 -1
  147. package/src/molecules/InlineEditableText.doc.ts +41 -0
  148. package/src/molecules/LoadMoreRow.doc.ts +36 -0
  149. package/src/molecules/LoadState.doc.ts +42 -0
  150. package/src/molecules/MetaTable.doc.ts +46 -0
  151. package/src/molecules/MetaTable.tsx +1 -1
  152. package/src/molecules/PercentRow.doc.ts +48 -0
  153. package/src/molecules/PhoneFrame.doc.ts +46 -0
  154. package/src/molecules/PhoneFrame.tsx +2 -2
  155. package/src/molecules/ProblemsButton.doc.ts +41 -0
  156. package/src/molecules/RemovableRow.doc.ts +48 -0
  157. package/src/molecules/RemovableRow.tsx +2 -2
  158. package/src/molecules/RevealRadioGroup.doc.ts +41 -0
  159. package/src/molecules/RevealSwitch.doc.ts +38 -0
  160. package/src/molecules/RuleRow.doc.ts +43 -0
  161. package/src/molecules/Select.doc.ts +62 -0
  162. package/src/molecules/Select.tsx +2 -2
  163. package/src/molecules/SideLabelRow.doc.ts +35 -0
  164. package/src/molecules/SideLabelRow.tsx +2 -2
  165. package/src/molecules/SplitButton.doc.ts +41 -0
  166. package/src/molecules/SplitButton.tsx +1 -1
  167. package/src/molecules/StatusButton.doc.ts +39 -0
  168. package/src/molecules/TagSelect.doc.ts +41 -0
  169. package/src/molecules/TagSelect.tsx +5 -5
  170. package/src/molecules/ToggleGrid.doc.ts +43 -0
  171. package/src/molecules/TokenTextField.doc.ts +41 -0
  172. package/src/molecules/TransferLayout.doc.ts +42 -0
  173. package/src/molecules/TransferLayout.tsx +2 -3
  174. package/src/molecules/TreeOptions.doc.ts +38 -0
  175. package/src/molecules/TreeOptions.tsx +6 -6
  176. package/src/organisms/ChipListAddPopover.doc.ts +54 -0
  177. package/src/organisms/HourOfDayRow.doc.ts +43 -0
  178. package/src/organisms/HourOfDayRow.tsx +1 -1
  179. package/src/organisms/HourOfWeekGrid.doc.ts +48 -0
  180. package/src/organisms/HourOfWeekGrid.tsx +1 -1
  181. package/src/organisms/RepeatableList.doc.ts +49 -0
  182. package/src/organisms/ResizableDrawer.doc.ts +48 -0
  183. package/src/organisms/RuleGroups.doc.ts +49 -0
  184. package/src/organisms/RuleGroups.tsx +3 -3
  185. package/src/organisms/RuleList.doc.ts +43 -0
  186. package/src/organisms/SearchableGroupedList.doc.ts +49 -0
  187. package/src/organisms/SearchableGroupedList.tsx +2 -2
  188. package/src/organisms/TokenPickerDialog.doc.ts +54 -0
  189. package/src/organisms/TransferPicker.doc.ts +69 -0
  190. package/src/organisms/TransferPicker.tsx +3 -3
  191. package/src/organisms/TreeSearchPanel.doc.ts +43 -0
  192. package/src/organisms/TreeSearchPanel.tsx +1 -1
  193. package/src/organisms/TreeSelect.doc.ts +56 -0
  194. package/src/organisms/TreeSelect.tsx +4 -4
  195. package/src/theme/AntsomiTheme.doc.ts +23 -0
@@ -39,9 +39,8 @@ export type AccentCardProps = {
39
39
  readonly isDisabled?: boolean | undefined;
40
40
  /**
41
41
  * `stripe` (default): a grey border with an accent stripe down the start edge and a light
42
- * header bar, as fe-app's Perform event card. `banner`: no border nor stripe but a soft shadow,
43
- * under a dark blue header bar with the title in white capitals and a white close cross, as
44
- * fe-app's audience picker.
42
+ * header bar. `banner`: no border nor stripe but a soft shadow,
43
+ * under a dark blue header bar with the title in white capitals and a white close cross.
45
44
  */
46
45
  readonly variant?: "stripe" | "banner" | undefined;
47
46
  };
@@ -103,7 +102,7 @@ export function AccentCard(props: AccentCardProps): ReactNode {
103
102
  }
104
103
 
105
104
  const styles = stylex.create({
106
- // fe-app's Perform event card (UIPerformEventV2 GeneralContainerCondition): a grey border and a
105
+ // A grey border and a
107
106
  // 4px accent stripe at the start (no border token is 4px). A look of this card only, which no
108
107
  // Card prop nor theme entry (it would paint every card) can express; `padding={0}` clears the rest.
109
108
  card: {
@@ -111,17 +110,17 @@ const styles = stylex.create({
111
110
  borderInlineStartWidth: 4,
112
111
  borderInlineStartColor: colorVars["--color-accent"],
113
112
  },
114
- // fe-app's header bar: 10px above and below, between the spacing steps of 8px and 12px, and as
113
+ // The header bar: 10px above and below, between the spacing steps of 8px and 12px, and as
115
114
  // high with the close button (sm) as without it.
116
115
  header: {
117
116
  paddingBlock: 10,
118
117
  minHeight: `calc(${sizeVars["--size-element-sm"]} + ${spacingVars["--spacing-5"]})`,
119
118
  backgroundColor: "var(--ants-mh-gray-75)",
120
119
  },
121
- // fe-app's audience picker (UITargetSelection ContainerTargetAudience): no border, square
122
- // corners and a soft shadow (Astryx's low elevation, near fe-app's 0 1px 4px grey).
120
+ // The banner card: no border, square
121
+ // corners and a soft shadow (Astryx's low elevation, near a 0 1px 4px grey shadow).
123
122
  bannerCard: { borderStyle: "none", borderRadius: 0 },
124
- // fe-app's HeaderTargetAudience: white semibold capitals on its header blue, 10px 20px around.
123
+ // White semibold capitals on the header blue, 10px 20px around.
125
124
  banner: {
126
125
  backgroundColor: "var(--ants-mh-blue-750)",
127
126
  color: colorVars["--color-on-accent"],
@@ -0,0 +1,40 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for CheckGroup. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["checkboxes", "multiple", "options", "group"],
7
+ usage: {
8
+ description:
9
+ "Choose several values from a short list of labeled checkboxes. Use ToggleGrid when a compact grid of toggle buttons fits the choices better.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep value controlled and accept onChange values in options order; use vertical orientation when labels need more room.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description: "Do not use checkboxes for mutually exclusive choices; use RevealRadioGroup.",
19
+ },
20
+ ],
21
+ anatomy: [
22
+ {
23
+ name: "Group label",
24
+ required: true,
25
+ description: "Names the set through FieldGroup.",
26
+ },
27
+ {
28
+ name: "Checkboxes",
29
+ required: true,
30
+ description: "One controlled checkbox per option, in a wrapping row or column.",
31
+ },
32
+ {
33
+ name: "Error",
34
+ required: false,
35
+ description: "A translated problem with the selection.",
36
+ },
37
+ ],
38
+ },
39
+ accessibility: ["Supply label for the group and a clear label on every option."],
40
+ } satisfies ComponentDoc;
@@ -0,0 +1,43 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for CheckRow. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["checkbox", "row", "pick", "list"],
7
+ usage: {
8
+ description:
9
+ "Show one checkbox choice with optional supporting text and end content. Use RemovableRow for a value that is already picked and needs a removal action.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep label meaningful because it names the checkbox, and reserve hoverContent for supplementary row actions.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not assume clicking the text toggles the checkbox; the checkbox itself is the control.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Checkbox",
25
+ required: true,
26
+ description: "The controlled boolean choice.",
27
+ },
28
+ {
29
+ name: "Text",
30
+ required: true,
31
+ description: "A one-line label and optional one-line description.",
32
+ },
33
+ {
34
+ name: "End content",
35
+ required: false,
36
+ description: "A value optionally replaced by hover actions.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: [
41
+ "label names the checkbox; provide names on interactive controls supplied through hoverContent.",
42
+ ],
43
+ } satisfies ComponentDoc;
@@ -36,7 +36,7 @@ export type CheckRowProps = {
36
36
  * One row of a list to tick: a checkbox (md, as every checkbox), the row's text on one line (and
37
37
  * an optional second line), and content at its end that `hoverContent` replaces while the row is
38
38
  * hovered or focused. The box is the control and is named by the text; the text itself is not a
39
- * click target, as in fe-app. As high as a small control, so `RowSkeletons variant="check"`
39
+ * click target. As high as a small control, so `RowSkeletons variant="check"`
40
40
  * stands in for it without a shift. It holds no state.
41
41
  */
42
42
  export function CheckRow(props: CheckRowProps): ReactNode {
@@ -0,0 +1,48 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for ChoiceDialog. */
4
+ export const doc = {
5
+ category: "Overlays",
6
+ keywords: ["dialog", "choice", "confirm", "radio"],
7
+ usage: {
8
+ description:
9
+ "Ask for one choice before confirming a change, with optional details under the selected option. Use ConfirmDialog when no choice is required.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep value and option details controlled, and use isConfirmDisabled while the selected details are incomplete.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not apply the choice merely when onValueChange fires; onConfirm is the explicit confirmation action.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Header",
25
+ required: true,
26
+ description: "The question supplied by title.",
27
+ },
28
+ {
29
+ name: "Description",
30
+ required: true,
31
+ description: "Explains what the user is choosing.",
32
+ },
33
+ {
34
+ name: "Choices",
35
+ required: true,
36
+ description: "A radio list revealing the selected option's detail.",
37
+ },
38
+ {
39
+ name: "Actions",
40
+ required: true,
41
+ description: "Translated cancel and confirm buttons.",
42
+ },
43
+ ],
44
+ },
45
+ accessibility: [
46
+ "Provide descriptive title and option labels; closing the dialog, including Escape, calls onCancel.",
47
+ ],
48
+ } satisfies ComponentDoc;
@@ -0,0 +1,42 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for ChoiceTiles. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["tiles", "choices", "actions", "cards"],
7
+ usage: {
8
+ description:
9
+ "Offer a few actions as cards with an icon, title and short description. Use RevealRadioGroup when a persistent selected value is required.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Make each title distinguish the action and use onSelect to show or perform what follows.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description: "Do not use tiles as toggles; this view has no selected state.",
19
+ },
20
+ ],
21
+ anatomy: [
22
+ {
23
+ name: "Icon circle",
24
+ required: true,
25
+ description: "Host glyph displayed in an accent circle on each tile.",
26
+ },
27
+ {
28
+ name: "Title",
29
+ required: true,
30
+ description: "The bold action text and button name.",
31
+ },
32
+ {
33
+ name: "Description",
34
+ required: true,
35
+ description: "Supporting text limited to two lines.",
36
+ },
37
+ ],
38
+ },
39
+ accessibility: [
40
+ "label names the group; each tile is a button named by its title and supports click, Enter and Space.",
41
+ ],
42
+ } satisfies ComponentDoc;
@@ -32,7 +32,7 @@ export type ChoiceTilesProps<V extends string> = {
32
32
  };
33
33
 
34
34
  /**
35
- * A choice among a few ways to go on, as antsomi-ui's tiles: a wrapping row of 180×170 cards, each
35
+ * A choice among a few ways to go on: a wrapping row of 180×170 cards, each
36
36
  * a button with its glyph in a soft accent circle, a bold title and a description under it. A pick
37
37
  * is an action, not a selected state: the host shows what follows instead. It holds no state.
38
38
  */
@@ -64,13 +64,13 @@ export function ChoiceTiles<V extends string>(props: ChoiceTilesProps<V>): React
64
64
  );
65
65
  }
66
66
 
67
- // fe-app's tiles are 150×130 at its 12px text; ours is larger, so a two-line description fits here.
67
+ // A 150×130 tile at 12px text is too tight; 180×170 leaves room for a two-line description.
68
68
  const TILE = { width: 180, height: 170 } as const;
69
69
 
70
70
  const styles = stylex.create({
71
71
  // Text has no alignment prop: its lines centre under the glyph from here.
72
72
  fill: { height: "100%", textAlign: "center" },
73
- // antsomi-ui's tile glyph: a 50px circle in the accent's lightest tint, the glyph in the accent.
73
+ // A 50px circle in the accent's lightest tint, the glyph in the accent.
74
74
  circle: {
75
75
  flexShrink: 0,
76
76
  width: 50,
@@ -0,0 +1,41 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for CommitTextField. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["text", "draft", "commit", "blur"],
7
+ related: [{ name: "TokenTextField", when: "Matched tokens need to appear as atomic pills." }],
8
+ usage: {
9
+ description:
10
+ "Edit text locally and report a single change on blur or single-line Enter. Use TokenTextField when matched tokens need to appear as atomic pills.",
11
+ bestPractices: [
12
+ {
13
+ guidance: true,
14
+ description:
15
+ "Return accepted text through value; use isDraftKeptOnCommit only when a refused draft should remain visible.",
16
+ },
17
+ {
18
+ guidance: false,
19
+ description: "Do not expect Enter to commit a multiline field; it inserts a new line.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Label",
25
+ required: true,
26
+ description: "The field's accessible name, optionally visually hidden.",
27
+ },
28
+ {
29
+ name: "Input",
30
+ required: true,
31
+ description: "A single-line control or a multiline text area holding a draft.",
32
+ },
33
+ {
34
+ name: "Help and error",
35
+ required: false,
36
+ description: "Translated description and validation text.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: ["Always supply label, including when isLabelHidden is true."],
41
+ } satisfies ComponentDoc;
@@ -0,0 +1,43 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for ConfirmDialog. */
4
+ export const doc = {
5
+ category: "Overlays",
6
+ keywords: ["confirmation", "dialog", "cancel", "loss"],
7
+ usage: {
8
+ description:
9
+ "Ask before a change that loses work, optionally paired with useConfirmedChange. Use ChoiceDialog when the user must choose an option before confirming.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Explain the consequence in description and make labels.action name the actual change.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not perform the pending change until onConfirm; onCancel should discard the pending request.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Header",
25
+ required: true,
26
+ description: "The confirmation question supplied by title.",
27
+ },
28
+ {
29
+ name: "Description",
30
+ required: true,
31
+ description: "The consequence of the pending change.",
32
+ },
33
+ {
34
+ name: "Actions",
35
+ required: true,
36
+ description: "The cancel button and confirming action.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: [
41
+ "Supply a clear title and translated action and cancel labels; dialog behavior is provided by Astryx Dialog.",
42
+ ],
43
+ } satisfies ComponentDoc;
@@ -0,0 +1,48 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for DateTimeInput. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["date", "time", "partial", "calendar"],
7
+ usage: {
8
+ description:
9
+ "Edit a local date and time even while either part is incomplete. Set hasTime=false for a date-only value; labels.timezone only displays a note.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep wire values as strings and use frame=none when the individual date and time labels should be visible.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not require the value to be complete on every onChange; empty and partial strings are supported.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Date input",
25
+ required: true,
26
+ description: "The date portion, optionally constrained by min.",
27
+ },
28
+ {
29
+ name: "Time input",
30
+ required: false,
31
+ description: "The time portion when hasTime is enabled.",
32
+ },
33
+ {
34
+ name: "Note",
35
+ required: false,
36
+ description: "labels.timezone shown beside the time.",
37
+ },
38
+ {
39
+ name: "Help and error",
40
+ required: false,
41
+ description: "Group guidance or date-field guidance with frame=none.",
42
+ },
43
+ ],
44
+ },
45
+ accessibility: [
46
+ "Supply label and labels.date and labels.time; the default bare group hides the individual visible labels while preserving their names.",
47
+ ],
48
+ } satisfies ComponentDoc;
@@ -0,0 +1,36 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for DurationInput. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["duration", "days", "hours", "seconds"],
7
+ usage: {
8
+ description:
9
+ "Edit a length of time as days, hours, minutes and seconds. Use DateTimeInput for a calendar date and time instead of an elapsed duration.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Translate every unit label and use max to constrain parts; reaching max.days disables the remaining parts.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not treat this partial duration object as an instant or assume unset parts are explicitly stored as zero.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Part inputs",
25
+ required: true,
26
+ description: "Four number inputs, each followed by its translated unit.",
27
+ },
28
+ {
29
+ name: "Error",
30
+ required: false,
31
+ description: "A translated problem with the whole duration.",
32
+ },
33
+ ],
34
+ },
35
+ accessibility: ["label names the unframed group; labels names each unit's input."],
36
+ } satisfies ComponentDoc;
@@ -44,7 +44,7 @@ export function DurationInput(props: DurationInputProps): ReactNode {
44
44
  const size = props.size ?? "md";
45
45
  const duration = props.value ?? {};
46
46
  const isWholeDays = max.days !== undefined && duration.days === max.days;
47
- // As fe-app's: with any other part set, days stop one short, so they never reach a max that disables those parts.
47
+ // With any other part set, days stop one short, so they never reach a max that disables those parts.
48
48
  const hasParts = PARTS.some((part) => part !== "days" && (duration[part] ?? 0) > 0);
49
49
  const limits = { ...max, ...(max.days !== undefined && hasParts && { days: max.days - 1 }) };
50
50
  return (
@@ -55,7 +55,7 @@ export function DurationInput(props: DurationInputProps): ReactNode {
55
55
  <NumberInput
56
56
  label={labels[part]}
57
57
  isLabelHidden
58
- // fe-app's: room for three digits of days, two of the others.
58
+ // Room for three digits of days, two of the others.
59
59
  width={part === "days" ? 80 : 64}
60
60
  size={size}
61
61
  min={0}
@@ -0,0 +1,41 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for FieldGroup. */
4
+ export const doc = {
5
+ category: "Layout",
6
+ keywords: ["fields", "group", "fieldset", "card"],
7
+ usage: {
8
+ description:
9
+ "Name several related fields and show a problem with the group as a whole. Use FieldRow to place a separate caption beside the grouped controls.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Supply label even without a frame, and disable child controls explicitly when using frame=card.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not expect isDisabled to disable the card variant; only the unframed fieldset disables its descendants.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Group label",
25
+ required: true,
26
+ description: "An accessible name, visible above content in the card variant.",
27
+ },
28
+ {
29
+ name: "Fields",
30
+ required: true,
31
+ description: "Host controls with the requested gap.",
32
+ },
33
+ {
34
+ name: "Description and error",
35
+ required: false,
36
+ description: "Help and a translated problem with the group.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: ["The unframed variant is a named fieldset; the card variant uses role group."],
41
+ } satisfies ComponentDoc;
@@ -18,7 +18,7 @@ export type FieldGroupProps = {
18
18
  readonly frame?: "none" | "card" | undefined;
19
19
  /** Help under the label. */
20
20
  readonly description?: string | undefined;
21
- /** Disables every field in the group, e.g. for a read-only form. */
21
+ /** Disables fields through the unframed fieldset; with `frame="card"`, disable children yourself. */
22
22
  readonly isDisabled?: boolean | undefined;
23
23
  /** A problem with the group as a whole, already in the user's language. */
24
24
  readonly error?: string | undefined;
@@ -0,0 +1,36 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for FieldRow. */
4
+ export const doc = {
5
+ category: "Layout",
6
+ keywords: ["form", "caption", "columns", "responsive"],
7
+ usage: {
8
+ description:
9
+ "Arrange a form section as a caption column beside its controls, stacking when room is limited. Use SideLabelRow for padded rows inside a card.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep caption widths consistent through the theme or labelWidth and use align=start for controls without a useful text baseline.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not rely on the visible caption to name individual controls; keep their own labels.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Caption column",
25
+ required: false,
26
+ description:
27
+ "The label and optional description; its space remains when no label is supplied in horizontal layout.",
28
+ },
29
+ {
30
+ name: "Control column",
31
+ required: true,
32
+ description: "Host controls that move below the caption in a narrow layout.",
33
+ },
34
+ ],
35
+ },
36
+ } satisfies ComponentDoc;
@@ -8,7 +8,7 @@ import type { ReactNode } from "react";
8
8
  export type FieldRowProps = {
9
9
  /**
10
10
  * The row's caption, in a column at the start. Without it the column stays, empty, so the
11
- * content lines up with the captioned rows around it (as fe-app's empty title column); stacked,
11
+ * content lines up with the captioned rows around it; stacked,
12
12
  * nothing is drawn above the content.
13
13
  */
14
14
  readonly label?: string | undefined;
@@ -0,0 +1,38 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for FieldSkeleton. */
4
+ export const doc = {
5
+ category: "Feedback",
6
+ keywords: ["field", "loading", "skeleton", "placeholder"],
7
+ usage: {
8
+ description:
9
+ "Reserve a form field's shape while its data loads. Use RowSkeletons for a list and ChipSkeletons for picked values.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Show the real label when known and match isLabelHidden to the field that will replace the placeholder.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not add a separate status for every skeleton inside one named loading region; set hasStatus=false.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Label",
25
+ required: false,
26
+ description: "The real caption or a short shimmer bar unless isLabelHidden.",
27
+ },
28
+ {
29
+ name: "Control placeholder",
30
+ required: true,
31
+ description: "A shimmer as high as a control, respecting horizontal-labels layout.",
32
+ },
33
+ ],
34
+ },
35
+ accessibility: [
36
+ "The default wrapper is a status named by labels.loading; hasStatus=false hides the placeholder from assistive technology.",
37
+ ],
38
+ } satisfies ComponentDoc;
@@ -0,0 +1,48 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for FrequencyLimitRow. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["frequency", "limit", "count", "window"],
7
+ usage: {
8
+ description:
9
+ "Edit a count per time window as one sentence. The window identified by everyWindow also reveals a number of units.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep value controlled and supply translated labels and connecting words; use paths when the inputs must be found by revealPath.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not retain every for unrelated windows; switching away from everyWindow drops that extra number.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Count input",
25
+ required: true,
26
+ description: "The number of occurrences followed by words.times.",
27
+ },
28
+ {
29
+ name: "Window select",
30
+ required: true,
31
+ description: "The offered counting window.",
32
+ },
33
+ {
34
+ name: "Every input",
35
+ required: false,
36
+ description: "An extra number and words.every for the designated window.",
37
+ },
38
+ {
39
+ name: "Trailing content",
40
+ required: false,
41
+ description: "Host content finishing the sentence.",
42
+ },
43
+ ],
44
+ },
45
+ accessibility: [
46
+ "labels.times, labels.window and labels.every supply the hidden accessible input labels.",
47
+ ],
48
+ } satisfies ComponentDoc;
@@ -72,7 +72,7 @@ function Marked(props: {
72
72
  );
73
73
  }
74
74
 
75
- // Wide enough for a few digits and the stepper, as fe-app's number box.
75
+ // Wide enough for a few digits and the stepper.
76
76
  const TIMES_WIDTH = 80;
77
77
 
78
78
  /** "N time(s) per window" as one sentence, with a number more when the window is the `everyWindow`. */