@iris-ui-kit/react 0.3.1 → 0.3.2

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.d.cts CHANGED
@@ -661,7 +661,7 @@ interface IrisCarouselProps {
661
661
  /**
662
662
  * Slide carousel: shows one child slide at a time with prev/next controls,
663
663
  * indicator dots, and keyboard (←/→) navigation. Controlled or uncontrolled.
664
- * a11y: region with `aria-roledescription="carousel"`, per-slide labelling,
664
+ * a11y: region and slides use localized role descriptions, per-slide labelling,
665
665
  * and a polite live region announcing the active slide.
666
666
  *
667
667
  * React port of {@link import('@iris-ui-kit/vue').IrisCarousel}.
package/dist/index.d.ts CHANGED
@@ -661,7 +661,7 @@ interface IrisCarouselProps {
661
661
  /**
662
662
  * Slide carousel: shows one child slide at a time with prev/next controls,
663
663
  * indicator dots, and keyboard (←/→) navigation. Controlled or uncontrolled.
664
- * a11y: region with `aria-roledescription="carousel"`, per-slide labelling,
664
+ * a11y: region and slides use localized role descriptions, per-slide labelling,
665
665
  * and a polite live region announcing the active slide.
666
666
  *
667
667
  * React port of {@link import('@iris-ui-kit/vue').IrisCarousel}.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  export { createUndoStack, useUndoStack } from './chunk-CYQO33XH.js';
3
- import { useGridCore, useGridColumns, toGridColumnsOptions, toGridRowsOptions, useGridRows, useGridSorting, toGridSortingOptions, useGridSelection, toGridSelectionOptions, useGridExpansion, toGridExpansionOptions, useGridEditing, useGridFiltering, toGridFilteringOptions, useGridRange, useGridClipboard, useGridVirtual, useGridPagination, toGridPaginationOptions } from './chunk-3772LKJP.js';
4
- export { toGridColumnsOptions, toGridExpansionOptions, toGridFilteringOptions, toGridPaginationOptions, toGridRowsOptions, toGridSelectionOptions, toGridSortingOptions, useGridClipboard, useGridColumns, useGridCore, useGridEditing, useGridExpansion, useGridFiltering, useGridPagination, useGridRange, useGridRows, useGridSelection, useGridSorting, useGridVirtual } from './chunk-3772LKJP.js';
3
+ import { useGridCore, useGridColumns, toGridColumnsOptions, toGridRowsOptions, useGridRows, useGridSorting, toGridSortingOptions, useGridSelection, toGridSelectionOptions, useGridExpansion, toGridExpansionOptions, useGridEditing, useGridFiltering, toGridFilteringOptions, useGridRange, useGridClipboard, useGridVirtual, useGridPagination, toGridPaginationOptions } from './chunk-JANOOAZ5.js';
4
+ export { toGridColumnsOptions, toGridExpansionOptions, toGridFilteringOptions, toGridPaginationOptions, toGridRowsOptions, toGridSelectionOptions, toGridSortingOptions, useGridClipboard, useGridColumns, useGridCore, useGridEditing, useGridExpansion, useGridFiltering, useGridPagination, useGridRange, useGridRows, useGridSelection, useGridSorting, useGridVirtual } from './chunk-JANOOAZ5.js';
5
5
  export { IrisGrid } from './chunk-7ILMMLK6.js';
6
6
  import { useBodyScrollLock, useFocusTrap } from './chunk-4VPCQ3U4.js';
7
7
  export { __getBodyScrollLockCount, __resetBodyScrollLock, useBodyScrollLock, useFocusTrap } from './chunk-4VPCQ3U4.js';
@@ -10,11 +10,11 @@ export { DATA_STATE_CLASS, __resetDataStateStyles, installDataStateStyles, useDa
10
10
  export { IrisProvider, PluginStoreContext, usePlugin, usePluginStore } from './chunk-IDD35UJ6.js';
11
11
  export { SkinProvider, SkinResolutionError, applySkin, builtinSkins, createSkinCatalog, createSkinEngine, createSkinRegistry, darkSkin, lightSkin, loadSkin, localStorageSkinStorage, memorySkinStorage, renderSkinStyle, resolveSkin, skinBootScript, skinError, skinToCssEntries, useSkin, useSkinContext, useSkinOptional, validateSkin } from './chunk-WIHBIDVJ.js';
12
12
  export { createClientFetcher, createResourceController, useResourceController } from './chunk-TQ33XJIK.js';
13
- import { IrisButton, IrisCheckbox, IrisFormField, IrisInput } from './chunk-QKDOW7FG.js';
14
- export { IrisAlert, IrisButton, IrisCheckbox, IrisDashboardTemplate, IrisDivider, IrisFormField, IrisInput, IrisLoginTemplate, IrisPasswordInput } from './chunk-QKDOW7FG.js';
13
+ import { IrisButton, IrisCheckbox, IrisFormField, IrisInput } from './chunk-EB5VUIPA.js';
14
+ export { IrisAlert, IrisButton, IrisCheckbox, IrisDashboardTemplate, IrisDivider, IrisFormField, IrisInput, IrisLoginTemplate, IrisPasswordInput } from './chunk-EB5VUIPA.js';
15
15
  export { IrisContainer, IrisDashboardCard, IrisDashboardGrid, IrisStack } from './chunk-ZKBDUWUD.js';
16
- import { IrisSlot, useMachine } from './chunk-TDVRIHE6.js';
17
- export { DropdownContext, IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisBreadcrumb, IrisBreadcrumbItem, IrisDropdown, IrisDropdownItem, IrisDropdownMenu, IrisDropdownSeparator, IrisDropdownTrigger, IrisIcon, IrisNavMenu, IrisSlot, createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, useAdminPreferences, useAdminShell, useDropdownContext, useMachine, useTabsNav, visibleNav } from './chunk-TDVRIHE6.js';
16
+ import { IrisSlot, useMachine } from './chunk-2Z45RXJA.js';
17
+ export { DropdownContext, IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisBreadcrumb, IrisBreadcrumbItem, IrisDropdown, IrisDropdownItem, IrisDropdownMenu, IrisDropdownSeparator, IrisDropdownTrigger, IrisIcon, IrisNavMenu, IrisSlot, createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, useAdminPreferences, useAdminShell, useDropdownContext, useMachine, useTabsNav, visibleNav } from './chunk-2Z45RXJA.js';
18
18
  export { ThemeProvider, useColorScheme, useDirection, useTheme, useThemeContext, useThemeOptional } from './chunk-XCK4RIXB.js';
19
19
  export { IrisHeaderLayout, IrisSidebarLayout } from './chunk-J5FB2UB2.js';
20
20
  export { useAsyncResource, usePaginatedResource } from './chunk-3KYNBLRY.js';
@@ -2167,7 +2167,7 @@ function IrisCarousel({
2167
2167
  {
2168
2168
  "data-iris-carousel": "",
2169
2169
  role: "group",
2170
- "aria-roledescription": "carousel",
2170
+ "aria-roledescription": t("carousel.roleDescription"),
2171
2171
  "aria-label": ariaLabel ?? t("carousel.label"),
2172
2172
  tabIndex: 0,
2173
2173
  className,
@@ -2203,7 +2203,7 @@ function IrisCarousel({
2203
2203
  "data-iris-carousel-slide": "",
2204
2204
  "data-active": i === current ? "true" : void 0,
2205
2205
  role: "group",
2206
- "aria-roledescription": "slide",
2206
+ "aria-roledescription": t("carousel.slideRoleDescription"),
2207
2207
  "aria-label": t("carousel.slide", { index: i + 1, total: count }),
2208
2208
  "aria-hidden": i !== current ? "true" : void 0,
2209
2209
  style: { flex: "0 0 100%", width: "100%", minWidth: 0 },
@@ -12057,7 +12057,8 @@ function ColumnResizeHandle({
12057
12057
  maxWidth,
12058
12058
  onResize,
12059
12059
  onAutoFit,
12060
- widthHint = false
12060
+ widthHint = false,
12061
+ t
12061
12062
  }) {
12062
12063
  const ref = React93.useRef(null);
12063
12064
  const startRef = React93.useRef(0);
@@ -12083,7 +12084,7 @@ function ColumnResizeHandle({
12083
12084
  ref,
12084
12085
  role: "separator",
12085
12086
  "aria-orientation": "vertical",
12086
- "aria-label": `Resize ${label}`,
12087
+ "aria-label": t("table.resizeColumn", { column: label }),
12087
12088
  tabIndex: 0,
12088
12089
  "data-iris-table-resize-handle": "",
12089
12090
  "data-column-key": colKey,
@@ -12145,7 +12146,8 @@ function PinnedDragHandle({
12145
12146
  colKey,
12146
12147
  label,
12147
12148
  resolve: resolve4,
12148
- commit
12149
+ commit,
12150
+ t
12149
12151
  }) {
12150
12152
  const ref = React93.useRef(null);
12151
12153
  const [dx, setDx] = React93.useState(0);
@@ -12165,7 +12167,7 @@ function PinnedDragHandle({
12165
12167
  ref,
12166
12168
  role: "separator",
12167
12169
  "aria-orientation": "vertical",
12168
- "aria-label": `Adjust pinned column count at ${label}`,
12170
+ "aria-label": t("table.resizePinned", { column: label }),
12169
12171
  tabIndex: 0,
12170
12172
  "data-iris-pinned-drag-handle": "",
12171
12173
  "data-column-key": colKey,
@@ -12469,6 +12471,12 @@ function useTableColumns(options) {
12469
12471
  () => applyColumnOrder(detectedColumns, options.columnOrder),
12470
12472
  [detectedColumns, options.columnOrder]
12471
12473
  );
12474
+ const visibilitySignature = JSON.stringify(
12475
+ Object.keys(options.columnVisibility ?? {}).map((key) => [
12476
+ key,
12477
+ options.columnVisibility?.[key]
12478
+ ])
12479
+ );
12472
12480
  const displayColumns = React93.useMemo(() => {
12473
12481
  let cols = orderedColumns;
12474
12482
  cols = applyColumnVisibility(cols, options.columnVisibility);
@@ -12476,7 +12484,7 @@ function useTableColumns(options) {
12476
12484
  cols = cols.filter((col) => col.visibleMethod ? col.visibleMethod() !== false : true);
12477
12485
  }
12478
12486
  return cols;
12479
- }, [orderedColumns, options.columnVisibility]);
12487
+ }, [orderedColumns, visibilitySignature]);
12480
12488
  const responsiveLeadingWidth = (options.rowDrag ? DRAG_COL_WIDTH : 0) + (options.showRowNumbers ? SEQ_COL_WIDTH : 0) + (hasDetail ? EXPAND_COL_WIDTH : 0) + (options.selectable !== "none" ? SELECTION_COL_WIDTH : 0);
12481
12489
  const responsiveResult = React93.useMemo(() => {
12482
12490
  if (!options.responsive) return { columns: displayColumns, overflow: false };
@@ -13777,7 +13785,10 @@ function FlatTableHeader(props) {
13777
13785
  "span",
13778
13786
  {
13779
13787
  "data-iris-header-stats": "",
13780
- "aria-label": `count ${headerStatsByKey[col.key].count}, average ${headerStatsByKey[col.key].average.toFixed(2)}`,
13788
+ "aria-label": t("table.headerStats", {
13789
+ count: String(headerStatsByKey[col.key].count),
13790
+ average: headerStatsByKey[col.key].average.toFixed(2)
13791
+ }),
13781
13792
  style: {
13782
13793
  marginInlineStart: "var(--iris-space-xxs, 4px)",
13783
13794
  fontSize: "var(--iris-font-size-xs, 12px)",
@@ -13785,7 +13796,10 @@ function FlatTableHeader(props) {
13785
13796
  fontWeight: 400,
13786
13797
  whiteSpace: "nowrap"
13787
13798
  },
13788
- children: `n=${headerStatsByKey[col.key].count} \xB7 avg=${headerStatsByKey[col.key].average.toFixed(2)}`
13799
+ children: t("table.headerStatsShort", {
13800
+ count: String(headerStatsByKey[col.key].count),
13801
+ average: headerStatsByKey[col.key].average.toFixed(2)
13802
+ })
13789
13803
  }
13790
13804
  ) : null,
13791
13805
  showCellRefs ? /* @__PURE__ */ jsx(
@@ -13843,7 +13857,8 @@ function FlatTableHeader(props) {
13843
13857
  colKey: col.key,
13844
13858
  label: col.title,
13845
13859
  resolve: resolvePinnedCount,
13846
- commit: commitPinnedCount
13860
+ commit: commitPinnedCount,
13861
+ t
13847
13862
  }
13848
13863
  ) : null,
13849
13864
  resizableColumns && !(pinnedBoundaryCol && pinnedBoundaryCol.key === col.key) ? /* @__PURE__ */ jsx(
@@ -13856,6 +13871,7 @@ function FlatTableHeader(props) {
13856
13871
  maxWidth: col.maxWidth ?? Infinity,
13857
13872
  onResize: setColumnWidth,
13858
13873
  widthHint,
13874
+ t,
13859
13875
  onAutoFit: autoResizeColumns ? () => onAutoFitColumn?.(col) : void 0
13860
13876
  }
13861
13877
  ) : null
@@ -14069,7 +14085,10 @@ function GroupedTableHeader(props) {
14069
14085
  "span",
14070
14086
  {
14071
14087
  "data-iris-header-stats": "",
14072
- "aria-label": `count ${headerStatsByKey[col.key].count}, average ${headerStatsByKey[col.key].average.toFixed(2)}`,
14088
+ "aria-label": t("table.headerStats", {
14089
+ count: String(headerStatsByKey[col.key].count),
14090
+ average: headerStatsByKey[col.key].average.toFixed(2)
14091
+ }),
14073
14092
  style: {
14074
14093
  marginInlineStart: "var(--iris-space-xxs, 4px)",
14075
14094
  fontSize: "var(--iris-font-size-xs, 12px)",
@@ -14077,7 +14096,10 @@ function GroupedTableHeader(props) {
14077
14096
  fontWeight: 400,
14078
14097
  whiteSpace: "nowrap"
14079
14098
  },
14080
- children: `n=${headerStatsByKey[col.key].count} \xB7 avg=${headerStatsByKey[col.key].average.toFixed(2)}`
14099
+ children: t("table.headerStatsShort", {
14100
+ count: String(headerStatsByKey[col.key].count),
14101
+ average: headerStatsByKey[col.key].average.toFixed(2)
14102
+ })
14081
14103
  }
14082
14104
  ) : null,
14083
14105
  showCellRefs && isLeaf ? /* @__PURE__ */ jsx(
@@ -14135,7 +14157,8 @@ function GroupedTableHeader(props) {
14135
14157
  colKey: col.key,
14136
14158
  label: col.title,
14137
14159
  resolve: resolvePinnedCount,
14138
- commit: commitPinnedCount
14160
+ commit: commitPinnedCount,
14161
+ t
14139
14162
  }
14140
14163
  ) : null
14141
14164
  ]
@@ -14971,7 +14994,7 @@ function TableViews({
14971
14994
  {
14972
14995
  "data-iris-table-views": "",
14973
14996
  value: saveOpen ? SAVE_ITEM_VALUE : activeKey ?? "",
14974
- "aria-label": t("table.views.placeholder"),
14997
+ "aria-label": t("table.views.label"),
14975
14998
  onChange: (e) => {
14976
14999
  const v = e.target.value;
14977
15000
  if (v === SAVE_ITEM_VALUE) {
@@ -15797,18 +15820,19 @@ function IrisTable({
15797
15820
  ...row,
15798
15821
  children
15799
15822
  });
15800
- const { rows: liveData, model: rowsModel } = useGridRows(
15823
+ const { rows: liveDataSnapshot, model: rowsModel } = useGridRows(
15801
15824
  gridCore,
15802
15825
  legacyRows.initialRows,
15803
15826
  {
15804
15827
  ...legacyRows.options,
15805
- // Keep the legacy no-`keepSource` seed identity while the core feature
15806
- // defaults to defensive ownership for standalone consumers.
15828
+ // keepSource copies the seed; without it, preserve the legacy adapter
15829
+ // contract by reading Core's source-reference state during render.
15807
15830
  cloneDefaultRows: keepSource === true,
15808
15831
  getChildren: getSubRows !== void 0 || lazyLoad !== void 0 ? readRowChildren : void 0,
15809
15832
  setChildren: writeLazyChildren
15810
15833
  }
15811
15834
  );
15835
+ const liveData = keepSource ? liveDataSnapshot : rowsModel.get();
15812
15836
  const { pagination, setPage, setPageSize } = useTablePagination(
15813
15837
  gridCore,
15814
15838
  proxy ? proxyState : null,
@@ -22251,6 +22275,7 @@ function TreeNodeView({
22251
22275
  selectNode,
22252
22276
  toggleExpand
22253
22277
  }) {
22278
+ const { t } = useI18n();
22254
22279
  const { node, depth, hasChildren } = flatNode;
22255
22280
  const isExpanded = expanded.has(node.id);
22256
22281
  const isSelected = selected.has(node.id);
@@ -22298,7 +22323,7 @@ function TreeNodeView({
22298
22323
  "button",
22299
22324
  {
22300
22325
  type: "button",
22301
- "aria-label": isExpanded ? "Collapse" : "Expand",
22326
+ "aria-label": isExpanded ? t("treeSelect.collapse") : t("treeSelect.expand"),
22302
22327
  "data-iris-tree-toggle": "",
22303
22328
  onClick: (event) => {
22304
22329
  event.stopPropagation();