@vygruppen/spor-react 12.23.0 → 12.24.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.23.0 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.24.0 build /home/runner/work/spor/spor/packages/spor-react
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx, src/icons/index.tsx
@@ -11,17 +11,17 @@ CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
13
  DTS Build start
14
+ ESM dist/index.mjs 330.53 KB
14
15
  ESM dist/icons/index.mjs 110.00 B
15
- ESM dist/index.mjs 330.04 KB
16
+ ESM dist/index.mjs.map 700.07 KB
16
17
  ESM dist/icons/index.mjs.map 157.00 B
17
- ESM dist/index.mjs.map 699.16 KB
18
- ESM ⚡️ Build success in 2774ms
19
- CJS dist/index.cjs 353.93 KB
18
+ ESM ⚡️ Build success in 2926ms
19
+ CJS dist/index.cjs 354.42 KB
20
20
  CJS dist/icons/index.cjs 381.00 B
21
- CJS dist/index.cjs.map 699.16 KB
21
+ CJS dist/index.cjs.map 700.07 KB
22
22
  CJS dist/icons/index.cjs.map 157.00 B
23
- CJS ⚡️ Build success in 2775ms
24
- DTS ⚡️ Build success in 21345ms
23
+ CJS ⚡️ Build success in 2927ms
24
+ DTS ⚡️ Build success in 22676ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
26
  DTS dist/index.d.ts 147.69 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
@@ -1,8 +1,8 @@
1
1
 
2
- > @vygruppen/spor-react@12.23.0 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.24.0 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
- [dotenv@17.2.3] injecting env (0) from .env -- tip: 🔄 add secrets lifecycle management: https://dotenvx.com/ops
5
+ [dotenv@17.2.3] injecting env (0) from .env -- tip: ⚙️ override existing env vars with { override: true }
6
6
  ┌ Chakra CLI ⚡️
7
7
  [?25l│
8
8
  ◒ Generating conditions types...
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 12.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5afeedd: Updated the Table sortable styling
8
+
9
+ ### Patch Changes
10
+
11
+ - @vygruppen/spor-icon-react@4.5.1
12
+
3
13
  ## 12.23.0
4
14
 
5
15
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -6281,11 +6281,13 @@ var TabsList = react.Tabs.List;
6281
6281
  var TabsTrigger = react.Tabs.Trigger;
6282
6282
  var TabsIndicator = react.Tabs.Indicator;
6283
6283
  var TabsContent = react.Tabs.Content;
6284
- var getNextSortState = (current, key, columnIndex) => ({
6285
- key,
6286
- columnIndex,
6287
- direction: current.key === key && current.direction === "asc" ? "desc" : "asc"
6288
- });
6284
+ var getNextSortState = (current, key, columnIndex) => {
6285
+ if (current.key !== key)
6286
+ return { key, columnIndex, direction: "asc" };
6287
+ if (current.direction === "asc")
6288
+ return { key, columnIndex, direction: "desc" };
6289
+ return { key: null, direction: "asc", columnIndex: null };
6290
+ };
6289
6291
  var getSortKey = (children) => typeof children === "string" ? children.trim() : null;
6290
6292
  var getColumnIndex = (element) => {
6291
6293
  var _a5;
@@ -6357,28 +6359,35 @@ var Table = React20.forwardRef(
6357
6359
  }
6358
6360
  );
6359
6361
  Table.displayName = "Table";
6360
- var TableColumnHeader = React20.forwardRef(({ children, onClick, ...rest }, ref) => {
6362
+ var TableColumnHeader = React20.forwardRef(({ children, ...rest }, ref) => {
6361
6363
  const { enabled, sortState, onSort } = useTableSort();
6362
6364
  const key = getSortKey(children);
6363
- const isActive = enabled && key != null && key === sortState.key;
6364
- return /* @__PURE__ */ jsxRuntime.jsx(
6365
- react.Table.ColumnHeader,
6366
- {
6367
- ref,
6368
- onClick: (event) => {
6369
- if (enabled && key) {
6370
- onSort(key, getColumnIndex(event.currentTarget));
6371
- }
6372
- onClick == null ? void 0 : onClick(event);
6373
- },
6374
- cursor: enabled && key ? "pointer" : void 0,
6375
- ...rest,
6376
- children: /* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { children: [
6377
- children,
6378
- isActive && (sortState.direction === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(spor_icon_react_star.DropdownUpFill18Icon, {}) : /* @__PURE__ */ jsxRuntime.jsx(spor_icon_react_star.DropdownDownFill18Icon, {}))
6379
- ] })
6380
- }
6381
- );
6365
+ const props = rest;
6366
+ const columnSortable = enabled && key != null && !("data-nosort" in props);
6367
+ const isActive = columnSortable && key === sortState.key;
6368
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Table.ColumnHeader, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { children: [
6369
+ children,
6370
+ columnSortable && /* @__PURE__ */ jsxRuntime.jsx(
6371
+ react.Button,
6372
+ {
6373
+ variant: "ghost",
6374
+ onClick: (event) => {
6375
+ const th = event.currentTarget.closest("th");
6376
+ if (th)
6377
+ onSort(key, getColumnIndex(th));
6378
+ },
6379
+ p: "0px !important",
6380
+ size: "xs",
6381
+ children: isActive ? sortState.direction === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(spor_icon_react_star.ArrowUpFill18Icon, { color: "outline.focus" }) : /* @__PURE__ */ jsxRuntime.jsx(spor_icon_react_star.ArrowDownFill18Icon, { color: "outline.focus" }) : /* @__PURE__ */ jsxRuntime.jsx(
6382
+ spor_icon_react_star.ChangeDirectionFill18Icon,
6383
+ {
6384
+ transform: "rotate(90deg)",
6385
+ color: "icon.disabled"
6386
+ }
6387
+ )
6388
+ }
6389
+ )
6390
+ ] }) });
6382
6391
  });
6383
6392
  TableColumnHeader.displayName = "ColumnHeader";
6384
6393
  var TableRow = React20.forwardRef(