@veeqo/transfigure 1.2.0 → 1.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.
Files changed (107) hide show
  1. package/dist/constants/viewConstants.d.ts +2 -0
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.js +16 -14
  4. package/dist/index100.cjs +1 -1
  5. package/dist/index100.js +32 -14
  6. package/dist/index101.cjs +1 -19
  7. package/dist/index101.js +28 -23
  8. package/dist/index102.cjs +12 -1
  9. package/dist/index102.js +16 -24
  10. package/dist/index103.cjs +1 -12
  11. package/dist/index103.js +15 -16
  12. package/dist/index104.cjs +1 -80
  13. package/dist/index104.js +24 -101
  14. package/dist/index105.cjs +1 -1
  15. package/dist/index105.js +7 -2
  16. package/dist/index106.cjs +80 -1
  17. package/dist/index106.js +101 -19
  18. package/dist/index107.cjs +1 -1
  19. package/dist/index107.js +2 -8
  20. package/dist/index108.cjs +1 -1
  21. package/dist/index108.js +17 -62
  22. package/dist/index109.cjs +1 -1
  23. package/dist/index109.js +7 -29
  24. package/dist/index11.cjs +1 -1
  25. package/dist/index11.js +1 -1
  26. package/dist/index110.cjs +1 -13
  27. package/dist/index110.js +63 -16
  28. package/dist/index111.cjs +1 -1
  29. package/dist/index111.js +29 -25
  30. package/dist/index112.cjs +13 -1
  31. package/dist/index112.js +14 -33
  32. package/dist/index113.cjs +1 -7
  33. package/dist/index113.js +26 -10
  34. package/dist/index114.cjs +1 -1
  35. package/dist/index114.js +35 -62
  36. package/dist/index115.cjs +7 -1
  37. package/dist/index115.js +10 -47
  38. package/dist/index116.cjs +1 -0
  39. package/dist/index116.js +65 -0
  40. package/dist/index117.cjs +1 -0
  41. package/dist/index117.js +49 -0
  42. package/dist/index17.cjs +1 -1
  43. package/dist/index17.js +1 -1
  44. package/dist/index22.cjs +1 -1
  45. package/dist/index22.js +1 -1
  46. package/dist/index31.cjs +1 -1
  47. package/dist/index31.js +1 -1
  48. package/dist/index34.cjs +1 -1
  49. package/dist/index34.js +1 -1
  50. package/dist/index36.cjs +1 -1
  51. package/dist/index36.js +2 -2
  52. package/dist/index39.cjs +1 -1
  53. package/dist/index39.js +1 -1
  54. package/dist/index41.cjs +1 -1
  55. package/dist/index41.js +1 -1
  56. package/dist/index42.cjs +1 -1
  57. package/dist/index42.js +1 -1
  58. package/dist/index44.cjs +1 -1
  59. package/dist/index44.js +1 -1
  60. package/dist/index62.cjs +1 -1
  61. package/dist/index62.js +31 -49
  62. package/dist/index7.cjs +1 -1
  63. package/dist/index7.js +4 -4
  64. package/dist/index80.cjs +1 -1
  65. package/dist/index80.js +20 -6
  66. package/dist/index81.cjs +1 -1
  67. package/dist/index81.js +7 -2
  68. package/dist/index82.cjs +1 -1
  69. package/dist/index82.js +2 -9
  70. package/dist/index83.cjs +1 -3
  71. package/dist/index83.js +8 -13
  72. package/dist/index84.cjs +3 -1
  73. package/dist/index84.js +13 -8
  74. package/dist/index85.cjs +1 -1
  75. package/dist/index85.js +8 -4
  76. package/dist/index88.cjs +1 -1
  77. package/dist/index88.js +7 -7
  78. package/dist/index90.cjs +1 -1
  79. package/dist/index90.js +5 -13
  80. package/dist/index91.cjs +1 -104
  81. package/dist/index91.js +13 -120
  82. package/dist/index92.cjs +104 -1
  83. package/dist/index92.js +117 -65
  84. package/dist/index93.cjs +1 -1
  85. package/dist/index93.js +63 -24
  86. package/dist/index94.cjs +1 -1
  87. package/dist/index94.js +29 -2
  88. package/dist/index95.cjs +1 -1
  89. package/dist/index95.js +2 -41
  90. package/dist/index96.cjs +1 -1
  91. package/dist/index96.js +39 -9
  92. package/dist/index97.cjs +1 -1
  93. package/dist/index97.js +9 -31
  94. package/dist/index98.cjs +19 -1
  95. package/dist/index98.js +23 -28
  96. package/dist/index99.cjs +1 -1
  97. package/dist/index99.js +1 -1
  98. package/dist/mocks/createMockTransformedView.d.ts +2 -0
  99. package/dist/mocks/createMockView.d.ts +2 -0
  100. package/dist/storybookHelpers/apiMocks/views/mockSeededAllView.d.ts +26 -0
  101. package/dist/types.d.ts +5 -0
  102. package/dist/utils/index.d.ts +1 -0
  103. package/dist/utils/organiseViews/index.d.ts +1 -0
  104. package/dist/utils/organiseViews/organiseViews.d.ts +18 -0
  105. package/dist/utils/organiseViews/organiseViews.test.d.ts +1 -0
  106. package/package.json +1 -1
  107. /package/dist/storybookHelpers/apiMocks/{custom_views.d.ts → views/custom_views.d.ts} +0 -0
