@travelallfly/ui 0.2.0 → 0.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The shared design system for AllFly apps: design tokens, a Tailwind preset and React components, with a Storybook to browse them. It implements the Figma file [AllFly Design System](https://www.figma.com/design/IctaOawIt0vNkTWvMfcEk7/AllFly-Design-System) (v1.0, light and dark themes).
4
4
 
5
- Status: first scaffold. It contains the foundations and one draft component (Button), which exists to prove the pipeline end to end. Further components are on hold until the theme is locked with design. The first published version is 0.1.0.
5
+ Status: the foundations and the first component, Button, match the final Figma file. Further components follow the build order in [docs/component-inventory.md](docs/component-inventory.md).
6
6
 
7
7
  ## Commands
8
8
 
package/dist/index.cjs CHANGED
@@ -31,7 +31,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var src_exports = {};
33
33
  __export(src_exports, {
34
- Button: () => Button
34
+ Badge: () => Badge,
35
+ Banner: () => Banner,
36
+ Button: () => Button,
37
+ Field: () => Field,
38
+ Input: () => Input
35
39
  });
36
40
  module.exports = __toCommonJS(src_exports);
37
41
 
@@ -139,12 +143,12 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
139
143
  secondary: [
140
144
  "border border-border-ink bg-bg-surface text-text-primary",
141
145
  "hover:bg-bg-hover active:bg-bg-sunken focus-visible:border-border-focus",
142
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
146
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
143
147
  ],
144
148
  destructive: [
145
- "border border-status-error-border bg-bg-surface text-status-error-text",
149
+ "border border-status-error-border bg-bg-surface text-status-error-strong",
146
150
  "hover:bg-status-error-fill active:bg-status-error-fill",
147
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
151
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
148
152
  ],
149
153
  link: [
150
154
  "text-text-link",
@@ -201,7 +205,162 @@ var Button = React.forwardRef(
201
205
  }
202
206
  );
203
207
  Button.displayName = "Button";
208
+
209
+ // src/components/badge/badge.tsx
210
+ var React2 = __toESM(require("react"), 1);
211
+ var import_class_variance_authority2 = require("class-variance-authority");
212
+ var import_jsx_runtime2 = require("react/jsx-runtime");
213
+ var badgeVariants = (0, import_class_variance_authority2.cva)(
214
+ "type-label-strong inline-flex h-6 shrink-0 items-center gap-spacing-xs whitespace-nowrap rounded-radius-full px-spacing-md",
215
+ {
216
+ variants: {
217
+ status: {
218
+ success: "bg-status-success-fill text-status-success-text",
219
+ info: "bg-status-info-fill text-status-info-text",
220
+ caution: "bg-status-caution-fill text-status-caution-text",
221
+ error: "bg-status-error-fill text-status-error-text",
222
+ neutral: "bg-status-neutral-fill text-status-neutral-text"
223
+ }
224
+ },
225
+ defaultVariants: {
226
+ status: "neutral"
227
+ }
228
+ }
229
+ );
230
+ var Badge = React2.forwardRef(({ className, status, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ref, className: cn(badgeVariants({ status }), className), ...props }));
231
+ Badge.displayName = "Badge";
232
+
233
+ // src/components/banner/banner.tsx
234
+ var React3 = __toESM(require("react"), 1);
235
+ var import_class_variance_authority3 = require("class-variance-authority");
236
+ var import_lucide_react = require("lucide-react");
237
+ var import_jsx_runtime3 = require("react/jsx-runtime");
238
+ var bannerVariants = (0, import_class_variance_authority3.cva)(
239
+ "type-body flex items-start gap-spacing-sm rounded-radius-lg border px-spacing-lg py-spacing-md",
240
+ {
241
+ variants: {
242
+ status: {
243
+ info: "border-status-info-border bg-status-info-fill text-status-info-text",
244
+ success: "border-status-success-border bg-status-success-fill text-status-success-text",
245
+ caution: "border-status-caution-border bg-status-caution-fill text-status-caution-text",
246
+ error: "border-status-error-border bg-status-error-fill text-status-error-text"
247
+ }
248
+ },
249
+ defaultVariants: {
250
+ status: "info"
251
+ }
252
+ }
253
+ );
254
+ var icons = {
255
+ info: import_lucide_react.Info,
256
+ success: import_lucide_react.CheckCircle2,
257
+ caution: import_lucide_react.AlertTriangle,
258
+ error: import_lucide_react.AlertCircle
259
+ };
260
+ var iconColour = {
261
+ info: "text-status-info-text",
262
+ success: "text-status-success-text",
263
+ caution: "text-status-caution-icon",
264
+ error: "text-status-error-text"
265
+ };
266
+ var Banner = React3.forwardRef(
267
+ ({ className, status, title, icon, children, role = "status", ...props }, ref) => {
268
+ const resolved = status ?? "info";
269
+ const Icon = icons[resolved];
270
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref, role, className: cn(bannerVariants({ status: resolved }), className), ...props, children: [
271
+ icon === null ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-hidden": "true", className: cn("mt-0.5 flex size-5 shrink-0 items-center", iconColour[resolved]), children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { className: "size-5", strokeWidth: 2 }) }),
272
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "min-w-0", children: [
273
+ title ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { className: "type-body-strong", children: title }) : null,
274
+ title && children ? " " : null,
275
+ children
276
+ ] })
277
+ ] });
278
+ }
279
+ );
280
+ Banner.displayName = "Banner";
281
+
282
+ // src/components/field/field.tsx
283
+ var React5 = __toESM(require("react"), 1);
284
+
285
+ // src/components/field/field-context.ts
286
+ var React4 = __toESM(require("react"), 1);
287
+ var FieldContext = React4.createContext(null);
288
+
289
+ // src/components/field/field.tsx
290
+ var import_jsx_runtime4 = require("react/jsx-runtime");
291
+ var Field = React5.forwardRef(
292
+ ({ className, label, helper, error, note, id, children, ...props }, ref) => {
293
+ const generatedId = React5.useId();
294
+ const inputId = id ?? generatedId;
295
+ const messageId = `${inputId}-message`;
296
+ const message = error ?? note ?? helper;
297
+ const context = React5.useMemo(
298
+ () => ({
299
+ id: inputId,
300
+ describedBy: message ? messageId : void 0,
301
+ invalid: Boolean(error),
302
+ prefilled: !error && Boolean(note)
303
+ }),
304
+ [inputId, messageId, message, error, note]
305
+ );
306
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref, className: cn("flex flex-col gap-1.5", className), ...props, children: [
307
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: inputId, className: "type-label text-text-primary", children: label }),
308
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FieldContext.Provider, { value: context, children }),
309
+ message ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
310
+ "p",
311
+ {
312
+ id: messageId,
313
+ className: cn(
314
+ "type-label",
315
+ error ? "text-status-error-strong" : note ? "text-status-info-text" : "text-text-muted"
316
+ ),
317
+ children: message
318
+ }
319
+ ) : null
320
+ ] });
321
+ }
322
+ );
323
+ Field.displayName = "Field";
324
+
325
+ // src/components/input/input.tsx
326
+ var React6 = __toESM(require("react"), 1);
327
+ var import_jsx_runtime5 = require("react/jsx-runtime");
328
+ var inputClasses = [
329
+ "type-body h-12 w-full min-w-0 rounded-radius-md border border-border-strong bg-bg-surface px-spacing-lg",
330
+ "text-text-primary placeholder:text-text-muted transition-colors",
331
+ "hover:border-border-control",
332
+ "focus-visible:border-border-focus focus-visible:shadow-elevation-focus focus-visible:outline-none",
333
+ "focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border-focus",
334
+ "data-[prefilled=true]:border-status-info-border",
335
+ "aria-[invalid=true]:border-status-error-border aria-[invalid=true]:ring-1 aria-[invalid=true]:ring-inset aria-[invalid=true]:ring-status-error-border",
336
+ "disabled:cursor-not-allowed disabled:border-border-default disabled:bg-bg-sunken disabled:text-text-muted"
337
+ ];
338
+ var Input = React6.forwardRef(
339
+ ({ className, prefilled, id, "aria-describedby": describedBy, "aria-invalid": invalid, ...props }, ref) => {
340
+ const field = React6.useContext(FieldContext);
341
+ const describedByIds = [field?.describedBy, describedBy].filter(Boolean).join(" ") || void 0;
342
+ const isInvalid = invalid ?? (field?.invalid ? true : void 0);
343
+ const isPrefilled = prefilled ?? field?.prefilled ?? false;
344
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
345
+ "input",
346
+ {
347
+ ref,
348
+ id: id ?? field?.id,
349
+ "aria-describedby": describedByIds,
350
+ "aria-invalid": isInvalid,
351
+ "data-prefilled": isPrefilled || void 0,
352
+ className: cn(inputClasses, className),
353
+ ...props
354
+ }
355
+ );
356
+ }
357
+ );
358
+ Input.displayName = "Input";
204
359
  // Annotate the CommonJS export names for ESM import in node:
