@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
@@ -0,0 +1,41 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for SplitButton. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["button", "menu", "actions", "split"],
7
+ usage: {
8
+ description:
9
+ "Pair a primary action with a menu of related alternatives. With no items, only the main button is shown.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Use isMainDisabled to block only the primary action, and labels.menu to name the menu arrow.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not assume isLoading disables the alternatives menu; it affects the main action while the menu stays usable.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Main button",
25
+ required: true,
26
+ description: "The default action, optionally busy or disabled.",
27
+ },
28
+ {
29
+ name: "Menu button",
30
+ required: false,
31
+ description: "A named arrow or host glyph opening the alternatives.",
32
+ },
33
+ {
34
+ name: "Menu",
35
+ required: false,
36
+ description: "Related actions, each with its own optional disabled state.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: ["label names the main action and labels.menu names the icon-only menu button."],
41
+ } satisfies ComponentDoc;
@@ -37,7 +37,7 @@ export type SplitButtonProps = {
37
37
  readonly isMainDisabled?: boolean | undefined;
38
38
  /** The main button shows a spinner and is announced as busy; the menu is not affected. */
39
39
  readonly isLoading?: boolean | undefined;
40
- /** Rounds its two ends into a pill, as fe-app's variant pills; the inner corners stay square. */
40
+ /** Rounds its two ends into a pill; the inner corners stay square. */
41
41
  readonly isRound?: boolean | undefined;
42
42
  /** The button's weight, `primary` by default. */
43
43
  readonly variant?: "primary" | "secondary" | undefined;
@@ -0,0 +1,39 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for StatusButton. */
4
+ export const doc = {
5
+ category: "Feedback",
6
+ keywords: ["status", "dot", "button", "connection"],
7
+ usage: {
8
+ description:
9
+ "Combine an action with a small dot showing a related state. Use a plain button when no state needs to be communicated.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description: "Translate labels.status to explain the dot independently of its tone.",
14
+ },
15
+ {
16
+ guidance: false,
17
+ description: "Do not rely on the dot's color alone to convey the state.",
18
+ },
19
+ ],
20
+ anatomy: [
21
+ {
22
+ name: "Button text",
23
+ required: true,
24
+ description: "The action supplied by label.",
25
+ },
26
+ {
27
+ name: "Status dot",
28
+ required: true,
29
+ description: "A named dot in the supplied status tone.",
30
+ },
31
+ {
32
+ name: "Icon",
33
+ required: false,
34
+ description: "Host-supplied leading content.",
35
+ },
36
+ ],
37
+ },
38
+ accessibility: ["labels.status names the status dot and label names the action."],
39
+ } satisfies ComponentDoc;
@@ -0,0 +1,41 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for TagSelect. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["tag", "color", "choice", "popover"],
7
+ usage: {
8
+ description:
9
+ "Choose one value through a small colored tag and a popover of tags. Use Select for a conventional field with a larger options list.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep option labels concise and provide label for the tag button and title for its popover.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not use the colored tag alone to explain the selected value; its text must identify it.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Picked tag",
25
+ required: true,
26
+ description: "The selected label, or the raw unknown value in blue.",
27
+ },
28
+ {
29
+ name: "Popover heading",
30
+ required: false,
31
+ description: "The supplied title while the tag list is open.",
32
+ },
33
+ {
34
+ name: "Tag choices",
35
+ required: false,
36
+ description: "Wrapping tag buttons that choose a value and close the popover.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: ["label names the tag button; read-only mode shows the tag without a button."],
41
+ } satisfies ComponentDoc;
@@ -41,8 +41,8 @@ export type TagSelectProps<V extends string> = {
41
41
 
42
42
  /**
43
43
  * A small coloured tag showing the picked value; pressing it opens a popover with a heading and
44
- * every tag, wrapping, each picked by a press, which closes the popover. As antsomi-ui's
45
- * `SelectAssociatedTag` tag. Its state is whether the popover is open.
44
+ * every tag, wrapping, each picked by a press, which closes the popover.
45
+ * Its state is whether the popover is open.
46
46
  */
47
47
  export function TagSelect<V extends string>(props: TagSelectProps<V>): ReactNode {
48
48
  const { options, value } = props;
@@ -150,7 +150,7 @@ function Tag<V extends string>(props: TagProps<V>): ReactNode {
150
150
  }
151
151
 
152
152
  const styles = stylex.create({
153
- // antsomi-ui's SelectedTag (SelectAssociatedTag/styled.ts): 16px high, 3px corners and sides,
153
+ // The selected tag: 16px high, 3px corners and sides,
154
154
  // cut at 70px; no spacing or radius step is 3px.
155
155
  tag: {
156
156
  display: "inline-flex",
@@ -171,11 +171,11 @@ const styles = stylex.create({
171
171
  cursor: { default: "pointer", ":disabled": "default" },
172
172
  },
173
173
  text: { minWidth: 0 },
174
- // antsomi-ui's Popover inner padding (overlayInnerStyle 10), between the 8px and 12px steps.
174
+ // The popover's 10px inner padding, between the 8px and 12px steps.
175
175
  panel: { padding: 10 },
176
176
  });
177
177
 
178
- // antsomi-ui's tag fills (SelectAssociatedTag constants), from the antsomi palette.
178
+ // Tag fills from the Antsomi palette.
179
179
  const tones = stylex.create({
180
180
  cyan: { backgroundColor: "var(--ants-mh-cyan-500)" },
181
181
  blue: { backgroundColor: "var(--ants-mh-blue-500)" },
@@ -0,0 +1,43 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for ToggleGrid. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["toggle", "grid", "multiple", "days"],
7
+ usage: {
8
+ description:
9
+ "Choose several compact values in a grid of toggle buttons, such as numbered days or hours. Use CheckGroup for longer checkbox labels.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep value controlled and accept changes in options order; use span for an option that should fill more tracks.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not use the grid for a single exclusive choice or assume toggling preserves click order.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Group label",
25
+ required: true,
26
+ description: "Names the set through FieldGroup.",
27
+ },
28
+ {
29
+ name: "Toggle buttons",
30
+ required: true,
31
+ description: "One pressed or unpressed button per option, with optional column spans.",
32
+ },
33
+ {
34
+ name: "Error",
35
+ required: false,
36
+ description: "A translated selection problem.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: [
41
+ "label names the group; option labels name the toggle buttons and their pressed states show the pick.",
42
+ ],
43
+ } satisfies ComponentDoc;
@@ -0,0 +1,41 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for TokenTextField. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["text", "tokens", "editor", "draft"],
7
+ related: [{ name: "CommitTextField", when: "Edit ordinary text without atomic token pills." }],
8
+ usage: {
9
+ description:
10
+ "Edit a controlled string containing atomic token pills. pattern returns a fresh global regular expression matching whole tokens and describe supplies their appearance. Local edits commit on blur or single-line Enter; an outside value replaces the draft.",
11
+ bestPractices: [
12
+ {
13
+ guidance: true,
14
+ description:
15
+ "Keep raw tokens in the string and use onDraftChange only for draft feedback such as a live length counter.",
16
+ },
17
+ {
18
+ guidance: false,
19
+ description:
20
+ "Do not return a pattern that matches empty strings or treat the visible token label as the stored value.",
21
+ },
22
+ ],
23
+ anatomy: [
24
+ { name: "Field label", required: true, description: "Names the editable string." },
25
+ {
26
+ name: "Editor",
27
+ required: true,
28
+ description: "Text and atomic tokens; loads separately with a skeleton.",
29
+ },
30
+ {
31
+ name: "Add button",
32
+ required: false,
33
+ description: "Opens the host's picker through onAddClick.",
34
+ },
35
+ ],
36
+ },
37
+ accessibility: [
38
+ "Provide label and translated labels.add, labels.remove and labels.loading.",
39
+ "Use isReadOnly to hide editing affordances while keeping the value readable.",
40
+ ],
41
+ } satisfies ComponentDoc;
@@ -0,0 +1,42 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for TransferLayout. */
4
+ export const doc = {
5
+ category: "Layout",
6
+ keywords: ["transfer", "columns", "scroll", "slots"],
7
+ usage: {
8
+ description:
9
+ "Lay out available and picked content in two independently scrolling columns with fixed headers. Use TransferPicker when the kit should also manage selection controls and search.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Name both columns through labels and use startRef when the host observes paging in the start viewport.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not expect layout slots to implement filtering, picking or removal; those behaviors belong to the host.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Start column",
25
+ required: true,
26
+ description: "The start viewport with optional header, fixed title and footer.",
27
+ },
28
+ {
29
+ name: "End column",
30
+ required: true,
31
+ description: "The end viewport with an optional fixed title and header.",
32
+ },
33
+ {
34
+ name: "Header strip",
35
+ required: false,
36
+ description:
37
+ "Host controls above the viewports; endHeader is omitted with isEndFullHeight.",
38
+ },
39
+ ],
40
+ },
41
+ accessibility: ["labels.start and labels.end name the two content columns."],
42
+ } satisfies ComponentDoc;
@@ -40,7 +40,7 @@ export type TransferLayoutProps = {
40
40
  };
41
41
 
42
42
  /**
43
- * Two columns side by side in one frame, as fe-app's audience picker: a header strip over two
43
+ * Two columns side by side in one frame: a header strip over two
44
44
  * equal columns of a fixed height whose lists scroll on their own, 1px lines between the parts
45
45
  * and no gap, and an optional footer under the start column. The headers and the lists' titles
46
46
  * sit outside the scrolling areas. Pure layout: every part is a slot. It holds no state.
@@ -126,8 +126,7 @@ export function TransferLayout({
126
126
 
127
127
  const LINE_COLOR = "var(--ants-mh-gray-200)";
128
128
 
129
- // fe-app's UITargetSelection grid (WrapperHeaderSelect, WrapperSelectItem, WrapperButtonFooter):
130
- // lines of its platinum grey, a 41px header strip, columns of a fixed height.
129
+ // Platinum grey grid lines, a 41px header strip, columns of a fixed height.
131
130
  const styles = stylex.create({
132
131
  frame: {
133
132
  gridTemplateColumns: "minmax(0, 1fr) minmax(0, 1fr)",
@@ -0,0 +1,38 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for TreeOptions. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["tree", "options", "leaves", "groups"],
7
+ usage: {
8
+ description:
9
+ "Pick one leaf from a flat or two-level tree while groups only expand and collapse. Use TreeSelect to put this tree behind a searchable field trigger.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Give every item a unique value and use isExpandedByDefault at mount when all groups should start open.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not supply deeper nesting and expect it to render; only the top level and its children are shown.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Rows",
25
+ required: true,
26
+ description: "Labels with a leaf selection mark or a group's trailing chevron.",
27
+ },
28
+ {
29
+ name: "Child rows",
30
+ required: false,
31
+ description: "Leaves indented beneath an expanded group.",
32
+ },
33
+ ],
34
+ },
35
+ accessibility: [
36
+ "The named tree exposes treeitem levels, expansion, selection and disabled states; Up and Down move focus, and Enter or Space acts on a row.",
37
+ ],
38
+ } satisfies ComponentDoc;
@@ -53,7 +53,7 @@ type Row = {
53
53
  };
54
54
 
55
55
  /**
56
- * The rows of a two-level tree to pick from, as fe-app's tree list: a group row shows its chevron
56
+ * The rows of a two-level tree to pick from: a group row shows its chevron
57
57
  * at the end (right when closed, down when open) and only opens and closes; a leaf is picked; a
58
58
  * disabled row does neither. Rows are the Selector's option rows (its styles, its option-row and
59
59
  * check theme targets, its check on the picked leaf at the end, where a group shows its chevron),
@@ -100,7 +100,7 @@ export function TreeOptions(props: TreeOptionsProps): ReactNode {
100
100
  };
101
101
  return (
102
102
  // Raw elements: a flat tree (rows with `aria-level`), which Astryx's TreeList is not: it puts
103
- // a group's chevron first, fe-app at the end.
103
+ // a group's chevron first; this tree puts it at the end.
104
104
  <div role="tree" aria-label={props.label} onKeyDown={moveFocus}>
105
105
  {rows.map((row) => (
106
106
  <div
@@ -122,8 +122,8 @@ export function TreeOptions(props: TreeOptionsProps): ReactNode {
122
122
  {...rowProps(row, size, value)}
123
123
  >
124
124
  {/* The option's content and mark column, as `Selector.tsx:1407-1431`. */}
125
- {/* One line cut with an ellipsis, the whole label in Text's tooltip when cut, as
126
- fe-app's tree (`Tree/Item.jsx:235`); Astryx's SelectorOption would run under the mark. */}
125
+ {/* One line cut with an ellipsis, with Text's tooltip for the whole label;
126
+ Astryx's SelectorOption would run under the mark. */}
127
127
  <span {...stylex.props(styles.content)}>
128
128
  <Text type="inherit" color="inherit" maxLines={1}>
129
129
  {row.item.label}
@@ -193,7 +193,7 @@ function moveFocus(event: KeyboardEvent<HTMLDivElement>): void {
193
193
  // focus, as the rows take focus, never on the picked row), `itemDisabled` (401-404) and
194
194
  // `itemSizeStyles` (452-460). The radius and the picked row's background and weight
195
195
  // (`itemSelected`) are left to the theme's `selector-option-row`. Only `child` is ours: a
196
- // group's leaves one indent step in, as fe-app's.
196
+ // group's leaves one indent step in.
197
197
  const styles = stylex.create({
198
198
  row: {
199
199
  boxSizing: "border-box",
@@ -250,7 +250,7 @@ export function leafOf(items: readonly TreeItem[], value: string): TreeItem | un
250
250
  return undefined;
251
251
  }
252
252
 
253
- // The rows a search leaves, as fe-app's `searchTree`: a case-insensitive substring of the label.
253
+ // The rows a search leaves: a case-insensitive substring of the label.
254
254
  // A leaf stays when it matches; a group when its label or a child's matches, keeping only the
255
255
  // children that match.
256
256
  export function matchTree(items: readonly TreeItem[], search: string): TreeItem[] {
@@ -0,0 +1,54 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for ChipListAddPopover. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["chips", "multiple", "popover", "apply"],
7
+ related: [
8
+ {
9
+ name: "TransferPicker",
10
+ when: "Keep available rows and picked values visible together with immediate changes.",
11
+ },
12
+ ],
13
+ usage: {
14
+ description:
15
+ "Pick several values as removable chips through a searchable checkbox popover. Checkbox edits remain a draft until Apply; closing another way drops them.",
16
+ bestPractices: [
17
+ {
18
+ guidance: true,
19
+ description:
20
+ "Use onRemove to confirm direct chip removal, and separately handle removals arriving in onChange from Apply.",
21
+ },
22
+ {
23
+ guidance: false,
24
+ description:
25
+ "Do not discard unknown stored values just because options has not loaded them; they remain visible as invalid values or loading placeholders.",
26
+ },
27
+ ],
28
+ anatomy: [
29
+ {
30
+ name: "Picked values",
31
+ required: false,
32
+ description: "Tokens or pill Chips when values are picked, with unknown values retained.",
33
+ },
34
+ {
35
+ name: "Add button",
36
+ required: false,
37
+ description: "Opens the checkbox popover unless read-only.",
38
+ },
39
+ {
40
+ name: "Popover",
41
+ required: false,
42
+ description: "Search, draft checkboxes and Apply.",
43
+ },
44
+ {
45
+ name: "Error",
46
+ required: false,
47
+ description: "A translated selection problem.",
48
+ },
49
+ ],
50
+ },
51
+ accessibility: [
52
+ "Supply translated search, add and apply labels plus labels.remove for each chip; labels.loading names loading placeholders.",
53
+ ],
54
+ } satisfies ComponentDoc;
@@ -0,0 +1,43 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for HourOfDayRow. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["hours", "day", "schedule", "drag"],
7
+ usage: {
8
+ description:
9
+ "Pick hours in one day by toggling cells or dragging a run. Use HourOfWeekGrid when selections vary by weekday.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Pass hours from 0 to 23 and format names through labels.hour; store the sorted unique result from onChange.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not compress the cells to fit a narrow panel; the row keeps its cell size and scrolls horizontally.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Hour cells",
25
+ required: true,
26
+ description: "Twenty-four cells showing picked hours and drag preview.",
27
+ },
28
+ {
29
+ name: "Hour labels",
30
+ required: true,
31
+ description: "Every third hour named below the row.",
32
+ },
33
+ {
34
+ name: "Error",
35
+ required: false,
36
+ description: "A translated problem below the selection.",
37
+ },
38
+ ],
39
+ },
40
+ accessibility: [
41
+ "label names the row; arrow keys move between hours and Space or Enter toggles the focused hour.",
42
+ ],
43
+ } satisfies ComponentDoc;
@@ -133,7 +133,7 @@ const styles = stylex.create({
133
133
  },
134
134
  on: { backgroundColor: colorVars["--color-accent"] },
135
135
  off: { backgroundColor: colorVars["--color-neutral"] },
136
- // fe-app's cells (SelectHoursOfDay Box) turn its hover blue under the pointer, picked or not,
136
+ // Cells turn hover blue under the pointer, picked or not,
137
137
  // while they can be changed.
138
138
  liveOn: {
139
139
  backgroundColor: {
@@ -0,0 +1,48 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for HourOfWeekGrid. */
4
+ export const doc = {
5
+ category: "Selection",
6
+ keywords: ["hours", "week", "schedule", "grid"],
7
+ usage: {
8
+ description:
9
+ "Pick hours across seven days by dragging a rectangle, toggling a day, or using the everyday row. Use HourOfDayRow when one daily selection is sufficient.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Supply seven day labels Monday first and store cells as day * 24 + hour, from 0 to 167.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not assume read-only matches disabled presentation; read-only hides the everyday editing row while disabled keeps it.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Day rows",
25
+ required: true,
26
+ description: "Seven rows of twenty-four hour cells, with day-name actions.",
27
+ },
28
+ {
29
+ name: "Everyday row",
30
+ required: false,
31
+ description: "Controls that toggle whole hours across all days, hidden when read-only.",
32
+ },
33
+ {
34
+ name: "Hour axis",
35
+ required: true,
36
+ description: "Formatted hour names along the grid.",
37
+ },
38
+ {
39
+ name: "Error",
40
+ required: false,
41
+ description: "A translated problem below the grid.",
42
+ },
43
+ ],
44
+ },
45
+ accessibility: [
46
+ "label names the grid even when visually hidden; cells expose selection, arrow keys move focus, and Space or Enter toggles a cell.",
47
+ ],
48
+ } satisfies ComponentDoc;
@@ -283,7 +283,7 @@ const styles = stylex.create({
283
283
  },
284
284
  on: { backgroundColor: colorVars["--color-accent"] },
285
285
  off: { backgroundColor: colorVars["--color-neutral"] },
286
- // fe-app's cells (SelectHoursOfDay Box) turn its hover blue under the pointer, picked or not,
286
+ // Cells turn hover blue under the pointer, picked or not,
287
287
  // while they can be changed.
288
288
  liveOn: {
289
289
  backgroundColor: {
@@ -0,0 +1,49 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for RepeatableList. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["list", "repeatable", "add", "rows"],
7
+ usage: {
8
+ description:
9
+ "Compose an editable list whose items and removal controls are supplied by the host. Use RuleList when every item should have a RuleRow and first/rest joining words.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Provide stable itemKey values and pass disabled or read-only state into the controls rendered by renderItem.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not hide the add button yourself at max; the list keeps it disabled with labels.maxReached when supplied.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Items",
25
+ required: false,
26
+ description:
27
+ "Host-rendered rows when items exist, optionally sharing column headings and tracks.",
28
+ },
29
+ {
30
+ name: "Separators",
31
+ required: false,
32
+ description: "Joint words or labeled dividers between items.",
33
+ },
34
+ {
35
+ name: "Add row",
36
+ required: false,
37
+ description: "A named add button, optionally placed by renderAdd.",
38
+ },
39
+ {
40
+ name: "Feedback",
41
+ required: false,
42
+ description: "Empty, maximum and validation messages.",
43
+ },
44
+ ],
45
+ },
46
+ accessibility: [
47
+ "label names the list's group; supply labels.add for its add action and accessible names inside rendered items.",
48
+ ],
49
+ } satisfies ComponentDoc;
@@ -0,0 +1,48 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for ResizableDrawer. */
4
+ export const doc = {
5
+ category: "Overlays",
6
+ keywords: ["drawer", "resize", "panel", "expand"],
7
+ usage: {
8
+ description:
9
+ "Place a resizable panel at the bottom of its parent, with a fixed header and scrolling body. Expansion covers that parent and Escape shrinks an expanded drawer.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep isExpanded controlled through onExpandedChange and provide labels and glyphs for expand and shrink.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not expect the drawer to cover the browser viewport unless its parent is sized for that purpose.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Resize bar",
25
+ required: true,
26
+ description: "The handle for changing the local drawer height.",
27
+ },
28
+ {
29
+ name: "Header",
30
+ required: true,
31
+ description: "Host title, optional end content, expand and close buttons.",
32
+ },
33
+ {
34
+ name: "Banners",
35
+ required: false,
36
+ description: "Host messages above the body.",
37
+ },
38
+ {
39
+ name: "Body",
40
+ required: true,
41
+ description: "Scrolling host content.",
42
+ },
43
+ ],
44
+ },
45
+ accessibility: [
46
+ "label names the drawer; labels names the expand, shrink, close and optional resize controls; Escape shrinks when expanded.",
47
+ ],
48
+ } satisfies ComponentDoc;