@app-studio/web 0.9.26 → 0.9.27

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.
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { ButtonProps } from '../../Button/Button/Button.props';
3
+ export declare type NavigatorShareData = Parameters<Navigator['share']>[0];
4
+ /**
5
+ * Properties for the ShareButton component.
6
+ * Extends the design-system Button while wiring the Web Share API workflow.
7
+ */
8
+ export interface ShareButtonProps extends Omit<ButtonProps, 'onClick'> {
9
+ /** Data passed to the `navigator.share` call. */
10
+ shareData: NavigatorShareData;
11
+ /** Optional label rendered when no custom children are provided. Defaults to "Share". */
12
+ label?: React.ReactNode;
13
+ /** Called immediately before invoking the Web Share API. */
14
+ onShareStart?: () => void;
15
+ /** Called when the share sheet completes successfully. */
16
+ onShareSuccess?: () => void;
17
+ /** Called when the user dismisses the native share sheet. */
18
+ onShareCancel?: () => void;
19
+ /** Called when the share operation throws an unexpected error. */
20
+ onShareError?: (error: unknown) => void;
21
+ /** Called when the Web Share API is not available for the provided data. */
22
+ onUnsupported?: () => void;
23
+ /**
24
+ * When true the button is disabled if the Web Share API is unavailable.
25
+ * Defaults to true to avoid misleading interactions.
26
+ */
27
+ disableWhenUnsupported?: boolean;
28
+ /** Additional click handler fired alongside the share workflow. */
29
+ onClick?: ButtonProps['onClick'];
30
+ }
31
+ export interface ShareButtonViewProps extends Omit<ShareButtonProps, 'shareData' | 'onShareStart' | 'onShareSuccess' | 'onShareCancel' | 'onShareError' | 'onUnsupported' | 'onClick'> {
32
+ /** Flag indicating if the current environment can use the Web Share API. */
33
+ isSupported: boolean;
34
+ /** True while awaiting the native share sheet to resolve. */
35
+ isSharing: boolean;
36
+ /** Internal handler that triggers the sharing flow. */
37
+ onShare: ButtonProps['onClick'];
38
+ }
@@ -0,0 +1,6 @@
1
+ import { ShareButtonProps } from './ShareButton.props';
2
+ export declare const useShareButton: (props: ShareButtonProps) => {
3
+ isSupported: any;
4
+ isSharing: boolean;
5
+ handleShare: (...args: unknown[]) => void;
6
+ };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ShareButtonViewProps } from './ShareButton.props';
3
+ declare const ShareButtonView: React.FC<ShareButtonViewProps>;
4
+ export default ShareButtonView;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ShareButtonProps } from './ShareButton/ShareButton.props';
3
+ export declare const ShareButton: React.FC<ShareButtonProps>;
@@ -3,6 +3,7 @@ import type { TextProps as TextAppProps } from 'app-studio';
3
3
  import { Headings, Size, TextWeights } from './Text.type';
4
4
  export interface TextProps extends Omit<TextAppProps, 'children' | 'style' | 'pointerEvents'> {
5
5
  children?: React.ReactNode;
6
+ backgroundColor?: string;
6
7
  heading?: Headings;
7
8
  isItalic?: boolean;
8
9
  isStriked?: boolean;
@@ -0,0 +1,2 @@
1
+ export declare const getTextColorHex: (backgroundColor: string) => "black" | "white";
2
+ export declare const getTextColor: (backgroundColor: string) => "black" | "white";
@@ -51,6 +51,7 @@ export * from './Menubar/Menubar';
51
51
  export * from './Pagination/Pagination';
52
52
  export * from './ProgressBar/ProgressBar';
53
53
  export * from './Separator/Separator';
54
+ export * from './ShareButton/ShareButton';
54
55
  export * from './StatusIndicator/StatusIndicator';
55
56
  export * from './Sidebar/Sidebar';
56
57
  export * from './Resizable/Resizable';
@@ -108,6 +109,7 @@ export * from './Menubar/Menubar/Menubar.props';
108
109
  export * from './Pagination/Pagination/Pagination.props';
109
110
  export * from './ProgressBar/ProgressBar/ProgressBar.props';
110
111
  export * from './Separator/Separator/Separator.props';
112
+ export * from './ShareButton/ShareButton/ShareButton.props';
111
113
  export * from './StatusIndicator/StatusIndicator/StatusIndicator.props';
112
114
  export * from './Sidebar/Sidebar/Sidebar.props';
113
115
  export * from './Resizable/Resizable/Resizable.props';