@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.
- 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,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
|
|
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
|
|
54
|
-
* `maxGroups`) is
|
|
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
|
|
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
|
|
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 (
|
|
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
|
|
82
|
-
*
|
|
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.
|
|
4
|
-
"description": "Generic UI kit: atoms, molecules and organisms over Astryx
|
|
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.
|
|
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/
|
|
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;
|
package/src/atoms/AddButton.tsx
CHANGED
|
@@ -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
|
|
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;
|
package/src/atoms/Chip.tsx
CHANGED
|
@@ -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
|
-
//
|
|
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
|
-
//
|
|
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;
|