@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.
- package/README.md +1 -1
- package/dist/atoms/AddButton.d.ts +1 -1
- package/dist/atoms/AddButton.doc.d.ts +21 -0
- package/dist/atoms/AddGlyph.doc.d.ts +16 -0
- package/dist/atoms/Chip.doc.d.ts +29 -0
- package/dist/atoms/ChipSkeletons.doc.d.ts +21 -0
- package/dist/atoms/FieldHeading.doc.d.ts +15 -0
- package/dist/atoms/HoverSwap.doc.d.ts +25 -0
- package/dist/atoms/InfoTip.doc.d.ts +25 -0
- package/dist/atoms/InfoTip.js +2 -0
- package/dist/atoms/JointLabel.doc.d.ts +15 -0
- package/dist/atoms/LabeledDivider.d.ts +1 -1
- package/dist/atoms/LabeledDivider.doc.d.ts +21 -0
- package/dist/atoms/LogoImage.doc.d.ts +21 -0
- package/dist/atoms/PanelSearchInput.d.ts +1 -1
- package/dist/atoms/PanelSearchInput.doc.d.ts +25 -0
- package/dist/atoms/PathMark.doc.d.ts +16 -0
- package/dist/atoms/RemoveButton.doc.d.ts +16 -0
- package/dist/atoms/RowSkeletons.doc.d.ts +25 -0
- package/dist/atoms/TextAction.d.ts +3 -3
- package/dist/atoms/TextAction.doc.d.ts +25 -0
- package/dist/atoms/TruncatedOption.d.ts +1 -1
- package/dist/atoms/TruncatedOption.doc.d.ts +24 -0
- package/dist/atoms/TruncatedText.doc.d.ts +15 -0
- package/dist/cli.js +248 -0
- package/dist/doc/schema.d.ts +34 -0
- package/dist/doc/schema.js +33 -0
- package/dist/docs.json +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +53 -51
- package/dist/lib/useLoadingShown.d.ts +1 -1
- package/dist/molecules/AccentCard.d.ts +2 -3
- package/dist/molecules/AccentCard.doc.d.ts +25 -0
- package/dist/molecules/CheckGroup.doc.d.ts +25 -0
- package/dist/molecules/CheckRow.d.ts +1 -1
- package/dist/molecules/CheckRow.doc.d.ts +25 -0
- package/dist/molecules/ChoiceDialog.doc.d.ts +21 -0
- package/dist/molecules/ChoiceTiles.d.ts +1 -1
- package/dist/molecules/ChoiceTiles.doc.d.ts +21 -0
- package/dist/molecules/CommitTextField.doc.d.ts +29 -0
- package/dist/molecules/ConfirmDialog.doc.d.ts +21 -0
- package/dist/molecules/DateTimeInput.doc.d.ts +25 -0
- package/dist/molecules/DurationInput.doc.d.ts +25 -0
- package/dist/molecules/FieldGroup.d.ts +1 -1
- package/dist/molecules/FieldGroup.doc.d.ts +25 -0
- package/dist/molecules/FieldRow.d.ts +1 -1
- package/dist/molecules/FieldRow.doc.d.ts +24 -0
- package/dist/molecules/FieldSkeleton.doc.d.ts +25 -0
- package/dist/molecules/FrequencyLimitRow.doc.d.ts +25 -0
- package/dist/molecules/InlineEditableText.doc.d.ts +25 -0
- package/dist/molecules/LoadMoreRow.doc.d.ts +21 -0
- package/dist/molecules/LoadState.doc.d.ts +21 -0
- package/dist/molecules/MetaTable.d.ts +1 -1
- package/dist/molecules/MetaTable.doc.d.ts +25 -0
- package/dist/molecules/PercentRow.doc.d.ts +25 -0
- package/dist/molecules/PhoneFrame.d.ts +1 -1
- package/dist/molecules/PhoneFrame.doc.d.ts +21 -0
- package/dist/molecules/ProblemsButton.doc.d.ts +25 -0
- package/dist/molecules/RemovableRow.d.ts +1 -1
- package/dist/molecules/RemovableRow.doc.d.ts +25 -0
- package/dist/molecules/RevealRadioGroup.doc.d.ts +25 -0
- package/dist/molecules/RevealSwitch.doc.d.ts +25 -0
- package/dist/molecules/RuleRow.doc.d.ts +25 -0
- package/dist/molecules/Select.d.ts +2 -2
- package/dist/molecules/Select.doc.d.ts +30 -0
- package/dist/molecules/Select.js +27 -27
- package/dist/molecules/SideLabelRow.d.ts +1 -1
- package/dist/molecules/SideLabelRow.doc.d.ts +20 -0
- package/dist/molecules/SplitButton.d.ts +1 -1
- package/dist/molecules/SplitButton.doc.d.ts +25 -0
- package/dist/molecules/StatusButton.doc.d.ts +25 -0
- package/dist/molecules/TagSelect.d.ts +2 -2
- package/dist/molecules/TagSelect.doc.d.ts +25 -0
- package/dist/molecules/ToggleGrid.doc.d.ts +25 -0
- package/dist/molecules/TokenTextField.doc.d.ts +29 -0
- package/dist/molecules/TransferLayout.d.ts +1 -1
- package/dist/molecules/TransferLayout.doc.d.ts +25 -0
- package/dist/molecules/TreeOptions.d.ts +1 -1
- package/dist/molecules/TreeOptions.doc.d.ts +25 -0
- package/dist/organisms/ChipListAddPopover.doc.d.ts +25 -0
- package/dist/organisms/HourOfDayRow.doc.d.ts +25 -0
- package/dist/organisms/HourOfWeekGrid.doc.d.ts +25 -0
- package/dist/organisms/RepeatableList.doc.d.ts +21 -0
- package/dist/organisms/ResizableDrawer.doc.d.ts +25 -0
- package/dist/organisms/RuleGroups.d.ts +3 -3
- package/dist/organisms/RuleGroups.doc.d.ts +21 -0
- package/dist/organisms/RuleList.doc.d.ts +25 -0
- package/dist/organisms/SearchableGroupedList.d.ts +1 -1
- package/dist/organisms/SearchableGroupedList.doc.d.ts +25 -0
- package/dist/organisms/TokenPickerDialog.doc.d.ts +21 -0
- package/dist/organisms/TransferPicker.d.ts +1 -1
- package/dist/organisms/TransferPicker.doc.d.ts +29 -0
- package/dist/organisms/TreeSearchPanel.doc.d.ts +25 -0
- package/dist/organisms/TreeSelect.d.ts +3 -3
- package/dist/organisms/TreeSelect.doc.d.ts +29 -0
- package/dist/theme/AntsomiTheme.doc.d.ts +15 -0
- package/dist/theme/AntsomiTheme.doc.js +22 -0
- package/package.json +17 -6
- package/src/atoms/AddButton.doc.ts +36 -0
- package/src/atoms/AddButton.tsx +1 -1
- package/src/atoms/AddGlyph.doc.ts +26 -0
- package/src/atoms/Chip.doc.ts +45 -0
- package/src/atoms/Chip.tsx +2 -2
- package/src/atoms/ChipSkeletons.doc.ts +31 -0
- package/src/atoms/FieldHeading.doc.ts +22 -0
- package/src/atoms/HoverSwap.doc.ts +39 -0
- package/src/atoms/InfoTip.doc.ts +37 -0
- package/src/atoms/InfoTip.tsx +2 -2
- package/src/atoms/JointLabel.doc.ts +23 -0
- package/src/atoms/LabeledDivider.doc.ts +35 -0
- package/src/atoms/LabeledDivider.tsx +1 -1
- package/src/atoms/LogoImage.doc.ts +42 -0
- package/src/atoms/PanelSearchInput.doc.ts +41 -0
- package/src/atoms/PanelSearchInput.tsx +1 -1
- package/src/atoms/PathMark.doc.ts +25 -0
- package/src/atoms/RemoveButton.doc.ts +26 -0
- package/src/atoms/RowSkeletons.doc.ts +43 -0
- package/src/atoms/TextAction.doc.ts +40 -0
- package/src/atoms/TextAction.tsx +4 -4
- package/src/atoms/TruncatedOption.doc.ts +39 -0
- package/src/atoms/TruncatedOption.tsx +1 -1
- package/src/atoms/TruncatedText.doc.ts +22 -0
- package/src/doc/schema.ts +67 -0
- package/src/index.ts +2 -0
- package/src/lib/useLoadMore.ts +1 -2
- package/src/lib/useLoadingShown.ts +1 -1
- package/src/molecules/AccentCard.doc.ts +43 -0
- package/src/molecules/AccentCard.tsx +7 -8
- package/src/molecules/CheckGroup.doc.ts +40 -0
- package/src/molecules/CheckRow.doc.ts +43 -0
- package/src/molecules/CheckRow.tsx +1 -1
- package/src/molecules/ChoiceDialog.doc.ts +48 -0
- package/src/molecules/ChoiceTiles.doc.ts +42 -0
- package/src/molecules/ChoiceTiles.tsx +3 -3
- package/src/molecules/CommitTextField.doc.ts +41 -0
- package/src/molecules/ConfirmDialog.doc.ts +43 -0
- package/src/molecules/DateTimeInput.doc.ts +48 -0
- package/src/molecules/DurationInput.doc.ts +36 -0
- package/src/molecules/DurationInput.tsx +2 -2
- package/src/molecules/FieldGroup.doc.ts +41 -0
- package/src/molecules/FieldGroup.tsx +1 -1
- package/src/molecules/FieldRow.doc.ts +36 -0
- package/src/molecules/FieldRow.tsx +1 -1
- package/src/molecules/FieldSkeleton.doc.ts +38 -0
- package/src/molecules/FrequencyLimitRow.doc.ts +48 -0
- package/src/molecules/FrequencyLimitRow.tsx +1 -1
- package/src/molecules/InlineEditableText.doc.ts +41 -0
- package/src/molecules/LoadMoreRow.doc.ts +36 -0
- package/src/molecules/LoadState.doc.ts +42 -0
- package/src/molecules/MetaTable.doc.ts +46 -0
- package/src/molecules/MetaTable.tsx +1 -1
- package/src/molecules/PercentRow.doc.ts +48 -0
- package/src/molecules/PhoneFrame.doc.ts +46 -0
- package/src/molecules/PhoneFrame.tsx +2 -2
- package/src/molecules/ProblemsButton.doc.ts +41 -0
- package/src/molecules/RemovableRow.doc.ts +48 -0
- package/src/molecules/RemovableRow.tsx +2 -2
- package/src/molecules/RevealRadioGroup.doc.ts +41 -0
- package/src/molecules/RevealSwitch.doc.ts +38 -0
- package/src/molecules/RuleRow.doc.ts +43 -0
- package/src/molecules/Select.doc.ts +62 -0
- package/src/molecules/Select.tsx +2 -2
- package/src/molecules/SideLabelRow.doc.ts +35 -0
- package/src/molecules/SideLabelRow.tsx +2 -2
- package/src/molecules/SplitButton.doc.ts +41 -0
- package/src/molecules/SplitButton.tsx +1 -1
- package/src/molecules/StatusButton.doc.ts +39 -0
- package/src/molecules/TagSelect.doc.ts +41 -0
- package/src/molecules/TagSelect.tsx +5 -5
- package/src/molecules/ToggleGrid.doc.ts +43 -0
- package/src/molecules/TokenTextField.doc.ts +41 -0
- package/src/molecules/TransferLayout.doc.ts +42 -0
- package/src/molecules/TransferLayout.tsx +2 -3
- package/src/molecules/TreeOptions.doc.ts +38 -0
- package/src/molecules/TreeOptions.tsx +6 -6
- package/src/organisms/ChipListAddPopover.doc.ts +54 -0
- package/src/organisms/HourOfDayRow.doc.ts +43 -0
- package/src/organisms/HourOfDayRow.tsx +1 -1
- package/src/organisms/HourOfWeekGrid.doc.ts +48 -0
- package/src/organisms/HourOfWeekGrid.tsx +1 -1
- package/src/organisms/RepeatableList.doc.ts +49 -0
- package/src/organisms/ResizableDrawer.doc.ts +48 -0
- package/src/organisms/RuleGroups.doc.ts +49 -0
- package/src/organisms/RuleGroups.tsx +3 -3
- package/src/organisms/RuleList.doc.ts +43 -0
- package/src/organisms/SearchableGroupedList.doc.ts +49 -0
- package/src/organisms/SearchableGroupedList.tsx +2 -2
- package/src/organisms/TokenPickerDialog.doc.ts +54 -0
- package/src/organisms/TransferPicker.doc.ts +69 -0
- package/src/organisms/TransferPicker.tsx +3 -3
- package/src/organisms/TreeSearchPanel.doc.ts +43 -0
- package/src/organisms/TreeSearchPanel.tsx +1 -1
- package/src/organisms/TreeSelect.doc.ts +56 -0
- package/src/organisms/TreeSelect.tsx +4 -4
- package/src/theme/AntsomiTheme.doc.ts +23 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for RuleGroups. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Inputs",
|
|
6
|
+
keywords: ["rules", "groups", "conditions", "and", "or"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Edit alternative groups of rules, where all rules in one group must hold. Use RuleList for a single flat conjunction of rules.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Keep groups controlled and configure controls returned by renderRule for the same disabled or read-only state as the groups.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect a disabled add at maxRules or maxGroups; this view hides adds at their limits and protects the final rule from removal.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Rule cards",
|
|
25
|
+
required: false,
|
|
26
|
+
description:
|
|
27
|
+
"Titled accent cards containing host controls and optional close actions when groups contain rules.",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "And joints",
|
|
31
|
+
required: false,
|
|
32
|
+
description: "Words and add-rule buttons within each group.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Or dividers",
|
|
36
|
+
required: false,
|
|
37
|
+
description: "Dashed separators and the add-group action.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "Error",
|
|
41
|
+
required: false,
|
|
42
|
+
description: "A translated problem with all groups.",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
accessibility: [
|
|
47
|
+
"label names the whole group and labels.remove names rule-card close actions; supplied controls keep their own labels.",
|
|
48
|
+
],
|
|
49
|
+
} satisfies ComponentDoc;
|
|
@@ -55,11 +55,11 @@ export type RuleGroupsProps<R> = {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Rules in groups
|
|
58
|
+
* Rules in groups: each rule a card with an accent stripe, a title
|
|
59
59
|
* and a close button; the word "and" under each card but a group's last, and a pill button adding
|
|
60
60
|
* a rule at the end of the group; a dashed divider with "or" between groups, and a pill button
|
|
61
|
-
* adding a group after the last; each word in capitals
|
|
62
|
-
* `maxGroups`) is
|
|
61
|
+
* adding a group after the last; each word in capitals. Unlike a list's add, an add at its limit (`maxRules`,
|
|
62
|
+
* `maxGroups`) is hidden. The only rule left has no close button, so the groups are
|
|
63
63
|
* never emptied from here; with no group at all only the button adding one shows. It holds no
|
|
64
64
|
* state.
|
|
65
65
|
*/
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for RuleList. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Inputs",
|
|
6
|
+
keywords: ["rules", "list", "conditions", "joint"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Edit rules that all must hold, with one joining word on the first row and another on later rows. Use RuleGroups when alternatives need separate groups of rule cards.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Provide stable itemKey values and pass the list's size and lock state to controls returned by renderControls.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect isReadOnly to change host-rendered controls; it hides the list's add and remove actions.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Rule rows",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "RuleRow controls with first/rest joint labels and removal actions.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Add row",
|
|
30
|
+
required: false,
|
|
31
|
+
description: "An optional add action, with a joint when hasAddJoint is enabled.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Feedback",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "Empty, maximum and validation messages.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
accessibility: [
|
|
41
|
+
"label names the list; labels.remove and labels.add name editing actions, and each supplied control needs its own label.",
|
|
42
|
+
],
|
|
43
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for SearchableGroupedList. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Selection",
|
|
6
|
+
keywords: ["search", "groups", "list", "tiles"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Browse host-rendered items in titled groups, filtering locally as text is typed. Use TreeSelect when the result must be a single leaf chosen from two-level groups.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Provide stable group keys and globally unique item keys; use itemText for the text to match and placeholder for independently loading groups.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect isDisabled to block host-rendered item actions; it only affects the uncapped list's search control.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Search",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "The local query input with clear action.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Group headings",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "Titles, optionally toggling collapsed groups.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Items",
|
|
35
|
+
required: true,
|
|
36
|
+
description:
|
|
37
|
+
"Host rows or three-column tiles, replaced by group placeholders when supplied.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "No-match message",
|
|
41
|
+
required: false,
|
|
42
|
+
description: "Shown when there are no matching items.",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
accessibility: [
|
|
47
|
+
"Supply labels.search and labels.clear, and scroll.label when using a scrolling region; item renderers supply their own accessible controls.",
|
|
48
|
+
],
|
|
49
|
+
} satisfies ComponentDoc;
|
|
@@ -66,7 +66,7 @@ export type SearchableGroupedListProps<I> = {
|
|
|
66
66
|
/**
|
|
67
67
|
* Caps the height, the groups scrolling under the search box, in a pop-over say; with no
|
|
68
68
|
* `maxHeight` it fills its parent's height, in a side panel say. The list then pads its own edges,
|
|
69
|
-
* so the search row (its magnifier at the end
|
|
69
|
+
* so the search row (its magnifier at the end) and the rule under it reach the
|
|
70
70
|
* edges of a flush (unpadded) surface, and so does the scrollbar.
|
|
71
71
|
*/
|
|
72
72
|
readonly scroll?: { readonly maxHeight?: number | undefined; readonly label: string } | undefined;
|
|
@@ -271,7 +271,7 @@ const styles = stylex.create({
|
|
|
271
271
|
framed: { minHeight: 0 },
|
|
272
272
|
capped: (maxHeight: number) => ({ maxHeight }),
|
|
273
273
|
scroll: { minHeight: 0 },
|
|
274
|
-
// A folding group's row
|
|
274
|
+
// A folding group's row: 10px sides, 36px high when folded.
|
|
275
275
|
fold: { paddingInline: 10, paddingBlock: 6 },
|
|
276
276
|
flush: { marginInline: -10 },
|
|
277
277
|
title: { fontSize: typeScaleVars["--text-label-size"] },
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for TokenPickerDialog. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Overlays",
|
|
6
|
+
keywords: ["token", "picker", "definition", "dialog"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Compose a token definition from a group, a leaf, a display name and fallback text. Use TokenTextField to edit the resulting raw token string inline.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Keep the definition controlled and reset its draft and items when onGroupChange selects a different group.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect confirmation while loading, without a picked item or with a blank display name; read-only mode hides confirmation.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Dialog heading",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "The supplied title.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Group and item selectors",
|
|
30
|
+
required: true,
|
|
31
|
+
description:
|
|
32
|
+
"A group choice and a searchable flat or two-level leaf choice, with a loading skeleton when needed.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Fallback text",
|
|
36
|
+
required: true,
|
|
37
|
+
description: "The controlled defaultValue field.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "Display name",
|
|
41
|
+
required: true,
|
|
42
|
+
description: "A required name, defaulted from the picked leaf until customized.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "Actions",
|
|
46
|
+
required: true,
|
|
47
|
+
description: "Cancel and, when editable, Insert or Save according to mode.",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
accessibility: [
|
|
52
|
+
"Provide the translated group, item, displayName and defaultValue field labels; the dialog uses Astryx Dialog behavior.",
|
|
53
|
+
],
|
|
54
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for TransferPicker. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Selection",
|
|
6
|
+
keywords: ["transfer", "multiple", "picked", "paging"],
|
|
7
|
+
related: [
|
|
8
|
+
{
|
|
9
|
+
name: "ChipListAddPopover",
|
|
10
|
+
when: "Use compact removable chips and apply checkbox changes as one draft.",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
usage: {
|
|
14
|
+
description:
|
|
15
|
+
"Pick several options in two columns, keeping available rows and removable picks visible together. Use ChipListAddPopover when a compact chip list with an Apply draft is more appropriate.",
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{
|
|
18
|
+
guidance: true,
|
|
19
|
+
description:
|
|
20
|
+
"Supply labels.loadMoreError, labels.retry and onRetryLoadMore together for paging recovery. The error pauses automatic loading; clear it and set isLoadingMore while retrying, then update options and hasMore after success.",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
guidance: false,
|
|
24
|
+
description:
|
|
25
|
+
"Do not treat select-all as only adding visible rows: when picks already exist, it clears the entire selection, including unknown picks.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
guidance: true,
|
|
29
|
+
description:
|
|
30
|
+
"Supply pickedOptions or pickedLabels for values absent from the loaded options and use onSearchChange when the host performs search.",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
guidance: false,
|
|
34
|
+
description:
|
|
35
|
+
"Do not replace the current pick with only the visible options after search or paging; unknown picks are intentionally retained.",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
anatomy: [
|
|
39
|
+
{
|
|
40
|
+
name: "Available column",
|
|
41
|
+
required: true,
|
|
42
|
+
description: "Search, a title and checkbox rows, with optional details and select-all.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "Picked column",
|
|
46
|
+
required: true,
|
|
47
|
+
description: "Framed picked rows with optional remove-all and row actions.",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Loading and paging rows",
|
|
51
|
+
required: false,
|
|
52
|
+
description: "Skeletons or a failed-page retry row that preserve loaded content.",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "Host slots",
|
|
56
|
+
required: false,
|
|
57
|
+
description: "Toolbar, end header and footer content.",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "Error",
|
|
61
|
+
required: false,
|
|
62
|
+
description: "A translated selection problem below the picker.",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
accessibility: [
|
|
67
|
+
"Supply search, clearSearch, picked and remove labels; disabled and read-only states block picking while search remains usable.",
|
|
68
|
+
],
|
|
69
|
+
} satisfies ComponentDoc;
|
|
@@ -142,7 +142,7 @@ export type TransferPickerProps<V extends string> = Pick<
|
|
|
142
142
|
const LOADING_ROWS = 6;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
|
-
* Picks options in two columns of one frame
|
|
145
|
+
* Picks options in two columns of one frame: a header strip with
|
|
146
146
|
* the search (and the host's controls) over the options to tick, and the host's controls with
|
|
147
147
|
* "Remove all" over the picked ones in framed rows with a remove button. Searching matches every
|
|
148
148
|
* word, in any case; it stays cheap for thousands of options, and a new search scrolls the
|
|
@@ -177,7 +177,7 @@ export function TransferPicker<V extends string>(props: TransferPickerProps<V>):
|
|
|
177
177
|
<HStack gap={2} align="center" justify={props.endHeader === undefined ? "end" : "between"}>
|
|
178
178
|
{props.endHeader}
|
|
179
179
|
{removeAll !== undefined && (
|
|
180
|
-
//
|
|
180
|
+
// Keep the clear action pressable while nothing is picked.
|
|
181
181
|
<TextAction
|
|
182
182
|
label={removeAll}
|
|
183
183
|
isDisabled={isDisabled}
|
|
@@ -365,7 +365,7 @@ function OptionsHeading<V extends string>(
|
|
|
365
365
|
isLabelHidden
|
|
366
366
|
isDisabled={props.isDisabled ?? false}
|
|
367
367
|
isReadOnly={props.isReadOnly ?? false}
|
|
368
|
-
//
|
|
368
|
+
// One mark for "some or all picked", and a click clears them.
|
|
369
369
|
value={props.value.length > 0 ? "indeterminate" : false}
|
|
370
370
|
onChange={props.onSelectAll}
|
|
371
371
|
/>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for TreeSearchPanel. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Selection",
|
|
6
|
+
keywords: ["tree", "search", "panel", "paging"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Compose the search and results panel used inside TreeSelect. Use TreeSelect for a complete trigger and popover around this panel.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Keep search value and selectedValue controlled, and use isSearchedByHost when items are already filtered remotely.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect the panel to close a surrounding popover after onPick; its host owns that behavior.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Search input",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "A controlled query that focuses a frame after mounting.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Results",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "TreeOptions, loading rows or a no-match message.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Paging row",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "A load-more sentinel, loading placeholders or a retry action.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
accessibility: [
|
|
41
|
+
"label names the tree and labels supplies the search and clear names; TreeOptions handles row focus and keyboard activation.",
|
|
42
|
+
],
|
|
43
|
+
} satisfies ComponentDoc;
|
|
@@ -14,7 +14,7 @@ import { LoadMoreRow } from "../molecules/LoadMoreRow";
|
|
|
14
14
|
import { matchTree, TreeOptions } from "../molecules/TreeOptions";
|
|
15
15
|
import type { TreeSelectItem, TreeSelectProps } from "./TreeSelect";
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// Cap the tree list at 200px so longer results scroll inside the panel.
|
|
18
18
|
const LIST_HEIGHT = 200;
|
|
19
19
|
|
|
20
20
|
/** What `TreeSearchPanel` takes. */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for TreeSelect. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Selection",
|
|
6
|
+
keywords: ["tree", "select", "search", "leaf"],
|
|
7
|
+
related: [
|
|
8
|
+
{ name: "Select", when: "Choose one value from flat options or sections without a tree." },
|
|
9
|
+
],
|
|
10
|
+
usage: {
|
|
11
|
+
description:
|
|
12
|
+
"Choose a single leaf through a searchable two-level tree in a popover. Use Select for a conventional flat or sectioned options list.",
|
|
13
|
+
bestPractices: [
|
|
14
|
+
{
|
|
15
|
+
guidance: true,
|
|
16
|
+
description:
|
|
17
|
+
"Supply labels.search, labels.noMatch and labels.clear for the panel. For paging recovery, supply labels.loadMoreError, labels.retry and onRetryLoadMore together; clear the error and set isLoadingMore while retrying, then update items and hasMore after success.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
guidance: true,
|
|
21
|
+
description:
|
|
22
|
+
"Keep item values unique and supply labels.value for a selected leaf that is absent from the loaded items.",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
guidance: false,
|
|
26
|
+
description:
|
|
27
|
+
"Do not expect group rows to become selected values or nesting deeper than two levels to render.",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
anatomy: [
|
|
31
|
+
{
|
|
32
|
+
name: "Trigger",
|
|
33
|
+
required: true,
|
|
34
|
+
description: "The selected label or placeholder, with loading or read-only presentation.",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "Start addon",
|
|
38
|
+
required: false,
|
|
39
|
+
description: "A separate host control sharing the frame, outside the trigger button.",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "Panel",
|
|
43
|
+
required: false,
|
|
44
|
+
description: "Search, a tree, and optional paging or retry rows while the popover is open.",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "Error",
|
|
48
|
+
required: false,
|
|
49
|
+
description: "A translated problem below the trigger.",
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
accessibility: [
|
|
54
|
+
"Supply label even when hidden; the tree supports Up and Down, Enter and Space, and Escape closes the popover.",
|
|
55
|
+
],
|
|
56
|
+
} satisfies ComponentDoc;
|
|
@@ -88,7 +88,7 @@ export type TreeSelectProps = Pick<LoadMoreOptions, "onLoadMore" | "hasMore" | "
|
|
|
88
88
|
readonly isLoading?: boolean | undefined;
|
|
89
89
|
/** The trigger's width, in pixels or any CSS length such as `"100%"`; as wide as its content without it. */
|
|
90
90
|
readonly width?: number | string | undefined;
|
|
91
|
-
/** The trigger's size, `md` by default (
|
|
91
|
+
/** The trigger's size, `md` by default (the theme's 30px control height). */
|
|
92
92
|
readonly size?: "sm" | "md" | undefined;
|
|
93
93
|
/** Dims the trigger and blocks it. */
|
|
94
94
|
readonly isDisabled?: boolean | undefined;
|
|
@@ -105,8 +105,8 @@ export type TreeSelectProps = Pick<LoadMoreOptions, "onLoadMore" | "hasMore" | "
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
* A Selector-like trigger opening a popover with a search box over a two-level tree
|
|
109
|
-
*
|
|
108
|
+
* A Selector-like trigger opening a popover with a search box over a two-level tree:
|
|
109
|
+
* a group row (its chevron at the end) only opens and closes, a
|
|
110
110
|
* leaf is picked and closes the popover, a disabled row is not picked. The search keeps a leaf
|
|
111
111
|
* whose label matches and a group whose label or a child's matches, with only its matching
|
|
112
112
|
* children, every group open; with `onSearchChange` the host searches instead. With
|
|
@@ -289,7 +289,7 @@ const styles = stylex.create({
|
|
|
289
289
|
cursor: { default: "pointer", ":disabled": "default" },
|
|
290
290
|
},
|
|
291
291
|
// With an addon the frame has the input look and lays out the addon, the line and the trigger;
|
|
292
|
-
//
|
|
292
|
+
// The tag's inset: 5px before the tag, the line 6px after it and 1px before the
|
|
293
293
|
// select (no spacing step is 5px, 6px or 1px).
|
|
294
294
|
frame: {
|
|
295
295
|
display: "flex",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for AntsomiTheme. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Theme",
|
|
6
|
+
keywords: ["theme", "provider", "tokens", "icons", "mode"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"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.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Import @antscorp/ui/theme.css separately and load Roboto in the host; nest providers when an override should affect only a subtree.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect the provider to load CSS or fonts, or replace theme tokens with hard-coded colors in consuming views.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
} satisfies ComponentDoc;
|