@spteck/license-manager-react-components 1.0.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/dist/atoms/appGlobalState.d.ts +4 -0
  4. package/dist/components/RenderLabel/RenderLabel.d.ts +8 -0
  5. package/dist/components/RenderLabel/index.d.ts +2 -0
  6. package/dist/components/RenderLabel/useRenderLabelStylesStyles.d.ts +1 -0
  7. package/dist/components/customControlBar/CustomControlBar.d.ts +15 -0
  8. package/dist/components/customControlBar/index.d.ts +1 -0
  9. package/dist/components/dropDownField/DropDownField.d.ts +3 -0
  10. package/dist/components/dropDownField/IDropDownFieldProps.d.ts +15 -0
  11. package/dist/components/dropDownField/IOption.d.ts +8 -0
  12. package/dist/components/dropDownField/index.d.ts +3 -0
  13. package/dist/components/errorSVG/ErrorSVG.d.ts +2 -0
  14. package/dist/components/informationBar/InformationBar.d.ts +6 -0
  15. package/dist/components/licenseControl/LicenseControl.d.ts +10 -0
  16. package/dist/components/licenseControl/useLicenseControlStyles.d.ts +5 -0
  17. package/dist/components/licensePlaceHolder/LicensePlaceHolder.d.ts +8 -0
  18. package/dist/components/licensePlaceHolder/licensePlaceHolderStyles.d.ts +8 -0
  19. package/dist/components/licenseProvider/ILicenseProviderProps.d.ts +17 -0
  20. package/dist/components/licenseProvider/LicenseProvider.d.ts +3 -0
  21. package/dist/components/mailTo/Mailto.d.ts +12 -0
  22. package/dist/components/pricePlan/PricePlan.d.ts +9 -0
  23. package/dist/components/pricePlan/usePricePlansStyles.d.ts +12 -0
  24. package/dist/components/registerDialog/RegisterDialog.d.ts +10 -0
  25. package/dist/components/renderHeader/RenderHeader.d.ts +8 -0
  26. package/dist/components/renderHeader/index.d.ts +2 -0
  27. package/dist/components/renderHeader/useRenderHeaderStyles.d.ts +1 -0
  28. package/dist/components/showError/ShowError.d.ts +6 -0
  29. package/dist/components/trialLicense.ts/TrialLicense.d.ts +6 -0
  30. package/dist/components/trialLicense.ts/useTrialLicenseStyles.d.ts +5 -0
  31. package/dist/constants/constants.d.ts +3 -0
  32. package/dist/hooks/useUtils.d.ts +4 -0
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.js +8 -0
  35. package/dist/license-manager-react-components.cjs.development.js +1433 -0
  36. package/dist/license-manager-react-components.cjs.development.js.map +1 -0
  37. package/dist/license-manager-react-components.cjs.production.min.js +2 -0
  38. package/dist/license-manager-react-components.cjs.production.min.js.map +1 -0
  39. package/dist/license-manager-react-components.esm.js +1406 -0
  40. package/dist/license-manager-react-components.esm.js.map +1 -0
  41. package/dist/loc/IStrings.d.ts +56 -0
  42. package/dist/loc/en.json +61 -0
  43. package/dist/models/EAppHostName.d.ts +7 -0
  44. package/dist/models/ETabsOptions.d.ts +5 -0
  45. package/dist/models/IGlobalState.d.ts +8 -0
  46. package/dist/zodSchemas/pricePlan.d.ts +47 -0
  47. package/package.json +79 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 João Mendes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # License-Manager-React-Components
