@godxjp/ui 20.2.0 → 20.2.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.
@@ -2,11 +2,13 @@
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { Check, ChevronsUpDown, Loader2, RotateCcw } from "lucide-react";
5
+ import { useTranslation } from "../../i18n/use-translation.js";
5
6
  import { cn } from "../../lib/utils.js";
6
7
  import {
7
8
  Dialog,
8
9
  DialogBody,
9
10
  DialogContent,
11
+ DialogFooter,
10
12
  DialogHeader,
11
13
  DialogTitle,
12
14
  DialogTrigger
@@ -23,6 +25,7 @@ import {
23
25
  import {
24
26
  Sheet,
25
27
  SheetBody,
28
+ SheetFooter,
26
29
  SheetContent,
27
30
  SheetHeader,
28
31
  SheetTrigger,
@@ -158,6 +161,7 @@ function OrgSwitcher({
158
161
  className,
159
162
  ...rest
160
163
  }) {
164
+ const { t } = useTranslation();
161
165
  const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);
162
166
  const controlled = open !== void 0;
163
167
  const resolvedOpen = controlled ? open : uncontrolledOpen;
@@ -201,6 +205,20 @@ function OrgSwitcher({
201
205
  close: () => setOpen(false)
202
206
  }
203
207
  );
208
+ const keyboardLegend = /* @__PURE__ */ jsxs("div", { className: "ui-org-switcher-legend", children: [
209
+ /* @__PURE__ */ jsxs("span", { className: "ui-org-switcher-hint", children: [
210
+ /* @__PURE__ */ jsx("kbd", { className: "kbd", "aria-hidden": "true", children: "\u2191\u2193" }),
211
+ t("layout.orgSwitcher.hintMove")
212
+ ] }),
213
+ /* @__PURE__ */ jsxs("span", { className: "ui-org-switcher-hint", children: [
214
+ /* @__PURE__ */ jsx("kbd", { className: "kbd", "aria-hidden": "true", children: "\u21B5" }),
215
+ t("layout.orgSwitcher.hintSelect")
216
+ ] }),
217
+ /* @__PURE__ */ jsxs("span", { className: "ui-org-switcher-hint", children: [
218
+ /* @__PURE__ */ jsx("kbd", { className: "kbd", "aria-hidden": "true", children: "esc" }),
219
+ t("layout.orgSwitcher.hintClose")
220
+ ] })
221
+ ] });
204
222
  if (sheet) {
205
223
  return /* @__PURE__ */ jsx("div", { className: cn("ui-org-switcher", className), "data-collapsed": collapsed || void 0, children: /* @__PURE__ */ jsxs(Sheet, { open: resolvedOpen, onOpenChange: setOpen, children: [
206
224
  /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: trigger }),
@@ -214,7 +232,8 @@ function OrgSwitcher({
214
232
  },
215
233
  children: [
216
234
  /* @__PURE__ */ jsx(SheetHeader, { title: labels.title }),
217
- /* @__PURE__ */ jsx(SheetBody, { children: panel })
235
+ /* @__PURE__ */ jsx(SheetBody, { children: panel }),
236
+ /* @__PURE__ */ jsx(SheetFooter, { children: keyboardLegend })
218
237
  ]
219
238
  }
220
239
  )
@@ -225,7 +244,8 @@ function OrgSwitcher({
225
244
  /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: trigger }),
226
245
  /* @__PURE__ */ jsxs(DialogContent, { className: "ui-org-switcher-dialog", children: [
227
246
  /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: labels.title }) }),
228
- /* @__PURE__ */ jsx(DialogBody, { children: panel })
247
+ /* @__PURE__ */ jsx(DialogBody, { children: panel }),
248
+ /* @__PURE__ */ jsx(DialogFooter, { children: keyboardLegend })
229
249
  ] })
230
250
  ] }) });
231
251
  }
@@ -242,6 +242,11 @@
242
242
  "deniedDescription": "Ask an administrator to grant you access.",
243
243
  "loading": "Loading roles…",
244
244
  "noDetail": "Select a role to see its detail"
245
+ },
246
+ "orgSwitcher": {
247
+ "hintMove": "Move",
248
+ "hintSelect": "Select",
249
+ "hintClose": "Close"
245
250
  }
246
251
  },
