@a-type/ui 1.3.6 → 1.4.1
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/colorMode.d.ts +3 -0
- package/dist/cjs/colorMode.js +57 -0
- package/dist/cjs/colorMode.js.map +1 -0
- package/dist/cjs/components/actions/ActionButton.d.ts +1 -3
- package/dist/cjs/components/actions/ActionButton.js +2 -2
- package/dist/cjs/components/actions/ActionButton.js.map +1 -1
- package/dist/cjs/components/box/Box.d.ts +2 -1
- package/dist/cjs/components/box/Box.js +1 -1
- package/dist/cjs/components/box/Box.js.map +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/input/Input.stories.d.ts +5 -1
- package/dist/cjs/components/input/Input.stories.js +3 -1
- package/dist/cjs/components/input/Input.stories.js.map +1 -1
- package/dist/cjs/components/select/Select.d.ts +2 -2
- package/dist/cjs/components/select/Select.js +2 -2
- package/dist/cjs/components/select/Select.js.map +1 -1
- package/dist/cjs/components/select/Select.stories.d.ts +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/css/main.css +1 -1
- package/dist/esm/colorMode.d.ts +3 -0
- package/dist/esm/colorMode.js +52 -0
- package/dist/esm/colorMode.js.map +1 -0
- package/dist/esm/components/actions/ActionButton.d.ts +1 -3
- package/dist/esm/components/actions/ActionButton.js +3 -3
- package/dist/esm/components/actions/ActionButton.js.map +1 -1
- package/dist/esm/components/box/Box.d.ts +2 -1
- package/dist/esm/components/box/Box.js +1 -1
- package/dist/esm/components/box/Box.js.map +1 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.js +1 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/input/Input.stories.d.ts +5 -1
- package/dist/esm/components/input/Input.stories.js +3 -1
- package/dist/esm/components/input/Input.stories.js.map +1 -1
- package/dist/esm/components/select/Select.d.ts +2 -2
- package/dist/esm/components/select/Select.js +2 -2
- package/dist/esm/components/select/Select.js.map +1 -1
- package/dist/esm/components/select/Select.stories.d.ts +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/colorMode.ts +64 -0
- package/src/components/actions/ActionButton.tsx +3 -4
- package/src/components/box/Box.tsx +4 -2
- package/src/components/dropdownMenu/DropdownMenu.tsx +1 -1
- package/src/components/input/Input.stories.tsx +3 -1
- package/src/components/input/Input.tsx +1 -0
- package/src/components/select/Select.tsx +2 -1
- package/src/index.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.stories.js","sourceRoot":"","sources":["../../../../src/components/input/Input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,IAAI,GAAG;IACZ,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"Input.stories.js","sourceRoot":"","sources":["../../../../src/components/input/Input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,IAAI,GAAG;IACZ,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE;QACT,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KAChC;IACD,UAAU,EAAE;QACX,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC5B;CAC4B,CAAC;AAE/B,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU,EAAE,CAAC"}
|
|
@@ -15,7 +15,7 @@ export declare const SelectTriggerBase: FunctionComponent<SelectPrimitive.Select
|
|
|
15
15
|
export declare const UnstyledSelectTrigger: FunctionComponent<SelectPrimitive.SelectTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
export interface SelectTriggerProps extends ButtonProps {
|
|
17
17
|
}
|
|
18
|
-
export declare const SelectTrigger: ({ ref, children, ...props }: SelectTriggerProps & {
|
|
18
|
+
export declare const SelectTrigger: ({ ref, children, asChild, ...props }: SelectTriggerProps & {
|
|
19
19
|
ref?: React.Ref<HTMLButtonElement>;
|
|
20
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export declare const SelectValue: FunctionComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -47,7 +47,7 @@ export declare const Select: (<T extends string = string>({ children, value, onV
|
|
|
47
47
|
ref?: React.Ref<HTMLDivElement>;
|
|
48
48
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
49
49
|
Group: (props: SelectPrimitive.SelectGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
Trigger: ({ ref, children, ...props }: SelectTriggerProps & {
|
|
50
|
+
Trigger: ({ ref, children, asChild, ...props }: SelectTriggerProps & {
|
|
51
51
|
ref?: React.Ref<HTMLButtonElement>;
|
|
52
52
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
53
53
|
Value: FunctionComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -43,8 +43,8 @@ export const selectTriggerClassName = classNames(getButtonClassName({ color: 'de
|
|
|
43
43
|
export const SelectTriggerBase = withNoNativeRender(withClassName(SelectPrimitive.Trigger, selectTriggerClassName));
|
|
44
44
|
export const UnstyledSelectTrigger = withNoNativeRender(SelectPrimitive.Trigger);
|
|
45
45
|
export const SelectTrigger = function SelectTrigger(_a) {
|
|
46
|
-
var { ref, children } = _a, props = __rest(_a, ["ref", "children"]);
|
|
47
|
-
return (_jsx(UnstyledSelectTrigger, Object.assign({ asChild: true }, props, { ref: ref, children: _jsx(Button, { className: "gap-2 font-normal", children: children || (_jsxs(_Fragment, { children: [_jsx(SelectValue, {}), _jsx(SelectIcon, {})] })) }) })));
|
|
46
|
+
var { ref, children, asChild } = _a, props = __rest(_a, ["ref", "children", "asChild"]);
|
|
47
|
+
return (_jsx(UnstyledSelectTrigger, Object.assign({ asChild: true }, props, { ref: ref, children: _jsx(Button, { className: "gap-2 font-normal", asChild: asChild, children: children || (_jsxs(_Fragment, { children: [_jsx(SelectValue, {}), _jsx(SelectIcon, {})] })) }) })));
|
|
48
48
|
};
|
|
49
49
|
export const SelectValue = withNoNativeRender(withClassName(SelectPrimitive.Value, 'flex flex-row'));
|
|
50
50
|
export const SelectLabel = withNoNativeRender(withClassName(SelectPrimitive.Label, 'px-25px text-xs leading-6 color-black select-none'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/components/select/Select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;AAEb,OAAO,EACN,SAAS,EACT,eAAe,EACf,aAAa,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,UAAU,MAAM,MAAM,CAAC;AAC9B,OAAO,EAMN,aAAa,EACb,UAAU,GACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAe,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAO1B,EAAE,EAAE;QAPsB,EAC1B,GAAG,EAAE,YAAY,EACjB,QAAQ,EACR,SAAS,OAI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;AACH,CAAC;AAED,uCAAuC;AACvC,MAAM,eAAe,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAE7C,SAAS,kBAAkB,CAC1B,SAAY;IAEZ,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAAE,EAAE;QACzC,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;QAE7C,IAAI,QAAQ;YAAE,OAAO,IAAI,CAAC;QAE1B,OAAO,KAAC,SAAS,oBAAK,KAAK,EAAI,CAAC;IACjC,CAAC,CAAC;IACF,OAAO,kBAAyB,CAAC;AAClC,CAAC;AAED,SAAS,2BAA2B,CAElC,SAAY;IACb,MAAM,2BAA2B,GAAG,CAAC,KAAU,EAAE,EAAE;QAClD,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;QAE7C,IAAI,QAAQ,EAAE,CAAC;YACd,OAAO,4BAAG,KAAK,CAAC,QAAQ,GAAI,CAAC;QAC9B,CAAC;QAED,OAAO,KAAC,SAAS,oBAAK,KAAK,EAAI,CAAC;IACjC,CAAC,CAAC;IACF,OAAO,2BAAkC,CAAC;AAC3C,CAAC"}
|
|
@@ -8,7 +8,7 @@ declare const meta: {
|
|
|
8
8
|
ref?: React.Ref<HTMLDivElement>;
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
Group: (props: import("@radix-ui/react-select").SelectGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
Trigger: ({ ref, children, ...props }: import("./Select.js").SelectTriggerProps & {
|
|
11
|
+
Trigger: ({ ref, children, asChild, ...props }: import("./Select.js").SelectTriggerProps & {
|
|
12
12
|
ref?: React.Ref<HTMLButtonElement>;
|
|
13
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
Value: import("react").FunctionComponent<import("@radix-ui/react-select").SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
package/src/colorMode.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export function setColorMode(mode: 'system' | 'light' | 'dark') {
|
|
2
|
+
if (mode === 'system') {
|
|
3
|
+
window.localStorage.removeItem('colorMode');
|
|
4
|
+
} else {
|
|
5
|
+
window.localStorage.setItem('colorMode', mode);
|
|
6
|
+
}
|
|
7
|
+
window.dispatchEvent(new Event('colorModeChanged'));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const updateMode = () => {
|
|
11
|
+
const mode = window.localStorage.getItem('colorMode');
|
|
12
|
+
document.documentElement.classList.remove('override-light', 'override-dark');
|
|
13
|
+
if (mode) {
|
|
14
|
+
document.documentElement.classList.add('override-' + mode);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// determine final mode, even if it's system
|
|
18
|
+
const finalMode =
|
|
19
|
+
mode ||
|
|
20
|
+
(window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
21
|
+
? 'dark'
|
|
22
|
+
: 'light');
|
|
23
|
+
// set the status bar color in pwas
|
|
24
|
+
const iosStatusBarColor = document.querySelector(
|
|
25
|
+
'meta[name=apple-mobile-web-app-status-bar-style]',
|
|
26
|
+
);
|
|
27
|
+
const androidStatusBarColor = document.querySelector(
|
|
28
|
+
'meta[name=theme-color]',
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// evaluate the var(--color-wash) css var for the bar color
|
|
32
|
+
const root = document.documentElement;
|
|
33
|
+
const cssVar = '--color-wash';
|
|
34
|
+
const color = getComputedStyle(root).getPropertyValue(cssVar);
|
|
35
|
+
|
|
36
|
+
if (finalMode === 'dark') {
|
|
37
|
+
iosStatusBarColor?.setAttribute('content', 'black');
|
|
38
|
+
androidStatusBarColor?.setAttribute('content', color);
|
|
39
|
+
}
|
|
40
|
+
if (finalMode === 'light') {
|
|
41
|
+
iosStatusBarColor?.setAttribute('content', 'white');
|
|
42
|
+
androidStatusBarColor?.setAttribute('content', color);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
updateMode();
|
|
46
|
+
|
|
47
|
+
// listen for changes and apply an override-mode to the html
|
|
48
|
+
window.addEventListener('colorModeChanged', updateMode);
|
|
49
|
+
|
|
50
|
+
export function getColorMode(): 'system' | 'light' | 'dark' {
|
|
51
|
+
return (window.localStorage.getItem('colorMode') as any) || 'system';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function subscribeToColorModeChange(
|
|
55
|
+
callback: (mode: 'system' | 'light' | 'dark') => void,
|
|
56
|
+
) {
|
|
57
|
+
const update = () => callback(getColorMode());
|
|
58
|
+
window.addEventListener('colorModeChanged', update);
|
|
59
|
+
return () => {
|
|
60
|
+
window.removeEventListener('colorModeChanged', update);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
(window as any).setColorMode = setColorMode;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import classNames from 'clsx';
|
|
4
|
-
import {
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
5
|
import { Button, ButtonProps } from '../button/Button.js';
|
|
6
6
|
import { CollapsibleContent, CollapsibleRoot } from '../collapsible/index.js';
|
|
7
7
|
|
|
8
8
|
export interface ActionButtonProps extends ButtonProps {
|
|
9
|
-
icon?: ReactNode;
|
|
10
9
|
visible?: boolean;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export function ActionButton({
|
|
14
|
-
icon,
|
|
15
13
|
children,
|
|
16
14
|
className,
|
|
17
15
|
visible = true,
|
|
16
|
+
asChild,
|
|
18
17
|
...rest
|
|
19
18
|
}: ActionButtonProps) {
|
|
20
19
|
// this rather convoluted logic is meant to do:
|
|
@@ -48,9 +47,9 @@ export function ActionButton({
|
|
|
48
47
|
'hover:bg-gray2',
|
|
49
48
|
className,
|
|
50
49
|
)}
|
|
50
|
+
asChild={asChild}
|
|
51
51
|
{...rest}
|
|
52
52
|
>
|
|
53
|
-
{icon}
|
|
54
53
|
{children}
|
|
55
54
|
</Button>
|
|
56
55
|
</CollapsibleContent>
|
|
@@ -16,6 +16,7 @@ export type BoxSpacingSize = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
|
16
16
|
export interface BoxProps extends Omit<SlotDivProps, 'wrap'> {
|
|
17
17
|
className?: string;
|
|
18
18
|
direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse';
|
|
19
|
+
d?: 'row' | 'col' | 'row-reverse' | 'col-reverse';
|
|
19
20
|
items?: BoxAlignment;
|
|
20
21
|
justify?: BoxJustification;
|
|
21
22
|
align?: `${BoxAlignment} ${BoxJustification}`;
|
|
@@ -31,13 +32,14 @@ export interface BoxProps extends Omit<SlotDivProps, 'wrap'> {
|
|
|
31
32
|
|
|
32
33
|
export function Box({
|
|
33
34
|
className,
|
|
34
|
-
direction,
|
|
35
35
|
items: itemsSolo,
|
|
36
36
|
justify: justifySolo,
|
|
37
37
|
align,
|
|
38
38
|
gap = 'md',
|
|
39
39
|
wrap,
|
|
40
|
-
p = '
|
|
40
|
+
p = 'none',
|
|
41
|
+
d = 'row',
|
|
42
|
+
direction = d,
|
|
41
43
|
container,
|
|
42
44
|
style: userStyle,
|
|
43
45
|
surface,
|
|
@@ -55,7 +55,7 @@ const StyledRadioItem = withClassName(
|
|
|
55
55
|
|
|
56
56
|
const StyledLabel = withClassName(
|
|
57
57
|
DropdownMenuPrimitive.Label,
|
|
58
|
-
'pl-
|
|
58
|
+
'pl-3 py-1 font-bold text-sm leading-6 color-gray-9',
|
|
59
59
|
);
|
|
60
60
|
|
|
61
61
|
const StyledSeparator = withClassName(
|
|
@@ -7,6 +7,7 @@ export const inputClassName = classNames(
|
|
|
7
7
|
'layer-components:(px-5 py-[5px] text-md font-sans rounded-20px bg-white select-auto min-w-60px color-black border-solid border-1 border-gray-5 shadow-sm-inset)',
|
|
8
8
|
'layer-components:focus:(outline-none bg-gray-1 ring-4 ring-white)',
|
|
9
9
|
'layer-components:focus-visible:(outline-none ring-gray-dark-blend)',
|
|
10
|
+
'layer-components:disabled:(bg-transparent border-gray-5 placeholder-gray-7 shadow-none)',
|
|
10
11
|
'layer-components:md:(min-w-120px)',
|
|
11
12
|
);
|
|
12
13
|
|
|
@@ -89,13 +89,14 @@ export interface SelectTriggerProps extends ButtonProps {}
|
|
|
89
89
|
export const SelectTrigger = function SelectTrigger({
|
|
90
90
|
ref,
|
|
91
91
|
children,
|
|
92
|
+
asChild,
|
|
92
93
|
...props
|
|
93
94
|
}: SelectTriggerProps & {
|
|
94
95
|
ref?: React.Ref<HTMLButtonElement>;
|
|
95
96
|
}) {
|
|
96
97
|
return (
|
|
97
98
|
<UnstyledSelectTrigger asChild {...props} ref={ref}>
|
|
98
|
-
<Button className="gap-2 font-normal">
|
|
99
|
+
<Button className="gap-2 font-normal" asChild={asChild}>
|
|
99
100
|
{children || (
|
|
100
101
|
<>
|
|
101
102
|
<SelectValue />
|