@flytedan/flytebot-design-system 0.12.6 → 0.12.8

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/index.cjs CHANGED
@@ -185,6 +185,7 @@ __export(index_exports, {
185
185
  meterFormats: () => meterFormats,
186
186
  modifierLabel: () => modifierLabel,
187
187
  pastedTextName: () => pastedTextName,
188
+ pluralizeUnit: () => pluralizeUnit,
188
189
  preferenceScore: () => preferenceScore,
189
190
  preferenceSegments: () => preferenceSegments,
190
191
  rangeFilter: () => rangeFilter,
@@ -2355,6 +2356,10 @@ function Meter({ segments = [], unallocated = 0, height = 8, label, legend = fal
2355
2356
 
2356
2357
  // src/components/data/Pagination.tsx
2357
2358
  var import_jsx_runtime33 = require("react/jsx-runtime");
2359
+ var unitPluralRules = new Intl.PluralRules("en-US");
2360
+ function pluralizeUnit(n, singular, irregularPlural) {
2361
+ return unitPluralRules.select(n) === "one" ? singular : irregularPlural ?? `${singular}s`;
2362
+ }
2358
2363
  function Pagination({
2359
2364
  page = 1,
2360
2365
  pageSize = 25,
@@ -2363,7 +2368,8 @@ function Pagination({
2363
2368
  onPageChange,
2364
2369
  onPageSizeChange,
2365
2370
  loading = false,
2366
- unit = "rows",
2371
+ unit = "row",
2372
+ unitPlural,
2367
2373
  className = "",
2368
2374
  ...rest
2369
2375
  }) {
@@ -2373,6 +2379,7 @@ function Pagination({
2373
2379
  const go = (p) => {
2374
2380
  if (onPageChange && p >= 1 && p <= totalPages && p !== page) onPageChange(p);
2375
2381
  };
2382
+ const unitLabel = pluralizeUnit(total, unit, unitPlural);
2376
2383
  const nums = [];
2377
2384
  const span = 1;
2378
2385
  for (let i = 1; i <= totalPages; i++) {
@@ -2382,7 +2389,7 @@ function Pagination({
2382
2389
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: ["fd-pag", className].filter(Boolean).join(" "), ...rest, children: [
2383
2390
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "fd-pag-count", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "inline-block", height: 12, width: 108 } }) : total === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
2384
2391
  "No ",
2385
- unit
2392
+ unitLabel
2386
2393
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
2387
2394
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("strong", { children: [
2388
2395
  from.toLocaleString(),
@@ -2392,7 +2399,7 @@ function Pagination({
2392
2399
  " of ",
2393
2400
  total.toLocaleString(),
2394
2401
  " ",
2395
- unit
2402
+ unitLabel
2396
2403
  ] }) }),
2397
2404
  onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "fd-pag-size", children: [
2398
2405
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "Rows" }),
@@ -8107,6 +8114,7 @@ function FeatureGate({
8107
8114
  if (!preview) return fallback;
8108
8115
  const f = SessionKit.findFlag(flag) || {};
8109
8116
  const missing = rt.missing || [];
8117
+ const canBypass = bypassPerm === null ? false : !bypassPerm || SessionKit.can(bypassPerm);
8110
8118
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
8111
8119
  ComingSoon,
8112
8120
  {
@@ -8120,7 +8128,7 @@ function FeatureGate({
8120
8128
  minHeight,
8121
8129
  onRoadmap,
8122
8130
  bypassKey: flag,
8123
- canBypass: !bypassPerm || SessionKit.can(bypassPerm),
8131
+ canBypass,
8124
8132
  children
8125
8133
  }
8126
8134
  );
@@ -10830,6 +10838,7 @@ function createVersionStore(initialState, options) {
10830
10838
  meterFormats,
10831
10839
  modifierLabel,
10832
10840
  pastedTextName,
10841
+ pluralizeUnit,
10833
10842
  preferenceScore,
10834
10843
  preferenceSegments,
10835
10844
  rangeFilter,