@nsaa/core 0.1.0-alpha.2 → 0.1.0-alpha.3
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 +30 -8
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/alert/alert.d.ts +3 -2
- package/dist/alert/alert.js +7 -2
- package/dist/alert-dialog/alert-dialog.js +13 -7
- package/dist/dialog/dialog.js +13 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/lib/opener.js +29 -0
- package/dist/sound/lazy-uisfx.d.ts +20 -0
- package/dist/sound/lazy-uisfx.js +68 -0
- package/dist/sound/sound-map.d.ts +2 -0
- package/dist/sound/sound-map.js +5 -1
- package/dist/sound/uisfx.d.ts +5 -1
- package/dist/sources/accordion.css +3 -0
- package/dist/sources/alert-dialog.css +26 -0
- package/dist/sources/alert.css +8 -0
- package/dist/sources/avatar.css +3 -0
- package/dist/sources/badge.css +3 -0
- package/dist/sources/button.css +24 -0
- package/dist/sources/calendar.css +25 -0
- package/dist/sources/card.css +3 -0
- package/dist/sources/checkbox.css +6 -0
- package/dist/sources/collapsible.css +2 -0
- package/dist/sources/combobox.css +28 -0
- package/dist/sources/command.css +30 -0
- package/dist/sources/context-menu.css +6 -0
- package/dist/sources/dialog.css +26 -0
- package/dist/sources/drawer.css +6 -0
- package/dist/sources/dropdown-menu.css +6 -0
- package/dist/sources/empty.css +3 -0
- package/dist/sources/field.css +5 -0
- package/dist/sources/input-group.css +27 -0
- package/dist/sources/input-otp.css +8 -0
- package/dist/sources/input.css +3 -0
- package/dist/sources/kbd.css +3 -0
- package/dist/sources/label.css +3 -0
- package/dist/sources/loaders-text.css +8 -0
- package/dist/sources/loaders.css +40 -0
- package/dist/sources/native-select.css +3 -0
- package/dist/sources/pagination.css +25 -0
- package/dist/sources/popover.css +3 -0
- package/dist/sources/radio-group.css +6 -0
- package/dist/sources/select.css +6 -0
- package/dist/sources/separator.css +3 -0
- package/dist/sources/skeleton.css +3 -0
- package/dist/sources/slider.css +6 -0
- package/dist/sources/spinner.css +20 -0
- package/dist/sources/switch.css +6 -0
- package/dist/sources/table.css +3 -0
- package/dist/sources/tabs.css +3 -0
- package/dist/sources/textarea.css +3 -0
- package/dist/sources/toast.css +25 -0
- package/dist/sources/toggle-group.css +32 -0
- package/dist/sources/toolbar.css +34 -0
- package/dist/sources/tooltip.css +3 -0
- package/package.json +7 -4
- package/src/feel.css +52 -0
- package/src/styles-base.css +142 -0
- package/src/styles.css +3 -133
package/src/styles.css
CHANGED
|
@@ -3,139 +3,9 @@
|
|
|
3
3
|
* @import "tailwindcss";
|
|
4
4
|
* @import "@nsaa/core/styles.css";
|
|
5
5
|
*/
|
|
6
|
-
@import "@nsaa/tokens/css";
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
@import "./feel.css";
|
|
7
|
+
@import "./styles-base.css";
|
|
10
8
|
|
|
11
|
-
/* Let Tailwind see the class names used by
|
|
9
|
+
/* Let Tailwind see the class names used by every built component. For less CSS, import
|
|
10
|
+
styles-base.css and the sources of the components you use instead (see that file). */
|
|
12
11
|
@source "../dist";
|
|
13
|
-
|
|
14
|
-
/* `dark:` follows the mode axis (`.dark` or `data-mode="dark"` on an ancestor), not the OS, so the
|
|
15
|
-
shadcn classes (#84) switch with the rest of the tokens. The nearest mode wins (#120): a light
|
|
16
|
-
panel inside a dark page is light, and a dark panel inside that light panel is dark again. */
|
|
17
|
-
@custom-variant dark (
|
|
18
|
-
&:where(
|
|
19
|
-
.dark,
|
|
20
|
-
[data-mode="dark"],
|
|
21
|
-
:is(.dark, [data-mode="dark"]) *:not([data-mode="light"], [data-mode="light"] *),
|
|
22
|
-
[data-mode="light"] [data-mode="dark"] *
|
|
23
|
-
)
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
/* shadcn's base layer (apps/v4 globals.css, `* { @apply border-border }`): a bare `border` class takes
|
|
27
|
-
the border token, not currentColor. Dialog's footer and the Drawer's edge rely on it (#84). */
|
|
28
|
-
@layer base {
|
|
29
|
-
*,
|
|
30
|
-
::after,
|
|
31
|
-
::before {
|
|
32
|
-
border-color: var(--border);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* shadcn's orientation variants (shadcn/tailwind.css, which the shadcn CLI imports for its users).
|
|
37
|
-
Base UI sets `data-orientation`, not `data-horizontal`; Tabs, Separator and Field use these (#84).
|
|
38
|
-
shadcn's other data-* variants match Base UI's attributes as Tailwind's defaults already. */
|
|
39
|
-
@custom-variant data-horizontal {
|
|
40
|
-
&:where([data-orientation="horizontal"]) {
|
|
41
|
-
@slot;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@custom-variant data-vertical {
|
|
46
|
-
&:where([data-orientation="vertical"]) {
|
|
47
|
-
@slot;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* shadcn's `data-selected` (same file): only `data-selected="true"`. cmdk writes "true" / "false", so
|
|
52
|
-
Tailwind's default (attribute present) would highlight every Command item (#84). */
|
|
53
|
-
@custom-variant data-selected {
|
|
54
|
-
&:where([data-selected="true"]) {
|
|
55
|
-
@slot;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* shadcn style hooks: `cn-rtl-flip` marks icons the shadcn CLI mirrors for right-to-left (the submenu
|
|
60
|
-
chevrons); `cn-input-otp` and two `cn-calendar-*` classes are styled by base-nova's style sheet, not
|
|
61
|
-
by the item's classes. */
|
|
62
|
-
@layer components {
|
|
63
|
-
.cn-rtl-flip:where(:dir(rtl)) {
|
|
64
|
-
rotate: 180deg;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* Input OTP's root: shadcn's style-nova.css gives `cn-input-otp` a `gap-2` between the groups. */
|
|
68
|
-
.cn-input-otp {
|
|
69
|
-
gap: calc(var(--spacing) * 2);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Calendar with captionLayout="dropdown" (#136): style-nova.css draws the month and year
|
|
73
|
-
dropdowns' border and focus ring, and pads the caption label; the item's classes don't. */
|
|
74
|
-
.cn-calendar-dropdown-root {
|
|
75
|
-
border: 1px solid var(--input);
|
|
76
|
-
|
|
77
|
-
&:has(:focus) {
|
|
78
|
-
border-color: var(--ring);
|
|
79
|
-
box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.cn-calendar-caption-label {
|
|
84
|
-
height: calc(var(--spacing) * 6);
|
|
85
|
-
padding-right: calc(var(--spacing) * 1);
|
|
86
|
-
padding-left: calc(var(--spacing) * 1.5);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* Hover only where hovering is real (fine pointers), never on disabled, busy or read-only controls. */
|
|
91
|
-
@custom-variant hover-fine {
|
|
92
|
-
@media (hover: hover) and (pointer: fine) {
|
|
93
|
-
&:hover:not([data-disabled], [data-loading], [data-readonly]) {
|
|
94
|
-
@slot;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Pressed look, never on disabled or busy controls. */
|
|
100
|
-
@custom-variant pressed {
|
|
101
|
-
&:active:not([data-disabled], [data-loading]) {
|
|
102
|
-
@slot;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* shadcn's `no-scrollbar` (apps/v4 globals.css), used by the Combobox list (#84). `cn-menu-target`
|
|
107
|
-
and `cn-menu-translucent` on Select and Combobox popups are inert markers the shadcn CLI keeps for
|
|
108
|
-
its optional translucent-menu setting; nothing styles them by default, so neither do we. */
|
|
109
|
-
@utility no-scrollbar {
|
|
110
|
-
-ms-overflow-style: none;
|
|
111
|
-
scrollbar-width: none;
|
|
112
|
-
|
|
113
|
-
&::-webkit-scrollbar {
|
|
114
|
-
display: none;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/* Input OTP's fake caret (`animate-caret-blink`, #84). shadcn's apps/v4 globals.css defines it; the
|
|
119
|
-
base-nova registry item doesn't ship it, so core does (and the `input-otp` registry item adds it).
|
|
120
|
-
One blink is `duration.caret` (1.25 s, as shadcn's; #125). Under reduced motion the caret stays solid. */
|
|
121
|
-
@theme {
|
|
122
|
-
--animate-caret-blink: caret-blink var(--nsaa-duration-caret) ease-out infinite;
|
|
123
|
-
|
|
124
|
-
@keyframes caret-blink {
|
|
125
|
-
0%,
|
|
126
|
-
70%,
|
|
127
|
-
100% {
|
|
128
|
-
opacity: 1;
|
|
129
|
-
}
|
|
130
|
-
20%,
|
|
131
|
-
50% {
|
|
132
|
-
opacity: 0;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
@media (prefers-reduced-motion: reduce) {
|
|
138
|
-
.animate-caret-blink {
|
|
139
|
-
animation: none;
|
|
140
|
-
}
|
|
141
|
-
}
|