205
360
  0 && (module.exports = {
206
- Button
361
+ Badge,
362
+ Banner,
363
+ Button,
364
+ Field,
365
+ Input
207
366
  });
package/dist/index.d.cts CHANGED
@@ -14,4 +14,34 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, But
14
14
  }
15
15
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
16
16
 
17
- export { Button, type ButtonProps };
17
+ declare const badgeVariants: (props?: ({
18
+ status?: "success" | "info" | "caution" | "error" | "neutral" | null | undefined;
19
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
20
+ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
21
+ }
22
+ declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
23
+
24
+ declare const bannerVariants: (props?: ({
25
+ status?: "success" | "info" | "caution" | "error" | null | undefined;
26
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
27
+ interface BannerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, VariantProps<typeof bannerVariants> {
28
+ title?: React.ReactNode;
29
+ icon?: React.ReactNode | null;
30
+ }
31
+ declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
32
+
33
+ interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'id'> {
34
+ label: React.ReactNode;
35
+ helper?: React.ReactNode;
36
+ error?: React.ReactNode;
37
+ note?: React.ReactNode;
38
+ id?: string;
39
+ }
40
+ declare const Field: React.ForwardRefExoticComponent<FieldProps & React.RefAttributes<HTMLDivElement>>;
41
+
42
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
43
+ prefilled?: boolean;
44
+ }
45
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
46
+
47
+ export { Badge, type BadgeProps, Banner, type BannerProps, Button, type ButtonProps, Field, type FieldProps, Input, type InputProps };
package/dist/index.d.ts CHANGED
@@ -14,4 +14,34 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, But
14
14
  }
15
15
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
16
16
 
17
- export { Button, type ButtonProps };
17
+ declare const badgeVariants: (props?: ({
18
+ status?: "success" | "info" | "caution" | "error" | "neutral" | null | undefined;
19
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
20
+ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
21
+ }
22
+ declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
23
+
24
+ declare const bannerVariants: (props?: ({
25
+ status?: "success" | "info" | "caution" | "error" | null | undefined;
26
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
27
+ interface BannerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, VariantProps<typeof bannerVariants> {
28
+ title?: React.ReactNode;
29
+ icon?: React.ReactNode | null;
30
+ }
31
+ declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>;
32
+
33
+ interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'id'> {
34
+ label: React.ReactNode;
35
+ helper?: React.ReactNode;
36
+ error?: React.ReactNode;
37
+ note?: React.ReactNode;
38
+ id?: string;
39
+ }
40
+ declare const Field: React.ForwardRefExoticComponent<FieldProps & React.RefAttributes<HTMLDivElement>>;
41
+
42
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
43
+ prefilled?: boolean;
44
+ }
45
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
46
+
47
+ export { Badge, type BadgeProps, Banner, type BannerProps, Button, type ButtonProps, Field, type FieldProps, Input, type InputProps };
package/dist/index.js CHANGED
@@ -104,12 +104,12 @@ var buttonVariants = cva(
104
104
  secondary: [
105
105
  "border border-border-ink bg-bg-surface text-text-primary",
106
106
  "hover:bg-bg-hover active:bg-bg-sunken focus-visible:border-border-focus",
107
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
107
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
108
108
  ],
109
109
  destructive: [
110
- "border border-status-error-border bg-bg-surface text-status-error-text",
110
+ "border border-status-error-border bg-bg-surface text-status-error-strong",
111
111
  "hover:bg-status-error-fill active:bg-status-error-fill",
112
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
112
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
113
113
  ],
114
114
  link: [
115
115
  "text-text-link",
@@ -166,6 +166,161 @@ var Button = React.forwardRef(
166
166
  }
167
167
  );
168
168
  Button.displayName = "Button";
169
+
170
+ // src/components/badge/badge.tsx
171
+ import * as React2 from "react";
172
+ import { cva as cva2 } from "class-variance-authority";
173
+ import { jsx as jsx2 } from "react/jsx-runtime";
174
+ var badgeVariants = cva2(
175
+ "type-label-strong inline-flex h-6 shrink-0 items-center gap-spacing-xs whitespace-nowrap rounded-radius-full px-spacing-md",
176
+ {
177
+ variants: {
178
+ status: {
179
+ success: "bg-status-success-fill text-status-success-text",
180
+ info: "bg-status-info-fill text-status-info-text",
181
+ caution: "bg-status-caution-fill text-status-caution-text",
182
+ error: "bg-status-error-fill text-status-error-text",
183
+ neutral: "bg-status-neutral-fill text-status-neutral-text"
184
+ }
185
+ },
186
+ defaultVariants: {
187
+ status: "neutral"
188
+ }
189
+ }
190
+ );
191
+ var Badge = React2.forwardRef(({ className, status, ...props }, ref) => /* @__PURE__ */ jsx2("span", { ref, className: cn(badgeVariants({ status }), className), ...props }));
192
+ Badge.displayName = "Badge";
193
+
194
+ // src/components/banner/banner.tsx
195
+ import * as React3 from "react";
196
+ import { cva as cva3 } from "class-variance-authority";
197
+ import { AlertCircle, AlertTriangle, CheckCircle2, Info } from "lucide-react";
198
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
199
+ var bannerVariants = cva3(
200
+ "type-body flex items-start gap-spacing-sm rounded-radius-lg border px-spacing-lg py-spacing-md",
201
+ {
202
+ variants: {
203
+ status: {
204
+ info: "border-status-info-border bg-status-info-fill text-status-info-text",
205
+ success: "border-status-success-border bg-status-success-fill text-status-success-text",
206
+ caution: "border-status-caution-border bg-status-caution-fill text-status-caution-text",
207
+ error: "border-status-error-border bg-status-error-fill text-status-error-text"
208
+ }
209
+ },
210
+ defaultVariants: {
211
+ status: "info"
212
+ }
213
+ }
214
+ );
215
+ var icons = {
216
+ info: Info,
217
+ success: CheckCircle2,
218
+ caution: AlertTriangle,
219
+ error: AlertCircle
220
+ };
221
+ var iconColour = {
222
+ info: "text-status-info-text",
223
+ success: "text-status-success-text",
224
+ caution: "text-status-caution-icon",
225
+ error: "text-status-error-text"
226
+ };
227
+ var Banner = React3.forwardRef(
228
+ ({ className, status, title, icon, children, role = "status", ...props }, ref) => {
229
+ const resolved = status ?? "info";
230
+ const Icon = icons[resolved];
231
+ return /* @__PURE__ */ jsxs2("div", { ref, role, className: cn(bannerVariants({ status: resolved }), className), ...props, children: [
232
+ icon === null ? null : /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", className: cn("mt-0.5 flex size-5 shrink-0 items-center", iconColour[resolved]), children: icon ?? /* @__PURE__ */ jsx3(Icon, { className: "size-5", strokeWidth: 2 }) }),
233
+ /* @__PURE__ */ jsxs2("p", { className: "min-w-0", children: [
234
+ title ? /* @__PURE__ */ jsx3("strong", { className: "type-body-strong", children: title }) : null,
235
+ title && children ? " " : null,
236
+ children
237
+ ] })
238
+ ] });
239
+ }
240
+ );
241
+ Banner.displayName = "Banner";
242
+
243
+ // src/components/field/field.tsx
244
+ import * as React5 from "react";
245
+
246
+ // src/components/field/field-context.ts
247
+ import * as React4 from "react";
248
+ var FieldContext = React4.createContext(null);
249
+
250
+ // src/components/field/field.tsx
251
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
252
+ var Field = React5.forwardRef(
253
+ ({ className, label, helper, error, note, id, children, ...props }, ref) => {
254
+ const generatedId = React5.useId();
255
+ const inputId = id ?? generatedId;
256
+ const messageId = `${inputId}-message`;
257
+ const message = error ?? note ?? helper;
258
+ const context = React5.useMemo(
259
+ () => ({
260
+ id: inputId,
261
+ describedBy: message ? messageId : void 0,
262
+ invalid: Boolean(error),
263
+ prefilled: !error && Boolean(note)
264
+ }),
265
+ [inputId, messageId, message, error, note]
266
+ );
267
+ return /* @__PURE__ */ jsxs3("div", { ref, className: cn("flex flex-col gap-1.5", className), ...props, children: [
268
+ /* @__PURE__ */ jsx4("label", { htmlFor: inputId, className: "type-label text-text-primary", children: label }),
269
+ /* @__PURE__ */ jsx4(FieldContext.Provider, { value: context, children }),
270
+ message ? /* @__PURE__ */ jsx4(
271
+ "p",
272
+ {
273
+ id: messageId,
274
+ className: cn(
275
+ "type-label",
276
+ error ? "text-status-error-strong" : note ? "text-status-info-text" : "text-text-muted"
277
+ ),
278
+ children: message
279
+ }
280
+ ) : null
281
+ ] });
282
+ }
283
+ );
284
+ Field.displayName = "Field";
285
+
286
+ // src/components/input/input.tsx
287
+ import * as React6 from "react";
288
+ import { jsx as jsx5 } from "react/jsx-runtime";
289
+ var inputClasses = [
290
+ "type-body h-12 w-full min-w-0 rounded-radius-md border border-border-strong bg-bg-surface px-spacing-lg",
291
+ "text-text-primary placeholder:text-text-muted transition-colors",
292
+ "hover:border-border-control",
293
+ "focus-visible:border-border-focus focus-visible:shadow-elevation-focus focus-visible:outline-none",
294
+ "focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border-focus",
295
+ "data-[prefilled=true]:border-status-info-border",
296
+ "aria-[invalid=true]:border-status-error-border aria-[invalid=true]:ring-1 aria-[invalid=true]:ring-inset aria-[invalid=true]:ring-status-error-border",
297
+ "disabled:cursor-not-allowed disabled:border-border-default disabled:bg-bg-sunken disabled:text-text-muted"
298
+ ];
299
+ var Input = React6.forwardRef(
300
+ ({ className, prefilled, id, "aria-describedby": describedBy, "aria-invalid": invalid, ...props }, ref) => {
301
+ const field = React6.useContext(FieldContext);
302
+ const describedByIds = [field?.describedBy, describedBy].filter(Boolean).join(" ") || void 0;
303
+ const isInvalid = invalid ?? (field?.invalid ? true : void 0);
304
+ const isPrefilled = prefilled ?? field?.prefilled ?? false;
305
+ return /* @__PURE__ */ jsx5(
306
+ "input",
307
+ {
308
+ ref,
309
+ id: id ?? field?.id,
310
+ "aria-describedby": describedByIds,
311
+ "aria-invalid": isInvalid,
312
+ "data-prefilled": isPrefilled || void 0,
313
+ className: cn(inputClasses, className),
314
+ ...props
315
+ }
316
+ );
317
+ }
318
+ );
319
+ Input.displayName = "Input";
169
320
  export {
170
- Button
321
+ Badge,
322
+ Banner,
323
+ Button,
324
+ Field,
325
+ Input
171
326
  };
package/dist/utils.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
4
 
@@ -44,12 +44,12 @@ var buttonVariants = _classvarianceauthority.cva.call(void 0,
44
44
  secondary: [
45
45
  "border border-border-ink bg-bg-surface text-text-primary",
46
46
  "hover:bg-bg-hover active:bg-bg-sunken focus-visible:border-border-focus",
47
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
47
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
48
48
  ],
49
49
  destructive: [
50
- "border border-status-error-border bg-bg-surface text-status-error-text",
50
+ "border border-status-error-border bg-bg-surface text-status-error-strong",
51
51
  "hover:bg-status-error-fill active:bg-status-error-fill",
52
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
52
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
53
53
  ],
54
54
  link: [
55
55
  "text-text-link",
@@ -69,6 +69,81 @@ var buttonVariants = _classvarianceauthority.cva.call(void 0,
69
69
  }
70
70
  );
71
71
 
72
+ // src/components/badge/badge.tsx
73
+ var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
74
+
75
+ var _jsxruntime = require('react/jsx-runtime');
76
+ var badgeVariants = _classvarianceauthority.cva.call(void 0,
77
+ "type-label-strong inline-flex h-6 shrink-0 items-center gap-spacing-xs whitespace-nowrap rounded-radius-full px-spacing-md",
78
+ {
79
+ variants: {
80
+ status: {
81
+ success: "bg-status-success-fill text-status-success-text",
82
+ info: "bg-status-info-fill text-status-info-text",
83
+ caution: "bg-status-caution-fill text-status-caution-text",
84
+ error: "bg-status-error-fill text-status-error-text",
85
+ neutral: "bg-status-neutral-fill text-status-neutral-text"
86
+ }
87
+ },
88
+ defaultVariants: {
89
+ status: "neutral"
90
+ }
91
+ }
92
+ );
93
+ var Badge = React.forwardRef(({ className, status, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ref, className: cn(badgeVariants({ status }), className), ...props }));
94
+ Badge.displayName = "Badge";
95
+
96
+ // src/components/banner/banner.tsx
97
+
98
+
99
+ var _lucidereact = require('lucide-react');
100
+
101
+ var bannerVariants = _classvarianceauthority.cva.call(void 0,
102
+ "type-body flex items-start gap-spacing-sm rounded-radius-lg border px-spacing-lg py-spacing-md",
103
+ {
104
+ variants: {
105
+ status: {
106
+ info: "border-status-info-border bg-status-info-fill text-status-info-text",
107
+ success: "border-status-success-border bg-status-success-fill text-status-success-text",
108
+ caution: "border-status-caution-border bg-status-caution-fill text-status-caution-text",
109
+ error: "border-status-error-border bg-status-error-fill text-status-error-text"
110
+ }
111
+ },
112
+ defaultVariants: {
113
+ status: "info"
114
+ }
115
+ }
116
+ );
117
+ var icons = {
118
+ info: _lucidereact.Info,
119
+ success: _lucidereact.CheckCircle2,
120
+ caution: _lucidereact.AlertTriangle,
121
+ error: _lucidereact.AlertCircle
122
+ };
123
+ var iconColour = {
124
+ info: "text-status-info-text",
125
+ success: "text-status-success-text",
126
+ caution: "text-status-caution-icon",
127
+ error: "text-status-error-text"
128
+ };
129
+ var Banner = React2.forwardRef(
130
+ ({ className, status, title, icon, children, role = "status", ...props }, ref) => {
131
+ const resolved = _nullishCoalesce(status, () => ( "info"));
132
+ const Icon = icons[resolved];
133
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref, role, className: cn(bannerVariants({ status: resolved }), className), ...props, children: [
134
+ icon === null ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": "true", className: cn("mt-0.5 flex size-5 shrink-0 items-center", iconColour[resolved]), children: _nullishCoalesce(icon, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { className: "size-5", strokeWidth: 2 }))) }),
135
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "min-w-0", children: [
136
+ title ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { className: "type-body-strong", children: title }) : null,
137
+ title && children ? " " : null,
138
+ children
139
+ ] })
140
+ ] });
141
+ }
142
+ );
143
+ Banner.displayName = "Banner";
144
+
145
+
146
+
72
147
 
73
148
 
74
- exports.buttonVariants = buttonVariants; exports.cn = cn;
149
+ exports.badgeVariants = badgeVariants; exports.bannerVariants = bannerVariants; exports.buttonVariants = buttonVariants; exports.cn = cn;
package/dist/utils.d.cts CHANGED
@@ -10,4 +10,12 @@ declare const buttonVariants: (props?: ({
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
12
12
 
13
- export { type ButtonVariantProps, buttonVariants, cn };
13
+ declare const badgeVariants: (props?: ({
14
+ status?: "success" | "info" | "caution" | "error" | "neutral" | null | undefined;
15
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
16
+
17
+ declare const bannerVariants: (props?: ({
18
+ status?: "success" | "info" | "caution" | "error" | null | undefined;
19
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
20
+
21
+ export { type ButtonVariantProps, badgeVariants, bannerVariants, buttonVariants, cn };
package/dist/utils.d.ts CHANGED
@@ -10,4 +10,12 @@ declare const buttonVariants: (props?: ({
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
12
12
 
13
- export { type ButtonVariantProps, buttonVariants, cn };
13
+ declare const badgeVariants: (props?: ({
14
+ status?: "success" | "info" | "caution" | "error" | "neutral" | null | undefined;
15
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
16
+
17
+ declare const bannerVariants: (props?: ({
18
+ status?: "success" | "info" | "caution" | "error" | null | undefined;
19
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
20
+
21
+ export { type ButtonVariantProps, badgeVariants, bannerVariants, buttonVariants, cn };
package/dist/utils.js CHANGED
@@ -44,12 +44,12 @@ var buttonVariants = cva(
44
44
  secondary: [
45
45
  "border border-border-ink bg-bg-surface text-text-primary",
46
46
  "hover:bg-bg-hover active:bg-bg-sunken focus-visible:border-border-focus",
47
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
47
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
48
48
  ],
49
49
  destructive: [
50
- "border border-status-error-border bg-bg-surface text-status-error-text",
50
+ "border border-status-error-border bg-bg-surface text-status-error-strong",
51
51
  "hover:bg-status-error-fill active:bg-status-error-fill",
52
- "aria-disabled:border-border-default aria-disabled:text-text-muted"
52
+ "aria-disabled:border-border-strong aria-disabled:text-text-muted"
53
53
  ],
54
54
  link: [
55
55
  "text-text-link",
@@ -68,7 +68,82 @@ var buttonVariants = cva(
68
68
  }
69
69
  }
70
70
  );
71
+
72
+ // src/components/badge/badge.tsx
73
+ import * as React from "react";
74
+ import { cva as cva2 } from "class-variance-authority";
75
+ import { jsx } from "react/jsx-runtime";
76
+ var badgeVariants = cva2(
77
+ "type-label-strong inline-flex h-6 shrink-0 items-center gap-spacing-xs whitespace-nowrap rounded-radius-full px-spacing-md",
78
+ {
79
+ variants: {
80
+ status: {
81
+ success: "bg-status-success-fill text-status-success-text",
82
+ info: "bg-status-info-fill text-status-info-text",
83
+ caution: "bg-status-caution-fill text-status-caution-text",
84
+ error: "bg-status-error-fill text-status-error-text",
85
+ neutral: "bg-status-neutral-fill text-status-neutral-text"
86
+ }
87
+ },
88
+ defaultVariants: {
89
+ status: "neutral"
90
+ }
91
+ }
92
+ );
93
+ var Badge = React.forwardRef(({ className, status, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, className: cn(badgeVariants({ status }), className), ...props }));
94
+ Badge.displayName = "Badge";
95
+
96
+ // src/components/banner/banner.tsx
97
+ import * as React2 from "react";
98
+ import { cva as cva3 } from "class-variance-authority";
99
+ import { AlertCircle, AlertTriangle, CheckCircle2, Info } from "lucide-react";
100
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
101
+ var bannerVariants = cva3(
102
+ "type-body flex items-start gap-spacing-sm rounded-radius-lg border px-spacing-lg py-spacing-md",
103
+ {
104
+ variants: {
105
+ status: {
106
+ info: "border-status-info-border bg-status-info-fill text-status-info-text",
107
+ success: "border-status-success-border bg-status-success-fill text-status-success-text",
108
+ caution: "border-status-caution-border bg-status-caution-fill text-status-caution-text",
109
+ error: "border-status-error-border bg-status-error-fill text-status-error-text"
110
+ }
111
+ },
112
+ defaultVariants: {
113
+ status: "info"
114
+ }
115
+ }
116
+ );
117
+ var icons = {
118
+ info: Info,
119
+ success: CheckCircle2,
120
+ caution: AlertTriangle,
121
+ error: AlertCircle
122
+ };
123
+ var iconColour = {
124
+ info: "text-status-info-text",
125
+ success: "text-status-success-text",
126
+ caution: "text-status-caution-icon",
127
+ error: "text-status-error-text"
128
+ };
129
+ var Banner = React2.forwardRef(
130
+ ({ className, status, title, icon, children, role = "status", ...props }, ref) => {
131
+ const resolved = status ?? "info";
132
+ const Icon = icons[resolved];
133
+ return /* @__PURE__ */ jsxs("div", { ref, role, className: cn(bannerVariants({ status: resolved }), className), ...props, children: [
134
+ icon === null ? null : /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", className: cn("mt-0.5 flex size-5 shrink-0 items-center", iconColour[resolved]), children: icon ?? /* @__PURE__ */ jsx2(Icon, { className: "size-5", strokeWidth: 2 }) }),
135
+ /* @__PURE__ */ jsxs("p", { className: "min-w-0", children: [
136
+ title ? /* @__PURE__ */ jsx2("strong", { className: "type-body-strong", children: title }) : null,
137
+ title && children ? " " : null,
138
+ children
139
+ ] })
140
+ ] });
141
+ }
142
+ );
143
+ Banner.displayName = "Banner";
71
144
  export {
145
+ badgeVariants,
146
+ bannerVariants,
72
147
  buttonVariants,
73
148
  cn
74
149
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travelallfly/ui",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "AllFly design system: tokens, Tailwind preset and shared React components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -75,6 +75,7 @@
75
75
  "test-consumers": "node scripts/test-consumers.mjs"
76
76
  },
77
77
  "peerDependencies": {
78
+ "lucide-react": ">=0.292.0 <1",
78
79
  "react": ">=18",
79
80
  "react-dom": ">=18",
80
81
  "tailwindcss": ">=3.4 <4"
@@ -103,6 +104,7 @@
103
104
  "eslint-plugin-react-hooks": "^5.2.0",
104
105
  "globals": "^17.14.0",
105
106
  "jsdom": "^26.0.0",
107
+ "lucide-react": "^0.474.0",
106
108
  "postcss": "^8.4.49",
107
109
  "react": "^19.0.1",
108
110
  "react-dom": "^19.0.1",