webadwaita 0.1.0 → 0.2.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/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/native/Box/index.js +120 -0
- package/dist/native/Button/index.js +135 -0
- package/dist/native/Card/index.js +67 -0
- package/dist/native/Checkbox/index.js +112 -0
- package/dist/native/Entry/index.js +76 -0
- package/dist/native/HeaderBar/index.js +79 -0
- package/dist/native/Switch/index.js +83 -0
- package/dist/native/index.js +8 -0
- package/dist/native/theme.js +16 -0
- package/dist/native/tokens.css.js +77 -0
- package/dist/types/Box/index.d.ts +23 -0
- package/dist/types/Box/index.d.ts.map +1 -0
- package/dist/types/Button/index.d.ts +22 -0
- package/dist/types/Button/index.d.ts.map +1 -0
- package/dist/types/Card/index.d.ts +14 -0
- package/dist/types/Card/index.d.ts.map +1 -0
- package/dist/types/Checkbox/index.d.ts +13 -0
- package/dist/types/Checkbox/index.d.ts.map +1 -0
- package/dist/types/Entry/index.d.ts +17 -0
- package/dist/types/Entry/index.d.ts.map +1 -0
- package/dist/types/HeaderBar/index.d.ts +16 -0
- package/dist/types/HeaderBar/index.d.ts.map +1 -0
- package/dist/types/Switch/index.d.ts +13 -0
- package/dist/types/Switch/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/theme.d.ts +77 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/tokens.css.d.ts +76 -0
- package/dist/types/tokens.css.d.ts.map +1 -0
- package/dist/web/Box/index.js +150 -0
- package/dist/web/Box/styles.css +39 -0
- package/dist/web/Button/index.js +132 -0
- package/dist/web/Button/styles.css +81 -0
- package/dist/web/Card/index.js +75 -0
- package/dist/web/Card/styles.css +91 -0
- package/dist/web/Checkbox/index.js +116 -0
- package/dist/web/Checkbox/styles.css +99 -0
- package/dist/web/Entry/index.js +74 -0
- package/dist/web/Entry/styles.css +113 -0
- package/dist/web/HeaderBar/index.js +87 -0
- package/dist/web/HeaderBar/styles.css +117 -0
- package/dist/web/Switch/index.js +86 -0
- package/dist/web/Switch/styles.css +134 -0
- package/dist/web/_tokens/styles.css +32 -0
- package/dist/web/index.js +8 -0
- package/dist/web/theme.js +16 -0
- package/dist/web/tokens.css.js +79 -0
- package/package.json +52 -31
- package/dist/Button.d.mts +0 -5
- package/dist/Button.d.ts +0 -5
- package/dist/Button.js +0 -63
- package/dist/Button.mjs +0 -41
- package/dist/button.d.mts +0 -5
- package/dist/button.d.ts +0 -5
- package/dist/button.js +0 -63
- package/dist/button.mjs +0 -15
- package/dist/chunk-FWCSY2DS.mjs +0 -37
- package/dist/styles.css +0 -346
- package/dist/styles.d.mts +0 -2
- package/dist/styles.d.ts +0 -2
- package/dist/styles.js +0 -1
- package/dist/styles.mjs +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { css, html } from 'react-strict-dom';
|
|
3
|
+
import { palette, spacing, typography } from '../tokens.css';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
/**
|
|
6
|
+
* Top-level header bar matching libadwaita's AdwHeaderBar — a thin titled
|
|
7
|
+
* strip that sits at the top of a window. Centered title with optional
|
|
8
|
+
* leading/trailing slots.
|
|
9
|
+
*/
|
|
10
|
+
export function HeaderBar(props) {
|
|
11
|
+
const {
|
|
12
|
+
title,
|
|
13
|
+
subtitle,
|
|
14
|
+
start,
|
|
15
|
+
end
|
|
16
|
+
} = props;
|
|
17
|
+
return /*#__PURE__*/_jsxs(html.header, {
|
|
18
|
+
style: styles.bar,
|
|
19
|
+
children: [/*#__PURE__*/_jsx(html.div, {
|
|
20
|
+
style: styles.side,
|
|
21
|
+
children: start
|
|
22
|
+
}), /*#__PURE__*/_jsxs(html.div, {
|
|
23
|
+
style: styles.titleBlock,
|
|
24
|
+
children: [title != null && /*#__PURE__*/_jsx(html.span, {
|
|
25
|
+
style: styles.title,
|
|
26
|
+
children: title
|
|
27
|
+
}), subtitle != null && /*#__PURE__*/_jsx(html.span, {
|
|
28
|
+
style: styles.subtitle,
|
|
29
|
+
children: subtitle
|
|
30
|
+
})]
|
|
31
|
+
}), /*#__PURE__*/_jsx(html.div, {
|
|
32
|
+
style: [styles.side, styles.sideEnd],
|
|
33
|
+
children: end
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const styles = css.create({
|
|
38
|
+
bar: {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
backgroundColor: palette.headerbarBg,
|
|
43
|
+
borderBottomWidth: 1,
|
|
44
|
+
borderBottomStyle: 'solid',
|
|
45
|
+
borderBottomColor: palette.border,
|
|
46
|
+
paddingBlock: spacing.sm,
|
|
47
|
+
paddingInline: spacing.md,
|
|
48
|
+
gap: spacing.sm,
|
|
49
|
+
minHeight: 46
|
|
50
|
+
},
|
|
51
|
+
side: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
gap: spacing.sm,
|
|
56
|
+
flexBasis: 0,
|
|
57
|
+
flexGrow: 1
|
|
58
|
+
},
|
|
59
|
+
sideEnd: {
|
|
60
|
+
justifyContent: 'flex-end'
|
|
61
|
+
},
|
|
62
|
+
titleBlock: {
|
|
63
|
+
display: 'flex',
|
|
64
|
+
flexDirection: 'column',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
justifyContent: 'center'
|
|
67
|
+
},
|
|
68
|
+
title: {
|
|
69
|
+
fontFamily: typography.fontFamily,
|
|
70
|
+
fontSize: typography.bodySize,
|
|
71
|
+
fontWeight: typography.weightStrong,
|
|
72
|
+
color: palette.fg
|
|
73
|
+
},
|
|
74
|
+
subtitle: {
|
|
75
|
+
fontFamily: typography.fontFamily,
|
|
76
|
+
fontSize: typography.captionSize,
|
|
77
|
+
color: palette.fgMuted
|
|
78
|
+
}
|
|
79
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { css, html } from 'react-strict-dom';
|
|
2
|
+
import { palette, motion } from '../tokens.css';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
/**
|
|
5
|
+
* Adwaita-style toggle switch — pill-shaped track with a sliding thumb.
|
|
6
|
+
* Uses an html.button so it works identically on web and native via
|
|
7
|
+
* react-strict-dom; the inner thumb is positioned absolutely.
|
|
8
|
+
*/
|
|
9
|
+
export function Switch(props) {
|
|
10
|
+
const {
|
|
11
|
+
checked,
|
|
12
|
+
disabled = false,
|
|
13
|
+
onChange,
|
|
14
|
+
label
|
|
15
|
+
} = props;
|
|
16
|
+
const toggle = () => {
|
|
17
|
+
if (!disabled) onChange?.(!checked);
|
|
18
|
+
};
|
|
19
|
+
return /*#__PURE__*/_jsx(html.button, {
|
|
20
|
+
type: "button",
|
|
21
|
+
role: "switch",
|
|
22
|
+
"aria-checked": checked,
|
|
23
|
+
"aria-label": label,
|
|
24
|
+
disabled: disabled,
|
|
25
|
+
onClick: toggle,
|
|
26
|
+
style: [styles.track, checked ? styles.trackOn : styles.trackOff, disabled && styles.disabled],
|
|
27
|
+
children: /*#__PURE__*/_jsx(html.span, {
|
|
28
|
+
style: [styles.thumb, checked ? styles.thumbOn : styles.thumbOff]
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const TRACK_W = 48;
|
|
33
|
+
const TRACK_H = 28;
|
|
34
|
+
const THUMB = 22;
|
|
35
|
+
const PAD = (TRACK_H - THUMB) / 2;
|
|
36
|
+
const styles = css.create({
|
|
37
|
+
track: {
|
|
38
|
+
position: 'relative',
|
|
39
|
+
width: TRACK_W,
|
|
40
|
+
height: TRACK_H,
|
|
41
|
+
borderRadius: TRACK_H / 2,
|
|
42
|
+
borderWidth: 0,
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
transitionProperty: 'background-color',
|
|
45
|
+
transitionDuration: motion.durationBase,
|
|
46
|
+
transitionTimingFunction: motion.easing,
|
|
47
|
+
padding: 0
|
|
48
|
+
},
|
|
49
|
+
trackOff: {
|
|
50
|
+
backgroundColor: {
|
|
51
|
+
default: palette.subtleBgHover,
|
|
52
|
+
':hover': palette.subtleBgActive
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
trackOn: {
|
|
56
|
+
backgroundColor: {
|
|
57
|
+
default: palette.accentBg,
|
|
58
|
+
':hover': palette.accentBgHover
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
thumb: {
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
top: PAD,
|
|
64
|
+
width: THUMB,
|
|
65
|
+
height: THUMB,
|
|
66
|
+
borderRadius: THUMB / 2,
|
|
67
|
+
backgroundColor: '#ffffff',
|
|
68
|
+
boxShadow: '0 1px 2px rgba(0, 0, 0, 0.25)',
|
|
69
|
+
transitionProperty: 'left, transform',
|
|
70
|
+
transitionDuration: motion.durationBase,
|
|
71
|
+
transitionTimingFunction: motion.easing
|
|
72
|
+
},
|
|
73
|
+
thumbOff: {
|
|
74
|
+
left: PAD
|
|
75
|
+
},
|
|
76
|
+
thumbOn: {
|
|
77
|
+
left: TRACK_W - THUMB - PAD
|
|
78
|
+
},
|
|
79
|
+
disabled: {
|
|
80
|
+
opacity: 0.5,
|
|
81
|
+
cursor: 'not-allowed'
|
|
82
|
+
}
|
|
83
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
2
|
+
export { Entry } from './Entry';
|
|
3
|
+
export { Switch } from './Switch';
|
|
4
|
+
export { Checkbox } from './Checkbox';
|
|
5
|
+
export { Card } from './Card';
|
|
6
|
+
export { HeaderBar } from './HeaderBar';
|
|
7
|
+
export { Box } from './Box';
|
|
8
|
+
export { theme, palette, radius, spacing, typography, motion } from './theme';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export of the design tokens for runtime use by consumer code (e.g. for
|
|
3
|
+
* computing inline styles, reading the accent color in a custom component).
|
|
4
|
+
*
|
|
5
|
+
* The stylex-aware tokens live in `tokens.stylex.ts`. At runtime, defineConsts
|
|
6
|
+
* returns a plain object with the same keys/values — so we just re-export.
|
|
7
|
+
*/
|
|
8
|
+
export { palette, radius, spacing, typography, motion } from './tokens.css';
|
|
9
|
+
import { palette, radius, spacing, typography, motion } from './tokens.css';
|
|
10
|
+
export const theme = {
|
|
11
|
+
palette,
|
|
12
|
+
radius,
|
|
13
|
+
spacing,
|
|
14
|
+
typography,
|
|
15
|
+
motion
|
|
16
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { css } from 'react-strict-dom';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adwaita-inspired design tokens, exposed via `css.defineConsts` so they can
|
|
5
|
+
* be referenced inside `css.create({...})` calls. StyleX requires shared
|
|
6
|
+
* values to live in a `.stylex.ts` file and to be defined this way.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: defineConsts only accepts string values. Numeric tokens (sizes,
|
|
9
|
+
* weights, line heights) are encoded as strings — CSS accepts them either
|
|
10
|
+
* way, and react-strict-dom forwards them through to RN as well.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const palette = css.defineConsts({
|
|
14
|
+
accentBg: '#3584e4',
|
|
15
|
+
accentBgHover: '#4a90e9',
|
|
16
|
+
accentBgActive: '#1a6bb8',
|
|
17
|
+
accentFg: '#ffffff',
|
|
18
|
+
destructiveBg: '#e01b24',
|
|
19
|
+
destructiveBgHover: '#e8434b',
|
|
20
|
+
destructiveBgActive: '#b81920',
|
|
21
|
+
destructiveFg: '#ffffff',
|
|
22
|
+
successBg: '#26a269',
|
|
23
|
+
warningBg: '#cd9309',
|
|
24
|
+
windowBg: '#fafafa',
|
|
25
|
+
viewBg: '#ffffff',
|
|
26
|
+
cardBg: '#ffffff',
|
|
27
|
+
headerbarBg: '#ebebeb',
|
|
28
|
+
sidebarBg: '#ebebeb',
|
|
29
|
+
fg: 'rgba(0, 0, 0, 0.8)',
|
|
30
|
+
fgMuted: 'rgba(0, 0, 0, 0.55)',
|
|
31
|
+
fgDisabled: 'rgba(0, 0, 0, 0.35)',
|
|
32
|
+
fgOnAccent: '#ffffff',
|
|
33
|
+
border: 'rgba(0, 0, 0, 0.15)',
|
|
34
|
+
borderStrong: 'rgba(0, 0, 0, 0.25)',
|
|
35
|
+
shadow: 'rgba(0, 0, 0, 0.07)',
|
|
36
|
+
subtleBg: 'rgba(0, 0, 0, 0.07)',
|
|
37
|
+
subtleBgHover: 'rgba(0, 0, 0, 0.12)',
|
|
38
|
+
subtleBgActive: 'rgba(0, 0, 0, 0.18)'
|
|
39
|
+
});
|
|
40
|
+
export const radius = css.defineConsts({
|
|
41
|
+
sm: '6px',
|
|
42
|
+
md: '9px',
|
|
43
|
+
lg: '12px',
|
|
44
|
+
pill: '9999px'
|
|
45
|
+
});
|
|
46
|
+
export const spacing = css.defineConsts({
|
|
47
|
+
xs: '4px',
|
|
48
|
+
sm: '8px',
|
|
49
|
+
md: '12px',
|
|
50
|
+
lg: '16px',
|
|
51
|
+
xl: '24px',
|
|
52
|
+
xxl: '32px'
|
|
53
|
+
});
|
|
54
|
+
export const typography = css.defineConsts({
|
|
55
|
+
fontFamily: '"Adwaita Sans", "Cantarell", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif',
|
|
56
|
+
fontFamilyMono: '"Adwaita Mono", "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace',
|
|
57
|
+
weightRegular: '400',
|
|
58
|
+
weightStrong: '600',
|
|
59
|
+
weightBold: '700',
|
|
60
|
+
bodySize: '14px',
|
|
61
|
+
bodyLineHeight: '1.5',
|
|
62
|
+
captionSize: '12px',
|
|
63
|
+
captionLineHeight: '1.4',
|
|
64
|
+
title4Size: '16px',
|
|
65
|
+
title4LineHeight: '1.3',
|
|
66
|
+
title3Size: '18px',
|
|
67
|
+
title3LineHeight: '1.3',
|
|
68
|
+
title2Size: '22px',
|
|
69
|
+
title2LineHeight: '1.25',
|
|
70
|
+
title1Size: '28px',
|
|
71
|
+
title1LineHeight: '1.2'
|
|
72
|
+
});
|
|
73
|
+
export const motion = css.defineConsts({
|
|
74
|
+
durationFast: '120ms',
|
|
75
|
+
durationBase: '180ms',
|
|
76
|
+
easing: 'cubic-bezier(0.4, 0, 0.2, 1)'
|
|
77
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type SpacingKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
3
|
+
type Direction = 'row' | 'column';
|
|
4
|
+
type Align = 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline';
|
|
5
|
+
type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
6
|
+
export type BoxProps = {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
direction?: Direction;
|
|
9
|
+
gap?: SpacingKey;
|
|
10
|
+
padding?: SpacingKey;
|
|
11
|
+
align?: Align;
|
|
12
|
+
justify?: Justify;
|
|
13
|
+
grow?: boolean;
|
|
14
|
+
wrap?: boolean;
|
|
15
|
+
style?: any;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Layout primitive — a flex container, the building block for everything else.
|
|
19
|
+
* Adwaita-inspired apps lean heavily on simple horizontal/vertical stacks.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Box(props: BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Box/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAC3D,KAAK,SAAS,GAAG,KAAK,GAAG,QAAQ,CAAC;AAClC,KAAK,KAAK,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAC3E,KAAK,OAAO,GACR,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,eAAe,GACf,cAAc,GACd,cAAc,CAAC;AAEnB,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,2CA8BlC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ButtonVariant = 'default' | 'suggested' | 'destructive' | 'flat' | 'pill';
|
|
3
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type ButtonProps = {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
onPress?: () => void;
|
|
11
|
+
type?: 'button' | 'submit';
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Adwaita-style button. Variants follow libadwaita conventions:
|
|
15
|
+
* - default: flat-ish neutral surface
|
|
16
|
+
* - suggested: blue accent (primary)
|
|
17
|
+
* - destructive: red, for irreversible actions
|
|
18
|
+
* - flat: no background, only on hover
|
|
19
|
+
* - pill: fully rounded (Adwaita "circular" buttons)
|
|
20
|
+
*/
|
|
21
|
+
export declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,aAAa,GACb,MAAM,GACN,MAAM,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CA6BxC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CardProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
/** "boxed" matches AdwBoxedList — solid surface w/ visible border. */
|
|
6
|
+
variant?: 'boxed' | 'flat';
|
|
7
|
+
padding?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Adwaita-style card surface. Default has a soft shadow + rounded corners;
|
|
11
|
+
* "flat" drops the shadow for use inside other surfaces.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Card(props: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CAapC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CheckboxProps = {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onChange?: (checked: boolean) => void;
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Adwaita-style checkbox. Solid blue square with a unicode check when on,
|
|
10
|
+
* subtle outlined square when off.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Checkbox(props: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Checkbox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAyC5C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type EntryProps = {
|
|
2
|
+
value?: string;
|
|
3
|
+
defaultValue?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
type?: 'text' | 'password' | 'email' | 'search' | 'tel' | 'url' | 'number';
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
onSubmit?: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Adwaita-style text entry. Underline focus indicator + subtle filled surface,
|
|
14
|
+
* like libadwaita's `AdwEntry`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Entry(props: EntryProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Entry/index.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAqCtC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type HeaderBarProps = {
|
|
3
|
+
title?: React.ReactNode;
|
|
4
|
+
subtitle?: React.ReactNode;
|
|
5
|
+
/** Buttons / actions to place at the start (left) of the bar. */
|
|
6
|
+
start?: React.ReactNode;
|
|
7
|
+
/** Buttons / actions to place at the end (right) of the bar. */
|
|
8
|
+
end?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Top-level header bar matching libadwaita's AdwHeaderBar — a thin titled
|
|
12
|
+
* strip that sits at the top of a window. Centered title with optional
|
|
13
|
+
* leading/trailing slots.
|
|
14
|
+
*/
|
|
15
|
+
export declare function HeaderBar(props: HeaderBarProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/HeaderBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iEAAiE;IACjE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,gEAAgE;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAiB9C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SwitchProps = {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
onChange?: (checked: boolean) => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Adwaita-style toggle switch — pill-shaped track with a sliding thumb.
|
|
9
|
+
* Uses an html.button so it works identically on web and native via
|
|
10
|
+
* react-strict-dom; the inner thumb is positioned absolutely.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Switch/index.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CA0BxC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
2
|
+
export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
|
|
3
|
+
export { Entry } from './Entry';
|
|
4
|
+
export type { EntryProps } from './Entry';
|
|
5
|
+
export { Switch } from './Switch';
|
|
6
|
+
export type { SwitchProps } from './Switch';
|
|
7
|
+
export { Checkbox } from './Checkbox';
|
|
8
|
+
export type { CheckboxProps } from './Checkbox';
|
|
9
|
+
export { Card } from './Card';
|
|
10
|
+
export type { CardProps } from './Card';
|
|
11
|
+
export { HeaderBar } from './HeaderBar';
|
|
12
|
+
export type { HeaderBarProps } from './HeaderBar';
|
|
13
|
+
export { Box } from './Box';
|
|
14
|
+
export type { BoxProps } from './Box';
|
|
15
|
+
export { theme, palette, radius, spacing, typography, motion } from './theme';
|
|
16
|
+
export type { Theme } from './theme';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9E,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export of the design tokens for runtime use by consumer code (e.g. for
|
|
3
|
+
* computing inline styles, reading the accent color in a custom component).
|
|
4
|
+
*
|
|
5
|
+
* The stylex-aware tokens live in `tokens.stylex.ts`. At runtime, defineConsts
|
|
6
|
+
* returns a plain object with the same keys/values — so we just re-export.
|
|
7
|
+
*/
|
|
8
|
+
export { palette, radius, spacing, typography, motion } from './tokens.css';
|
|
9
|
+
export declare const theme: {
|
|
10
|
+
readonly palette: import("@stylexjs/stylex").VarGroup<Readonly<{
|
|
11
|
+
accentBg: string;
|
|
12
|
+
accentBgHover: string;
|
|
13
|
+
accentBgActive: string;
|
|
14
|
+
accentFg: string;
|
|
15
|
+
destructiveBg: string;
|
|
16
|
+
destructiveBgHover: string;
|
|
17
|
+
destructiveBgActive: string;
|
|
18
|
+
destructiveFg: string;
|
|
19
|
+
successBg: string;
|
|
20
|
+
warningBg: string;
|
|
21
|
+
windowBg: string;
|
|
22
|
+
viewBg: string;
|
|
23
|
+
cardBg: string;
|
|
24
|
+
headerbarBg: string;
|
|
25
|
+
sidebarBg: string;
|
|
26
|
+
fg: string;
|
|
27
|
+
fgMuted: string;
|
|
28
|
+
fgDisabled: string;
|
|
29
|
+
fgOnAccent: string;
|
|
30
|
+
border: string;
|
|
31
|
+
borderStrong: string;
|
|
32
|
+
shadow: string;
|
|
33
|
+
subtleBg: string;
|
|
34
|
+
subtleBgHover: string;
|
|
35
|
+
subtleBgActive: string;
|
|
36
|
+
}>, symbol>;
|
|
37
|
+
readonly radius: import("@stylexjs/stylex").VarGroup<Readonly<{
|
|
38
|
+
sm: string;
|
|
39
|
+
md: string;
|
|
40
|
+
lg: string;
|
|
41
|
+
pill: string;
|
|
42
|
+
}>, symbol>;
|
|
43
|
+
readonly spacing: import("@stylexjs/stylex").VarGroup<Readonly<{
|
|
44
|
+
xs: string;
|
|
45
|
+
sm: string;
|
|
46
|
+
md: string;
|
|
47
|
+
lg: string;
|
|
48
|
+
xl: string;
|
|
49
|
+
xxl: string;
|
|
50
|
+
}>, symbol>;
|
|
51
|
+
readonly typography: import("@stylexjs/stylex").VarGroup<Readonly<{
|
|
52
|
+
fontFamily: string;
|
|
53
|
+
fontFamilyMono: string;
|
|
54
|
+
weightRegular: string;
|
|
55
|
+
weightStrong: string;
|
|
56
|
+
weightBold: string;
|
|
57
|
+
bodySize: string;
|
|
58
|
+
bodyLineHeight: string;
|
|
59
|
+
captionSize: string;
|
|
60
|
+
captionLineHeight: string;
|
|
61
|
+
title4Size: string;
|
|
62
|
+
title4LineHeight: string;
|
|
63
|
+
title3Size: string;
|
|
64
|
+
title3LineHeight: string;
|
|
65
|
+
title2Size: string;
|
|
66
|
+
title2LineHeight: string;
|
|
67
|
+
title1Size: string;
|
|
68
|
+
title1LineHeight: string;
|
|
69
|
+
}>, symbol>;
|
|
70
|
+
readonly motion: import("@stylexjs/stylex").VarGroup<Readonly<{
|
|
71
|
+
durationFast: string;
|
|
72
|
+
durationBase: string;
|
|
73
|
+
easing: string;
|
|
74
|
+
}>, symbol>;
|
|
75
|
+
};
|
|
76
|
+
export type Theme = typeof theme;
|
|
77
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,MAAM,EACP,MAAM,cAAc,CAAC;AAItB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA4D,CAAC;AAC/E,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { css } from 'react-strict-dom';
|
|
2
|
+
/**
|
|
3
|
+
* Adwaita-inspired design tokens, exposed via `css.defineConsts` so they can
|
|
4
|
+
* be referenced inside `css.create({...})` calls. StyleX requires shared
|
|
5
|
+
* values to live in a `.stylex.ts` file and to be defined this way.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: defineConsts only accepts string values. Numeric tokens (sizes,
|
|
8
|
+
* weights, line heights) are encoded as strings — CSS accepts them either
|
|
9
|
+
* way, and react-strict-dom forwards them through to RN as well.
|
|
10
|
+
*/
|
|
11
|
+
export declare const palette: css.VarGroup<Readonly<{
|
|
12
|
+
accentBg: string;
|
|
13
|
+
accentBgHover: string;
|
|
14
|
+
accentBgActive: string;
|
|
15
|
+
accentFg: string;
|
|
16
|
+
destructiveBg: string;
|
|
17
|
+
destructiveBgHover: string;
|
|
18
|
+
destructiveBgActive: string;
|
|
19
|
+
destructiveFg: string;
|
|
20
|
+
successBg: string;
|
|
21
|
+
warningBg: string;
|
|
22
|
+
windowBg: string;
|
|
23
|
+
viewBg: string;
|
|
24
|
+
cardBg: string;
|
|
25
|
+
headerbarBg: string;
|
|
26
|
+
sidebarBg: string;
|
|
27
|
+
fg: string;
|
|
28
|
+
fgMuted: string;
|
|
29
|
+
fgDisabled: string;
|
|
30
|
+
fgOnAccent: string;
|
|
31
|
+
border: string;
|
|
32
|
+
borderStrong: string;
|
|
33
|
+
shadow: string;
|
|
34
|
+
subtleBg: string;
|
|
35
|
+
subtleBgHover: string;
|
|
36
|
+
subtleBgActive: string;
|
|
37
|
+
}>, symbol>;
|
|
38
|
+
export declare const radius: css.VarGroup<Readonly<{
|
|
39
|
+
sm: string;
|
|
40
|
+
md: string;
|
|
41
|
+
lg: string;
|
|
42
|
+
pill: string;
|
|
43
|
+
}>, symbol>;
|
|
44
|
+
export declare const spacing: css.VarGroup<Readonly<{
|
|
45
|
+
xs: string;
|
|
46
|
+
sm: string;
|
|
47
|
+
md: string;
|
|
48
|
+
lg: string;
|
|
49
|
+
xl: string;
|
|
50
|
+
xxl: string;
|
|
51
|
+
}>, symbol>;
|
|
52
|
+
export declare const typography: css.VarGroup<Readonly<{
|
|
53
|
+
fontFamily: string;
|
|
54
|
+
fontFamilyMono: string;
|
|
55
|
+
weightRegular: string;
|
|
56
|
+
weightStrong: string;
|
|
57
|
+
weightBold: string;
|
|
58
|
+
bodySize: string;
|
|
59
|
+
bodyLineHeight: string;
|
|
60
|
+
captionSize: string;
|
|
61
|
+
captionLineHeight: string;
|
|
62
|
+
title4Size: string;
|
|
63
|
+
title4LineHeight: string;
|
|
64
|
+
title3Size: string;
|
|
65
|
+
title3LineHeight: string;
|
|
66
|
+
title2Size: string;
|
|
67
|
+
title2LineHeight: string;
|
|
68
|
+
title1Size: string;
|
|
69
|
+
title1LineHeight: string;
|
|
70
|
+
}>, symbol>;
|
|
71
|
+
export declare const motion: css.VarGroup<Readonly<{
|
|
72
|
+
durationFast: string;
|
|
73
|
+
durationBase: string;
|
|
74
|
+
easing: string;
|
|
75
|
+
}>, symbol>;
|
|
76
|
+
//# sourceMappingURL=tokens.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.css.d.ts","sourceRoot":"","sources":["../../src/tokens.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC;;;;;;;;GAQG;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;WAgClB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;WAKjB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;WAOlB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;WAsBrB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;WAIjB,CAAC"}
|