nuvio 0.0.2 → 1.2.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 (81) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +337 -6
  3. package/dist/nuvio-base-dark.css +1497 -0
  4. package/dist/nuvio-base-dark.min.css +1 -0
  5. package/dist/nuvio-base-light.css +1497 -0
  6. package/dist/nuvio-base-light.min.css +1 -0
  7. package/dist/nuvio-base-prefer.css +1549 -0
  8. package/dist/nuvio-base-prefer.min.css +1 -0
  9. package/dist/nuvio-base.css +1655 -0
  10. package/dist/nuvio-base.min.css +1 -0
  11. package/dist/nuvio-dark.css +9755 -0
  12. package/dist/nuvio-dark.min.css +1 -0
  13. package/dist/nuvio-light.css +9755 -0
  14. package/dist/nuvio-light.min.css +1 -0
  15. package/dist/nuvio-prefer.css +9876 -0
  16. package/dist/nuvio-prefer.min.css +1 -0
  17. package/dist/nuvio.css +10103 -18
  18. package/dist/nuvio.min.css +1 -2
  19. package/package.json +37 -22
  20. package/src/_config-base.scss +6 -0
  21. package/src/_includes-base.scss +10 -0
  22. package/src/_includes-full.scss +44 -0
  23. package/src/base/_index.scss +295 -0
  24. package/src/config/_index.scss +322 -0
  25. package/src/config/_layers.scss +27 -0
  26. package/src/config/themes.scss +308 -0
  27. package/src/config/utilities.scss +106 -0
  28. package/src/elements/accordion.scss +65 -0
  29. package/src/elements/block.scss +14 -0
  30. package/src/elements/box.scss +66 -0
  31. package/src/elements/dropdown.scss +149 -0
  32. package/src/elements/footer.scss +9 -0
  33. package/src/elements/icon.scss +63 -0
  34. package/src/elements/image.scss +36 -0
  35. package/src/elements/modal.scss +123 -0
  36. package/src/elements/navbar.scss +463 -0
  37. package/src/elements/notification.scss +53 -0
  38. package/src/elements/placeholder.scss +55 -0
  39. package/src/elements/progress.scss +85 -0
  40. package/src/elements/table.scss +149 -0
  41. package/src/elements/tag.scss +88 -0
  42. package/src/forms/button.scss +415 -0
  43. package/src/forms/checkbox-radio.scss +38 -0
  44. package/src/forms/controls.scss +181 -0
  45. package/src/forms/file.scss +237 -0
  46. package/src/forms/form-utilities.scss +109 -0
  47. package/src/forms/input.scss +27 -0
  48. package/src/forms/range.scss +96 -0
  49. package/src/forms/segmented.scss +130 -0
  50. package/src/forms/select.scss +100 -0
  51. package/src/forms/textarea.scss +26 -0
  52. package/src/forms/toggle.scss +106 -0
  53. package/src/layout/border.scss +34 -0
  54. package/src/layout/container.scss +36 -0
  55. package/src/layout/flexbox-base.scss +204 -0
  56. package/src/layout/flexbox-shorthands.scss +48 -0
  57. package/src/layout/grid.scss +72 -0
  58. package/src/layout/overflow.scss +23 -0
  59. package/src/layout/position.scss +16 -0
  60. package/src/layout/spacing.scss +70 -0
  61. package/src/layout/visibility.scss +50 -0
  62. package/src/main-base-auto.scss +4 -0
  63. package/src/main-base-dark.scss +4 -0
  64. package/src/main-base-light.scss +4 -0
  65. package/src/main-base-prefer.scss +4 -0
  66. package/src/main-full-auto.scss +4 -0
  67. package/src/main-full-dark.scss +6 -0
  68. package/src/main-full-light.scss +6 -0
  69. package/src/main-full-prefer.scss +6 -0
  70. package/src/typography/color.scss +25 -0
  71. package/src/typography/content.scss +185 -0
  72. package/src/typography/interaction.scss +20 -0
  73. package/src/typography/text.scss +71 -0
  74. package/src/typography/title.scss +76 -0
  75. package/dist/nuvio.css.map +0 -1
  76. package/dist/nuvio.min.css.map +0 -1
  77. package/src/_buttons.scss +0 -19
  78. package/src/_reset.scss +0 -5
  79. package/src/_typography.scss +0 -13
  80. package/src/_variables.scss +0 -5
  81. package/src/main.scss +0 -3
