@orangecheck/design 0.29.0 → 0.30.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.
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +155 -67
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +155 -68
- package/dist/components.mjs.map +1 -1
- package/dist/composites.d.mts +14 -1
- package/dist/composites.d.ts +14 -1
- package/dist/composites.js +138 -50
- package/dist/composites.js.map +1 -1
- package/dist/composites.mjs +139 -52
- package/dist/composites.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +106 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -18
- package/dist/index.mjs.map +1 -1
- package/dist/primitives.js +1 -1
- package/dist/primitives.js.map +1 -1
- package/dist/primitives.mjs +1 -1
- package/dist/primitives.mjs.map +1 -1
- package/package.json +1 -1
package/dist/composites.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import { clsx } from 'clsx';
|
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
import Link from 'next/link';
|
|
7
|
-
import * as React3 from 'react';
|
|
8
|
-
import { Fragment } from 'react';
|
|
9
7
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
8
|
import { cva } from 'class-variance-authority';
|
|
9
|
+
import * as React3 from 'react';
|
|
10
|
+
import { Fragment } from 'react';
|
|
11
11
|
import '@radix-ui/react-label';
|
|
12
12
|
import '@radix-ui/react-checkbox';
|
|
13
13
|
import '@radix-ui/react-radio-group';
|
|
@@ -93,6 +93,142 @@ function SectionHeader({
|
|
|
93
93
|
meta && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 font-mono text-[10px] tracking-widest uppercase", children: meta })
|
|
94
94
|
] });
|
|
95
95
|
}
|
|
96
|
+
var buttonVariants = cva(
|
|
97
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
98
|
+
{
|
|
99
|
+
variants: {
|
|
100
|
+
variant: {
|
|
101
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
102
|
+
destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
|
|
103
|
+
outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
|
104
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
105
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
106
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
107
|
+
// For CTAs placed ON a saturated brand band or a dark section
|
|
108
|
+
// (e.g. a terracotta hero / footer / a forced-dark block) where
|
|
109
|
+
// the surface is dark+light-text in either mode. A neutral white
|
|
110
|
+
// pill + a translucent-white ghost read on any such surface;
|
|
111
|
+
// hardcoded white is deliberate (cf. destructive's text-white).
|
|
112
|
+
onBrand: "bg-white text-neutral-900 shadow-sm hover:bg-white/90",
|
|
113
|
+
onBrandOutline: "border border-white/40 bg-transparent text-white hover:bg-white/10"
|
|
114
|
+
},
|
|
115
|
+
size: {
|
|
116
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
117
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
118
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
119
|
+
icon: "size-9"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
defaultVariants: {
|
|
123
|
+
variant: "default",
|
|
124
|
+
size: "default"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
function Button({
|
|
129
|
+
className,
|
|
130
|
+
variant,
|
|
131
|
+
size,
|
|
132
|
+
asChild = false,
|
|
133
|
+
...props
|
|
134
|
+
}) {
|
|
135
|
+
const Comp = asChild ? Slot : "button";
|
|
136
|
+
return /* @__PURE__ */ jsx(
|
|
137
|
+
Comp,
|
|
138
|
+
{
|
|
139
|
+
"data-slot": "button",
|
|
140
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
141
|
+
...props
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
var VARIANTS = {
|
|
146
|
+
"not-found": {
|
|
147
|
+
code: 404,
|
|
148
|
+
title: "no such route",
|
|
149
|
+
detail: "the page you're looking for doesn't exist, or has been moved.",
|
|
150
|
+
tone: "text-primary",
|
|
151
|
+
label: "not found",
|
|
152
|
+
actions: []
|
|
153
|
+
},
|
|
154
|
+
"server-error": {
|
|
155
|
+
code: 500,
|
|
156
|
+
title: "internal error",
|
|
157
|
+
detail: "something went wrong on our end.",
|
|
158
|
+
tone: "text-destructive",
|
|
159
|
+
label: "server error",
|
|
160
|
+
actions: [
|
|
161
|
+
"try refreshing the page",
|
|
162
|
+
"wait a few minutes, try again",
|
|
163
|
+
"return home and start over"
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
function OcErrorPage({
|
|
168
|
+
variant = "not-found",
|
|
169
|
+
code,
|
|
170
|
+
title,
|
|
171
|
+
detail,
|
|
172
|
+
actions,
|
|
173
|
+
homeHref = "/",
|
|
174
|
+
children,
|
|
175
|
+
className = ""
|
|
176
|
+
}) {
|
|
177
|
+
const v = VARIANTS[variant];
|
|
178
|
+
const shownCode = code ?? v.code;
|
|
179
|
+
const shownActions = actions ?? [...v.actions];
|
|
180
|
+
const isServerError = variant === "server-error";
|
|
181
|
+
return /* @__PURE__ */ jsx(
|
|
182
|
+
"div",
|
|
183
|
+
{
|
|
184
|
+
className: `container flex min-h-[60vh] flex-col items-center justify-center ${className}`,
|
|
185
|
+
children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-xl", children: [
|
|
186
|
+
/* @__PURE__ */ jsxs("div", { className: `label-mono mb-4 ${v.tone}`, children: [
|
|
187
|
+
"\xA7 ",
|
|
188
|
+
shownCode,
|
|
189
|
+
" // ",
|
|
190
|
+
v.label
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
"h1",
|
|
194
|
+
{
|
|
195
|
+
className: `font-display text-7xl font-bold tracking-tight tabular-nums sm:text-8xl ${v.tone}`,
|
|
196
|
+
children: shownCode
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
/* @__PURE__ */ jsx("h2", { className: "font-display mt-2 text-2xl font-bold tracking-tight sm:text-3xl", children: title ?? v.title }),
|
|
200
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mt-3 font-mono text-xs", children: [
|
|
201
|
+
"// ",
|
|
202
|
+
detail ?? v.detail
|
|
203
|
+
] }),
|
|
204
|
+
shownActions.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-8 border", children: [
|
|
205
|
+
/* @__PURE__ */ jsx("div", { className: "border-b px-4 py-2 font-mono text-[11px] tracking-widest uppercase", children: "what can you do" }),
|
|
206
|
+
/* @__PURE__ */ jsx("ul", { className: "divide-y font-mono text-xs", children: shownActions.map((a) => /* @__PURE__ */ jsxs("li", { className: "px-4 py-2", children: [
|
|
207
|
+
">> ",
|
|
208
|
+
a
|
|
209
|
+
] }, a)) })
|
|
210
|
+
] }),
|
|
211
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-8 flex flex-wrap gap-3", children: [
|
|
212
|
+
/* @__PURE__ */ jsx(Button, { asChild: true, className: "font-mono", children: /* @__PURE__ */ jsx(Link, { href: homeHref, children: /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: "go home" }) }) }),
|
|
213
|
+
/* @__PURE__ */ jsx(
|
|
214
|
+
Button,
|
|
215
|
+
{
|
|
216
|
+
variant: "outline",
|
|
217
|
+
onClick: () => {
|
|
218
|
+
if (typeof window === "undefined") return;
|
|
219
|
+
if (isServerError) window.location.reload();
|
|
220
|
+
else window.history.back();
|
|
221
|
+
},
|
|
222
|
+
className: "font-mono",
|
|
223
|
+
children: /* @__PURE__ */ jsx("span", { className: "text-[11px] tracking-widest uppercase", children: isServerError ? "retry" : "go back" })
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] }),
|
|
227
|
+
children && /* @__PURE__ */ jsx("div", { className: "mt-6", children })
|
|
228
|
+
] })
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
}
|
|
96
232
|
var TONE_CLASS2 = {
|
|
97
233
|
info: "border-primary/30 bg-primary/5",
|
|
98
234
|
warning: "border-warning/40 bg-warning/5",
|
|
@@ -361,55 +497,6 @@ function MarketingHeading({
|
|
|
361
497
|
)
|
|
362
498
|
] });
|
|
363
499
|
}
|
|
364
|
-
var buttonVariants = cva(
|
|
365
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
366
|
-
{
|
|
367
|
-
variants: {
|
|
368
|
-
variant: {
|
|
369
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
370
|
-
destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",
|
|
371
|
-
outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
|
372
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
373
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
374
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
375
|
-
// For CTAs placed ON a saturated brand band or a dark section
|
|
376
|
-
// (e.g. a terracotta hero / footer / a forced-dark block) where
|
|
377
|
-
// the surface is dark+light-text in either mode. A neutral white
|
|
378
|
-
// pill + a translucent-white ghost read on any such surface;
|
|
379
|
-
// hardcoded white is deliberate (cf. destructive's text-white).
|
|
380
|
-
onBrand: "bg-white text-neutral-900 shadow-sm hover:bg-white/90",
|
|
381
|
-
onBrandOutline: "border border-white/40 bg-transparent text-white hover:bg-white/10"
|
|
382
|
-
},
|
|
383
|
-
size: {
|
|
384
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
385
|
-
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
386
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
387
|
-
icon: "size-9"
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
defaultVariants: {
|
|
391
|
-
variant: "default",
|
|
392
|
-
size: "default"
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
);
|
|
396
|
-
function Button({
|
|
397
|
-
className,
|
|
398
|
-
variant,
|
|
399
|
-
size,
|
|
400
|
-
asChild = false,
|
|
401
|
-
...props
|
|
402
|
-
}) {
|
|
403
|
-
const Comp = asChild ? Slot : "button";
|
|
404
|
-
return /* @__PURE__ */ jsx(
|
|
405
|
-
Comp,
|
|
406
|
-
{
|
|
407
|
-
"data-slot": "button",
|
|
408
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
409
|
-
...props
|
|
410
|
-
}
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
500
|
cva(
|
|
414
501
|
"focus-visible:border-ring focus-visible:ring-ring/50 inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
415
502
|
{
|
|
@@ -896,6 +983,6 @@ function VerifiedChip({ icon, iconTone = "peach", label, className }) {
|
|
|
896
983
|
);
|
|
897
984
|
}
|
|
898
985
|
|
|
899
|
-
export { AccentList, AccentNote, BrandBand, Callout, CheckList, ComparisonTable, DataRow, DefinitionList, EmailCapture, EmptyState, Faq, FeatureCard, HelpHint, MarketingHeading, NumberedStep, Panel, Section, SectionHeader, StatCard, StatGrid, StatTile, StepList, TwoToneHeading, VerifiedChip };
|
|
986
|
+
export { AccentList, AccentNote, BrandBand, Callout, CheckList, ComparisonTable, DataRow, DefinitionList, EmailCapture, EmptyState, Faq, FeatureCard, HelpHint, MarketingHeading, NumberedStep, OcErrorPage, Panel, Section, SectionHeader, StatCard, StatGrid, StatTile, StepList, TwoToneHeading, VerifiedChip };
|
|
900
987
|
//# sourceMappingURL=composites.mjs.map
|
|
901
988
|
//# sourceMappingURL=composites.mjs.map
|