@licklist/design 0.72.72-stage.0 → 0.72.72-stage.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.
Files changed (50) hide show
  1. package/dist/header/BookeditHeader.d.ts +1 -4
  2. package/dist/header/BookeditHeader.d.ts.map +1 -1
  3. package/dist/header/Header.d.ts +10 -2
  4. package/dist/header/Header.d.ts.map +1 -1
  5. package/dist/header/Header.js +31 -5
  6. package/dist/header/index.d.ts +2 -2
  7. package/dist/header/index.d.ts.map +1 -1
  8. package/dist/index.js +0 -3
  9. package/dist/sales/coupon/form/CouponFrom.d.ts +2 -1
  10. package/dist/sales/coupon/form/CouponFrom.d.ts.map +1 -1
  11. package/dist/sales/coupon/form/CouponFrom.js +19 -6
  12. package/dist/setting/index.d.ts +0 -2
  13. package/dist/setting/index.d.ts.map +1 -1
  14. package/package.json +2 -2
  15. package/src/header/BookeditHeader.tsx +1 -5
  16. package/src/header/Header.stories.tsx +39 -90
  17. package/src/header/Header.tsx +47 -9
  18. package/src/header/index.ts +2 -2
  19. package/src/sales/coupon/form/CouponFrom.tsx +20 -8
  20. package/src/setting/index.ts +0 -2
  21. package/yarn.lock +152 -142
  22. package/dist/assets/logo/licklist.sm.svg.js +0 -33
  23. package/dist/assets/logo/licklist.svg.js +0 -16
  24. package/dist/header/LicklistHeader.d.ts +0 -15
  25. package/dist/header/LicklistHeader.d.ts.map +0 -1
  26. package/dist/header/LicklistHeader.js +0 -23
  27. package/dist/setting/admin/AdminSettingForm.d.ts +0 -25
  28. package/dist/setting/admin/AdminSettingForm.d.ts.map +0 -1
  29. package/dist/setting/admin/AdminSettingForm.js +0 -220
  30. package/dist/setting/admin/PaymentFeeForm.d.ts +0 -13
  31. package/dist/setting/admin/PaymentFeeForm.d.ts.map +0 -1
  32. package/dist/setting/admin/PaymentFeeForm.js +0 -424
  33. package/dist/setting/admin/index.d.ts +0 -2
  34. package/dist/setting/admin/index.d.ts.map +0 -1
  35. package/dist/setting/system/SystemSettingForm.d.ts +0 -10
  36. package/dist/setting/system/SystemSettingForm.d.ts.map +0 -1
  37. package/dist/setting/system/SystemSettingForm.js +0 -95
  38. package/dist/setting/system/index.d.ts +0 -2
  39. package/dist/setting/system/index.d.ts.map +0 -1
  40. package/dist/types/currency.d.ts +0 -5
  41. package/dist/types/currency.d.ts.map +0 -1
  42. package/src/header/LicklistHeader.tsx +0 -46
  43. package/src/setting/admin/AdminSetting.stories.tsx +0 -52
  44. package/src/setting/admin/AdminSettingForm.tsx +0 -196
  45. package/src/setting/admin/PaymentFeeForm.tsx +0 -304
  46. package/src/setting/admin/index.ts +0 -1
  47. package/src/setting/system/SystemSetting.stories.tsx +0 -26
  48. package/src/setting/system/SystemSettingForm.tsx +0 -62
  49. package/src/setting/system/index.ts +0 -1
  50. package/src/types/currency.ts +0 -4
