aidos-ui 4.0.4 → 4.0.6
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/LICENSE +1 -1
- package/README.md +23 -3
- package/dist/index.d.ts +801 -68
- package/dist/index.js +3934 -68
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +6 -2
- package/dist/jsx-dev-runtime.js +87 -42
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +2 -2
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/vite-plugin-jss-debug.d.ts +3 -1
- package/dist/vite-plugin-jss-debug.js +57 -74
- package/dist/vite-plugin-jss-debug.js.map +1 -1
- package/package.json +61 -27
- package/.prettierrc +0 -4
- package/CLAUDE.md +0 -72
- package/dist/Badge.d.ts +0 -6
- package/dist/Badge.js +0 -22
- package/dist/Badge.js.map +0 -1
- package/dist/BaseButton.d.ts +0 -14
- package/dist/BaseButton.js +0 -23
- package/dist/BaseButton.js.map +0 -1
- package/dist/BaseInput.d.ts +0 -14
- package/dist/BaseInput.js +0 -15
- package/dist/BaseInput.js.map +0 -1
- package/dist/BaseLink.d.ts +0 -18
- package/dist/BaseLink.js +0 -29
- package/dist/BaseLink.js.map +0 -1
- package/dist/BaseList.d.ts +0 -6
- package/dist/BaseList.js +0 -14
- package/dist/BaseList.js.map +0 -1
- package/dist/BaseListAddOn.d.ts +0 -5
- package/dist/BaseListAddOn.js +0 -7
- package/dist/BaseListAddOn.js.map +0 -1
- package/dist/BaseListItem.d.ts +0 -26
- package/dist/BaseListItem.js +0 -29
- package/dist/BaseListItem.js.map +0 -1
- package/dist/BaseView.d.ts +0 -12
- package/dist/BaseView.js +0 -26
- package/dist/BaseView.js.map +0 -1
- package/dist/Box.d.ts +0 -4
- package/dist/Box.js +0 -6
- package/dist/Box.js.map +0 -1
- package/dist/Button.d.ts +0 -20
- package/dist/Button.js +0 -19
- package/dist/Button.js.map +0 -1
- package/dist/Calendar.d.ts +0 -18
- package/dist/Calendar.js +0 -57
- package/dist/Calendar.js.map +0 -1
- package/dist/Card.d.ts +0 -4
- package/dist/Card.js +0 -14
- package/dist/Card.js.map +0 -1
- package/dist/Checkbox.d.ts +0 -11
- package/dist/Checkbox.js +0 -32
- package/dist/Checkbox.js.map +0 -1
- package/dist/Circle.d.ts +0 -5
- package/dist/Circle.js +0 -12
- package/dist/Circle.js.map +0 -1
- package/dist/Column.d.ts +0 -6
- package/dist/Column.js +0 -7
- package/dist/Column.js.map +0 -1
- package/dist/DarkMode.d.ts +0 -13
- package/dist/DarkMode.js +0 -62
- package/dist/DarkMode.js.map +0 -1
- package/dist/DateInput.d.ts +0 -13
- package/dist/DateInput.js +0 -29
- package/dist/DateInput.js.map +0 -1
- package/dist/DatePicker.d.ts +0 -11
- package/dist/DatePicker.js +0 -34
- package/dist/DatePicker.js.map +0 -1
- package/dist/DatetimeInput.d.ts +0 -13
- package/dist/DatetimeInput.js +0 -31
- package/dist/DatetimeInput.js.map +0 -1
- package/dist/DesignBook.d.ts +0 -1
- package/dist/DesignBook.js +0 -55
- package/dist/DesignBook.js.map +0 -1
- package/dist/Dialog.d.ts +0 -17
- package/dist/Dialog.js +0 -92
- package/dist/Dialog.js.map +0 -1
- package/dist/Dropdown.d.ts +0 -14
- package/dist/Dropdown.js +0 -65
- package/dist/Dropdown.js.map +0 -1
- package/dist/Emitter.d.ts +0 -6
- package/dist/Emitter.js +0 -19
- package/dist/Emitter.js.map +0 -1
- package/dist/FlexLayout.d.ts +0 -11
- package/dist/FlexLayout.js +0 -18
- package/dist/FlexLayout.js.map +0 -1
- package/dist/Icon.d.ts +0 -12
- package/dist/Icon.js +0 -60
- package/dist/Icon.js.map +0 -1
- package/dist/IconButton.d.ts +0 -11
- package/dist/IconButton.js +0 -34
- package/dist/IconButton.js.map +0 -1
- package/dist/IconLink.d.ts +0 -9
- package/dist/IconLink.js +0 -32
- package/dist/IconLink.js.map +0 -1
- package/dist/IconType.d.ts +0 -1
- package/dist/IconType.js +0 -2
- package/dist/IconType.js.map +0 -1
- package/dist/Interactable.d.ts +0 -50
- package/dist/Interactable.js +0 -169
- package/dist/Interactable.js.map +0 -1
- package/dist/JSSComment.d.ts +0 -10
- package/dist/JSSComment.js +0 -52
- package/dist/JSSComment.js.map +0 -1
- package/dist/Link.d.ts +0 -22
- package/dist/Link.js +0 -29
- package/dist/Link.js.map +0 -1
- package/dist/List.d.ts +0 -15
- package/dist/List.js +0 -29
- package/dist/List.js.map +0 -1
- package/dist/ListButtonItem.d.ts +0 -14
- package/dist/ListButtonItem.js +0 -11
- package/dist/ListButtonItem.js.map +0 -1
- package/dist/ListDivider.d.ts +0 -1
- package/dist/ListDivider.js +0 -12
- package/dist/ListDivider.js.map +0 -1
- package/dist/ListHeaderItem.d.ts +0 -10
- package/dist/ListHeaderItem.js +0 -15
- package/dist/ListHeaderItem.js.map +0 -1
- package/dist/ListItem.d.ts +0 -9
- package/dist/ListItem.js +0 -9
- package/dist/ListItem.js.map +0 -1
- package/dist/ListLinkItem.d.ts +0 -16
- package/dist/ListLinkItem.js +0 -11
- package/dist/ListLinkItem.js.map +0 -1
- package/dist/ListSpacer.d.ts +0 -1
- package/dist/ListSpacer.js +0 -13
- package/dist/ListSpacer.js.map +0 -1
- package/dist/MenuIcon.d.ts +0 -5
- package/dist/MenuIcon.js +0 -31
- package/dist/MenuIcon.js.map +0 -1
- package/dist/NextJSRouter.d.ts +0 -1
- package/dist/NextJSRouter.js +0 -37
- package/dist/NextJSRouter.js.map +0 -1
- package/dist/NextJSRouterState.d.ts +0 -38
- package/dist/NextJSRouterState.js +0 -111
- package/dist/NextJSRouterState.js.map +0 -1
- package/dist/OnVisible.d.ts +0 -5
- package/dist/OnVisible.js +0 -28
- package/dist/OnVisible.js.map +0 -1
- package/dist/Popover.d.ts +0 -22
- package/dist/Popover.js +0 -90
- package/dist/Popover.js.map +0 -1
- package/dist/ProgressBar.d.ts +0 -7
- package/dist/ProgressBar.js +0 -42
- package/dist/ProgressBar.js.map +0 -1
- package/dist/ProgressCircle.d.ts +0 -5
- package/dist/ProgressCircle.js +0 -12
- package/dist/ProgressCircle.js.map +0 -1
- package/dist/Providers.d.ts +0 -9
- package/dist/Providers.js +0 -16
- package/dist/Providers.js.map +0 -1
- package/dist/RangeInput.d.ts +0 -14
- package/dist/RangeInput.js +0 -32
- package/dist/RangeInput.js.map +0 -1
- package/dist/ResultOrError.d.ts +0 -13
- package/dist/ResultOrError.js +0 -7
- package/dist/ResultOrError.js.map +0 -1
- package/dist/RootView.d.ts +0 -5
- package/dist/RootView.js +0 -35
- package/dist/RootView.js.map +0 -1
- package/dist/Row.d.ts +0 -6
- package/dist/Row.js +0 -7
- package/dist/Row.js.map +0 -1
- package/dist/Select.d.ts +0 -9
- package/dist/Select.js +0 -17
- package/dist/Select.js.map +0 -1
- package/dist/StackContext.d.ts +0 -8
- package/dist/StackContext.js +0 -25
- package/dist/StackContext.js.map +0 -1
- package/dist/StaticCheckbox.d.ts +0 -16
- package/dist/StaticCheckbox.js +0 -48
- package/dist/StaticCheckbox.js.map +0 -1
- package/dist/Storage.d.ts +0 -13
- package/dist/Storage.js +0 -146
- package/dist/Storage.js.map +0 -1
- package/dist/Stream.d.ts +0 -9
- package/dist/Stream.js +0 -36
- package/dist/Stream.js.map +0 -1
- package/dist/Sublist.d.ts +0 -12
- package/dist/Sublist.js +0 -18
- package/dist/Sublist.js.map +0 -1
- package/dist/SubmitIconInput.d.ts +0 -8
- package/dist/SubmitIconInput.js +0 -25
- package/dist/SubmitIconInput.js.map +0 -1
- package/dist/Tabs.d.ts +0 -23
- package/dist/Tabs.js +0 -39
- package/dist/Tabs.js.map +0 -1
- package/dist/Text.d.ts +0 -25
- package/dist/Text.js +0 -52
- package/dist/Text.js.map +0 -1
- package/dist/TextArea.d.ts +0 -11
- package/dist/TextArea.js +0 -27
- package/dist/TextArea.js.map +0 -1
- package/dist/TextInput.d.ts +0 -15
- package/dist/TextInput.js +0 -61
- package/dist/TextInput.js.map +0 -1
- package/dist/TextInputWithState.d.ts +0 -8
- package/dist/TextInputWithState.js +0 -14
- package/dist/TextInputWithState.js.map +0 -1
- package/dist/TextPairing.d.ts +0 -21
- package/dist/TextPairing.js +0 -26
- package/dist/TextPairing.js.map +0 -1
- package/dist/TimeInput.d.ts +0 -15
- package/dist/TimeInput.js +0 -58
- package/dist/TimeInput.js.map +0 -1
- package/dist/Tooltip.d.ts +0 -11
- package/dist/Tooltip.js +0 -73
- package/dist/Tooltip.js.map +0 -1
- package/dist/aria.d.ts +0 -8
- package/dist/aria.js +0 -42
- package/dist/aria.js.map +0 -1
- package/dist/guid.d.ts +0 -1
- package/dist/guid.js +0 -7
- package/dist/guid.js.map +0 -1
- package/dist/hash.d.ts +0 -1
- package/dist/hash.js +0 -20
- package/dist/hash.js.map +0 -1
- package/dist/isServer.d.ts +0 -1
- package/dist/isServer.js +0 -4
- package/dist/isServer.js.map +0 -1
- package/dist/jss.d.ts +0 -122
- package/dist/jss.js +0 -515
- package/dist/jss.js.map +0 -1
- package/dist/numberToBase.d.ts +0 -1
- package/dist/numberToBase.js +0 -44
- package/dist/numberToBase.js.map +0 -1
- package/dist/stateMachineContextFactory.d.ts +0 -36
- package/dist/stateMachineContextFactory.js +0 -48
- package/dist/stateMachineContextFactory.js.map +0 -1
- package/dist/useCookie.d.ts +0 -9
- package/dist/useCookie.js +0 -67
- package/dist/useCookie.js.map +0 -1
- package/dist/useKeyboard.d.ts +0 -8
- package/dist/useKeyboard.js +0 -26
- package/dist/useKeyboard.js.map +0 -1
- package/dist/useNavigation.d.ts +0 -5
- package/dist/useNavigation.js +0 -79
- package/dist/useNavigation.js.map +0 -1
- package/dist/usePromise.d.ts +0 -1
- package/dist/usePromise.js +0 -12
- package/dist/usePromise.js.map +0 -1
- package/dist/useRefEffect.d.ts +0 -1
- package/dist/useRefEffect.js +0 -15
- package/dist/useRefEffect.js.map +0 -1
- package/jss-debug-loader.mjs +0 -44
- package/next-env.d.ts +0 -6
- package/next.config.js +0 -33
- package/scripts/embeddings.js +0 -93
- package/scripts/openai_embeddings.js +0 -100
- package/scripts/publish.js +0 -28
- package/scripts/test_embeddings.js +0 -47
- package/src/Badge.tsx +0 -36
- package/src/BaseButton.tsx +0 -62
- package/src/BaseInput.tsx +0 -63
- package/src/BaseLink.tsx +0 -80
- package/src/BaseList.tsx +0 -26
- package/src/BaseListAddOn.tsx +0 -10
- package/src/BaseListItem.tsx +0 -119
- package/src/BaseView.tsx +0 -57
- package/src/Box.tsx +0 -20
- package/src/Button.tsx +0 -90
- package/src/Calendar.tsx +0 -123
- package/src/Card.tsx +0 -30
- package/src/Checkbox.tsx +0 -63
- package/src/Circle.tsx +0 -24
- package/src/Column.tsx +0 -12
- package/src/DarkMode.tsx +0 -100
- package/src/DateInput.tsx +0 -63
- package/src/DatePicker.tsx +0 -67
- package/src/DatetimeInput.tsx +0 -64
- package/src/DesignBook.tsx +0 -677
- package/src/Dialog.tsx +0 -150
- package/src/Dropdown.tsx +0 -146
- package/src/Emitter.ts +0 -26
- package/src/FlexLayout.tsx +0 -53
- package/src/Icon.tsx +0 -80
- package/src/IconButton.tsx +0 -81
- package/src/IconLink.tsx +0 -59
- package/src/IconType.ts +0 -787
- package/src/Interactable.tsx +0 -210
- package/src/JSSComment.tsx +0 -56
- package/src/Link.tsx +0 -110
- package/src/List.tsx +0 -58
- package/src/ListButtonItem.tsx +0 -69
- package/src/ListDivider.tsx +0 -13
- package/src/ListHeaderItem.tsx +0 -45
- package/src/ListItem.tsx +0 -24
- package/src/ListLinkItem.tsx +0 -76
- package/src/ListSpacer.tsx +0 -14
- package/src/MenuIcon.tsx +0 -50
- package/src/NextJSRouter.tsx +0 -60
- package/src/NextJSRouterState.tsx +0 -154
- package/src/OnVisible.tsx +0 -42
- package/src/Popover.tsx +0 -145
- package/src/ProgressBar.tsx +0 -63
- package/src/ProgressCircle.tsx +0 -38
- package/src/Providers.tsx +0 -33
- package/src/RangeInput.tsx +0 -82
- package/src/ResultOrError.ts +0 -15
- package/src/RootView.tsx +0 -55
- package/src/Row.tsx +0 -12
- package/src/Select.tsx +0 -39
- package/src/StackContext.tsx +0 -52
- package/src/StaticCheckbox.tsx +0 -72
- package/src/Storage.tsx +0 -198
- package/src/Stream.tsx +0 -50
- package/src/Sublist.tsx +0 -61
- package/src/SubmitIconInput.tsx +0 -45
- package/src/Tabs.tsx +0 -110
- package/src/Text.tsx +0 -111
- package/src/TextArea.tsx +0 -58
- package/src/TextInput.tsx +0 -123
- package/src/TextInputWithState.tsx +0 -32
- package/src/TextPairing.tsx +0 -115
- package/src/TimeInput.tsx +0 -109
- package/src/Tooltip.tsx +0 -109
- package/src/aria.ts +0 -72
- package/src/docs/mdx.tsx +0 -137
- package/src/docs/pages.ts +0 -115
- package/src/docs/searchIndex.ts +0 -1
- package/src/examples/ExampleDialog.tsx +0 -28
- package/src/guid.ts +0 -7
- package/src/hash.ts +0 -21
- package/src/index.ts +0 -68
- package/src/isServer.ts +0 -3
- package/src/jss.tsx +0 -712
- package/src/jsx-dev-runtime.ts +0 -74
- package/src/jsx-runtime.ts +0 -2
- package/src/numberToBase.ts +0 -52
- package/src/pages/Badge.mdx +0 -152
- package/src/pages/Button.mdx +0 -163
- package/src/pages/Calendar.mdx +0 -254
- package/src/pages/Card.mdx +0 -147
- package/src/pages/Checkbox.mdx +0 -131
- package/src/pages/Dialog.mdx +0 -197
- package/src/pages/FlexLayout.mdx +0 -211
- package/src/pages/Hashing.mdx +0 -211
- package/src/pages/Icon.mdx +0 -171
- package/src/pages/IconButton.mdx +0 -155
- package/src/pages/Link.mdx +0 -160
- package/src/pages/List.mdx +0 -262
- package/src/pages/ListHeader.mdx +0 -220
- package/src/pages/Popover.mdx +0 -223
- package/src/pages/ProgressBar.mdx +0 -200
- package/src/pages/ProgressCircle.mdx +0 -218
- package/src/pages/RangeInput.mdx +0 -237
- package/src/pages/Tabs.mdx +0 -281
- package/src/pages/Text.mdx +0 -154
- package/src/pages/TextInput.mdx +0 -235
- package/src/pages/TextPairing.mdx +0 -204
- package/src/pages/TimeInput.mdx +0 -178
- package/src/pages/Tooltip.mdx +0 -115
- package/src/pages/_app.tsx +0 -466
- package/src/pages/_document.tsx +0 -30
- package/src/pages/css-in-js.mdx +0 -240
- package/src/pages/index.mdx +0 -58
- package/src/pages/navigation.mdx +0 -158
- package/src/pages/prism.css +0 -3
- package/src/pages/useCookie.mdx +0 -176
- package/src/pages/useKeyboard.mdx +0 -257
- package/src/pages/useNavigation.mdx +0 -258
- package/src/pages/usePromise.mdx +0 -280
- package/src/pages/useRefEffect.mdx +0 -251
- package/src/stateMachineContextFactory.tsx +0 -111
- package/src/useCookie.tsx +0 -95
- package/src/useKeyboard.tsx +0 -43
- package/src/useNavigation.tsx +0 -89
- package/src/usePromise.tsx +0 -18
- package/src/useRefEffect.tsx +0 -18
- package/src/vite-plugin-jss-debug.ts +0 -77
- package/tsconfig.build.json +0 -23
- package/tsconfig.json +0 -38
package/src/RootView.tsx
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useRef, useCallback } from "react";
|
|
2
|
-
|
|
3
|
-
import { Column } from "./Column";
|
|
4
|
-
import { useIsTopOfStack } from "./StackContext";
|
|
5
|
-
import { queryFocusables } from "./aria";
|
|
6
|
-
import { cssVar } from "./jss";
|
|
7
|
-
|
|
8
|
-
export function RootView({
|
|
9
|
-
children,
|
|
10
|
-
focusOnlyOnFirstMount = true,
|
|
11
|
-
}: {
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
focusOnlyOnFirstMount?: boolean;
|
|
14
|
-
}) {
|
|
15
|
-
const isTopOfStack = useIsTopOfStack();
|
|
16
|
-
const firstMountRef = useRef(true);
|
|
17
|
-
const refCallback = useCallback(
|
|
18
|
-
(element) => {
|
|
19
|
-
if (!element) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!isTopOfStack) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (focusOnlyOnFirstMount && !firstMountRef.current) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const focusables = queryFocusables(element);
|
|
32
|
-
const firstFocusable = focusables[0];
|
|
33
|
-
firstMountRef.current = false;
|
|
34
|
-
firstFocusable && firstFocusable.focus();
|
|
35
|
-
},
|
|
36
|
-
[isTopOfStack, focusOnlyOnFirstMount]
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Column
|
|
41
|
-
ref={refCallback}
|
|
42
|
-
jss={{
|
|
43
|
-
marginBottom: 0,
|
|
44
|
-
flexGrow: 1,
|
|
45
|
-
flexShrink: 1,
|
|
46
|
-
flexBasis: "0%",
|
|
47
|
-
overflow: "auto",
|
|
48
|
-
backgroundColor: cssVar("--secondary-background"),
|
|
49
|
-
minHeight: "600px",
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
{children}
|
|
53
|
-
</Column>
|
|
54
|
-
);
|
|
55
|
-
}
|
package/src/Row.tsx
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FlexLayout, FlexLayoutProps } from "./FlexLayout";
|
|
3
|
-
|
|
4
|
-
export interface RowProps extends FlexLayoutProps {
|
|
5
|
-
direction?: "row";
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const Row = React.forwardRef(
|
|
9
|
-
(props: RowProps, ref?: React.Ref<HTMLElement>) => {
|
|
10
|
-
return <FlexLayout ref={ref} direction="row" {...props} />;
|
|
11
|
-
}
|
|
12
|
-
);
|
package/src/Select.tsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
import { JSS, cssVar, toClassnames } from "./jss";
|
|
3
|
-
|
|
4
|
-
export interface SelectProps extends React.HTMLAttributes<HTMLSelectElement> {
|
|
5
|
-
value: string;
|
|
6
|
-
onValueChange: (value: string) => void;
|
|
7
|
-
jss?: JSS;
|
|
8
|
-
ref?: React.Ref<HTMLSelectElement>;
|
|
9
|
-
className?: undefined;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const Select = forwardRef(
|
|
13
|
-
(
|
|
14
|
-
{ jss, children, onValueChange, value, ...otherProps }: SelectProps,
|
|
15
|
-
ref?: React.Ref<HTMLSelectElement>
|
|
16
|
-
) => {
|
|
17
|
-
return (
|
|
18
|
-
<select
|
|
19
|
-
ref={ref}
|
|
20
|
-
className={toClassnames([
|
|
21
|
-
{
|
|
22
|
-
fontSize: 20,
|
|
23
|
-
border: `1px solid ${cssVar("--divider")}`,
|
|
24
|
-
backgroundColor: cssVar("--overlay-background"),
|
|
25
|
-
borderRadius: cssVar("--border-radius-m"),
|
|
26
|
-
},
|
|
27
|
-
jss,
|
|
28
|
-
])}
|
|
29
|
-
value={value}
|
|
30
|
-
onChange={(e) => {
|
|
31
|
-
onValueChange(e.target.value);
|
|
32
|
-
}}
|
|
33
|
-
{...otherProps}
|
|
34
|
-
>
|
|
35
|
-
{children}
|
|
36
|
-
</select>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
);
|
package/src/StackContext.tsx
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useContext,
|
|
3
|
-
useState,
|
|
4
|
-
ReactNode,
|
|
5
|
-
useMemo,
|
|
6
|
-
useRef,
|
|
7
|
-
useEffect,
|
|
8
|
-
} from "react";
|
|
9
|
-
import { createEmitter, Subscribe } from "./Emitter";
|
|
10
|
-
|
|
11
|
-
type State = {
|
|
12
|
-
subscribe: Subscribe<boolean>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const StackContext = React.createContext<State>({
|
|
16
|
-
subscribe: () => {
|
|
17
|
-
return () => {};
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
type Props = {
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
isTopOfStack: boolean;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export function StackContextProvider({ children, isTopOfStack }: Props) {
|
|
27
|
-
const emitterRef = useRef(createEmitter<boolean>());
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
emitterRef.current.emit(isTopOfStack);
|
|
31
|
-
}, [isTopOfStack]);
|
|
32
|
-
|
|
33
|
-
const value = useMemo(
|
|
34
|
-
() => ({ subscribe: emitterRef.current.subscribe }),
|
|
35
|
-
[]
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<StackContext.Provider value={value}>{children}</StackContext.Provider>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function useIsTopOfStack() {
|
|
44
|
-
const [isTopOfStack, setIsTopOfStack] = useState<boolean>(true);
|
|
45
|
-
const { subscribe } = useContext(StackContext);
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
return subscribe(setIsTopOfStack);
|
|
49
|
-
}, [subscribe]);
|
|
50
|
-
|
|
51
|
-
return isTopOfStack;
|
|
52
|
-
}
|
package/src/StaticCheckbox.tsx
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BaseView } from "./BaseView";
|
|
3
|
-
import { Icon } from "./Icon";
|
|
4
|
-
import { JSS, Size, cssVar } from "./jss";
|
|
5
|
-
import { IconType } from "./IconType";
|
|
6
|
-
|
|
7
|
-
type StaticCheckboxProps = {
|
|
8
|
-
checked: boolean;
|
|
9
|
-
size: Size;
|
|
10
|
-
icon?: IconType;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const styles: { [key: string]: JSS } = {
|
|
14
|
-
border: {
|
|
15
|
-
position: "absolute",
|
|
16
|
-
top: "var(--spacing-xs)",
|
|
17
|
-
bottom: "var(--spacing-xs)",
|
|
18
|
-
left: "var(--spacing-xs)",
|
|
19
|
-
right: "var(--spacing-xs)",
|
|
20
|
-
border: "1px solid var(--divider)",
|
|
21
|
-
borderRadius: "50%",
|
|
22
|
-
},
|
|
23
|
-
borderChecked: {
|
|
24
|
-
border: "none",
|
|
25
|
-
backgroundColor: "var(--highlight)",
|
|
26
|
-
},
|
|
27
|
-
icon: {
|
|
28
|
-
position: "absolute",
|
|
29
|
-
display: "flex",
|
|
30
|
-
justifyContent: "center",
|
|
31
|
-
alignItems: "center",
|
|
32
|
-
top: "var(--spacing-xs)",
|
|
33
|
-
bottom: "var(--spacing-xs)",
|
|
34
|
-
left: "var(--spacing-xs)",
|
|
35
|
-
right: "var(--spacing-xs)",
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const sizes = {
|
|
40
|
-
xsmall: 20,
|
|
41
|
-
small: 24,
|
|
42
|
-
medium: 32,
|
|
43
|
-
large: 40,
|
|
44
|
-
xlarge: 48,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export function StaticCheckbox({
|
|
48
|
-
checked,
|
|
49
|
-
size,
|
|
50
|
-
icon = "fa-check",
|
|
51
|
-
}: StaticCheckboxProps) {
|
|
52
|
-
return (
|
|
53
|
-
<BaseView
|
|
54
|
-
jss={{
|
|
55
|
-
position: "relative",
|
|
56
|
-
backgroundColor: cssVar("--primary-background"),
|
|
57
|
-
overflow: "hidden",
|
|
58
|
-
padding: cssVar("--spacing-xs"),
|
|
59
|
-
borderRadius: sizes[size] / 2,
|
|
60
|
-
height: sizes[size],
|
|
61
|
-
width: sizes[size],
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
64
|
-
<BaseView jss={[styles.border, checked && styles.borderChecked]} />
|
|
65
|
-
{checked && (
|
|
66
|
-
<BaseView jss={styles.icon}>
|
|
67
|
-
<Icon size={size} color="light" icon={icon} />
|
|
68
|
-
</BaseView>
|
|
69
|
-
)}
|
|
70
|
-
</BaseView>
|
|
71
|
-
);
|
|
72
|
-
}
|
package/src/Storage.tsx
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
useState,
|
|
4
|
-
useCallback,
|
|
5
|
-
useEffect,
|
|
6
|
-
createContext,
|
|
7
|
-
ReactNode,
|
|
8
|
-
useRef,
|
|
9
|
-
} from "react";
|
|
10
|
-
import { Callback, createEmitter } from "./Emitter";
|
|
11
|
-
|
|
12
|
-
const VERSION = 1;
|
|
13
|
-
|
|
14
|
-
export function createStorage<State>({
|
|
15
|
-
initialState,
|
|
16
|
-
name = "aidos-storage",
|
|
17
|
-
}: {
|
|
18
|
-
initialState: State;
|
|
19
|
-
name?: string;
|
|
20
|
-
}) {
|
|
21
|
-
const StorageContext = createContext<{
|
|
22
|
-
subscribe: <T>(selector: (state: State) => T) => () => void;
|
|
23
|
-
mutate: (mutator: (state: State) => State) => void;
|
|
24
|
-
persist: () => Promise<void>;
|
|
25
|
-
}>({
|
|
26
|
-
subscribe: () => {
|
|
27
|
-
throw new Error("Not implemented");
|
|
28
|
-
},
|
|
29
|
-
mutate: () => {
|
|
30
|
-
throw new Error("Not implemented");
|
|
31
|
-
},
|
|
32
|
-
persist: () => {
|
|
33
|
-
throw new Error("Not implemented");
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const state = { current: initialState };
|
|
38
|
-
|
|
39
|
-
function Storage({ children }: { children: ReactNode }): React.JSX.Element {
|
|
40
|
-
const emitterRef = useRef(createEmitter<State>());
|
|
41
|
-
|
|
42
|
-
const subscribe = useCallback((callback: Callback<State>) => {
|
|
43
|
-
return emitterRef.current.subscribe(callback);
|
|
44
|
-
}, []);
|
|
45
|
-
|
|
46
|
-
const mutate = useCallback((mutator: (state: State) => State) => {
|
|
47
|
-
state.current = mutator(state.current);
|
|
48
|
-
emitterRef.current.emit(state.current);
|
|
49
|
-
}, []);
|
|
50
|
-
|
|
51
|
-
const persist = useCallback(async () => {
|
|
52
|
-
const s = JSON.stringify(state.current);
|
|
53
|
-
const bytes = new TextEncoder().encode(s);
|
|
54
|
-
const blob = new Blob([bytes], {
|
|
55
|
-
type: "application/json;charset=utf-8",
|
|
56
|
-
});
|
|
57
|
-
return saveBlob(blob);
|
|
58
|
-
}, []);
|
|
59
|
-
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
getBlob().then((blob) => {
|
|
62
|
-
if (blob == null) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const fr = new FileReader();
|
|
67
|
-
|
|
68
|
-
fr.onload = (event) => {
|
|
69
|
-
const text = event.target.result.toString();
|
|
70
|
-
state.current = JSON.parse(text);
|
|
71
|
-
emitterRef.current.emit(state.current);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
fr.onerror = (error) => {
|
|
75
|
-
// reject(error);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
fr.readAsText(blob);
|
|
79
|
-
});
|
|
80
|
-
}, []);
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<StorageContext.Provider
|
|
84
|
-
value={{
|
|
85
|
-
subscribe,
|
|
86
|
-
mutate,
|
|
87
|
-
persist,
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
{children}
|
|
91
|
-
</StorageContext.Provider>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function useStorage<T>(selector: (state: State) => T): T {
|
|
96
|
-
const [localState, setLocalState] = useState(() => selector(state.current));
|
|
97
|
-
const { subscribe } = React.useContext(StorageContext);
|
|
98
|
-
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
return subscribe((newState) => {
|
|
101
|
-
const newLocalState = selector(newState);
|
|
102
|
-
setLocalState((prev) => (newLocalState != prev ? newLocalState : prev));
|
|
103
|
-
});
|
|
104
|
-
}, []);
|
|
105
|
-
|
|
106
|
-
return localState;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function useMutation(): (mutator: (state: State) => State) => void {
|
|
110
|
-
const { mutate } = React.useContext(StorageContext);
|
|
111
|
-
return mutate;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function usePersist() {
|
|
115
|
-
const { persist } = React.useContext(StorageContext);
|
|
116
|
-
return persist;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const dbPromise: Promise<IDBDatabase> = new Promise((resolve, reject) => {
|
|
120
|
-
const request = window.indexedDB.open(name, VERSION);
|
|
121
|
-
|
|
122
|
-
request.onerror = (event) => {
|
|
123
|
-
reject(event);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
request.onupgradeneeded = (event) => {
|
|
127
|
-
// @ts-ignore
|
|
128
|
-
const db: IDBDatabase = event.target.result;
|
|
129
|
-
const table = db.createObjectStore("blobs", {
|
|
130
|
-
keyPath: "key",
|
|
131
|
-
});
|
|
132
|
-
table.createIndex("key", "key", { unique: true });
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
request.onsuccess = (event) => {
|
|
136
|
-
// @ts-ignore
|
|
137
|
-
const db: IDBDatabase = event.target.result;
|
|
138
|
-
resolve(db);
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
const getBlob = async (): Promise<Blob | null> => {
|
|
143
|
-
const db = await dbPromise;
|
|
144
|
-
return new Promise((resolve, reject) => {
|
|
145
|
-
const transaction = db.transaction(["blobs"]);
|
|
146
|
-
const objectStore = transaction.objectStore("blobs");
|
|
147
|
-
const get: IDBRequest<Blob> = objectStore.get(1);
|
|
148
|
-
|
|
149
|
-
transaction.onerror = (event) => {
|
|
150
|
-
db.close();
|
|
151
|
-
reject(event);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
get.onsuccess = (event) => {
|
|
155
|
-
// @ts-ignore
|
|
156
|
-
const result: DBStorage = event.target.result;
|
|
157
|
-
|
|
158
|
-
if (result && result.blob) {
|
|
159
|
-
resolve(result.blob);
|
|
160
|
-
} else {
|
|
161
|
-
resolve(null);
|
|
162
|
-
}
|
|
163
|
-
db.close();
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
get.onerror = (event) => {
|
|
167
|
-
reject(event);
|
|
168
|
-
};
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const saveBlob = async (blob: Blob): Promise<void> => {
|
|
173
|
-
const db = await dbPromise;
|
|
174
|
-
return new Promise((resolve, reject) => {
|
|
175
|
-
const transaction = db.transaction(["blobs"], "readwrite");
|
|
176
|
-
|
|
177
|
-
transaction.oncomplete = () => {
|
|
178
|
-
db.close();
|
|
179
|
-
resolve();
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
transaction.onerror = (event) => {
|
|
183
|
-
db.close();
|
|
184
|
-
reject(event);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const objectStore = transaction.objectStore("blobs");
|
|
188
|
-
objectStore.put({ blob, key: 1 });
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
return {
|
|
193
|
-
Storage,
|
|
194
|
-
useStorage,
|
|
195
|
-
useMutation,
|
|
196
|
-
usePersist,
|
|
197
|
-
};
|
|
198
|
-
}
|
package/src/Stream.tsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { startTransition, useEffect, useRef, useState } from "react";
|
|
2
|
-
|
|
3
|
-
export const useStream = ({
|
|
4
|
-
render,
|
|
5
|
-
bufferStart,
|
|
6
|
-
bufferEnd,
|
|
7
|
-
index,
|
|
8
|
-
debounce = 100,
|
|
9
|
-
}) => {
|
|
10
|
-
const cache = useRef({
|
|
11
|
-
[index]: render(index),
|
|
12
|
-
});
|
|
13
|
-
const [frame, setFrame] = useState(cache.current[index]);
|
|
14
|
-
const timeout = useRef(null);
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
clearTimeout(timeout.current);
|
|
18
|
-
const subscriptions = [];
|
|
19
|
-
|
|
20
|
-
timeout.current = setTimeout(() => {
|
|
21
|
-
for (let i = index - bufferStart; i < index + bufferEnd; i++) {
|
|
22
|
-
subscriptions.push(
|
|
23
|
-
requestIdleCallback(() => {
|
|
24
|
-
if (!(i in cache.current)) {
|
|
25
|
-
cache.current[i] = render(i);
|
|
26
|
-
|
|
27
|
-
if (i === index) {
|
|
28
|
-
setFrame(cache.current[index]);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
startTransition(() => {
|
|
36
|
-
setFrame(cache.current[index]);
|
|
37
|
-
});
|
|
38
|
-
}, debounce);
|
|
39
|
-
|
|
40
|
-
return () => {
|
|
41
|
-
subscriptions.forEach((handle) => {
|
|
42
|
-
cancelIdleCallback(handle);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
}, [index]);
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
frame,
|
|
49
|
-
};
|
|
50
|
-
};
|
package/src/Sublist.tsx
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import { ListButtonItem } from "./ListButtonItem";
|
|
3
|
-
import { Icon } from "./Icon";
|
|
4
|
-
import { Box } from "./Box";
|
|
5
|
-
import { Row } from "./Row";
|
|
6
|
-
import { JSS } from "./jss";
|
|
7
|
-
|
|
8
|
-
export function Sublist({
|
|
9
|
-
children,
|
|
10
|
-
label,
|
|
11
|
-
labelBold,
|
|
12
|
-
initialState = { collapsed: false },
|
|
13
|
-
jss,
|
|
14
|
-
secondaryAddOn,
|
|
15
|
-
}: {
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
label: string;
|
|
18
|
-
labelBold?: boolean;
|
|
19
|
-
initialState?: {
|
|
20
|
-
collapsed: boolean;
|
|
21
|
-
};
|
|
22
|
-
jss?: JSS;
|
|
23
|
-
secondaryAddOn?: ReactNode;
|
|
24
|
-
}) {
|
|
25
|
-
const [collapsed, setCollapsed] = React.useState(initialState.collapsed);
|
|
26
|
-
return (
|
|
27
|
-
<>
|
|
28
|
-
<ListButtonItem
|
|
29
|
-
headline={label}
|
|
30
|
-
headlineBold={labelBold}
|
|
31
|
-
onClick={() => setCollapsed((x) => !x)}
|
|
32
|
-
jss={jss}
|
|
33
|
-
addOn={
|
|
34
|
-
<Row gap="medium" align="center">
|
|
35
|
-
{secondaryAddOn}
|
|
36
|
-
<Box
|
|
37
|
-
padding="medium"
|
|
38
|
-
jss={[
|
|
39
|
-
{
|
|
40
|
-
transition: "transform 0.15s ease-in",
|
|
41
|
-
},
|
|
42
|
-
!collapsed && {
|
|
43
|
-
transform: "rotateZ(90deg)",
|
|
44
|
-
},
|
|
45
|
-
]}
|
|
46
|
-
>
|
|
47
|
-
<Icon
|
|
48
|
-
color="primary"
|
|
49
|
-
size="medium"
|
|
50
|
-
icon="fa-solid:chevron-right"
|
|
51
|
-
/>
|
|
52
|
-
</Box>
|
|
53
|
-
</Row>
|
|
54
|
-
}
|
|
55
|
-
addOnPosition="end"
|
|
56
|
-
color="primary"
|
|
57
|
-
/>
|
|
58
|
-
{collapsed ? null : children}
|
|
59
|
-
</>
|
|
60
|
-
);
|
|
61
|
-
}
|
package/src/SubmitIconInput.tsx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BaseInput, BaseInputProps } from "./BaseInput";
|
|
3
|
-
import { Box } from "./Box";
|
|
4
|
-
import { Icon } from "./Icon";
|
|
5
|
-
import { IconType } from "./IconType";
|
|
6
|
-
|
|
7
|
-
interface SubmitIconInputProps extends BaseInputProps {
|
|
8
|
-
icon: IconType;
|
|
9
|
-
type?: "submit";
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function SubmitIconInput({ icon, ...otherProps }: SubmitIconInputProps) {
|
|
13
|
-
return (
|
|
14
|
-
<BaseInput
|
|
15
|
-
label={
|
|
16
|
-
<Box
|
|
17
|
-
jss={{
|
|
18
|
-
cursor: "pointer",
|
|
19
|
-
display: "flex",
|
|
20
|
-
justifyContent: "center",
|
|
21
|
-
alignItems: "center",
|
|
22
|
-
":hover": {
|
|
23
|
-
backgroundColor: "var(--secondary-background)",
|
|
24
|
-
opacity: 0.8,
|
|
25
|
-
},
|
|
26
|
-
":active": {
|
|
27
|
-
transform: "scale(0.92)",
|
|
28
|
-
},
|
|
29
|
-
height: 32,
|
|
30
|
-
width: 32,
|
|
31
|
-
borderRadius: 16,
|
|
32
|
-
}}
|
|
33
|
-
>
|
|
34
|
-
<Icon icon={icon} size="medium" color="primary" />
|
|
35
|
-
</Box>
|
|
36
|
-
}
|
|
37
|
-
{...otherProps}
|
|
38
|
-
type="submit"
|
|
39
|
-
jss={{
|
|
40
|
-
visibility: "hidden",
|
|
41
|
-
}}
|
|
42
|
-
value=""
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
}
|
package/src/Tabs.tsx
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { BaseLink } from "./BaseLink";
|
|
2
|
-
import { Row, RowProps } from "./Row";
|
|
3
|
-
import { JSS, Padding, Size, cssVar, getPadding } from "./jss";
|
|
4
|
-
import { useNavigation } from "./useNavigation";
|
|
5
|
-
import { Text } from "./Text";
|
|
6
|
-
import { ReactNode } from "react";
|
|
7
|
-
import { BaseButton } from "./BaseButton";
|
|
8
|
-
|
|
9
|
-
export type Tab = {
|
|
10
|
-
label: string;
|
|
11
|
-
href?: string;
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
addOn?: ReactNode;
|
|
15
|
-
addOnPosition?: "start" | "end";
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export interface TabsProps extends RowProps {
|
|
19
|
-
["aria-controls"]: string;
|
|
20
|
-
tabs: Array<Tab>;
|
|
21
|
-
labelSize?: Size;
|
|
22
|
-
bare?: boolean;
|
|
23
|
-
tabPadding?: Padding;
|
|
24
|
-
jssTab?: JSS | ((data: { selected: boolean }) => JSS);
|
|
25
|
-
labelRenderer?: (label: string) => ReactNode;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function Tabs({
|
|
29
|
-
tabs,
|
|
30
|
-
gap = "none",
|
|
31
|
-
padding = "none",
|
|
32
|
-
tabPadding = "medium",
|
|
33
|
-
labelSize = "large",
|
|
34
|
-
jss,
|
|
35
|
-
jssTab,
|
|
36
|
-
labelRenderer,
|
|
37
|
-
["aria-controls"]: ariaControls,
|
|
38
|
-
...otherProps
|
|
39
|
-
}: TabsProps) {
|
|
40
|
-
const root = useNavigation();
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Row
|
|
44
|
-
role="tablist"
|
|
45
|
-
jss={jss}
|
|
46
|
-
gap={gap}
|
|
47
|
-
padding={padding}
|
|
48
|
-
ref={root}
|
|
49
|
-
{...otherProps}
|
|
50
|
-
>
|
|
51
|
-
{tabs.map(
|
|
52
|
-
({
|
|
53
|
-
label,
|
|
54
|
-
href,
|
|
55
|
-
onClick,
|
|
56
|
-
selected,
|
|
57
|
-
addOn,
|
|
58
|
-
addOnPosition = "start",
|
|
59
|
-
}) => {
|
|
60
|
-
const BaseComponent = href != null ? BaseLink : BaseButton;
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<BaseComponent
|
|
64
|
-
aria-controls={ariaControls}
|
|
65
|
-
role="tab"
|
|
66
|
-
aria-selected={selected ? "true" : undefined}
|
|
67
|
-
key={label}
|
|
68
|
-
bare
|
|
69
|
-
color={selected ? "positive" : "primary"}
|
|
70
|
-
href={href}
|
|
71
|
-
onClick={onClick}
|
|
72
|
-
animateInteraction={false}
|
|
73
|
-
jss={[
|
|
74
|
-
{
|
|
75
|
-
textDecoration: "none",
|
|
76
|
-
borderBottom: selected
|
|
77
|
-
? `3px solid ${cssVar("--highlight")}`
|
|
78
|
-
: `3px solid transparent`,
|
|
79
|
-
":active span": {
|
|
80
|
-
transform: "scale(0.97)",
|
|
81
|
-
},
|
|
82
|
-
":first-child": {
|
|
83
|
-
borderTopLeftRadius: cssVar("--border-radius-m"),
|
|
84
|
-
},
|
|
85
|
-
":last-child": {
|
|
86
|
-
borderTopRightRadius: cssVar("--border-radius-m"),
|
|
87
|
-
},
|
|
88
|
-
":hover": {
|
|
89
|
-
backgroundColor: cssVar("--hovered-background"),
|
|
90
|
-
},
|
|
91
|
-
":active:hover": {
|
|
92
|
-
backgroundColor: cssVar("--pressed-background"),
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
getPadding(tabPadding),
|
|
96
|
-
typeof jssTab === "function" ? jssTab({ selected }) : jssTab,
|
|
97
|
-
]}
|
|
98
|
-
>
|
|
99
|
-
{addOnPosition === "start" && addOn}
|
|
100
|
-
<Text size={labelSize} color={selected ? "primary" : "secondary"}>
|
|
101
|
-
{labelRenderer ? labelRenderer(label) : label}
|
|
102
|
-
</Text>
|
|
103
|
-
{addOnPosition === "end" && addOn}
|
|
104
|
-
</BaseComponent>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
)}
|
|
108
|
-
</Row>
|
|
109
|
-
);
|
|
110
|
-
}
|