2
+
3
+ By João Mendes @joaojmendes joao.j.mendes@spteck.com
@@ -0,0 +1,4 @@
1
+ import { IGlobalState } from '../models/IGlobalState';
2
+ export declare const appGlobalStateAtom: import("jotai/esm/").PrimitiveAtom<IGlobalState> & {
3
+ init: IGlobalState;
4
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export interface IRenderLabelProps {
3
+ label: string;
4
+ icon?: string | JSX.Element;
5
+ isRequired?: boolean;
6
+ }
7
+ export declare const RenderLabel: React.FunctionComponent<IRenderLabelProps>;
8
+ export default RenderLabel;
@@ -0,0 +1,2 @@
1
+ export * from './RenderLabel';
2
+ export { default as RenderLabel } from './RenderLabel';
@@ -0,0 +1 @@
1
+ export declare const useRenderLabelStyles: () => Record<"labelContainer" | "iconStyles" | "item", string>;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { Theme } from '@fluentui/react-components';
3
+ export interface IControlItem {
4
+ id: string;
5
+ name: string;
6
+ icon?: JSX.Element | string;
7
+ }
8
+ export interface ICustomControlBarProps {
9
+ items: IControlItem[];
10
+ selectedItemId: string | undefined;
11
+ onSelectedItem: (itemId: string) => void;
12
+ renderControl: (item: IControlItem, isSelected: boolean, onClick: () => void) => JSX.Element;
13
+ theme: Theme;
14
+ }
15
+ export declare const CustomControlBar: React.FunctionComponent<ICustomControlBarProps>;
@@ -0,0 +1 @@
1
+ export * from './CustomControlBar';
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IDropdownFieldProps } from './IDropDownFieldProps';
3
+ export declare const DropdownField: React.FC<IDropdownFieldProps>;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { IOption } from './IOption';
3
+ export interface IDropdownFieldProps {
4
+ options: IOption[];
5
+ onChange?: (selectedValue: string) => void;
6
+ renderItem?: (item: IOption) => JSX.Element;
7
+ validate?: (value: string) => string;
8
+ label?: string | JSX.Element;
9
+ placeholder?: string;
10
+ message?: string;
11
+ messageType?: "error" | "info" | "warning";
12
+ required?: boolean;
13
+ size?: "small" | "medium" | "large";
14
+ hint?: string;
15
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export interface IOption {
3
+ value: string;
4
+ text?: string;
5
+ disabled?: boolean;
6
+ checkIcon?: React.ReactNode;
7
+ as?: "div";
8
+ }
@@ -0,0 +1,3 @@
1
+ export * from './DropDownField';
2
+ export * from './IDropDownFieldProps';
3
+ export * from './IOption';
@@ -0,0 +1,2 @@
1
+ import type { SVGProps } from "react";
2
+ export declare function ErrorIcon(props: SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface IInformationBarProps {
3
+ message: JSX.Element | string;
4
+ onAction?: () => void;
5
+ }
6
+ export declare const InformationBar: React.FunctionComponent<IInformationBarProps>;
@@ -0,0 +1,10 @@
1
+ import { EStatus } from '@spteck/react-hooks-library';
2
+ import React from 'react';
3
+ interface ILicenseControlProps {
4
+ licenseStatus: EStatus;
5
+ licenseType: string | undefined;
6
+ expiryDate: number | undefined;
7
+ onDismiss: () => void;
8
+ }
9
+ export declare const LicenseControl: React.FC<ILicenseControlProps>;
10
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const useLicenseControlStyles: () => {
2
+ container: string;
3
+ title: string;
4
+ footer: string;
5
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { EStatus } from '@spteck/react-hooks-library';
3
+ export interface ILicensePlaceHolderProps {
4
+ licenseStatus: EStatus;
5
+ licenseType: string | undefined;
6
+ expiryDate: number | undefined;
7
+ }
8
+ export declare const LicensePlaceHolder: React.FunctionComponent<ILicensePlaceHolderProps>;
@@ -0,0 +1,8 @@
1
+ export declare const useStyles: () => {
2
+ container: string;
3
+ titleContainer: string;
4
+ titleAndIcon: string;
5
+ informationPanel: string;
6
+ infoRow: string;
7
+ title: string;
8
+ };
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { BaseComponentContext } from '@microsoft/sp-component-base';
3
+ import { EStatus } from '@spteck/react-hooks-library';
4
+ import { Theme } from '@fluentui/react-components';
5
+ export interface ILicenseProviderProps {
6
+ context: BaseComponentContext;
7
+ theme: Theme;
8
+ language?: string;
9
+ tenantId: string;
10
+ applicationId: string;
11
+ applicationName: string;
12
+ applicationIcon?: JSX.Element;
13
+ placeHolderText?: string;
14
+ showApps?: boolean;
15
+ children?: React.ReactNode;
16
+ onLicenseStatusChange?: (status: EStatus) => void;
17
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { ILicenseProviderProps } from './ILicenseProviderProps';
3
+ export declare const LicenseProvider: React.FunctionComponent<ILicenseProviderProps>;
@@ -0,0 +1,12 @@
1
+ import React, { ElementType } from 'react';
2
+ interface MailtoProps<C extends ElementType> {
3
+ to: string;
4
+ from?: string;
5
+ subject?: string;
6
+ body?: string;
7
+ children: React.ReactNode;
8
+ as?: C;
9
+ componentProps?: React.ComponentProps<C>;
10
+ }
11
+ export declare const Mailto: <C extends React.ElementType<any> = "a">(props: MailtoProps<C>) => JSX.Element;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { Theme } from '@fluentui/react-components';
3
+ import { PricePlan, PricePlanCollection } from '../../zodSchemas/pricePlan';
4
+ export interface IPricePlanProps {
5
+ plans: PricePlanCollection;
6
+ onSelect: (pricePlan: PricePlan) => void;
7
+ theme?: Theme;
8
+ }
9
+ export declare const PricePlans: React.FunctionComponent<IPricePlanProps>;
@@ -0,0 +1,12 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ export declare const usePricePlansStyles: () => {
3
+ styles: {
4
+ container: string;
5
+ cardGrid: string;
6
+ card: string;
7
+ cardBody: string;
8
+ planName: string;
9
+ iconStyle: string;
10
+ cardHeader: string;
11
+ };
12
+ };
@@ -0,0 +1,10 @@
1
+ import { EStatus } from '@spteck/react-hooks-library';
2
+ import React from 'react';
3
+ export interface IRegisterDialogProps {
4
+ licenseStatus: EStatus;
5
+ licenseType: string | undefined;
6
+ expiryDate: number | undefined;
7
+ open: boolean;
8
+ onDismiss: (update?: boolean) => void;
9
+ }
10
+ export declare const RegisterDialog: React.FC<IRegisterDialogProps>;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export interface IRenderHeaderProps {
3
+ onDismiss: (open?: boolean) => void;
4
+ icon?: string | JSX.Element;
5
+ title: string | React.ReactNode;
6
+ description?: string | React.ReactNode;
7
+ }
8
+ export declare const RenderHeader: React.FunctionComponent<IRenderHeaderProps>;
@@ -0,0 +1,2 @@
1
+ export * from './RenderHeader';
2
+ export * from './useRenderHeaderStyles';
@@ -0,0 +1 @@
1
+ export declare const useRenderHeaderStyles: () => Record<"closeButton" | "divider" | "renderHeaderContent" | "renderHeaderHeader" | "renderHeaderFooter" | "renderHeaderBody" | "renderHeaderTitleContainer" | "renderHeaderTitle" | "renderHeaderDescription" | "dialogTitleAndDescriptionContainer", string>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface IErrorDisplayProps {
3
+ message: string;
4
+ }
5
+ export declare const ShowError: React.FC<IErrorDisplayProps>;
6
+ export default ShowError;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface ITrialLicenseProps {
3
+ onTrialLicenseAdded: () => void;
4
+ onDismiss: () => void;
5
+ }
6
+ export declare const TrialLicense: React.FunctionComponent<ITrialLicenseProps>;
@@ -0,0 +1,5 @@
1
+ export declare const useStyles: () => {
2
+ container: string;
3
+ title: string;
4
+ cardFooter: string;
5
+ };
@@ -0,0 +1,3 @@
1
+ export declare const SUPPORT_EMAIL = "geral@spteck.com";
2
+ export declare const EMAIL_BODY_TEMPLATE = "Subject: Support Request from {0} {1}\n\nDear Support Team,\n\nI am reaching out to you because I am experiencing issues with my license. Here are my details:\n\n ** Tenant ID **: {2}\n ** Application ID **: {3} - {4}\n ** User First Name **: {5}\n ** User Last Name **: {6}\n ** Email**: {7}\n\n {8}\n\nBest regards,\n{9} {10}";
3
+ export declare const EMAIL_BODY_TEMPLATE_REQUEST_LICENSE = "Subject: Request for New License {0} {1}\n\nDear Support Team,\n\nI am just contacting you to request a license for the following product. Here are my details:\n\n ** Tenant ID **: {2}\n ** Application ID **: {3} - {4}\n ** User First Name **: {5}\n ** User Last Name **: {6}\n ** Email **: {7}\n\nBest regards,\n{8} {9}";
@@ -0,0 +1,4 @@
1
+ export declare const useUtils: () => {
2
+ formatString: (template: string, ...args: any[]) => string;
3
+ generateSalt: (tenantId: string, appId: string) => string;
4
+ };
@@ -0,0 +1,2 @@
1
+ export * from './components/licensePlaceHolder/LicensePlaceHolder';
2
+ export * from './components/licenseProvider/LicenseProvider';
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./license-manager-react-components.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./license-manager-react-components.cjs.development.js')
8
+ }