@nqlib/nqui 0.4.2 → 0.4.4
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 +104 -152
- package/dist/button-CJHdCq9I.js +155 -0
- package/dist/button-R304rhsj.cjs +1 -0
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.es.js +1 -1
- package/dist/carousel-D1FMVglR.cjs +1 -0
- package/dist/carousel-U7RZhYZj.js +179 -0
- package/dist/carousel.cjs.js +1 -1
- package/dist/carousel.es.js +1 -1
- package/dist/{command-palette-dEJ9aEk4.js → command-palette-DCtLpM3Q.js} +1 -1
- package/dist/{command-palette-BuYcxPCc.cjs → command-palette-MHc03bBf.cjs} +1 -1
- package/dist/command.cjs.js +1 -1
- package/dist/command.es.js +1 -1
- package/dist/components/custom/color-picker.d.ts +1 -1
- package/dist/components/custom/color-picker.d.ts.map +1 -1
- package/dist/components/custom/color-slider.d.ts +4 -10
- package/dist/components/custom/color-slider.d.ts.map +1 -1
- package/dist/components/debug/debug-features.d.ts +29 -0
- package/dist/components/debug/debug-features.d.ts.map +1 -0
- package/dist/components/debug/debug-panel.d.ts.map +1 -1
- package/dist/components/index.d.ts +14 -13
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +15 -4
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +37 -3
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts +12 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/combobox.d.ts +2 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +3 -2
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +6 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts +10 -2
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +18 -2
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/spinner.d.ts +2 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +15 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/{debug-panel-AjzBdMMz.js → debug-panel-CG-vAN0L.js} +3593 -3775
- package/dist/debug-panel-DHBfAc1V.cjs +75 -0
- package/dist/debug.cjs.js +1 -1
- package/dist/debug.es.js +1 -1
- package/dist/{drawer-pUXPg3lF.js → drawer-DO26uhym.js} +31 -31
- package/dist/drawer-DVarEy65.cjs +1 -0
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.es.js +1 -1
- package/dist/{enhanced-calendar-BENbxw7_.js → enhanced-calendar-BGlsSYJd.js} +1 -1
- package/dist/{enhanced-calendar-5PA8CeF7.cjs → enhanced-calendar-C7EQIr6i.cjs} +1 -1
- package/dist/entries/sonner.d.ts +1 -2
- package/dist/entries/sonner.d.ts.map +1 -1
- package/dist/lib/wrap-inline-label-text.d.ts +7 -0
- package/dist/lib/wrap-inline-label-text.d.ts.map +1 -0
- package/dist/nqui.cjs.js +21 -47
- package/dist/nqui.es.js +2236 -2381
- package/dist/sonner-CpmECDBk.js +179 -0
- package/dist/sonner-nE9hIalJ.cjs +48 -0
- package/dist/sonner.cjs.js +1 -1
- package/dist/sonner.es.js +3 -2
- package/dist/styles.css +183 -1
- package/docs/components/README.md +8 -7
- package/docs/components/nqui-badge.md +1 -0
- package/docs/components/nqui-button.md +3 -1
- package/docs/components/nqui-card.md +1 -0
- package/docs/components/nqui-carousel.md +6 -0
- package/docs/components/nqui-checkbox.md +15 -0
- package/docs/components/nqui-color-slider.md +5 -3
- package/docs/components/nqui-combobox.md +58 -37
- package/docs/components/nqui-drawer.md +1 -1
- package/docs/components/nqui-scroll-area.md +1 -1
- package/docs/components/nqui-select.md +2 -2
- package/docs/components/nqui-sheet.md +1 -1
- package/docs/components/nqui-slider.md +13 -0
- package/docs/components/nqui-spinner.md +6 -1
- package/docs/components/nqui-switch.md +23 -1
- package/docs/components/nqui-toaster.md +5 -1
- package/docs/nqui-skills/SKILL.md +8 -1
- package/docs/nqui-skills/design-system.md +16 -3
- package/package.json +1 -1
- package/scripts/build-styles.js +16 -0
- package/scripts/init-debug-css.js +4 -2
- package/scripts/verify-build.js +1 -1
- package/dist/button-CYFTFDKe.cjs +0 -1
- package/dist/button-nJvDl3w8.js +0 -44
- package/dist/carousel-DEyyJi49.js +0 -179
- package/dist/carousel-Dhhz8m5V.cjs +0 -1
- package/dist/components/custom/enhanced-badge.d.ts +0 -33
- package/dist/components/custom/enhanced-badge.d.ts.map +0 -1
- package/dist/components/custom/enhanced-button.d.ts +0 -39
- package/dist/components/custom/enhanced-button.d.ts.map +0 -1
- package/dist/components/custom/enhanced-checkbox.d.ts +0 -39
- package/dist/components/custom/enhanced-checkbox.d.ts.map +0 -1
- package/dist/components/custom/enhanced-combobox.d.ts +0 -35
- package/dist/components/custom/enhanced-combobox.d.ts.map +0 -1
- package/dist/components/custom/enhanced-select.d.ts +0 -30
- package/dist/components/custom/enhanced-select.d.ts.map +0 -1
- package/dist/components/custom/enhanced-sonner.d.ts +0 -15
- package/dist/components/custom/enhanced-sonner.d.ts.map +0 -1
- package/dist/debug-panel-NaOmD68t.cjs +0 -171
- package/dist/drawer-Cqq0Ozb2.cjs +0 -1
- package/dist/sonner-BtzU00r3.js +0 -248
- package/dist/sonner-Dfk26eds.cjs +0 -54
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { Toaster as T } from "sonner";
|
|
4
|
+
import { HugeiconsIcon as s } from "@hugeicons/react";
|
|
5
|
+
import { Loading03Icon as S, MultiplicationSignCircleIcon as I, Alert02Icon as E, InformationCircleIcon as C, CheckmarkCircle02Icon as N } from "@hugeicons/core-free-icons";
|
|
6
|
+
var z = (t, n, p, c, l, r, u, f) => {
|
|
7
|
+
let e = document.documentElement, g = ["light", "dark"];
|
|
8
|
+
function d(o) {
|
|
9
|
+
(Array.isArray(t) ? t : [t]).forEach((m) => {
|
|
10
|
+
let v = m === "class", k = v && r ? l.map((x) => r[x] || x) : l;
|
|
11
|
+
v ? (e.classList.remove(...k), e.classList.add(r && r[o] ? r[o] : o)) : e.setAttribute(m, o);
|
|
12
|
+
}), w(o);
|
|
13
|
+
}
|
|
14
|
+
function w(o) {
|
|
15
|
+
f && g.includes(o) && (e.style.colorScheme = o);
|
|
16
|
+
}
|
|
17
|
+
function y() {
|
|
18
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
19
|
+
}
|
|
20
|
+
if (c) d(c);
|
|
21
|
+
else try {
|
|
22
|
+
let o = localStorage.getItem(n) || p, m = u && o === "system" ? y() : o;
|
|
23
|
+
d(m);
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}, W = i.createContext(void 0), A = { setTheme: (t) => {
|
|
27
|
+
}, themes: [] }, L = () => {
|
|
28
|
+
var t;
|
|
29
|
+
return (t = i.useContext(W)) != null ? t : A;
|
|
30
|
+
};
|
|
31
|
+
i.memo(({ forcedTheme: t, storageKey: n, attribute: p, enableSystem: c, enableColorScheme: l, defaultTheme: r, value: u, themes: f, nonce: e, scriptProps: g }) => {
|
|
32
|
+
let d = JSON.stringify([p, n, r, t, f, u, c, l]).slice(1, -1);
|
|
33
|
+
return i.createElement("script", { ...g, suppressHydrationWarning: !0, nonce: typeof window > "u" ? e : "", dangerouslySetInnerHTML: { __html: `(${z.toString()})(${d})` } });
|
|
34
|
+
});
|
|
35
|
+
const b = "nqui-toast-styles-v2";
|
|
36
|
+
function M() {
|
|
37
|
+
if (typeof document > "u" || document.getElementById(b)) return;
|
|
38
|
+
const t = document.createElement("style");
|
|
39
|
+
t.id = b, t.textContent = `
|
|
40
|
+
/* Pill toast — inverted surface: dark-on-light app, light-on-dark app */
|
|
41
|
+
[data-sonner-toast] .cn-toast {
|
|
42
|
+
border: 1px solid color-mix(in oklch, var(--normal-text) 18%, transparent) !important;
|
|
43
|
+
border-radius: 9999px !important;
|
|
44
|
+
box-shadow:
|
|
45
|
+
0 1px 0 0 color-mix(in oklch, var(--normal-text) 12%, transparent),
|
|
46
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.08);
|
|
47
|
+
transition: all 200ms ease-in-out !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.dark [data-sonner-toast] .cn-toast {
|
|
51
|
+
box-shadow:
|
|
52
|
+
0 1px 0 0 color-mix(in oklch, var(--normal-text) 14%, transparent),
|
|
53
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.12);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-sonner-toast] .cn-toast.toast-success {
|
|
57
|
+
border-left-width: 3px !important;
|
|
58
|
+
border-left-color: var(--success-500) !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[data-sonner-toast] .cn-toast.toast-error {
|
|
62
|
+
border-left-width: 3px !important;
|
|
63
|
+
border-left-color: var(--danger-500) !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[data-sonner-toast] .cn-toast.toast-warning {
|
|
67
|
+
border-left-width: 3px !important;
|
|
68
|
+
border-left-color: var(--warning-500) !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-sonner-toast] .cn-toast.toast-info {
|
|
72
|
+
border-left-width: 3px !important;
|
|
73
|
+
border-left-color: var(--info-500) !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[data-sonner-toast] .cn-toast.toast-loading {
|
|
77
|
+
border-left-width: 3px !important;
|
|
78
|
+
border-left-color: var(--primary-500) !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.cn-toast .toast-icon-success { color: var(--success); }
|
|
82
|
+
.cn-toast .toast-icon-error { color: var(--destructive); }
|
|
83
|
+
.cn-toast .toast-icon-warning { color: var(--warning); }
|
|
84
|
+
.cn-toast .toast-icon-info { color: var(--info); }
|
|
85
|
+
.cn-toast .toast-icon-loading { color: var(--primary); }
|
|
86
|
+
`, document.head.appendChild(t);
|
|
87
|
+
}
|
|
88
|
+
const h = ({ ...t }) => {
|
|
89
|
+
const { theme: n = "system" } = L();
|
|
90
|
+
return i.useEffect(() => {
|
|
91
|
+
M();
|
|
92
|
+
}, []), /* @__PURE__ */ a(
|
|
93
|
+
T,
|
|
94
|
+
{
|
|
95
|
+
theme: n,
|
|
96
|
+
className: "toaster group",
|
|
97
|
+
icons: {
|
|
98
|
+
success: /* @__PURE__ */ a(
|
|
99
|
+
s,
|
|
100
|
+
{
|
|
101
|
+
icon: N,
|
|
102
|
+
strokeWidth: 2,
|
|
103
|
+
className: "size-4 text-success toast-icon-success"
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
info: /* @__PURE__ */ a(
|
|
107
|
+
s,
|
|
108
|
+
{
|
|
109
|
+
icon: C,
|
|
110
|
+
strokeWidth: 2,
|
|
111
|
+
className: "size-4 text-info toast-icon-info"
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
warning: /* @__PURE__ */ a(
|
|
115
|
+
s,
|
|
116
|
+
{
|
|
117
|
+
icon: E,
|
|
118
|
+
strokeWidth: 2,
|
|
119
|
+
className: "size-4 text-warning toast-icon-warning"
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
error: /* @__PURE__ */ a(
|
|
123
|
+
s,
|
|
124
|
+
{
|
|
125
|
+
icon: I,
|
|
126
|
+
strokeWidth: 2,
|
|
127
|
+
className: "size-4 text-destructive toast-icon-error"
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
loading: /* @__PURE__ */ a(
|
|
131
|
+
s,
|
|
132
|
+
{
|
|
133
|
+
icon: S,
|
|
134
|
+
strokeWidth: 2,
|
|
135
|
+
className: "size-4 text-primary toast-icon-loading animate-spin"
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
},
|
|
139
|
+
style: {
|
|
140
|
+
/* Invert page chrome: light UI → dark toast; dark UI → light toast */
|
|
141
|
+
"--normal-bg": "var(--foreground)",
|
|
142
|
+
"--normal-text": "var(--background)",
|
|
143
|
+
"--normal-border": "color-mix(in oklch, var(--background) 25%, transparent)",
|
|
144
|
+
"--border-radius": "9999px",
|
|
145
|
+
"--success-bg": "var(--success)",
|
|
146
|
+
"--success-text": "var(--success-foreground)",
|
|
147
|
+
"--success-border": "var(--success-400)",
|
|
148
|
+
"--error-bg": "var(--destructive)",
|
|
149
|
+
"--error-text": "var(--destructive-foreground)",
|
|
150
|
+
"--error-border": "var(--danger-400)",
|
|
151
|
+
"--warning-bg": "var(--warning)",
|
|
152
|
+
"--warning-text": "var(--warning-foreground)",
|
|
153
|
+
"--warning-border": "var(--warning-400)",
|
|
154
|
+
"--info-bg": "var(--info)",
|
|
155
|
+
"--info-text": "var(--info-foreground)",
|
|
156
|
+
"--info-border": "var(--info-400)"
|
|
157
|
+
},
|
|
158
|
+
toastOptions: {
|
|
159
|
+
classNames: {
|
|
160
|
+
toast: "cn-toast",
|
|
161
|
+
success: "toast-success",
|
|
162
|
+
error: "toast-error",
|
|
163
|
+
warning: "toast-warning",
|
|
164
|
+
info: "toast-info",
|
|
165
|
+
loading: "toast-loading"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
...t
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
h.displayName = "Toaster";
|
|
173
|
+
const j = h, P = h;
|
|
174
|
+
export {
|
|
175
|
+
P as E,
|
|
176
|
+
h as T,
|
|
177
|
+
j as a,
|
|
178
|
+
L as z
|
|
179
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),T=require("react"),j=require("sonner"),i=require("@hugeicons/react"),l=require("@hugeicons/core-free-icons");function E(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const d=E(T);var N=(t,o,r,n,u,a,f,x)=>{let s=document.documentElement,h=["light","dark"];function m(e){(Array.isArray(t)?t:[t]).forEach(p=>{let v=p==="class",S=v&&a?u.map(b=>a[b]||b):u;v?(s.classList.remove(...S),s.classList.add(a&&a[e]?a[e]:e)):s.setAttribute(p,e)}),k(e)}function k(e){x&&h.includes(e)&&(s.style.colorScheme=e)}function I(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)m(n);else try{let e=localStorage.getItem(o)||r,p=f&&e==="system"?I():e;m(p)}catch{}},C=d.createContext(void 0),O={setTheme:t=>{},themes:[]},y=()=>{var t;return(t=d.useContext(C))!=null?t:O};d.memo(({forcedTheme:t,storageKey:o,attribute:r,enableSystem:n,enableColorScheme:u,defaultTheme:a,value:f,themes:x,nonce:s,scriptProps:h})=>{let m=JSON.stringify([r,o,a,t,x,f,n,u]).slice(1,-1);return d.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?s:"",dangerouslySetInnerHTML:{__html:`(${N.toString()})(${m})`}})});const w="nqui-toast-styles-v2";function z(){if(typeof document>"u"||document.getElementById(w))return;const t=document.createElement("style");t.id=w,t.textContent=`
|
|
2
|
+
/* Pill toast — inverted surface: dark-on-light app, light-on-dark app */
|
|
3
|
+
[data-sonner-toast] .cn-toast {
|
|
4
|
+
border: 1px solid color-mix(in oklch, var(--normal-text) 18%, transparent) !important;
|
|
5
|
+
border-radius: 9999px !important;
|
|
6
|
+
box-shadow:
|
|
7
|
+
0 1px 0 0 color-mix(in oklch, var(--normal-text) 12%, transparent),
|
|
8
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.08);
|
|
9
|
+
transition: all 200ms ease-in-out !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dark [data-sonner-toast] .cn-toast {
|
|
13
|
+
box-shadow:
|
|
14
|
+
0 1px 0 0 color-mix(in oklch, var(--normal-text) 14%, transparent),
|
|
15
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.12);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-sonner-toast] .cn-toast.toast-success {
|
|
19
|
+
border-left-width: 3px !important;
|
|
20
|
+
border-left-color: var(--success-500) !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-sonner-toast] .cn-toast.toast-error {
|
|
24
|
+
border-left-width: 3px !important;
|
|
25
|
+
border-left-color: var(--danger-500) !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-sonner-toast] .cn-toast.toast-warning {
|
|
29
|
+
border-left-width: 3px !important;
|
|
30
|
+
border-left-color: var(--warning-500) !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-sonner-toast] .cn-toast.toast-info {
|
|
34
|
+
border-left-width: 3px !important;
|
|
35
|
+
border-left-color: var(--info-500) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-sonner-toast] .cn-toast.toast-loading {
|
|
39
|
+
border-left-width: 3px !important;
|
|
40
|
+
border-left-color: var(--primary-500) !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cn-toast .toast-icon-success { color: var(--success); }
|
|
44
|
+
.cn-toast .toast-icon-error { color: var(--destructive); }
|
|
45
|
+
.cn-toast .toast-icon-warning { color: var(--warning); }
|
|
46
|
+
.cn-toast .toast-icon-info { color: var(--info); }
|
|
47
|
+
.cn-toast .toast-icon-loading { color: var(--primary); }
|
|
48
|
+
`,document.head.appendChild(t)}const g=({...t})=>{const{theme:o="system"}=y();return d.useEffect(()=>{z()},[]),c.jsx(j.Toaster,{theme:o,className:"toaster group",icons:{success:c.jsx(i.HugeiconsIcon,{icon:l.CheckmarkCircle02Icon,strokeWidth:2,className:"size-4 text-success toast-icon-success"}),info:c.jsx(i.HugeiconsIcon,{icon:l.InformationCircleIcon,strokeWidth:2,className:"size-4 text-info toast-icon-info"}),warning:c.jsx(i.HugeiconsIcon,{icon:l.Alert02Icon,strokeWidth:2,className:"size-4 text-warning toast-icon-warning"}),error:c.jsx(i.HugeiconsIcon,{icon:l.MultiplicationSignCircleIcon,strokeWidth:2,className:"size-4 text-destructive toast-icon-error"}),loading:c.jsx(i.HugeiconsIcon,{icon:l.Loading03Icon,strokeWidth:2,className:"size-4 text-primary toast-icon-loading animate-spin"})},style:{"--normal-bg":"var(--foreground)","--normal-text":"var(--background)","--normal-border":"color-mix(in oklch, var(--background) 25%, transparent)","--border-radius":"9999px","--success-bg":"var(--success)","--success-text":"var(--success-foreground)","--success-border":"var(--success-400)","--error-bg":"var(--destructive)","--error-text":"var(--destructive-foreground)","--error-border":"var(--danger-400)","--warning-bg":"var(--warning)","--warning-text":"var(--warning-foreground)","--warning-border":"var(--warning-400)","--info-bg":"var(--info)","--info-text":"var(--info-foreground)","--info-border":"var(--info-400)"},toastOptions:{classNames:{toast:"cn-toast",success:"toast-success",error:"toast-error",warning:"toast-warning",info:"toast-info",loading:"toast-loading"}},...t})};g.displayName="Toaster";const H=g,_=g;exports.EnhancedSonner=_;exports.EnhancedToaster=H;exports.Toaster=g;exports.z=y;
|
package/dist/sonner.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sonner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sonner-nE9hIalJ.cjs");exports.CoreToaster=e.Toaster;exports.EnhancedSonner=e.EnhancedSonner;exports.EnhancedToaster=e.EnhancedToaster;exports.Toaster=e.Toaster;
|
package/dist/sonner.es.js
CHANGED
package/dist/styles.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - Light and dark mode support
|
|
13
13
|
* - Base layer styles
|
|
14
14
|
* - Utility animations
|
|
15
|
+
* - Hit-area @utility blocks (inlined from src/styles/hit-area.css)
|
|
15
16
|
* - @source inline() directives for zero-config Tailwind utility generation
|
|
16
17
|
*
|
|
17
18
|
* Generated by: npm run build:lib
|
|
@@ -68,9 +69,148 @@
|
|
|
68
69
|
/* Z-index elevation utilities */
|
|
69
70
|
@source inline("z-[var(--z-debug)] z-[var(--z-sticky-page)] z-[var(--z-background)] z-[var(--z-content)] z-[var(--z-popover)] z-[var(--z-modal-backdrop)] z-[var(--z-modal)] z-[var(--z-tooltip)] z-[var(--z-sticky-content)] z-[var(--z-floating)]");
|
|
70
71
|
|
|
72
|
+
/* Hit-area utilities (referenced from TSX / docs; @utility defines behavior) */
|
|
73
|
+
@source inline("hit-area-4 hit-area-6 hit-area-debug");
|
|
74
|
+
|
|
71
75
|
|
|
72
76
|
|
|
73
77
|
/* Custom dark mode variant - matches when .dark class is on element or ancestor */
|
|
78
|
+
/* Hit-area — https://bazza.dev/craft/2026/hit-area */
|
|
79
|
+
/* Bazza hit-area utilities — https://bazza.dev/craft/2026/hit-area */
|
|
80
|
+
|
|
81
|
+
@utility hit-area-debug {
|
|
82
|
+
position: relative;
|
|
83
|
+
&::before {
|
|
84
|
+
content: "";
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: var(--hit-area-t, 0px);
|
|
87
|
+
right: var(--hit-area-r, 0px);
|
|
88
|
+
bottom: var(--hit-area-b, 0px);
|
|
89
|
+
left: var(--hit-area-l, 0px);
|
|
90
|
+
pointer-events: inherit;
|
|
91
|
+
@apply border border-dashed border-blue-500 bg-blue-500/10;
|
|
92
|
+
}
|
|
93
|
+
&:hover::before {
|
|
94
|
+
@apply border border-dashed border-green-500 bg-green-500/10;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@utility hit-area {
|
|
99
|
+
position: relative;
|
|
100
|
+
&::before {
|
|
101
|
+
content: "";
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: var(--hit-area-t, 0px);
|
|
104
|
+
right: var(--hit-area-r, 0px);
|
|
105
|
+
bottom: var(--hit-area-b, 0px);
|
|
106
|
+
left: var(--hit-area-l, 0px);
|
|
107
|
+
pointer-events: inherit;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@utility hit-area-* {
|
|
112
|
+
position: relative;
|
|
113
|
+
--hit-area-t: --spacing(--value(number) * -1); --hit-area-t: calc(--value([*]) * -1);
|
|
114
|
+
--hit-area-b: --spacing(--value(number) * -1); --hit-area-b: calc(--value([*]) * -1);
|
|
115
|
+
--hit-area-l: --spacing(--value(number) * -1); --hit-area-l: calc(--value([*]) * -1);
|
|
116
|
+
--hit-area-r: --spacing(--value(number) * -1); --hit-area-r: calc(--value([*]) * -1);
|
|
117
|
+
&::before {
|
|
118
|
+
content: "";
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: var(--hit-area-t, 0px);
|
|
121
|
+
right: var(--hit-area-r, 0px);
|
|
122
|
+
bottom: var(--hit-area-b, 0px);
|
|
123
|
+
left: var(--hit-area-l, 0px);
|
|
124
|
+
pointer-events: inherit;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@utility hit-area-l-* {
|
|
129
|
+
position: relative;
|
|
130
|
+
--hit-area-l: --spacing(--value(number) * -1); --hit-area-l: calc(--value([*]) * -1);
|
|
131
|
+
&::before {
|
|
132
|
+
content: "";
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: var(--hit-area-t, 0px);
|
|
135
|
+
right: var(--hit-area-r, 0px);
|
|
136
|
+
bottom: var(--hit-area-b, 0px);
|
|
137
|
+
left: var(--hit-area-l, 0px);
|
|
138
|
+
pointer-events: inherit;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@utility hit-area-r-* {
|
|
143
|
+
position: relative;
|
|
144
|
+
--hit-area-r: --spacing(--value(number) * -1); --hit-area-r: calc(--value([*]) * -1);
|
|
145
|
+
&::before {
|
|
146
|
+
content: "";
|
|
147
|
+
position: absolute;
|
|
148
|
+
top: var(--hit-area-t, 0px);
|
|
149
|
+
right: var(--hit-area-r, 0px);
|
|
150
|
+
bottom: var(--hit-area-b, 0px);
|
|
151
|
+
left: var(--hit-area-l, 0px);
|
|
152
|
+
pointer-events: inherit;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@utility hit-area-t-* {
|
|
157
|
+
position: relative;
|
|
158
|
+
--hit-area-t: --spacing(--value(number) * -1); --hit-area-t: calc(--value([*]) * -1);
|
|
159
|
+
&::before {
|
|
160
|
+
content: "";
|
|
161
|
+
position: absolute;
|
|
162
|
+
top: var(--hit-area-t, 0px);
|
|
163
|
+
right: var(--hit-area-r, 0px);
|
|
164
|
+
bottom: var(--hit-area-b, 0px);
|
|
165
|
+
left: var(--hit-area-l, 0px);
|
|
166
|
+
pointer-events: inherit;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@utility hit-area-b-* {
|
|
171
|
+
position: relative;
|
|
172
|
+
--hit-area-b: --spacing(--value(number) * -1); --hit-area-b: calc(--value([*]) * -1);
|
|
173
|
+
&::before {
|
|
174
|
+
content: "";
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: var(--hit-area-t, 0px);
|
|
177
|
+
right: var(--hit-area-r, 0px);
|
|
178
|
+
bottom: var(--hit-area-b, 0px);
|
|
179
|
+
left: var(--hit-area-l, 0px);
|
|
180
|
+
pointer-events: inherit;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@utility hit-area-x-* {
|
|
185
|
+
position: relative;
|
|
186
|
+
--hit-area-l: --spacing(--value(number) * -1); --hit-area-l: calc(--value([*]) * -1);
|
|
187
|
+
--hit-area-r: --spacing(--value(number) * -1); --hit-area-r: calc(--value([*]) * -1);
|
|
188
|
+
&::before {
|
|
189
|
+
content: "";
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: var(--hit-area-t, 0px);
|
|
192
|
+
right: var(--hit-area-r, 0px);
|
|
193
|
+
bottom: var(--hit-area-b, 0px);
|
|
194
|
+
left: var(--hit-area-l, 0px);
|
|
195
|
+
pointer-events: inherit;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@utility hit-area-y-* {
|
|
200
|
+
position: relative;
|
|
201
|
+
--hit-area-t: --spacing(--value(number) * -1); --hit-area-t: calc(--value([*]) * -1);
|
|
202
|
+
--hit-area-b: --spacing(--value(number) * -1); --hit-area-b: calc(--value([*]) * -1);
|
|
203
|
+
&::before {
|
|
204
|
+
content: "";
|
|
205
|
+
position: absolute;
|
|
206
|
+
top: var(--hit-area-t, 0px);
|
|
207
|
+
right: var(--hit-area-r, 0px);
|
|
208
|
+
bottom: var(--hit-area-b, 0px);
|
|
209
|
+
left: var(--hit-area-l, 0px);
|
|
210
|
+
pointer-events: inherit;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
74
214
|
@theme inline {
|
|
75
215
|
--font-sans: 'Inter Variable', sans-serif;
|
|
76
216
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
@@ -455,6 +595,48 @@
|
|
|
455
595
|
}
|
|
456
596
|
}
|
|
457
597
|
|
|
598
|
+
/* Spinner — dual arc (Uiverse-style), primary gradient */
|
|
599
|
+
@keyframes nqui-spinner-rotate {
|
|
600
|
+
from {
|
|
601
|
+
transform: rotate(0deg);
|
|
602
|
+
}
|
|
603
|
+
to {
|
|
604
|
+
transform: rotate(360deg);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
@keyframes nqui-spinner-dash-first {
|
|
609
|
+
0%,
|
|
610
|
+
100% {
|
|
611
|
+
stroke-dashoffset: 50;
|
|
612
|
+
}
|
|
613
|
+
50% {
|
|
614
|
+
stroke-dashoffset: 625;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
@keyframes nqui-spinner-dash-second {
|
|
619
|
+
0%,
|
|
620
|
+
100% {
|
|
621
|
+
stroke-dashoffset: -625;
|
|
622
|
+
}
|
|
623
|
+
50% {
|
|
624
|
+
stroke-dashoffset: -50;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.nqui-spinner-rotate {
|
|
629
|
+
animation: nqui-spinner-rotate 2s linear infinite;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.nqui-spinner-arc-first circle {
|
|
633
|
+
animation: nqui-spinner-dash-first 3s ease-in-out infinite;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.nqui-spinner-arc-second circle {
|
|
637
|
+
animation: nqui-spinner-dash-second 3s ease-in-out infinite;
|
|
638
|
+
}
|
|
639
|
+
|
|
458
640
|
/* Toast Icon Animations */
|
|
459
641
|
.toast-icon-success {
|
|
460
642
|
animation: toast-checkmark 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
|
@@ -982,4 +1164,4 @@
|
|
|
982
1164
|
--sidebar-accent-foreground: oklch(0.92 0 0);
|
|
983
1165
|
--sidebar-border: oklch(1 0 0 / 10%);
|
|
984
1166
|
--sidebar-ring: oklch(0.556 0 0);
|
|
985
|
-
}
|
|
1167
|
+
}
|
|
@@ -28,16 +28,17 @@ Implementation guides for each component. **AI Skill:** Optimized for AI/LLM con
|
|
|
28
28
|
|
|
29
29
|
## Shared Conventions (AI Implementation Rules)
|
|
30
30
|
|
|
31
|
-
- **Control sizes:** `sm`=h-6, `default`=h-7, `lg`=h-8. Button, Toggle, ToggleGroup, Input, Select use this scale. See `.cursor/skills/nqui-design-system/SKILL.md`.
|
|
31
|
+
- **Control sizes:** `sm`=h-6, `default`=h-7, `lg`=h-8. Button, Toggle, ToggleGroup, Input, Select, Switch, Slider use this scale. See `packages/nqui/docs/nqui-skills/design-system.md` or `.cursor/skills/nqui-design-system/SKILL.md`.
|
|
32
32
|
- **CSS vars required:** nqui uses `--primary`, `--background`, `--foreground`, etc. Run `npx @nqlib/nqui init-css`.
|
|
33
|
-
- **Enhanced vs Core:** Button
|
|
34
|
-
- **Grouped controls:** ButtonGroup, ToggleGroup share border; ToggleGroup uses item dividers (`border-foreground/20`) or `ToggleGroupSeparator`.
|
|
33
|
+
- **Enhanced vs Core:** Default exports (`Button`, `Badge`, `Checkbox`, `Select`, etc.) are the polished/3D variants. Implementations live in **`packages/nqui/src/components/ui/*.tsx`** (single file per concern). Use `CoreButton`, `CoreBadge`, `CoreCheckbox`, etc. for base Radix/shadcn-style behavior. Separator: single component with `variant` prop (no CoreSeparator).
|
|
34
|
+
- **Grouped controls:** ButtonGroup, ToggleGroup share border; outer container uses **pill** radius (`rounded-full`). ToggleGroup uses item dividers (`border-foreground/20`) or `ToggleGroupSeparator`.
|
|
35
35
|
- **Toolbar context:** Always show Toggle/ToggleGroup in realistic context (document toolbar, chart settings, etc.). Reference: `src/pages/ComponentShowcase.tsx`.
|
|
36
|
-
- **Style injection:**
|
|
36
|
+
- **Style injection:** Some components inject `<style>` once at mount (e.g. **Combobox** input chrome in `ui/combobox.tsx`) → safe for SSR if the component is client-only (`"use client"`).
|
|
37
37
|
- **OKLCH:** ColorPicker expects OKLCH strings (`oklch(0.5 0.15 240)`), not hex.
|
|
38
38
|
- **SidebarProvider:** Must wrap entire layout (sidebar + content).
|
|
39
39
|
- **Z-index:** Use CSS vars from `styles/elevation.css` (e.g. `z-[var(--z-modal)]`). Never hardcode `z-10`, `z-50`, etc.
|
|
40
40
|
- **Keyboard:** Use `Keys`, `isMod`, `shouldIgnoreKeyboardShortcut` from `@/lib/keyboard` for custom shortcuts.
|
|
41
|
+
- **Bounded content:** Chips, pills, and inline controls should stay inside their box (ellipsis / line-clamp / scroll-by-design). See **Bounded content** in `packages/nqui/docs/nqui-skills/design-system.md`. Portals and tooltips are explicit exceptions.
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
@@ -165,7 +166,7 @@ Use these rules to choose the right component. **Selection** = user picks from o
|
|
|
165
166
|
|-------|-----|
|
|
166
167
|
| 2–5 options, inline (e.g. bold/italic/underline) | **ToggleGroup** `type="multiple"` |
|
|
167
168
|
| Form context, list of options | **Checkbox** (each option) |
|
|
168
|
-
| Many options, need search | **Combobox** `
|
|
169
|
+
| Many options, need search | **Combobox** with `multiple` (see `nqui-combobox.md`) |
|
|
169
170
|
|
|
170
171
|
### Actions (trigger, not select)
|
|
171
172
|
|
|
@@ -206,7 +207,7 @@ Use these rules to choose the right component. **Selection** = user picks from o
|
|
|
206
207
|
| Single choice, 5+ options or no space | **Select** |
|
|
207
208
|
| Single choice, need search | **Combobox** (single) |
|
|
208
209
|
| Single choice, form, small option set | **RadioGroup** |
|
|
209
|
-
| Multiple choice, need search | **Combobox** `
|
|
210
|
+
| Multiple choice, need search | **Combobox** with `multiple` (see `nqui-combobox.md`) |
|
|
210
211
|
| One boolean (agree, subscribe) | **Checkbox** |
|
|
211
212
|
| On/off setting (dark mode, notifications) | **Switch** |
|
|
212
213
|
| Numeric range (volume, opacity) | **Slider** |
|
|
@@ -233,7 +234,7 @@ Use these rules to choose the right component. **Selection** = user picks from o
|
|
|
233
234
|
| Rating | [nqui-rating.md](./nqui-rating.md) | Star/score (1–5). |
|
|
234
235
|
| InputOTP | [nqui-input-otp.md](./nqui-input-otp.md) | OTP/verification. |
|
|
235
236
|
| Field | [nqui-field.md](./nqui-field.md) | Label + description + error wrapper. |
|
|
236
|
-
| Combobox | [nqui-combobox.md](./nqui-combobox.md) | **Searchable** select. Single or `
|
|
237
|
+
| Combobox | [nqui-combobox.md](./nqui-combobox.md) | **Searchable** select. Single or `multiple`. Use when user types to filter. |
|
|
237
238
|
| ColorPicker | [nqui-color-picker.md](./nqui-color-picker.md) | Color selection. OKLCH. |
|
|
238
239
|
| ColorSlider | [nqui-color-slider.md](./nqui-color-slider.md) | Hue/saturation (used in ColorPicker). |
|
|
239
240
|
| Label | [nqui-label.md](./nqui-label.md) | Form label. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# nqui Button
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Default **Button** is the enhanced variant (gradients, depth, active scale). Implemented in **`ui/button.tsx`** with **`CoreButton`** for the plain primitive.
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
@@ -52,5 +52,7 @@ Render as `<a>` or custom element:
|
|
|
52
52
|
|
|
53
53
|
## Notes
|
|
54
54
|
|
|
55
|
+
- **Shape:** full pill (`rounded-full`) for all sizes.
|
|
56
|
+
- **Bounded label:** string/number children are wrapped so **`truncate`** + **`min-w-0`** apply in narrow layouts. Same pattern is used across **Toggle**, **Tabs**, **Badge**, **Combobox** chips; **Select** value uses **line-clamp**. Custom markup with one long inner node may still need its own `min-w-0 truncate` or a **`title`**.
|
|
55
57
|
- Active state uses `scale-95`; avoid parent `transform` overrides.
|
|
56
58
|
- Use `CoreButton` from `@nqlib/nqui` for base shadcn style.
|
|
@@ -32,6 +32,7 @@ import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter }
|
|
|
32
32
|
|
|
33
33
|
## Notes
|
|
34
34
|
|
|
35
|
+
- **Layout / bounds:** Root **Card**, **CardHeader**, **CardContent**, and **CardFooter** include **`min-w-0`** so nested flex/grid layouts can shrink and children are less likely to spill horizontally. **Card** stays **`overflow-visible`** on purpose so popovers, menus, and focus rings are not clipped—pair with bounded components (buttons, carousel insets, `truncate`, etc.) instead of `overflow-hidden` on the card by default.
|
|
35
36
|
- **stickyHeader:** Use `stickyHeader` prop on Card for scrollable content with sticky header. The header uses `--z-sticky-content` (z-index: 15).
|
|
36
37
|
- **Z-index layering:** Card sticky headers (15) are below page headers (20). If using in a page with sticky header, ensure proper z-index layering.
|
|
37
38
|
- **Height required:** Card needs a defined height (e.g., `h-[400px]` or `h-full`) for sticky behavior to work.
|
|
@@ -20,3 +20,9 @@ import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext
|
|
|
20
20
|
<CarouselNext />
|
|
21
21
|
</Carousel>
|
|
22
22
|
```
|
|
23
|
+
|
|
24
|
+
## Notes
|
|
25
|
+
|
|
26
|
+
- **Prev/Next** are positioned **inside** the carousel region (`left-2` / `right-2`, or `top-2` / `bottom-2` when vertical) so arrows stay within parents like **Card** instead of using negative offsets that sat outside the viewport (`-left-12` / `-right-12` previously).
|
|
27
|
+
- **Visibility:** Arrows are **dim by default** (`opacity-35`), ramp up on **carousel hover** (`group-hover/carousel`), and go **full opacity** on **button** `:hover`, `:focus-visible`, and `:active` (tap). Disabled controls stay faint.
|
|
28
|
+
- Override with `className` on `CarouselPrevious` / `CarouselNext` if you need edge-aligned or external controls.
|
|
@@ -49,8 +49,23 @@ Options: `0`, `1`, `2`, `3`, `4` (maps to Tailwind gap-0 through gap-4).
|
|
|
49
49
|
<Checkbox checked="indeterminate" onCheckedChange={...} />
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
## Hit area (expanded pointer target)
|
|
53
|
+
|
|
54
|
+
nqui ships [Bazza **hit-area** utilities](https://bazza.dev/craft/2026/hit-area) in library CSS (`hit-area-*`, `hit-area-x-*`, `hit-area-debug`, etc.). They extend the clickable region with a `::before` layer without changing layout.
|
|
55
|
+
|
|
56
|
+
**Enhanced checkbox:** The checkmark is drawn with `::after` on the control root so `::before` stays free for `hit-area-*` on the **same** element. Add a class when you want a larger target (e.g. padded table cells):
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<Checkbox className="hit-area-6" checked={rowSelected} onCheckedChange={...} aria-label="Select row" />
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Label hover pill:** `.checkbox-animated-label::before` is on the **label** wrapper only; it does not conflict with `hit-area-*` on the checkbox button.
|
|
63
|
+
|
|
64
|
+
**Without hit-area:** You can still wrap the control in `<span className="relative hit-area-6">` if you prefer the expanded area on a wrapper.
|
|
65
|
+
|
|
52
66
|
## Notes
|
|
53
67
|
|
|
68
|
+
- Implementation: **`packages/nqui/src/components/ui/checkbox.tsx`** (enhanced + core in one module).
|
|
54
69
|
- Injects `<style>` at mount. Use client-only guard for SSR.
|
|
55
70
|
- Square and round share the same animation (pulse + checkmark scale); round has no SVG filters.
|
|
56
71
|
- Use `CoreCheckbox` for plain Radix checkbox.
|
|
@@ -10,10 +10,12 @@ import { ColorSlider } from "@nqlib/nqui"
|
|
|
10
10
|
|
|
11
11
|
## Types
|
|
12
12
|
|
|
13
|
+
Built on **`Slider`** from `ui/slider` (white thumb + shadow). For **non-controlled** demos, prefer **`defaultValue`** so the thumb stays draggable.
|
|
14
|
+
|
|
13
15
|
```tsx
|
|
14
|
-
<ColorSlider sliderType="hue"
|
|
15
|
-
<ColorSlider sliderType="saturation"
|
|
16
|
-
<ColorSlider sliderType="lightness"
|
|
16
|
+
<ColorSlider sliderType="hue" defaultValue={[240]} onValueChange={setVal} min={0} max={360} />
|
|
17
|
+
<ColorSlider sliderType="saturation" defaultValue={[0.5]} onValueChange={setVal} min={0} max={1} step={0.01} />
|
|
18
|
+
<ColorSlider sliderType="lightness" defaultValue={[0.6]} onValueChange={setVal} min={0} max={1} step={0.01} />
|
|
17
19
|
```
|
|
18
20
|
|
|
19
21
|
## Custom
|