@waveso/ui 0.9.1 → 0.10.1

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.
@@ -13,6 +13,17 @@ interface ActionBarEntry {
13
13
  /** Discard this form's changes. */
14
14
  onReset: () => void;
15
15
  }
16
+ /** Overridable button + status strings, for internationalization. */
17
+ interface ActionBarLabels {
18
+ /** Save button. @default "Save" */
19
+ save?: string;
20
+ /** Save button while a save is in progress. @default "Saving" */
21
+ saving?: string;
22
+ /** Reset button. @default "Reset" */
23
+ reset?: string;
24
+ /** Status shown when a save fails. @default "Couldn't save your changes" */
25
+ saveError?: string;
26
+ }
16
27
  interface ActionBarProviderProps {
17
28
  children: React.ReactNode;
18
29
  /** Message when one form has changes. */
@@ -24,6 +35,8 @@ interface ActionBarProviderProps {
24
35
  * users get) when guarded navigation is blocked.
25
36
  */
26
37
  blockedMessage?: string;
38
+ /** Overridable button + status strings (for i18n). Merged over the English defaults. */
39
+ labels?: ActionBarLabels;
27
40
  /** Additional className for the bar's inner content box (`data-slot="action-bar-content"`). */
28
41
  className?: string;
29
42
  }
@@ -56,6 +69,7 @@ declare function ActionBarProvider({
56
69
  message,
57
70
  pluralMessage,
58
71
  blockedMessage,
72
+ labels,
59
73
  className
60
74
  }: ActionBarProviderProps): _$react_jsx_runtime0.JSX.Element;
61
75
  /**
@@ -83,4 +97,4 @@ declare function useActionBar(id: string, entry: ActionBarEntry): void;
83
97
  */
84
98
  declare function useActionBarGuard(navigate: (href: string) => void): (href: string) => boolean;
85
99
  //#endregion
86
- export { type ActionBarEntry, ActionBarProvider, type ActionBarProviderProps, useActionBar, useActionBarGuard };
100
+ export { type ActionBarEntry, type ActionBarLabels, ActionBarProvider, type ActionBarProviderProps, useActionBar, useActionBarGuard };
@@ -48,7 +48,14 @@ const ActionBarContext = React.createContext(null);
48
48
  * useActionBar('profile', { hasChanges, saving, onSave, onReset });
