@universe-platform/ui 0.1.0-beta.62 → 0.1.0-beta.63

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/dist/globals.css CHANGED
@@ -772,6 +772,9 @@
772
772
  .max-w-4xl {
773
773
  max-width: var(--container-4xl);
774
774
  }
775
+ .max-w-\[10rem\] {
776
+ max-width: 10rem;
777
+ }
775
778
  .max-w-\[70\%\] {
776
779
  max-width: 70%;
777
780
  }
package/dist/index.js CHANGED
@@ -6243,51 +6243,61 @@ var import_jsx_runtime14 = require("react/jsx-runtime");
6243
6243
  function RelationButtonsView({ groups, onSelect, disabled, stacked = false }) {
6244
6244
  const visible = groups.filter((g) => g.options.length > 0);
6245
6245
  if (visible.length === 0) return null;
6246
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6247
- "div",
6248
- {
6249
- className: "bg-white border border-slate-200 rounded-xl p-3 flex flex-col gap-2.5 shadow-2xs",
6250
- children: [
6251
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center justify-between gap-2 pb-2 border-b border-slate-100", children: [
6252
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-xs font-bold text-slate-800 truncate", title: group.title, children: group.title }),
6246
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => {
6247
+ const titleIsDuplicate = group.options.some(
6248
+ (opt) => opt.label.trim() === group.title.trim()
6249
+ );
6250
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6251
+ "div",
6252
+ {
6253
+ className: "bg-white border border-slate-200 rounded-xl px-3 py-2.5 shadow-2xs",
6254
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: [
6255
+ !titleIsDuplicate && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6256
+ "span",
6257
+ {
6258
+ className: "self-end h-8 inline-flex items-center text-xs font-bold text-slate-800 max-w-[10rem] truncate",
6259
+ title: group.title,
6260
+ children: group.title
6261
+ }
6262
+ ),
6263
+ group.options.map((opt) => {
6264
+ const active = group.activeId === opt.id;
6265
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col items-center gap-0.5", children: [
6266
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6267
+ "span",
6268
+ {
6269
+ className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6270
+ children: opt.count
6271
+ }
6272
+ ),
6273
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6274
+ "button",
6275
+ {
6276
+ type: "button",
6277
+ disabled,
6278
+ onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6279
+ title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6280
+ "aria-pressed": active,
6281
+ className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6282
+ children: opt.label
6283
+ }
6284
+ )
6285
+ ] }, opt.id);
6286
+ }),
6253
6287
  group.activeId ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6254
6288
  "button",
6255
6289
  {
6256
6290
  type: "button",
6257
6291
  onClick: () => onSelect(group.key, void 0),
6258
- className: "text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0",
6292
+ className: "self-end h-8 inline-flex items-center px-1 text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0 whitespace-nowrap",
6259
6293
  children: "\u05E0\u05E7\u05D4 \u05E1\u05D9\u05E0\u05D5\u05DF"
6260
6294
  }
6261
6295
  ) : null
6262
- ] }),
6263
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: group.options.map((opt) => {
6264
- const active = group.activeId === opt.id;
6265
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col items-center gap-0.5", children: [
6266
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6267
- "span",
6268
- {
6269
- className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6270
- children: opt.count
6271
- }
6272
- ),
6273
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6274
- "button",
6275
- {
6276
- type: "button",
6277
- disabled,
6278
- onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6279
- title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6280
- "aria-pressed": active,
6281
- className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6282
- children: opt.label
6283
- }
6284
- )
6285
- ] }, opt.id);
6286
- }) })
6287
- ]
6288
- },
6289
- group.key
6290
- )) });
6296
+ ] })
6297
+ },
6298
+ group.key
6299
+ );
6300
+ }) });
6291
6301
  }
6292
6302
 
6293
6303
  // src/components/TableBlock/RelationButtonsBar.tsx
