@antscorp/ui 0.1.1 → 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,25 @@
1
+ /** Usage guidance for HourOfDayRow. */
2
+ export declare const doc: {
3
+ category: "Selection";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: ({
15
+ name: string;
16
+ required: true;
17
+ description: string;
18
+ } | {
19
+ name: string;
20
+ required: false;
21
+ description: string;
22
+ })[];
23
+ };
24
+ accessibility: string[];
25
+ };
@@ -0,0 +1,25 @@
1
+ /** Usage guidance for HourOfWeekGrid. */
2
+ export declare const doc: {
3
+ category: "Selection";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: ({
15
+ name: string;
16
+ required: true;
17
+ description: string;
18
+ } | {
19
+ name: string;
20
+ required: false;
21
+ description: string;
22
+ })[];
23
+ };
24
+ accessibility: string[];
25
+ };
@@ -0,0 +1,21 @@
1
+ /** Usage guidance for RepeatableList. */
2
+ export declare const doc: {
3
+ category: "Inputs";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: {
15
+ name: string;
16
+ required: false;
17
+ description: string;
18
+ }[];
19
+ };
20
+ accessibility: string[];
21
+ };
@@ -0,0 +1,25 @@
1
+ /** Usage guidance for ResizableDrawer. */
2
+ export declare const doc: {
3
+ category: "Overlays";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: ({
15
+ name: string;
16
+ required: true;
17
+ description: string;
18
+ } | {
19
+ name: string;
20
+ required: false;
21
+ description: string;
22
+ })[];
23
+ };
24
+ accessibility: string[];
25
+ };
@@ -47,11 +47,11 @@ export type RuleGroupsProps<R> = {
47
47
  readonly isReadOnly?: boolean | undefined;
48
48
  };
49
49
  /**
50
- * Rules in groups, as fe-app's attribute filter: each rule a card with an accent stripe, a title
50
+ * Rules in groups: each rule a card with an accent stripe, a title
51
51
  * and a close button; the word "and" under each card but a group's last, and a pill button adding
52
52
  * a rule at the end of the group; a dashed divider with "or" between groups, and a pill button
53
- * adding a group after the last; each word in capitals, as fe-app's. Unlike a list's add, an add at its limit (`maxRules`,
54
- * `maxGroups`) is gone, as fe-app's. The only rule left has no close button, so the groups are
53
+ * adding a group after the last; each word in capitals. Unlike a list's add, an add at its limit (`maxRules`,
54
+ * `maxGroups`) is hidden. The only rule left has no close button, so the groups are
55
55
  * never emptied from here; with no group at all only the button adding one shows. It holds no
56
56
  * state.
57
57
  */
@@ -0,0 +1,21 @@
1
+ /** Usage guidance for RuleGroups. */
2
+ export declare const doc: {
3
+ category: "Inputs";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: {
15
+ name: string;
16
+ required: false;
17
+ description: string;
18
+ }[];
19
+ };
20
+ accessibility: string[];
21
+ };
@@ -0,0 +1,25 @@
1
+ /** Usage guidance for RuleList. */
2
+ export declare const doc: {
3
+ category: "Inputs";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: ({
15
+ name: string;
16
+ required: true;
17
+ description: string;
18
+ } | {
19
+ name: string;
20
+ required: false;
21
+ description: string;
22
+ })[];
23
+ };
24
+ accessibility: string[];
25
+ };
@@ -50,7 +50,7 @@ export type SearchableGroupedListProps<I> = {
50
50
  /**
51
51
  * Caps the height, the groups scrolling under the search box, in a pop-over say; with no
52
52
  * `maxHeight` it fills its parent's height, in a side panel say. The list then pads its own edges,
53
- * so the search row (its magnifier at the end, as fe-app's) and the rule under it reach the
53
+ * so the search row (its magnifier at the end) and the rule under it reach the
54
54
  * edges of a flush (unpadded) surface, and so does the scrollbar.
55
55
  */
56
56
  readonly scroll?: {
@@ -0,0 +1,25 @@
1
+ /** Usage guidance for SearchableGroupedList. */
2
+ export declare const doc: {
3
+ category: "Selection";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: ({
15
+ name: string;
16
+ required: true;
17
+ description: string;
18
+ } | {
19
+ name: string;
20
+ required: false;
21
+ description: string;
22
+ })[];
23
+ };
24
+ accessibility: string[];
25
+ };
@@ -0,0 +1,21 @@
1
+ /** Usage guidance for TokenPickerDialog. */
2
+ export declare const doc: {
3
+ category: "Overlays";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: {
15
+ name: string;
16
+ required: true;
17
+ description: string;
18
+ }[];
19
+ };
20
+ accessibility: string[];
21
+ };
@@ -117,7 +117,7 @@ export type TransferPickerProps<V extends string> = Pick<LoadMoreOptions, "onLoa
117
117
  readonly error?: string | undefined;
