@a-type/ui 6.1.37 → 6.1.39
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/arbor/arbor.d.ts +5 -5
- package/dist/arbor/tokens.d.ts +4 -4
- package/dist/components/autocomplete/Autocomplete.js +1 -1
- package/dist/components/autocomplete/Autocomplete.js.map +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/camera/Camera.js +1 -1
- package/dist/components/camera/Camera.js.map +1 -1
- package/dist/components/card/Card.d.ts +2 -2
- package/dist/components/card/Card.js +1 -1
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/datePicker/DatePicker.d.ts +1 -1
- package/dist/components/datePicker/DatePicker.stories.d.ts +1 -1
- package/dist/components/datePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/emojiPicker/EmojiPicker.js +2 -1
- package/dist/components/emojiPicker/EmojiPicker.js.map +1 -1
- package/dist/components/globalErrorFallback/GlobalErrorFallback.js +1 -1
- package/dist/components/globalErrorFallback/GlobalErrorFallback.js.map +1 -1
- package/dist/components/input/Input.js +1 -1
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/Input.module.css +13 -4
- package/dist/components/layouts/PageNowPlaying.js +1 -1
- package/dist/components/layouts/PageRoot.js +1 -1
- package/dist/components/layouts/PageRoot.js.map +1 -1
- package/dist/components/lightbox/Lightbox.js +1 -1
- package/dist/components/lightbox/Lightbox.js.map +1 -1
- package/dist/components/lists/lists.js +1 -1
- package/dist/components/lists/lists.js.map +1 -1
- package/dist/components/marquee/marquee.js +1 -1
- package/dist/components/marquee/marquee.js.map +1 -1
- package/dist/components/navBar/NavBar.js +1 -1
- package/dist/components/navBar/NavBar.js.map +1 -1
- package/dist/components/note/Note.js +1 -1
- package/dist/components/note/Note.js.map +1 -1
- package/dist/components/progress/Progress.js +1 -1
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/provider/Provider.d.ts +0 -6
- package/dist/components/provider/Provider.js +3 -8
- package/dist/components/provider/Provider.js.map +1 -1
- package/dist/components/richEditor/richEditor.stories.js +2 -1
- package/dist/components/richEditor/richEditor.stories.js.map +1 -1
- package/dist/components/scrollArea/ScrollArea.js +1 -1
- package/dist/components/scrollArea/ScrollArea.js.map +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/splashScreen/SplashScreen.js +1 -1
- package/dist/components/splashScreen/SplashScreen.js.map +1 -1
- package/dist/components/textArea/TextArea.js +1 -1
- package/dist/components/textArea/TextArea.js.map +1 -1
- package/dist/components/utility/HideWhileKeyboardOpen.js +1 -1
- package/dist/components/utility/HideWhileKeyboardOpen.js.map +1 -1
- package/dist/components/viewport/Viewport.js +2 -1
- package/dist/components/viewport/Viewport.js.map +1 -1
- package/dist/hooks/useLongPress.d.ts +1 -1
- package/dist/hooks/useVisualViewportOffset.js +1 -1
- package/dist/hooks/useVisualViewportOffset.js.map +1 -1
- package/dist/systems/config.d.ts +6 -0
- package/dist/systems/config.js +8 -0
- package/dist/systems/config.js.map +1 -0
- package/package.json +1 -1
- package/src/components/autocomplete/Autocomplete.tsx +1 -1
- package/src/components/button/Button.tsx +1 -1
- package/src/components/camera/Camera.tsx +1 -1
- package/src/components/card/Card.tsx +1 -1
- package/src/components/combobox/Combobox.tsx +1 -1
- package/src/components/emojiPicker/EmojiPicker.tsx +2 -1
- package/src/components/globalErrorFallback/GlobalErrorFallback.tsx +1 -1
- package/src/components/input/Input.module.css +13 -4
- package/src/components/input/Input.tsx +1 -1
- package/src/components/layouts/PageNowPlaying.tsx +1 -1
- package/src/components/layouts/PageRoot.tsx +1 -1
- package/src/components/lightbox/Lightbox.tsx +1 -1
- package/src/components/lists/lists.tsx +1 -1
- package/src/components/marquee/marquee.tsx +1 -1
- package/src/components/navBar/NavBar.tsx +1 -1
- package/src/components/note/Note.tsx +1 -1
- package/src/components/progress/Progress.tsx +1 -1
- package/src/components/provider/Provider.tsx +5 -14
- package/src/components/richEditor/richEditor.stories.tsx +45 -41
- package/src/components/scrollArea/ScrollArea.tsx +1 -1
- package/src/components/slider/Slider.tsx +1 -1
- package/src/components/splashScreen/SplashScreen.tsx +1 -1
- package/src/components/textArea/TextArea.tsx +1 -1
- package/src/components/utility/HideWhileKeyboardOpen.tsx +25 -25
- package/src/components/viewport/Viewport.tsx +2 -1
- package/src/hooks/useVisualViewportOffset.ts +1 -1
- package/src/systems/config.ts +11 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { Input } from '../input/Input.js';
|
|
3
4
|
import { tipTapClassName, tipTapReadonlyClassName } from './index.js';
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
@@ -19,49 +20,52 @@ type Story = StoryObj<{ readonly: boolean }>;
|
|
|
19
20
|
export const Default: Story = {
|
|
20
21
|
render(args) {
|
|
21
22
|
return (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
<Input.Border>
|
|
24
|
+
<div
|
|
25
|
+
contentEditable={true}
|
|
26
|
+
className={clsx(
|
|
27
|
+
tipTapClassName,
|
|
28
|
+
args.readonly && tipTapReadonlyClassName,
|
|
29
|
+
)}
|
|
30
|
+
>
|
|
31
|
+
<div className="ProseMirror">
|
|
32
|
+
<p>{paragraphText}</p>
|
|
33
|
+
<h1>Heading 1</h1>
|
|
34
|
+
<p>{paragraphText}</p>
|
|
35
|
+
<h2>Heading 2</h2>
|
|
36
|
+
<p>{paragraphText}</p>
|
|
37
|
+
<p>{paragraphText}</p>
|
|
38
|
+
<hr />
|
|
39
|
+
<p>{paragraphText}</p>
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
41
|
+
<blockquote>{paragraphText}</blockquote>
|
|
42
|
+
<h3>Heading 3</h3>
|
|
43
|
+
<ul>
|
|
44
|
+
<li>{paragraphText}</li>
|
|
45
|
+
<li>{paragraphText}</li>
|
|
46
|
+
</ul>
|
|
47
|
+
<p>{paragraphText}</p>
|
|
48
|
+
<ol>
|
|
49
|
+
<li>{paragraphText}</li>
|
|
50
|
+
<li>{paragraphText}</li>
|
|
51
|
+
</ol>
|
|
52
|
+
<h4>Heading 4</h4>
|
|
53
|
+
<p>{paragraphText}</p>
|
|
54
|
+
<p>
|
|
55
|
+
<mark>Highlighted</mark> text
|
|
56
|
+
</p>
|
|
57
|
+
<p>
|
|
58
|
+
<a href="#">Link</a>
|
|
59
|
+
</p>
|
|
60
|
+
<p>
|
|
61
|
+
<strong>Bold</strong> text
|
|
62
|
+
</p>
|
|
63
|
+
<p>
|
|
64
|
+
<em>Italic</em> text
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
63
67
|
</div>
|
|
64
|
-
</
|
|
68
|
+
</Input.Border>
|
|
65
69
|
);
|
|
66
70
|
},
|
|
67
71
|
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ScrollAreaScrollbarProps,
|
|
6
6
|
} from '@base-ui/react/scroll-area';
|
|
7
7
|
import { Ref } from 'react';
|
|
8
|
-
import { withClassName } from '../../hooks.js';
|
|
8
|
+
import { withClassName } from '../../hooks/withClassName.js';
|
|
9
9
|
import cls from './ScrollArea.module.css';
|
|
10
10
|
|
|
11
11
|
export type * from '@base-ui/react/scroll-area';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Slider as BaseSlider, SliderRootProps } from '@base-ui/react/slider';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Ref } from 'react';
|
|
4
|
-
import { withClassName } from '../../hooks.js';
|
|
4
|
+
import { withClassName } from '../../hooks/withClassName.js';
|
|
5
5
|
import cls from './Slider.module.css';
|
|
6
6
|
|
|
7
7
|
export const SliderRoot = withClassName(BaseSlider.Root, cls.root);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'clsx';
|
|
2
2
|
import { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
-
import { withClassName } from '../../hooks.js';
|
|
4
3
|
import useMergedRef from '../../hooks/useMergedRef.js';
|
|
4
|
+
import { withClassName } from '../../hooks/withClassName.js';
|
|
5
5
|
import { Input, InputProps } from '../input/Input.js';
|
|
6
6
|
import cls from './TextArea.module.css';
|
|
7
7
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import clsx from 'clsx';
|
|
2
|
-
import { HTMLAttributes } from 'react';
|
|
3
|
-
import { useIsKeyboardOpen } from '../../hooks.js';
|
|
4
|
-
import { SlotDiv } from './SlotDiv.js';
|
|
5
|
-
|
|
6
|
-
export interface HideWhileKeyboardOpenProps
|
|
7
|
-
extends HTMLAttributes<HTMLDivElement> {}
|
|
8
|
-
|
|
9
|
-
export const HideWhileKeyboardOpen = function HideWhileKeyboardOpen({
|
|
10
|
-
ref,
|
|
11
|
-
className,
|
|
12
|
-
...rest
|
|
13
|
-
}: HideWhileKeyboardOpenProps & {
|
|
14
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
15
|
-
}) {
|
|
16
|
-
const isKeyboardOpen = useIsKeyboardOpen();
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<SlotDiv
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={clsx(isKeyboardOpen && 'layer-responsive:hidden', className)}
|
|
22
|
-
{...rest}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { useIsKeyboardOpen } from '../../hooks/useVisualViewportOffset.js';
|
|
4
|
+
import { SlotDiv } from './SlotDiv.js';
|
|
5
|
+
|
|
6
|
+
export interface HideWhileKeyboardOpenProps
|
|
7
|
+
extends HTMLAttributes<HTMLDivElement> {}
|
|
8
|
+
|
|
9
|
+
export const HideWhileKeyboardOpen = function HideWhileKeyboardOpen({
|
|
10
|
+
ref,
|
|
11
|
+
className,
|
|
12
|
+
...rest
|
|
13
|
+
}: HideWhileKeyboardOpenProps & {
|
|
14
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
15
|
+
}) {
|
|
16
|
+
const isKeyboardOpen = useIsKeyboardOpen();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<SlotDiv
|
|
20
|
+
ref={ref}
|
|
21
|
+
className={clsx(isKeyboardOpen && 'layer-responsive:hidden', className)}
|
|
22
|
+
{...rest}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
useState,
|
|
11
11
|
} from 'react';
|
|
12
12
|
import { createPortal } from 'react-dom';
|
|
13
|
-
import { useSizeCssVars, useStableCallback } from '../../hooks.js';
|
|
14
13
|
import useMergedRef from '../../hooks/useMergedRef.js';
|
|
14
|
+
import { useSizeCssVars } from '../../hooks/useSize.js';
|
|
15
|
+
import { useStableCallback } from '../../hooks/useStableCallback.js';
|
|
15
16
|
import { Box, BoxProps } from '../box/Box.js';
|
|
16
17
|
import {
|
|
17
18
|
useKeyboardControls,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
export const ConfigContext = createContext<{
|
|
4
|
+
virtualKeyboardBehavior: 'overlay' | 'displace';
|
|
5
|
+
}>({
|
|
6
|
+
virtualKeyboardBehavior: 'displace',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export function useConfig() {
|
|
10
|
+
return useContext(ConfigContext);
|
|
11
|
+
}
|