@contractspec/lib.ui-kit-web 3.3.0 → 3.4.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.
@@ -1,288 +1,5 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
-
4
- // ui/button.tsx
5
- import { Slot } from "@radix-ui/react-slot";
6
- import { cva } from "class-variance-authority";
7
- import { cn } from "@contractspec/lib.ui-kit-core/utils";
8
- import { jsxDEV } from "react/jsx-dev-runtime";
9
- var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
14
- outline: "border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
15
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
16
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
17
- link: "text-primary underline-offset-4 hover:underline"
18
- },
19
- size: {
20
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
21
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
22
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
23
- icon: "size-9"
24
- }
25
- },
26
- defaultVariants: {
27
- variant: "default",
28
- size: "default"
29
- }
30
- });
31
- function Button({
32
- className,
33
- variant,
34
- size,
35
- asChild = false,
36
- ref,
37
- ...props
38
- }) {
39
- if (asChild) {
40
- return /* @__PURE__ */ jsxDEV(Slot, {
41
- "data-slot": "button",
42
- className: cn(buttonVariants({ variant, size, className })),
43
- ...props
44
- }, undefined, false, undefined, this);
45
- }
46
- return /* @__PURE__ */ jsxDEV("button", {
47
- ref,
48
- "data-slot": "button",
49
- className: cn(buttonVariants({ variant, size, className })),
50
- ...props
51
- }, undefined, false, undefined, this);
52
- }
53
- // ui/stack.tsx
54
- import { cva as cva2 } from "class-variance-authority";
55
- import { cn as cn2 } from "@contractspec/lib.ui-kit-core/utils";
56
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
57
- var vStackVariants = cva2("flex flex-col", {
58
- variants: {
59
- gap: {
60
- none: "gap-0",
61
- xs: "gap-1",
62
- sm: "gap-2",
63
- md: "gap-3",
64
- lg: "gap-4",
65
- xl: "gap-6",
66
- "2xl": "gap-8"
67
- },
68
- align: {
69
- start: "items-start",
70
- center: "items-center",
71
- end: "items-end",
72
- stretch: "items-stretch"
73
- },
74
- justify: {
75
- start: "justify-start",
76
- center: "justify-center",
77
- end: "justify-end",
78
- between: "justify-between",
79
- around: "justify-around",
80
- evenly: "justify-evenly"
81
- }
82
- },
83
- defaultVariants: {
84
- gap: "md",
85
- align: "stretch",
86
- justify: "start"
87
- }
88
- });
89
- function VStack({
90
- className,
91
- gap,
92
- align,
93
- justify,
94
- as = "div",
95
- ref,
96
- ...props
97
- }) {
98
- const Comp = as;
99
- return /* @__PURE__ */ jsxDEV2(Comp, {
100
- ref,
101
- className: cn2(vStackVariants({ gap, align, justify }), className),
102
- ...props
103
- }, undefined, false, undefined, this);
104
- }
105
- var hStackVariants = cva2("flex flex-row", {
106
- variants: {
107
- gap: {
108
- none: "gap-0",
109
- xs: "gap-1",
110
- sm: "gap-2",
111
- md: "gap-3",
112
- lg: "gap-4",
113
- xl: "gap-6",
114
- "2xl": "gap-8"
115
- },
116
- align: {
117
- start: "items-start",
118
- center: "items-center",
119
- end: "items-end",
120
- stretch: "items-stretch",
121
- baseline: "items-baseline"
122
- },
123
- justify: {
124
- start: "justify-start",
125
- center: "justify-center",
126
- end: "justify-end",
127
- between: "justify-between",
128
- around: "justify-around",
129
- evenly: "justify-evenly"
130
- },
131
- wrap: {
132
- nowrap: "flex-nowrap",
133
- wrap: "flex-wrap",
134
- wrapReverse: "flex-wrap-reverse"
135
- }
136
- },
137
- defaultVariants: {
138
- gap: "md",
139
- align: "center",
140
- justify: "start",
141
- wrap: "wrap"
142
- }
143
- });
144
- function HStack({
145
- className,
146
- gap,
147
- align,
148
- justify,
149
- wrap,
150
- as = "div",
151
- ref,
152
- ...props
153
- }) {
154
- const Comp = as;
155
- return /* @__PURE__ */ jsxDEV2(Comp, {
156
- ref,
157
- className: cn2(hStackVariants({ gap, align, justify, wrap }), className),
158
- ...props
159
- }, undefined, false, undefined, this);
160
- }
161
- var boxVariants = cva2("flex flex-row", {
162
- variants: {
163
- gap: {
164
- none: "gap-0",
165
- xs: "gap-1",
166
- sm: "gap-2",
167
- md: "gap-3",
168
- lg: "gap-4",
169
- xl: "gap-6",
170
- "2xl": "gap-8"
171
- },
172
- align: {
173
- start: "items-start",
174
- center: "items-center",
175
- end: "items-end",
176
- stretch: "items-stretch",
177
- baseline: "items-baseline"
178
- },
179
- justify: {
180
- start: "justify-start",
181
- center: "justify-center",
182
- end: "justify-end",
183
- between: "justify-between",
184
- around: "justify-around",
185
- evenly: "justify-evenly"
186
- },
187
- wrap: {
188
- nowrap: "flex-nowrap",
189
- wrap: "flex-wrap",
190
- wrapReverse: "flex-wrap-reverse"
191
- }
192
- },
193
- defaultVariants: {
194
- gap: "md",
195
- align: "center",
196
- justify: "center",
197
- wrap: "nowrap"
198
- }
199
- });
200
- function Box({
201
- className,
202
- gap,
203
- align,
204
- justify,
205
- wrap,
206
- as = "div",
207
- ref,
208
- ...props
209
- }) {
210
- const Comp = as;
211
- return /* @__PURE__ */ jsxDEV2(Comp, {
212
- ref,
213
- className: cn2(boxVariants({ gap, align, justify, wrap }), className),
214
- ...props
215
- }, undefined, false, undefined, this);
216
- }
217
- // ui/usecases/UseCaseCard.tsx
218
- import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
219
- function UseCaseCard({
220
- title,
221
- summary,
222
- ctaHref,
223
- ctaLabel = "Learn more",
224
- onCtaClick
225
- }) {
226
- return /* @__PURE__ */ jsxDEV3(VStack, {
227
- className: "rounded-lg border p-4",
228
- gap: "sm",
229
- children: [
230
- /* @__PURE__ */ jsxDEV3("div", {
231
- className: "text-lg font-semibold",
232
- children: title
233
- }, undefined, false, undefined, this),
234
- summary && /* @__PURE__ */ jsxDEV3("div", {
235
- className: "text-muted-foreground text-base",
236
- children: summary
237
- }, undefined, false, undefined, this),
238
- ctaHref && /* @__PURE__ */ jsxDEV3(HStack, {
239
- children: /* @__PURE__ */ jsxDEV3("a", {
240
- href: ctaHref,
241
- onClick: onCtaClick,
242
- children: /* @__PURE__ */ jsxDEV3(Button, {
243
- size: "sm",
244
- variant: "outline",
245
- children: ctaLabel
246
- }, undefined, false, undefined, this)
247
- }, undefined, false, undefined, this)
248
- }, undefined, false, undefined, this)
249
- ]
250
- }, undefined, true, undefined, this);
251
- }
252
-
253
- // ui/usecases/UserStoryCard.tsx
254
- import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
255
- function UserStoryCard({
256
- title,
257
- body,
258
- outcome
259
- }) {
260
- return /* @__PURE__ */ jsxDEV4(VStack, {
261
- className: "rounded-lg border p-4",
262
- gap: "sm",
263
- children: [
264
- /* @__PURE__ */ jsxDEV4("div", {
265
- className: "text-lg font-semibold",
266
- children: title
267
- }, undefined, false, undefined, this),
268
- body && /* @__PURE__ */ jsxDEV4("div", {
269
- className: "text-muted-foreground text-base",
270
- children: body
271
- }, undefined, false, undefined, this),
272
- outcome && /* @__PURE__ */ jsxDEV4("div", {
273
- className: "text-base",
274
- children: [
275
- /* @__PURE__ */ jsxDEV4("span", {
276
- className: "font-medium",
277
- children: "Outcome:"
278
- }, undefined, false, undefined, this),
279
- " ",
280
- outcome
281
- ]
282
- }, undefined, true, undefined, this)
283
- ]
284
- }, undefined, true, undefined, this);
285
- }
286
3
  export {
287
4
  UserStoryCard,
288
5
  UseCaseCard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.ui-kit-web",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Web UI components with Radix primitives",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -31,7 +31,7 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@contractspec/lib.ui-kit-core": "3.3.0",
34
+ "@contractspec/lib.ui-kit-core": "3.4.0",
35
35
  "@hookform/resolvers": "5.2.2",
36
36
  "@radix-ui/react-accordion": "^1.2.11",
37
37
  "@radix-ui/react-alert-dialog": "^1.1.14",
@@ -93,12 +93,12 @@
93
93
  "typescript": "^5.9.3",
94
94
  "react": "19.2.4",
95
95
  "react-dom": "19.2.4",
96
- "@contractspec/tool.typescript": "3.3.0",
96
+ "@contractspec/tool.typescript": "3.4.0",
97
97
  "@types/geojson": "^7946.0.14",
98
98
  "@sentry/nextjs": "^10.42.0",
99
99
  "maplibre-gl": "^5.19.0",
100
100
  "react-map-gl": "^8.0.4",
101
- "@contractspec/tool.bun": "3.3.0"
101
+ "@contractspec/tool.bun": "3.4.0"
102
102
  },
103
103
  "exports": {
104
104
  ".": {