@antscorp/ui 0.1.3 → 0.1.4
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 +25 -1
- package/dist/atoms/AddButton.d.ts +2 -5
- package/dist/atoms/Chip.d.ts +2 -5
- package/dist/atoms/Chip.js +1 -1
- package/dist/atoms/RemoveButton.d.ts +2 -5
- package/dist/atoms/TextAction.d.ts +2 -3
- package/dist/docs.json +1 -1
- package/dist/lib/iso.d.ts +2 -2
- package/dist/lib/iso.js +16 -8
- package/dist/lib/tokenEditorExtensions.js +1 -1
- package/dist/molecules/AccentCard.js +2 -2
- package/dist/molecules/CheckRow.d.ts +2 -7
- package/dist/molecules/ChoiceTiles.js +1 -1
- package/dist/molecules/CommitTextField.d.ts +1 -19
- package/dist/molecules/CommitTextField.js +21 -18
- package/dist/molecules/ConfirmDialog.d.ts +2 -7
- package/dist/molecules/DateTimeInput.d.ts +6 -3
- package/dist/molecules/DateTimeInput.js +82 -73
- package/dist/molecules/RemovableRow.js +32 -32
- package/dist/molecules/RevealRadioGroup.d.ts +2 -9
- package/dist/molecules/RevealSwitch.d.ts +2 -7
- package/dist/molecules/Select.d.ts +7 -23
- package/dist/molecules/Select.js +26 -20
- package/dist/molecules/StatusButton.d.ts +2 -7
- package/dist/molecules/TreeOptions.d.ts +3 -2
- package/dist/molecules/TreeOptions.js +67 -44
- package/dist/organisms/HourOfDayRow.js +2 -2
- package/dist/organisms/HourOfWeekGrid.js +2 -2
- package/dist/organisms/TreeSearchPanel.js +50 -47
- package/dist/ui.css +1 -1
- package/package.json +23 -17
- package/src/atoms/AddButton.tsx +2 -6
- package/src/atoms/Chip.tsx +5 -7
- package/src/atoms/RemoveButton.tsx +2 -6
- package/src/atoms/TextAction.tsx +2 -4
- package/src/lib/iso.ts +15 -3
- package/src/lib/tokenEditorExtensions.ts +1 -1
- package/src/molecules/AccentCard.tsx +4 -2
- package/src/molecules/CheckRow.tsx +2 -8
- package/src/molecules/ChoiceTiles.tsx +3 -1
- package/src/molecules/CommitTextField.tsx +15 -20
- package/src/molecules/ConfirmDialog.tsx +2 -8
- package/src/molecules/DateTimeInput.tsx +86 -68
- package/src/molecules/RemovableRow.tsx +1 -1
- package/src/molecules/RevealRadioGroup.tsx +5 -10
- package/src/molecules/RevealSwitch.tsx +2 -8
- package/src/molecules/Select.tsx +22 -22
- package/src/molecules/StatusButton.tsx +2 -8
- package/src/molecules/TreeOptions.tsx +86 -62
- package/src/organisms/HourOfDayRow.tsx +4 -2
- package/src/organisms/HourOfWeekGrid.tsx +4 -2
- package/src/organisms/TreeSearchPanel.tsx +1 -1
- package/dist/atoms/AddButton.doc.d.ts +0 -21
- package/dist/atoms/AddGlyph.doc.d.ts +0 -16
- package/dist/atoms/Chip.doc.d.ts +0 -29
- package/dist/atoms/ChipSkeletons.doc.d.ts +0 -21
- package/dist/atoms/FieldHeading.doc.d.ts +0 -15
- package/dist/atoms/HoverSwap.doc.d.ts +0 -25
- package/dist/atoms/InfoTip.doc.d.ts +0 -25
- package/dist/atoms/JointLabel.doc.d.ts +0 -15
- package/dist/atoms/LabeledDivider.doc.d.ts +0 -21
- package/dist/atoms/LogoImage.doc.d.ts +0 -21
- package/dist/atoms/PanelSearchInput.doc.d.ts +0 -25
- package/dist/atoms/PathMark.doc.d.ts +0 -16
- package/dist/atoms/RemoveButton.doc.d.ts +0 -16
- package/dist/atoms/RowSkeletons.doc.d.ts +0 -25
- package/dist/atoms/TextAction.doc.d.ts +0 -25
- package/dist/atoms/TruncatedOption.doc.d.ts +0 -24
- package/dist/atoms/TruncatedText.doc.d.ts +0 -15
- package/dist/molecules/AccentCard.doc.d.ts +0 -25
- package/dist/molecules/CheckGroup.doc.d.ts +0 -25
- package/dist/molecules/CheckRow.doc.d.ts +0 -25
- package/dist/molecules/ChoiceDialog.doc.d.ts +0 -21
- package/dist/molecules/ChoiceTiles.doc.d.ts +0 -21
- package/dist/molecules/CommitTextField.doc.d.ts +0 -29
- package/dist/molecules/ConfirmDialog.doc.d.ts +0 -21
- package/dist/molecules/DateTimeInput.doc.d.ts +0 -25
- package/dist/molecules/DurationInput.doc.d.ts +0 -25
- package/dist/molecules/FieldGroup.doc.d.ts +0 -25
- package/dist/molecules/FieldRow.doc.d.ts +0 -24
- package/dist/molecules/FieldSkeleton.doc.d.ts +0 -25
- package/dist/molecules/FrequencyLimitRow.doc.d.ts +0 -25
- package/dist/molecules/InlineEditableText.doc.d.ts +0 -25
- package/dist/molecules/LoadMoreRow.doc.d.ts +0 -21
- package/dist/molecules/LoadState.doc.d.ts +0 -21
- package/dist/molecules/MetaTable.doc.d.ts +0 -25
- package/dist/molecules/PercentRow.doc.d.ts +0 -25
- package/dist/molecules/PhoneFrame.doc.d.ts +0 -21
- package/dist/molecules/ProblemsButton.doc.d.ts +0 -25
- package/dist/molecules/RemovableRow.doc.d.ts +0 -25
- package/dist/molecules/RevealRadioGroup.doc.d.ts +0 -25
- package/dist/molecules/RevealSwitch.doc.d.ts +0 -25
- package/dist/molecules/RuleRow.doc.d.ts +0 -25
- package/dist/molecules/Select.doc.d.ts +0 -30
- package/dist/molecules/SideLabelRow.doc.d.ts +0 -20
- package/dist/molecules/SplitButton.doc.d.ts +0 -25
- package/dist/molecules/StatusButton.doc.d.ts +0 -25
- package/dist/molecules/TagSelect.doc.d.ts +0 -25
- package/dist/molecules/ToggleGrid.doc.d.ts +0 -25
- package/dist/molecules/TokenTextField.doc.d.ts +0 -29
- package/dist/molecules/TransferLayout.doc.d.ts +0 -25
- package/dist/molecules/TreeOptions.doc.d.ts +0 -25
- package/dist/organisms/ChipListAddPopover.doc.d.ts +0 -25
- package/dist/organisms/HourOfDayRow.doc.d.ts +0 -25
- package/dist/organisms/HourOfWeekGrid.doc.d.ts +0 -25
- package/dist/organisms/RepeatableList.doc.d.ts +0 -21
- package/dist/organisms/ResizableDrawer.doc.d.ts +0 -25
- package/dist/organisms/RuleGroups.doc.d.ts +0 -21
- package/dist/organisms/RuleList.doc.d.ts +0 -25
- package/dist/organisms/SearchableGroupedList.doc.d.ts +0 -25
- package/dist/organisms/TokenPickerDialog.doc.d.ts +0 -21
- package/dist/organisms/TransferPicker.doc.d.ts +0 -29
- package/dist/organisms/TreeSearchPanel.doc.d.ts +0 -25
- package/dist/organisms/TreeSelect.doc.d.ts +0 -29
- package/dist/theme/AntsomiTheme.doc.d.ts +0 -15
- package/dist/theme/AntsomiTheme.doc.js +0 -22
- package/src/atoms/AddButton.doc.ts +0 -36
- package/src/atoms/AddGlyph.doc.ts +0 -26
- package/src/atoms/Chip.doc.ts +0 -45
- package/src/atoms/ChipSkeletons.doc.ts +0 -31
- package/src/atoms/FieldHeading.doc.ts +0 -22
- package/src/atoms/HoverSwap.doc.ts +0 -39
- package/src/atoms/InfoTip.doc.ts +0 -37
- package/src/atoms/JointLabel.doc.ts +0 -23
- package/src/atoms/LabeledDivider.doc.ts +0 -35
- package/src/atoms/LogoImage.doc.ts +0 -42
- package/src/atoms/PanelSearchInput.doc.ts +0 -41
- package/src/atoms/PathMark.doc.ts +0 -25
- package/src/atoms/RemoveButton.doc.ts +0 -26
- package/src/atoms/RowSkeletons.doc.ts +0 -43
- package/src/atoms/TextAction.doc.ts +0 -40
- package/src/atoms/TruncatedOption.doc.ts +0 -39
- package/src/atoms/TruncatedText.doc.ts +0 -22
- package/src/molecules/AccentCard.doc.ts +0 -43
- package/src/molecules/CheckGroup.doc.ts +0 -40
- package/src/molecules/CheckRow.doc.ts +0 -43
- package/src/molecules/ChoiceDialog.doc.ts +0 -48
- package/src/molecules/ChoiceTiles.doc.ts +0 -42
- package/src/molecules/CommitTextField.doc.ts +0 -41
- package/src/molecules/ConfirmDialog.doc.ts +0 -43
- package/src/molecules/DateTimeInput.doc.ts +0 -48
- package/src/molecules/DurationInput.doc.ts +0 -36
- package/src/molecules/FieldGroup.doc.ts +0 -41
- package/src/molecules/FieldRow.doc.ts +0 -36
- package/src/molecules/FieldSkeleton.doc.ts +0 -38
- package/src/molecules/FrequencyLimitRow.doc.ts +0 -48
- package/src/molecules/InlineEditableText.doc.ts +0 -41
- package/src/molecules/LoadMoreRow.doc.ts +0 -36
- package/src/molecules/LoadState.doc.ts +0 -42
- package/src/molecules/MetaTable.doc.ts +0 -46
- package/src/molecules/PercentRow.doc.ts +0 -48
- package/src/molecules/PhoneFrame.doc.ts +0 -46
- package/src/molecules/ProblemsButton.doc.ts +0 -41
- package/src/molecules/RemovableRow.doc.ts +0 -48
- package/src/molecules/RevealRadioGroup.doc.ts +0 -41
- package/src/molecules/RevealSwitch.doc.ts +0 -38
- package/src/molecules/RuleRow.doc.ts +0 -43
- package/src/molecules/Select.doc.ts +0 -62
- package/src/molecules/SideLabelRow.doc.ts +0 -35
- package/src/molecules/SplitButton.doc.ts +0 -41
- package/src/molecules/StatusButton.doc.ts +0 -39
- package/src/molecules/TagSelect.doc.ts +0 -41
- package/src/molecules/ToggleGrid.doc.ts +0 -43
- package/src/molecules/TokenTextField.doc.ts +0 -41
- package/src/molecules/TransferLayout.doc.ts +0 -42
- package/src/molecules/TreeOptions.doc.ts +0 -38
- package/src/organisms/ChipListAddPopover.doc.ts +0 -54
- package/src/organisms/HourOfDayRow.doc.ts +0 -43
- package/src/organisms/HourOfWeekGrid.doc.ts +0 -48
- package/src/organisms/RepeatableList.doc.ts +0 -49
- package/src/organisms/ResizableDrawer.doc.ts +0 -48
- package/src/organisms/RuleGroups.doc.ts +0 -49
- package/src/organisms/RuleList.doc.ts +0 -43
- package/src/organisms/SearchableGroupedList.doc.ts +0 -49
- package/src/organisms/TokenPickerDialog.doc.ts +0 -54
- package/src/organisms/TransferPicker.doc.ts +0 -69
- package/src/organisms/TreeSearchPanel.doc.ts +0 -43
- package/src/organisms/TreeSelect.doc.ts +0 -56
- package/src/theme/AntsomiTheme.doc.ts +0 -23
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @antscorp/ui
|
|
2
2
|
|
|
3
|
-
React 19 views, Astryx, StyleX and the Antsomi theme through one facade.
|
|
3
|
+
React >=19.2 views, Astryx, StyleX and the Antsomi theme through one facade.
|
|
4
|
+
React and React DOM >=19.2 are supplied by the host as peers.
|
|
5
|
+
The packaged CLI requires Node >=24.
|
|
4
6
|
|
|
5
7
|
```sh
|
|
6
8
|
bun add @antscorp/ui
|
|
@@ -25,3 +27,25 @@ export function Example() {
|
|
|
25
27
|
StyleX consumers select `antscorp-source` and extract their own CSS instead of importing
|
|
26
28
|
`ui.css`. See the [repository README](../../README.md)
|
|
27
29
|
for source configuration, linked development and releases.
|
|
30
|
+
|
|
31
|
+
## Localization
|
|
32
|
+
|
|
33
|
+
The host translates kit `label`/`labels`, descriptions and errors. Astryx-owned calendar,
|
|
34
|
+
clear, search and status text uses `InternationalizationProvider` from the same facade:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { getLocaleDirection, InternationalizationProvider } from "@antscorp/ui/astryx/i18n";
|
|
38
|
+
import arSA from "@antscorp/ui/astryx/locales/ar-SA.generated.js";
|
|
39
|
+
|
|
40
|
+
const locale = "ar-SA";
|
|
41
|
+
const dir = getLocaleDirection(locale);
|
|
42
|
+
|
|
43
|
+
// The host also sets <html dir={dir}>; this provider renders no DOM element.
|
|
44
|
+
<InternationalizationProvider locale={locale} messages={{ [locale]: arSA }} dir={dir}>
|
|
45
|
+
<AntsomiTheme>{/* Views with host-translated labels. */}</AntsomiTheme>
|
|
46
|
+
</InternationalizationProvider>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Keep the DOM `dir` and provider direction in sync. Use `overrides` for sparse, locale-keyed
|
|
50
|
+
upstream text changes; missing translations fall back to English. `DateTimeInput` defaults to
|
|
51
|
+
`hourFormat="12h"`; set `hourFormat="24h"` for a 24-hour clock. No second translation layer is needed.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { type ButtonProps } from "@astryxdesign/core/Button";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
/** What `AddButton` takes. */
|
|
3
|
-
export type AddButtonProps = {
|
|
4
|
-
/** What it adds, such as "Add row"; the host translates it. */
|
|
5
|
-
readonly label: string;
|
|
4
|
+
export type AddButtonProps = Pick<ButtonProps, "label" | "isDisabled"> & {
|
|
6
5
|
/** `ghost` by default; `secondary` for an add that needs more weight. */
|
|
7
6
|
readonly variant?: "ghost" | "secondary" | undefined;
|
|
8
7
|
/** The button's height, `md` by default; its plus follows it. */
|
|
@@ -11,8 +10,6 @@ export type AddButtonProps = {
|
|
|
11
10
|
readonly shape?: "default" | "pill" | undefined;
|
|
12
11
|
/** `sentence` (default) shows the label as given; `upper` in capitals, such as "+ AND". */
|
|
13
12
|
readonly case?: "sentence" | "upper" | undefined;
|
|
14
|
-
/** Dimmed and not pressable, e.g. when a limit is reached. */
|
|
15
|
-
readonly isDisabled?: boolean | undefined;
|
|
16
13
|
/** Read-only: an add is an editing affordance, so nothing is drawn. */
|
|
17
14
|
readonly isReadOnly?: boolean | undefined;
|
|
18
15
|
/** Called when the button is pressed. */
|
package/dist/atoms/Chip.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { type TokenProps } from "@astryxdesign/core/Token";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
/** What `Chip` takes. */
|
|
3
|
-
export type ChipProps = {
|
|
4
|
-
/** The chip's text; cut short with an ellipsis past `maxWidth`, and shown whole in a tooltip. */
|
|
5
|
-
readonly label: string;
|
|
4
|
+
export type ChipProps = Pick<TokenProps, "label" | "isDisabled"> & {
|
|
6
5
|
/** `neutral` (default) is the plain grey chip; `accent` the pale accent one; `danger` a value no longer valid. */
|
|
7
6
|
readonly tone?: "neutral" | "accent" | "danger" | undefined;
|
|
8
7
|
/** The chip's height, `sm` or `md` (default), as the controls beside it. */
|
|
@@ -21,8 +20,6 @@ export type ChipProps = {
|
|
|
21
20
|
* button over its end; it stays in the tab order. Without it the button always shows after the text.
|
|
22
21
|
*/
|
|
23
22
|
readonly isRemoveOnHover?: boolean | undefined;
|
|
24
|
-
/** Dims the chip and blocks its remove button. */
|
|
25
|
-
readonly isDisabled?: boolean | undefined;
|
|
26
23
|
/** Read-only: no remove button. */
|
|
27
24
|
readonly isReadOnly?: boolean | undefined;
|
|
28
25
|
};
|
package/dist/atoms/Chip.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { type IconButtonProps } from "@astryxdesign/core/IconButton";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
/** What `RemoveButton` takes. */
|
|
3
|
-
export type RemoveButtonProps = {
|
|
4
|
-
/** What goes, such as "Remove row"; the button shows only an icon, so this is its name. */
|
|
5
|
-
readonly label: string;
|
|
4
|
+
export type RemoveButtonProps = Pick<IconButtonProps, "label" | "isDisabled"> & {
|
|
6
5
|
/** The button's height, `md` by default. */
|
|
7
6
|
readonly size?: "sm" | "md" | undefined;
|
|
8
|
-
/** Dimmed and not pressable. */
|
|
9
|
-
readonly isDisabled?: boolean | undefined;
|
|
10
7
|
/** Read-only: a remove is an editing affordance, so nothing is drawn. */
|
|
11
8
|
readonly isReadOnly?: boolean | undefined;
|
|
12
9
|
/** Called when the button is pressed. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type LinkProps } from "@astryxdesign/core/Link";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
/** What `TextAction` takes. */
|
|
3
|
-
export type TextActionProps = {
|
|
4
|
+
export type TextActionProps = Pick<LinkProps, "isDisabled"> & {
|
|
4
5
|
/** What it does, such as "Remove all"; shown in capitals by default, so pass it in normal case. */
|
|
5
6
|
readonly label: string;
|
|
6
7
|
/** A glyph before the text, in the text's colour, such as an Astryx `Icon` of a bin for a removal. */
|
|
@@ -14,8 +15,6 @@ export type TextActionProps = {
|
|
|
14
15
|
readonly onClick?: (() => void) | undefined;
|
|
15
16
|
/** A down chevron after the text, for an action that opens a menu. */
|
|
16
17
|
readonly hasChevron?: boolean | undefined;
|
|
17
|
-
/** Dimmed and not pressable. */
|
|
18
|
-
readonly isDisabled?: boolean | undefined;
|
|
19
18
|
};
|
|
20
19
|
/**
|
|
21
20
|
* An action drawn as text alone: bold capitals in the accent, no frame, such as "REMOVE ALL"
|