247
252
  "dataDisplay": {
@@ -236,6 +236,11 @@
236
236
  "deniedDescription": "閲覧するには管理者に権限の付与を依頼してください。",
237
237
  "loading": "ロールを読み込み中…",
238
238
  "noDetail": "ロールを選択すると詳細が表示されます"
239
+ },
240
+ "orgSwitcher": {
241
+ "hintMove": "移動",
242
+ "hintSelect": "選択",
243
+ "hintClose": "閉じる"
239
244
  }
240
245
  },
241
246
  "dataDisplay": {
@@ -236,6 +236,11 @@
236
236
  "deniedDescription": "Hãy đề nghị quản trị viên cấp quyền truy cập.",
237
237
  "loading": "Đang tải vai trò…",
238
238
  "noDetail": "Chọn một vai trò để xem chi tiết"
239
+ },
240
+ "orgSwitcher": {
241
+ "hintMove": "Di chuyển",
242
+ "hintSelect": "Chọn",
243
+ "hintClose": "Đóng"
239
244
  }
240
245
  },
241
246
  "dataDisplay": {
@@ -1136,6 +1136,7 @@
1136
1136
 
1137
1137
  [data-slot="dialog-content"].ui-org-switcher-dialog {
1138
1138
 
1139
+ --dialog-space-x: var(--org-switcher-sheet-inset);
1139
1140
  --dialog-space-inset: var(--dialog-space-y) var(--org-switcher-sheet-inset);
1140
1141
  --org-switcher-list-offset: var(--org-switcher-sheet-inset);
1141
1142
  max-inline-size: var(--org-switcher-dialog-width);
@@ -1171,14 +1172,38 @@
1171
1172
 
1172
1173
  .ui-org-switcher-command .ui-command-item {
1173
1174
  border-radius: 0;
1174
- margin-inline: 0;
1175
- padding-inline: var(--command-input-padding-x);
1175
+ margin-inline: calc(-1 * var(--org-switcher-list-inset));
1176
+ padding-inline: calc(var(--org-switcher-list-inset) + var(--command-input-padding-x));
1176
1177
  }
1177
1178
 
1178
1179
  .ui-org-switcher-command .ui-command-item + .ui-command-item {
1179
1180
  border-block-start: 1px solid hsl(var(--border));
1180
1181
  }
1181
1182
 
1183
+ [data-slot="dialog-footer"]:has(> .ui-org-switcher-legend),
1184
+ [data-slot="sheet-footer"]:has(> .ui-org-switcher-legend) {
1185
+ justify-content: flex-start;
1186
+ }
1187
+
1188
+ .ui-org-switcher-legend {
1189
+ display: flex;
1190
+ flex-wrap: wrap;
1191
+ align-items: center;
1192
+ gap: var(--org-switcher-legend-space-gap);
1193
+ color: hsl(var(--muted-foreground));
1194
+ font-size: var(--org-switcher-legend-font-size);
1195
+ }
1196
+
1197
+ .ui-org-switcher-hint {
1198
+ display: inline-flex;
1199
+ align-items: center;
1200
+ gap: var(--org-switcher-hint-space-gap);
1201
+ }
1202
+
1203
+ .ui-org-switcher-hint > .kbd {
1204
+ margin-inline-start: 0;
1205
+ }
1206
+
1182
1207
  .ui-org-switcher-state {
1183
1208
  display: flex;
1184
1209
  min-height: var(--org-switcher-state-min-height);
@@ -1218,14 +1243,17 @@
1218
1243
  --app-launcher-launchpad-backdrop-background,
1219
1244
  color-mix(
1220
1245
  in srgb,
1221
- var(--overlay-background) var(--app-launcher-launchpad-backdrop-alpha),
1246
+ hsl(var(--background)) var(--app-launcher-launchpad-backdrop-alpha),
1222
1247
  transparent
1223
1248
  )
1224
1249
  );
1225
- backdrop-filter: blur(var(--app-launcher-launchpad-backdrop-blur-size));
1250
+ backdrop-filter: blur(var(--app-launcher-launchpad-backdrop-blur-size))
1251
+ saturate(var(--app-launcher-launchpad-backdrop-color-saturate));
1226
1252
 
1227
1253
  display: grid;
1228
- place-items: center;
1254
+
1255
+ padding: var(--app-launcher-launchpad-space-safe-area);
1256
+ place-items: start;
1229
1257
  }
1230
1258
 
1231
1259
  [data-slot="dialog-content"].ui-app-launcher-launchpad {
@@ -1238,7 +1266,7 @@
1238
1266
  calc(100vw - 2 * var(--app-launcher-launchpad-space-inset))
1239
1267
  );
1240
1268
  max-height: calc(100dvh - 2 * var(--app-launcher-launchpad-space-inset));
1241
- justify-items: center;
1269
+ justify-items: start;
1242
1270
  transform: none;
1243
1271
  border: 0;
1244
1272
  border-radius: 0;
@@ -1286,8 +1314,7 @@
1286
1314
  var(--app-launcher-launchpad-grid-gap)
1287
1315
  ) - var(--app-launcher-launchpad-grid-gap)