49
49
  * ```
50
50
  */
51
- function ActionBarProvider({ children, message = "You have unsaved changes", pluralMessage = (count) => `${count} unsaved changes`, blockedMessage = "Save or reset your changes before leaving this page", className }) {
51
+ function ActionBarProvider({ children, message = "You have unsaved changes", pluralMessage = (count) => `${count} unsaved changes`, blockedMessage = "Save or reset your changes before leaving this page", labels, className }) {
52
+ const text = {
53
+ save: "Save",
54
+ saving: "Saving",
55
+ reset: "Reset",
56
+ saveError: "Couldn't save your changes",
57
+ ...labels
58
+ };
52
59
  const entriesRef = React.useRef(/* @__PURE__ */ new Map());
53
60
  const [, forceUpdate] = React.useState(0);
54
61
  const [jiggleTransform, setJiggleTransform] = React.useState(null);
@@ -205,7 +212,7 @@ function ActionBarProvider({ children, message = "You have unsaved changes", plu
205
212
  children: [/* @__PURE__ */ jsx("span", {
206
213
  "data-slot": "action-bar-message",
207
214
  className: cn("whitespace-nowrap text-sm font-medium", saveError ? "text-destructive" : "text-contrast"),
208
- children: saveError ? "Couldn't save your changes" : displayMessage
215
+ children: saveError ? text.saveError : displayMessage
209
216
  }), /* @__PURE__ */ jsxs("div", {
210
217
  "data-slot": "action-bar-actions",
211
218
  className: "flex items-center gap-1.5",
@@ -215,14 +222,14 @@ function ActionBarProvider({ children, message = "You have unsaved changes", plu
215
222
  disabled: anySaving,
216
223
  onClick: handleResetAll,
217
224
  className: "h-9 px-3 text-sm hover:text-destructive",
218
- children: "Reset"
225
+ children: text.reset
219
226
  }), /* @__PURE__ */ jsx(Button, {
220
227
  type: "button",
221
228
  variant: "default",
222
229
  disabled: anySaving,
223
230
  onClick: handleSaveAll,
224
231
  className: "h-9 px-4 text-sm",
225
- children: anySaving ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Spinner, { className: "mr-1.5 h-3.5 w-3.5" }), "Saving"] }) : /* @__PURE__ */ jsxs(Fragment, { children: ["Save", /* @__PURE__ */ jsx(Kbd, {
232
+ children: anySaving ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Spinner, { className: "mr-1.5 h-3.5 w-3.5" }), text.saving] }) : /* @__PURE__ */ jsxs(Fragment, { children: [text.save, /* @__PURE__ */ jsx(Kbd, {
226
233
  className: "ml-1.5",
227
234
  children: isMac ? "⌘S" : "Ctrl+S"
228
235
  })] })
package/dist/badge.d.ts CHANGED
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
5
5
 
6
6
  //#region src/badge.d.ts
7
7
  declare const badgeVariants: (props?: ({
8
- variant?: "default" | "outline" | "link" | "destructive" | "success" | "warning" | "secondary" | "ghost" | null | undefined;
8
+ variant?: "default" | "link" | "outline" | "success" | "warning" | "destructive" | "secondary" | "ghost" | null | undefined;
9
9
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  type BadgeProps = useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>;
11
11
  declare function Badge({
@@ -37,8 +37,6 @@ function BreadcrumbLink({ className, render, ...props }) {
37
37
  function BreadcrumbPage({ className, ...props }) {
38
38
  return /* @__PURE__ */ jsx("span", {
39
39
  "data-slot": "breadcrumb-page",
40
- role: "link",
41
- "aria-disabled": "true",
42
40
  "aria-current": "page",
43
41
  className: cn("text-contrast font-normal", className),
44
42
  ...props
package/dist/button.d.ts CHANGED
@@ -6,8 +6,8 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
6
6
 
7
7
  //#region src/button.d.ts
8
8
  declare const buttonVariants: (props?: ({
9
- variant?: "default" | "outline" | "link" | "destructive" | "success" | "secondary" | "ghost" | null | undefined;
10
- size?: "default" | "sm" | "xs" | "icon" | "lg" | "xl" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
+ variant?: "default" | "link" | "outline" | "success" | "destructive" | "secondary" | "ghost" | null | undefined;
10
+ size?: "default" | "sm" | "lg" | "icon" | "xs" | "xl" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
11
11
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
12
12
  type ButtonProps = React.ComponentProps<typeof Button$1> & VariantProps<typeof buttonVariants>;
13
13
  declare function Button({
package/dist/item.d.ts CHANGED
@@ -11,7 +11,7 @@ declare const itemVariants: (props?: ({
11
11
  size?: "default" | "sm" | "xs" | null | undefined;
12
12
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
13
13
  declare const itemMediaVariants: (props?: ({
14
- variant?: "default" | "icon" | "image" | null | undefined;
14
+ variant?: "default" | "image" | "icon" | null | undefined;
15
15
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
16
16
  type ItemGroupProps = React.ComponentProps<"div">;
17
17
  type ItemSeparatorProps = React.ComponentProps<typeof Separator>;
package/dist/toast.d.ts CHANGED
@@ -7,7 +7,7 @@ import * as _$_base_ui_react0 from "@base-ui/react";
7
7
  //#region src/toast.d.ts
8
8
  declare const toastRootClass = "bg-elevated text-contrast ring-contrast/10 rounded-md p-4 text-sm shadow-md ring-1 outline-hidden";
9
9
  declare const toastIconVariants: (props?: ({
10
- type?: "success" | "warning" | "loading" | "info" | "error" | null | undefined;
10
+ type?: "loading" | "success" | "info" | "warning" | "error" | null | undefined;
11
11
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
12
12
  declare const toastViewportVariants: (props?: ({
13
13
  position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waveso/ui",
3
- "version": "0.9.1",
3
+ "version": "0.10.1",
4
4
  "description": "Wave UI component library built on Base UI and Tailwind CSS",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -51,9 +51,11 @@
51
51
  "format": "biome format --write",
52
52
  "test": "vitest run --passWithNoTests",
53
53
  "test:watch": "vitest",
54
+ "check:package": "publint && attw --pack . --ignore-rules no-resolution",
54
55
  "clean": "rm -rf dist",
55
56
  "storybook": "storybook dev -p 6006",
56
57
  "build-storybook": "storybook build",
58
+ "chromatic": "chromatic --exit-zero-on-changes",
57
59
  "prepublishOnly": "npm run build",
58
60
  "changeset": "changeset",
59
61
  "version": "changeset version",
@@ -83,6 +85,7 @@
83
85
  }
84
86
  },
85
87
  "devDependencies": {
88
+ "@arethetypeswrong/cli": "^0.18.4",
86
89
  "@base-ui/react": "^1.6.0",
87
90
  "@biomejs/biome": "2.5.2",
88
91
  "@changesets/cli": "^2.27.0",
@@ -91,15 +94,18 @@
91
94
  "@storybook/react-vite": "~10.4.0",
92
95
  "@tailwindcss/vite": "^4.2.1",
93
96
  "@testing-library/dom": "^10.4.1",
97
+ "@testing-library/jest-dom": "^6.9.1",
94
98
  "@testing-library/react": "^16.3.2",
95
99
  "@testing-library/user-event": "^14.6.1",
96
100
  "@types/react": "^19",
97
101
  "@types/react-dom": "^19",
102
+ "chromatic": "^18.0.1",
98
103
  "class-variance-authority": "^0.7.1",
99
104
  "clsx": "^2.1.1",
100
105
  "input-otp": "^1.4.2",
101
106
  "jsdom": "^29.1.1",
102
107
  "motion": "^12.31.0",
108
+ "publint": "^0.3.21",
103
109
  "react": "^19.2.0",
104
110
  "react-dom": "^19.2.0",
105
111
  "react-hook-form": "^7.66.0",