@code0-tech/pictor 0.1.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.
- package/LICENSE +29 -0
- package/README.md +0 -0
- package/dist/cjs/components/FontSizes/Text.d.ts +10 -0
- package/dist/cjs/components/alert/Alert.d.ts +19 -0
- package/dist/cjs/components/badge/Badge.d.ts +9 -0
- package/dist/cjs/components/button/Button.d.ts +17 -0
- package/dist/cjs/components/button-group/ButtonGroup.d.ts +8 -0
- package/dist/cjs/components/card/Card.d.ts +20 -0
- package/dist/cjs/components/col/Col.d.ts +14 -0
- package/dist/cjs/components/container/Container.d.ts +7 -0
- package/dist/cjs/components/dropdown/Dropdown.d.ts +24 -0
- package/dist/cjs/components/dropdown/DropdownFooter.d.ts +13 -0
- package/dist/cjs/components/dropdown/DropdownHeader.d.ts +13 -0
- package/dist/cjs/components/dropdown/DropdownItem.d.ts +12 -0
- package/dist/cjs/components/dropdown/DropdownItemGroup.d.ts +12 -0
- package/dist/cjs/components/input/Input.d.ts +37 -0
- package/dist/cjs/components/list-group/ListGroup.d.ts +12 -0
- package/dist/cjs/components/menu/InternalMenu.d.ts +4 -0
- package/dist/cjs/components/menu/Menu.d.ts +41 -0
- package/dist/cjs/components/popover/InternalPopover.d.ts +10 -0
- package/dist/cjs/components/popover/Popover.d.ts +16 -0
- package/dist/cjs/components/quote/Quote.d.ts +12 -0
- package/dist/cjs/components/row/Row.d.ts +7 -0
- package/dist/cjs/components/tooltip/Tooltip.d.ts +18 -0
- package/dist/cjs/index.d.ts +16 -0
- package/dist/cjs/index.js +9202 -0
- package/dist/cjs/utils/types.d.ts +4 -0
- package/dist/cjs/utils/utils.d.ts +16 -0
- package/dist/esm/components/FontSizes/Text.d.ts +10 -0
- package/dist/esm/components/alert/Alert.d.ts +19 -0
- package/dist/esm/components/badge/Badge.d.ts +9 -0
- package/dist/esm/components/button/Button.d.ts +17 -0
- package/dist/esm/components/button-group/ButtonGroup.d.ts +8 -0
- package/dist/esm/components/card/Card.d.ts +20 -0
- package/dist/esm/components/col/Col.d.ts +14 -0
- package/dist/esm/components/container/Container.d.ts +7 -0
- package/dist/esm/components/dropdown/Dropdown.d.ts +24 -0
- package/dist/esm/components/dropdown/DropdownFooter.d.ts +13 -0
- package/dist/esm/components/dropdown/DropdownHeader.d.ts +13 -0
- package/dist/esm/components/dropdown/DropdownItem.d.ts +12 -0
- package/dist/esm/components/dropdown/DropdownItemGroup.d.ts +12 -0
- package/dist/esm/components/input/Input.d.ts +37 -0
- package/dist/esm/components/list-group/ListGroup.d.ts +12 -0
- package/dist/esm/components/menu/InternalMenu.d.ts +4 -0
- package/dist/esm/components/menu/Menu.d.ts +41 -0
- package/dist/esm/components/popover/InternalPopover.d.ts +10 -0
- package/dist/esm/components/popover/Popover.d.ts +16 -0
- package/dist/esm/components/quote/Quote.d.ts +12 -0
- package/dist/esm/components/row/Row.d.ts +7 -0
- package/dist/esm/components/tooltip/Tooltip.d.ts +18 -0
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +9178 -0
- package/dist/esm/utils/types.d.ts +4 -0
- package/dist/esm/utils/utils.d.ts +16 -0
- package/dist/index.d.ts +247 -0
- package/package.json +77 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export declare const getChild: (children: ReactNode | ReactNode[], child: React.FC<any>, required?: boolean) => React.ReactElement | undefined;
|
|
3
|
+
export declare const getContent: (children: ReactNode | ReactNode[], ...child: React.FC<any>[]) => ReactNode[] | null;
|
|
4
|
+
export interface Positioning {
|
|
5
|
+
height: number;
|
|
6
|
+
width: number;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const getWindowPositioning: () => Omit<Omit<Positioning, "x">, "y">;
|
|
11
|
+
export declare const getPositioning: (node: HTMLElement) => Positioning;
|
|
12
|
+
export declare const getPositionAroundTarget: (target: HTMLElement, element: HTMLElement, position?: 'top' | 'bottom' | 'left' | 'right') => {
|
|
13
|
+
position: string;
|
|
14
|
+
y: number;
|
|
15
|
+
x: number;
|
|
16
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import React, { ReactNode, HTMLProps, DetailedHTMLProps, AnchorHTMLAttributes, ReactElement, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { TablerIconsProps } from '@tabler/icons-react';
|
|
3
|
+
import { PositionProps, OverlayTriggerProps } from '@react-types/overlays';
|
|
4
|
+
import { AriaMenuProps, Key } from 'react-aria';
|
|
5
|
+
|
|
6
|
+
type Color = "primary" | "secondary" | "info" | "success" | "warning" | "error";
|
|
7
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
8
|
+
|
|
9
|
+
interface AlertType {
|
|
10
|
+
children?: ReactNode | ReactNode[];
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
color?: Color;
|
|
13
|
+
icon?: boolean;
|
|
14
|
+
dismissible?: boolean;
|
|
15
|
+
onClose?: (event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Alert: React.FC<AlertType>;
|
|
18
|
+
|
|
19
|
+
interface BadgeType extends HTMLProps<HTMLSpanElement> {
|
|
20
|
+
children: string;
|
|
21
|
+
color?: Color;
|
|
22
|
+
}
|
|
23
|
+
declare const Badge: React.FC<BadgeType>;
|
|
24
|
+
|
|
25
|
+
interface ButtonType extends DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
|
26
|
+
children: ReactNode | ReactNode[];
|
|
27
|
+
color?: Color;
|
|
28
|
+
variant?: "none" | "normal" | "outlined" | "filled";
|
|
29
|
+
active?: boolean;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface ButtonIconType {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
declare const _default$7: React.FC<ButtonType> & {
|
|
36
|
+
Icon: React.FC<ButtonIconType>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
interface ButtonGroupType {
|
|
40
|
+
children: ReactElement<ButtonType>[];
|
|
41
|
+
}
|
|
42
|
+
declare const ButtonGroup: React.FC<ButtonGroupType>;
|
|
43
|
+
|
|
44
|
+
interface CardType extends HTMLProps<HTMLDivElement> {
|
|
45
|
+
children: ReactNode | ReactNode[];
|
|
46
|
+
color?: Color;
|
|
47
|
+
variant?: "none" | "normal" | "outlined" | "filled";
|
|
48
|
+
gradient?: boolean;
|
|
49
|
+
gradientPosition?: "top-left" | "top-right" | "bottom-right" | "bottom-left";
|
|
50
|
+
outline?: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface SectionType {
|
|
53
|
+
children: ReactNode | ReactNode[];
|
|
54
|
+
image?: boolean;
|
|
55
|
+
border?: boolean;
|
|
56
|
+
}
|
|
57
|
+
declare const _default$6: React.FC<CardType> & {
|
|
58
|
+
Section: React.FC<SectionType>;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type ColBreakPointRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
62
|
+
interface ColType extends HTMLProps<HTMLDivElement> {
|
|
63
|
+
children: ReactNode | ReactNode[];
|
|
64
|
+
xs?: ColBreakPointRange;
|
|
65
|
+
sm?: ColBreakPointRange;
|
|
66
|
+
md?: ColBreakPointRange;
|
|
67
|
+
lg?: ColBreakPointRange;
|
|
68
|
+
xl?: ColBreakPointRange;
|
|
69
|
+
xxl?: ColBreakPointRange;
|
|
70
|
+
}
|
|
71
|
+
declare const Col: React.FC<ColType>;
|
|
72
|
+
|
|
73
|
+
interface ContainerType extends HTMLProps<HTMLDivElement> {
|
|
74
|
+
children: ReactNode | ReactNode[];
|
|
75
|
+
}
|
|
76
|
+
declare const Container: React.FC<ContainerType>;
|
|
77
|
+
|
|
78
|
+
interface DropdownItemType {
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface DropdownItemGroupType {
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface DropdownFooterType {
|
|
87
|
+
children: ReactNode;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface DropdownHeaderType {
|
|
91
|
+
children: ReactNode;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface DropdownType$1 {
|
|
95
|
+
children: ReactElement<DropdownTriggerType & DropdownMenuType>[];
|
|
96
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
97
|
+
align?: 'start' | 'center' | 'end';
|
|
98
|
+
maxWidthFactor?: number;
|
|
99
|
+
}
|
|
100
|
+
interface DropdownTriggerType {
|
|
101
|
+
children: ReactNode;
|
|
102
|
+
}
|
|
103
|
+
interface DropdownMenuType {
|
|
104
|
+
children: ReactNode;
|
|
105
|
+
}
|
|
106
|
+
declare const _default$5: React.FC<DropdownType$1> & {
|
|
107
|
+
Trigger: React.FC<DropdownTriggerType>;
|
|
108
|
+
Menu: React.FC<DropdownMenuType>;
|
|
109
|
+
Header: React.FC<DropdownHeaderType>;
|
|
110
|
+
Footer: React.FC<DropdownFooterType>;
|
|
111
|
+
Group: React.FC<DropdownItemGroupType> & {
|
|
112
|
+
Item: React.FC<DropdownItemType>;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
interface FontType extends Omit<Omit<HTMLProps<HTMLSpanElement>, "children">, "size"> {
|
|
117
|
+
children: string;
|
|
118
|
+
size: Size;
|
|
119
|
+
hierarchy?: "primary" | "secondary" | "tertiary";
|
|
120
|
+
}
|
|
121
|
+
declare const Text: React.FC<FontType>;
|
|
122
|
+
|
|
123
|
+
type InputChildType = InputControlType | InputDescType | InputLabelType;
|
|
124
|
+
interface InputType {
|
|
125
|
+
children: ReactElement<InputControlType> | ReactElement<InputChildType>[];
|
|
126
|
+
disabled?: boolean;
|
|
127
|
+
valid?: boolean | undefined;
|
|
128
|
+
}
|
|
129
|
+
type InputControlTypesType = "email" | "date" | "datetime-local" | "hidden" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
|
|
130
|
+
interface InputControlType extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
131
|
+
placeholder: string;
|
|
132
|
+
children?: ReactElement<InputControlMessageType | InputControlIconType>[] | ReactElement<InputControlMessageType | InputControlIconType>;
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
type?: InputControlTypesType;
|
|
135
|
+
}
|
|
136
|
+
type InputControlMessageType = {
|
|
137
|
+
children: string;
|
|
138
|
+
};
|
|
139
|
+
type InputControlIconType = {
|
|
140
|
+
children: ReactElement<TablerIconsProps>;
|
|
141
|
+
};
|
|
142
|
+
type InputLabelType = {
|
|
143
|
+
children: string;
|
|
144
|
+
};
|
|
145
|
+
type InputDescType = {
|
|
146
|
+
children: string;
|
|
147
|
+
};
|
|
148
|
+
declare const _default$4: React.FC<InputType> & {
|
|
149
|
+
Desc: React.FC<InputDescType>;
|
|
150
|
+
Label: React.FC<InputLabelType>;
|
|
151
|
+
Control: React.ForwardRefExoticComponent<Omit<InputControlType, "ref"> & React.RefAttributes<HTMLInputElement>> & {
|
|
152
|
+
Message: React.FC<InputControlMessageType>;
|
|
153
|
+
Icon: React.FC<InputControlIconType>;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
interface ListGroupType {
|
|
158
|
+
children: ReactElement<ListGroupItemType> | ReactElement<ListGroupItemType>[];
|
|
159
|
+
}
|
|
160
|
+
interface ListGroupItemType {
|
|
161
|
+
children: ReactNode;
|
|
162
|
+
}
|
|
163
|
+
declare const _default$3: React.FC<ListGroupType> & {
|
|
164
|
+
Item: React.FC<ListGroupItemType>;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
interface PopoverProps extends PositionProps, OverlayTriggerProps {
|
|
168
|
+
children: React.ReactElement<PopoverTriggerType & PopoverContentType>[];
|
|
169
|
+
}
|
|
170
|
+
interface PopoverTriggerType {
|
|
171
|
+
children: React.ReactElement;
|
|
172
|
+
}
|
|
173
|
+
interface PopoverContentType {
|
|
174
|
+
children: React.ReactNode;
|
|
175
|
+
}
|
|
176
|
+
declare const _default$2: React.FC<PopoverProps> & {
|
|
177
|
+
Trigger: React.FC<PopoverTriggerType>;
|
|
178
|
+
Content: React.FC<PopoverContentType>;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
interface MenuType<T> extends AriaMenuProps<T>, PopoverProps {
|
|
182
|
+
children: React.ReactElement<MenuTriggerType & MenuContentType>[];
|
|
183
|
+
}
|
|
184
|
+
interface MenuTriggerType {
|
|
185
|
+
children: React.ReactElement;
|
|
186
|
+
}
|
|
187
|
+
interface MenuContentType {
|
|
188
|
+
children: React.ReactNode;
|
|
189
|
+
}
|
|
190
|
+
interface MenuItemType {
|
|
191
|
+
children: React.ReactNode;
|
|
192
|
+
key: Key;
|
|
193
|
+
color?: Color;
|
|
194
|
+
disabled?: boolean;
|
|
195
|
+
unselectable?: boolean;
|
|
196
|
+
textValue?: string;
|
|
197
|
+
}
|
|
198
|
+
interface MenuShortcutType {
|
|
199
|
+
children: string;
|
|
200
|
+
}
|
|
201
|
+
interface MenuIconType {
|
|
202
|
+
children: React.ReactNode;
|
|
203
|
+
}
|
|
204
|
+
interface MenuSectionType {
|
|
205
|
+
children: React.ReactElement<MenuItemType> | React.ReactElement<MenuItemType>[];
|
|
206
|
+
title?: string;
|
|
207
|
+
}
|
|
208
|
+
declare const _default$1: React.FC<MenuType<any>> & {
|
|
209
|
+
Trigger: React.FC<MenuTriggerType>;
|
|
210
|
+
Content: React.FC<MenuContentType>;
|
|
211
|
+
Item: React.FC<MenuItemType>;
|
|
212
|
+
Shortcut: React.FC<MenuShortcutType>;
|
|
213
|
+
Section: React.FC<MenuSectionType>;
|
|
214
|
+
Icon: React.FC<MenuIconType>;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
interface QuoteType extends Omit<CardType, "children"> {
|
|
218
|
+
children: string;
|
|
219
|
+
logo: string;
|
|
220
|
+
name: string;
|
|
221
|
+
position: string;
|
|
222
|
+
inlineBorder?: boolean;
|
|
223
|
+
}
|
|
224
|
+
declare const Quote: React.FC<QuoteType>;
|
|
225
|
+
|
|
226
|
+
interface RowType extends HTMLProps<HTMLDivElement> {
|
|
227
|
+
children: ReactNode | ReactNode[];
|
|
228
|
+
}
|
|
229
|
+
declare const Row: React.FC<RowType>;
|
|
230
|
+
|
|
231
|
+
interface DropdownType {
|
|
232
|
+
children: ReactElement<TooltipTriggerType & TooltipMenuType>[];
|
|
233
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
234
|
+
align?: 'start' | 'center' | 'end';
|
|
235
|
+
}
|
|
236
|
+
interface TooltipTriggerType {
|
|
237
|
+
children: ReactNode;
|
|
238
|
+
}
|
|
239
|
+
interface TooltipMenuType {
|
|
240
|
+
children: ReactNode;
|
|
241
|
+
}
|
|
242
|
+
declare const _default: React.FC<DropdownType> & {
|
|
243
|
+
Trigger: React.FC<TooltipTriggerType>;
|
|
244
|
+
Menu: React.FC<TooltipMenuType>;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export { Alert, Badge, _default$7 as Button, ButtonGroup, _default$6 as Card, Col, Container, _default$5 as Dropdown, _default$4 as Input, _default$3 as ListGroup, _default$1 as Menu, _default$2 as Popover, Quote, Row, Text, _default as Tooltip };
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@code0-tech/pictor",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A simple template for a custom React component library",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "npm run storybook:dev",
|
|
7
|
+
"build": "npm run clear && npm run rollup",
|
|
8
|
+
"clear": "concurrently --kill-others \"rimraf ./dist\" \"rimraf ./storybook-static\"",
|
|
9
|
+
"rollup": "rollup -c",
|
|
10
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
11
|
+
"storybook:build": "storybook build",
|
|
12
|
+
"storybook:test": "test-storybook",
|
|
13
|
+
"storybook:test:all": "test-storybook --browsers chromium firefox webkit",
|
|
14
|
+
"storybook:test:update": "npm run storybook:test:all -- -u",
|
|
15
|
+
"docs:preview": "npm run --prefix ../telescopium project:preview pictor"
|
|
16
|
+
},
|
|
17
|
+
"author": "Code0",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@mdx-js/react": "^2.1.2",
|
|
20
|
+
"@rollup/plugin-commonjs": "^21.1.0",
|
|
21
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
22
|
+
"@rollup/plugin-typescript": "^8.5.0",
|
|
23
|
+
"@storybook/addon-a11y": "^7.6.4",
|
|
24
|
+
"@storybook/addon-essentials": "^7.5.3",
|
|
25
|
+
"@storybook/addon-interactions": "^7.5.3",
|
|
26
|
+
"@storybook/addon-links": "^7.5.3",
|
|
27
|
+
"@storybook/addon-onboarding": "^1.0.8",
|
|
28
|
+
"@storybook/blocks": "^7.5.3",
|
|
29
|
+
"@storybook/cli": "^7.5.3",
|
|
30
|
+
"@storybook/manager-api": "^7.5.3",
|
|
31
|
+
"@storybook/react": "^7.5.3",
|
|
32
|
+
"@storybook/react-vite": "^7.5.3",
|
|
33
|
+
"@storybook/test-runner": "^0.16.0",
|
|
34
|
+
"@storybook/testing-library": "^0.2.2",
|
|
35
|
+
"@storybook/theming": "^7.5.3",
|
|
36
|
+
"@tabler/icons-react": "^2.42.0",
|
|
37
|
+
"@types/react": "^18.0.15",
|
|
38
|
+
"axe-playwright": "^1.2.3",
|
|
39
|
+
"babel-loader": "^8.2.3",
|
|
40
|
+
"concurrently": "^8.2.2",
|
|
41
|
+
"css-loader": "^6.5.1",
|
|
42
|
+
"html-webpack-plugin": "^5.5.0",
|
|
43
|
+
"identity-obj-proxy": "^3.0.0",
|
|
44
|
+
"jest-image-snapshot": "^6.4.0",
|
|
45
|
+
"react": "^18.2.0",
|
|
46
|
+
"react-dom": "^18.2.0",
|
|
47
|
+
"rimraf": "^5.0.5",
|
|
48
|
+
"rollup": "^2.60.0",
|
|
49
|
+
"rollup-plugin-dts": "^4.0.1",
|
|
50
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
51
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
52
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
53
|
+
"sass": "^1.43.5",
|
|
54
|
+
"sass-loader": "^12.3.0",
|
|
55
|
+
"storybook": "^7.5.3",
|
|
56
|
+
"style-loader": "^3.3.1",
|
|
57
|
+
"typescript": "^4.7.4"
|
|
58
|
+
},
|
|
59
|
+
"main": "dist/cjs/index.js",
|
|
60
|
+
"module": "dist/esm/index.js",
|
|
61
|
+
"files": [
|
|
62
|
+
"dist"
|
|
63
|
+
],
|
|
64
|
+
"types": "dist/index.d.ts",
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"react": "18.2.0",
|
|
67
|
+
"react-dom": "18.2.0"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"react-aria": "^3.31.1",
|
|
74
|
+
"react-stately": "^3.29.1",
|
|
75
|
+
"rollup-plugin-visualizer": "^5.11.0"
|
|
76
|
+
}
|
|
77
|
+
}
|