1288
1316
  );
1289
- justify-content: center;
1290
- justify-self: center;
1317
+ justify-content: start;
1291
1318
  gap: var(--app-launcher-launchpad-grid-gap);
1292
1319
  }
1293
1320
 
@@ -1313,7 +1340,9 @@
1313
1340
  box-shadow: var(--app-launcher-launchpad-mark-shadow);
1314
1341
  color: hsl(var(--foreground));
1315
1342
  font-size: var(--app-launcher-launchpad-mark-font-size);
1316
- backdrop-filter: blur(var(--app-launcher-launchpad-backdrop-blur-size));
1343
+
1344
+ backdrop-filter: blur(calc(var(--app-launcher-launchpad-backdrop-blur-size) / 2))
1345
+ saturate(var(--app-launcher-launchpad-backdrop-color-saturate));
1317
1346
  }
1318
1347
 
1319
1348
  .ui-app-launcher-launchpad .ui-app-launcher-group {
@@ -1329,7 +1358,7 @@
1329
1358
  }
1330
1359
 
1331
1360
  .ui-app-launcher-launchpad [data-slot="dialog-header"] {
1332
- align-items: center;
1361
+ align-items: start;
1333
1362
  }
1334
1363
 
1335
1364
  .ui-app-launcher-launchpad [data-slot="dialog-close"] {
@@ -132,6 +132,10 @@
132
132
 
133
133
  --org-switcher-list-offset: 0px;
134
134
 
135
+ --org-switcher-legend-space-gap: var(--space-4);
136
+ --org-switcher-legend-font-size: var(--font-size-2xs);
137
+ --org-switcher-hint-space-gap: var(--space-1);
138
+
135
139
  --org-switcher-dialog-width: 26rem;
136
140
 
137
141
  --org-switcher-search-space-block: var(--space-3);
@@ -164,9 +168,14 @@
164
168
  --app-launcher-group-label-color: var(--muted-foreground);
165
169
  --app-launcher-state-min-height: 8rem;
166
170
 
167
- --app-launcher-launchpad-backdrop-blur-size: 28px;
168
- --app-launcher-launchpad-backdrop-alpha: 42%;
171
+ --app-launcher-launchpad-backdrop-background: initial;
172
+ --app-launcher-launchpad-backdrop-blur-size: 16px;
173
+ --app-launcher-launchpad-backdrop-alpha: 55%;
174
+
175
+ --app-launcher-launchpad-backdrop-color-saturate: 180%;
169
176
  --app-launcher-launchpad-space-inset: var(--space-8);
177
+
178
+ --app-launcher-launchpad-space-safe-area: 0;
170
179
  --app-launcher-launchpad-panel-max-width: 60rem;
171
180
  --app-launcher-launchpad-panel-gap: var(--space-8);
172
181
  --app-launcher-launchpad-grid-gap: var(--space-6);
@@ -184,7 +193,7 @@
184
193
 
185
194
  --app-launcher-launchpad-mark-background: color-mix(
186
195
  in srgb,
187
- hsl(var(--card)) 62%,
196
+ hsl(var(--card)) 78%,
188
197
  transparent
189
198
  );
190
199
  --app-launcher-launchpad-mark-border-color: color-mix(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@godxjp/ui",
3
- "version": "20.2.0",
4
- "godxUiMcp": "20.2.0",
3
+ "version": "20.2.1",
4
+ "godxUiMcp": "20.2.1",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",