package/dist/index98.js CHANGED
@@ -1,31 +1,26 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Modal as n, Text as r } from "@veeqo/ui";
3
- const s = ({ shouldShow: a, viewName: i, onCancel: t, onDelete: o }) => /* @__PURE__ */ e(
4
- n,
5
- {
6
- headerTitle: `Delete '${i}' view?`,
7
- "data-testid": "act-react-listing-custom-confirmation-popup",
8
- variant: "sm",
9
- shouldShow: a,
10
- onClose: t,
11
- rightActions: [
12
- {
13
- className: "act-react-listing-custom-confirmation-popup-cancel",
14
- label: "Cancel",
15
- onClick: t,
16
- variant: "default"
17
- },
18
- {
19
- className: "act-react-listing-custom-confirmation-popup-delete",
20
- label: "Delete",
21
- onClick: o,
22
- variant: "primaryDestructive"
23
- }
24
- ],
25
- showHeaderCloseButton: !0,
26
- children: /* @__PURE__ */ e(r, { variant: "body", children: "This cannot be undone." })
1
+ import t from "styled-components";
2
+ import { theme as o, Card as r, Button as e } from "@veeqo/ui";
3
+ const n = t(e).attrs(() => ({ role: "option", variant: "flat" }))`
4
+ margin: ${o.sizes.xs};
5
+ min-width: 180px;
6
+ justify-content: flex-start;
7
+ font-size: ${o.text.body.fontSize};
8
+
9
+ &:hover {
10
+ background-color: ${o.colors.neutral.grey.lightest};
11
+ color: ${o.colors.secondary.blue.base};
12
+ cursor: pointer;
27
13
  }
28
- );
14
+ `, a = t(r.Surface).attrs(() => ({ role: "listbox", elevation: 4 }))`
15
+ margin-top: ${o.sizes.xs};
16
+ background-color: white;
17
+ `, l = t.hr`
18
+ width: 100%;
19
+ border-top: 1px solid ${o.colors.neutral.grey.dark};
20
+ margin: 0;
21
+ `;
29
22
  export {
30
- s as Confirmation
23
+ l as Divider,
24
+ n as Item,
25
+ a as MenuItems
31
26
  };
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),i=require("./index104.cjs"),n=r.theme.colors.secondary.blue.base,a=({onClick:t})=>e.jsx(i.Notification,{children:e.jsx(i.Pill,{children:e.jsxs(r.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.Glyph,{ariaLabel:"info",name:"info",color:n}),e.jsxs(i.Wrap,{children:[e.jsx(i.Text,{variant:"body",margin:"0 4px 0 0",children:"You are currently in a"}),e.jsx(i.Bold,{variant:"bodyBoldDark",children:"draft view"}),e.jsx(i.Hint,{variant:"hintText",children:"Apply filters and save these by creating a custom view"})]}),e.jsx(i.Button,{variant:"primary",onClick:t,size:"sm",children:"Create view"})]})})});exports.DraftPill=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),i=require("./index106.cjs"),n=r.theme.colors.secondary.blue.base,a=({onClick:t})=>e.jsx(i.Notification,{children:e.jsx(i.Pill,{children:e.jsxs(r.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.Glyph,{ariaLabel:"info",name:"info",color:n}),e.jsxs(i.Wrap,{children:[e.jsx(i.Text,{variant:"body",margin:"0 4px 0 0",children:"You are currently in a"}),e.jsx(i.Bold,{variant:"bodyBoldDark",children:"draft view"}),e.jsx(i.Hint,{variant:"hintText",children:"Apply filters and save these by creating a custom view"})]}),e.jsx(i.Button,{variant:"primary",onClick:t,size:"sm",children:"Create view"})]})})});exports.DraftPill=a;
package/dist/index99.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
2
  import { Stack as a, theme as n } from "@veeqo/ui";