118
118
  };
119
119
  /**
120
- * Picks options in two columns of one frame, as fe-app's target selection: a header strip with
120
+ * Picks options in two columns of one frame: a header strip with
121
121
  * the search (and the host's controls) over the options to tick, and the host's controls with
122
122
  * "Remove all" over the picked ones in framed rows with a remove button. Searching matches every
123
123
  * word, in any case; it stays cheap for thousands of options, and a new search scrolls the
@@ -0,0 +1,29 @@
1
+ /** Usage guidance for TransferPicker. */
2
+ export declare const doc: {
3
+ category: "Selection";
4
+ keywords: string[];
5
+ related: {
6
+ name: string;
7
+ when: string;
8
+ }[];
9
+ usage: {
10
+ description: string;
11
+ bestPractices: ({
12
+ guidance: true;
13
+ description: string;
14
+ } | {
15
+ guidance: false;
16
+ description: string;
17
+ })[];
18
+ anatomy: ({
19
+ name: string;
20
+ required: true;
21
+ description: string;
22
+ } | {
23
+ name: string;
24
+ required: false;
25
+ description: string;
26
+ })[];
27
+ };
28
+ accessibility: string[];
29
+ };
@@ -0,0 +1,25 @@
1
+ /** Usage guidance for TreeSearchPanel. */
2
+ export declare const doc: {
3
+ category: "Selection";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ anatomy: ({
15
+ name: string;
16
+ required: true;
17
+ description: string;
18
+ } | {
19
+ name: string;
20
+ required: false;
21
+ description: string;
22
+ })[];
23
+ };
24
+ accessibility: string[];
25
+ };
@@ -62,7 +62,7 @@ export type TreeSelectProps = Pick<LoadMoreOptions, "onLoadMore" | "hasMore" | "
62
62
  readonly isLoading?: boolean | undefined;
63
63
  /** The trigger's width, in pixels or any CSS length such as `"100%"`; as wide as its content without it. */
64
64
  readonly width?: number | string | undefined;
65
- /** The trigger's size, `md` by default (30px, as fe-app's controls). */
65
+ /** The trigger's size, `md` by default (the theme's 30px control height). */
66
66
  readonly size?: "sm" | "md" | undefined;
67
67
  /** Dims the trigger and blocks it. */
68
68
  readonly isDisabled?: boolean | undefined;
@@ -78,8 +78,8 @@ export type TreeSelectProps = Pick<LoadMoreOptions, "onLoadMore" | "hasMore" | "
78
78
  readonly startAddon?: ReactNode;
79
79
  };
