@nous-research/ui 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/ui/build.css +3 -0
- package/dist/ui/components/fit-text/fit-text.css +42 -0
- package/dist/ui/components/grid/grid.css +78 -0
- package/dist/ui/components/modal/modal.css +36 -0
- package/dist/ui/fonts.css +63 -0
- package/dist/ui/globals.css +174 -1597
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -6,9 +6,10 @@ the shared design system for react ui @ nous. components, hooks, utils, fonts, o
|
|
|
6
6
|
|
|
7
7
|
`npm i @nous-research/ui` or `pnpm i @nous-research/ui`
|
|
8
8
|
|
|
9
|
-
import the
|
|
9
|
+
import the global styles in your app's root css file:
|
|
10
10
|
|
|
11
11
|
```css
|
|
12
|
+
@import 'tailwindcss';
|
|
12
13
|
@import '@nous-research/ui/styles/globals.css';
|
|
13
14
|
```
|
|
14
15
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.fit-text {
|
|
2
|
+
--fit-captured-length: initial;
|
|
3
|
+
--fit-support-sentinel: var(--fit-captured-length, 9999px);
|
|
4
|
+
|
|
5
|
+
display: flex;
|
|
6
|
+
container-type: inline-size;
|
|
7
|
+
|
|
8
|
+
> [aria-hidden] {
|
|
9
|
+
visibility: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
> :not([aria-hidden]) {
|
|
13
|
+
flex-grow: 1;
|
|
14
|
+
container-type: inline-size;
|
|
15
|
+
|
|
16
|
+
--fit-captured-length: 100cqi;
|
|
17
|
+
--fit-available-space: var(--fit-captured-length);
|
|
18
|
+
|
|
19
|
+
> * {
|
|
20
|
+
--fit-support-sentinel: inherit;
|
|
21
|
+
--fit-captured-length: 100cqi;
|
|
22
|
+
--fit-ratio: tan(
|
|
23
|
+
atan2(
|
|
24
|
+
var(--fit-available-space),
|
|
25
|
+
var(--fit-available-space) - var(--fit-captured-length)
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
display: block;
|
|
30
|
+
inline-size: var(--fit-available-space);
|
|
31
|
+
font-size: clamp(
|
|
32
|
+
var(--fit-min, 1em),
|
|
33
|
+
1em * var(--fit-ratio),
|
|
34
|
+
var(--fit-max, infinity * 1px) - var(--fit-support-sentinel)
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
@container (inline-size > 0) {
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
.g {
|
|
2
|
+
@apply grid grid-cols-1 border-l border-current/20;
|
|
3
|
+
|
|
4
|
+
&:has(> .gc:nth-child(3)):not(:has(> .gc:nth-child(4))) > .gc:nth-child(2) {
|
|
5
|
+
@apply -order-1;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@media (width >= 40rem) {
|
|
9
|
+
&:has(> .gc:nth-child(2)) {
|
|
10
|
+
@apply grid-cols-2;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&:has(> .gc:nth-child(3)):not(:has(> .gc:nth-child(4)))
|
|
14
|
+
> .gc:nth-child(2) {
|
|
15
|
+
@apply -order-1 col-span-full;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (width >= 64rem) {
|
|
20
|
+
&:has(> .gc:nth-child(3)) {
|
|
21
|
+
@apply grid-cols-3;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:has(> .gc:nth-child(4)) {
|
|
25
|
+
@apply grid-cols-4;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:has(> .gc:nth-child(5)) {
|
|
29
|
+
@apply grid-cols-5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:has(> .gc:nth-child(6)) {
|
|
33
|
+
@apply grid-cols-6;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:has(> .gc:nth-child(3)):not(:has(> .gc:nth-child(4))) {
|
|
37
|
+
grid-template-columns: 1fr 2fr 1fr;
|
|
38
|
+
|
|
39
|
+
> .gc:nth-child(2) {
|
|
40
|
+
@apply order-none col-auto;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:last-child {
|
|
46
|
+
@apply border-b;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:first-child,
|
|
50
|
+
+ .g > .gc,
|
|
51
|
+
> .g {
|
|
52
|
+
@apply border-t;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.g {
|
|
56
|
+
@apply border-l-0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:not(:last-child) .gc:last-child {
|
|
60
|
+
@apply border-b-0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.gc {
|
|
64
|
+
@apply min-w-0 border-r border-inherit p-4;
|
|
65
|
+
|
|
66
|
+
&:has(> .gc) {
|
|
67
|
+
@apply p-0;
|
|
68
|
+
|
|
69
|
+
> .gc {
|
|
70
|
+
@apply border-r-0 not-first:border-t last:border-b-0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.post.gc {
|
|
76
|
+
@apply lg:p-12;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.modal {
|
|
2
|
+
@apply bg-foreground-base text-background-base z-50 m-auto max-h-[85dvh] max-w-[90dvw] p-0 opacity-0 outline-none;
|
|
3
|
+
|
|
4
|
+
transition:
|
|
5
|
+
opacity 0.25s ease-out,
|
|
6
|
+
overlay 0.25s ease-out allow-discrete,
|
|
7
|
+
display 0.25s ease-out allow-discrete;
|
|
8
|
+
|
|
9
|
+
&::backdrop {
|
|
10
|
+
@apply bg-foreground-base/2 backdrop-blur-xs;
|
|
11
|
+
|
|
12
|
+
transition:
|
|
13
|
+
opacity 0.25s ease-out,
|
|
14
|
+
overlay 0.25s ease-out allow-discrete,
|
|
15
|
+
display 0.25s ease-out allow-discrete;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&[open] {
|
|
19
|
+
@apply opacity-100;
|
|
20
|
+
|
|
21
|
+
&::backdrop {
|
|
22
|
+
@apply opacity-100;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@starting-style {
|
|
27
|
+
&[open],
|
|
28
|
+
&[open]::backdrop {
|
|
29
|
+
@apply opacity-0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.modal-body {
|
|
35
|
+
@apply overflow-y-auto p-8 font-mono normal-case;
|
|
36
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'Collapse';
|
|
3
|
+
font-style: normal;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
font-display: swap;
|
|
6
|
+
src: url(/fonts/Collapse-Regular.woff2) format('woff2');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: 'Collapse';
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 700;
|
|
13
|
+
font-display: swap;
|
|
14
|
+
src: url(/fonts/Collapse-Bold.woff2) format('woff2');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@font-face {
|
|
18
|
+
font-family: 'Rules Compressed';
|
|
19
|
+
font-style: normal;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
font-display: swap;
|
|
22
|
+
src: url(/fonts/RulesCompressed-Regular.woff2) format('woff2');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@font-face {
|
|
26
|
+
font-family: 'Rules Compressed';
|
|
27
|
+
font-style: normal;
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
font-display: swap;
|
|
30
|
+
src: url(/fonts/RulesCompressed-Medium.woff2) format('woff2');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: 'Rules Expanded';
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
font-display: swap;
|
|
38
|
+
src: url(/fonts/RulesExpanded-Regular.woff2) format('woff2');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@font-face {
|
|
42
|
+
font-family: 'Rules Expanded';
|
|
43
|
+
font-style: normal;
|
|
44
|
+
font-weight: 700;
|
|
45
|
+
font-display: swap;
|
|
46
|
+
src: url(/fonts/RulesExpanded-Bold.woff2) format('woff2');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@font-face {
|
|
50
|
+
font-family: 'Mondwest';
|
|
51
|
+
font-style: normal;
|
|
52
|
+
font-weight: 400;
|
|
53
|
+
font-display: swap;
|
|
54
|
+
src: url(/fonts/Mondwest-Regular.woff2) format('woff2');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:root {
|
|
58
|
+
--font-sans: 'Collapse', sans-serif;
|
|
59
|
+
--font-mono: 'Courier Prime', monospace;
|
|
60
|
+
--font-rules-compressed: 'Rules Compressed', sans-serif;
|
|
61
|
+
--font-rules-expanded: 'Rules Expanded', sans-serif;
|
|
62
|
+
--font-mondwest: 'Mondwest', sans-serif;
|
|
63
|
+
}
|