@jonmilner/ui 0.10.0 → 0.10.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/dist/Text/Text.css +1 -1
- package/dist/Text/Text.css.mjs +5 -1
- package/dist/Text/index.d.mts +1 -1
- package/dist/Text/index.mjs +2 -2
- package/dist/docs/Field.md +3 -3
- package/dist/docs/Heading.md +1 -1
- package/dist/docs/Tabs.md +1 -1
- package/dist/docs/Text.md +11 -1
- package/dist/docs/manifest.json +25 -13
- package/package.json +1 -1
package/dist/Text/Text.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
2
|
-
@layer components.text{._1mgdisq3{--_1mgdisq0:var(--line-height-med);--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body);font-size:var(--font-size-med);font-weight:var(--font-weight-regular);line-height:var(--_1mgdisq0)}._1mgdisq3:before{content:"";margin-block-end:var(--_1mgdisq1);display:table}._1mgdisq3:after{content:"";margin-block-start:var(--_1mgdisq2);display:table}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var){--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;display:inline}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):before,:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):after{content:none}._1mgdisq4{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq4:before,._1mgdisq4:after{content:none}._1mgdisq5{--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body)}._1mgdisq6{--_1mgdisq1:calc((var(--font-trim-heading-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-heading-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-heading)}._1mgdisq7{--_1mgdisq1:calc((var(--font-trim-display-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-display-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-display)}._1mgdisq8{--_1mgdisq1:calc((var(--font-trim-label-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-label-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-label)}._1mgdisq9{--_1mgdisq1:calc((var(--font-trim-mono-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-mono-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-mono)}._1mgdisqa{font-size:var(--font-size-xs)}._1mgdisqb{font-size:var(--font-size-sm)}._1mgdisqc{font-size:var(--font-size-med)}._1mgdisqd{font-size:var(--font-size-lg)}._1mgdisqe{font-size:var(--font-size-xl)}._1mgdisqf{font-size:var(--font-size-2xl)}._1mgdisqg{font-size:var(--font-size-3xl)}._1mgdisqh{font-size:var(--font-size-4xl)}._1mgdisqi{font-weight:var(--font-weight-regular)}._1mgdisqj{font-weight:var(--font-weight-medium)}._1mgdisqk{font-weight:var(--font-weight-semibold)}._1mgdisql{font-weight:var(--font-weight-bold)}._1mgdisqm{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqn{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqp{white-space:nowrap}._1mgdisqq{text-overflow:ellipsis;white-space:nowrap;margin-block-start:var(--_1mgdisq1);margin-block-end:var(--_1mgdisq2);padding-block-start:calc(-1 * var(--_1mgdisq1));padding-block-end:calc(-1 * var(--_1mgdisq2))}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) .
|
|
2
|
+
@layer components.text{._1mgdisq3{--_1mgdisq0:var(--line-height-med);--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body);font-size:var(--font-size-med);font-weight:var(--font-weight-regular);line-height:var(--_1mgdisq0)}._1mgdisq3:before{content:"";margin-block-end:var(--_1mgdisq1);display:table}._1mgdisq3:after{content:"";margin-block-start:var(--_1mgdisq2);display:table}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var){--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;display:inline}:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):before,:where(._1mgdisq3)>._1mgdisq3:where(a,abbr,b,bdi,bdo,cite,code,data,del,dfn,em,i,ins,kbd,label,mark,output,q,s,samp,small,span,strong,sub,sup,time,u,var):after{content:none}._1mgdisq4{--_1mgdisq0:inherit;--_1mgdisq1:inherit;--_1mgdisq2:inherit;text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}._1mgdisq4:before,._1mgdisq4:after{content:none}._1mgdisq5{--_1mgdisq1:calc((var(--font-trim-body-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-body-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-body)}._1mgdisq6{--_1mgdisq1:calc((var(--font-trim-heading-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-heading-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-heading)}._1mgdisq7{--_1mgdisq1:calc((var(--font-trim-display-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-display-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-display)}._1mgdisq8{--_1mgdisq1:calc((var(--font-trim-label-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-label-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-label)}._1mgdisq9{--_1mgdisq1:calc((var(--font-trim-mono-cap) - var(--_1mgdisq0) / 2) * 1em);--_1mgdisq2:calc((var(--font-trim-mono-baseline) - var(--_1mgdisq0) / 2) * 1em);font-family:var(--font-mono)}._1mgdisqa{font-size:var(--font-size-xs)}._1mgdisqb{font-size:var(--font-size-sm)}._1mgdisqc{font-size:var(--font-size-med)}._1mgdisqd{font-size:var(--font-size-lg)}._1mgdisqe{font-size:var(--font-size-xl)}._1mgdisqf{font-size:var(--font-size-2xl)}._1mgdisqg{font-size:var(--font-size-3xl)}._1mgdisqh{font-size:var(--font-size-4xl)}._1mgdisqi{font-weight:var(--font-weight-regular)}._1mgdisqj{font-weight:var(--font-weight-medium)}._1mgdisqk{font-weight:var(--font-weight-semibold)}._1mgdisql{font-weight:var(--font-weight-bold)}._1mgdisqm{--_1mgdisq0:var(--line-height-sm);line-height:var(--_1mgdisq0)}._1mgdisqn{--_1mgdisq0:var(--line-height-med);line-height:var(--_1mgdisq0)}._1mgdisqo{--_1mgdisq0:var(--line-height-lg);line-height:var(--_1mgdisq0)}._1mgdisqp{white-space:nowrap}._1mgdisqq{white-space:pre-wrap;overflow-wrap:anywhere}._1mgdisqr{white-space:pre}._1mgdisqs{text-overflow:ellipsis;white-space:nowrap;margin-block-start:var(--_1mgdisq1);margin-block-end:var(--_1mgdisq2);padding-block-start:calc(-1 * var(--_1mgdisq1));padding-block-end:calc(-1 * var(--_1mgdisq2))}:where([data-text-reveal]:hover,[data-text-reveal]:focus-within) ._1mgdisqs{white-space:normal;text-overflow:clip}}
|
package/dist/Text/Text.css.mjs
CHANGED
|
@@ -27,6 +27,10 @@ var e = "_1mgdisq3", t = "_1mgdisq4", n = {
|
|
|
27
27
|
sm: "_1mgdisqm",
|
|
28
28
|
med: "_1mgdisqn",
|
|
29
29
|
lg: "_1mgdisqo"
|
|
30
|
-
}, o = {
|
|
30
|
+
}, o = {
|
|
31
|
+
nowrap: "_1mgdisqp",
|
|
32
|
+
"pre-wrap": "_1mgdisqq",
|
|
33
|
+
pre: "_1mgdisqr"
|
|
34
|
+
}, s = "_1mgdisqs";
|
|
31
35
|
//#endregion
|
|
32
36
|
export { n as font, a as leading, e as root, r as size, s as truncate, t as truncateBox, i as weight, o as wrap };
|
package/dist/Text/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ export type TextOwnProps = {
|
|
|
10
10
|
size?: keyof typeof tokens.fontSize;
|
|
11
11
|
truncate?: boolean | "box";
|
|
12
12
|
weight?: keyof typeof tokens.fontWeight;
|
|
13
|
-
wrap?: "nowrap";
|
|
13
|
+
wrap?: "nowrap" | "pre-wrap" | "pre";
|
|
14
14
|
};
|
|
15
15
|
export type TextProps<T extends ElementType = "p"> = PolymorphicProps<T, StyleProps & TextOwnProps>;
|
|
16
16
|
export declare function Text<T extends ElementType = "p">({ as, size, font, weight, leading, truncate, wrap, display, overflow, className, ...props }: TextProps<T>): import("react").JSX.Element;
|
package/dist/Text/index.mjs
CHANGED
package/dist/docs/Field.md
CHANGED
|
@@ -113,7 +113,7 @@ Also accepts the style props (see `manifest.json` `styleProps`).
|
|
|
113
113
|
| `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
|
|
114
114
|
| `truncate` | `"box" \| boolean` | no | |
|
|
115
115
|
| `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
|
|
116
|
-
| `wrap` | `"nowrap"` | no | |
|
|
116
|
+
| `wrap` | `"nowrap" \| "pre" \| "pre-wrap"` | no | |
|
|
117
117
|
|
|
118
118
|
Also accepts the style props (see `manifest.json` `styleProps`).
|
|
119
119
|
|
|
@@ -127,7 +127,7 @@ Also accepts the style props (see `manifest.json` `styleProps`).
|
|
|
127
127
|
| `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
|
|
128
128
|
| `truncate` | `"box" \| boolean` | no | |
|
|
129
129
|
| `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
|
|
130
|
-
| `wrap` | `"nowrap"` | no | |
|
|
130
|
+
| `wrap` | `"nowrap" \| "pre" \| "pre-wrap"` | no | |
|
|
131
131
|
|
|
132
132
|
Also accepts the style props (see `manifest.json` `styleProps`).
|
|
133
133
|
|
|
@@ -141,6 +141,6 @@ Also accepts the style props (see `manifest.json` `styleProps`).
|
|
|
141
141
|
| `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
|
|
142
142
|
| `truncate` | `"box" \| boolean` | no | |
|
|
143
143
|
| `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
|
|
144
|
-
| `wrap` | `"nowrap"` | no | |
|
|
144
|
+
| `wrap` | `"nowrap" \| "pre" \| "pre-wrap"` | no | |
|
|
145
145
|
|
|
146
146
|
Also accepts the style props (see `manifest.json` `styleProps`).
|
package/dist/docs/Heading.md
CHANGED
|
@@ -65,6 +65,6 @@ Generated from the TypeScript types.
|
|
|
65
65
|
| `size` | `"2xl" \| "lg" \| "med" \| "sm" \| "xl"` | no | |
|
|
66
66
|
| `truncate` | `"box" \| boolean` | no | |
|
|
67
67
|
| `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
|
|
68
|
-
| `wrap` | `"nowrap"` | no | |
|
|
68
|
+
| `wrap` | `"nowrap" \| "pre" \| "pre-wrap"` | no | |
|
|
69
69
|
|
|
70
70
|
Also accepts every `<h2>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
|
package/dist/docs/Tabs.md
CHANGED
|
@@ -126,6 +126,6 @@ Also accepts the style props (see `manifest.json` `styleProps`).
|
|
|
126
126
|
| `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
|
|
127
127
|
| `value` | `any` | yes | The value of the Tab. |
|
|
128
128
|
| `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
|
|
129
|
-
| `wrap` | `"nowrap"` | no | |
|
|
129
|
+
| `wrap` | `"nowrap" \| "pre" \| "pre-wrap"` | no | |
|
|
130
130
|
|
|
131
131
|
Also accepts the style props (see `manifest.json` `styleProps`).
|
package/dist/docs/Text.md
CHANGED
|
@@ -29,6 +29,10 @@ The base of all visible text, and the primitive every text component builds on.
|
|
|
29
29
|
- `truncate` keeps one line and cuts it with an ellipsis, without clipping ascenders or descenders. It sets the block margins, so do not combine it with margin props.
|
|
30
30
|
- `truncate="box"` cuts a part of another Text's line (a field's summary inside a button's label) at its own box: untrimmed, in the outer Text's font until its own props say otherwise. Use it only inside another Text, below a Box or element that is not a Text run.
|
|
31
31
|
- `wrap="nowrap"` keeps the text on one line, uncut: a short label that must never break. A long string overflows its box, so cap it with `truncate` instead.
|
|
32
|
+
- `wrap="pre-wrap"` keeps newlines and runs of spaces and wraps, breaking a long unbroken string (a path, a URL, a hash) anywhere so it stays in its box: logs, commit messages, user-entered text.
|
|
33
|
+
- `wrap="pre"` keeps newlines and runs of spaces on unwrapped lines, so a long line overflows its box: aligned output whose columns must not reflow. Text is not a scroll container; where the box cannot grow, use `pre-wrap`.
|
|
34
|
+
- `truncate` wins over `wrap`: a Text with both keeps one line, collapses whitespace and ignores `wrap`.
|
|
35
|
+
- Plain wrapped text with a long unbroken string and no whitespace to keep has no `wrap` value; its component sets `overflow-wrap` in its own styles.
|
|
32
36
|
- The trim is two pseudo-elements; do not style `::before` or `::after` on a Text.
|
|
33
37
|
- No native `text-box`; capsize only (ADR 0016).
|
|
34
38
|
|
|
@@ -55,6 +59,12 @@ The base of all visible text, and the primitive every text component builds on.
|
|
|
55
59
|
</Text>
|
|
56
60
|
```
|
|
57
61
|
|
|
62
|
+
```tsx
|
|
63
|
+
<Text as="pre" font="mono" size="sm" wrap="pre-wrap">
|
|
64
|
+
{commitMessage}
|
|
65
|
+
</Text>
|
|
66
|
+
```
|
|
67
|
+
|
|
58
68
|
## Don't
|
|
59
69
|
|
|
60
70
|
```tsx
|
|
@@ -94,6 +104,6 @@ Generated from the TypeScript types.
|
|
|
94
104
|
| `size` | `"2xl" \| "3xl" \| "4xl" \| "lg" \| "med" \| "sm" \| "xl" \| "xs"` | no | |
|
|
95
105
|
| `truncate` | `"box" \| boolean` | no | |
|
|
96
106
|
| `weight` | `"bold" \| "medium" \| "regular" \| "semibold"` | no | |
|
|
97
|
-
| `wrap` | `"nowrap"` | no | |
|
|
107
|
+
| `wrap` | `"nowrap" \| "pre" \| "pre-wrap"` | no | |
|
|
98
108
|
|
|
99
109
|
Also accepts every `<p>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
|
package/dist/docs/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./manifest.schema.json",
|
|
3
3
|
"package": "@jonmilner/ui",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.1",
|
|
5
5
|
"components": [
|
|
6
6
|
{
|
|
7
7
|
"name": "AlertDialog",
|
|
@@ -824,10 +824,12 @@
|
|
|
824
824
|
},
|
|
825
825
|
{
|
|
826
826
|
"name": "wrap",
|
|
827
|
-
"type": "\"nowrap\"",
|
|
827
|
+
"type": "\"nowrap\" | \"pre\" | \"pre-wrap\"",
|
|
828
828
|
"required": false,
|
|
829
829
|
"values": [
|
|
830
|
-
"nowrap"
|
|
830
|
+
"nowrap",
|
|
831
|
+
"pre",
|
|
832
|
+
"pre-wrap"
|
|
831
833
|
]
|
|
832
834
|
}
|
|
833
835
|
]
|
|
@@ -897,10 +899,12 @@
|
|
|
897
899
|
},
|
|
898
900
|
{
|
|
899
901
|
"name": "wrap",
|
|
900
|
-
"type": "\"nowrap\"",
|
|
902
|
+
"type": "\"nowrap\" | \"pre\" | \"pre-wrap\"",
|
|
901
903
|
"required": false,
|
|
902
904
|
"values": [
|
|
903
|
-
"nowrap"
|
|
905
|
+
"nowrap",
|
|
906
|
+
"pre",
|
|
907
|
+
"pre-wrap"
|
|
904
908
|
]
|
|
905
909
|
}
|
|
906
910
|
]
|
|
@@ -970,10 +974,12 @@
|
|
|
970
974
|
},
|
|
971
975
|
{
|
|
972
976
|
"name": "wrap",
|
|
973
|
-
"type": "\"nowrap\"",
|
|
977
|
+
"type": "\"nowrap\" | \"pre\" | \"pre-wrap\"",
|
|
974
978
|
"required": false,
|
|
975
979
|
"values": [
|
|
976
|
-
"nowrap"
|
|
980
|
+
"nowrap",
|
|
981
|
+
"pre",
|
|
982
|
+
"pre-wrap"
|
|
977
983
|
]
|
|
978
984
|
}
|
|
979
985
|
]
|
|
@@ -1050,10 +1056,12 @@
|
|
|
1050
1056
|
},
|
|
1051
1057
|
{
|
|
1052
1058
|
"name": "wrap",
|
|
1053
|
-
"type": "\"nowrap\"",
|
|
1059
|
+
"type": "\"nowrap\" | \"pre\" | \"pre-wrap\"",
|
|
1054
1060
|
"required": false,
|
|
1055
1061
|
"values": [
|
|
1056
|
-
"nowrap"
|
|
1062
|
+
"nowrap",
|
|
1063
|
+
"pre",
|
|
1064
|
+
"pre-wrap"
|
|
1057
1065
|
]
|
|
1058
1066
|
}
|
|
1059
1067
|
],
|
|
@@ -1944,10 +1952,12 @@
|
|
|
1944
1952
|
},
|
|
1945
1953
|
{
|
|
1946
1954
|
"name": "wrap",
|
|
1947
|
-
"type": "\"nowrap\"",
|
|
1955
|
+
"type": "\"nowrap\" | \"pre\" | \"pre-wrap\"",
|
|
1948
1956
|
"required": false,
|
|
1949
1957
|
"values": [
|
|
1950
|
-
"nowrap"
|
|
1958
|
+
"nowrap",
|
|
1959
|
+
"pre",
|
|
1960
|
+
"pre-wrap"
|
|
1951
1961
|
]
|
|
1952
1962
|
}
|
|
1953
1963
|
]
|
|
@@ -2064,10 +2074,12 @@
|
|
|
2064
2074
|
},
|
|
2065
2075
|
{
|
|
2066
2076
|
"name": "wrap",
|
|
2067
|
-
"type": "\"nowrap\"",
|
|
2077
|
+
"type": "\"nowrap\" | \"pre\" | \"pre-wrap\"",
|
|
2068
2078
|
"required": false,
|
|
2069
2079
|
"values": [
|
|
2070
|
-
"nowrap"
|
|
2080
|
+
"nowrap",
|
|
2081
|
+
"pre",
|
|
2082
|
+
"pre-wrap"
|
|
2071
2083
|
]
|
|
2072
2084
|
}
|
|
2073
2085
|
],
|