forstok-ui-lib 2.0.0 → 3.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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent, Dispatch, SetStateAction, KeyboardEvent, FocusEvent, InputHTMLAttributes, ChangeEvent, PropsWithChildren, ButtonHTMLAttributes, RefObject } from 'react';
3
+ import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent, Dispatch, SetStateAction, KeyboardEvent, FocusEvent, ChangeEvent, DragEvent, InputHTMLAttributes, PropsWithChildren, ButtonHTMLAttributes, RefObject } from 'react';
4
4
  import * as styled_components from 'styled-components';
5
5
  import * as styled_components_dist_types from 'styled-components/dist/types';
6
6
 
@@ -27,8 +27,52 @@ type TLinkBase = {
27
27
  }));
28
28
  declare const LinkComponent: ({ children, mode, $activated, href, $elipsis, $shadow, disabled, ...props }: TLinkBase) => react_jsx_runtime.JSX.Element;
29
29
 
30
+ type RemoveUnderscoreFirstLetter<S extends string> = S extends `${infer FirstLetter}${infer U}` ? `${FirstLetter extends "_" ? U : `${FirstLetter}${U}`}` : S;
31
+ type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${RemoveUnderscoreFirstLetter<Lowercase<T>>}${CamelToSnakeCase<U>}` : S;
32
+ type WithRequired<T, K extends keyof T> = T & {
33
+ [P in K]-?: T[P];
34
+ };
35
+ type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
36
+ type KeysToSnakeCase<T extends object> = {
37
+ [K in keyof T as CamelToSnakeCase<K & string>]: T[K];
38
+ };
39
+ type TIdNum = {
40
+ id: number;
41
+ };
42
+ type TIdStr = {
43
+ id: string;
44
+ };
45
+ type TObject = {
46
+ [key: string]: any;
47
+ };
48
+ type TMouseEvent = (e: MouseEvent) => void;
49
+ type TChangeEvent = (e: ChangeEvent) => void;
50
+ type TDragEvent = (e: DragEvent) => void;
30
51
  type TEnterEvent = (e: KeyboardEvent<HTMLInputElement | HTMLElement> | FocusEvent<HTMLInputElement | HTMLElement | Element> | MouseEvent<HTMLElement>) => void;
31
52
  type TKeyboadEvent = (e: KeyboardEvent<HTMLInputElement>) => void;
53
+ type TPage = {
54
+ totalCount: number;
55
+ totalPageCount: number;
56
+ pageInfo: {
57
+ endCursor?: string | null;
58
+ hasNextPage: boolean;
59
+ hasPreviousPage: boolean;
60
+ startCursor?: string | null;
61
+ };
62
+ pageCursors?: {
63
+ page: number;
64
+ startCursor: string;
65
+ endCursor: string;
66
+ }[] | null;
67
+ };
68
+ type TFile = {
69
+ name: string;
70
+ file: File;
71
+ };
72
+ type TFileImage = TFile & {
73
+ src: string;
74
+ url?: string;
75
+ };
32
76
  type TState<T> = Dispatch<SetStateAction<T>>;
33
77
 
34
78
  type TInput$1 = InputHTMLAttributes<HTMLInputElement> & {
@@ -129,4 +173,23 @@ declare const TabsContent: styled_components_dist_types.IStyledComponentBase<"we
129
173
  declare const FoContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
130
174
  declare const InfoGroup: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
131
175
 
132
- export { ButtonComponent, CheckboxComponent, FoContainer, HeaderContainer, IconComponent, InfoGroup, InputComponent, LabelComponent, LinkComponent, ListContainer, LoadingComponent, PanelContainer, PanelWrapper, TabsContainer, TabsContent, TextComponent, Title, boxBase, clearList, dropBase, elipsis, formLabel, headTable, multiElipsis, responseWidth, thirdElipsis };
176
+ type TUser = {
177
+ profile_id: number;
178
+ profile_name: string;
179
+ id: number;
180
+ username: string;
181
+ email: string;
182
+ freshchat_restore_id: string | number | null;
183
+ credentials: {
184
+ aws_access_key: string;
185
+ aws_secret_access_key: string;
186
+ aws_bucket_name: string;
187
+ aws_region: string;
188
+ chat_token: string;
189
+ shopee_partner_id: string;
190
+ shopee_partner_key: string;
191
+ };
192
+ has_access_orderV1: boolean;
193
+ };
194
+
195
+ export { ButtonComponent, CheckboxComponent, FoContainer, HeaderContainer, IconComponent, InfoGroup, InputComponent, type KeysToSnakeCase, LabelComponent, LinkComponent, ListContainer, LoadingComponent, PanelContainer, PanelWrapper, type PartialBy, type TChangeEvent, type TDragEvent, type TEnterEvent, type TFile, type TFileImage, type TIdNum, type TIdStr, type TKeyboadEvent, type TMouseEvent, type TObject, type TPage, type TState, type TUser, TabsContainer, TabsContent, TextComponent, Title, type WithRequired, boxBase, clearList, dropBase, elipsis, formLabel, headTable, multiElipsis, responseWidth, thirdElipsis };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "2.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@
2
2
 
3
3
  export * from './components';
4
4
  export * from './assets';
5
+ export * from './typeds';
@@ -0,0 +1,2 @@
1
+ export * from './base.typed';
2
+ export * from './shares.typed';
@@ -0,0 +1,18 @@
1
+ export type TUser = {
2
+ profile_id: number,
3
+ profile_name: string,
4
+ id: number,
5
+ username: string,
6
+ email: string,
7
+ freshchat_restore_id: string|number | null,
8
+ credentials: {
9
+ aws_access_key: string,
10
+ aws_secret_access_key: string,
11
+ aws_bucket_name: string,
12
+ aws_region: string,
13
+ chat_token: string,
14
+ shopee_partner_id: string,
15
+ shopee_partner_key: string
16
+ },
17
+ has_access_orderV1: boolean
18
+ }