@a-type/ui 1.7.11 → 1.8.0
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/cjs/components/box/Box.d.ts +4 -1
- package/dist/cjs/components/box/Box.js +7 -5
- package/dist/cjs/components/box/Box.js.map +1 -1
- package/dist/cjs/components/box/Box.stories.js +1 -1
- package/dist/cjs/components/box/Box.stories.js.map +1 -1
- package/dist/cjs/components/card/Card.d.ts +2 -2
- package/dist/cjs/components/card/Card.js +2 -1
- package/dist/cjs/components/card/Card.js.map +1 -1
- package/dist/cjs/components/card/Card.stories.d.ts +1 -1
- package/dist/cjs/components/contextMenu/contextMenu.js +5 -4
- package/dist/cjs/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/cjs/components/dialog/Dialog.js +10 -9
- package/dist/cjs/components/dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js +4 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/cjs/components/layouts/PageNav.js +2 -1
- package/dist/cjs/components/layouts/PageNav.js.map +1 -1
- package/dist/cjs/components/layouts/PageNowPlaying.js +11 -10
- package/dist/cjs/components/layouts/PageNowPlaying.js.map +1 -1
- package/dist/cjs/components/popover/Popover.js +8 -7
- package/dist/cjs/components/popover/Popover.js.map +1 -1
- package/dist/cjs/components/select/Select.js +2 -1
- package/dist/cjs/components/select/Select.js.map +1 -1
- package/dist/cjs/components/tooltip/Tooltip.d.ts +2 -2
- package/dist/cjs/components/tooltip/Tooltip.js +2 -1
- package/dist/cjs/components/tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/uno.preset.js +5 -5
- package/dist/cjs/uno.preset.js.map +1 -1
- package/dist/css/main.css +1 -1
- package/dist/esm/components/box/Box.d.ts +4 -1
- package/dist/esm/components/box/Box.js +4 -3
- package/dist/esm/components/box/Box.js.map +1 -1
- package/dist/esm/components/box/Box.stories.js +1 -1
- package/dist/esm/components/box/Box.stories.js.map +1 -1
- package/dist/esm/components/card/Card.d.ts +2 -2
- package/dist/esm/components/card/Card.js +3 -2
- package/dist/esm/components/card/Card.js.map +1 -1
- package/dist/esm/components/card/Card.stories.d.ts +1 -1
- package/dist/esm/components/contextMenu/contextMenu.js +5 -4
- package/dist/esm/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/esm/components/dialog/Dialog.js +10 -9
- package/dist/esm/components/dialog/Dialog.js.map +1 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.js +4 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/esm/components/layouts/PageNav.js +2 -1
- package/dist/esm/components/layouts/PageNav.js.map +1 -1
- package/dist/esm/components/layouts/PageNowPlaying.js +11 -10
- package/dist/esm/components/layouts/PageNowPlaying.js.map +1 -1
- package/dist/esm/components/popover/Popover.js +8 -7
- package/dist/esm/components/popover/Popover.js.map +1 -1
- package/dist/esm/components/select/Select.js +2 -1
- package/dist/esm/components/select/Select.js.map +1 -1
- package/dist/esm/components/tooltip/Tooltip.js +2 -1
- package/dist/esm/components/tooltip/Tooltip.js.map +1 -1
- package/dist/esm/uno.preset.js +5 -5
- package/dist/esm/uno.preset.js.map +1 -1
- package/package.json +1 -1
- package/src/components/box/Box.stories.tsx +5 -5
- package/src/components/box/Box.tsx +5 -4
- package/src/components/card/Card.tsx +3 -2
- package/src/components/contextMenu/contextMenu.tsx +20 -17
- package/src/components/dialog/Dialog.tsx +26 -23
- package/src/components/dropdownMenu/DropdownMenu.tsx +10 -1
- package/src/components/layouts/PageNav.tsx +4 -1
- package/src/components/layouts/PageNowPlaying.tsx +24 -21
- package/src/components/popover/Popover.tsx +20 -17
- package/src/components/select/Select.tsx +27 -24
- package/src/components/tooltip/Tooltip.tsx +17 -14
- package/src/uno.preset.ts +5 -5
|
@@ -2,6 +2,7 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
|
2
2
|
import classNames from 'clsx';
|
|
3
3
|
import { ComponentPropsWithoutRef } from 'react';
|
|
4
4
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
5
|
+
import { BoxContext } from '../box/Box.js';
|
|
5
6
|
|
|
6
7
|
export const ContextMenuRoot = ContextMenuPrimitive.Root;
|
|
7
8
|
|
|
@@ -15,23 +16,25 @@ export const ContextMenuContent = function Content({
|
|
|
15
16
|
}) {
|
|
16
17
|
return (
|
|
17
18
|
<ContextMenuPrimitive.Portal>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
ev
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
20
|
+
<ContextMenuPrimitive.Content
|
|
21
|
+
className={classNames(
|
|
22
|
+
'layer-components:(min-w-120px bg-white rounded-md border-default overflow-hidden p-1 shadow-md z-menu)',
|
|
23
|
+
'layer-components:transform-origin-[var(--radix-context-menu-transform-origin)]',
|
|
24
|
+
'layer-components:[&[data-state=open]]:animate-popover-in',
|
|
25
|
+
'layer-components:[&[data-state=closed]]:animate-popover-out',
|
|
26
|
+
'layer-components:(max-h-[var(--radix-context-menu-content-available-height)] overflow-y-auto)',
|
|
27
|
+
'important:motion-reduce:animate-none',
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
onClick={(ev) => {
|
|
31
|
+
ev.stopPropagation();
|
|
32
|
+
onClick?.(ev);
|
|
33
|
+
}}
|
|
34
|
+
ref={ref}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
</BoxContext.Provider>
|
|
35
38
|
</ContextMenuPrimitive.Portal>
|
|
36
39
|
);
|
|
37
40
|
};
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from 'react';
|
|
16
16
|
import useMergedRef from '../../hooks/useMergedRef.js';
|
|
17
17
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
18
|
+
import { BoxContext } from '../box/Box.js';
|
|
18
19
|
import { Button } from '../button/index.js';
|
|
19
20
|
import { useParticles } from '../particles/index.js';
|
|
20
21
|
import { useConfig } from '../provider/Provider.js';
|
|
@@ -121,29 +122,31 @@ export const Content = function Content({
|
|
|
121
122
|
return (
|
|
122
123
|
<DialogPrimitive.Portal>
|
|
123
124
|
<StyledOverlay />
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
125
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
126
|
+
<StyledContent
|
|
127
|
+
data-dialog-content
|
|
128
|
+
ref={finalRef}
|
|
129
|
+
{...props}
|
|
130
|
+
className={classNames(
|
|
131
|
+
{
|
|
132
|
+
'md:max-w-800px': width === 'lg',
|
|
133
|
+
'max-w-600px': width === 'md',
|
|
134
|
+
'max-w-300px': width === 'sm',
|
|
135
|
+
},
|
|
136
|
+
!disableSheet && sheetClassNames,
|
|
137
|
+
!disableSheet &&
|
|
138
|
+
virtualKeyboardBehavior === 'overlay' &&
|
|
139
|
+
sheetClassNameWithOverlayKeyboard,
|
|
140
|
+
!disableSheet &&
|
|
141
|
+
virtualKeyboardBehavior === 'displace' &&
|
|
142
|
+
sheetClassNameWithDisplaceKeyboard,
|
|
143
|
+
outerClassName || className,
|
|
144
|
+
)}
|
|
145
|
+
>
|
|
146
|
+
{!disableSheet && <DialogSwipeHandle />}
|
|
147
|
+
{children}
|
|
148
|
+
</StyledContent>
|
|
149
|
+
</BoxContext.Provider>
|
|
147
150
|
</DialogPrimitive.Portal>
|
|
148
151
|
);
|
|
149
152
|
};
|
|
@@ -3,9 +3,18 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
3
3
|
import classNames, { clsx } from 'clsx';
|
|
4
4
|
import { Ref } from 'react';
|
|
5
5
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
6
|
+
import { BoxContext } from '../box/Box.js';
|
|
6
7
|
|
|
7
8
|
const StyledContent = withClassName(
|
|
8
|
-
|
|
9
|
+
function DropdownMenuContent(
|
|
10
|
+
props: DropdownMenuPrimitive.DropdownMenuContentProps,
|
|
11
|
+
) {
|
|
12
|
+
return (
|
|
13
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
14
|
+
<DropdownMenuPrimitive.Content {...props} />
|
|
15
|
+
</BoxContext.Provider>
|
|
16
|
+
);
|
|
17
|
+
},
|
|
9
18
|
'min-w-220px bg-white z-menu shadow-lg rounded-lg border-default',
|
|
10
19
|
'layer-components:transform-origin-[var(--radix-dropdown-menu-transform-origin)]',
|
|
11
20
|
'layer-components:[&[data-state=open]]:animate-popover-in',
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import classNames from 'clsx';
|
|
4
4
|
import { HTMLAttributes, useRef } from 'react';
|
|
5
5
|
import { useBoundsCssVars } from '../../hooks.js';
|
|
6
|
+
import { BoxContext } from '../box/Box.js';
|
|
6
7
|
import { HideWhileKeyboardOpen } from '../utility/HideWhileKeyboardOpen.js';
|
|
7
8
|
|
|
8
9
|
export function PageNav({
|
|
@@ -30,7 +31,9 @@ export function PageNav({
|
|
|
30
31
|
)}
|
|
31
32
|
ref={ref}
|
|
32
33
|
>
|
|
33
|
-
{
|
|
34
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
35
|
+
{children}
|
|
36
|
+
</BoxContext.Provider>
|
|
34
37
|
</HideWhileKeyboardOpen>
|
|
35
38
|
);
|
|
36
39
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import classNames from 'clsx';
|
|
4
4
|
import { HTMLAttributes } from 'react';
|
|
5
|
+
import { BoxContext } from '../box/Box.js';
|
|
5
6
|
import { useConfig } from '../provider/Provider.js';
|
|
6
7
|
|
|
7
8
|
export function PageNowPlaying({
|
|
@@ -16,26 +17,28 @@ export function PageNowPlaying({
|
|
|
16
17
|
const { virtualKeyboardBehavior } = useConfig();
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
21
|
+
<div
|
|
22
|
+
{...props}
|
|
23
|
+
className={classNames(
|
|
24
|
+
'layer-components:(fixed left-0 right-0 z-now-playing flex flex-col gap-2 items-end)',
|
|
25
|
+
// on mobile, this must be positioned above any nav bar that's present,
|
|
26
|
+
// or at minimum in the safe area
|
|
27
|
+
'layer-components:bottom-[var(--nav-height,env(safe-area-inset-bottom,0px))]',
|
|
28
|
+
'layer-components:transition-bottom',
|
|
29
|
+
'layer-components:sm:(fixed bottom-3 left-[var(--content-left,20%)] transition-opacity top-auto items-end w-[var(--content-width,100%)] max-w-80vw p-0 opacity-[var(--content-ready,0)])',
|
|
30
|
+
unstyled
|
|
31
|
+
? 'layer-variants:p-2'
|
|
32
|
+
: 'layer-components:(bg-wash p-2px rounded-xl border-light shadow-md min-w-32px items-center justify-center m-2 w-auto)',
|
|
33
|
+
keepAboveKeyboard &&
|
|
34
|
+
virtualKeyboardBehavior === 'overlay' &&
|
|
35
|
+
'layer-variants:lt-sm:bottom-[max(var(--mock-virtual-keyboard-height,env(keyboard-inset-height,0px),var(--nav-height,env(safe-area-inset-bottom,0px))))]',
|
|
36
|
+
keepAboveKeyboard &&
|
|
37
|
+
virtualKeyboardBehavior === 'displace' &&
|
|
38
|
+
'layer-variants:lt-sm:bottom-[max(var(--viewport-bottom-offset,0px),var(--nav-height,env(safe-area-inset-bottom,0px)))]',
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
/>
|
|
42
|
+
</BoxContext.Provider>
|
|
40
43
|
);
|
|
41
44
|
}
|
|
@@ -5,6 +5,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
|
5
5
|
import classNames from 'clsx';
|
|
6
6
|
import { Ref } from 'react';
|
|
7
7
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
8
|
+
import { BoxContext } from '../box/Box.js';
|
|
8
9
|
|
|
9
10
|
const StyledContent = withClassName(
|
|
10
11
|
PopoverPrimitive.Content,
|
|
@@ -54,23 +55,25 @@ export const PopoverContent = function PopoverContent({
|
|
|
54
55
|
}) {
|
|
55
56
|
return (
|
|
56
57
|
<PopoverPrimitive.Portal forceMount={forceMount}>
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
59
|
+
<StyledContent
|
|
60
|
+
{...props}
|
|
61
|
+
forceMount={forceMount}
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={classNames(
|
|
64
|
+
{
|
|
65
|
+
'layer-variants:important:p-0': padding === 'none',
|
|
66
|
+
'layer-variants:p-5': padding === 'default',
|
|
67
|
+
'layer-variants:rounded-none': radius === 'none',
|
|
68
|
+
'layer-variants:rounded-lg': radius === 'default',
|
|
69
|
+
'layer-variants:rounded-md': radius === 'md',
|
|
70
|
+
},
|
|
71
|
+
className,
|
|
72
|
+
)}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
</StyledContent>
|
|
76
|
+
</BoxContext.Provider>
|
|
74
77
|
</PopoverPrimitive.Portal>
|
|
75
78
|
);
|
|
76
79
|
};
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
useContext,
|
|
18
18
|
} from 'react';
|
|
19
19
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
20
|
+
import { BoxContext } from '../box/Box.js';
|
|
20
21
|
import { Button, ButtonProps, getButtonClassName } from '../button/index.js';
|
|
21
22
|
import { Icon } from '../icon/index.js';
|
|
22
23
|
|
|
@@ -147,30 +148,32 @@ export const SelectContent = withPassthroughNativeRender(
|
|
|
147
148
|
({ ref: forwardedRef, children, inDialog, className, ...props }) => {
|
|
148
149
|
return (
|
|
149
150
|
<SelectPrimitive.Portal>
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
151
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
152
|
+
<SelectPrimitive.Content
|
|
153
|
+
className={classNames(
|
|
154
|
+
'layer-components:(overflow-hidden bg-white rounded-lg border border-solid border border-black z-menu shadow-lg)',
|
|
155
|
+
'layer-components:transform-origin-[var(--radix-select-content-transform-origin)]',
|
|
156
|
+
'layer-components:[&[data-state=open]]:animate-popover-in',
|
|
157
|
+
'layer-components:[&[data-state=closed]]:animate-popover-out',
|
|
158
|
+
'layer-components:(min-w-[var(--radix-select-trigger-width)] max-h-[var(--radix-select-content-available-height)])',
|
|
159
|
+
inDialog && 'z-[calc(var(--z-dialog)+1)]',
|
|
160
|
+
className,
|
|
161
|
+
)}
|
|
162
|
+
style={zIndex}
|
|
163
|
+
{...props}
|
|
164
|
+
ref={forwardedRef}
|
|
165
|
+
>
|
|
166
|
+
<SelectPrimitive.ScrollUpButton className="flex items-center justify-center h-25px bg-white color-primary-dark cursor-default">
|
|
167
|
+
<ChevronUpIcon />
|
|
168
|
+
</SelectPrimitive.ScrollUpButton>
|
|
169
|
+
<SelectPrimitive.Viewport className="p-1">
|
|
170
|
+
{children}
|
|
171
|
+
</SelectPrimitive.Viewport>
|
|
172
|
+
<SelectPrimitive.ScrollDownButton className="flex items-center justify-center h-25px bg-white color-primary-dark cursor-default">
|
|
173
|
+
<ChevronDownIcon />
|
|
174
|
+
</SelectPrimitive.ScrollDownButton>
|
|
175
|
+
</SelectPrimitive.Content>
|
|
176
|
+
</BoxContext.Provider>
|
|
174
177
|
</SelectPrimitive.Portal>
|
|
175
178
|
);
|
|
176
179
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
4
|
import classNames from 'clsx';
|
|
5
|
+
import { BoxContext } from '../box/Box.js';
|
|
5
6
|
|
|
6
7
|
function Content({
|
|
7
8
|
children,
|
|
@@ -10,20 +11,22 @@ function Content({
|
|
|
10
11
|
}: TooltipPrimitive.TooltipContentProps) {
|
|
11
12
|
return (
|
|
12
13
|
<TooltipPrimitive.Portal>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
<BoxContext.Provider value={{ spacingScale: 1 }}>
|
|
15
|
+
<TooltipPrimitive.Content
|
|
16
|
+
className={classNames(
|
|
17
|
+
'layer-components:(relative rounded-sm py-2 px-3 bg-black text-white text-sm leading-tight shadow-sm select-none hidden z-tooltip sm:display-initial)',
|
|
18
|
+
'[&[data-state=delayed-open]]:display-initial',
|
|
19
|
+
'[&[data-state=instant-open]]:display-initial',
|
|
20
|
+
'layer-components:transform-origin-[var(--radix-tooltip-content-transform-origin)]',
|
|
21
|
+
'layer-components:[&[data-state=delayed-open]]:animate-popover-in',
|
|
22
|
+
className,
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
<TooltipPrimitive.Arrow className="fill-black" />
|
|
28
|
+
</TooltipPrimitive.Content>
|
|
29
|
+
</BoxContext.Provider>
|
|
27
30
|
</TooltipPrimitive.Portal>
|
|
28
31
|
);
|
|
29
32
|
}
|
package/src/uno.preset.ts
CHANGED
|
@@ -130,11 +130,11 @@ export default function presetAglio({
|
|
|
130
130
|
},
|
|
131
131
|
spacing: makeSpacing(spacingIncrement),
|
|
132
132
|
borderRadius: {
|
|
133
|
-
xs:
|
|
134
|
-
sm:
|
|
135
|
-
md:
|
|
136
|
-
lg:
|
|
137
|
-
xl:
|
|
133
|
+
xs: `calc(${0.25 * roundedness}rem * var(--spacing-scale,1))`,
|
|
134
|
+
sm: `calc(${0.5 * roundedness}rem * var(--spacing-scale,1))`,
|
|
135
|
+
md: `calc(${roundedness}rem * var(--spacing-scale,1))`,
|
|
136
|
+
lg: `calc(${roundedness * 1.25}rem * var(--spacing-scale,1))`,
|
|
137
|
+
xl: `calc(${roundedness * 1.5}rem * var(--spacing-scale,1))`,
|
|
138
138
|
full: roundedness === 0 ? '0px' : '9999px',
|
|
139
139
|
},
|
|
140
140
|
lineWidth: {
|