3
- import { Notification as t, Pill as o, Glyph as l, Wrap as c, Text as d, Bold as s, Hint as h, Button as m } from "./index104.js";
3
+ import { Notification as t, Pill as o, Glyph as l, Wrap as c, Text as d, Bold as s, Hint as h, Button as m } from "./index106.js";
4
4
  const p = n.colors.secondary.blue.base, b = ({ onClick: e }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ i(a, { direction: "horizontal", alignY: "center", children: [
5
5
  /* @__PURE__ */ r(l, { ariaLabel: "info", name: "info", color: p }),
6
6
  /* @__PURE__ */ i(c, { children: [
@@ -0,0 +1,2 @@
1
+ import { TransformedView } from 'src/types';
2
+ export declare const createMockTransformedView: (overrides?: Partial<TransformedView>) => TransformedView;
@@ -0,0 +1,2 @@
1
+ import { View } from 'src/types';
2
+ export declare const createMockView: (overrides?: Partial<View>) => View;
@@ -0,0 +1,26 @@
1
+ export declare const MOCK_SEEDED_ALL_VIEW: {
2
+ id: string;
3
+ type: string;
4
+ attributes: {
5
+ title: string;
6
+ filters: {
7
+ filter: {};
8
+ };
9
+ columns: {
10
+ columnIds: string[];
11
+ };
12
+ shared: boolean;
13
+ created_at: string;
14
+ updated_at: string;
15
+ editable: boolean;
16
+ type: string;
17
+ };
18
+ relationships: {
19
+ user: {
20
+ data: {
21
+ id: string;
22
+ type: string;
23
+ };
24
+ };
25
+ };
26
+ };
package/dist/types.d.ts CHANGED
@@ -108,4 +108,9 @@ export type TransformedView = {
108
108
  originalView?: TransformedView;
109
109
  columns: ViewColumns;
110
110
  };
111
+ export type ViewsState = {
112
+ fixedViews: TransformedView[];
113
+ customViews: TransformedView[];
114
+ viewsMap: Map<string, TransformedView>;
115
+ };
111
116
  export {};
@@ -3,3 +3,4 @@ export * from './getFetcherFunction';
3
3
  export * from './isValidDateRange';
4
4
  export * from './viewsAdapter';
5
5
  export * from './createAllView';
6
+ export * from './organiseViews';
@@ -0,0 +1 @@
1
+ export { organiseViews } from './organiseViews';
@@ -0,0 +1,18 @@
1
+ import { View, ViewsState } from 'src/types';
2
+ export type OrganiseViewsProps = {
3
+ data?: View[];
4
+ canUpdateCustomViews: boolean;
5
+ };
6
+ /**
7
+ * This helper takes an array of custom_view objects returned from the v2/custom_views endpoint
8
+ * and organises them into 3 data structures:
9
+ *
10
+ * - Fixed views
11
+ * - Custom views
12
+ * - A map containing all views for easy lookup
13
+ *
14
+ * It also contains logic to conditionally add the "All" view, a generic view intended to contain
15
+ * no/minimal filters. If one is provided in the response, it replaces the generated "All" view
16
+ * in the data structures.
17
+ */
18
+ export declare const organiseViews: ({ data, canUpdateCustomViews }: OrganiseViewsProps) => ViewsState;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/transfigure",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.cjs",