@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,41 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for InlineEditableText. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Inputs",
|
|
6
|
+
keywords: ["inline", "text", "edit", "draft"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Edit a title or body text in place, committing on blur or Enter without a separate edit mode. Use CommitTextField for a conventional labeled field.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Supply both labels.edit and icons.edit to offer a pencil that focuses the input.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect a field or pencil in read-only mode; the view renders plain text with the placeholder when empty.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Text",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "A draft input, or plain text in read-only mode.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Trailing content",
|
|
30
|
+
required: false,
|
|
31
|
+
description: "The after slot between the text and pencil.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Pencil",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "A named host-supplied edit glyph shown on hover.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
accessibility: ["label names the input; labels.edit names the optional pencil button."],
|
|
41
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for LoadMoreRow. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Feedback",
|
|
6
|
+
keywords: ["pagination", "loading", "retry", "sentinel"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Finish a paged list with loading placeholders or a failed-page retry action. Use LoadState for the initial load that replaces the whole content.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Keep loaded rows above this view and attach sentinelRef to the host's load-more observer.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not pass error without onRetry and expect an error row; both are needed to show it.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Loading rows",
|
|
25
|
+
required: false,
|
|
26
|
+
description: "Two timed skeleton rows in the requested variant.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Retry row",
|
|
30
|
+
required: false,
|
|
31
|
+
description: "The translated error and retry button.",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
accessibility: ["Supply a clear translated labels.retry for the retry button."],
|
|
36
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for LoadState. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Feedback",
|
|
6
|
+
keywords: ["loading", "error", "retry", "placeholder"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Switch between a content-shaped loading placeholder, a failure with retry, and loaded children. Use LoadMoreRow for later pages so existing results can remain visible.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Choose FieldSkeleton or RowSkeletons as placeholder and give that placeholder its loading status name.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description: "Do not use a generic spinner in place of the content-shaped skeleton.",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
anatomy: [
|
|
22
|
+
{
|
|
23
|
+
name: "Placeholder",
|
|
24
|
+
required: false,
|
|
25
|
+
description: "Host-supplied skeleton content while loading.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "Error",
|
|
29
|
+
required: false,
|
|
30
|
+
description: "A failure title, optional detail and retry button.",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "Content",
|
|
34
|
+
required: false,
|
|
35
|
+
description: "The children after loading succeeds.",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
accessibility: [
|
|
40
|
+
"The placeholder names its own loading status; labels.retry names the error action.",
|
|
41
|
+
],
|
|
42
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for MetaTable. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Data display",
|
|
6
|
+
keywords: ["table", "metadata", "names", "counts"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Display a read-only list of names with an optional short-value column. Use TransferPicker when users need to edit the picked values.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Provide labels.meta to show the meta column and labels.loading when rows are loading.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect a row with error to remain a link; its name becomes plain error-toned text with an explanation.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Name column",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "A heading and names, optionally linked in a new tab.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Meta column",
|
|
30
|
+
required: false,
|
|
31
|
+
description: "Short values under labels.meta.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Problem tip",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "A warning explanation for an invalid row.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "Loading cells",
|
|
40
|
+
required: false,
|
|
41
|
+
description: "Shimmer bars in the real columns for loading rows.",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
accessibility: ["The first loading row provides the one status named by labels.loading."],
|
|
46
|
+
} satisfies ComponentDoc;
|
|
@@ -47,7 +47,7 @@ export type MetaTableProps = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* A read-only table of names and a short value each
|
|
50
|
+
* A read-only table of names and a short value each: a name
|
|
51
51
|
* column (each name a link when it has an `href`, on one line with the whole name in a tooltip when
|
|
52
52
|
* cut; a problem in the error tone with a ⚠ tip) and, with `labels.meta`, a value column at the
|
|
53
53
|
* end. A row that `isLoading` shows shimmer bars in its cells, in the table's real columns; the
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for PercentRow. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Inputs",
|
|
6
|
+
keywords: ["percent", "slider", "share", "commit"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Edit a whole percentage through a number input and a bounded slider. Dragging previews locally and reports the change only when the interaction ends.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Use onChange to store committed values and isRemoveDisabled when removal must also be blocked.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not assume isDisabled blocks removal; it locks the share while the optional remove action stays active.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Caption",
|
|
25
|
+
required: false,
|
|
26
|
+
description: "The FieldRow caption beside the controls.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Percent input",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "The controlled whole percentage.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Slider",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "A bounded percentage control with local drag preview.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "Remove button",
|
|
40
|
+
required: false,
|
|
41
|
+
description: "A named removal action supplied through onRemove.",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
accessibility: [
|
|
46
|
+
"labels.share names the controls and labels.remove names the optional remove button.",
|
|
47
|
+
],
|
|
48
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for PhoneFrame. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Layout",
|
|
6
|
+
keywords: ["phone", "preview", "device", "content"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Preview content inside a drawn phone with a status bar and titled header. Use it for a visual preview rather than interactive device navigation.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Give title a recognizable name and keep preview content readable within the scrolling body.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect the drawn back chevron or status-bar symbols to perform actions.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Device frame",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "A rounded phone outline with a camera island.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Status bar",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "Clock, signal and battery imagery.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Header",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "A back chevron, avatar and title.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "Content",
|
|
40
|
+
required: true,
|
|
41
|
+
description: "Host preview content that scrolls within the device.",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
accessibility: ["The frame is a figure named by title."],
|
|
46
|
+
} satisfies ComponentDoc;
|
|
@@ -21,7 +21,7 @@ export type PhoneFrameProps = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* A phone to preview content in,
|
|
24
|
+
* A phone frame with a branding bar to preview content in,
|
|
25
25
|
* drawn rather than pictured: a dark rounded device with a camera island, a status bar (clock,
|
|
26
26
|
* signal, battery), a header with a back chevron, the avatar and the title, and the content under
|
|
27
27
|
* it, scrolling when it is taller than the screen. As wide as its container, up to 290px, with a
|
|
@@ -77,7 +77,7 @@ export function PhoneFrame({ title, avatarSrc, labels, children }: PhoneFramePro
|
|
|
77
77
|
const BARS = ["s", "m", "l", "xl"] as const;
|
|
78
78
|
|
|
79
79
|
const styles = stylex.create({
|
|
80
|
-
//
|
|
80
|
+
// A medium frame: 290 × 600 at most. The bezel is black with a slate rim; no Astryx
|
|
81
81
|
// surface is a device, so the antsomi palette draws it.
|
|
82
82
|
device: {
|
|
83
83
|
boxSizing: "border-box",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for ProblemsButton. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Feedback",
|
|
6
|
+
keywords: ["errors", "problems", "popover", "count"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Summarize validation problems in a count button that opens a selectable list. The view renders nothing when items is empty.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Translate labels.count with the problem count and use onPick's index to locate the corresponding problem.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not assume picking a problem fixes it; the host decides how to reveal or address it.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Count button",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "An error glyph and the number of problems when there are problems.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Popover",
|
|
30
|
+
required: false,
|
|
31
|
+
description: "A titled, scrollable list built while open.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Problem actions",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "A button per problem that reports its index and closes the popover.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
accessibility: ["labels.count names the count button; title labels the problem list."],
|
|
41
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for RemovableRow. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Inputs",
|
|
6
|
+
keywords: ["picked", "row", "remove", "framed"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Show a picked value with supporting text and a remove action. Use CheckRow when the row is an option to tick instead.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Name the removal through labels.remove and use isFramed when picked values need bordered single-line rows.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect isReadOnly to hide host-supplied hover actions; the host must make those appropriate for viewing.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Text",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "The value label with an optional description.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Problem",
|
|
30
|
+
required: false,
|
|
31
|
+
description: "Validation text below an unframed row or a warning tip in a framed row.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "End content",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "Host content optionally swapped for hover actions.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "Remove button",
|
|
40
|
+
required: false,
|
|
41
|
+
description: "Removes the picked value unless read-only.",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
accessibility: [
|
|
46
|
+
"labels.remove names the remove button; name interactive host-supplied hover actions separately.",
|
|
47
|
+
],
|
|
48
|
+
} satisfies ComponentDoc;
|
|
@@ -36,7 +36,7 @@ export type RemovableRowProps = {
|
|
|
36
36
|
*/
|
|
37
37
|
readonly hoverContent?: ReactNode;
|
|
38
38
|
/**
|
|
39
|
-
* A bordered box around the row
|
|
39
|
+
* A bordered box around the row: its text on one line, the whole text
|
|
40
40
|
* in a tooltip when cut. As high as `RowSkeletons variant="framed"`.
|
|
41
41
|
*/
|
|
42
42
|
readonly isFramed?: boolean | undefined;
|
|
@@ -134,7 +134,7 @@ export function RemovableRow(props: RemovableRowProps): ReactNode {
|
|
|
134
134
|
const styles = stylex.create({
|
|
135
135
|
// The texts take the room the end content and the remove button leave, so they wrap.
|
|
136
136
|
text: { minWidth: 0, flexGrow: 1 },
|
|
137
|
-
//
|
|
137
|
+
// A picked item's frame: a 1px platinum
|
|
138
138
|
// border, 5px corners and 8px padding (the `padding` step 2).
|
|
139
139
|
frame: {
|
|
140
140
|
borderWidth: borderVars["--border-width"],
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for RevealRadioGroup. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Selection",
|
|
6
|
+
keywords: ["radio", "choice", "reveal", "details"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Choose one option and reveal only its related content below the list or beneath that option. Use RevealSwitch for a single boolean setting.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Keep value controlled and choose contentPlacement=option when each option's detail should follow its label.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect the group to make controls inside option content read-only or disabled; configure those controls in the host.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Group label",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "The group's name, optionally visually hidden.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Radio options",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "The mutually exclusive choices with optional explanatory tips.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Revealed content",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "Only the chosen option's content.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
accessibility: ["Supply label even when isLabelHidden, and clear labels for every option."],
|
|
41
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for RevealSwitch. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Selection",
|
|
6
|
+
keywords: ["switch", "boolean", "reveal", "settings"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Turn a setting on or off and reveal its controls only while it is on. Use RevealRadioGroup when choosing among several alternatives.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Keep value controlled and give the switch a label that explains what enabling it does.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not expect disabling or making the switch read-only to change the behavior of supplied children.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Switch",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "The labeled boolean control.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Content",
|
|
30
|
+
required: false,
|
|
31
|
+
description: "Host controls shown below the switch while value is true.",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
accessibility: [
|
|
36
|
+
"label names the switch; the host supplies accessible labels for revealed controls.",
|
|
37
|
+
],
|
|
38
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for RuleRow. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Inputs",
|
|
6
|
+
keywords: ["rule", "row", "joint", "remove"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Arrange a joining word, host controls and a remove button on a wrapping row. Inside RepeatableList with columns, the row uses the shared grid tracks.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Give host controls the row's size and use align=start when a control shows validation below its input.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not assume isDisabled or isReadOnly changes the supplied controls; those flags control the row's remove affordance.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Joint word",
|
|
25
|
+
required: false,
|
|
26
|
+
description: "The translated word joining this row to its predecessor.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Controls",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "Host-supplied fields, operators and values.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Remove button",
|
|
35
|
+
required: false,
|
|
36
|
+
description: "A named action, with its grid track preserved in read-only column layouts.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
accessibility: [
|
|
41
|
+
"labels.remove names the remove button; each supplied control needs its own label.",
|
|
42
|
+
],
|
|
43
|
+
} satisfies ComponentDoc;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for Select. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Selection",
|
|
6
|
+
keywords: ["choice", "options", "search"],
|
|
7
|
+
related: [
|
|
8
|
+
{ name: "TreeSelect", when: "Choose one leaf from a two-level tree." },
|
|
9
|
+
{
|
|
10
|
+
name: "ChipListAddPopover",
|
|
11
|
+
when: "Choose multiple values in a compact popover with an Apply draft.",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "TransferPicker",
|
|
15
|
+
when: "Choose multiple values with available and picked rows visible together.",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
example: "Default",
|
|
19
|
+
usage: {
|
|
20
|
+
description:
|
|
21
|
+
"Choose one value from options, optionally grouped into sections. Keep value controlled and update it through onChange. Offer onClear when the selection may be empty.",
|
|
22
|
+
bestPractices: [
|
|
23
|
+
{
|
|
24
|
+
guidance: true,
|
|
25
|
+
description:
|
|
26
|
+
"Use hasSearch for long lists and keep the known label available through labels.value while options load.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
guidance: false,
|
|
30
|
+
description:
|
|
31
|
+
"Do not supply labels.warning alongside error expecting both to appear; warning takes precedence over the validation error.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
guidance: false,
|
|
35
|
+
description:
|
|
36
|
+
"Do not disable a field merely to display its value; use isReadOnly when editing is unavailable.",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
anatomy: [
|
|
40
|
+
{
|
|
41
|
+
name: "Field label",
|
|
42
|
+
required: true,
|
|
43
|
+
description: "Names the choice even when visually hidden.",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "Trigger",
|
|
47
|
+
required: true,
|
|
48
|
+
description: "Shows the selected value or placeholder and opens the list.",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "Options",
|
|
52
|
+
required: false,
|
|
53
|
+
description:
|
|
54
|
+
"The choices, sections and optional search field, while the list is open and editable.",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
accessibility: [
|
|
59
|
+
"Always provide label, including when isLabelHidden is true.",
|
|
60
|
+
"Supply translated description and error text so the choice and its validation are clear.",
|
|
61
|
+
],
|
|
62
|
+
} satisfies ComponentDoc;
|
package/src/molecules/Select.tsx
CHANGED
|
@@ -34,7 +34,7 @@ export type SelectProps = {
|
|
|
34
34
|
readonly hasSearch?: boolean | undefined;
|
|
35
35
|
/** The trigger's look: an underlined field (`input`, the default) or a bare text button (`ghost`). */
|
|
36
36
|
readonly variant?: "input" | "ghost" | undefined;
|
|
37
|
-
/** The trigger's size, `md` by default (
|
|
37
|
+
/** The trigger's size, `md` by default (the theme's 30px control height). */
|
|
38
38
|
readonly size?: "sm" | "md" | undefined;
|
|
39
39
|
/** The trigger's width, in pixels or any CSS length such as `"100%"`. */
|
|
40
40
|
readonly width?: number | string | undefined;
|
|
@@ -69,7 +69,7 @@ export type SelectProps = {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* The kit's select
|
|
72
|
+
* The kit's select on Astryx's `Selector`: the list is as wide as the
|
|
73
73
|
* trigger (the theme) and a long option label ends in an ellipsis with the whole label in a
|
|
74
74
|
* tooltip. Every select is one rather than Astryx's `Selector` (lint-enforced). It holds no state.
|
|
75
75
|
*/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComponentDoc } from "../doc/schema";
|
|
2
|
+
|
|
3
|
+
/** Usage guidance for SideLabelRow. */
|
|
4
|
+
export const doc = {
|
|
5
|
+
category: "Layout",
|
|
6
|
+
keywords: ["card", "row", "caption", "responsive"],
|
|
7
|
+
usage: {
|
|
8
|
+
description:
|
|
9
|
+
"Place a narrow caption beside controls inside a card, with padding for the card's rows. Use FieldRow for a form section with theme-driven caption and control widths.",
|
|
10
|
+
bestPractices: [
|
|
11
|
+
{
|
|
12
|
+
guidance: true,
|
|
13
|
+
description:
|
|
14
|
+
"Keep labelWidth consistent across the card and let controls move below the caption when space runs out.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
guidance: false,
|
|
18
|
+
description:
|
|
19
|
+
"Do not treat the visual caption as an accessible label association for every supplied control.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anatomy: [
|
|
23
|
+
{
|
|
24
|
+
name: "Caption",
|
|
25
|
+
required: true,
|
|
26
|
+
description: "The narrow label column, wrapping long text.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Controls",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "Host content beside the caption or beneath it in a narrow layout.",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
} satisfies ComponentDoc;
|
|
@@ -17,7 +17,7 @@ export type SideLabelRowProps = {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* One row of a card: a narrow label column and the row's controls, padded as a card's rows are.
|
|
20
|
-
* The label sits centred on the first line of controls (`md` high,
|
|
20
|
+
* The label sits centred on the first line of controls (`md` high, the theme's 30px); where the controls would get
|
|
21
21
|
* narrower than 240px they move under the label. It holds no state.
|
|
22
22
|
*/
|
|
23
23
|
export function SideLabelRow({ label, labelWidth = 90, children }: SideLabelRowProps): ReactNode {
|
|
@@ -34,7 +34,7 @@ export function SideLabelRow({ label, labelWidth = 90, children }: SideLabelRowP
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const styles = stylex.create({
|
|
37
|
-
//
|
|
37
|
+
// Rows have 10px above and below, between the
|
|
38
38
|
// spacing steps of 8px and 12px.
|
|
39
39
|
row: { paddingBlock: 10 },
|
|
40
40
|
// As high as an `md` control, so the text is centred on the first line of controls.
|