aidos-ui 4.0.0 → 4.0.2
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/.claude/settings.local.json +14 -1
- package/CLAUDE.md +72 -0
- package/dist/BaseButton.js.map +1 -1
- package/dist/BaseLink.js.map +1 -1
- package/dist/BaseListItem.d.ts +1 -1
- package/dist/Calendar.d.ts +2 -2
- package/dist/Card.js +1 -1
- package/dist/Card.js.map +1 -1
- package/dist/DarkMode.js.map +1 -1
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dialog.d.ts +3 -3
- package/dist/Dialog.js +7 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.js.map +1 -1
- package/dist/Icon.d.ts +3 -3
- package/dist/Icon.js +2 -21
- package/dist/Icon.js.map +1 -1
- package/dist/Interactable.js.map +1 -1
- package/dist/NextJSRouterState.js.map +1 -1
- package/dist/OnVisible.d.ts +1 -1
- package/dist/OnVisible.js.map +1 -1
- package/dist/Popover.d.ts +3 -3
- package/dist/Popover.js +3 -1
- package/dist/Popover.js.map +1 -1
- package/dist/Providers.d.ts +2 -2
- package/dist/RangeInput.d.ts +1 -1
- package/dist/RootView.js.map +1 -1
- package/dist/Select.d.ts +0 -1
- package/dist/Storage.d.ts +2 -1
- package/dist/Storage.js.map +1 -1
- package/dist/Stream.js.map +1 -1
- package/dist/Text.js.map +1 -1
- package/dist/TextInput.d.ts +3 -2
- package/dist/TextInput.js +13 -4
- package/dist/TextInput.js.map +1 -1
- package/dist/TextPairing.js.map +1 -1
- package/dist/Tooltip.d.ts +2 -2
- package/dist/Tooltip.js +3 -2
- package/dist/Tooltip.js.map +1 -1
- package/dist/aria.js.map +1 -1
- package/dist/hash.js.map +1 -1
- package/dist/jss.d.ts +11 -6
- package/dist/jss.js +47 -2
- package/dist/jss.js.map +1 -1
- package/dist/numberToBase.js.map +1 -1
- package/dist/stateMachineContextFactory.js.map +1 -1
- package/dist/useCookie.js.map +1 -1
- package/dist/useKeyboard.js.map +1 -1
- package/dist/useNavigation.js.map +1 -1
- package/dist/useRefEffect.js.map +1 -1
- package/next-env.d.ts +2 -1
- package/next.config.js +2 -1
- package/package.json +27 -20
- package/src/BaseListItem.tsx +1 -1
- package/src/Calendar.tsx +2 -2
- package/src/Card.tsx +1 -1
- package/src/Dialog.tsx +10 -4
- package/src/Icon.tsx +4 -30
- package/src/Popover.tsx +6 -4
- package/src/Providers.tsx +1 -1
- package/src/RangeInput.tsx +1 -1
- package/src/Storage.tsx +1 -1
- package/src/TextInput.tsx +17 -5
- package/src/Tooltip.tsx +5 -4
- package/src/docs/mdx.tsx +40 -0
- package/src/docs/searchIndex.ts +1 -1
- package/src/jss.tsx +55 -3
- package/src/pages/Badge.mdx +136 -14
- package/src/pages/Button.mdx +121 -63
- package/src/pages/Calendar.mdx +196 -2
- package/src/pages/Card.mdx +123 -47
- package/src/pages/Checkbox.mdx +103 -28
- package/src/pages/Dialog.mdx +172 -7
- package/src/pages/FlexLayout.mdx +185 -51
- package/src/pages/Hashing.mdx +199 -8
- package/src/pages/Icon.mdx +150 -42
- package/src/pages/IconButton.mdx +127 -116
- package/src/pages/Link.mdx +118 -47
- package/src/pages/List.mdx +167 -283
- package/src/pages/ListHeader.mdx +157 -27
- package/src/pages/Popover.mdx +177 -55
- package/src/pages/ProgressBar.mdx +186 -6
- package/src/pages/ProgressCircle.mdx +196 -13
- package/src/pages/RangeInput.mdx +189 -61
- package/src/pages/Tabs.mdx +202 -346
- package/src/pages/Text.mdx +102 -81
- package/src/pages/TextInput.mdx +169 -44
- package/src/pages/TextPairing.mdx +164 -115
- package/src/pages/TimeInput.mdx +142 -37
- package/src/pages/Tooltip.mdx +99 -12
- package/src/pages/_app.tsx +13 -3
- package/src/pages/css-in-js.mdx +196 -83
- package/src/pages/navigation.mdx +122 -20
- package/src/pages/useCookie.mdx +168 -7
- package/src/pages/useKeyboard.mdx +242 -5
- package/src/pages/useNavigation.mdx +244 -16
- package/src/pages/usePromise.mdx +271 -6
- package/src/pages/useRefEffect.mdx +230 -28
- package/tsconfig.json +13 -4
package/src/Providers.tsx
CHANGED
package/src/RangeInput.tsx
CHANGED
package/src/Storage.tsx
CHANGED
|
@@ -36,7 +36,7 @@ export function createStorage<State>({
|
|
|
36
36
|
|
|
37
37
|
const state = { current: initialState };
|
|
38
38
|
|
|
39
|
-
function Storage({ children }: { children: ReactNode }): JSX.Element {
|
|
39
|
+
function Storage({ children }: { children: ReactNode }): React.JSX.Element {
|
|
40
40
|
const emitterRef = useRef(createEmitter<State>());
|
|
41
41
|
|
|
42
42
|
const subscribe = useCallback((callback: Callback<State>) => {
|
package/src/TextInput.tsx
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { BaseInput, BaseInputProps } from "./BaseInput";
|
|
3
|
-
import { Row } from "./Row";
|
|
4
|
-
import { Gap, JSS, Padding, cssVar, getPadding } from "./jss";
|
|
5
3
|
import { Column } from "./Column";
|
|
4
|
+
import { Row } from "./Row";
|
|
5
|
+
import { Gap, JSS, Padding, Size, cssVar, getPadding } from "./jss";
|
|
6
|
+
|
|
7
|
+
const fontSize = {
|
|
8
|
+
xsmall: cssVar("--font-xsmall"),
|
|
9
|
+
small: cssVar("--font-small"),
|
|
10
|
+
medium: cssVar("--font-medium"),
|
|
11
|
+
large: cssVar("--font-large"),
|
|
12
|
+
xlarge: cssVar("--font-xlarge"),
|
|
13
|
+
xxlarge: cssVar("--font-xxlarge"),
|
|
14
|
+
xxxlarge: cssVar("--font-xxxlarge"),
|
|
15
|
+
};
|
|
6
16
|
|
|
7
|
-
export interface TextInputProps extends BaseInputProps {
|
|
17
|
+
export interface TextInputProps extends Omit<BaseInputProps, "size"> {
|
|
8
18
|
onValueChange?: (value: string) => void;
|
|
9
19
|
jssRoot?: JSS;
|
|
10
20
|
addOn?: ReactNode;
|
|
@@ -13,6 +23,7 @@ export interface TextInputProps extends BaseInputProps {
|
|
|
13
23
|
onChange?: undefined;
|
|
14
24
|
padding?: Padding;
|
|
15
25
|
bare?: boolean;
|
|
26
|
+
size?: Size;
|
|
16
27
|
}
|
|
17
28
|
|
|
18
29
|
export const TextInput = React.forwardRef(
|
|
@@ -27,6 +38,7 @@ export const TextInput = React.forwardRef(
|
|
|
27
38
|
addOnPosition = "start",
|
|
28
39
|
padding = "medium",
|
|
29
40
|
bare,
|
|
41
|
+
size = "medium",
|
|
30
42
|
...inputProps
|
|
31
43
|
}: TextInputProps,
|
|
32
44
|
ref?: React.Ref<HTMLInputElement>
|
|
@@ -81,8 +93,8 @@ export const TextInput = React.forwardRef(
|
|
|
81
93
|
color: cssVar("--primary-text"),
|
|
82
94
|
outline: "none",
|
|
83
95
|
border: "none",
|
|
84
|
-
fontSize:
|
|
85
|
-
lineHeight:
|
|
96
|
+
fontSize: fontSize[size],
|
|
97
|
+
lineHeight: 1.2,
|
|
86
98
|
"::placeholder": {
|
|
87
99
|
color: cssVar("--subtle-text"),
|
|
88
100
|
},
|
package/src/Tooltip.tsx
CHANGED
|
@@ -10,11 +10,12 @@ const jsss: { [key: string]: JSS } = {
|
|
|
10
10
|
top: "-100%",
|
|
11
11
|
transform: "translateY(50%)",
|
|
12
12
|
backgroundColor: cssVar("--primary-background"),
|
|
13
|
-
padding: cssVar("--spacing-s")
|
|
13
|
+
padding: `${cssVar("--spacing-s")} ${cssVar("--spacing-m")}`,
|
|
14
14
|
borderRadius: cssVar("--border-radius-m"),
|
|
15
15
|
border: `1px solid ${cssVar("--divider")}`,
|
|
16
|
-
boxShadow:
|
|
16
|
+
boxShadow: cssVar("--shadow-md"),
|
|
17
17
|
overflow: "hidden",
|
|
18
|
+
animation: "popoverFadeIn 0.15s ease-out",
|
|
18
19
|
},
|
|
19
20
|
};
|
|
20
21
|
|
|
@@ -23,11 +24,11 @@ interface TooltipProps {
|
|
|
23
24
|
jss?: JSS;
|
|
24
25
|
className?: undefined;
|
|
25
26
|
tag?: keyof HTMLElementTagNameMap;
|
|
26
|
-
children: JSX.Element;
|
|
27
|
+
children: React.JSX.Element;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export function Tooltip({ content, jss, tag, children }: TooltipProps) {
|
|
30
|
-
const [tooltip, setTooltip] = useState<JSX.Element>(null);
|
|
31
|
+
const [tooltip, setTooltip] = useState<React.JSX.Element>(null);
|
|
31
32
|
const dialogRef = useRef(null);
|
|
32
33
|
const focusTrapRoot = useRefEffect((root: HTMLDialogElement) => {
|
|
33
34
|
dialogRef.current = root;
|
package/src/docs/mdx.tsx
CHANGED
|
@@ -83,6 +83,46 @@ const components: any = {
|
|
|
83
83
|
{children}
|
|
84
84
|
</span>
|
|
85
85
|
),
|
|
86
|
+
table: (props) => (
|
|
87
|
+
<table
|
|
88
|
+
style={{
|
|
89
|
+
width: "100%",
|
|
90
|
+
borderCollapse: "collapse",
|
|
91
|
+
marginBottom: cssVar("--spacing-l"),
|
|
92
|
+
fontSize: 14,
|
|
93
|
+
}}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
),
|
|
97
|
+
thead: (props) => (
|
|
98
|
+
<thead
|
|
99
|
+
style={{
|
|
100
|
+
borderBottom: `2px solid ${cssVar("--divider")}`,
|
|
101
|
+
}}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
),
|
|
105
|
+
th: (props) => (
|
|
106
|
+
<th
|
|
107
|
+
style={{
|
|
108
|
+
textAlign: "left",
|
|
109
|
+
padding: cssVar("--spacing-s"),
|
|
110
|
+
color: cssVar("--primary-text"),
|
|
111
|
+
fontWeight: "bold",
|
|
112
|
+
}}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
),
|
|
116
|
+
td: (props) => (
|
|
117
|
+
<td
|
|
118
|
+
style={{
|
|
119
|
+
padding: cssVar("--spacing-s"),
|
|
120
|
+
borderBottom: `1px solid ${cssVar("--divider")}`,
|
|
121
|
+
color: cssVar("--secondary-text"),
|
|
122
|
+
}}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
),
|
|
86
126
|
};
|
|
87
127
|
|
|
88
128
|
export function labelToID(string: string): string {
|