@tempots/ui 0.1.0 → 0.3.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/README.md +1 -1
- package/components/pop-over.d.ts +13 -0
- package/index.cjs +1 -0
- package/index.d.ts +1 -24
- package/index.js +1440 -20
- package/package.json +15 -38
- package/components/Box/Box.d.ts +0 -8
- package/components/Box/Box.js +0 -8
- package/components/Button/Button.d.ts +0 -12
- package/components/Button/Button.js +0 -19
- package/components/Control/Control.d.ts +0 -8
- package/components/Control/Control.js +0 -16
- package/components/Field/Field.d.ts +0 -11
- package/components/Field/Field.js +0 -37
- package/components/Field/field-layout.d.ts +0 -1
- package/components/Field/field-layout.js +0 -1
- package/components/Fieldset/Fieldset.d.ts +0 -8
- package/components/Fieldset/Fieldset.js +0 -12
- package/components/Fieldset/fieldset-context.d.ts +0 -7
- package/components/Fieldset/fieldset-context.js +0 -3
- package/components/Group/Group.d.ts +0 -13
- package/components/Group/Group.js +0 -28
- package/components/Input/BaseInput.d.ts +0 -10
- package/components/Input/BaseInput.js +0 -17
- package/components/Input/FloatInput.d.ts +0 -10
- package/components/Input/FloatInput.js +0 -14
- package/components/Input/IntInput.d.ts +0 -9
- package/components/Input/IntInput.js +0 -25
- package/components/Input/NativeSelect.d.ts +0 -11
- package/components/Input/NativeSelect.js +0 -27
- package/components/Input/TextInput.d.ts +0 -7
- package/components/Input/TextInput.js +0 -9
- package/components/Input/UnitInput.d.ts +0 -10
- package/components/Input/UnitInput.js +0 -14
- package/components/Popover/Popover.d.ts +0 -9
- package/components/Popover/Popover.js +0 -35
- package/components/Popover/UnstyledPopover.d.ts +0 -19
- package/components/Popover/UnstyledPopover.js +0 -97
- package/components/Popover/index.d.ts +0 -2
- package/components/Popover/index.js +0 -2
- package/components/SegmentedControl/SegmentedControl.d.ts +0 -9
- package/components/SegmentedControl/SegmentedControl.js +0 -16
- package/components/Stack/Stack.d.ts +0 -11
- package/components/Stack/Stack.js +0 -18
- package/components/StyleProvider/StyleProvider.d.ts +0 -37
- package/components/StyleProvider/StyleProvider.js +0 -103
- package/components/Tooltip/index.d.ts +0 -5
- package/components/Tooltip/index.js +0 -31
- package/components/styling/Sizing.d.ts +0 -10
- package/components/styling/Sizing.js +0 -5
- package/components/styling/Spacing.d.ts +0 -28
- package/components/styling/Spacing.js +0 -49
- package/components/styling/Sx.d.ts +0 -6
- package/components/styling/Sx.js +0 -6
- package/styles/color.d.ts +0 -1
- package/styles/color.js +0 -1
- package/styles/reset.d.ts +0 -1
- package/styles/reset.js +0 -283
- package/styles/side.d.ts +0 -1
- package/styles/side.js +0 -1
- package/styles/size.d.ts +0 -5
- package/styles/size.js +0 -44
- package/styles/sx.d.ts +0 -9
- package/styles/sx.js +0 -28
- package/styles/ui-styles.d.ts +0 -67
- package/styles/ui-styles.js +0 -118
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type JSX, type Signal } from '@tempots/dom';
|
|
2
|
-
export interface SegmentedControlProps<T> {
|
|
3
|
-
options: Signal<T[]>;
|
|
4
|
-
value: Signal<T>;
|
|
5
|
-
onChange?: (value: T) => void;
|
|
6
|
-
display?: (value: T) => JSX.DOMNode;
|
|
7
|
-
equality?: (a: T, b: T) => boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function SegmentedControl<T>(props: SegmentedControlProps<T>): JSX.DOMNode;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@tempots/dom/jsx-runtime";
|
|
2
|
-
import { For } from '@tempots/dom';
|
|
3
|
-
import { strictEqual } from '@tempots/std/equals';
|
|
4
|
-
import { Box } from '../Box/Box';
|
|
5
|
-
import { Control } from '../Control/Control';
|
|
6
|
-
import { Sx } from '../styling/Sx';
|
|
7
|
-
function Segment({ value, display, selected, onChange }) {
|
|
8
|
-
return (_jsx(Box, { children: _jsxs("button", { onClick: () => { onChange(value.get()); }, disabled: selected, children: [_jsx(Sx, { sx: { display: 'inline', fontWeight: selected.map(v => v ? 'bold' : 'normal') } }), value.map(display)] }) }));
|
|
9
|
-
}
|
|
10
|
-
export function SegmentedControl(props) {
|
|
11
|
-
const options = props.options;
|
|
12
|
-
const equality = props.equality ?? strictEqual;
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
14
|
-
const onChange = props.onChange ?? (() => { });
|
|
15
|
-
return (_jsx(Control, { children: _jsx(For, { of: options, children: (option) => _jsx(Segment, { value: option, display: props.display ?? String, selected: option.combine(props.value, equality), onChange: onChange }) }) }));
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type JSX, Signal } from '@tempots/dom';
|
|
2
|
-
import { type Size } from '../../styles/size';
|
|
3
|
-
export type AlignItems = 'flex-start' | 'flex-end' | 'center' | 'start' | 'end' | 'self-start' | 'self-end' | 'baseline' | 'stretch' | 'safe' | 'unsafe';
|
|
4
|
-
export type JustifyContent = 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'left' | 'right' | 'normal' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'safe center' | 'unsafe center' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset';
|
|
5
|
-
export interface StackProps {
|
|
6
|
-
align?: Signal<AlignItems>;
|
|
7
|
-
justify?: Signal<JustifyContent>;
|
|
8
|
-
spacing?: Signal<number> | Signal<Size>;
|
|
9
|
-
children?: JSX.DOMNode;
|
|
10
|
-
}
|
|
11
|
-
export declare const Stack: (props: StackProps) => JSX.DOMNode;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@tempots/dom/jsx-runtime";
|
|
2
|
-
import { Consumer, Signal } from '@tempots/dom';
|
|
3
|
-
import { StyleMarker } from '../StyleProvider/StyleProvider';
|
|
4
|
-
import { Sx } from '../styling/Sx';
|
|
5
|
-
export const Stack = (props) => {
|
|
6
|
-
const { children, align, justify, spacing } = props;
|
|
7
|
-
return (_jsx(Consumer, { mark: StyleMarker, children: ({ styles }) => {
|
|
8
|
-
return (_jsxs("div", { children: [_jsx(Sx, { sx: {
|
|
9
|
-
display: 'flex',
|
|
10
|
-
flexDirection: 'column',
|
|
11
|
-
alignItems: align ?? Signal.of('normal'),
|
|
12
|
-
justifyContent: justify,
|
|
13
|
-
gap: (spacing ?? Signal.of('md')).combine(styles, (sp, st) => {
|
|
14
|
-
return (typeof sp === 'number' ? sp : st.styles.spacing[sp]);
|
|
15
|
-
})
|
|
16
|
-
} }), children] }));
|
|
17
|
-
} }));
|
|
18
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { type JSX, Prop, type Signal } from '@tempots/dom';
|
|
2
|
-
import { type Size } from '../../styles/size';
|
|
3
|
-
import { type UIStyles } from '../../styles/ui-styles';
|
|
4
|
-
export interface Styles {
|
|
5
|
-
components: UIComponentStyles;
|
|
6
|
-
styles: UIStyles;
|
|
7
|
-
}
|
|
8
|
-
export interface UITheme {
|
|
9
|
-
styles: Signal<Styles>;
|
|
10
|
-
isLight: Prop<boolean>;
|
|
11
|
-
}
|
|
12
|
-
export interface StyleProviderProps {
|
|
13
|
-
children?: JSX.Element;
|
|
14
|
-
}
|
|
15
|
-
export declare const StyleMarker: symbol;
|
|
16
|
-
export declare const StyleProvider: ({ children }: StyleProviderProps) => JSX.DOMNode;
|
|
17
|
-
export type ComponentClasses<T> = (options: T) => string;
|
|
18
|
-
export interface UIComponentStyles {
|
|
19
|
-
button: {
|
|
20
|
-
root: ComponentClasses<ButtonStyles>;
|
|
21
|
-
content: ComponentClasses<ButtonStyles>;
|
|
22
|
-
};
|
|
23
|
-
control: {
|
|
24
|
-
root: ComponentClasses<ControlStyles>;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'danger';
|
|
28
|
-
export interface ButtonStyles {
|
|
29
|
-
size: Size | number;
|
|
30
|
-
compact: boolean;
|
|
31
|
-
variant: ButtonVariant;
|
|
32
|
-
}
|
|
33
|
-
export interface ControlStyles {
|
|
34
|
-
size: Size;
|
|
35
|
-
spacing: Size;
|
|
36
|
-
}
|
|
37
|
-
export declare const defaultComponentStyle: ({ font, border, spacing, background, control }: UIStyles) => UIComponentStyles;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@tempots/dom/jsx-runtime";
|
|
2
|
-
import { css } from '@emotion/css';
|
|
3
|
-
import { Portal, Prop, OnRemove, Provider, makeProviderMark, When } from '@tempots/dom';
|
|
4
|
-
import { resetCss } from '../../styles/reset';
|
|
5
|
-
import { getRadiusSize, getSize } from '../../styles/size';
|
|
6
|
-
import { defaultDarkStyles, defaultLightStyles } from '../../styles/ui-styles';
|
|
7
|
-
import { Sx } from '../styling/Sx';
|
|
8
|
-
export const StyleMarker = makeProviderMark();
|
|
9
|
-
const counter = Prop.of(0);
|
|
10
|
-
export const StyleProvider = ({ children }) => {
|
|
11
|
-
const isLight = Prop.of(true);
|
|
12
|
-
const styles = isLight.map(v => {
|
|
13
|
-
if (v) {
|
|
14
|
-
return {
|
|
15
|
-
components: defaultComponentStyle(defaultLightStyles),
|
|
16
|
-
styles: defaultLightStyles
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return {
|
|
21
|
-
components: defaultComponentStyle(defaultDarkStyles),
|
|
22
|
-
styles: defaultDarkStyles
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
counter.update(v => v + 1);
|
|
27
|
-
return (_jsxs(Provider, { value: { styles, isLight }, mark: StyleMarker, children: [_jsx(Sx, { sx: { backgroundColor: styles.map(v => v.styles.background.color) } }), _jsx(When, { is: counter.map(v => v > 0), children: _jsx(Portal, { selector: "head", children: _jsx("style", { children: resetCss }) }) }), children, _jsx(OnRemove, { clear: () => { counter.update(v => v - 1); } })] }));
|
|
28
|
-
};
|
|
29
|
-
export const defaultComponentStyle = ({ font, border, spacing, background, control }) => {
|
|
30
|
-
return {
|
|
31
|
-
button: {
|
|
32
|
-
root: ({ size, variant, compact }) => {
|
|
33
|
-
const obj = {
|
|
34
|
-
alignContent: 'center',
|
|
35
|
-
display: 'inline-flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
fontWeight: 500,
|
|
38
|
-
fontSize: getSize(size, 'md', font.size),
|
|
39
|
-
borderRadius: getRadiusSize('md', 'sm', border.radius),
|
|
40
|
-
border: `1px solid ${control.borderColor}`,
|
|
41
|
-
backgroundColor: background.color,
|
|
42
|
-
color: font.color,
|
|
43
|
-
padding: `0 ${spacing.md / (compact ? 2 : 1)}px`,
|
|
44
|
-
textShadow: control.accentTextShadow,
|
|
45
|
-
boxShadow: control.shadow,
|
|
46
|
-
// minWidth: getSize(size, 'md', control.height),
|
|
47
|
-
height: getSize(size, 'md', control.height),
|
|
48
|
-
cursor: 'pointer',
|
|
49
|
-
fontFamily: font.family.control
|
|
50
|
-
};
|
|
51
|
-
obj[':hover:not([disabled])'] = {
|
|
52
|
-
backgroundColor: background.inverseColor,
|
|
53
|
-
color: font.inverseColor
|
|
54
|
-
};
|
|
55
|
-
obj[':focus'] = {
|
|
56
|
-
outline: `2px solid ${control.focusColor}`,
|
|
57
|
-
outlineOffset: 0.5
|
|
58
|
-
};
|
|
59
|
-
obj[':active:not([disabled])'] = {
|
|
60
|
-
transform: 'translateY(2px)'
|
|
61
|
-
};
|
|
62
|
-
obj[':disabled'] = {
|
|
63
|
-
cursor: 'not-allowed',
|
|
64
|
-
backgroundColor: background.mutedColor,
|
|
65
|
-
color: font.mutedColor
|
|
66
|
-
};
|
|
67
|
-
return css(obj);
|
|
68
|
-
},
|
|
69
|
-
content: ({ size, variant, compact }) => {
|
|
70
|
-
return css({
|
|
71
|
-
minWidth: '1.25em',
|
|
72
|
-
margin: '0 auto'
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
control: {
|
|
77
|
-
root: ({ size, spacing: sp }) => {
|
|
78
|
-
const obj = {
|
|
79
|
-
display: 'inline-flex',
|
|
80
|
-
alignItems: 'center',
|
|
81
|
-
flexDirection: 'row',
|
|
82
|
-
gap: getSize(sp, 'md', spacing),
|
|
83
|
-
overflow: 'hidden',
|
|
84
|
-
lineHeight: getSize(size, 'md', control.height),
|
|
85
|
-
height: getSize(size, 'md', control.height),
|
|
86
|
-
fontWeight: 500,
|
|
87
|
-
padding: '0 2px',
|
|
88
|
-
fontSize: getSize(size, 'md', font.size),
|
|
89
|
-
fontFamily: font.family.control,
|
|
90
|
-
borderRadius: getRadiusSize('md', 'sm', border.radius),
|
|
91
|
-
border: `1px solid ${control.borderColor}`,
|
|
92
|
-
backgroundColor: background.color,
|
|
93
|
-
color: font.color,
|
|
94
|
-
':focus-within': {
|
|
95
|
-
outline: `2px solid ${control.focusColor}`,
|
|
96
|
-
outlineOffset: 0.5
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
return css(obj);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@tempots/dom/jsx-runtime";
|
|
2
|
-
import { Consumer, Signal, Attribute } from '@tempots/dom';
|
|
3
|
-
import { UnstyledPopover } from '../Popover';
|
|
4
|
-
import { onTargetOverMount } from '../Popover/UnstyledPopover';
|
|
5
|
-
import { StyleMarker } from '../StyleProvider/StyleProvider';
|
|
6
|
-
import { Sx } from '../styling/Sx';
|
|
7
|
-
const ARROW_SIZE = 8;
|
|
8
|
-
export function Tooltip({ children }) {
|
|
9
|
-
return (_jsx(_Fragment, { children: _jsx(Consumer, { mark: StyleMarker, children: ({ styles }) => {
|
|
10
|
-
const at = styles.at('styles').at;
|
|
11
|
-
return (_jsxs(UnstyledPopover, { onTargetMount: onTargetOverMount, placement: Signal.of('top'), arrow: _jsx("div", { children: _jsx(Sx, { sx: {
|
|
12
|
-
backgroundColor: at('background').at('inverseColor'),
|
|
13
|
-
boxShadow: at('shadow').at('md'),
|
|
14
|
-
marginTop: -ARROW_SIZE / 2,
|
|
15
|
-
transform: 'rotate(45deg)',
|
|
16
|
-
width: ARROW_SIZE,
|
|
17
|
-
height: ARROW_SIZE
|
|
18
|
-
} }) }), children: [_jsx(Attribute, { name: "role", value: Signal.of('tooltip') }), _jsx(Sx, { sx: {
|
|
19
|
-
maxWidth: '200px',
|
|
20
|
-
height: 'auto',
|
|
21
|
-
lineHeight: '1em',
|
|
22
|
-
textAlign: 'center',
|
|
23
|
-
whiteSpace: 'normal',
|
|
24
|
-
backgroundColor: at('background').at('inverseColor'),
|
|
25
|
-
color: at('font').at('inverseColor'),
|
|
26
|
-
padding: at('spacing').map(v => `${v.xs}px ${v.md}px`),
|
|
27
|
-
borderRadius: at('border').at('radius').at('sm'),
|
|
28
|
-
boxShadow: at('shadow').at('md')
|
|
29
|
-
} }), children] }));
|
|
30
|
-
} }) }));
|
|
31
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type JSX } from '@tempots/dom';
|
|
2
|
-
export interface SizingProps {
|
|
3
|
-
width?: JSX.VValue<string> | JSX.VValue<number>;
|
|
4
|
-
height?: JSX.VValue<string> | JSX.VValue<number>;
|
|
5
|
-
minWidth?: JSX.VValue<string> | JSX.VValue<number>;
|
|
6
|
-
minHeight?: JSX.VValue<string> | JSX.VValue<number>;
|
|
7
|
-
maxWidth?: JSX.VValue<string> | JSX.VValue<number>;
|
|
8
|
-
maxHeight?: JSX.VValue<string> | JSX.VValue<number>;
|
|
9
|
-
}
|
|
10
|
-
export declare const Sizing: ({ width, height, maxHeight, maxWidth, minHeight, minWidth }: SizingProps) => JSX.DOMNode;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@tempots/dom/jsx-runtime";
|
|
2
|
-
import { Sx } from './Sx';
|
|
3
|
-
export const Sizing = ({ width, height, maxHeight, maxWidth, minHeight, minWidth }) => {
|
|
4
|
-
return _jsx(Sx, { sx: { width, height, maxHeight, maxWidth, minHeight, minWidth } }); // TODO any
|
|
5
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type JSX } from '@tempots/dom';
|
|
2
|
-
import { type Size } from '../../styles/size';
|
|
3
|
-
export type Space = JSX.VValue<Size> | JSX.VValue<number>;
|
|
4
|
-
export interface SpacingProps {
|
|
5
|
-
m?: Space;
|
|
6
|
-
mt?: Space;
|
|
7
|
-
mr?: Space;
|
|
8
|
-
mb?: Space;
|
|
9
|
-
ml?: Space;
|
|
10
|
-
mh?: Space;
|
|
11
|
-
mv?: Space;
|
|
12
|
-
ms?: Space;
|
|
13
|
-
me?: Space;
|
|
14
|
-
mis?: Space;
|
|
15
|
-
mie?: Space;
|
|
16
|
-
p?: Space;
|
|
17
|
-
pt?: Space;
|
|
18
|
-
pr?: Space;
|
|
19
|
-
pb?: Space;
|
|
20
|
-
pl?: Space;
|
|
21
|
-
ph?: Space;
|
|
22
|
-
pv?: Space;
|
|
23
|
-
ps?: Space;
|
|
24
|
-
pe?: Space;
|
|
25
|
-
pis?: Space;
|
|
26
|
-
pie?: Space;
|
|
27
|
-
}
|
|
28
|
-
export declare const Spacing: (props: SpacingProps) => JSX.DOMNode;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@tempots/dom/jsx-runtime";
|
|
2
|
-
import { Signal, ClassName, Consumer } from '@tempots/dom';
|
|
3
|
-
import { getSizeOrNull } from '../../styles/size';
|
|
4
|
-
import { objectOfPropertiesToSignalOfObject, sxToClassProp } from '../../styles/sx';
|
|
5
|
-
import { StyleMarker } from '../StyleProvider/StyleProvider';
|
|
6
|
-
const map = {
|
|
7
|
-
m: ['margin'],
|
|
8
|
-
mt: ['marginTop'],
|
|
9
|
-
mr: ['marginRight'],
|
|
10
|
-
mb: ['marginBottom'],
|
|
11
|
-
ml: ['marginLeft'],
|
|
12
|
-
ms: ['marginBlockStart'],
|
|
13
|
-
me: ['marginBlockEnd'],
|
|
14
|
-
mis: ['marginInlineStart'],
|
|
15
|
-
mie: ['marginInlineEnd'],
|
|
16
|
-
p: ['padding'],
|
|
17
|
-
pt: ['paddingTop'],
|
|
18
|
-
pr: ['paddingRight'],
|
|
19
|
-
pb: ['paddingBottom'],
|
|
20
|
-
pl: ['paddingLeft'],
|
|
21
|
-
ps: ['paddingBlockStart'],
|
|
22
|
-
pe: ['paddingBlockEnd'],
|
|
23
|
-
pis: ['paddingInlineStart'],
|
|
24
|
-
pie: ['paddingInlineEnd'],
|
|
25
|
-
mh: ['marginStart', 'marginEnd'],
|
|
26
|
-
mv: ['marginTop', 'marginBottom'],
|
|
27
|
-
ph: ['paddingStart', 'paddingEnd'],
|
|
28
|
-
pv: ['paddingTop', 'paddingBottom']
|
|
29
|
-
};
|
|
30
|
-
export const Spacing = (props) => {
|
|
31
|
-
return (_jsx(Consumer, { mark: StyleMarker, children: (theme) => {
|
|
32
|
-
const keys = Object.keys(props).filter(k => k !== 'children');
|
|
33
|
-
if (keys.length === 0)
|
|
34
|
-
return null;
|
|
35
|
-
const sx = keys.reduce((acc, k) => {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
-
const s = Signal.wrap(props[k]).combine(theme.styles, (s, { styles: { spacing } }) => [s, spacing]);
|
|
38
|
-
for (const kk of map[k]) {
|
|
39
|
-
if (acc[kk] == null) {
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
-
acc[kk] = s.map(([v, spacing]) => getSizeOrNull(v, spacing));
|
|
44
|
-
}
|
|
45
|
-
return acc;
|
|
46
|
-
}, {});
|
|
47
|
-
return _jsx(ClassName, { value: sxToClassProp(objectOfPropertiesToSignalOfObject(sx)) });
|
|
48
|
-
} }));
|
|
49
|
-
};
|
package/components/styling/Sx.js
DELETED
package/styles/color.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Color = 'blue' | 'green' | 'red' | 'yellow' | 'orange' | 'purple' | 'pink' | 'gray' | 'black';
|
package/styles/color.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/styles/reset.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const resetCss = "\n html {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n font-family: system-ui, sans-serif;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n -moz-osx-font-smoothing: grayscale;\n touch-action: manipulation;\n }\n\n body {\n position: relative;\n min-height: 100%;\n font-feature-settings: 'kern';\n }\n\n *,\n *::before,\n *::after {\n border-width: 0;\n border-style: solid;\n box-sizing: border-box;\n }\n\n main {\n display: block;\n }\n\n hr {\n border-top-width: 1px;\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n }\n\n pre,\n code,\n kbd,\n samp {\n font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 1em;\n }\n\n a {\n background-color: transparent;\n color: inherit;\n text-decoration: inherit;\n }\n\n abbr[title] {\n border-bottom: none;\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n\n b,\n strong {\n font-weight: bold;\n }\n\n small {\n font-size: 80%;\n }\n\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n\n sub {\n bottom: -0.25em;\n }\n\n sup {\n top: -0.5em;\n }\n\n img {\n border-style: none;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n }\n\n button,\n input {\n overflow: visible;\n }\n\n button,\n select {\n text-transform: none;\n }\n\n button::-moz-focus-inner,\n [type='button']::-moz-focus-inner,\n [type='reset']::-moz-focus-inner,\n [type='submit']::-moz-focus-inner {\n border-style: none;\n padding: 0;\n }\n\n fieldset {\n padding: 0.35em 0.75em 0.625em;\n }\n\n legend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n }\n\n progress {\n vertical-align: baseline;\n }\n\n textarea {\n overflow: auto;\n }\n\n [type='checkbox'],\n [type='radio'] {\n box-sizing: border-box;\n padding: 0;\n }\n\n [type='number']::-webkit-inner-spin-button,\n [type='number']::-webkit-outer-spin-button {\n -webkit-appearance: none !important;\n }\n\n input[type='number'] {\n -moz-appearance: textfield;\n }\n\n [type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n [type='search']::-webkit-search-decoration {\n -webkit-appearance: none !important;\n }\n\n ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n details {\n display: block;\n }\n\n summary {\n display: list-item;\n }\n\n template {\n display: none;\n }\n\n [hidden] {\n display: none !important;\n }\n\n body,\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre {\n margin: 0;\n }\n\n button {\n background: transparent;\n padding: 0;\n }\n\n fieldset {\n margin: 0;\n padding: 0;\n }\n\n ol,\n ul {\n margin: 0;\n padding: 0;\n }\n\n textarea {\n resize: vertical;\n }\n\n button,\n [role='button'] {\n cursor: pointer;\n }\n\n button::-moz-focus-inner {\n border: 0 !important;\n }\n\n table {\n border-collapse: collapse;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n }\n\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n }\n\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n\n [data-js-focus-visible]\n :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) {\n outline: none;\n box-shadow: none;\n }\n\n select::-ms-expand {\n display: none;\n }\n";
|
package/styles/reset.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
// export const reset = css`
|
|
2
|
-
// * {
|
|
3
|
-
// box-sizing: border-box;
|
|
4
|
-
// }
|
|
5
|
-
// `
|
|
6
|
-
export const resetCss = `
|
|
7
|
-
html {
|
|
8
|
-
line-height: 1.5;
|
|
9
|
-
-webkit-text-size-adjust: 100%;
|
|
10
|
-
font-family: system-ui, sans-serif;
|
|
11
|
-
-webkit-font-smoothing: antialiased;
|
|
12
|
-
text-rendering: optimizeLegibility;
|
|
13
|
-
-moz-osx-font-smoothing: grayscale;
|
|
14
|
-
touch-action: manipulation;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
body {
|
|
18
|
-
position: relative;
|
|
19
|
-
min-height: 100%;
|
|
20
|
-
font-feature-settings: 'kern';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
*,
|
|
24
|
-
*::before,
|
|
25
|
-
*::after {
|
|
26
|
-
border-width: 0;
|
|
27
|
-
border-style: solid;
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
main {
|
|
32
|
-
display: block;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
hr {
|
|
36
|
-
border-top-width: 1px;
|
|
37
|
-
box-sizing: content-box;
|
|
38
|
-
height: 0;
|
|
39
|
-
overflow: visible;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
pre,
|
|
43
|
-
code,
|
|
44
|
-
kbd,
|
|
45
|
-
samp {
|
|
46
|
-
font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
47
|
-
font-size: 1em;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
a {
|
|
51
|
-
background-color: transparent;
|
|
52
|
-
color: inherit;
|
|
53
|
-
text-decoration: inherit;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
abbr[title] {
|
|
57
|
-
border-bottom: none;
|
|
58
|
-
text-decoration: underline;
|
|
59
|
-
-webkit-text-decoration: underline dotted;
|
|
60
|
-
text-decoration: underline dotted;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
b,
|
|
64
|
-
strong {
|
|
65
|
-
font-weight: bold;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
small {
|
|
69
|
-
font-size: 80%;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
sub,
|
|
73
|
-
sup {
|
|
74
|
-
font-size: 75%;
|
|
75
|
-
line-height: 0;
|
|
76
|
-
position: relative;
|
|
77
|
-
vertical-align: baseline;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
sub {
|
|
81
|
-
bottom: -0.25em;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
sup {
|
|
85
|
-
top: -0.5em;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
img {
|
|
89
|
-
border-style: none;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
button,
|
|
93
|
-
input,
|
|
94
|
-
optgroup,
|
|
95
|
-
select,
|
|
96
|
-
textarea {
|
|
97
|
-
font-family: inherit;
|
|
98
|
-
font-size: 100%;
|
|
99
|
-
line-height: 1.15;
|
|
100
|
-
margin: 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
button,
|
|
104
|
-
input {
|
|
105
|
-
overflow: visible;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
button,
|
|
109
|
-
select {
|
|
110
|
-
text-transform: none;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
button::-moz-focus-inner,
|
|
114
|
-
[type='button']::-moz-focus-inner,
|
|
115
|
-
[type='reset']::-moz-focus-inner,
|
|
116
|
-
[type='submit']::-moz-focus-inner {
|
|
117
|
-
border-style: none;
|
|
118
|
-
padding: 0;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
fieldset {
|
|
122
|
-
padding: 0.35em 0.75em 0.625em;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
legend {
|
|
126
|
-
box-sizing: border-box;
|
|
127
|
-
color: inherit;
|
|
128
|
-
display: table;
|
|
129
|
-
max-width: 100%;
|
|
130
|
-
padding: 0;
|
|
131
|
-
white-space: normal;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
progress {
|
|
135
|
-
vertical-align: baseline;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
textarea {
|
|
139
|
-
overflow: auto;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
[type='checkbox'],
|
|
143
|
-
[type='radio'] {
|
|
144
|
-
box-sizing: border-box;
|
|
145
|
-
padding: 0;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
[type='number']::-webkit-inner-spin-button,
|
|
149
|
-
[type='number']::-webkit-outer-spin-button {
|
|
150
|
-
-webkit-appearance: none !important;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
input[type='number'] {
|
|
154
|
-
-moz-appearance: textfield;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
[type='search'] {
|
|
158
|
-
-webkit-appearance: textfield;
|
|
159
|
-
outline-offset: -2px;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
[type='search']::-webkit-search-decoration {
|
|
163
|
-
-webkit-appearance: none !important;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
::-webkit-file-upload-button {
|
|
167
|
-
-webkit-appearance: button;
|
|
168
|
-
font: inherit;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
details {
|
|
172
|
-
display: block;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
summary {
|
|
176
|
-
display: list-item;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
template {
|
|
180
|
-
display: none;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
[hidden] {
|
|
184
|
-
display: none !important;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
body,
|
|
188
|
-
blockquote,
|
|
189
|
-
dl,
|
|
190
|
-
dd,
|
|
191
|
-
h1,
|
|
192
|
-
h2,
|
|
193
|
-
h3,
|
|
194
|
-
h4,
|
|
195
|
-
h5,
|
|
196
|
-
h6,
|
|
197
|
-
hr,
|
|
198
|
-
figure,
|
|
199
|
-
p,
|
|
200
|
-
pre {
|
|
201
|
-
margin: 0;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
button {
|
|
205
|
-
background: transparent;
|
|
206
|
-
padding: 0;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
fieldset {
|
|
210
|
-
margin: 0;
|
|
211
|
-
padding: 0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
ol,
|
|
215
|
-
ul {
|
|
216
|
-
margin: 0;
|
|
217
|
-
padding: 0;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
textarea {
|
|
221
|
-
resize: vertical;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
button,
|
|
225
|
-
[role='button'] {
|
|
226
|
-
cursor: pointer;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
button::-moz-focus-inner {
|
|
230
|
-
border: 0 !important;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
table {
|
|
234
|
-
border-collapse: collapse;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
h1,
|
|
238
|
-
h2,
|
|
239
|
-
h3,
|
|
240
|
-
h4,
|
|
241
|
-
h5,
|
|
242
|
-
h6 {
|
|
243
|
-
font-size: inherit;
|
|
244
|
-
font-weight: inherit;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
button,
|
|
248
|
-
input,
|
|
249
|
-
optgroup,
|
|
250
|
-
select,
|
|
251
|
-
textarea {
|
|
252
|
-
padding: 0;
|
|
253
|
-
line-height: inherit;
|
|
254
|
-
color: inherit;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
img,
|
|
258
|
-
svg,
|
|
259
|
-
video,
|
|
260
|
-
canvas,
|
|
261
|
-
audio,
|
|
262
|
-
iframe,
|
|
263
|
-
embed,
|
|
264
|
-
object {
|
|
265
|
-
display: block;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
img,
|
|
269
|
-
video {
|
|
270
|
-
max-width: 100%;
|
|
271
|
-
height: auto;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
[data-js-focus-visible]
|
|
275
|
-
:focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) {
|
|
276
|
-
outline: none;
|
|
277
|
-
box-shadow: none;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
select::-ms-expand {
|
|
281
|
-
display: none;
|
|
282
|
-
}
|
|
283
|
-
`;
|
package/styles/side.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Side = 'top' | 'right' | 'bottom' | 'left' | 'start' | 'end';
|
package/styles/side.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/styles/size.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type Size = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
2
|
-
export declare const getSize: <T>(size: Size | number | undefined | null, defaultSize: Size, sizes: Record<Size, T>) => number | T;
|
|
3
|
-
export declare const getSizeOrNull: <T>(size: Size | number | undefined | null, sizes: Record<Size, T>) => number | T | null;
|
|
4
|
-
export declare const getRadiusSize: (size: Size | 'full' | number | undefined | null, defaultSize: Size | 'full', sizes: Record<Size, number>) => string | number;
|
|
5
|
-
export declare const getSizeT: <T>(size: Size | number | undefined | null, defaultSize: Size, sizes: Record<Size, T>) => T;
|