@okam/stack-ui 0.0.1
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/components/Accordion/index.d.ts +3 -0
- package/components/Accordion/interface.d.ts +16 -0
- package/components/Button/index.d.ts +5 -0
- package/components/Button/interface.d.ts +15 -0
- package/components/Icon/index.d.ts +3 -0
- package/components/Icon/interface.d.ts +6 -0
- package/components/Lightbox/hooks/overlay/index.d.ts +12 -0
- package/components/Lightbox/hooks/overlay/interface.d.ts +2 -0
- package/components/Lightbox/index.d.ts +3 -0
- package/components/Lightbox/interface.d.ts +19 -0
- package/components/Modal/Dialog.d.ts +3 -0
- package/components/Modal/index.d.ts +3 -0
- package/components/Modal/interface.d.ts +11 -0
- package/components/Popover/index.d.ts +10 -0
- package/components/Popover/interface.d.ts +11 -0
- package/components/ShareButton/index.d.ts +4 -0
- package/components/ShareButton/interface.d.ts +23 -0
- package/components/ShareButton/utils/generateUtmTags.d.ts +2 -0
- package/components/ShareButton/utils/useFacebookShareUrl.d.ts +2 -0
- package/components/ShareButton/utils/useMailToShareUrl.d.ts +2 -0
- package/components/ShareButton/utils/useTwitterShareUrl.d.ts +2 -0
- package/components/ShareButton/utils/useWindow.d.ts +5 -0
- package/components/SidePanel/index.d.ts +4 -0
- package/components/SidePanel/interface.d.ts +9 -0
- package/components/Typography/index.d.ts +5 -0
- package/components/Typography/interface.d.ts +10 -0
- package/components/WysiwygBlock/index.d.ts +3 -0
- package/components/WysiwygBlock/interface.d.ts +5 -0
- package/components/icons/ArrowRight.d.ts +3 -0
- package/components/icons/IconFallback.d.ts +3 -0
- package/index.d.ts +20 -0
- package/index.js +3 -0
- package/index.mjs +5815 -0
- package/package.json +18 -0
- package/providers/SidePanel/index.d.ts +4 -0
- package/providers/SidePanel/interface.d.ts +17 -0
- package/providers/Theme/hooks.d.ts +3 -0
- package/providers/Theme/index.d.ts +9 -0
- package/providers/Theme/interface.d.ts +23 -0
- package/providers/Theme/utils.d.ts +2 -0
- package/transitions/ModalTransition.d.ts +7 -0
- package/transitions/RenderWithSlide.d.ts +7 -0
- package/transitions/SidePanelTransition.d.ts +7 -0
- package/types/components.d.ts +23 -0
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@okam/stack-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./index.js",
|
|
5
|
+
"types": "./index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./index.mjs",
|
|
9
|
+
"require": "./index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"url": "https://github.com/OKAMca/stack.git"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TSidePanelContext, TSidePanelProviderProps } from './interface';
|
|
3
|
+
export declare const useSidePanel: () => TSidePanelContext, SidePanelProvider: import("react").Provider<TSidePanelContext | undefined>;
|
|
4
|
+
export declare function SidePanelContextProvider({ children, defaultSelectedKey }: TSidePanelProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OverlayTriggerState } from '@react-stately/overlays';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
export type TSidePanelProviderProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
defaultSelectedKey: string;
|
|
6
|
+
};
|
|
7
|
+
export type TButtonProps = {
|
|
8
|
+
closeButtonProps: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
9
|
+
closeButtonRef: React.MutableRefObject<null>;
|
|
10
|
+
openButtonProps: React.HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
openButtonRef: React.MutableRefObject<null>;
|
|
12
|
+
};
|
|
13
|
+
export type TSidePanelContext = {
|
|
14
|
+
defaultSelectedKey: string;
|
|
15
|
+
overlayState: OverlayTriggerState;
|
|
16
|
+
buttonProps: TButtonProps;
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TThemeProviderProps, TThemePanelContext, TTheme } from './interface';
|
|
3
|
+
export declare function createCtxNullable<A extends Record<string, unknown> | null>(): readonly [() => A | null, React.Provider<A | undefined>];
|
|
4
|
+
export declare const useTheme: () => TThemePanelContext<TTheme> | null, ThemeProvider: React.Provider<TThemePanelContext<TTheme> | undefined>;
|
|
5
|
+
export declare function ThemeContextProvider({ children, brandTheme }: TThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const createThemeProvider: (brandTheme: TTheme) => ({ children }: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { makeTheme } from './utils';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export type TStyleValue = false | string;
|
|
3
|
+
export type TToken = Record<string, string | boolean>;
|
|
4
|
+
export type TFunc = (props: TToken) => TStyleValue[] | string;
|
|
5
|
+
export type TThemeRecord = Record<string, TFunc>;
|
|
6
|
+
export type TTheme = Record<string, TFunc | TThemeRecord>;
|
|
7
|
+
export type TStyle = Record<string, TStyleValue>;
|
|
8
|
+
export type TCustomTheme = TStyleValue[] | null | undefined;
|
|
9
|
+
export type TStyleCollection = Record<string, TStyle>;
|
|
10
|
+
export type TDefaultTheme = {
|
|
11
|
+
typography: (props: TToken) => TStyleValue[] | string;
|
|
12
|
+
};
|
|
13
|
+
export type TThemeProviderProps<T = TTheme> = {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
brandTheme?: T;
|
|
16
|
+
};
|
|
17
|
+
export type TThemePanelContext<T = TTheme> = {
|
|
18
|
+
brandTheme: T;
|
|
19
|
+
};
|
|
20
|
+
export interface ITheme {
|
|
21
|
+
defaultTokens: TToken;
|
|
22
|
+
styles: TStyleCollection;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { RefCallBack } from 'react-hook-form';
|
|
3
|
+
import type { TCustomTheme, TToken } from '../providers/Theme/interface';
|
|
4
|
+
export interface TDefaultComponent<T = TToken> {
|
|
5
|
+
as?: React.ElementType<any>;
|
|
6
|
+
customTheme?: TCustomTheme;
|
|
7
|
+
tokens?: T;
|
|
8
|
+
themeName?: string | null;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export type TReactHookForm = {
|
|
12
|
+
onBlur?: (...event: any[]) => void;
|
|
13
|
+
onChange?: (...event: any[]) => void;
|
|
14
|
+
fieldRef?: RefCallBack;
|
|
15
|
+
min?: string | number | undefined;
|
|
16
|
+
max?: string | number | undefined;
|
|
17
|
+
maxLength?: number | undefined;
|
|
18
|
+
minLength?: number | undefined;
|
|
19
|
+
pattern?: string | undefined;
|
|
20
|
+
validation?: object;
|
|
21
|
+
};
|
|
22
|
+
export type Nullable<T> = T | undefined | null;
|
|
23
|
+
export type Maybe<T> = T | null;
|