@a-type/ui 6.0.17 → 6.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/box/Box.d.ts +2 -1
- package/dist/components/box/Box.js +2 -2
- package/dist/components/box/Box.js.map +1 -1
- package/dist/components/box/Box.module.css +15 -0
- package/dist/components/typography/typography.d.ts +4 -1
- package/dist/components/typography/typography.js +4 -1
- package/dist/components/typography/typography.js.map +1 -1
- package/dist/components/typography/typography.module.css +19 -0
- package/package.json +1 -1
- package/src/components/box/Box.module.css +15 -0
- package/src/components/box/Box.tsx +3 -0
- package/src/components/typography/typography.module.css +19 -0
- package/src/components/typography/typography.tsx +9 -0
|
@@ -28,6 +28,7 @@ export interface BoxProps extends Omit<SlotDivProps, 'wrap'> {
|
|
|
28
28
|
ref?: Ref<HTMLDivElement>;
|
|
29
29
|
container?: boolean;
|
|
30
30
|
glass?: boolean;
|
|
31
|
+
self?: 'auto' | 'start' | 'end' | 'center' | 'stretch';
|
|
31
32
|
}
|
|
32
|
-
export declare function Box({ className, items: itemsSolo, justify: justifySolo, layout: align, gap, wrap, p, col, d, direction, style, container, surface, color, border, full, overflow, grow, elevated, rounded, glass, ref, ...rest }: BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function Box({ className, items: itemsSolo, justify: justifySolo, layout: align, gap, wrap, p, col, d, direction, style, container, surface, color, border, full, overflow, grow, elevated, rounded, glass, self, ref, ...rest }: BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
33
34
|
export {};
|
|
@@ -14,11 +14,11 @@ import clsx from 'clsx';
|
|
|
14
14
|
import { SlotDiv } from '../utility/SlotDiv.js';
|
|
15
15
|
import cls from './Box.module.css';
|
|
16
16
|
export function Box(_a) {
|
|
17
|
-
var { className, items: itemsSolo, justify: justifySolo, layout: align, gap, wrap, p, col, d = col ? 'col' : undefined, direction = d, style, container, surface, color, border, full, overflow, grow, elevated, rounded = surface ? true : undefined, glass, ref } = _a, rest = __rest(_a, ["className", "items", "justify", "layout", "gap", "wrap", "p", "col", "d", "direction", "style", "container", "surface", "color", "border", "full", "overflow", "grow", "elevated", "rounded", "glass", "ref"]);
|
|
17
|
+
var { className, items: itemsSolo, justify: justifySolo, layout: align, gap, wrap, p, col, d = col ? 'col' : undefined, direction = d, style, container, surface, color, border, full, overflow, grow, elevated, rounded = surface ? true : undefined, glass, self, ref } = _a, rest = __rest(_a, ["className", "items", "justify", "layout", "gap", "wrap", "p", "col", "d", "direction", "style", "container", "surface", "color", "border", "full", "overflow", "grow", "elevated", "rounded", "glass", "self", "ref"]);
|
|
18
18
|
const items = itemsSolo !== null && itemsSolo !== void 0 ? itemsSolo : align === null || align === void 0 ? void 0 : align.split(' ')[0];
|
|
19
19
|
const justify = justifySolo !== null && justifySolo !== void 0 ? justifySolo : align === null || align === void 0 ? void 0 : align.split(' ')[1];
|
|
20
20
|
const [inset, elevation, up] = parseElevated(elevated);
|
|
21
|
-
const main = (_jsx(SlotDiv, Object.assign({ ref: ref }, rest, { style: style, className: clsx('layer-components:relative layer-components:flex', color && `@mode-${color}`, cls.root, className), "data-direction": direction, "data-gap": gap, "data-items": items, "data-justify": justify, "data-wrap": wrap, "data-p": p, "data-rounded": rounded, "data-surface": surface, "data-border": border, "data-full": full, "data-overflow": overflow, "data-grow": grow, "data-elevated": elevation, "data-shadow-up": up, "data-shadow-inset": inset, "data-container": container, "data-glass": glass })));
|
|
21
|
+
const main = (_jsx(SlotDiv, Object.assign({ ref: ref }, rest, { style: style, className: clsx('layer-components:relative layer-components:flex', color && `@mode-${color}`, cls.root, className), "data-direction": direction, "data-gap": gap, "data-items": items, "data-justify": justify, "data-wrap": wrap, "data-p": p, "data-rounded": rounded, "data-surface": surface, "data-border": border, "data-full": full, "data-overflow": overflow, "data-grow": grow, "data-elevated": elevation, "data-shadow-up": up, "data-shadow-inset": inset, "data-container": container, "data-glass": glass, "data-self": self })));
|
|
22
22
|
return main;
|
|
23
23
|
}
|
|
24
24
|
function parseElevated(elevated) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../../src/components/box/Box.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,OAAO,EAAgB,MAAM,uBAAuB,CAAC;AAC9D,OAAO,GAAG,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../../src/components/box/Box.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,OAAO,EAAgB,MAAM,uBAAuB,CAAC;AAC9D,OAAO,GAAG,MAAM,kBAAkB,CAAC;AA0CnC,MAAM,UAAU,GAAG,CAAC,EAyBT;QAzBS,EACnB,SAAS,EACT,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,KAAK,EACb,GAAG,EACH,IAAI,EACJ,CAAC,EACD,GAAG,EACH,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAC3B,SAAS,GAAG,CAAC,EACb,KAAK,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACpC,KAAK,EACL,IAAI,EACJ,GAAG,OAEO,EADP,IAAI,cAxBY,uNAyBnB,CADO;IAEP,MAAM,KAAK,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,KAAK,aAAL,KAAK,uBAAL,KAA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E,IAAI,CAAU,CAAC;AAC1C,CAAC"}
|
|
@@ -74,6 +74,21 @@
|
|
|
74
74
|
&[data-justify='evenly'] {
|
|
75
75
|
justify-content: space-evenly;
|
|
76
76
|
}
|
|
77
|
+
&[data-self='auto'] {
|
|
78
|
+
align-self: auto;
|
|
79
|
+
}
|
|
80
|
+
&[data-self='start'] {
|
|
81
|
+
align-self: flex-start;
|
|
82
|
+
}
|
|
83
|
+
&[data-self='center'] {
|
|
84
|
+
align-self: center;
|
|
85
|
+
}
|
|
86
|
+
&[data-self='end'] {
|
|
87
|
+
align-self: flex-end;
|
|
88
|
+
}
|
|
89
|
+
&[data-self='stretch'] {
|
|
90
|
+
align-self: stretch;
|
|
91
|
+
}
|
|
77
92
|
|
|
78
93
|
&[data-p='none'] {
|
|
79
94
|
padding: 0;
|
|
@@ -6,10 +6,13 @@ export interface TypographyProps extends useRender.ComponentProps<'span'> {
|
|
|
6
6
|
strikethrough?: boolean;
|
|
7
7
|
bold?: boolean;
|
|
8
8
|
thin?: boolean;
|
|
9
|
+
normal?: boolean;
|
|
10
|
+
uppercase?: boolean;
|
|
9
11
|
truncate?: boolean;
|
|
10
12
|
dim?: boolean;
|
|
13
|
+
color?: 'neutral' | 'main' | 'attention' | 'success';
|
|
11
14
|
}
|
|
12
|
-
export declare function Text({ emphasis, italic, underline, strikethrough, render, className, bold, thin, truncate, dim, ...rest }: TypographyProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
15
|
+
export declare function Text({ emphasis, italic, underline, strikethrough, render, className, bold, thin, truncate, dim, color, normal, uppercase, ...rest }: TypographyProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
13
16
|
export declare const Heading: import("react").FunctionComponent<TypographyProps>;
|
|
14
17
|
export declare const HeroText: import("react").FunctionComponent<TypographyProps>;
|
|
15
18
|
export declare const P: (props: TypographyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ import { withClassName } from '../../hooks/withClassName.js';
|
|
|
16
16
|
import { withProps } from '../../hooks/withProps.js';
|
|
17
17
|
import cls from './typography.module.css';
|
|
18
18
|
export function Text(_a) {
|
|
19
|
-
var { emphasis, italic, underline, strikethrough, render, className, bold, thin, truncate, dim } = _a, rest = __rest(_a, ["emphasis", "italic", "underline", "strikethrough", "render", "className", "bold", "thin", "truncate", "dim"]);
|
|
19
|
+
var { emphasis, italic, underline, strikethrough, render, className, bold, thin, truncate, dim, color, normal, uppercase } = _a, rest = __rest(_a, ["emphasis", "italic", "underline", "strikethrough", "render", "className", "bold", "thin", "truncate", "dim", "color", "normal", "uppercase"]);
|
|
20
20
|
return useRender({
|
|
21
21
|
render,
|
|
22
22
|
defaultTagName: 'span',
|
|
@@ -30,6 +30,9 @@ export function Text(_a) {
|
|
|
30
30
|
thin: thin ? true : undefined,
|
|
31
31
|
truncate: truncate ? true : undefined,
|
|
32
32
|
dim: dim ? true : undefined,
|
|
33
|
+
color: color ? color : undefined,
|
|
34
|
+
normal: normal ? true : undefined,
|
|
35
|
+
uppercase: uppercase ? true : undefined,
|
|
33
36
|
},
|
|
34
37
|
});
|
|
35
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../../src/components/typography/typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,GAAG,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../../src/components/typography/typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,IAAI,MAAM,MA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,12 @@
|
|
|
31
31
|
&[data-thin] {
|
|
32
32
|
font-weight: var(--m-text-weight-thin);
|
|
33
33
|
}
|
|
34
|
+
&[data-normal] {
|
|
35
|
+
font-weight: var(--m-text-weight-normal);
|
|
36
|
+
}
|
|
37
|
+
&[data-uppercase] {
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
}
|
|
34
40
|
&[data-truncate] {
|
|
35
41
|
overflow: hidden;
|
|
36
42
|
text-overflow: ellipsis;
|
|
@@ -40,6 +46,19 @@
|
|
|
40
46
|
&[data-dim] {
|
|
41
47
|
@apply --mx-fg(var(--m-color-neutral-heavy));
|
|
42
48
|
}
|
|
49
|
+
|
|
50
|
+
&[data-color='neutral'] {
|
|
51
|
+
@apply --mx-fg(var(--m-color-neutral-ink));
|
|
52
|
+
}
|
|
53
|
+
&[data-color='main'] {
|
|
54
|
+
@apply --mx-fg(var(--m-color-main-heavy));
|
|
55
|
+
}
|
|
56
|
+
&[data-color='attention'] {
|
|
57
|
+
@apply --mx-fg(var(--m-color-palette-attention-heavy));
|
|
58
|
+
}
|
|
59
|
+
&[data-color='success'] {
|
|
60
|
+
@apply --mx-fg(var(--m-color-palette-success-heavy));
|
|
61
|
+
}
|
|
43
62
|
}
|
|
44
63
|
|
|
45
64
|
@layer components {
|
package/package.json
CHANGED
|
@@ -74,6 +74,21 @@
|
|
|
74
74
|
&[data-justify='evenly'] {
|
|
75
75
|
justify-content: space-evenly;
|
|
76
76
|
}
|
|
77
|
+
&[data-self='auto'] {
|
|
78
|
+
align-self: auto;
|
|
79
|
+
}
|
|
80
|
+
&[data-self='start'] {
|
|
81
|
+
align-self: flex-start;
|
|
82
|
+
}
|
|
83
|
+
&[data-self='center'] {
|
|
84
|
+
align-self: center;
|
|
85
|
+
}
|
|
86
|
+
&[data-self='end'] {
|
|
87
|
+
align-self: flex-end;
|
|
88
|
+
}
|
|
89
|
+
&[data-self='stretch'] {
|
|
90
|
+
align-self: stretch;
|
|
91
|
+
}
|
|
77
92
|
|
|
78
93
|
&[data-p='none'] {
|
|
79
94
|
padding: 0;
|
|
@@ -40,6 +40,7 @@ export interface BoxProps extends Omit<SlotDivProps, 'wrap'> {
|
|
|
40
40
|
ref?: Ref<HTMLDivElement>;
|
|
41
41
|
container?: boolean;
|
|
42
42
|
glass?: boolean;
|
|
43
|
+
self?: 'auto' | 'start' | 'end' | 'center' | 'stretch';
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export function Box({
|
|
@@ -64,6 +65,7 @@ export function Box({
|
|
|
64
65
|
elevated,
|
|
65
66
|
rounded = surface ? true : undefined,
|
|
66
67
|
glass,
|
|
68
|
+
self,
|
|
67
69
|
ref,
|
|
68
70
|
...rest
|
|
69
71
|
}: BoxProps) {
|
|
@@ -99,6 +101,7 @@ export function Box({
|
|
|
99
101
|
data-shadow-inset={inset}
|
|
100
102
|
data-container={container}
|
|
101
103
|
data-glass={glass}
|
|
104
|
+
data-self={self}
|
|
102
105
|
/>
|
|
103
106
|
);
|
|
104
107
|
|
|
@@ -31,6 +31,12 @@
|
|
|
31
31
|
&[data-thin] {
|
|
32
32
|
font-weight: var(--m-text-weight-thin);
|
|
33
33
|
}
|
|
34
|
+
&[data-normal] {
|
|
35
|
+
font-weight: var(--m-text-weight-normal);
|
|
36
|
+
}
|
|
37
|
+
&[data-uppercase] {
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
}
|
|
34
40
|
&[data-truncate] {
|
|
35
41
|
overflow: hidden;
|
|
36
42
|
text-overflow: ellipsis;
|
|
@@ -40,6 +46,19 @@
|
|
|
40
46
|
&[data-dim] {
|
|
41
47
|
@apply --mx-fg(var(--m-color-neutral-heavy));
|
|
42
48
|
}
|
|
49
|
+
|
|
50
|
+
&[data-color='neutral'] {
|
|
51
|
+
@apply --mx-fg(var(--m-color-neutral-ink));
|
|
52
|
+
}
|
|
53
|
+
&[data-color='main'] {
|
|
54
|
+
@apply --mx-fg(var(--m-color-main-heavy));
|
|
55
|
+
}
|
|
56
|
+
&[data-color='attention'] {
|
|
57
|
+
@apply --mx-fg(var(--m-color-palette-attention-heavy));
|
|
58
|
+
}
|
|
59
|
+
&[data-color='success'] {
|
|
60
|
+
@apply --mx-fg(var(--m-color-palette-success-heavy));
|
|
61
|
+
}
|
|
43
62
|
}
|
|
44
63
|
|
|
45
64
|
@layer components {
|
|
@@ -11,8 +11,11 @@ export interface TypographyProps extends useRender.ComponentProps<'span'> {
|
|
|
11
11
|
strikethrough?: boolean;
|
|
12
12
|
bold?: boolean;
|
|
13
13
|
thin?: boolean;
|
|
14
|
+
normal?: boolean;
|
|
15
|
+
uppercase?: boolean;
|
|
14
16
|
truncate?: boolean;
|
|
15
17
|
dim?: boolean;
|
|
18
|
+
color?: 'neutral' | 'main' | 'attention' | 'success';
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
export function Text({
|
|
@@ -26,6 +29,9 @@ export function Text({
|
|
|
26
29
|
thin,
|
|
27
30
|
truncate,
|
|
28
31
|
dim,
|
|
32
|
+
color,
|
|
33
|
+
normal,
|
|
34
|
+
uppercase,
|
|
29
35
|
...rest
|
|
30
36
|
}: TypographyProps) {
|
|
31
37
|
return useRender({
|
|
@@ -44,6 +50,9 @@ export function Text({
|
|
|
44
50
|
thin: thin ? true : undefined,
|
|
45
51
|
truncate: truncate ? true : undefined,
|
|
46
52
|
dim: dim ? true : undefined,
|
|
53
|
+
color: color ? color : undefined,
|
|
54
|
+
normal: normal ? true : undefined,
|
|
55
|
+
uppercase: uppercase ? true : undefined,
|
|
47
56
|
},
|
|
48
57
|
});
|
|
49
58
|
}
|