@antscorp/ui 0.1.4 → 0.1.5
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/dist/atoms/AddButton.d.ts +2 -1
- package/dist/atoms/Chip.d.ts +4 -1
- package/dist/atoms/RemoveButton.d.ts +2 -1
- package/dist/atoms/TextAction.d.ts +2 -1
- package/dist/docs.json +1 -1
- package/dist/lib/forwardable.d.ts +8 -0
- package/dist/molecules/CheckGroup.d.ts +2 -1
- package/dist/molecules/CheckRow.d.ts +4 -1
- package/dist/molecules/CommitTextField.d.ts +2 -1
- package/dist/molecules/ConfirmDialog.d.ts +2 -1
- package/dist/molecules/DateTimeInput.d.ts +2 -1
- package/dist/molecules/DurationInput.d.ts +2 -1
- package/dist/molecules/PercentRow.d.ts +2 -1
- package/dist/molecules/RevealRadioGroup.d.ts +2 -1
- package/dist/molecules/RevealSwitch.d.ts +2 -1
- package/dist/molecules/Select.d.ts +2 -1
- package/dist/molecules/StatusButton.d.ts +2 -1
- package/dist/molecules/ToggleGrid.d.ts +2 -1
- package/dist/molecules/TokenTextField.d.ts +2 -1
- package/dist/organisms/TokenPickerDialog.d.ts +2 -1
- package/dist/organisms/TransferPicker.d.ts +2 -1
- package/dist/theme/AntsomiTheme.d.ts +3 -2
- package/dist/theme/AntsomiTheme.js +8 -7
- package/package.json +3 -3
- package/src/atoms/AddButton.tsx +2 -1
- package/src/atoms/Chip.tsx +4 -1
- package/src/atoms/RemoveButton.tsx +3 -1
- package/src/atoms/TextAction.tsx +3 -1
- package/src/lib/forwardable.ts +8 -0
- package/src/molecules/CheckGroup.tsx +3 -3
- package/src/molecules/CheckRow.tsx +4 -1
- package/src/molecules/CommitTextField.tsx +15 -12
- package/src/molecules/ConfirmDialog.tsx +5 -1
- package/src/molecules/DateTimeInput.tsx +3 -2
- package/src/molecules/DurationInput.tsx +4 -1
- package/src/molecules/PercentRow.tsx +3 -2
- package/src/molecules/RevealRadioGroup.tsx +3 -3
- package/src/molecules/RevealSwitch.tsx +3 -1
- package/src/molecules/Select.tsx +16 -13
- package/src/molecules/StatusButton.tsx +3 -1
- package/src/molecules/ToggleGrid.tsx +3 -3
- package/src/molecules/TokenTextField.tsx +3 -3
- package/src/organisms/TokenPickerDialog.tsx +2 -1
- package/src/organisms/TransferPicker.tsx +3 -3
- package/src/theme/AntsomiTheme.tsx +9 -3
|
@@ -14,6 +14,7 @@ import { mergeProps, themeProps } from "@astryxdesign/core/utils";
|
|
|
14
14
|
import * as stylex from "@stylexjs/stylex";
|
|
15
15
|
import { lazy, type ReactNode, Suspense, useId, useRef, useState } from "react";
|
|
16
16
|
|
|
17
|
+
import type { Forwardable } from "../lib/forwardable";
|
|
17
18
|
import type { TokenLook } from "../lib/tokenEditorConfig";
|
|
18
19
|
import { FieldSkeleton } from "./FieldSkeleton";
|
|
19
20
|
import { TokenEditorBoundary } from "./token-editor-boundary";
|
|
@@ -24,9 +25,8 @@ const Editor = lazy(() => import("./token-editor"));
|
|
|
24
25
|
export type { TokenLook } from "../lib/tokenEditorConfig";
|
|
25
26
|
|
|
26
27
|
/** What `TokenTextField` takes. */
|
|
27
|
-
export type TokenTextFieldProps =
|
|
28
|
-
FieldProps,
|
|
29
|
-
"label" | "description" | "isLabelHidden" | "isDisabled" | "isRequired"
|
|
28
|
+
export type TokenTextFieldProps = Forwardable<
|
|
29
|
+
Pick<FieldProps, "label" | "description" | "isLabelHidden" | "isDisabled" | "isRequired">
|
|
30
30
|
> & {
|
|
31
31
|
/** The committed string; outside changes replace the local draft. */
|
|
32
32
|
readonly value: string;
|
|
@@ -6,6 +6,7 @@ import { TextInput } from "@astryxdesign/core/TextInput";
|
|
|
6
6
|
import { VStack } from "@astryxdesign/core/VStack";
|
|
7
7
|
import { type ReactNode, useState } from "react";
|
|
8
8
|
|
|
9
|
+
import type { Forwardable } from "../lib/forwardable";
|
|
9
10
|
import { useLoadingShown } from "../lib/useLoadingShown";
|
|
10
11
|
import { FieldSkeleton } from "../molecules/FieldSkeleton";
|
|
11
12
|
import { leafOf, type TreeItem } from "../molecules/TreeOptions";
|
|
@@ -22,7 +23,7 @@ export type TokenPickerValue = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
/** What `TokenPickerDialog` takes. */
|
|
25
|
-
export type TokenPickerDialogProps = Pick<DialogProps, "isOpen"
|
|
26
|
+
export type TokenPickerDialogProps = Forwardable<Pick<DialogProps, "isOpen">> & {
|
|
26
27
|
/** Closes or cancels the dialog. */
|
|
27
28
|
readonly onClose: () => void;
|
|
28
29
|
/** Dialog heading. */
|
|
@@ -10,6 +10,7 @@ import { InfoTip } from "../atoms/InfoTip";
|
|
|
10
10
|
import { PanelSearchInput } from "../atoms/PanelSearchInput";
|
|
11
11
|
import { RowSkeletons } from "../atoms/RowSkeletons";
|
|
12
12
|
import { TextAction } from "../atoms/TextAction";
|
|
13
|
+
import type { Forwardable } from "../lib/forwardable";
|
|
13
14
|
import { useLoadingShown } from "../lib/useLoadingShown";
|
|
14
15
|
import { type LoadMoreOptions, useLoadMore } from "../lib/useLoadMore";
|
|
15
16
|
import { CheckRow } from "../molecules/CheckRow";
|
|
@@ -34,9 +35,8 @@ export type TransferPickerOption<V extends string> = {
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
/** What `TransferPicker` takes. */
|
|
37
|
-
export type TransferPickerProps<V extends string> =
|
|
38
|
-
LoadMoreOptions,
|
|
39
|
-
"onLoadMore" | "hasMore" | "isLoadingMore"
|
|
38
|
+
export type TransferPickerProps<V extends string> = Forwardable<
|
|
39
|
+
Pick<LoadMoreOptions, "onLoadMore" | "hasMore" | "isLoadingMore">
|
|
40
40
|
> & {
|
|
41
41
|
/** Names the list of options (the start column). */
|
|
42
42
|
readonly label: string;
|
|
@@ -2,11 +2,13 @@ import { antsomiTheme } from "@antscorp/astryx-theme-antsomi";
|
|
|
2
2
|
import { Theme } from "@astryxdesign/core/theme";
|
|
3
3
|
import type { ComponentProps, ReactElement } from "react";
|
|
4
4
|
|
|
5
|
+
import type { Forwardable } from "../lib/forwardable";
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Astryx Theme props with the Antsomi base theme as the default.
|
|
7
9
|
* Inherited `children` renders the themed subtree; `mode` selects light, dark or system mode.
|
|
8
10
|
*/
|
|
9
|
-
export type AntsomiThemeProps = Omit<ComponentProps<typeof Theme>, "theme"
|
|
11
|
+
export type AntsomiThemeProps = Forwardable<Omit<ComponentProps<typeof Theme>, "theme">> & {
|
|
10
12
|
/** Optional override created with `defineTheme({ extends: antsomiTheme, … })`. */
|
|
11
13
|
readonly theme?: ComponentProps<typeof Theme>["theme"];
|
|
12
14
|
};
|
|
@@ -16,6 +18,10 @@ export type AntsomiThemeProps = Omit<ComponentProps<typeof Theme>, "theme"> & {
|
|
|
16
18
|
* Import `@antscorp/ui/theme.css` separately. Extend the base with Astryx's
|
|
17
19
|
* `defineTheme({ name: "custom", extends: antsomiTheme, tokens: { … } })` and pass it as `theme`.
|
|
18
20
|
*/
|
|
19
|
-
export function AntsomiTheme({ theme,
|
|
20
|
-
return
|
|
21
|
+
export function AntsomiTheme({ theme, mode, children }: AntsomiThemeProps): ReactElement {
|
|
22
|
+
return (
|
|
23
|
+
<Theme theme={theme ?? antsomiTheme} {...(mode !== undefined && { mode })}>
|
|
24
|
+
{children}
|
|
25
|
+
</Theme>
|
|
26
|
+
);
|
|
21
27
|
}
|