loseta 0.8.0 → 0.10.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.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/registry/components/attachment.css +84 -0
  3. package/registry/components/bubble.css +92 -0
  4. package/registry/components/calendar.css +57 -0
  5. package/registry/components/carousel.css +95 -0
  6. package/registry/components/chart.css +65 -0
  7. package/registry/components/marker.css +47 -0
  8. package/registry/components/message-scroller.css +56 -0
  9. package/registry/components/message.css +61 -0
  10. package/registry/components/questionnaire.css +92 -0
  11. package/registry/components/resizable.css +51 -0
  12. package/registry/components/sidebar.css +39 -0
  13. package/registry/components/toast.css +47 -0
  14. package/registry/components/trace.css +78 -0
  15. package/registry/examples/attachment.html +41 -0
  16. package/registry/examples/bubble.html +21 -0
  17. package/registry/examples/calendar.html +60 -0
  18. package/registry/examples/carousel.html +49 -0
  19. package/registry/examples/chart.html +39 -0
  20. package/registry/examples/marker.html +14 -0
  21. package/registry/examples/message-scroller.html +54 -0
  22. package/registry/examples/message.html +31 -0
  23. package/registry/examples/questionnaire.html +66 -0
  24. package/registry/examples/resizable.html +23 -0
  25. package/registry/examples/sidebar.html +31 -0
  26. package/registry/examples/toast.html +17 -0
  27. package/registry/examples/trace.html +42 -0
  28. package/registry/registry.json +418 -1
  29. package/registry/styles/nova/attachment.css +176 -0
  30. package/registry/styles/nova/bubble.css +147 -0
  31. package/registry/styles/nova/calendar.css +78 -0
  32. package/registry/styles/nova/carousel.css +55 -0
  33. package/registry/styles/nova/chart.css +42 -0
  34. package/registry/styles/nova/marker.css +35 -0
  35. package/registry/styles/nova/message-scroller.css +47 -0
  36. package/registry/styles/nova/message.css +39 -0
  37. package/registry/styles/nova/questionnaire.css +141 -0
  38. package/registry/styles/nova/resizable.css +33 -0
  39. package/registry/styles/nova/sidebar.css +98 -0
  40. package/registry/styles/nova/toast.css +62 -0
  41. package/registry/styles/nova/trace.css +85 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loseta",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Native CSS component scaffolds with the shadcn feel.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,84 @@