80
80
  /**
81
- * A Selector-like trigger opening a popover with a search box over a two-level tree, as fe-app's
82
- * `UISelectCondition use="tree"`: a group row (its chevron at the end) only opens and closes, a
81
+ * A Selector-like trigger opening a popover with a search box over a two-level tree:
82
+ * a group row (its chevron at the end) only opens and closes, a
83
83
  * leaf is picked and closes the popover, a disabled row is not picked. The search keeps a leaf
84
84
  * whose label matches and a group whose label or a child's matches, with only its matching
85
85
  * children, every group open; with `onSearchChange` the host searches instead. With
@@ -0,0 +1,29 @@
1
+ /** Usage guidance for TreeSelect. */
2
+ export declare const doc: {
3
+ category: "Selection";
4
+ keywords: string[];
5
+ related: {
6
+ name: string;
7
+ when: string;
8
+ }[];
9
+ usage: {
10
+ description: string;
11
+ bestPractices: ({
12
+ guidance: true;
13
+ description: string;
14
+ } | {
15
+ guidance: false;
16
+ description: string;
17
+ })[];
18
+ anatomy: ({
19
+ name: string;
20
+ required: true;
21
+ description: string;
22
+ } | {
23
+ name: string;
24
+ required: false;
25
+ description: string;
26
+ })[];
27
+ };
28
+ accessibility: string[];
29
+ };
@@ -0,0 +1,15 @@
1
+ /** Usage guidance for AntsomiTheme. */
2
+ export declare const doc: {
3
+ category: "Theme";
4
+ keywords: string[];
5
+ usage: {
6
+ description: string;
7
+ bestPractices: ({
8
+ guidance: true;
9
+ description: string;
10
+ } | {
11
+ guidance: false;
12
+ description: string;
13
+ })[];
14
+ };
15
+ };
@@ -0,0 +1,22 @@
1
+ // src/theme/AntsomiTheme.doc.ts
2
+ var e = {
3
+ category: "Theme",
4
+ keywords: [
5
+ "theme",
6
+ "provider",
7
+ "tokens",
8
+ "icons",
9
+ "mode"
10
+ ],
11
+ usage: {
12
+ description: "Apply the Antsomi base theme to a subtree and forward Astryx's light, dark or system mode. Extend antsomiTheme with defineTheme and pass the result through theme for a scoped override.",
13
+ bestPractices: [{
14
+ guidance: !0,
15
+ description: "Import @antscorp/ui/theme.css separately and load Roboto in the host; nest providers when an override should affect only a subtree."
16
+ }, {
17
+ guidance: !1,
18
+ description: "Do not expect the provider to load CSS or fonts, or replace theme tokens with hard-coded colors in consuming views."
19
+ }]
20
+ }
21
+ };
22
+ export { e as doc };
package/package.json CHANGED
@@ -1,16 +1,20 @@
1
1
  {
2
2
  "name": "@antscorp/ui",
3
- "version": "0.1.1",
4
- "description": "Generic UI kit: atoms, molecules and organisms over Astryx, with no MarketingHub words.",
3
+ "version": "0.1.3",
4
+ "description": "Generic UI kit: atoms, molecules and organisms over Astryx.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://bitbucket.org/git-vn/at.antsomi-ui.git",
9
9
  "directory": "packages/ui"
10
10
  },
11
+ "bin": {
12
+ "antscorp-ui": "./dist/cli.js"
13
+ },
11
14
  "files": [
12
15
  "dist",
13
16
  "src",
17
+ "!src/cli/**",
14
18
  "!src/**/*.test.*",
15
19
  "!src/**/*.stories.*",
16
20
  "!src/**/__snapshots__/**",
@@ -37,6 +41,11 @@
37
41
  "types": "./dist/astryx/*.d.ts",
38
42
  "default": "./dist/astryx/*.js"
39
43
  },
44
+ "./doc": {
45
+ "antscorp-source": "./src/doc/schema.ts",
46
+ "types": "./dist/doc/schema.d.ts",
47
+ "default": "./dist/doc/schema.js"
48
+ },
40
49
  "./stylex": {
41
50
  "antscorp-source": "./src/stylex.ts",
42
51
  "types": "./dist/stylex.d.ts",
@@ -89,19 +98,21 @@
89
98
  "astryx:reexports": "bun scripts/astryx-reexports.ts",
90
99
  "test": "bun scripts/astryx-reexports.ts --check && vitest run && AUI_REACT_COMPILER=off vitest run --coverage",
91
100
  "typecheck": "tsc -p .",
92
- "build": "vite build --config vite.build.ts && tsc -p tsconfig.build.json && bun scripts/build-declarations.ts"
101
+ "build": "vite build --config vite.build.ts && tsc -p tsconfig.build.json && bun scripts/build-declarations.ts && node ../../tools/component-catalog/src/main.ts . && bun build src/cli/main.ts --target=node --outfile=dist/cli.js"
93
102
  },
