@object-ui/components 17.2.0 → 17.3.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.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * Translated accessible name for the close button the Shadcn `Sheet` and
10
+ * `Dialog` primitives auto-render — objectstack#5505.
11
+ *
12
+ * Those buttons are icon-only (a lucide `X`), so their `sr-only` span is not
13
+ * decoration: it IS the control's accessible name, the thing a screen reader
14
+ * announces and the thing `getByRole('button', { name })` matches. Upstream
15
+ * ships it as a hardcoded English literal, so under zh/ja/es every drawer and
16
+ * modal in the console announced "Close" in English.
17
+ *
18
+ * ## Why the implementation lives HERE and not in the primitives
19
+ *
20
+ * `packages/components/src/ui/**` is regenerated from the Shadcn registry
21
+ * (AGENTS.md Commandment #7) — anything written there is overwritten by the
22
+ * next `pnpm shadcn:update`. `src/lib/` is not part of that regeneration, so
23
+ * this file is permanent. The primitives get only a one-line
24
+ * `<CloseSrLabel />` reference, re-applied on every sync by the declared patch
25
+ * in `scripts/shadcn-local-patches.mjs`. Keeping the payload out of the
26
+ * regenerated zone is what makes the patch small enough to survive upstream
27
+ * churn: two anchored lines rather than an inlined hook.
28
+ *
29
+ * ## Why `createSafeTranslation`
30
+ *
31
+ * The no-provider path must stay English. A large number of existing unit
32
+ * tests and e2e specs address dialogs and drawers by their English accessible
33
+ * name with no `I18nProvider` mounted (e.g.
34
+ * `packages/plugin-form/src/discardGuard.test.tsx`,
35
+ * `packages/plugin-detail/src/__tests__/InlineCreateRelated.closeButtonName.test.tsx`),
36
+ * and a primitive that rendered a raw `common.close` key there would break all
37
+ * of them. `createSafeTranslation` probes its test key and falls back to the
38
+ * defaults map below when translations are not configured, so "no provider"
39
+ * resolves to "Close" rather than to a key.
40
+ */
41
+ import * as React from "react";
42
+ /**
43
+ * `sr-only` accessible name for an icon-only close control.
44
+ *
45
+ * A component rather than a helper call because it owns a hook — the
46
+ * primitives render it as `<CloseSrLabel />` inside their close button, which
47
+ * keeps the hook call legal in files whose components are expression-bodied
48
+ * `forwardRef` arrows with no statement block to put a hook in.
49
+ */
50
+ export declare function CloseSrLabel(): React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/components",
3
- "version": "17.2.0",
3
+ "version": "17.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Standard UI component library for Object UI, built with Shadcn UI + Tailwind CSS",
@@ -26,7 +26,7 @@
26
26
  "./style.css": "./dist/index.css"
27
27
  },
28
28
  "dependencies": {
29
- "@objectstack/spec": "^17.0.0-rc.1",
29
+ "@objectstack/spec": "^17.0.0-rc.2",
30
30
  "@radix-ui/react-accordion": "^1.2.20",
31
31
  "@radix-ui/react-alert-dialog": "^1.1.23",
32
32
  "@radix-ui/react-aspect-ratio": "^1.1.15",
@@ -60,7 +60,7 @@
60
60
  "date-fns": "^4.4.0",
61
61
  "embla-carousel-react": "^8.6.0",
62
62
  "input-otp": "^1.4.2",
63
- "lucide-react": "^1.25.0",
63
+ "lucide-react": "^1.28.0",
64
64
  "next-themes": "^0.4.6",
65
65
  "react-day-picker": "^10.0.1",
66
66
  "react-hook-form": "^7.83.0",
@@ -70,12 +70,12 @@
70
70
  "tailwind-merge": "^3.6.0",
71
71
  "tailwindcss-animate": "^1.0.7",
72
72
  "vaul": "^1.1.2",
73
- "@object-ui/core": "17.2.0",
74
- "@object-ui/i18n": "17.2.0",
75
- "@object-ui/react": "17.2.0",
76
- "@object-ui/react-runtime": "17.2.0",
77
- "@object-ui/sdui-parser": "17.2.0",
78
- "@object-ui/types": "17.2.0"
73
+ "@object-ui/core": "17.3.0",
74
+ "@object-ui/i18n": "17.3.0",
75
+ "@object-ui/react": "17.3.0",
76
+ "@object-ui/react-runtime": "17.3.0",
77
+ "@object-ui/sdui-parser": "17.3.0",
78
+ "@object-ui/types": "17.3.0"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "^18.0.0 || ^19.0.0",
@@ -85,15 +85,15 @@
85
85
  "devDependencies": {
86
86
  "@radix-ui/react-focus-scope": "^1.1.16",
87
87
  "@tailwindcss/postcss": "^4.3.3",
88
- "@types/react": "19.2.17",
89
- "@types/react-dom": "19.2.3",
90
- "@vitejs/plugin-react": "^6.0.4",
88
+ "@types/react": "19.2.18",
89
+ "@types/react-dom": "19.2.4",
90
+ "@vitejs/plugin-react": "^6.0.5",
91
91
  "autoprefixer": "^10.5.4",
92
- "postcss": "^8.5.24",
93
- "shadcn": "^4.15.0",
92
+ "postcss": "^8.5.26",
93
+ "shadcn": "^4.16.0",
94
94
  "tailwindcss": "^4.3.3",
95
95
  "typescript": "^6.0.3",
96
- "vite": "^8.1.5",
96
+ "vite": "^8.2.0",
97
97
  "vite-plugin-dts": "^5.0.3",
98
98
  "zod": "^4.4.3"
99
99
  },