1
+ /* Attachment */
2
+ @layer loseta.components {
3
+ .attachment {
4
+ position: relative;
5
+ display: flex;
6
+ width: fit-content;
7
+ max-width: 100%;
8
+ min-width: 0;
9
+ flex-shrink: 0;
10
+ flex-wrap: wrap;
11
+ border-style: solid;
12
+ border-width: 1px;
13
+
14
+ &[data-orientation='vertical'] {
15
+ width: 7rem;
16
+ flex-direction: column;
17
+ }
18
+
19
+ > [data-slot='media'] {
20
+ position: relative;
21
+ display: flex;
22
+ aspect-ratio: 1 / 1;
23
+ flex-shrink: 0;
24
+ align-items: center;
25
+ justify-content: center;
26
+ overflow: hidden;
27
+
28
+ > :is(img, svg) {
29
+ width: 100%;
30
+ height: 100%;
31
+ }
32
+
33
+ > img {
34
+ object-fit: cover;
35
+ }
36
+ }
37
+
38
+ > [data-slot='content'] {
39
+ display: flex;
40
+ flex: 1 1 auto;
41
+ min-width: 0;
42
+ flex-direction: column;
43
+
44
+ :is([data-slot='title'], [data-slot='description']) {
45
+ display: block;
46
+ max-width: 100%;
47
+ overflow: hidden;
48
+ text-overflow: ellipsis;
49
+ white-space: nowrap;
50
+ }
51
+
52
+ > [data-slot='description'][role='alert'] {
53
+ white-space: normal;
54
+ }
55
+ }
56
+
57
+ > [data-slot='actions'] {
58
+ display: flex;
59
+ flex-shrink: 0;
60
+ align-items: center;
61
+ }
62
+
63
+ &[data-orientation='vertical'] > [data-slot='actions'] {
64
+ position: absolute;
65
+ z-index: 2;
66
+ inset-block-start: 0.75rem;
67
+ inset-inline-end: 0.75rem;
68
+ }
69
+
70
+ > [data-slot='trigger'] {
71
+ position: absolute;
72
+ z-index: 1;
73
+ inset: 0;
74
+ border-style: none;
75
+ background-color: transparent;
76
+ outline-style: none;
77
+
78
+ @media (forced-colors: active) {
79
+ outline: 2px solid transparent;
80
+ outline-offset: 2px;
81
+ }
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,92 @@
1
+ /* Bubble */
2
+ @layer loseta.components {
3
+ .bubble-group {
4
+ display: flex;
5
+ min-width: 0;
6
+ flex-direction: column;
7
+ gap: 0.5rem;
8
+ }
9
+
10
+ .bubble {
11
+ position: relative;
12
+ display: flex;
13
+ width: fit-content;
14
+ max-width: 80%;
15
+ min-width: 0;
16
+ flex-direction: column;
17
+ gap: 0.25rem;
18
+
19
+ &[data-align='end'] {
20
+ align-self: flex-end;
21
+ }
22
+
23
+ &[data-variant='ghost'] {
24
+ max-width: 100%;
25
+ }
26
+
27
+ > [data-slot='content'] {
28
+ width: fit-content;
29
+ max-width: 100%;
30
+ min-width: 0;
31
+ overflow: hidden;
32
+ overflow-wrap: anywhere;
33
+ border-style: solid;
34
+ border-width: 1px;
35
+ border-color: transparent;
36
+ outline-style: none;
37
+
38
+ &:is(a, button) {
39
+ text-align: start;
40
+ }
41
+
42
+ @media (forced-colors: active) {
43
+ &:is(a, button) {
44
+ outline: 2px solid transparent;
45
+ outline-offset: 2px;
46
+ }
47
+ }
48
+ }
49
+
50
+ > [data-slot='reactions'] {
51
+ position: absolute;
52
+ z-index: 1;
53
+ display: flex;
54
+ width: fit-content;
55
+ align-items: center;
56
+ justify-content: center;
57
+ gap: 0.25rem;
58
+ inset-block-end: 0;
59
+ inset-inline-end: 0.75rem;
60
+ translate: 0 75%;
61
+
62
+ &[data-side='top'] {
63
+ inset-block-start: 0;
64
+ inset-block-end: auto;
65
+ translate: 0 -75%;
66
+ }
67
+
68
+ &[data-align='start'] {
69
+ inset-inline-start: 0.75rem;
70
+ inset-inline-end: auto;
71
+ }
72
+ }
73
+
74
+ [data-slot='reaction'] {
75
+ display: inline-flex;
76
+ flex-shrink: 0;
77
+ align-items: center;
78
+ justify-content: center;
79
+ gap: 0.25rem;
80
+ border-style: none;
81
+ border-radius: var(--radius-full);
82
+ font: inherit;
83
+ cursor: pointer;
84
+ outline-style: none;
85
+
86
+ @media (forced-colors: active) {
87
+ outline: 2px solid transparent;
88
+ outline-offset: 2px;
89
+ }
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,57 @@
1
+ /* Calendar */
2
+ @layer loseta.components {
3
+ .calendar {
4
+ display: flex;
5
+ flex-direction: column;
6
+
7
+ > header {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ }
12
+
13
+ > header > button {
14
+ display: inline-flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ outline-style: none;
18
+
19
+ @media (forced-colors: active) {
20
+ outline: 2px solid transparent;
21
+ outline-offset: 2px;
22
+ }
23
+ }
24
+
25
+ table {
26
+ width: 100%;
27
+ table-layout: fixed;
28
+ border-collapse: collapse;
29
+ }
30
+
31
+ th {
32
+ font-weight: 400;
33
+ text-align: center;
34
+ }
35
+
36
+ td {
37
+ padding: 0;
38
+ text-align: center;
39
+ }
40
+
41
+ td > button {
42
+ display: inline-flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ outline-style: none;
46
+
47
+ @media (forced-colors: active) {
48
+ outline: 2px solid transparent;
49
+ outline-offset: 2px;
50
+ }
51
+
52
+ &[aria-disabled='true'] {
53
+ pointer-events: none;
54
+ }
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,95 @@
1
+ /* Carousel */
2
+ @layer loseta.components {
3
+ .carousel {
4
+ position: relative;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 0.75rem;
8
+
9
+ > .carousel-viewport {
10
+ overflow-x: auto;
11
+ overflow-y: hidden;
12
+ scroll-snap-type: x mandatory;
13
+ scrollbar-width: none;
14
+
15
+ &::-webkit-scrollbar {
16
+ display: none;
17
+ }
18
+ }
19
+
20
+ > .carousel-viewport > .carousel-track {
21
+ display: flex;
22
+ }
23
+
24
+ .carousel-item {
25
+ flex: 0 0 100%;
26
+ min-width: 0;
27
+ scroll-snap-align: start;
28
+ scroll-snap-stop: always;
29
+ }
30
+
31
+ &[data-orientation='vertical'] {
32
+ > .carousel-viewport {
33
+ overflow-x: hidden;
34
+ overflow-y: auto;
35
+ scroll-snap-type: y mandatory;
36
+ }
37
+
38
+ .carousel-track {
39
+ flex-direction: column;
40
+ }
41
+
42
+ .carousel-item {
43
+ flex-basis: 100%;
44
+ }
45
+ }
46
+
47
+ .carousel-controls {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ gap: 0.5rem;
52
+ }
53
+
54
+ .carousel-button {
55
+ display: inline-flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ outline-style: none;
59
+
60
+ @media (forced-colors: active) {
61
+ outline: 2px solid transparent;
62
+ outline-offset: 2px;
63
+ }
64
+ }
65
+
66
+ .carousel-indicators {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: 0.25rem;
70
+ }
71
+
72
+ .carousel-indicator {
73
+ position: relative;
74
+ display: inline-flex;
75
+ width: 1.5rem;
76
+ height: 1.5rem;
77
+ align-items: center;
78
+ justify-content: center;
79
+ outline-style: none;
80
+
81
+ @media (forced-colors: active) {
82
+ outline: 2px solid transparent;
83
+ outline-offset: 2px;
84
+ }
85
+
86
+ &::before {
87
+ width: 0.5rem;
88
+ height: 0.5rem;
89
+ border-radius: var(--radius-full);
90
+ background-color: currentColor;
91
+ content: '';
92
+ }
93
+ }
94
+ }
95
+ }
@@ -0,0 +1,65 @@
1
+ /* Chart */
2
+ @layer loseta.components {
3
+ .chart {
4
+ position: relative;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 0.75rem;
8
+
9
+ > [data-slot='plot'] {
10
+ position: relative;
11
+ width: 100%;
12
+
13
+ > :is(svg, canvas) {
14
+ display: block;
15
+ width: 100%;
16
+ height: 100%;
17
+ }
18
+ }
19
+
20
+ > [data-slot='legend'] {
21
+ display: flex;
22
+ flex-wrap: wrap;
23
+ align-items: center;
24
+ gap: 0.75rem;
25
+ }
26
+
27
+ [data-slot='legend-item'] {
28
+ display: inline-flex;
29
+ align-items: center;
30
+ gap: 0.375rem;
31
+ }
32
+
33
+ [data-slot='swatch'] {
34
+ width: 0.5rem;
35
+ height: 0.5rem;
36
+ border-radius: var(--radius-full);
37
+ background-color: var(--chart-color, var(--primary));
38
+ }
39
+
40
+ [data-slot='tooltip'] {
41
+ position: absolute;
42
+ z-index: 1;
43
+ }
44
+
45
+ [data-series='1'] {
46
+ --chart-color: var(--chart-1);
47
+ }
48
+
49
+ [data-series='2'] {
50
+ --chart-color: var(--chart-2);
51
+ }
52
+
53
+ [data-series='3'] {
54
+ --chart-color: var(--chart-3);
55
+ }
56
+
57
+ [data-series='4'] {
58
+ --chart-color: var(--chart-4);
59
+ }
60
+
61
+ [data-series='5'] {
62
+ --chart-color: var(--chart-5);
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,47 @@
1
+ /* Marker */
2
+ @layer loseta.components {
3
+ .marker {
4
+ position: relative;
5
+ display: flex;
6
+ min-height: 1rem;
7
+ width: 100%;
8
+ align-items: center;
9
+ gap: 0.5rem;
10
+ text-align: start;
11
+
12
+ > [data-slot='icon'] {
13
+ display: inline-flex;
14
+ width: 1rem;
15
+ height: 1rem;
16
+ flex-shrink: 0;
17
+ align-items: center;
18
+ justify-content: center;
19
+ }
20
+
21
+ > [data-slot='content'] {
22
+ min-width: 0;
23
+ overflow-wrap: anywhere;
24
+ }
25
+
26
+ &[data-variant='separator'] {
27
+ &::before,
28
+ &::after {
29
+ height: 1px;
30
+ min-width: 0;
31
+ flex: 1;
32
+ content: '';
33
+ }
34
+
35
+ > [data-slot='content'] {
36
+ flex: none;
37
+ text-align: center;
38
+ }
39
+ }
40
+
41
+ &[data-variant='border'] {
42
+ border-block-end-style: solid;
43
+ border-block-end-width: 1px;
44
+ padding-block-end: 0.5rem;
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,56 @@
1
+ /* Message Scroller */
2
+ @layer loseta.components {
3
+ .message-scroller {
4
+ position: relative;
5
+ display: flex;
6
+ min-height: 0;
7
+ width: 100%;
8
+ flex-direction: column;
9
+ overflow: hidden;
10
+ }
11
+
12
+ .message-scroller-viewport {
13
+ min-height: 0;
14
+ flex: 1 1 auto;
15
+ overflow-y: auto;
16
+ overscroll-behavior: contain;
17
+ scrollbar-width: thin;
18
+ outline-style: none;
19
+
20
+ @media (forced-colors: active) {
21
+ outline: 2px solid transparent;
22
+ outline-offset: 2px;
23
+ }
24
+ }
25
+
26
+ .message-scroller [data-slot='content'] {
27
+ display: flex;
28
+ min-height: 100%;
29
+ min-width: 0;
30
+ flex-direction: column;
31
+ gap: 1rem;
32
+ }
33
+
34
+ .message-scroller [data-slot='jump'] {
35
+ position: absolute;
36
+ z-index: 2;
37
+ inset-block-end: 1rem;
38
+ inset-inline-end: 1rem;
39
+ display: inline-flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ border-style: solid;
43
+ border-width: 1px;
44
+ outline-style: none;
45
+ cursor: pointer;
46
+
47
+ &[hidden] {
48
+ display: none;
49
+ }
50
+
51
+ @media (forced-colors: active) {
52
+ outline: 2px solid transparent;
53
+ outline-offset: 2px;
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,61 @@
1
+ /* Message */
2
+ @layer loseta.components {
3
+ .message-group {
4
+ display: flex;
5
+ width: 100%;
6
+ min-width: 0;
7
+ flex-direction: column;
8
+ gap: 0.5rem;
9
+ }
10
+
11
+ .message {
12
+ position: relative;
13
+ display: flex;
14
+ width: 100%;
15
+ min-width: 0;
16
+ gap: 0.5rem;
17
+
18
+ &[data-align='end'] {
19
+ flex-direction: row-reverse;
20
+ }
21
+
22
+ > [data-slot='avatar'] {
23
+ display: flex;
24
+ flex-shrink: 0;
25
+ align-items: center;
26
+ align-self: flex-end;
27
+ justify-content: center;
28
+ }
29
+
30
+ > [data-slot='content'] {
31
+ display: flex;
32
+ flex: 1 1 auto;
33
+ min-width: 0;
34
+ flex-direction: column;
35
+ align-items: flex-start;
36
+ gap: 0.5rem;
37
+ }
38
+
39
+ &[data-align='end'] > [data-slot='content'] {
40
+ align-items: flex-end;
41
+ }
42
+
43
+ [data-slot='header'],
44
+ [data-slot='footer'] {
45
+ display: flex;
46
+ max-width: 100%;
47
+ min-width: 0;
48
+ align-items: center;
49
+ gap: 0.5rem;
50
+ }
51
+
52
+ &[data-align='end'] [data-slot='footer'] {
53
+ justify-content: flex-end;
54
+ }
55
+
56
+ [data-slot='header'] > *,
57
+ [data-slot='footer'] > * {
58
+ min-width: 0;
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,92 @@
1
+ /* Questionnaire */
2
+ @layer loseta.components {
3
+ .questionnaire {
4
+ display: flex;
5
+ width: 100%;
6
+ min-width: 0;
7
+ flex-direction: column;
8
+ gap: 1rem;
9
+
10
+ > [data-slot='progress'] {
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 0.5rem;
14
+
15
+ > progress {
16
+ display: block;
17
+ width: 100%;
18
+ appearance: none;
19
+ overflow: hidden;
20
+
21
+ &::-webkit-progress-bar {
22
+ appearance: none;
23
+ }
24
+ }
25
+ }
26
+
27
+ [data-slot='item'] {
28
+ display: flex;
29
+ min-width: 0;
30
+ flex-direction: column;
31
+ gap: 0.75rem;
32
+ border-style: none;
33
+ margin: 0;
34
+ padding: 0;
35
+
36
+ &[hidden] {
37
+ display: none;
38
+ }
39
+
40
+ > legend {
41
+ padding: 0;
42
+ }
43
+ }
44
+
45
+ [data-slot='choices'] {
46
+ display: flex;
47
+ flex-direction: column;
48
+ gap: 0.5rem;
49
+ }
50
+
51
+ .questionnaire-choice {
52
+ position: relative;
53
+ display: flex;
54
+ align-items: flex-start;
55
+ gap: 0.75rem;
56
+ border-style: solid;
57
+ border-width: 1px;
58
+ cursor: pointer;
59
+
60
+ > input {
61
+ flex-shrink: 0;
62
+ margin-block-start: 0.125rem;
63
+ }
64
+
65
+ > [data-slot='text'] {
66
+ display: flex;
67
+ min-width: 0;
68
+ flex-direction: column;
69
+ gap: 0.125rem;
70
+ }
71
+ }
72
+
73
+ [data-slot='input'] {
74
+ width: 100%;
75
+ }
76
+
77
+ [data-slot='actions'] {
78
+ display: flex;
79
+ flex-wrap: wrap;
80
+ align-items: center;
81
+ gap: 0.5rem;
82
+ }
83
+
84
+ [data-slot='skip'] {
85
+ margin-inline-end: auto;
86
+ }
87
+
88
+ [data-slot='error'] {
89
+ margin: 0;
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,51 @@
1
+ /* Resizable */
2
+ @layer loseta.components {
3
+ .resizable {
4
+ display: flex;
5
+ width: 100%;
6
+ height: 100%;
7
+ overflow: hidden;
8
+
9
+ &[data-orientation='vertical'] {
10
+ flex-direction: column;
11
+ }
12
+
13
+ > .resizable-panel {
14
+ flex: var(--panel-size, 1) 1 0;
15
+ min-width: 0;
16
+ min-height: 0;
17
+ overflow: auto;
18
+ }
19
+
20
+ > [data-slot='handle'] {
21
+ position: relative;
22
+ display: flex;
23
+ flex: 0 0 0.5rem;
24
+ align-items: center;
25
+ justify-content: center;
26
+ touch-action: none;
27
+ cursor: col-resize;
28
+ outline-style: none;
29
+
30
+ @media (forced-colors: active) {
31
+ outline: 2px solid transparent;
32
+ outline-offset: 2px;
33
+ }
34
+
35
+ &::before {
36
+ width: 1px;
37
+ height: 100%;
38
+ content: '';
39
+ }
40
+ }
41
+
42
+ &[data-orientation='vertical'] > [data-slot='handle'] {
43
+ cursor: row-resize;
44
+
45
+ &::before {
46
+ width: 100%;
47
+ height: 1px;
48
+ }
49
+ }
50
+ }
51
+ }