jattac.libs.web.zest-button 1.2.2 → 1.2.4

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/README.md CHANGED
@@ -37,13 +37,15 @@ export default App;
37
37
 
38
38
  ### Documentation
39
39
 
40
+ To get started, check out our **Cookbook** of practical recipes.
41
+
40
42
  | Topic | Description |
41
43
  | :--- | :--- |
42
- | **[Features](./docs/features.md)** | A guided tour of all component features with live examples. |
43
- | **[API Reference](./docs/api.md)** | An exhaustive technical reference for all props and type definitions. |
44
- | **[Examples](./docs/examples.md)** | A cookbook of practical, real-world examples for common use cases. |
45
- | **[Configuration](./docs/configuration.md)**| A guide to configuring themes and other component-wide settings. |
46
- | **[Development](./docs/development.md)** | Information for contributors on the project's architecture and setup. |
44
+ | **[The Cookbook](./docs/examples.md)** | **(Start Here)** A collection of practical, real-world recipes to master `ZestButton`. |
45
+ | **[Features Showcase](./docs/features.md)** | A high-level visual tour of what's possible. |
46
+ | **[API Reference](./docs/api.md)** | An exhaustive technical reference for all props and types. |
47
+ | **[Configuration Guide](./docs/configuration.md)**| A deep dive into global configuration using the `ZestProvider`. |
48
+ | **[Development Guide](./docs/development.md)** | Information for contributors on the project's architecture and setup. |
47
49
  | **[Breaking Changes](./docs/breaking-changes.md)** | A log of breaking changes to assist with version upgrades. |
48
50
 
49
51
  ### License
@@ -3,6 +3,9 @@ export type ZestVariant = "standard" | "success" | "danger";
3
3
  export type ZestSize = "sm" | "md" | "lg";
4
4
  export type ZestTheme = 'light' | 'dark' | 'system';
5
5
  export type ZestButtonStyle = 'solid' | 'outline' | 'text' | 'dashed';
6
+ export interface CustomZestSemanticTypes {
7
+ }
8
+ export type SemanticType = 'add' | 'save' | 'submit' | 'edit' | 'update' | 'delete' | 'remove' | 'cancel' | 'close' | 'view' | 'details' | 'download' | 'upload' | 'refresh' | 'reload' | 'print' | 'share' | 'confirm' | keyof CustomZestSemanticTypes;
6
9
  /**
7
10
  * Visual appearance of the button
8
11
  */
@@ -29,11 +32,11 @@ interface SuccessOptions {
29
32
  showFailIcon?: boolean;
30
33
  autoResetAfterMs?: number;
31
34
  }
32
- interface ConfirmOptions {
35
+ export interface ConfirmOptions {
33
36
  displayLabel: string;
34
37
  timeoutSecs: number;
35
38
  }
36
- interface ZestCustomProps {
39
+ export interface ZestCustomProps {
37
40
  visualOptions?: VisualOptions;
38
41
  busyOptions?: BusyOptions;
39
42
  successOptions?: SuccessOptions;
@@ -41,6 +44,7 @@ interface ZestCustomProps {
41
44
  isDefault?: boolean;
42
45
  theme?: ZestTheme;
43
46
  buttonStyle?: ZestButtonStyle;
47
+ semanticType?: SemanticType;
44
48
  }
45
49
  /**
46
50
  * All supported props
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ZestCustomProps } from './ZestButton';
3
+ export interface ZestGlobalConfig {
4
+ defaultProps?: ZestCustomProps;
5
+ semanticTypeDefaults?: Partial<Record<string, Partial<ZestCustomProps>>>;
6
+ }
7
+ declare const ZestContext: React.Context<ZestGlobalConfig | undefined>;
8
+ export declare const useZest: () => ZestGlobalConfig | undefined;
9
+ export default ZestContext;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ZestGlobalConfig } from './ZestContext';
3
+ interface ZestProviderProps {
4
+ config: ZestGlobalConfig;
5
+ children: React.ReactNode;
6
+ }
7
+ declare const ZestProvider: React.FC<ZestProviderProps>;
8
+ export default ZestProvider;
@@ -0,0 +1,20 @@
1
+ import { ZestCustomProps } from '../ZestButton';
2
+ interface UseBusyStateProps {
3
+ busyOptions: ZestCustomProps['busyOptions'];
4
+ successOptions: ZestCustomProps['successOptions'];
5
+ }
6
+ export declare const useBusyState: ({ busyOptions, successOptions }: UseBusyStateProps) => {
7
+ internalBusy: boolean;
8
+ wasSuccessful: boolean;
9
+ wasFailed: boolean;
10
+ startBusy: () => void;
11
+ endBusy: (isSuccess: boolean) => void;
12
+ handleInternally: boolean;
13
+ preventRageClick: boolean;
14
+ minBusyDurationMs: number;
15
+ showCheckmark: boolean;
16
+ showFailIcon: boolean;
17
+ autoResetAfterMs: number;
18
+ failTimeoutRef: import("react").MutableRefObject<NodeJS.Timeout | null>;
19
+ };
20
+ export {};
@@ -0,0 +1,13 @@
1
+ import { ZestCustomProps } from '../ZestButton';
2
+ interface UseConfirmationProps {
3
+ confirmOptions?: ZestCustomProps['confirmOptions'];
4
+ originalChildren: React.ReactNode;
5
+ onConfirmFail?: () => void;
6
+ }
7
+ export declare const useConfirmation: ({ confirmOptions, originalChildren, onConfirmFail }: UseConfirmationProps) => {
8
+ awaitingConfirm: boolean;
9
+ currentChildren: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | import("react").ReactPortal | null | undefined;
10
+ startConfirmation: () => void;
11
+ stopConfirmation: () => void;
12
+ };
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useThemeDetection: () => "light" | "dark";
@@ -0,0 +1,2 @@
1
+ import { ZestCustomProps } from '../ZestButton';
2
+ export declare const useZestConfig: (localZestProps?: ZestCustomProps) => ZestCustomProps;