@@ -1,8 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- interface NavigationItem {
3
- href: string;
4
- label: string;
5
- }
2
+ import { NavigationItem } from './Header';
6
3
  interface Props {
7
4
  children?: ReactNode | ReactNode[];
8
5
  href?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"BookeditHeader.d.ts","sourceRoot":"","sources":["../../src/header/BookeditHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AACD,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;IAC3B,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,SAAS,CAAA;CAC1E;AAED,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,sBAAsB,GACvB,EAAE,KAAK,2CAYP;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"BookeditHeader.d.ts","sourceRoot":"","sources":["../../src/header/BookeditHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEjD,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;IAC3B,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,SAAS,CAAA;CAC1E;AAED,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,sBAAsB,GACvB,EAAE,KAAK,2CAYP;AAED,eAAe,cAAc,CAAA"}
@@ -1,8 +1,16 @@
1
1
  import { ReactNode } from 'react';
2
- interface NavigationItem {
2
+ export type NavigationItem = {
3
3
  href: string;
4
4
  label: string;
5
- }
5
+ pathname: string[];
6
+ } | {
7
+ label: string;
8
+ links: {
9
+ href: string;
10
+ label: string;
11
+ pathname: string[];
12
+ }[];
13
+ };
6
14
  type Props = {
7
15
  children?: ReactNode | ReactNode[];
8
16
  href?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/header/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAA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,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,sBAAsB,GACvB,EAAE,KAAK,2CAmEP;AAED,eAAe,MAAM,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { Accordion } from '@mantine/core';
2
3
  import Nav from 'react-bootstrap/Nav';
3
4
  import Navbar from 'react-bootstrap/Navbar';
5
+ import { NavLink } from 'react-router-dom';
4
6
 
5
7
  function Header(param) {
6
8
  var children = param.children, href = param.href, logo = param.logo, leftNavs = param.leftNavs, navItems = param.navItems, renderMobileNavigation = param.renderMobileNavigation;
@@ -39,12 +41,36 @@ function Header(param) {
39
41
  id: "header-navbar-nav",
40
42
  children: renderMobileNavigation ? renderMobileNavigation(navItems) : /*#__PURE__*/ jsx(Nav, {
41
43
  className: "mr-auto",
42
- children: navItems.map(function(param) {
43
- var label = param.label, href = param.href;
44
+ children: navItems.map(function(item) {
45
+ if ('links' in item) {
46
+ return /*#__PURE__*/ jsx(Accordion, {
47
+ defaultValue: "Apples",
48
+ children: /*#__PURE__*/ jsxs(Accordion.Item, {
49
+ value: item.label,
50
+ children: [
51
+ /*#__PURE__*/ jsx(Accordion.Control, {
52
+ children: item.label
53
+ }),
54
+ item.links.map(function(subItem) {
55
+ return /*#__PURE__*/ jsx(Accordion.Panel, {
56
+ children: /*#__PURE__*/ jsx(Nav.Item, {
57
+ children: /*#__PURE__*/ jsx(NavLink, {
58
+ exact: true,
59
+ to: subItem.href,
60
+ className: "nav-link",
61
+ children: subItem.label
62
+ })
63
+ }, "".concat(subItem.label, "-").concat(subItem.href))
64
+ }, subItem.href + subItem.label);
65
+ })
66
+ ]
67
+ })
68
+ });
69
+ }
44
70
  return /*#__PURE__*/ jsx(Nav.Link, {
45
- href: href,
46
- children: label
47
- }, "".concat(href).concat(label));
71
+ href: item.href,
72
+ children: item.label
73
+ }, "".concat(item.href).concat(item.label));
48
74
  })
49
75
  })
50
76
  })
@@ -1,6 +1,6 @@
1
1
  import BookeditHeader from './BookeditHeader';
2
- import LicklistHeader from './LicklistHeader';
3
2
  import Header from './Header';
4
3
  export * from './elements';
5
- export { LicklistHeader, BookeditHeader, Header };
4
+ export { BookeditHeader, Header };
5
+ export type { NavigationItem } from './Header';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,cAAc,YAAY,CAAA;AAE1B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,cAAc,YAAY,CAAA;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA"}
package/dist/index.js CHANGED
@@ -30,7 +30,6 @@ export { EventStatisticModal } from './events/event-statistic-modal/EventStatist
30
30
  export { EventVenueMap } from './events/event-venue-map/EventVenueMap.js';
31
31
  export { FileUpload } from './file-upload/FileUpload.js';
32
32
  export { default as BookeditHeader } from './header/BookeditHeader.js';
33
- export { default as LicklistHeader } from './header/LicklistHeader.js';
34
33
  export { default as Header } from './header/Header.js';
35
34
  export { default as CompanySelector } from './header/elements/CompanySelector.js';
36
35
  export { Example, ExampleContent, ExampleToggle } from './help/example/Example.js';
@@ -137,8 +136,6 @@ export { RyftPayment } from './sales/payment-form/components/RyftPayment/RyftPay
137
136
  export { BookingResults } from './sales/booking/results/BookingResults.js';
138
137
  export { BACKGROUND_COLOR_CLASSNAMES } from './sales/booking/results/constants.js';
139
138
  export { NotesTable } from './sales/notes/NotesTable.js';
140
- export { SystemSettingForm } from './setting/system/SystemSettingForm.js';
141
- export { AdminSettingForm } from './setting/admin/AdminSettingForm.js';
142
139
  export { DashboardSettingForm } from './setting/dashboard/DashboardSettingForm.js';
143
140
  export { SnippetCard } from './setting/dashboard/snippets/card/SnippetCard.js';
144
141
  export { SnippetTemplateCard } from './setting/dashboard/snippet-templates/card/SnippetTemplateCard.js';
@@ -23,9 +23,10 @@ export interface CouponFormProps {
23
23
  productGroups?: ProductGroup[];
24
24
  defaultValues?: CouponFormValues;
25
25
  onSubmit: (values: CouponFormValues) => void;
26
+ onCancel: () => void;
26
27
  isLoading?: boolean;
27
28
  hasPermission: boolean;
28
29
  serverErrors?: ServerError;
29
30
  }
30
- export declare const CouponForm: ({ onSubmit, defaultValues, isLoading, productGroups, hasPermission, serverErrors, }: CouponFormProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const CouponForm: ({ onSubmit, onCancel, defaultValues, isLoading, productGroups, hasPermission, serverErrors, }: CouponFormProps) => import("react/jsx-runtime").JSX.Element;
31
32
  //# sourceMappingURL=CouponFrom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CouponFrom.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/form/CouponFrom.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,eAAe,EAChB,MAAM,+DAA+D,CAAA;AACtE,OAAO,EACL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAA;AAIhE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAK3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,UAAU,CAAA;IACxB,eAAe,EAAE,eAAe,EAAE,CAAA;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,eAAe,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AAE,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B,aAAa,CAAC,EAAE,gBAAgB,CAAA;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,WAAW,CAAA;CAC3B;AAED,eAAO,MAAM,UAAU,kGAQpB,eAAe,4CA6CjB,CAAA"}
@@ -59,7 +59,7 @@ function _object_spread_props(target, source) {
59
59
  return target;
60
60
  }
61
61
  var CouponForm = function(param) {
62
- var onSubmit = param.onSubmit, defaultValues = param.defaultValues, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, productGroups = param.productGroups, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? false : _param_hasPermission, serverErrors = param.serverErrors;
62
+ var onSubmit = param.onSubmit, onCancel = param.onCancel, defaultValues = param.defaultValues, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, productGroups = param.productGroups, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? false : _param_hasPermission, serverErrors = param.serverErrors;
63
63
  var form = useForm({
64
64
  defaultValues: defaultValues
65
65
  });
@@ -85,11 +85,24 @@ var CouponForm = function(param) {
85
85
  productGroups: productGroups,
86
86
  isLoading: isLoading
87
87
  }),
88
- hasPermission && /*#__PURE__*/ jsx(Button, {
89
- className: "mt-5 d-no dne d-md-block",
90
- type: "submit",
91
- disabled: isLoading,
92
- children: t('save')
88
+ hasPermission && /*#__PURE__*/ jsxs("div", {
89
+ className: "tw-flex tw-gap-4",
90
+ children: [
91
+ /*#__PURE__*/ jsx(Button, {
92
+ className: "d-md-block mt-5",
93
+ type: "submit",
94
+ disabled: isLoading,
95
+ children: t('save')
96
+ }),
97
+ /*#__PURE__*/ jsx(Button, {
98
+ className: "mt-5 d-md-block",
99
+ variant: "outline-primary",
100
+ type: "reset",
101
+ onClick: onCancel,
102
+ disabled: isLoading,
103
+ children: t('cancel')
104
+ })
105
+ ]
93
106
  })
94
107
  ]
95
108
  })
@@ -1,4 +1,2 @@
1
- export * from './system';
2
- export * from './admin';
3
1
  export * from './dashboard';
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setting/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setting/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.72.72-stage.0",
3
+ "version": "0.72.72-stage.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -94,7 +94,7 @@
94
94
  "@wojtekmaj/react-daterange-picker": "4.1.0",
95
95
  "bootstrap": "4.6.0",
96
96
  "bootstrap-social": "5.1.1",
97
- "clsx": "1.1.1",
97
+ "clsx": "2.1.1",
98
98
  "date-fns": "2.29.3",
99
99
  "emojibase": "6.1.0",
100
100
  "emojibase-data": "7.0.1",
@@ -1,12 +1,8 @@
1
1
  import { ReactNode } from 'react'
2
2
  import { ReactComponent as LogoSvg } from '../assets/logo/bookedit.svg'
3
3
  import Logo from '../logo/Logo'
4
- import Header from './Header'
4
+ import Header, { NavigationItem } from './Header'
5
5
 
6
- interface NavigationItem {
7
- href: string
8
- label: string
9
- }
10
6
  interface Props {
11
7
  children?: ReactNode | ReactNode[]
12
8
  href?: string
@@ -1,87 +1,38 @@
1
- import Nav from 'react-bootstrap/Nav'
1
+ import React from 'react'
2
2
  import StyledButton from '../static/StyledButton'
3
3
  import BookeditHeader from './BookeditHeader'
4
4
  import CompanySelector from './elements/CompanySelector'
5
- import LicklistHeader from './LicklistHeader'
5
+ import { NavigationItem } from './Header'
6
6
 
7
- const providerNavItems = [
8
- { href: `/profile`, label: 'profile' },
9
- { href: `/events`, label: 'events' },
10
- { href: `/sales`, label: 'salesAndEnquiries' },
11
- { href: `/product-sets`, label: 'productSets' },
12
- { href: `/affiliates`, label: 'affiliates' },
13
- { href: `/product-groups`, label: 'productGroups' },
14
- { href: '/#', label: 'loyalty' },
15
- { href: '/#', label: 'emailAndSms' },
16
- { href: '/#', label: 'followersAndProfiles' },
7
+ const providerNavItems: NavigationItem[] = [
8
+ { href: `/profile`, label: 'profile', pathname: [] },
9
+ { href: `/events`, label: 'events', pathname: [] },
10
+ { href: `/sales`, label: 'salesAndEnquiries', pathname: [] },
11
+ { href: `/product-sets`, label: 'productSets', pathname: [] },
12
+ { href: `/affiliates`, label: 'affiliates', pathname: [] },
13
+ { href: `/product-groups`, label: 'productGroups', pathname: [] },
14
+ { href: '/#', label: 'loyalty', pathname: [] },
15
+ { href: '/#', label: 'emailAndSms', pathname: [] },
16
+ { href: '/#', label: 'followersAndProfiles', pathname: [] },
17
17
  ]
18
18
 
19
19
  export default {
20
20
  title: 'Header',
21
21
  }
22
22
 
23
- export const Licklist = () => (
24
- <>
25
- <LicklistHeader
26
- leftNavs={
27
- <>
28
- <ul className='navbar-nav bd-navbar-nav flex-row navbar-nav-primary'>
29
- <li className='nav-item px-3 px-sm-3 px-lg-4'>
30
- <Nav.Link href='#'>
31
- <FaSearch />
32
- </Nav.Link>
33
- </li>
34
- <li className='nav-item px-3 px-sm-4 d-none d-sm-inline'>
35
- <Nav.Link href='#' className='nav-link-light-grey'>
36
- Explore
37
- </Nav.Link>
38
- </li>
39
- <li className='nav-item px-3 px-sm-4 d-none d-sm-inline'>
40
- <Nav.Link href='#' className=''>
41
- Galleries
42
- </Nav.Link>
43
- </li>
44
- </ul>
45
- </>
46
- }
47
- >
48
- <StyledButton size='sm' className='rounded-pill mr-2'>
49
- Login
50
- </StyledButton>
51
- <StyledButton
52
- size='sm'
53
- className='rounded-pill'
54
- variant='outline-secondary'
55
- >
56
- Sign up
57
- </StyledButton>
58
- </LicklistHeader>
59
- </>
60
- )
61
-
62
- Licklist.story = {
63
- parameters: {
64
- info: `
65
- Licklist header component
66
- `,
67
- },
68
- }
69
-
70
23
  export const Bookedit = () => (
71
- <>
72
- <BookeditHeader navItems={providerNavItems}>
73
- <StyledButton size='sm' className='rounded-pill mr-2'>
74
- Login
75
- </StyledButton>
76
- <StyledButton
77
- size='sm'
78
- className='rounded-pill'
79
- variant='outline-secondary'
80
- >
81
- Sign up
82
- </StyledButton>
83
- </BookeditHeader>
84
- </>
24
+ <BookeditHeader navItems={providerNavItems}>
25
+ <StyledButton size='sm' className='rounded-pill mr-2'>
26
+ Login
27
+ </StyledButton>
28
+ <StyledButton
29
+ size='sm'
30
+ className='rounded-pill'
31
+ variant='outline-secondary'
32
+ >
33
+ Sign up
34
+ </StyledButton>
35
+ </BookeditHeader>
85
36
  )
86
37
 
87
38
  Bookedit.story = {
@@ -93,23 +44,21 @@ Bookedit.story = {
93
44
  }
94
45
 
95
46
  export const BookeditWithElements = () => (
96
- <>
97
- <BookeditHeader
98
- leftNavs={
99
- <div className='header-elements'>
100
- <CompanySelector
101
- value={1}
102
- list={[
103
- { id: 1, title: 'Company #1' },
104
- { id: 2, title: 'Company #2' },
105
- ]}
106
- onChange={() => null}
107
- />
108
- </div>
109
- }
110
- navItems={providerNavItems}
111
- />
112
- </>
47
+ <BookeditHeader
48
+ leftNavs={
49
+ <div className='header-elements'>
50
+ <CompanySelector
51
+ value={1}
52
+ list={[
53
+ { id: 1, title: 'Company #1' },
54
+ { id: 2, title: 'Company #2' },
55
+ ]}
56
+ onChange={() => null}
57
+ />
58
+ </div>
59
+ }
60
+ navItems={providerNavItems}
61
+ />
113
62
  )
114
63
 
115
64
  BookeditWithElements.story = {
@@ -1,11 +1,23 @@
1
+ import { Accordion } from '@mantine/core'
1
2
  import { ReactNode } from 'react'
2
3
  import Nav from 'react-bootstrap/Nav'
3
4
  import Navbar from 'react-bootstrap/Navbar'
5
+ import { NavLink } from 'react-router-dom'
4
6
 
5
- interface NavigationItem {
6
- href: string
7
- label: string
8
- }
7
+ export type NavigationItem =
8
+ | {
9
+ href: string
10
+ label: string
11
+ pathname: string[]
12
+ }
13
+ | {
14
+ label: string
15
+ links: {
16
+ href: string
17
+ label: string
18
+ pathname: string[]
19
+ }[]
20
+ }
9
21
 
10
22
  type Props = {
11
23
  children?: ReactNode | ReactNode[]
@@ -53,11 +65,37 @@ function Header({
53
65
  renderMobileNavigation(navItems)
54
66
  ) : (
55
67
  <Nav className='mr-auto'>
56
- {navItems.map(({ label, href }) => (
57
- <Nav.Link href={href} key={`${href}${label}`}>
58
- {label}
59
- </Nav.Link>
60
- ))}
68
+ {navItems.map((item) => {
69
+ if ('links' in item) {
70
+ return (
71
+ <Accordion defaultValue='Apples'>
72
+ <Accordion.Item value={item.label}>
73
+ <Accordion.Control>{item.label}</Accordion.Control>
74
+ {item.links.map((subItem) => (
75
+ <Accordion.Panel key={subItem.href + subItem.label}>
76
+ <Nav.Item key={`${subItem.label}-${subItem.href}`}>
77
+ {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
78
+ {/* @ts-ignore */}
79
+ <NavLink
80
+ exact
81
+ to={subItem.href}
82
+ className='nav-link'
83
+ >
84
+ {subItem.label}
85
+ </NavLink>
86
+ </Nav.Item>
87
+ </Accordion.Panel>
88
+ ))}
89
+ </Accordion.Item>
90
+ </Accordion>
91
+ )
92
+ }
93
+ return (
94
+ <Nav.Link href={item.href} key={`${item.href}${item.label}`}>
95
+ {item.label}
96
+ </Nav.Link>
97
+ )
98
+ })}
61
99
  </Nav>
62
100
  )}
63
101
  </Navbar.Collapse>
@@ -1,7 +1,7 @@
1
1
  import BookeditHeader from './BookeditHeader'
2
- import LicklistHeader from './LicklistHeader'
3
2
  import Header from './Header'
4
3
 
5
4
  export * from './elements'
6
5
 
7
- export { LicklistHeader, BookeditHeader, Header }
6
+ export { BookeditHeader, Header }
7
+ export type { NavigationItem } from './Header'
@@ -12,7 +12,6 @@ import { useForm, FormProvider } from 'react-hook-form'
12
12
  import { useTranslation } from 'react-i18next'
13
13
  import { ServerError } from '@licklist/plugins/dist/hooks/Api/useHttpQuery'
14
14
  import FormErrorService from '@licklist/plugins/dist/services/Form/FormErrorService'
15
-
16
15
  import { CouponFormControl } from '../control'
17
16
 
18
17
  export interface CouponFormValues {
@@ -38,6 +37,7 @@ export interface CouponFormProps {
38
37
  productGroups?: ProductGroup[]
39
38
  defaultValues?: CouponFormValues
40
39
  onSubmit: (values: CouponFormValues) => void
40
+ onCancel: () => void
41
41
  isLoading?: boolean
42
42
  hasPermission: boolean
43
43
  serverErrors?: ServerError
@@ -45,6 +45,7 @@ export interface CouponFormProps {
45
45
 
46
46
  export const CouponForm = ({
47
47
  onSubmit,
48
+ onCancel,
48
49
  defaultValues,
49
50
  isLoading = false,
50
51
  productGroups,
@@ -73,13 +74,24 @@ export const CouponForm = ({
73
74
  isLoading={isLoading}
74
75
  />
75
76
  {hasPermission && (
76
- <Button
77
- className='mt-5 d-no dne d-md-block'
78
- type='submit'
79
- disabled={isLoading}
80
- >
81
- {t('save')}
82
- </Button>
77
+ <div className='tw-flex tw-gap-4'>
78
+ <Button
79
+ className='d-md-block mt-5'
80
+ type='submit'
81
+ disabled={isLoading}
82
+ >
83
+ {t('save')}
84
+ </Button>
85
+ <Button
86
+ className='mt-5 d-md-block'
87
+ variant='outline-primary'
88
+ type='reset'
89
+ onClick={onCancel}
90
+ disabled={isLoading}
91
+ >
92
+ {t('cancel')}
93
+ </Button>
94
+ </div>
83
95
  )}
84
96
  </Form>
85
97
  </FormProvider>
@@ -1,3 +1 @@
1
- export * from './system'
2
- export * from './admin'
3
1
  export * from './dashboard'