@@ -0,0 +1,149 @@
1
+ @use "../config" as c;
2
+ @use "../config/themes" as t;
3
+ @use "../config/utilities" as u;
4
+ @use "../config/layers" as l;
5
+
6
+ @include l.layer("components") {
7
+ .dropdown {
8
+ anchor-scope: --nv-dropdown;
9
+ display: inline-flex;
10
+ position: relative;
11
+ vertical-align: top;
12
+
13
+ @media (hover: hover) and (pointer: fine) {
14
+ &.is-hover:hover {
15
+ .dropdown-menu { display: block; }
16
+ }
17
+ }
18
+
19
+ // Flow-relative like the flex-based .is-right modifiers elsewhere: under
20
+ // `dir="rtl"` this pins the menu to the trailing (left) edge.
21
+ &.is-right .dropdown-menu {
22
+ inset-inline-start: auto;
23
+ inset-inline-end: 0;
24
+ }
25
+
26
+ &.is-up .dropdown-menu {
27
+ bottom: 100%;
28
+ padding-bottom: 0.25rem;
29
+ padding-top: initial;
30
+ top: auto;
31
+ }
32
+ }
33
+
34
+ .dropdown-trigger {
35
+ cursor: pointer;
36
+ }
37
+
38
+ .dropdown-menu {
39
+ display: none;
40
+ inset-inline-start: 0;
41
+ min-width: 12rem;
42
+ padding-top: 0.25rem;
43
+ position: absolute;
44
+ top: 100%;
45
+ z-index: 20;
46
+ }
47
+
48
+ .dropdown-content {
49
+ @include t.theme("background-color", "surface-1");
50
+ @include t.theme("border-color", "border");
51
+ border-width: c.$dropdown-border-width;
52
+ border-style: solid;
53
+ border-radius: c.$radius;
54
+ padding-bottom: 0.5rem;
55
+ padding-top: 0.5rem;
56
+ }
57
+
58
+ .dropdown-item {
59
+ @include t.theme("color", "text");
60
+ display: block;
61
+ font-size: c.$font-size-sm;
62
+ line-height: 1.5;
63
+ padding: 0.375rem 1rem;
64
+ }
65
+
66
+ a.dropdown-item,
67
+ button.dropdown-item {
68
+ @include t.theme("background-color", "surface-1");
69
+ padding-inline-end: 3rem;
70
+ text-align: inherit;
71
+ white-space: nowrap;
72
+ width: 100%;
73
+ cursor: pointer;
74
+ appearance: none;
75
+ border: none;
76
+ color: inherit;
77
+ font-family: inherit;
78
+ font-size: inherit;
79
+ margin: 0;
80
+
81
+ @include u.on-hover {
82
+ @include t.theme("background-color", "control-hover");
83
+ }
84
+
85
+ // The base outline alone is easy to miss on a dense menu – tint the row too.
86
+ &:focus-visible {
87
+ @include t.theme("background-color", "control-hover");
88
+ }
89
+
90
+ &.is-active,
91
+ &.is-selected {
92
+ @include t.theme("background-color", "fill-link");
93
+ @include t.theme("color", "fill-text-link");
94
+ }
95
+ }
96
+
97
+ .dropdown-divider {
98
+ @include t.theme("background-color", "border");
99
+ border: none;
100
+ display: block;
101
+ height: c.$dropdown-border-width;
102
+ margin: 0.5rem 0;
103
+ }
104
+
105
+ // ── Click-to-Open: [popover] ──────────────────────────────────────────────
106
+ // A shown popover moves to the top layer, where nesting no longer positions it
107
+ // against its trigger – hence the anchor positioning below. `anchor-scope` on
108
+ // `.dropdown` stops the shared anchor name from leaking between dropdowns on
109
+ // the same page.
110
+
111
+ .dropdown-trigger {
112
+ anchor-name: --nv-dropdown;
113
+ }
114
+
115
+ // `justify-self` decides which edge of the position-area the menu sits on;
116
+ // without it a fit-content popover lands on the area's start edge, which for
117
+ // the trailing-aligned variant is the far side of the viewport.
118
+ .dropdown-menu[popover] {
119
+ background: transparent;
120
+ border: 0;
121
+ color: inherit;
122
+ inset: auto; // undo the UA's inset: 0 / margin: auto centering
123
+ justify-self: start;
124
+ margin: 0;
125
+ overflow: visible;
126
+ position: absolute;
127
+ position-anchor: --nv-dropdown;
128
+ position-area: block-end span-inline-end;
129
+ position-try-fallbacks: flip-block;
130
+
131
+ &:popover-open { display: block; }
132
+ }
133
+
134
+ // Both variants repeat `inset: auto`: the physical offsets from the .is-right
135
+ // and .is-up rules above are more specific than the [popover] block and would
136
+ // otherwise fight the anchor.
137
+ .dropdown.is-right .dropdown-menu[popover] {
138
+ inset: auto;
139
+ justify-self: end;
140
+ position-area: block-end span-inline-start;
141
+ }
142
+
143
+ .dropdown.is-up .dropdown-menu[popover] {
144
+ inset: auto;
145
+ padding-bottom: 0.25rem;
146
+ padding-top: 0;
147
+ position-area: block-start span-inline-end;
148
+ }
149
+ }
@@ -0,0 +1,9 @@
1
+ @use "../config/themes" as t;
2
+ @use "../config/layers" as l;
3
+
4
+ @include l.layer("components") {
5
+ .footer {
6
+ @include t.theme("background-color", "surface-1");
7
+ padding: 3rem 1.5rem 6rem;
8
+ }
9
+ }
@@ -0,0 +1,63 @@
1
+ @use "../config" as c;
2
+ @use "../config/utilities" as u;
3
+ @use "../config/layers" as l;
4
+
5
+ @include l.layer("components") {
6
+ .icon {
7
+ align-items: center;
8
+ display: inline-flex;
9
+ flex-shrink: 0;
10
+ justify-content: center;
11
+ height: 1.5em;
12
+ width: 1.5em;
13
+ transition-duration: c.$duration;
14
+ transition-property: color;
15
+
16
+ &.is-small {
17
+ font-size: 1em;
18
+ height: 1em;
19
+ width: 1em;
20
+ }
21
+
22
+ &.is-medium {
23
+ font-size: 2em;
24
+ height: 1em;
25
+ width: 1em;
26
+ }
27
+
28
+ &.is-large {
29
+ font-size: 3em;
30
+ height: 1em;
31
+ width: 1em;
32
+ }
33
+
34
+ // Not named is-inline, though that is what it does: the display utility of
35
+ // that name carries `display: inline !important` and would win here, taking
36
+ // the flex centering above with it. The glyph then falls to the bottom of an
37
+ // inherited line box, a quarter of a line low, wherever the parent is a flex
38
+ // container. The sibling trap: .is-block (display) is not .block, the
39
+ // prose bottom-margin helper from elements/block.scss.
40
+ &.is-glyph {
41
+ font-size: inherit;
42
+ height: 1em;
43
+ width: 1em;
44
+ vertical-align: -.2em;
45
+ color: inherit;
46
+ transform: translateY(c.$text-icon-y-compensation);
47
+ margin-inline-start: .0667em;
48
+ }
49
+
50
+ // Framework-drawn close glyph – two crossed bars, no icon font required.
51
+ // Reuses the technique the navbar burger uses for its own open-state X.
52
+ &.is-close {
53
+ @include u.close-x;
54
+ }
55
+
56
+ &.yc-up1 { transform: translateY(c.$text-icon-y-compensation - .5px); }
57
+ &.yc-up2 { transform: translateY(c.$text-icon-y-compensation - 1px); }
58
+ &.yc-up3 { transform: translateY(c.$text-icon-y-compensation - 1.5px); }
59
+ &.yc-down1 { transform: translateY(c.$text-icon-y-compensation + .5px); }
60
+ &.yc-down2 { transform: translateY(c.$text-icon-y-compensation + 1px); }
61
+ &.yc-down3 { transform: translateY(c.$text-icon-y-compensation + 1.5px); }
62
+ }
63
+ }
@@ -0,0 +1,36 @@
1
+ @use "../config" as c;
2
+ @use "../config/layers" as l;
3
+
4
+ @include l.layer("components") {
5
+ .image {
6
+ display: block;
7
+ position: relative;
8
+
9
+ img {
10
+ display: block;
11
+ height: auto;
12
+ width: 100%;
13
+
14
+ &.is-circle {
15
+ border-radius: c.$radius-pill;
16
+ }
17
+ }
18
+
19
+ &.is-fullwidth {
20
+ width: 100%;
21
+ }
22
+
23
+ &.is-square {
24
+ aspect-ratio: 1;
25
+ overflow: hidden;
26
+
27
+ img {
28
+ position: absolute;
29
+ inset: 0;
30
+ height: 100%;
31
+ width: 100%;
32
+ object-fit: cover;
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,123 @@
1
+ @use "sass:math";
2
+ @use "../config" as c;
3
+ @use "../config/themes" as t;
4
+ @use "../config/utilities" as u;
5
+ @use "../config/layers" as l;
6
+
7
+ @include l.layer("components") {
8
+ // ── .modal ─────────────────────────────────────────────────────────────────
9
+ // Styles a native <dialog>. Opening, ESC-to-close, focus containment and the
10
+ // backdrop are the platform's job – see README for the markup-only variants.
11
+
12
+ .modal {
13
+ @include t.theme("background-color", "surface-1");
14
+ @include t.theme("border-color", "border");
15
+ @include t.theme("color", "text");
16
+ border-radius: c.$modal-radius;
17
+ border-style: solid;
18
+ border-width: c.$modal-border-width;
19
+ max-height: calc(100dvh - #{c.$viewport-gap * 2});
20
+ max-width: c.$modal-max-width;
21
+ padding: 0; // the sections below own the padding
22
+ width: calc(100% - #{c.$viewport-gap});
23
+
24
+ // `display` has to stay scoped to [open]. An unscoped `display: flex` here
25
+ // outranks the UA's `dialog:not([open]) { display: none }` and would leave
26
+ // every dialog on the page permanently visible.
27
+ &[open] {
28
+ display: flex;
29
+ flex-direction: column;
30
+
31
+ // A form wrapping the whole modal (so its footer buttons can submit it)
32
+ // is a normal pattern. Make it transparent to the flex layout so
33
+ // .modal-head/-body/-foot act as direct flex items either way – without
34
+ // this, the form is an unconstrained flex item and .modal-body's
35
+ // max-height/overflow never gets applied, breaking the scrollable body.
36
+ > form { display: contents; }
37
+ }
38
+
39
+ &::backdrop {
40
+ background-color: c.$modal-backdrop-color;
41
+ backdrop-filter: blur(c.$modal-backdrop-blur);
42
+ }
43
+
44
+ &.is-small { max-width: c.$modal-max-width-small; }
45
+ &.is-medium { max-width: c.$modal-max-width; }
46
+ &.is-large { max-width: c.$modal-max-width-large; }
47
+ }
48
+
49
+ // Native modal dialogs block interaction with the page but not scrolling. Base
50
+ // already sets `scrollbar-gutter: stable`, so this costs no layout shift.
51
+ html:has(dialog.modal[open]) {
52
+ overflow: hidden;
53
+ }
54
+
55
+ // ── .modal-head / .modal-body / .modal-foot ────────────────────────────────
56
+
57
+ .modal-head,
58
+ .modal-foot {
59
+ align-items: center;
60
+ display: flex;
61
+ flex-shrink: 0;
62
+ gap: math.div(c.$block-spacing, 3);
63
+ padding: c.$modal-padding;
64
+ }
65
+
66
+ .modal-head {
67
+ @include t.theme("border-bottom-color", "border");
68
+ border-bottom-style: solid;
69
+ border-bottom-width: c.$modal-border-width;
70
+ justify-content: space-between;
71
+
72
+ // A heading beside a close button is not a last child – drop its block margin.
73
+ .title,
74
+ .subtitle { margin-bottom: 0; }
75
+ }
76
+
77
+ // ── .modal-close ─────────────────────────────────────────────────────────
78
+ // A minimal close control, not a `.button` – full button height and its
79
+ // link-ink color are both too heavy for a corner glyph next to a title.
80
+ .modal-close {
81
+ align-items: center;
82
+ appearance: none;
83
+ background: none;
84
+ border: none;
85
+ border-radius: c.$radius-sm;
86
+ cursor: pointer;
87
+ display: inline-flex;
88
+ flex-shrink: 0;
89
+ height: 1.75em;
90
+ justify-content: center;
91
+ padding: 0;
92
+ transition: background-color c.$duration c.$easing, color c.$duration c.$easing;
93
+ width: 1.75em;
94
+
95
+ @include t.theme("color", "text-muted");
96
+ @include u.close-x;
97
+
98
+ @include u.on-hover {
99
+ @include t.theme("background-color", "surface-1-hover");
100
+ @include t.theme("color", "text");
101
+ }
102
+
103
+ &:focus-visible {
104
+ outline: 2px solid;
105
+ outline-offset: 2px;
106
+ @include t.theme("outline-color", "focus-ring");
107
+ }
108
+ }
109
+
110
+ .modal-body {
111
+ flex: 1 1 auto;
112
+ overflow-y: auto;
113
+ padding: c.$modal-padding;
114
+ }
115
+
116
+ .modal-foot {
117
+ @include t.theme("border-top-color", "border");
118
+ border-top-style: solid;
119
+ border-top-width: c.$modal-border-width;
120
+ flex-wrap: wrap;
121
+ justify-content: flex-end;
122
+ }
123
+ }