thread-ui 0.9.0 → 0.12.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/README.md +7 -1
- package/dist/components/data-display/filter-controls/variants/filter-controls.js +1 -1
- package/dist/components/data-display/filter-controls/variants/filter-controls.js.map +1 -1
- package/dist/components/data-display/filter-controls/variants/inline-filter-controls.js +1 -1
- package/dist/components/data-display/filter-controls/variants/inline-filter-controls.js.map +1 -1
- package/dist/components/data-display/sort-controls/sort-controls.js +1 -1
- package/dist/components/data-display/sort-controls/sort-controls.js.map +1 -1
- package/dist/components/form-elements/form-label/form-label.js +1 -1
- package/dist/components/form-elements/form-label/form-label.js.map +1 -1
- package/dist/components/media/image-panel/image-panel.js +47 -47
- package/dist/components/media/image-panel/image-panel.js.map +1 -1
- package/dist/components/media/media-card/media-card.js +22 -5
- package/dist/components/media/media-card/media-card.js.map +1 -1
- package/dist/components/navigation/nav-menu/components/nav-link/nav-link.js +2 -4
- package/dist/components/navigation/nav-menu/components/nav-link/nav-link.js.map +1 -1
- package/dist/components/typography/body/body.types.d.ts +31 -0
- package/dist/components/typography/body/body.types.js +2 -0
- package/dist/components/typography/body/body.types.js.map +1 -0
- package/dist/components/typography/body/list.d.ts +15 -0
- package/dist/components/typography/body/list.js +47 -0
- package/dist/components/typography/body/list.js.map +1 -0
- package/dist/components/typography/body/text.d.ts +12 -0
- package/dist/components/typography/body/text.js +30 -0
- package/dist/components/typography/body/text.js.map +1 -0
- package/dist/components/typography/code/code.d.ts +2 -0
- package/dist/components/typography/code/code.js +23 -0
- package/dist/components/typography/code/code.js.map +1 -0
- package/dist/components/typography/code/code.types.d.ts +9 -0
- package/dist/components/typography/code/code.types.js +2 -0
- package/dist/components/typography/code/code.types.js.map +1 -0
- package/dist/components/typography/heading/heading.d.ts +38 -0
- package/dist/components/typography/heading/heading.js +53 -0
- package/dist/components/typography/heading/heading.js.map +1 -0
- package/dist/components/typography/heading/heading.types.d.ts +13 -0
- package/dist/components/typography/heading/heading.types.js +2 -0
- package/dist/components/typography/heading/heading.types.js.map +1 -0
- package/dist/components/typography/heading/render-heading.d.ts +16 -0
- package/dist/components/typography/heading/render-heading.js +52 -0
- package/dist/components/typography/heading/render-heading.js.map +1 -0
- package/dist/components/typography/index.d.ts +8 -2
- package/dist/components/typography/index.js +4 -1
- package/dist/components/typography/index.js.map +1 -1
- package/dist/components/typography/page-header/page-header.js +5 -8
- package/dist/components/typography/page-header/page-header.js.map +1 -1
- package/dist/components/typography/shared-utils/get-presentation-styles.d.ts +2 -0
- package/dist/components/typography/shared-utils/get-presentation-styles.js +31 -0
- package/dist/components/typography/shared-utils/get-presentation-styles.js.map +1 -0
- package/dist/components/typography/shared-utils/get-typography-styles.d.ts +3 -0
- package/dist/components/typography/shared-utils/get-typography-styles.js +56 -0
- package/dist/components/typography/shared-utils/get-typography-styles.js.map +1 -0
- package/dist/components/typography/typography.d.ts +55 -22
- package/dist/components/typography/typography.js +198 -127
- package/dist/components/typography/typography.js.map +1 -1
- package/dist/components/typography/typography.types.d.ts +23 -0
- package/dist/components/typography/typography.types.js +2 -0
- package/dist/components/typography/typography.types.js.map +1 -0
- package/dist/components/ui/card/card.js +3 -32
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/divider/divider.d.ts +1 -1
- package/dist/components/ui/divider/divider.js +20 -6
- package/dist/components/ui/divider/divider.js.map +1 -1
- package/dist/components/ui/divider/divider.types.d.ts +3 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/tab-view/components/tab-item-content.d.ts +5 -0
- package/dist/components/ui/tab-view/components/tab-item-content.js +23 -0
- package/dist/components/ui/tab-view/components/tab-item-content.js.map +1 -0
- package/dist/components/ui/tab-view/components/tab-view-content.d.ts +1 -0
- package/dist/components/ui/tab-view/components/tab-view-content.js +8 -0
- package/dist/components/ui/tab-view/components/tab-view-content.js.map +1 -0
- package/dist/components/ui/tab-view/components/tab-view-controls.d.ts +1 -0
- package/dist/components/ui/tab-view/components/tab-view-controls.js +66 -0
- package/dist/components/ui/tab-view/components/tab-view-controls.js.map +1 -0
- package/dist/components/ui/tab-view/index.d.ts +2 -0
- package/dist/components/ui/tab-view/index.js +2 -0
- package/dist/components/ui/tab-view/index.js.map +1 -0
- package/dist/components/ui/tab-view/tab-view-context.d.ts +34 -0
- package/dist/components/ui/tab-view/tab-view-context.js +4 -0
- package/dist/components/ui/tab-view/tab-view-context.js.map +1 -0
- package/dist/components/ui/tab-view/tab-view.d.ts +18 -0
- package/dist/components/ui/tab-view/tab-view.js +42 -0
- package/dist/components/ui/tab-view/tab-view.js.map +1 -0
- package/dist/components/ui/tab-view/tab-view.types.d.ts +39 -0
- package/dist/components/ui/tab-view/tab-view.types.js +2 -0
- package/dist/components/ui/tab-view/tab-view.types.js.map +1 -0
- package/dist/styled-system/styles.css +1 -1
- package/dist/styled-system/tokens/index.js +477 -353
- package/dist/styled-system/tokens/tokens.d.ts +19 -19
- package/dist/styles/panda.css +1 -1
- package/dist/styles/theme.css +37 -0
- package/dist/theme/css-name-configurations/theme-css-names.d.ts +54 -0
- package/dist/theme/css-name-configurations/theme-css-names.js +52 -0
- package/dist/theme/css-name-configurations/theme-css-names.js.map +1 -1
- package/dist/theme/default-theme.js +53 -0
- package/dist/theme/default-theme.js.map +1 -1
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/theme-docs/misc-elements.d.ts +6 -0
- package/dist/theme/theme-docs/misc-elements.js +20 -0
- package/dist/theme/theme-docs/misc-elements.js.map +1 -0
- package/dist/theme/theme-surface-system.d.ts +2 -0
- package/dist/theme/theme-surface-system.js +8 -0
- package/dist/theme/theme-surface-system.js.map +1 -1
- package/dist/theme/theme-typography-system.d.ts +10 -0
- package/dist/theme/theme-typography-system.js +51 -0
- package/dist/theme/theme-typography-system.js.map +1 -0
- package/dist/types/theme/theme.types.d.ts +90 -7
- package/dist/utils/context/create-stateful-component-context/create-stateful-component-context.d.ts +11 -0
- package/dist/utils/context/create-stateful-component-context/create-stateful-component-context.js +21 -0
- package/dist/utils/context/create-stateful-component-context/create-stateful-component-context.js.map +1 -0
- package/dist/utils/context/create-stateful-component-context/index.d.ts +1 -0
- package/dist/utils/context/create-stateful-component-context/index.js +2 -0
- package/dist/utils/context/create-stateful-component-context/index.js.map +1 -0
- package/dist/utils/context/index.d.ts +1 -0
- package/dist/utils/context/index.js +1 -0
- package/dist/utils/context/index.js.map +1 -1
- package/dist/utils/theme-utilities/get-resolved-layer-values/get-resolved-layer-values.d.ts +1 -1
- package/dist/utils/theme-utilities/get-resolved-layer-values/get-resolved-layer-values.js +8 -1
- package/dist/utils/theme-utilities/get-resolved-layer-values/get-resolved-layer-values.js.map +1 -1
- package/dist/utils/theme-utilities/get-resolved-typography-values/get-resolved-typography-values.d.ts +12 -0
- package/dist/utils/theme-utilities/get-resolved-typography-values/get-resolved-typography-values.js +13 -0
- package/dist/utils/theme-utilities/get-resolved-typography-values/get-resolved-typography-values.js.map +1 -0
- package/dist/utils/theme-utilities/get-resolved-typography-values/index.d.ts +1 -0
- package/dist/utils/theme-utilities/get-resolved-typography-values/index.js +2 -0
- package/dist/utils/theme-utilities/get-resolved-typography-values/index.js.map +1 -0
- package/dist/utils/theme-utilities/get-surface-styles/get-surface-styles.d.ts +3 -0
- package/dist/utils/theme-utilities/get-surface-styles/get-surface-styles.js +38 -0
- package/dist/utils/theme-utilities/get-surface-styles/get-surface-styles.js.map +1 -0
- package/dist/utils/theme-utilities/get-surface-styles/index.d.ts +1 -0
- package/dist/utils/theme-utilities/get-surface-styles/index.js +2 -0
- package/dist/utils/theme-utilities/get-surface-styles/index.js.map +1 -0
- package/dist/utils/theme-utilities/get-text-color-styles/get-text-color-styles.d.ts +11 -0
- package/dist/utils/theme-utilities/get-text-color-styles/get-text-color-styles.js +34 -0
- package/dist/utils/theme-utilities/get-text-color-styles/get-text-color-styles.js.map +1 -0
- package/dist/utils/theme-utilities/get-text-color-styles/index.d.ts +1 -0
- package/dist/utils/theme-utilities/get-text-color-styles/index.js +2 -0
- package/dist/utils/theme-utilities/get-text-color-styles/index.js.map +1 -0
- package/dist/utils/theme-utilities/index.d.ts +3 -0
- package/dist/utils/theme-utilities/index.js +3 -0
- package/dist/utils/theme-utilities/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,145 +1,193 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { css, cva, cx } from '../../styled-system/css';
|
|
3
|
+
import { getResolvedTypographyValues, getTextColorStyles } from '../../utils';
|
|
4
|
+
/** Typography CVA — map individual token keys to style declarations. */
|
|
5
|
+
const getTypographyStyles = cva({
|
|
6
|
+
variants: {
|
|
7
|
+
fontFamily: {
|
|
8
|
+
body: { fontFamily: 'body' },
|
|
9
|
+
heading: { fontFamily: 'heading' },
|
|
10
|
+
mono: { fontFamily: 'mono' },
|
|
11
|
+
},
|
|
12
|
+
fontSize: {
|
|
13
|
+
'heading.sm': { fontSize: 'heading.sm' },
|
|
14
|
+
'heading.md': { fontSize: 'heading.md' },
|
|
15
|
+
'heading.lg': { fontSize: 'heading.lg' },
|
|
16
|
+
'heading.xl': { fontSize: 'heading.xl' },
|
|
17
|
+
'body.xxs': { fontSize: 'body.xxs' },
|
|
18
|
+
'body.xs': { fontSize: 'body.xs' },
|
|
19
|
+
'body.sm': { fontSize: 'body.sm' },
|
|
20
|
+
'body.md': { fontSize: 'body.md' },
|
|
21
|
+
'body.lg': { fontSize: 'body.lg' },
|
|
22
|
+
'body.xl': { fontSize: 'body.xl' },
|
|
23
|
+
},
|
|
24
|
+
fontWeight: {
|
|
25
|
+
regular: { fontWeight: 'regular' },
|
|
26
|
+
medium: { fontWeight: 'medium' },
|
|
27
|
+
semibold: { fontWeight: 'semibold' },
|
|
28
|
+
bold: { fontWeight: 'bold' },
|
|
29
|
+
},
|
|
30
|
+
lineHeight: {
|
|
31
|
+
none: { lineHeight: 'none' },
|
|
32
|
+
tighter: { lineHeight: 'tighter' },
|
|
33
|
+
tight: { lineHeight: 'tight' },
|
|
34
|
+
normal: { lineHeight: 'normal' },
|
|
35
|
+
loose: { lineHeight: 'loose' },
|
|
36
|
+
looser: { lineHeight: 'looser' },
|
|
37
|
+
},
|
|
38
|
+
letterSpacing: {
|
|
39
|
+
tight: { letterSpacing: 'tight' },
|
|
40
|
+
normal: { letterSpacing: 'normal' },
|
|
41
|
+
wide: { letterSpacing: 'wide' },
|
|
42
|
+
},
|
|
43
|
+
marginBottom: {
|
|
44
|
+
none: { marginBottom: 'none' },
|
|
45
|
+
xxs: { marginBottom: 'xxs' },
|
|
46
|
+
xs: { marginBottom: 'xs' },
|
|
47
|
+
sm: { marginBottom: 'sm' },
|
|
48
|
+
md: { marginBottom: 'md' },
|
|
49
|
+
lg: { marginBottom: 'lg' },
|
|
50
|
+
xl: { marginBottom: 'xl' },
|
|
51
|
+
xxl: { marginBottom: 'xxl' },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
/** Presentation CVA for align/truncate. Not part of the typography chord. */
|
|
56
|
+
const getPresentationStyles = cva({
|
|
57
|
+
variants: {
|
|
58
|
+
align: {
|
|
59
|
+
left: { textAlign: 'left' },
|
|
60
|
+
center: { textAlign: 'center' },
|
|
61
|
+
},
|
|
62
|
+
truncate: {
|
|
63
|
+
true: {
|
|
64
|
+
overflow: 'hidden',
|
|
65
|
+
whiteSpace: 'nowrap',
|
|
66
|
+
textOverflow: 'ellipsis',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
indent: {
|
|
70
|
+
true: {
|
|
71
|
+
textIndent: '4',
|
|
72
|
+
},
|
|
73
|
+
false: {},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
/** Subtitle role mapping: subtitle under a heading uses one-step-down typography role. */
|
|
78
|
+
const SUBTITLE_ROLE_MAP = {
|
|
79
|
+
title: 'h1',
|
|
80
|
+
h1: 'h2',
|
|
81
|
+
h2: 'h3',
|
|
82
|
+
h3: 'body',
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Internal helper rendering a heading with optional subtitle.
|
|
86
|
+
* Wraps in <hgroup> when subtitle is present.
|
|
87
|
+
*
|
|
88
|
+
*/
|
|
89
|
+
const renderHeading = (role, HeadingTag, { children, align = 'left', inline = false, color = 'standard', truncate = false, subtitle, }) => {
|
|
90
|
+
// If no subtitle, pass marginBottom through unless inline
|
|
91
|
+
if (!subtitle) {
|
|
92
|
+
const resolved = getResolvedTypographyValues({
|
|
93
|
+
role,
|
|
94
|
+
marginBottom: inline ? 'none' : undefined,
|
|
95
|
+
});
|
|
96
|
+
const headingClass = cx(getTypographyStyles(resolved), getPresentationStyles({ align, truncate: truncate || undefined }), getTextColorStyles(color));
|
|
97
|
+
return _jsx(HeadingTag, { className: headingClass, children: children });
|
|
98
|
+
}
|
|
99
|
+
// Wrap subtitle and heading in hgroup, add margin to wrapper
|
|
100
|
+
const headingResolved = getResolvedTypographyValues({
|
|
101
|
+
role,
|
|
102
|
+
marginBottom: 'none',
|
|
103
|
+
});
|
|
104
|
+
const headingClass = cx(getTypographyStyles(headingResolved), getPresentationStyles({ align, truncate: truncate || undefined }), getTextColorStyles(color));
|
|
105
|
+
const subtitleRole = SUBTITLE_ROLE_MAP[role];
|
|
106
|
+
const subtitleResolved = getResolvedTypographyValues({
|
|
107
|
+
role: subtitleRole,
|
|
108
|
+
fontFamily: 'heading',
|
|
109
|
+
marginBottom: 'none',
|
|
110
|
+
});
|
|
111
|
+
const subtitleClass = cx(getTypographyStyles(subtitleResolved), getPresentationStyles({ align, truncate: truncate || undefined }), getTextColorStyles('text-secondary'));
|
|
112
|
+
// Derive hgroup outer margin from heading
|
|
113
|
+
const wrapperResolved = getResolvedTypographyValues({
|
|
114
|
+
role,
|
|
115
|
+
marginBottom: inline ? 'none' : undefined,
|
|
116
|
+
});
|
|
117
|
+
const wrapperClass = getTypographyStyles({
|
|
118
|
+
fontSize: wrapperResolved.fontSize,
|
|
119
|
+
marginBottom: wrapperResolved.marginBottom,
|
|
120
|
+
});
|
|
121
|
+
return (_jsxs("hgroup", { className: wrapperClass, children: [_jsx(HeadingTag, { className: headingClass, children: children }), _jsx("p", { className: subtitleClass, children: subtitle })] }));
|
|
122
|
+
};
|
|
3
123
|
/**
|
|
4
|
-
* Display-level heading. Renders as `h1`
|
|
124
|
+
* Display-level heading. Renders as `h1`
|
|
5
125
|
*
|
|
6
126
|
* @example
|
|
7
127
|
* <Title align="center">Welcome</Title>
|
|
128
|
+
* <Title subtitle="Last updated March 2025">Welcome</Title>
|
|
8
129
|
*/
|
|
9
|
-
export const Title = (
|
|
10
|
-
const styles = {
|
|
11
|
-
fontSize: '3rem',
|
|
12
|
-
fontWeight: 700,
|
|
13
|
-
lineHeight: 1.3,
|
|
14
|
-
marginBottom: inline ? 0 : '40px',
|
|
15
|
-
textAlign: align,
|
|
16
|
-
color: getColoredTextColor(color),
|
|
17
|
-
...(truncate && {
|
|
18
|
-
overflow: 'hidden',
|
|
19
|
-
whiteSpace: 'nowrap',
|
|
20
|
-
textOverflow: 'ellipsis',
|
|
21
|
-
}),
|
|
22
|
-
};
|
|
23
|
-
return _jsx("h1", { style: styles, children: children });
|
|
24
|
-
};
|
|
130
|
+
export const Title = (props) => renderHeading('title', 'h1', props);
|
|
25
131
|
/**
|
|
26
|
-
* Primary heading
|
|
132
|
+
* Primary heading
|
|
27
133
|
*
|
|
28
134
|
* @example
|
|
29
135
|
* <H1>Page Title</H1>
|
|
30
136
|
*/
|
|
31
|
-
export const H1 = (
|
|
32
|
-
const styles = {
|
|
33
|
-
fontSize: '2rem',
|
|
34
|
-
fontWeight: 600,
|
|
35
|
-
lineHeight: 1.3,
|
|
36
|
-
marginBottom: inline ? 0 : '32px',
|
|
37
|
-
textAlign: align,
|
|
38
|
-
color: getColoredTextColor(color),
|
|
39
|
-
...(truncate && {
|
|
40
|
-
overflow: 'hidden',
|
|
41
|
-
whiteSpace: 'nowrap',
|
|
42
|
-
textOverflow: 'ellipsis',
|
|
43
|
-
}),
|
|
44
|
-
};
|
|
45
|
-
return _jsx("h1", { style: styles, children: children });
|
|
46
|
-
};
|
|
137
|
+
export const H1 = (props) => renderHeading('h1', 'h1', props);
|
|
47
138
|
/**
|
|
48
|
-
* Secondary heading
|
|
139
|
+
* Secondary heading
|
|
49
140
|
*
|
|
50
141
|
* @example
|
|
51
142
|
* <H2>Section Title</H2>
|
|
52
143
|
*/
|
|
53
|
-
export const H2 = (
|
|
54
|
-
const styles = {
|
|
55
|
-
fontSize: '1.5rem',
|
|
56
|
-
fontWeight: 600,
|
|
57
|
-
lineHeight: 1.3,
|
|
58
|
-
marginBottom: inline ? 0 : '24px',
|
|
59
|
-
textAlign: align,
|
|
60
|
-
color: getColoredTextColor(color),
|
|
61
|
-
...(truncate && {
|
|
62
|
-
overflow: 'hidden',
|
|
63
|
-
whiteSpace: 'nowrap',
|
|
64
|
-
textOverflow: 'ellipsis',
|
|
65
|
-
}),
|
|
66
|
-
};
|
|
67
|
-
return _jsx("h2", { style: styles, children: children });
|
|
68
|
-
};
|
|
144
|
+
export const H2 = (props) => renderHeading('h2', 'h2', props);
|
|
69
145
|
/**
|
|
70
|
-
* Tertiary heading
|
|
146
|
+
* Tertiary heading
|
|
71
147
|
*
|
|
72
148
|
* @example
|
|
73
149
|
* <H3>Subsection Title</H3>
|
|
74
150
|
*/
|
|
75
|
-
export const H3 = (
|
|
76
|
-
const styles = {
|
|
77
|
-
fontSize: '1.25rem',
|
|
78
|
-
fontWeight: 600,
|
|
79
|
-
lineHeight: 1.3,
|
|
80
|
-
marginBottom: inline ? 0 : '16px',
|
|
81
|
-
textAlign: align,
|
|
82
|
-
color: getColoredTextColor(color),
|
|
83
|
-
...(truncate && {
|
|
84
|
-
overflow: 'hidden',
|
|
85
|
-
whiteSpace: 'nowrap',
|
|
86
|
-
textOverflow: 'ellipsis',
|
|
87
|
-
}),
|
|
88
|
-
};
|
|
89
|
-
return _jsx("h3", { style: styles, children: children });
|
|
90
|
-
};
|
|
91
|
-
const TEXT_SIZES = {
|
|
92
|
-
xxs: '0.625rem',
|
|
93
|
-
xs: '0.75rem',
|
|
94
|
-
sm: '0.875rem',
|
|
95
|
-
md: '1rem',
|
|
96
|
-
lg: '1.125rem',
|
|
97
|
-
xl: '1.25rem',
|
|
98
|
-
xxl: '1.375rem',
|
|
99
|
-
};
|
|
151
|
+
export const H3 = (props) => renderHeading('h3', 'h3', props);
|
|
100
152
|
/**
|
|
101
153
|
* Body text. Renders as `p` by default or `span` when `inline` is true.
|
|
102
154
|
*
|
|
155
|
+
* Allows for individual attribute overrides for customization
|
|
156
|
+
*
|
|
103
157
|
* @example
|
|
104
|
-
* <Text
|
|
158
|
+
* <Text>Default Text</Text>
|
|
159
|
+
* @example
|
|
160
|
+
* <Text size="sm" weight="semibold">Important note</Text>
|
|
105
161
|
*/
|
|
106
|
-
export const Text = ({ children, align = 'left', inline = false, color = 'standard',
|
|
162
|
+
export const Text = ({ children, align = 'left', inline = false, color = 'standard', size = 'md', weight, lineHeight, letterSpacing, marginBottom, truncate = false, indent, }) => {
|
|
107
163
|
const Component = inline ? 'span' : 'p';
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
textOverflow: 'ellipsis',
|
|
119
|
-
}),
|
|
120
|
-
};
|
|
121
|
-
return _jsx(Component, { style: styles, children: children });
|
|
164
|
+
const resolved = getResolvedTypographyValues({
|
|
165
|
+
role: 'body',
|
|
166
|
+
fontSize: `body.${size}`,
|
|
167
|
+
fontWeight: weight,
|
|
168
|
+
lineHeight,
|
|
169
|
+
letterSpacing,
|
|
170
|
+
marginBottom: inline ? 'none' : marginBottom,
|
|
171
|
+
});
|
|
172
|
+
const className = cx(getTypographyStyles(resolved), getPresentationStyles({ indent, align, truncate: truncate || undefined }), getTextColorStyles(color));
|
|
173
|
+
return _jsx(Component, { className: className, children: children });
|
|
122
174
|
};
|
|
123
175
|
/**
|
|
124
|
-
*
|
|
176
|
+
* Standalone secondary text rendered as an inline `span`.
|
|
177
|
+
* For subtitles attached to headings, use the `subtitle` prop on Title/H1/H2/H3 instead.
|
|
125
178
|
*
|
|
126
179
|
* @example
|
|
127
180
|
* <Subtitle>Last updated March 2025</Subtitle>
|
|
128
181
|
*/
|
|
129
|
-
export const Subtitle = ({ children, align = 'left', color = '
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
fontSize: '
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
whiteSpace: 'nowrap',
|
|
139
|
-
textOverflow: 'ellipsis',
|
|
140
|
-
}),
|
|
141
|
-
};
|
|
142
|
-
return _jsx("span", { style: styles, children: children });
|
|
182
|
+
export const Subtitle = ({ children, align = 'left', color = 'secondary', truncate = false, fontFamily, indent, }) => {
|
|
183
|
+
const resolved = getResolvedTypographyValues({
|
|
184
|
+
role: 'body',
|
|
185
|
+
fontSize: 'body.sm',
|
|
186
|
+
marginBottom: 'none',
|
|
187
|
+
fontFamily,
|
|
188
|
+
});
|
|
189
|
+
const className = cx(getTypographyStyles(resolved), getPresentationStyles({ indent, align, truncate: truncate || undefined }), getTextColorStyles(color));
|
|
190
|
+
return (_jsx("span", { className: className, style: { display: 'block', marginTop: '0.2em' }, children: children }));
|
|
143
191
|
};
|
|
144
192
|
/**
|
|
145
193
|
* Unordered list with configurable marker style, size, and color.
|
|
@@ -147,16 +195,22 @@ export const Subtitle = ({ children, align = 'left', color = 'text-secondary', t
|
|
|
147
195
|
* @example
|
|
148
196
|
* <List items={['Apples', 'Oranges', 'Bananas']} decoration="circle" />
|
|
149
197
|
*/
|
|
150
|
-
export const List = ({ align = 'left', color = 'standard', size = 'md', items, decoration = 'disc', }) => {
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
198
|
+
export const List = ({ align = 'left', color = 'standard', size = 'md', weight, lineHeight, letterSpacing, items, decoration = 'disc', }) => {
|
|
199
|
+
const resolved = getResolvedTypographyValues({
|
|
200
|
+
role: 'body',
|
|
201
|
+
fontSize: `body.${size}`,
|
|
202
|
+
fontWeight: weight,
|
|
203
|
+
lineHeight,
|
|
204
|
+
letterSpacing,
|
|
205
|
+
marginBottom: 'none',
|
|
206
|
+
});
|
|
207
|
+
const itemClass = cx(getTypographyStyles(resolved), getPresentationStyles({ align }), getTextColorStyles(color));
|
|
208
|
+
const listStyles = {
|
|
209
|
+
padding: 0,
|
|
156
210
|
listStyleType: decoration === 'blank' ? 'none' : decoration,
|
|
157
211
|
marginLeft: decoration !== 'none' ? '1em' : undefined,
|
|
158
212
|
};
|
|
159
|
-
return (_jsx("ul", { style:
|
|
213
|
+
return (_jsx("ul", { style: listStyles, children: items.map((item, index) => (_jsx("li", { className: itemClass, children: item }, index))) }));
|
|
160
214
|
};
|
|
161
215
|
/**
|
|
162
216
|
* Ordered list with decimal numbering.
|
|
@@ -164,15 +218,32 @@ export const List = ({ align = 'left', color = 'standard', size = 'md', items, d
|
|
|
164
218
|
* @example
|
|
165
219
|
* <OrderedList items={['First', 'Second', 'Third']} />
|
|
166
220
|
*/
|
|
167
|
-
export const OrderedList = ({ align = 'left', color = 'standard', size = 'md', items, }) => {
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
};
|
|
176
|
-
|
|
221
|
+
export const OrderedList = ({ align = 'left', color = 'standard', size = 'md', weight, lineHeight, letterSpacing, items, }) => {
|
|
222
|
+
const resolved = getResolvedTypographyValues({
|
|
223
|
+
role: 'body',
|
|
224
|
+
fontSize: `body.${size}`,
|
|
225
|
+
fontWeight: weight,
|
|
226
|
+
lineHeight,
|
|
227
|
+
letterSpacing,
|
|
228
|
+
marginBottom: 'none',
|
|
229
|
+
});
|
|
230
|
+
const itemClass = cx(getTypographyStyles(resolved), getPresentationStyles({ align }), getTextColorStyles(color));
|
|
231
|
+
return (_jsx("ol", { style: { padding: 0, listStyleType: 'decimal', marginLeft: '1em' }, children: items.map((item, index) => (_jsx("li", { className: itemClass, children: item }, index))) }));
|
|
232
|
+
};
|
|
233
|
+
export const Code = ({ children, align = 'left', color = 'standard', size = 'sm', truncate = false, }) => {
|
|
234
|
+
const resolved = getResolvedTypographyValues({
|
|
235
|
+
role: 'code',
|
|
236
|
+
fontSize: `body.${size}`,
|
|
237
|
+
});
|
|
238
|
+
const className = cx(css({
|
|
239
|
+
paddingY: '2px',
|
|
240
|
+
paddingX: '3px',
|
|
241
|
+
backgroundColor: 'structure.subtle',
|
|
242
|
+
borderRadius: 'xs',
|
|
243
|
+
borderWidth: 'sm',
|
|
244
|
+
borderColor: 'structure.default',
|
|
245
|
+
letterSpacing: 'wide',
|
|
246
|
+
}), getTypographyStyles(resolved), getPresentationStyles({ align, truncate: truncate || undefined }), getTextColorStyles(color));
|
|
247
|
+
return _jsx("code", { className: className, children: children });
|
|
177
248
|
};
|
|
178
249
|
//# sourceMappingURL=typography.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../../src/components/typography/typography.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../../src/components/typography/typography.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAY1E,wEAAwE;AACxE,MAAM,mBAAmB,GAAG,GAAG,CAAC;IAC/B,QAAQ,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AE,IAAI;QAClB,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,mBAAmB;QAChC,aAAa,EAAE,MAAM;KACrB,CAAC,EACF,mBAAmB,CAAC,QAAQ,CAAC,EAC7B,qBAAqB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,IAAI,SAAS,EAAE,CAAC,EACjE,kBAAkB,CAAC,KAAK,CAAC,CACzB,CAAC;IAEF,OAAO,eAAM,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAQ,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ColoredTextOptions, Prettify } from '../../types';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type BaseTypographyPresentationProps = {
|
|
4
|
+
/** Text alignment @default `'left'` */
|
|
5
|
+
align?: 'left' | 'center';
|
|
6
|
+
/** Removes bottom margin when true @default `false` */
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
/** Truncates text to a single line with ellipsis @default `false` */
|
|
9
|
+
truncate?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type ExpandedTypographyPresentationProps = Prettify<BaseTypographyPresentationProps & {
|
|
12
|
+
/** Optionally indent text */
|
|
13
|
+
indent?: boolean;
|
|
14
|
+
/** Optionally underline text */
|
|
15
|
+
underline?: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
/** Shared Typography Props */
|
|
18
|
+
export type TypographyProps = Prettify<BaseTypographyPresentationProps & {
|
|
19
|
+
/** Content */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/** Text color variant @default `'standard'` */
|
|
22
|
+
color?: ColoredTextOptions;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.types.js","sourceRoot":"","sources":["../../../src/components/typography/typography.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cva } from '../../../styled-system/css';
|
|
2
|
+
import { cva, cx } from '../../../styled-system/css';
|
|
3
3
|
import { H3 } from '../../../components/typography';
|
|
4
4
|
import { Divider } from '../divider';
|
|
5
|
-
import { getResolvedLayerValues } from '../../../utils';
|
|
5
|
+
import { getResolvedLayerValues, getSurfaceStyles } from '../../../utils';
|
|
6
6
|
const styles = {
|
|
7
7
|
cardContainer: cva({
|
|
8
8
|
base: {
|
|
@@ -39,26 +39,6 @@ const styles = {
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
-
bg: {
|
|
43
|
-
none: {},
|
|
44
|
-
canvas: { backgroundColor: 'canvas' },
|
|
45
|
-
inset: { backgroundColor: 'inset' },
|
|
46
|
-
surface: { backgroundColor: 'surface' },
|
|
47
|
-
elevated: { backgroundColor: 'elevated' },
|
|
48
|
-
overlay: { backgroundColor: 'overlay' },
|
|
49
|
-
},
|
|
50
|
-
shadow: {
|
|
51
|
-
none: { boxShadow: 'none' },
|
|
52
|
-
sm: { boxShadow: 'sm' },
|
|
53
|
-
md: { boxShadow: 'md' },
|
|
54
|
-
lg: { boxShadow: 'lg' },
|
|
55
|
-
},
|
|
56
|
-
structure: {
|
|
57
|
-
none: { borderWidth: '0' },
|
|
58
|
-
subtle: { borderWidth: 'md', borderColor: 'structure.subtle' },
|
|
59
|
-
default: { borderWidth: 'md', borderColor: 'structure.default' },
|
|
60
|
-
strong: { borderWidth: 'md', borderColor: 'structure.strong' },
|
|
61
|
-
},
|
|
62
42
|
},
|
|
63
43
|
compoundVariants: [
|
|
64
44
|
{
|
|
@@ -72,9 +52,6 @@ const styles = {
|
|
|
72
52
|
defaultVariants: {
|
|
73
53
|
size: 'md',
|
|
74
54
|
fullWidth: false,
|
|
75
|
-
bg: 'surface',
|
|
76
|
-
shadow: 'none',
|
|
77
|
-
structure: 'subtle',
|
|
78
55
|
},
|
|
79
56
|
}),
|
|
80
57
|
title: cva({
|
|
@@ -113,12 +90,6 @@ const styles = {
|
|
|
113
90
|
export const Card = ({ layer = 'surface', bg, shadow, structure, children, size = 'md', fullWidth = false, title, }) => {
|
|
114
91
|
// Resolve from level, allow individual overrides
|
|
115
92
|
const layerValues = getResolvedLayerValues({ layer, bg, shadow, structure });
|
|
116
|
-
return (_jsxs("div", { className: styles.cardContainer({
|
|
117
|
-
size,
|
|
118
|
-
fullWidth,
|
|
119
|
-
bg: layerValues.bg,
|
|
120
|
-
shadow: layerValues.shadow,
|
|
121
|
-
structure: layerValues.structure,
|
|
122
|
-
}), children: [title && (_jsxs("div", { className: styles.title({ size }), children: [_jsx(H3, { align: title.align, inline: true, children: title.text }), title?.divider && _jsx(Divider, {})] })), _jsx("div", { children: children })] }));
|
|
93
|
+
return (_jsxs("div", { className: cx(styles.cardContainer({ size, fullWidth }), getSurfaceStyles(layerValues)), children: [title && (_jsxs("div", { className: styles.title({ size }), children: [_jsx(H3, { align: title.align, inline: true, children: title.text }), title?.divider && _jsx(Divider, {})] })), _jsx("div", { children: children })] }));
|
|
123
94
|
};
|
|
124
95
|
//# sourceMappingURL=card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../../../src/components/ui/card/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../../../src/components/ui/card/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEnE,MAAM,MAAM,GAAG;IACd,aAAa,EAAE,GAAG,CAAC;QAClB,IAAI,EAAE;YACL,WAAW,EAAE,O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jB,KAAK,GACM,EAAE,EAAE;IACf,iDAAiD;IACjD,MAAM,WAAW,GAAG,sBAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAE7E,OAAO,CACN,eACC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,aAEtF,KAAK,IAAI,CACT,eAAK,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,aACrC,KAAC,EAAE,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,kBAC5B,KAAK,CAAC,IAAI,GACP,EACJ,KAAK,EAAE,OAAO,IAAI,KAAC,OAAO,KAAG,IACzB,CACN,EACD,wBAAM,QAAQ,GAAO,IAChB,CACN,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -5,4 +5,4 @@ import { DividerProps } from './divider.types';
|
|
|
5
5
|
* @example
|
|
6
6
|
* <Divider width="50%" marginY="12px" weight="light" />
|
|
7
7
|
*/
|
|
8
|
-
export declare const Divider: ({ width, marginY, weight }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Divider: ({ width, marginY, weight, color }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,10 +2,24 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { css, cva, cx } from '../../../styled-system/css';
|
|
3
3
|
const styles = {
|
|
4
4
|
core: {
|
|
5
|
-
base:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
base: cva({
|
|
6
|
+
base: {
|
|
7
|
+
marginX: 'auto',
|
|
8
|
+
borderRadius: '9999px',
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
color: {
|
|
12
|
+
subtle: {
|
|
13
|
+
backgroundColor: 'structure.subtle',
|
|
14
|
+
},
|
|
15
|
+
default: {
|
|
16
|
+
backgroundColor: 'structure.default',
|
|
17
|
+
},
|
|
18
|
+
strong: {
|
|
19
|
+
backgroundColor: 'structure.strong',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
9
23
|
}),
|
|
10
24
|
marginY: css({
|
|
11
25
|
marginY: '4',
|
|
@@ -33,12 +47,12 @@ const styles = {
|
|
|
33
47
|
* @example
|
|
34
48
|
* <Divider width="50%" marginY="12px" weight="light" />
|
|
35
49
|
*/
|
|
36
|
-
export const Divider = ({ width, marginY, weight }) => {
|
|
50
|
+
export const Divider = ({ width, marginY, weight, color = 'default' }) => {
|
|
37
51
|
const staticStyles = {
|
|
38
52
|
...(width && { width }),
|
|
39
53
|
...(marginY && { marginTop: marginY, marginBottom: marginY }),
|
|
40
54
|
};
|
|
41
|
-
const className = cx(styles.core.base, styles.dividerWeight({ weight }), !marginY && styles.core.marginY, !width && styles.core.width);
|
|
55
|
+
const className = cx(styles.core.base({ color }), styles.dividerWeight({ weight }), !marginY && styles.core.marginY, !width && styles.core.width);
|
|
42
56
|
return _jsx("div", { style: staticStyles, className: className });
|
|
43
57
|
};
|
|
44
58
|
//# sourceMappingURL=divider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../../../src/components/ui/divider/divider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,MAAM,GAAG;IACd,IAAI,EAAE;QACL,IAAI,EAAE,GAAG,CAAC;YACT,OAAO,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../../../src/components/ui/divider/divider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,MAAM,GAAG;IACd,IA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AC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAC/B,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAC3B,CAAC;IAEF,OAAO,cAAK,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC;AAC3D,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StructureColorOptions } from '../../../types';
|
|
1
2
|
export type DividerProps = {
|
|
2
3
|
/** Width override. Defaults to `75%` */
|
|
3
4
|
width?: string;
|
|
@@ -5,4 +6,6 @@ export type DividerProps = {
|
|
|
5
6
|
marginY?: string;
|
|
6
7
|
/** Line thickness @default `'standard'` */
|
|
7
8
|
weight?: 'light' | 'standard' | 'heavy';
|
|
9
|
+
/** Structure Color @default `'default'` */
|
|
10
|
+
color?: StructureColorOptions;
|
|
8
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
|