package/dist/index.mjs CHANGED
@@ -6088,51 +6088,61 @@ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
6088
6088
  function RelationButtonsView({ groups, onSelect, disabled, stacked = false }) {
6089
6089
  const visible = groups.filter((g) => g.options.length > 0);
6090
6090
  if (visible.length === 0) return null;
6091
- return /* @__PURE__ */ jsx14("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => /* @__PURE__ */ jsxs12(
6092
- "div",
6093
- {
6094
- className: "bg-white border border-slate-200 rounded-xl p-3 flex flex-col gap-2.5 shadow-2xs",
6095
- children: [
6096
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-2 pb-2 border-b border-slate-100", children: [
6097
- /* @__PURE__ */ jsx14("span", { className: "text-xs font-bold text-slate-800 truncate", title: group.title, children: group.title }),
6091
+ return /* @__PURE__ */ jsx14("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => {
6092
+ const titleIsDuplicate = group.options.some(
6093
+ (opt) => opt.label.trim() === group.title.trim()
6094
+ );
6095
+ return /* @__PURE__ */ jsx14(
6096
+ "div",
6097
+ {
6098
+ className: "bg-white border border-slate-200 rounded-xl px-3 py-2.5 shadow-2xs",
6099
+ children: /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: [
6100
+ !titleIsDuplicate && /* @__PURE__ */ jsx14(
6101
+ "span",
6102
+ {
6103
+ className: "self-end h-8 inline-flex items-center text-xs font-bold text-slate-800 max-w-[10rem] truncate",
6104
+ title: group.title,
6105
+ children: group.title
6106
+ }
6107
+ ),
6108
+ group.options.map((opt) => {
6109
+ const active = group.activeId === opt.id;
6110
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center gap-0.5", children: [
6111
+ /* @__PURE__ */ jsx14(
6112
+ "span",
6113
+ {
6114
+ className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6115
+ children: opt.count
6116
+ }
6117
+ ),
6118
+ /* @__PURE__ */ jsx14(
6119
+ "button",
6120
+ {
6121
+ type: "button",
6122
+ disabled,
6123
+ onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6124
+ title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6125
+ "aria-pressed": active,
6126
+ className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6127
+ children: opt.label
6128
+ }
6129
+ )
6130
+ ] }, opt.id);
6131
+ }),
6098
6132
  group.activeId ? /* @__PURE__ */ jsx14(
6099
6133
  "button",
6100
6134
  {
6101
6135
  type: "button",
6102
6136
  onClick: () => onSelect(group.key, void 0),
6103
- className: "text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0",
6137
+ className: "self-end h-8 inline-flex items-center px-1 text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0 whitespace-nowrap",
6104
6138
  children: "\u05E0\u05E7\u05D4 \u05E1\u05D9\u05E0\u05D5\u05DF"
6105
6139
  }
6106
6140
  ) : null
6107
- ] }),
6108
- /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: group.options.map((opt) => {
6109
- const active = group.activeId === opt.id;
6110
- return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center gap-0.5", children: [
6111
- /* @__PURE__ */ jsx14(
6112
- "span",
6113
- {
6114
- className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6115
- children: opt.count
6116
- }
6117
- ),
6118
- /* @__PURE__ */ jsx14(
6119
- "button",
6120
- {
6121
- type: "button",
6122
- disabled,
6123
- onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6124
- title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6125
- "aria-pressed": active,
6126
- className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6127
- children: opt.label
6128
- }
6129
- )
6130
- ] }, opt.id);
6131
- }) })
6132
- ]
6133
- },
6134
- group.key
6135
- )) });
6141
+ ] })
6142
+ },
6143
+ group.key
6144
+ );
6145
+ }) });
6136
6146
  }
6137
6147
 
6138
6148
  // src/components/TableBlock/RelationButtonsBar.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universe-platform/ui",
3
- "version": "0.1.0-beta.62",
3
+ "version": "0.1.0-beta.63",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",