@manakind/ui-core 0.22.0 → 0.24.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 +10 -2
- package/dist/button/button.css +16 -0
- package/dist/button/button.d.ts +10 -0
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +8 -6
- package/dist/button/button.js.map +1 -1
- package/dist/card/card.css +5 -0
- package/dist/card/card.d.ts +11 -2
- package/dist/card/card.d.ts.map +1 -1
- package/dist/card/card.js +2 -2
- package/dist/card/card.js.map +1 -1
- package/dist/card/index.d.ts +1 -1
- package/dist/card/index.d.ts.map +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/combobox/combobox.css +5 -5
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/combobox.js +2 -21
- package/dist/combobox/combobox.js.map +1 -1
- package/dist/dialog/dialog.css +5 -0
- package/dist/dialog/dialog.d.ts +8 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/dialog/dialog.js +2 -2
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/dialog/index.d.ts +1 -1
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/group-items.d.ts +15 -0
- package/dist/group-items.d.ts.map +1 -0
- package/dist/group-items.js +25 -0
- package/dist/group-items.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/layout.css +134 -0
- package/dist/layout/layout.d.ts +66 -4
- package/dist/layout/layout.d.ts.map +1 -1
- package/dist/layout/layout.js +58 -10
- package/dist/layout/layout.js.map +1 -1
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/link.css +40 -0
- package/dist/link/link.css.d.ts +2 -0
- package/dist/link/link.d.ts +27 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +17 -0
- package/dist/link/link.js.map +1 -0
- package/dist/scroll-area/index.d.ts +3 -0
- package/dist/scroll-area/index.d.ts.map +1 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/scroll-area/index.js.map +1 -0
- package/dist/scroll-area/scroll-area.css +26 -0
- package/dist/scroll-area/scroll-area.css.d.ts +2 -0
- package/dist/scroll-area/scroll-area.d.ts +26 -0
- package/dist/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area/scroll-area.js +16 -0
- package/dist/scroll-area/scroll-area.js.map +1 -0
- package/dist/section/section.d.ts +8 -2
- package/dist/section/section.d.ts.map +1 -1
- package/dist/section/section.js +2 -2
- package/dist/section/section.js.map +1 -1
- package/dist/segment-group/segment-group.css +5 -0
- package/dist/segment-group/segment-group.d.ts +6 -1
- package/dist/segment-group/segment-group.d.ts.map +1 -1
- package/dist/segment-group/segment-group.js +2 -2
- package/dist/segment-group/segment-group.js.map +1 -1
- package/dist/select/select.css +49 -0
- package/dist/select/select.d.ts +26 -4
- package/dist/select/select.d.ts.map +1 -1
- package/dist/select/select.js +22 -5
- package/dist/select/select.js.map +1 -1
- package/dist/spinner/index.d.ts +3 -0
- package/dist/spinner/index.d.ts.map +1 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/spinner.css +36 -0
- package/dist/spinner/spinner.css.d.ts +2 -0
- package/dist/spinner/spinner.d.ts +25 -0
- package/dist/spinner/spinner.d.ts.map +1 -0
- package/dist/spinner/spinner.js +17 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/sticky/index.d.ts +3 -0
- package/dist/sticky/index.d.ts.map +1 -0
- package/dist/sticky/index.js +2 -0
- package/dist/sticky/index.js.map +1 -0
- package/dist/sticky/sticky.css +92 -0
- package/dist/sticky/sticky.css.d.ts +2 -0
- package/dist/sticky/sticky.d.ts +47 -0
- package/dist/sticky/sticky.d.ts.map +1 -0
- package/dist/sticky/sticky.js +20 -0
- package/dist/sticky/sticky.js.map +1 -0
- package/dist/text/text.css +20 -0
- package/dist/text/text.d.ts +13 -5
- package/dist/text/text.d.ts.map +1 -1
- package/dist/text/text.js +25 -6
- package/dist/text/text.js.map +1 -1
- package/package.json +34 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import './sticky.css';
|
|
4
|
+
import type { Breakpoint } from '../layout/layout';
|
|
5
|
+
/** The viewport edge a sticky element holds to while the page scrolls past it. */
|
|
6
|
+
export type StickyEdge = 'top' | 'bottom';
|
|
7
|
+
/**
|
|
8
|
+
* What a sticky element paints behind itself. `none` leaves the children
|
|
9
|
+
* to draw their own surface (a card); `canvas` paints the page's canvas so
|
|
10
|
+
* content scrolling under it is covered, with the bar's block inset;
|
|
11
|
+
* `raised` is the chrome's surface with a hairline and shadow on the side
|
|
12
|
+
* facing the page.
|
|
13
|
+
*/
|
|
14
|
+
export type StickySurface = 'none' | 'canvas' | 'raised';
|
|
15
|
+
export interface StickyProps extends ComponentProps<typeof ark.div> {
|
|
16
|
+
/** The edge it holds to. Defaults to `top`. */
|
|
17
|
+
edge?: StickyEdge;
|
|
18
|
+
/**
|
|
19
|
+
* Keep clear of the app's chrome: under the header at the top
|
|
20
|
+
* (`--ds-sticky-offset-top`), above the viewport's edge at the bottom
|
|
21
|
+
* (`--ds-sticky-offset-bottom`). Off by default, for the header itself.
|
|
22
|
+
*/
|
|
23
|
+
offset?: boolean;
|
|
24
|
+
/** Stick only from this viewport step up; stay in the flow on narrower viewports. */
|
|
25
|
+
from?: Breakpoint;
|
|
26
|
+
/**
|
|
27
|
+
* Scroll inside its own box when taller than the room it holds, instead
|
|
28
|
+
* of pushing past the viewport: a pinned aside longer than the screen.
|
|
29
|
+
*/
|
|
30
|
+
scroll?: boolean;
|
|
31
|
+
/** What it paints behind itself. Defaults to `none`. */
|
|
32
|
+
surface?: StickySurface;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* An element that holds to an edge of the viewport while the page scrolls
|
|
36
|
+
* past it: the app's header, a filter row under it, a bar of bulk actions
|
|
37
|
+
* at the foot of a list, an aside pinned beside a long form.
|
|
38
|
+
*
|
|
39
|
+
* Sticky, never fixed, so it stays in the page's flow and column: a bottom
|
|
40
|
+
* bar at the end of a page floats above the rows while they scroll and
|
|
41
|
+
* settles into its own place when the page ends, with nothing to clear.
|
|
42
|
+
* Sits on the `sticky` stacking layer, above the page's raised controls
|
|
43
|
+
* and below every overlay. Renders a `div`; pass `asChild` to stick your
|
|
44
|
+
* own element (`<Sticky asChild><header>…</header></Sticky>`).
|
|
45
|
+
*/
|
|
46
|
+
export declare function Sticky({ edge, offset, from, scroll, surface, className, children, ...props }: StickyProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
//# sourceMappingURL=sticky.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../src/sticky/sticky.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,kFAAkF;AAClF,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;IACjE,+CAA+C;IAC/C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qFAAqF;IACrF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wDAAwD;IACxD,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,EACrB,IAAY,EACZ,MAAc,EACd,IAAI,EACJ,MAAc,EACd,OAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,2CAiBb"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import './sticky.css';
|
|
4
|
+
import { cx } from '../cx';
|
|
5
|
+
/**
|
|
6
|
+
* An element that holds to an edge of the viewport while the page scrolls
|
|
7
|
+
* past it: the app's header, a filter row under it, a bar of bulk actions
|
|
8
|
+
* at the foot of a list, an aside pinned beside a long form.
|
|
9
|
+
*
|
|
10
|
+
* Sticky, never fixed, so it stays in the page's flow and column: a bottom
|
|
11
|
+
* bar at the end of a page floats above the rows while they scroll and
|
|
12
|
+
* settles into its own place when the page ends, with nothing to clear.
|
|
13
|
+
* Sits on the `sticky` stacking layer, above the page's raised controls
|
|
14
|
+
* and below every overlay. Renders a `div`; pass `asChild` to stick your
|
|
15
|
+
* own element (`<Sticky asChild><header>…</header></Sticky>`).
|
|
16
|
+
*/
|
|
17
|
+
export function Sticky({ edge = 'top', offset = false, from, scroll = false, surface = 'none', className, children, ...props }) {
|
|
18
|
+
return (_jsx(ark.div, { className: cx('ds-sticky', `ds-sticky--${edge}`, offset && 'ds-sticky--offset', from && `ds-sticky--from-${from}`, scroll && 'ds-sticky--scroll', surface !== 'none' && `ds-sticky--surface-${surface}`, className), ...props, children: children }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=sticky.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky.js","sourceRoot":"","sources":["../../src/sticky/sticky.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmC3B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,GAAG,KAAK,EACZ,MAAM,GAAG,KAAK,EACd,IAAI,EACJ,MAAM,GAAG,KAAK,EACd,OAAO,GAAG,MAAM,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACI;IACZ,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,WAAW,EACX,cAAc,IAAI,EAAE,EACpB,MAAM,IAAI,mBAAmB,EAC7B,IAAI,IAAI,mBAAmB,IAAI,EAAE,EACjC,MAAM,IAAI,mBAAmB,EAC7B,OAAO,KAAK,MAAM,IAAI,sBAAsB,OAAO,EAAE,EACrD,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
package/dist/text/text.css
CHANGED
|
@@ -95,6 +95,10 @@
|
|
|
95
95
|
color: var(--ds-text-tone-info);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
&.ds-text--tone-accent {
|
|
99
|
+
color: var(--ds-text-tone-accent);
|
|
100
|
+
}
|
|
101
|
+
|
|
98
102
|
&.ds-text--align-start {
|
|
99
103
|
text-align: start;
|
|
100
104
|
}
|
|
@@ -112,6 +116,22 @@
|
|
|
112
116
|
letter-spacing: var(--ds-text-caps-letter-spacing);
|
|
113
117
|
}
|
|
114
118
|
|
|
119
|
+
&.ds-text--mono {
|
|
120
|
+
font-family: var(--ds-text-mono-font-family);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&.ds-text--tabular {
|
|
124
|
+
font-variant-numeric: tabular-nums;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.ds-text--preserve-breaks {
|
|
128
|
+
white-space: pre-wrap;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&.ds-text--strikethrough {
|
|
132
|
+
text-decoration: line-through;
|
|
133
|
+
}
|
|
134
|
+
|
|
115
135
|
/*
|
|
116
136
|
* Clipped by its own box, not kept from wrapping: `white-space: nowrap`
|
|
117
137
|
* would let a long word push past the edge, which is the one thing the
|
package/dist/text/text.d.ts
CHANGED
|
@@ -7,9 +7,10 @@ export type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
|
7
7
|
/**
|
|
8
8
|
* What the text is for, which decides its colour. `default` and `muted` are
|
|
9
9
|
* the two text roles; the four statuses are for a line of text that reports
|
|
10
|
-
* one, such as a validation message or a result
|
|
10
|
+
* one, such as a validation message or a result; `accent` is the strong
|
|
11
|
+
* primary colour, for a short label the brand lends its colour to.
|
|
11
12
|
*/
|
|
12
|
-
export type TextTone = 'default' | 'muted' | 'success' | 'warning' | 'danger' | 'info';
|
|
13
|
+
export type TextTone = 'default' | 'muted' | 'success' | 'warning' | 'danger' | 'info' | 'accent';
|
|
13
14
|
export type TextAlign = 'start' | 'center' | 'end';
|
|
14
15
|
/**
|
|
15
16
|
* The elements `Text` renders: the ones whose attributes are a paragraph's.
|
|
@@ -18,8 +19,9 @@ export type TextAlign = 'start' | 'center' | 'end';
|
|
|
18
19
|
* a component reference would be stringified and thrown. An element with
|
|
19
20
|
* attributes of its own (`label` with `htmlFor`, `time` with `dateTime`, an
|
|
20
21
|
* `output`) goes through `asChild`, which keeps that element's own props.
|
|
22
|
+
* `code` and `kbd` take the monospace face.
|
|
21
23
|
*/
|
|
22
|
-
export type TextTag = 'p' | 'span' | 'div' | 'strong' | 'em' | 'small' | 'li' | 'dt' | 'dd' | 'figcaption';
|
|
24
|
+
export type TextTag = 'p' | 'span' | 'div' | 'strong' | 'em' | 'small' | 'li' | 'dt' | 'dd' | 'figcaption' | 'code' | 'kbd';
|
|
23
25
|
export interface TextStyleProps {
|
|
24
26
|
/** Step of the type scale. Defaults to `md`, body text. */
|
|
25
27
|
size?: TextSize;
|
|
@@ -35,6 +37,12 @@ export interface TextStyleProps {
|
|
|
35
37
|
* so a long word still breaks instead of pushing past the edge.
|
|
36
38
|
*/
|
|
37
39
|
truncate?: boolean | number;
|
|
40
|
+
/** Digits of equal width, so figures in a column or a count that ticks line up. */
|
|
41
|
+
tabular?: boolean;
|
|
42
|
+
/** Keep the line breaks the text was written with: a description, a reflection, a note. */
|
|
43
|
+
preserveBreaks?: boolean;
|
|
44
|
+
/** A line through the text: a milestone reached, a move no longer on the list. */
|
|
45
|
+
strikethrough?: boolean;
|
|
38
46
|
}
|
|
39
47
|
export interface TextProps extends ComponentProps<typeof ark.p>, TextStyleProps {
|
|
40
48
|
/** Element to render. Defaults to `p`. */
|
|
@@ -55,7 +63,7 @@ export interface TextProps extends ComponentProps<typeof ark.p>, TextStyleProps
|
|
|
55
63
|
* tokens rather than per element. Renders a `p`; pick another tag with `as`,
|
|
56
64
|
* or pass `asChild` to style an element of your own.
|
|
57
65
|
*/
|
|
58
|
-
export declare function Text({ as, size, weight, tone, align, truncate, caps, className, style, children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export declare function Text({ as, size, weight, tone, align, truncate, tabular, preserveBreaks, strikethrough, caps, className, style, children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
59
67
|
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
60
68
|
export interface HeadingProps extends ComponentProps<typeof ark.h2>, TextStyleProps {
|
|
61
69
|
/**
|
|
@@ -74,5 +82,5 @@ export interface HeadingProps extends ComponentProps<typeof ark.h2>, TextStylePr
|
|
|
74
82
|
* contract. Pass `asChild` to style a heading element of your own, say one
|
|
75
83
|
* a library renders.
|
|
76
84
|
*/
|
|
77
|
-
export declare function Heading({ level, size, weight, tone, align, truncate, className, style, children, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
export declare function Heading({ level, size, weight, tone, align, truncate, tabular, preserveBreaks, strikethrough, className, style, children, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
78
86
|
//# sourceMappingURL=text.d.ts.map
|
package/dist/text/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,YAAY,CAAC;AAGpB,sDAAsD;AACtD,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEhF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,YAAY,CAAC;AAGpB,sDAAsD;AACtD,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEhF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,G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AG,CAAC,GAAG,CAAC,CAAC;AAYjD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC,EAAE,cAAc;IACjF;;;;OAIG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,IAAgB,EAChB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,YAAY,2CAwBd"}
|
package/dist/text/text.js
CHANGED
|
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ark } from '@ark-ui/react/factory';
|
|
3
3
|
import './text.css';
|
|
4
4
|
import { cx } from '../cx';
|
|
5
|
-
function textClasses(block, { size, weight, tone, align, truncate }, className) {
|
|
6
|
-
return cx('ds-text', block, size && `ds-text--size-${size}`, weight && `ds-text--weight-${weight}`, tone && tone !== 'default' && `ds-text--tone-${tone}`, align && `ds-text--align-${align}`, truncate ? 'ds-text--truncate' : false, className);
|
|
5
|
+
function textClasses(block, { size, weight, tone, align, truncate, tabular, preserveBreaks, strikethrough }, className) {
|
|
6
|
+
return cx('ds-text', block, size && `ds-text--size-${size}`, weight && `ds-text--weight-${weight}`, tone && tone !== 'default' && `ds-text--tone-${tone}`, align && `ds-text--align-${align}`, truncate ? 'ds-text--truncate' : false, tabular && 'ds-text--tabular', preserveBreaks && 'ds-text--preserve-breaks', strikethrough && 'ds-text--strikethrough', className);
|
|
7
7
|
}
|
|
8
|
+
const MONO_TAGS = new Set(['code', 'kbd']);
|
|
8
9
|
/**
|
|
9
10
|
* The line count as the private property `text.css` clamps to. Always written
|
|
10
11
|
* when truncating, `1` for `true`: custom properties inherit, so a truncated
|
|
@@ -24,12 +25,21 @@ function truncateStyle(truncate, style) {
|
|
|
24
25
|
* tokens rather than per element. Renders a `p`; pick another tag with `as`,
|
|
25
26
|
* or pass `asChild` to style an element of your own.
|
|
26
27
|
*/
|
|
27
|
-
export function Text({ as, size = 'md', weight, tone = 'default', align, truncate, caps = false, className, style, children, ...props }) {
|
|
28
|
+
export function Text({ as, size = 'md', weight, tone = 'default', align, truncate, tabular, preserveBreaks, strikethrough, caps = false, className, style, children, ...props }) {
|
|
28
29
|
// Every factory member has the same props apart from its element's ref
|
|
29
30
|
// type; the cast settles the union on `p`, the default, which is why `as`
|
|
30
31
|
// is a closed list of plain text elements rather than any tag.
|
|
31
32
|
const Component = (as ? ark[as] : ark.p);
|
|
32
|
-
return (_jsx(Component, { className: textClasses(cx('ds-text--body', caps && 'ds-text--caps'
|
|
33
|
+
return (_jsx(Component, { className: textClasses(cx('ds-text--body', caps && 'ds-text--caps', as && MONO_TAGS.has(as) && 'ds-text--mono'), {
|
|
34
|
+
size,
|
|
35
|
+
weight: weight ?? (caps ? 'semibold' : undefined),
|
|
36
|
+
tone,
|
|
37
|
+
align,
|
|
38
|
+
truncate,
|
|
39
|
+
tabular,
|
|
40
|
+
preserveBreaks,
|
|
41
|
+
strikethrough,
|
|
42
|
+
}, className), style: truncateStyle(truncate, style), ...props, children: children }));
|
|
33
43
|
}
|
|
34
44
|
/** The size each level takes when `size` is not given: a plain ramp down the scale. */
|
|
35
45
|
const HEADING_SIZES = {
|
|
@@ -49,8 +59,17 @@ const HEADING_SIZES = {
|
|
|
49
59
|
* contract. Pass `asChild` to style a heading element of your own, say one
|
|
50
60
|
* a library renders.
|
|
51
61
|
*/
|
|
52
|
-
export function Heading({ level, size, weight, tone = 'default', align, truncate, className, style, children, ...props }) {
|
|
62
|
+
export function Heading({ level, size, weight, tone = 'default', align, truncate, tabular, preserveBreaks, strikethrough, className, style, children, ...props }) {
|
|
53
63
|
const Component = ark[`h${level}`];
|
|
54
|
-
return (_jsx(Component, { className: textClasses('ds-text--heading', {
|
|
64
|
+
return (_jsx(Component, { className: textClasses('ds-text--heading', {
|
|
65
|
+
size: size ?? HEADING_SIZES[level],
|
|
66
|
+
weight,
|
|
67
|
+
tone,
|
|
68
|
+
align,
|
|
69
|
+
truncate,
|
|
70
|
+
tabular,
|
|
71
|
+
preserveBreaks,
|
|
72
|
+
strikethrough,
|
|
73
|
+
}, className), style: truncateStyle(truncate, style), ...props, children: children }));
|
|
55
74
|
}
|
|
56
75
|
//# sourceMappingURL=text.js.map
|
package/dist/text/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA+D3B,SAAS,WAAW,CAClB,KAAa,EACb,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAkB,EAC/F,SAAkB;IAElB,OAAO,EAAE,CACP,SAAS,EACT,KAAK,EACL,IAAI,IAAI,iBAAiB,IAAI,EAAE,EAC/B,MAAM,IAAI,mBAAmB,MAAM,EAAE,EACrC,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,iBAAiB,IAAI,EAAE,EACrD,KAAK,IAAI,kBAAkB,KAAK,EAAE,EAClC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,KAAK,EACtC,OAAO,IAAI,kBAAkB,EAC7B,cAAc,IAAI,0BAA0B,EAC5C,aAAa,IAAI,wBAAwB,EACzC,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,YAER,QAAQ,GACC,CACb,CAAC;AACJ,CAAC;AAID,uFAAuF;AACvF,MAAM,aAAa,GAAmC;IACpD,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;CACR,CAAC;AAWF;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACK;IACb,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACnC,OAAO,CACL,KAAC,SAAS,IACR,SAAS,EAAE,WAAW,CACpB,kBAAkB,EAClB;YACE,IAAI,EAAE,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC;YAClC,MAAM;YACN,IAAI;YACJ,KAAK;YACL,QAAQ;YACR,OAAO;YACP,cAAc;YACd,aAAa;SACd,EACD,SAAS,CACV,EACD,KAAK,EAAE,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,KACjC,KAAK,YAER,QAAQ,GACC,CACb,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manakind/ui-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -100,6 +100,10 @@
|
|
|
100
100
|
"types": "./dist/layout/index.d.ts",
|
|
101
101
|
"import": "./dist/layout/index.js"
|
|
102
102
|
},
|
|
103
|
+
"./link": {
|
|
104
|
+
"types": "./dist/link/index.d.ts",
|
|
105
|
+
"import": "./dist/link/index.js"
|
|
106
|
+
},
|
|
103
107
|
"./menu": {
|
|
104
108
|
"types": "./dist/menu/index.d.ts",
|
|
105
109
|
"import": "./dist/menu/index.js"
|
|
@@ -120,6 +124,10 @@
|
|
|
120
124
|
"types": "./dist/reorder-control/index.d.ts",
|
|
121
125
|
"import": "./dist/reorder-control/index.js"
|
|
122
126
|
},
|
|
127
|
+
"./scroll-area": {
|
|
128
|
+
"types": "./dist/scroll-area/index.d.ts",
|
|
129
|
+
"import": "./dist/scroll-area/index.js"
|
|
130
|
+
},
|
|
123
131
|
"./section": {
|
|
124
132
|
"types": "./dist/section/index.d.ts",
|
|
125
133
|
"import": "./dist/section/index.js"
|
|
@@ -140,10 +148,18 @@
|
|
|
140
148
|
"types": "./dist/skeleton/index.d.ts",
|
|
141
149
|
"import": "./dist/skeleton/index.js"
|
|
142
150
|
},
|
|
151
|
+
"./spinner": {
|
|
152
|
+
"types": "./dist/spinner/index.d.ts",
|
|
153
|
+
"import": "./dist/spinner/index.js"
|
|
154
|
+
},
|
|
143
155
|
"./split-layout": {
|
|
144
156
|
"types": "./dist/split-layout/index.d.ts",
|
|
145
157
|
"import": "./dist/split-layout/index.js"
|
|
146
158
|
},
|
|
159
|
+
"./sticky": {
|
|
160
|
+
"types": "./dist/sticky/index.d.ts",
|
|
161
|
+
"import": "./dist/sticky/index.js"
|
|
162
|
+
},
|
|
147
163
|
"./switch": {
|
|
148
164
|
"types": "./dist/switch/index.d.ts",
|
|
149
165
|
"import": "./dist/switch/index.js"
|
|
@@ -240,6 +256,10 @@
|
|
|
240
256
|
"types": "./dist/layout/layout.css.d.ts",
|
|
241
257
|
"default": "./dist/layout/layout.css"
|
|
242
258
|
},
|
|
259
|
+
"./css/link": {
|
|
260
|
+
"types": "./dist/link/link.css.d.ts",
|
|
261
|
+
"default": "./dist/link/link.css"
|
|
262
|
+
},
|
|
243
263
|
"./css/menu": {
|
|
244
264
|
"types": "./dist/menu/menu.css.d.ts",
|
|
245
265
|
"default": "./dist/menu/menu.css"
|
|
@@ -260,6 +280,10 @@
|
|
|
260
280
|
"types": "./dist/reorder-control/reorder-control.css.d.ts",
|
|
261
281
|
"default": "./dist/reorder-control/reorder-control.css"
|
|
262
282
|
},
|
|
283
|
+
"./css/scroll-area": {
|
|
284
|
+
"types": "./dist/scroll-area/scroll-area.css.d.ts",
|
|
285
|
+
"default": "./dist/scroll-area/scroll-area.css"
|
|
286
|
+
},
|
|
263
287
|
"./css/section": {
|
|
264
288
|
"types": "./dist/section/section.css.d.ts",
|
|
265
289
|
"default": "./dist/section/section.css"
|
|
@@ -280,10 +304,18 @@
|
|
|
280
304
|
"types": "./dist/skeleton/skeleton.css.d.ts",
|
|
281
305
|
"default": "./dist/skeleton/skeleton.css"
|
|
282
306
|
},
|
|
307
|
+
"./css/spinner": {
|
|
308
|
+
"types": "./dist/spinner/spinner.css.d.ts",
|
|
309
|
+
"default": "./dist/spinner/spinner.css"
|
|
310
|
+
},
|
|
283
311
|
"./css/split-layout": {
|
|
284
312
|
"types": "./dist/split-layout/split-layout.css.d.ts",
|
|
285
313
|
"default": "./dist/split-layout/split-layout.css"
|
|
286
314
|
},
|
|
315
|
+
"./css/sticky": {
|
|
316
|
+
"types": "./dist/sticky/sticky.css.d.ts",
|
|
317
|
+
"default": "./dist/sticky/sticky.css"
|
|
318
|
+
},
|
|
287
319
|
"./css/switch": {
|
|
288
320
|
"types": "./dist/switch/switch.css.d.ts",
|
|
289
321
|
"default": "./dist/switch/switch.css"
|
|
@@ -324,7 +356,7 @@
|
|
|
324
356
|
},
|
|
325
357
|
"devDependencies": {
|
|
326
358
|
"@manakind/ds-config": "*",
|
|
327
|
-
"@manakind/manuia-tokens": "0.
|
|
359
|
+
"@manakind/manuia-tokens": "0.23.0",
|
|
328
360
|
"@testing-library/jest-dom": "^6.9.1",
|
|
329
361
|
"@testing-library/react": "^16.3.2",
|
|
330
362
|
"@testing-library/user-event": "^14.6.1",
|