@compill/admin 1.0.45 → 1.0.46

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/index.cjs.js CHANGED
@@ -170,20 +170,17 @@ function InvalidateButton(_a) {
170
170
  const invalidate = api.useMutate(mutation, {
171
171
  successMsg: "Page successfully invalidated"
172
172
  });
173
- return jsxRuntime.jsx(ui.Button, Object.assign({
173
+ return jsxRuntime.jsx(ui.IconButton, Object.assign({
174
174
  scheme: "dark",
175
- variant: "borderless",
176
- size: "sm",
175
+ variant: "glass",
176
+ size: "md",
177
177
  corners: "square",
178
178
  aspectRatio: "square",
179
179
  title: "Regenerate",
180
180
  disabled: mutation.isLoading,
181
- onClick: invalidate
182
- }, props, {
183
- children: jsxRuntime.jsx(ui.Icon, {
184
- path: mdiDatabaseRefreshOutline
185
- })
186
- }));
181
+ onClick: invalidate,
182
+ icon: mdiDatabaseRefreshOutline
183
+ }, props));
187
184
  }
188
185
 
189
186
  function NavigateButton(_a) {
@@ -228,8 +225,8 @@ function PublishButton(_a) {
228
225
  return jsxRuntime.jsxs(ui.Button, Object.assign({
229
226
  scheme: "secondary",
230
227
  variant: "glass",
231
- corners: "pill",
232
- px: "4",
228
+ size: "sm",
229
+ px: "3",
233
230
  disabled: mutation.isLoading,
234
231
  onClick: publish,
235
232
  dflex: true,
@@ -647,8 +644,8 @@ function UpdateButton(_a) {
647
644
  }, [dirty, props, handleSubmit]);
648
645
  return jsxRuntime.jsxs(form.SubmitButton, Object.assign({
649
646
  type: "submit",
650
- corners: "pill",
651
- px: "4",
647
+ size: "sm",
648
+ px: "3",
652
649
  dflex: true,
653
650
  alignItems: "center",
654
651
  gap: "3"
@@ -668,19 +665,14 @@ function ViewButton(_a) {
668
665
  const openPage = React__default["default"].useCallback(() => {
669
666
  window.open(path, '_blank');
670
667
  }, [path]);
671
- return jsxRuntime.jsx(ui.Button, Object.assign({
668
+ return jsxRuntime.jsx(ui.IconButton, Object.assign({
669
+ icon: icon ? icon : mdiOpenInNew,
672
670
  type: "submit",
673
671
  scheme: "dark",
674
672
  variant: "glass",
675
- corners: "pill",
676
- w: "10",
677
- h: "10",
673
+ size: "md",
678
674
  onClick: openPage
679
- }, props, {
680
- children: jsxRuntime.jsx(ui.Icon, {
681
- path: icon !== null && icon !== void 0 ? icon : mdiOpenInNew
682
- })
683
- }));
675
+ }, props));
684
676
  }
685
677
 
686
678
  function OrderCell({
@@ -820,6 +812,8 @@ function PageContentEditor(_a) {
820
812
  children: jsxRuntime.jsx(FormEditor, {
821
813
  minH: "128",
822
814
  minW: "144",
815
+ maxW: props.maxW,
816
+ // w={props.w}
823
817
  name: name,
824
818
  placeHolder: "Write here..."
825
819
  })
@@ -883,9 +877,10 @@ function PageSidebarSection(_a) {
883
877
  return jsxRuntime.jsxs("div", Object.assign({
884
878
  w: "full",
885
879
  bgColor: "white",
886
- rounded: true,
880
+ rounded: "lg",
887
881
  p: "5",
888
- textSize: "sm"
882
+ textSize: "sm",
883
+ shadow: true
889
884
  }, props, {
890
885
  children: [title && jsxRuntime.jsx(admin.PageSectionTitle, {
891
886
  children: title
@@ -1157,44 +1152,51 @@ function Internal({
1157
1152
  item: item,
1158
1153
  isLoading: mutation.isLoading,
1159
1154
  trackingRef: containerRef === null || containerRef === void 0 ? void 0 : containerRef.current
1160
- }), jsxRuntime.jsxs(PageContainer, {
1161
- w: editorMaxW ? "auto" : "full",
1162
- size: "x2",
1163
- id: "pagecontainer",
1164
- children: [header, jsxRuntime.jsxs("div", {
1165
- dflex: true,
1166
- gap: "8",
1167
- children: [jsxRuntime.jsxs("div", {
1155
+ }), jsxRuntime.jsx("div", {
1156
+ p: "5",
1157
+ bgColor: "slate-100",
1158
+ rounded: "lg",
1159
+ children: jsxRuntime.jsxs(PageContainer, {
1160
+ w: editorMaxW ? "auto" : "full",
1161
+ size: "x2",
1162
+ id: "pagecontainer",
1163
+ children: [header, jsxRuntime.jsxs("div", {
1168
1164
  dflex: true,
1169
- flexCol: true,
1170
- gap: "8",
1171
- flexGrow: true,
1172
- children: [(editor === null || editor === void 0 ? void 0 : editor.type) != "textarea" &&
1173
- // TODO Find a way to make this editor shrink in width when resizing the window...
1174
- jsxRuntime.jsx(PageContentEditor, {
1175
- name: "content",
1176
- w: editorMaxW,
1177
- maxW: editorMaxW,
1178
- minW: "144"
1179
- }), (editor === null || editor === void 0 ? void 0 : editor.type) == "textarea" && jsxRuntime.jsx(form.TextArea, {
1180
- name: editor === null || editor === void 0 ? void 0 : editor.name,
1181
- maxW: editorMaxW,
1182
- minW: editorMaxW,
1183
- w: editorMaxW,
1184
- minH: "128",
1185
- rows: 25,
1186
- bgColor: "white",
1187
- border: "0",
1188
- p: "5",
1189
- textColor: "slate-800"
1190
- }), editoFooter]
1191
- }), jsxRuntime.jsx(PageSidebar, {
1192
- children: sections === null || sections === void 0 ? void 0 : sections.map((section, index) => jsxRuntime.jsx(Section, {
1193
- section: section,
1194
- item: item
1195
- }, index))
1165
+ gap: "5",
1166
+ children: [jsxRuntime.jsxs("div", {
1167
+ dflex: true,
1168
+ flexCol: true,
1169
+ gap: "8",
1170
+ flexGrow: true,
1171
+ children: [(editor === null || editor === void 0 ? void 0 : editor.type) != "textarea" &&
1172
+ // TODO Find a way to make this editor shrink in width when resizing the window...
1173
+ jsxRuntime.jsx(PageContentEditor, {
1174
+ name: "content",
1175
+ maxW: editorMaxW,
1176
+ minW: "144",
1177
+ shadow: true,
1178
+ rounded: "lg"
1179
+ }), (editor === null || editor === void 0 ? void 0 : editor.type) == "textarea" && jsxRuntime.jsx(form.TextArea, {
1180
+ name: editor === null || editor === void 0 ? void 0 : editor.name,
1181
+ maxW: editorMaxW,
1182
+ minW: editorMaxW,
1183
+ w: editorMaxW,
1184
+ minH: "128",
1185
+ rows: 25,
1186
+ bgColor: "white",
1187
+ border: "0",
1188
+ shadow: true,
1189
+ p: "5",
1190
+ textColor: "slate-800"
1191
+ }), editoFooter]
1192
+ }), jsxRuntime.jsx(PageSidebar, {
1193
+ children: sections === null || sections === void 0 ? void 0 : sections.map((section, index) => jsxRuntime.jsx(Section, {
1194
+ section: section,
1195
+ item: item
1196
+ }, index))
1197
+ })]
1196
1198
  })]
1197
- })]
1199
+ })
1198
1200
  })]
1199
1201
  });
1200
1202
  }
@@ -1450,7 +1452,7 @@ function TableTopBar(_a) {
1450
1452
  flexRow: true,
1451
1453
  alignItems: "center",
1452
1454
  gap: "3",
1453
- p: "3"
1455
+ p: "8"
1454
1456
  }, props, {
1455
1457
  children: [title && jsxRuntime.jsx("h2", {
1456
1458
  textSize: "x2",
@@ -1926,7 +1928,7 @@ function TableRowPublishPostButton$1(_a) {
1926
1928
  return jsxRuntime.jsx(ui.Button, Object.assign({
1927
1929
  variant: "borderless",
1928
1930
  corners: "square",
1929
- scheme: "default",
1931
+ scheme: "dark",
1930
1932
  onClick: publish
1931
1933
  }, props, {
1932
1934
  children: jsxRuntime.jsx(ui.Icon, {
@@ -1950,10 +1952,6 @@ function TableRowActionsView({
1950
1952
  alignItems: "stretch",
1951
1953
  placeContent: "end",
1952
1954
  h: "full",
1953
- divideX: "1px",
1954
- divideColor: "zinc-100",
1955
- rounded: "lg",
1956
- overflow: "hidden",
1957
1955
  children: rowActions === null || rowActions === void 0 ? void 0 : rowActions.map((action, index) => jsxRuntime.jsxs(React__default["default"].Fragment, {
1958
1956
  children: [action.type === "publish" && jsxRuntime.jsx(TableRowPublishPostButton$1, {
1959
1957
  id: item.id,
@@ -1988,11 +1986,11 @@ function ActionButton$1(_a) {
1988
1986
  alignContent: "center",
1989
1987
  placeContent: "center",
1990
1988
  py: "2.5",
1991
- px: "2",
1989
+ px: "3",
1992
1990
  h: "full",
1993
1991
  size: "lg",
1994
1992
  variant: "borderless",
1995
- corners: "square",
1993
+ corners: "default",
1996
1994
  onClick: handleClick
1997
1995
  }, props));
1998
1996
  }
@@ -2006,11 +2004,11 @@ const icons = {
2006
2004
  };
2007
2005
  const schemes$1 = {
2008
2006
  "link": "dark",
2009
- "view": "secondary",
2010
- "edit": "warning",
2011
- "delete": "danger",
2012
- "publish": "warning",
2013
- "custom": "default"
2007
+ "view": "dark",
2008
+ "edit": "dark",
2009
+ "delete": "dark",
2010
+ "publish": "dark",
2011
+ "custom": "dark"
2014
2012
  };
2015
2013
 
2016
2014
  function useTableProps(api, table, rowActions) {
@@ -2627,8 +2625,7 @@ function TableWrapper({
2627
2625
  };
2628
2626
  }, [subtitle]);
2629
2627
  return jsxRuntime.jsx(table.Table, Object.assign({}, tableProps, {
2630
- px: "3",
2631
- py: "3",
2628
+ p: "8",
2632
2629
  title: _subtitle
2633
2630
  }));
2634
2631
  }
@@ -3259,11 +3256,9 @@ function TableRowNavigateButton(_a) {
3259
3256
  navigate(`${path}`);
3260
3257
  }, [navigate, path]);
3261
3258
  return jsxRuntime.jsx(ui.Button, Object.assign({
3262
- scheme: "secondary",
3263
- w: "10",
3264
- h: "10",
3259
+ scheme: "dark",
3265
3260
  variant: "borderless",
3266
- corners: "pill",
3261
+ corners: "square",
3267
3262
  onClick: handleClick
3268
3263
  }, props, {
3269
3264
  children: jsxRuntime.jsx(ui.Icon, {
package/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from '@soperio/jsx-runtime';
2
- import { Icon, Button, Container, Tile, Popover, Modal, Collapse, Checkbox, Badge } from '@valerya/ui';
2
+ import { Icon, Button, IconButton, Container, Tile, Popover, Modal, Collapse, Checkbox, Badge } from '@valerya/ui';
3
3
  import Link from 'next/link';
4
4
  import React, { useRef, useCallback, useContext as useContext$2, useLayoutEffect, useEffect, createContext } from 'react';
5
5
  import { INVALIDATE_API } from '@compill/admin-api';
@@ -161,20 +161,17 @@ function InvalidateButton(_a) {
161
161
  const invalidate = useMutate(mutation, {
162
162
  successMsg: "Page successfully invalidated"
163
163
  });
164
- return jsx(Button, Object.assign({
164
+ return jsx(IconButton, Object.assign({
165
165
  scheme: "dark",
166
- variant: "borderless",
167
- size: "sm",
166
+ variant: "glass",
167
+ size: "md",
168
168
  corners: "square",
169
169
  aspectRatio: "square",
170
170
  title: "Regenerate",
171
171
  disabled: mutation.isLoading,
172
- onClick: invalidate
173
- }, props, {
174
- children: jsx(Icon, {
175
- path: mdiDatabaseRefreshOutline
176
- })
177
- }));
172
+ onClick: invalidate,
173
+ icon: mdiDatabaseRefreshOutline
174
+ }, props));
178
175
  }
179
176
 
180
177
  function NavigateButton(_a) {
@@ -219,8 +216,8 @@ function PublishButton(_a) {
219
216
  return jsxs(Button, Object.assign({
220
217
  scheme: "secondary",
221
218
  variant: "glass",
222
- corners: "pill",
223
- px: "4",
219
+ size: "sm",
220
+ px: "3",
224
221
  disabled: mutation.isLoading,
225
222
  onClick: publish,
226
223
  dflex: true,
@@ -638,8 +635,8 @@ function UpdateButton(_a) {
638
635
  }, [dirty, props, handleSubmit]);
639
636
  return jsxs(SubmitButton, Object.assign({
640
637
  type: "submit",
641
- corners: "pill",
642
- px: "4",
638
+ size: "sm",
639
+ px: "3",
643
640
  dflex: true,
644
641
  alignItems: "center",
645
642
  gap: "3"
@@ -659,19 +656,14 @@ function ViewButton(_a) {
659
656
  const openPage = React.useCallback(() => {
660
657
  window.open(path, '_blank');
661
658
  }, [path]);
662
- return jsx(Button, Object.assign({
659
+ return jsx(IconButton, Object.assign({
660
+ icon: icon ? icon : mdiOpenInNew,
663
661
  type: "submit",
664
662
  scheme: "dark",
665
663
  variant: "glass",
666
- corners: "pill",
667
- w: "10",
668
- h: "10",
664
+ size: "md",
669
665
  onClick: openPage
670
- }, props, {
671
- children: jsx(Icon, {
672
- path: icon !== null && icon !== void 0 ? icon : mdiOpenInNew
673
- })
674
- }));
666
+ }, props));
675
667
  }
676
668
 
677
669
  function OrderCell({
@@ -811,6 +803,8 @@ function PageContentEditor(_a) {
811
803
  children: jsx(FormEditor, {
812
804
  minH: "128",
813
805
  minW: "144",
806
+ maxW: props.maxW,
807
+ // w={props.w}
814
808
  name: name,
815
809
  placeHolder: "Write here..."
816
810
  })
@@ -874,9 +868,10 @@ function PageSidebarSection(_a) {
874
868
  return jsxs("div", Object.assign({
875
869
  w: "full",
876
870
  bgColor: "white",
877
- rounded: true,
871
+ rounded: "lg",
878
872
  p: "5",
879
- textSize: "sm"
873
+ textSize: "sm",
874
+ shadow: true
880
875
  }, props, {
881
876
  children: [title && jsx(PageSectionTitle$1, {
882
877
  children: title
@@ -1148,44 +1143,51 @@ function Internal({
1148
1143
  item: item,
1149
1144
  isLoading: mutation.isLoading,
1150
1145
  trackingRef: containerRef === null || containerRef === void 0 ? void 0 : containerRef.current
1151
- }), jsxs(PageContainer, {
1152
- w: editorMaxW ? "auto" : "full",
1153
- size: "x2",
1154
- id: "pagecontainer",
1155
- children: [header, jsxs("div", {
1156
- dflex: true,
1157
- gap: "8",
1158
- children: [jsxs("div", {
1146
+ }), jsx("div", {
1147
+ p: "5",
1148
+ bgColor: "slate-100",
1149
+ rounded: "lg",
1150
+ children: jsxs(PageContainer, {
1151
+ w: editorMaxW ? "auto" : "full",
1152
+ size: "x2",
1153
+ id: "pagecontainer",
1154
+ children: [header, jsxs("div", {
1159
1155
  dflex: true,
1160
- flexCol: true,
1161
- gap: "8",
1162
- flexGrow: true,
1163
- children: [(editor === null || editor === void 0 ? void 0 : editor.type) != "textarea" &&
1164
- // TODO Find a way to make this editor shrink in width when resizing the window...
1165
- jsx(PageContentEditor, {
1166
- name: "content",
1167
- w: editorMaxW,
1168
- maxW: editorMaxW,
1169
- minW: "144"
1170
- }), (editor === null || editor === void 0 ? void 0 : editor.type) == "textarea" && jsx(TextArea, {
1171
- name: editor === null || editor === void 0 ? void 0 : editor.name,
1172
- maxW: editorMaxW,
1173
- minW: editorMaxW,
1174
- w: editorMaxW,
1175
- minH: "128",
1176
- rows: 25,
1177
- bgColor: "white",
1178
- border: "0",
1179
- p: "5",
1180
- textColor: "slate-800"
1181
- }), editoFooter]
1182
- }), jsx(PageSidebar, {
1183
- children: sections === null || sections === void 0 ? void 0 : sections.map((section, index) => jsx(Section, {
1184
- section: section,
1185
- item: item
1186
- }, index))
1156
+ gap: "5",
1157
+ children: [jsxs("div", {
1158
+ dflex: true,
1159
+ flexCol: true,
1160
+ gap: "8",
1161
+ flexGrow: true,
1162
+ children: [(editor === null || editor === void 0 ? void 0 : editor.type) != "textarea" &&
1163
+ // TODO Find a way to make this editor shrink in width when resizing the window...
1164
+ jsx(PageContentEditor, {
1165
+ name: "content",
1166
+ maxW: editorMaxW,
1167
+ minW: "144",
1168
+ shadow: true,
1169
+ rounded: "lg"
1170
+ }), (editor === null || editor === void 0 ? void 0 : editor.type) == "textarea" && jsx(TextArea, {
1171
+ name: editor === null || editor === void 0 ? void 0 : editor.name,
1172
+ maxW: editorMaxW,
1173
+ minW: editorMaxW,
1174
+ w: editorMaxW,
1175
+ minH: "128",
1176
+ rows: 25,
1177
+ bgColor: "white",
1178
+ border: "0",
1179
+ shadow: true,
1180
+ p: "5",
1181
+ textColor: "slate-800"
1182
+ }), editoFooter]
1183
+ }), jsx(PageSidebar, {
1184
+ children: sections === null || sections === void 0 ? void 0 : sections.map((section, index) => jsx(Section, {
1185
+ section: section,
1186
+ item: item
1187
+ }, index))
1188
+ })]
1187
1189
  })]
1188
- })]
1190
+ })
1189
1191
  })]
1190
1192
  });
1191
1193
  }
@@ -1441,7 +1443,7 @@ function TableTopBar(_a) {
1441
1443
  flexRow: true,
1442
1444
  alignItems: "center",
1443
1445
  gap: "3",
1444
- p: "3"
1446
+ p: "8"
1445
1447
  }, props, {
1446
1448
  children: [title && jsx("h2", {
1447
1449
  textSize: "x2",
@@ -1917,7 +1919,7 @@ function TableRowPublishPostButton$1(_a) {
1917
1919
  return jsx(Button, Object.assign({
1918
1920
  variant: "borderless",
1919
1921
  corners: "square",
1920
- scheme: "default",
1922
+ scheme: "dark",
1921
1923
  onClick: publish
1922
1924
  }, props, {
1923
1925
  children: jsx(Icon, {
@@ -1941,10 +1943,6 @@ function TableRowActionsView({
1941
1943
  alignItems: "stretch",
1942
1944
  placeContent: "end",
1943
1945
  h: "full",
1944
- divideX: "1px",
1945
- divideColor: "zinc-100",
1946
- rounded: "lg",
1947
- overflow: "hidden",
1948
1946
  children: rowActions === null || rowActions === void 0 ? void 0 : rowActions.map((action, index) => jsxs(React.Fragment, {
1949
1947
  children: [action.type === "publish" && jsx(TableRowPublishPostButton$1, {
1950
1948
  id: item.id,
@@ -1979,11 +1977,11 @@ function ActionButton$1(_a) {
1979
1977
  alignContent: "center",
1980
1978
  placeContent: "center",
1981
1979
  py: "2.5",
1982
- px: "2",
1980
+ px: "3",
1983
1981
  h: "full",
1984
1982
  size: "lg",
1985
1983
  variant: "borderless",
1986
- corners: "square",
1984
+ corners: "default",
1987
1985
  onClick: handleClick
1988
1986
  }, props));
1989
1987
  }
@@ -1997,11 +1995,11 @@ const icons = {
1997
1995
  };
1998
1996
  const schemes$1 = {
1999
1997
  "link": "dark",
2000
- "view": "secondary",
2001
- "edit": "warning",
2002
- "delete": "danger",
2003
- "publish": "warning",
2004
- "custom": "default"
1998
+ "view": "dark",
1999
+ "edit": "dark",
2000
+ "delete": "dark",
2001
+ "publish": "dark",
2002
+ "custom": "dark"
2005
2003
  };
2006
2004
 
2007
2005
  function useTableProps(api, table, rowActions) {
@@ -2618,8 +2616,7 @@ function TableWrapper({
2618
2616
  };
2619
2617
  }, [subtitle]);
2620
2618
  return jsx(Table, Object.assign({}, tableProps, {
2621
- px: "3",
2622
- py: "3",
2619
+ p: "8",
2623
2620
  title: _subtitle
2624
2621
  }));
2625
2622
  }
@@ -3250,11 +3247,9 @@ function TableRowNavigateButton(_a) {
3250
3247
  navigate(`${path}`);
3251
3248
  }, [navigate, path]);
3252
3249
  return jsx(Button, Object.assign({
3253
- scheme: "secondary",
3254
- w: "10",
3255
- h: "10",
3250
+ scheme: "dark",
3256
3251
  variant: "borderless",
3257
- corners: "pill",
3252
+ corners: "square",
3258
3253
  onClick: handleClick
3259
3254
  }, props, {
3260
3255
  children: jsx(Icon, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ButtonProps } from "@valerya/ui";
3
- interface InvalidateButtonProps extends ButtonProps {
2
+ import { IconButtonProps } from "@valerya/ui";
3
+ interface InvalidateButtonProps extends Omit<IconButtonProps, "icon"> {
4
4
  pathOrPermalink: string;
5
5
  }
6
6
  export declare function InvalidateButton({ pathOrPermalink, ...props }: InvalidateButtonProps): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ButtonProps } from "@valerya/ui";
3
- export declare function ViewButton({ path, icon, ...props }: {
2
+ import { IconButtonProps } from "@valerya/ui";
3
+ export declare function ViewButton({ path, icon, ...props }: Omit<IconButtonProps, "icon"> & {
4
4
  path: string;
5
5
  icon?: string;
6
- } & ButtonProps): JSX.Element;
6
+ }): JSX.Element;