94
103
  "dependencies": {
95
- "@antscorp/astryx-theme-antsomi": "0.1.1",
104
+ "@antscorp/astryx-theme-antsomi": "0.1.3",
96
105
  "@antscorp/immutable": "0.1.0",
97
106
  "@astryxdesign/core": "0.7.4",
98
107
  "@codemirror/state": "6.7.6",
99
108
  "@codemirror/view": "6.43.14",
100
109
  "@stylexjs/stylex": "0.19.1",
101
- "spin-delay": "2.0.1"
110
+ "spin-delay": "2.0.1",
111
+ "zod": "4.6.5"
102
112
  },
103
113
  "devDependencies": {
104
- "@antscorp/vite-stylex": "0.1.1",
114
+ "@antscorp/component-catalog": "0.1.0",
115
+ "@antscorp/vite-stylex": "0.1.3",
105
116
  "@storybook/react-vite": "10.6.1",
106
117
  "@testing-library/dom": "10.4.2",
107
118
  "@testing-library/react": "16.3.3",
@@ -0,0 +1,36 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for AddButton. */
4
+ export const doc = {
5
+ category: "Inputs",
6
+ keywords: ["add", "button", "list", "plus"],
7
+ usage: {
8
+ description:
9
+ "Add a row or item with a labeled plus button. Use TextAction for an action that does not need the add glyph.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep label specific about what will be added and let the host update the list in onClick.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not expect the button to add data itself; isReadOnly hides the entire editing affordance.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Plus",
25
+ required: true,
26
+ description: "The theme's ui:add glyph, sized with the button.",
27
+ },
28
+ {
29
+ name: "Label",
30
+ required: true,
31
+ description: "The translated action text, optionally shown in capitals.",
32
+ },
33
+ ],
34
+ },
35
+ accessibility: ["The button is named by label; uppercase presentation preserves that name."],
36
+ } satisfies ComponentDoc;
@@ -15,7 +15,7 @@ export type AddButtonProps = {
15
15
  readonly size?: "sm" | "md" | undefined;
16
16
  /** `default` keeps the button's own corners; `pill` rounds them fully; the theme colours its outline. */
17
17
  readonly shape?: "default" | "pill" | undefined;
18
- /** `sentence` (default) shows the label as given; `upper` in capitals, as fe-app's "+ AND". */
18
+ /** `sentence` (default) shows the label as given; `upper` in capitals, such as "+ AND". */
19
19
  readonly case?: "sentence" | "upper" | undefined;
20
20
  /** Dimmed and not pressable, e.g. when a limit is reached. */
21
21
  readonly isDisabled?: boolean | undefined;
@@ -0,0 +1,26 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for AddGlyph. */
4
+ export const doc = {
5
+ category: "Data display",
6
+ keywords: ["plus", "glyph", "icon", "add"],
7
+ usage: {
8
+ description:
9
+ "Draw the theme's decorative plus inside a custom add control. Use AddButton when a complete labeled action is needed.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Match size to the containing button and provide its action label on that button.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not use the glyph alone as an action or expect it to draw in a theme without ui:add.",
20
+ },
21
+ ],
22
+ },
23
+ accessibility: [
24
+ "The glyph is decorative and hidden from assistive technology; the containing button supplies the name.",
25
+ ],
26
+ } satisfies ComponentDoc;
@@ -0,0 +1,45 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for Chip. */
4
+ export const doc = {
5
+ category: "Data display",
6
+ keywords: ["pill", "picked value", "remove"],
7
+ related: [
8
+ {
9
+ name: "astryx/Badge",
10
+ when: "Show an informational status or category rather than a removable picked value.",
11
+ },
12
+ ],
13
+ usage: {
14
+ description:
15
+ "Show one picked value in a compact pill. Supply onRemove and labels.remove together to offer removal; the host owns the picked values.",
16
+ bestPractices: [
17
+ {
18
+ guidance: true,
19
+ description:
20
+ "Use a short, recognizable label and provide a translated remove label naming the value.",
21
+ },
22
+ {
23
+ guidance: false,
24
+ description:
25
+ "Do not use colour alone to explain why a value is invalid; provide surrounding validation text.",
26
+ },
27
+ ],
28
+ anatomy: [
29
+ {
30
+ name: "Label",
31
+ required: true,
32
+ description: "The picked value, truncated with a tooltip when needed.",
33
+ },
34
+ {
35
+ name: "Remove button",
36
+ required: false,
37
+ description: "Removes the value; hidden in read-only mode.",
38
+ },
39
+ ],
40
+ },
41
+ accessibility: [
42
+ "Name the remove action through labels.remove.",
43
+ "Hover removal also appears on keyboard focus; keep the action reachable with Tab.",
44
+ ],
45
+ } satisfies ComponentDoc;
@@ -103,7 +103,7 @@ export function Chip(props: ChipProps): ReactNode {
103
103
  const marker = stylex.defaultMarker();
104
104
 
105
105
  const styles = stylex.create({
106
- // fe-app's chip (ItemPreviewSource): a pill as high as the controls, 10px either side (no
106
+ // A pill as high as the controls, 10px either side (no
107
107
  // spacing step is 10px), in 12px body text of the normal weight. An xstyle, not a `token` theme entry: Token is also
108
108
  // drawn by ChipListAddPopover's unframed list in Astryx's own look, which a theme entry would change.
109
109
  chip: {
@@ -120,7 +120,7 @@ const styles = stylex.create({
120
120
  backgroundColor: "var(--ants-mh-blue-200)",
121
121
  color: colorVars["--color-text-primary"],
122
122
  },
123
- // fe-app's: a 16px white circle over the chip's end (Token's own remove button is 16px too).
123
+ // A 16px white circle over the chip's end (Token's own remove button is 16px too).
124
124
  hoverRemove: {
125
125
  position: "absolute",
126
126
  insetInlineEnd: spacingVars["--spacing-1"],
@@ -0,0 +1,31 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for ChipSkeletons. */
4
+ export const doc = {
5
+ category: "Feedback",
6
+ keywords: ["loading", "skeleton", "chips", "placeholder"],
7
+ usage: {
8
+ description:
9
+ "Reserve the shape of picked values while their labels load. Use RowSkeletons for a vertical options list.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Match count, size and shape to the values being loaded, and supply label for the loading status.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description:
19
+ "Do not replace already known labels with skeletons unless the whole list is being reloaded.",
20
+ },
21
+ ],
22
+ anatomy: [
23
+ {
24
+ name: "Chip bars",
25
+ required: true,
26
+ description: "A row of rounded shimmer bars with varied widths.",
27
+ },
28
+ ],
29
+ },
30
+ accessibility: ["The wrapper has role status and uses label as its accessible name."],
31
+ } satisfies ComponentDoc;
@@ -0,0 +1,22 @@
1
+ import type { ComponentDoc } from "../doc/schema";
2
+
3
+ /** Usage guidance for FieldHeading. */
4
+ export const doc = {
5
+ category: "Data display",
6
+ keywords: ["heading", "caption", "field"],
7
+ usage: {
8
+ description:
9
+ "Show a separate supporting caption above controls whose own labels are hidden. Use FieldRow when the form needs a caption column beside its controls.",
10
+ bestPractices: [
11
+ {
12
+ guidance: true,
13
+ description:
14
+ "Keep each control's own accessible label even when FieldHeading supplies the visible caption.",
15
+ },
16
+ {
17
+ guidance: false,
18
+ description: "Do not treat this text as a label association or a semantic heading element.",
19
+ },
20
+ ],
21
+ },
22
+ } satisfies ComponentDoc;