@code0-tech/pictor 0.6.1 → 0.6.3
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 +1 -1
- package/dist/assets/components/command/Command.style.css +1 -1
- package/dist/assets/components/gantt/Gantt.style.css +1 -0
- package/dist/assets/components/layout/Layout.style.css +1 -1
- package/dist/components/alert/Alert.d.ts +2 -2
- package/dist/components/alert/Alert.js +8 -7
- package/dist/components/avatar/Avatar.d.ts +2 -2
- package/dist/components/avatar/Avatar.js +30 -27
- package/dist/components/badge/Badge.d.ts +2 -2
- package/dist/components/badge/Badge.js +26 -23
- package/dist/components/breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js +16 -14
- package/dist/components/button/Button.d.ts +3 -3
- package/dist/components/button/Button.js +13 -12
- package/dist/components/button-group/ButtonGroup.d.ts +2 -2
- package/dist/components/button-group/ButtonGroup.js +23 -20
- package/dist/components/card/Card.d.ts +3 -3
- package/dist/components/card/Card.js +19 -16
- package/dist/components/card/CardSection.d.ts +2 -2
- package/dist/components/card/CardSection.js +16 -13
- package/dist/components/col/Col.d.ts +2 -2
- package/dist/components/col/Col.js +22 -19
- package/dist/components/command/Command.d.ts +12 -12
- package/dist/components/command/Command.js +91 -78
- package/dist/components/container/Container.d.ts +2 -2
- package/dist/components/container/Container.js +13 -10
- package/dist/components/context-menu/ContextMenu.d.ts +13 -13
- package/dist/components/context-menu/ContextMenu.js +26 -25
- package/dist/components/data-table/DataTable.d.ts +2 -2
- package/dist/components/data-table/DataTable.js +18 -17
- package/dist/components/data-table/DataTableColumn.d.ts +2 -2
- package/dist/components/data-table/DataTableColumn.js +12 -11
- package/dist/components/data-table/DataTableFilterInput.js +4 -3
- package/dist/components/dialog/Dialog.d.ts +12 -12
- package/dist/components/dialog/Dialog.js +24 -23
- package/dist/components/editor/Editor.d.ts +2 -2
- package/dist/components/editor/Editor.js +4 -3
- package/dist/components/file-tabs/FileTabs.d.ts +5 -5
- package/dist/components/file-tabs/FileTabs.js +38 -35
- package/dist/components/flex/Flex.d.ts +2 -2
- package/dist/components/flex/Flex.js +16 -13
- package/dist/components/form/CheckboxInput.js +17 -15
- package/dist/components/form/Input.d.ts +3 -3
- package/dist/components/form/Input.js +4 -3
- package/dist/components/form/PinInput.d.ts +3 -3
- package/dist/components/form/PinInput.js +33 -30
- package/dist/components/form/RadioGroup.js +22 -19
- package/dist/components/form/RadioInput.d.ts +2 -2
- package/dist/components/form/RadioInput.js +19 -16
- package/dist/components/fullscreen/FullScreen.d.ts +2 -2
- package/dist/components/fullscreen/FullScreen.js +8 -6
- package/dist/components/gantt/Gantt.d.ts +12 -0
- package/dist/components/gantt/Gantt.js +92 -0
- package/dist/components/gantt/GanttFooter.d.ts +2 -0
- package/dist/components/gantt/GanttFooter.js +38 -0
- package/dist/components/gantt/GanttGroup.d.ts +8 -0
- package/dist/components/gantt/GanttGroup.js +134 -0
- package/dist/components/gantt/GanttHeader.d.ts +10 -0
- package/dist/components/gantt/GanttHeader.js +55 -0
- package/dist/components/gantt/GanttItem.d.ts +16 -0
- package/dist/components/gantt/GanttItem.js +23 -0
- package/dist/components/layout/Layout.d.ts +3 -3
- package/dist/components/layout/Layout.js +37 -33
- package/dist/components/menu/Menu.d.ts +15 -15
- package/dist/components/menu/Menu.js +35 -32
- package/dist/components/resizable/Resizable.d.ts +4 -4
- package/dist/components/resizable/Resizable.js +18 -17
- package/dist/components/row/Row.d.ts +2 -2
- package/dist/components/row/Row.js +15 -12
- package/dist/components/scroll-area/ScrollArea.d.ts +6 -6
- package/dist/components/scroll-area/ScrollArea.js +35 -32
- package/dist/components/segmented-control/SegmentedControl.d.ts +3 -3
- package/dist/components/segmented-control/SegmentedControl.js +12 -11
- package/dist/components/spacing/Spacing.d.ts +3 -3
- package/dist/components/spacing/Spacing.js +12 -11
- package/dist/components/tab/Tab.d.ts +5 -5
- package/dist/components/tab/Tab.js +22 -21
- package/dist/components/text/Text.d.ts +3 -3
- package/dist/components/text/Text.js +14 -11
- package/dist/components/toast/Toast.d.ts +2 -2
- package/dist/components/toast/Toast.js +32 -31
- package/dist/components/tooltip/Tooltip.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.js +34 -31
- package/dist/index.d.ts +1 -0
- package/dist/index.js +151 -152
- package/dist/utils/color.d.ts +4 -0
- package/dist/utils/color.js +43 -0
- package/dist/utils/component.d.ts +105 -0
- package/dist/utils/component.js +130 -0
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/index.js +14 -18
- package/dist/utils/size.d.ts +4 -0
- package/dist/utils/size.js +21 -0
- package/dist/utils/utils.d.ts +0 -55
- package/dist/utils/utils.js +1 -159
- package/package.json +3 -3
- package/dist/utils/nonReactiveArrayService.d.ts +0 -19
- package/dist/utils/nonReactiveArrayService.js +0 -54
- package/dist/utils/objectStore.d.ts +0 -12
- package/dist/utils/objectStore.js +0 -34
- package/dist/utils/types.d.ts +0 -57
- package/dist/utils/types.js +0 -4
package/dist/index.js
CHANGED
|
@@ -5,56 +5,56 @@ import { Badge as u } from "./components/badge/Badge.js";
|
|
|
5
5
|
import { Breadcrumb as x } from "./components/breadcrumb/Breadcrumb.js";
|
|
6
6
|
import { Button as f } from "./components/button/Button.js";
|
|
7
7
|
import { ButtonGroup as g } from "./components/button-group/ButtonGroup.js";
|
|
8
|
-
import { Card as
|
|
9
|
-
import { Col as
|
|
10
|
-
import { Command as
|
|
11
|
-
import { Container as
|
|
12
|
-
import { ContextMenu as
|
|
8
|
+
import { Card as s } from "./components/card/Card.js";
|
|
9
|
+
import { Col as b } from "./components/col/Col.js";
|
|
10
|
+
import { Command as M, CommandDialog as I, CommandEmpty as c, CommandGroup as D, CommandInput as A, CommandItem as F, CommandList as P, CommandSeparator as v, CommandShortcut as h } from "./components/command/Command.js";
|
|
11
|
+
import { Container as R } from "./components/container/Container.js";
|
|
12
|
+
import { ContextMenu as y, ContextMenuArrow as G, ContextMenuContent as z, ContextMenuGroup as B, ContextMenuItem as V, ContextMenuLabel as k, ContextMenuPortal as E, ContextMenuSeparator as H, ContextMenuSub as O, ContextMenuSubContent as Q, ContextMenuSubTrigger as N, ContextMenuTrigger as Z } from "./components/context-menu/ContextMenu.js";
|
|
13
13
|
import { DataTable as q } from "./components/data-table/DataTable.js";
|
|
14
14
|
import { DataTableColumn as K } from "./components/data-table/DataTableColumn.js";
|
|
15
15
|
import { DataTableFilterInput as W, createFilterQueryLanguage as X } from "./components/data-table/DataTableFilterInput.js";
|
|
16
16
|
import { DataTableFilterSuggestionMenu as _ } from "./components/data-table/DataTableFilterSuggestionMenu.js";
|
|
17
|
-
import { Dialog as
|
|
18
|
-
import { Editor as
|
|
19
|
-
import { FileTabsService as
|
|
20
|
-
import { FileTabs as
|
|
21
|
-
import { Flex as
|
|
22
|
-
import { CheckboxInput as
|
|
23
|
-
import { EmailInput as
|
|
24
|
-
import { Input as
|
|
25
|
-
import { InputDescription as
|
|
26
|
-
import { InputLabel as
|
|
27
|
-
import { InputMessage as
|
|
28
|
-
import { InputSuggestionMenuContent as
|
|
29
|
-
import { NumberInput as
|
|
30
|
-
import { PasswordInput as
|
|
31
|
-
import { PinInput as
|
|
32
|
-
import { RadioGroup as
|
|
33
|
-
import { RadioInput as
|
|
34
|
-
import { SwitchInput as
|
|
35
|
-
import { TextAreaInput as
|
|
36
|
-
import { TextInput as
|
|
37
|
-
import { useForm as
|
|
38
|
-
import { buildDefaultSyntax as
|
|
39
|
-
import { FullScreen as
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import { ObjectService as br, createObjectService as cr } from "./utils/objectStore.js";
|
|
17
|
+
import { Dialog as oo, DialogClose as eo, DialogContent as ro, DialogDescription as to, DialogFooter as no, DialogHeader as ao, DialogOverlay as po, DialogPortal as mo, DialogTitle as uo, DialogTrigger as io } from "./components/dialog/Dialog.js";
|
|
18
|
+
import { Editor as lo } from "./components/editor/Editor.js";
|
|
19
|
+
import { FileTabsService as Co } from "./components/file-tabs/FileTabs.service.js";
|
|
20
|
+
import { FileTabs as So, FileTabsContent as so, FileTabsList as To, FileTabsTrigger as bo } from "./components/file-tabs/FileTabs.js";
|
|
21
|
+
import { Flex as Io } from "./components/flex/Flex.js";
|
|
22
|
+
import { CheckboxInput as Do } from "./components/form/CheckboxInput.js";
|
|
23
|
+
import { EmailInput as Fo, emailValidation as Po } from "./components/form/EmailInput.js";
|
|
24
|
+
import { Input as ho } from "./components/form/Input.js";
|
|
25
|
+
import { InputDescription as Ro } from "./components/form/InputDescription.js";
|
|
26
|
+
import { InputLabel as yo } from "./components/form/InputLabel.js";
|
|
27
|
+
import { InputMessage as zo } from "./components/form/InputMessage.js";
|
|
28
|
+
import { InputSuggestionMenuContent as Vo, InputSuggestionMenuContentItems as ko } from "./components/form/InputSuggestion.js";
|
|
29
|
+
import { NumberInput as Ho } from "./components/form/NumberInput.js";
|
|
30
|
+
import { PasswordInput as Qo, passwordValidation as No } from "./components/form/PasswordInput.js";
|
|
31
|
+
import { PinInput as jo, PinInputField as qo, PinInputHiddenField as Jo } from "./components/form/PinInput.js";
|
|
32
|
+
import { RadioGroup as Uo } from "./components/form/RadioGroup.js";
|
|
33
|
+
import { RadioInput as Xo } from "./components/form/RadioInput.js";
|
|
34
|
+
import { SwitchInput as _o } from "./components/form/SwitchInput.js";
|
|
35
|
+
import { TextAreaInput as oe } from "./components/form/TextAreaInput.js";
|
|
36
|
+
import { TextInput as re } from "./components/form/TextInput.js";
|
|
37
|
+
import { useForm as ne } from "./components/form/useForm.js";
|
|
38
|
+
import { buildDefaultSyntax as pe } from "./components/form/Input.syntax.hook.js";
|
|
39
|
+
import { FullScreen as ue } from "./components/fullscreen/FullScreen.js";
|
|
40
|
+
import { Gantt as xe, getRelativeValue as le } from "./components/gantt/Gantt.js";
|
|
41
|
+
import { Layout as Ce } from "./components/layout/Layout.js";
|
|
42
|
+
import { Menu as Se, MenuArrow as se, MenuCheckboxItem as Te, MenuContent as be, MenuGroup as de, MenuItem as Me, MenuItemIndicator as Ie, MenuLabel as ce, MenuPortal as De, MenuSeparator as Ae, MenuSub as Fe, MenuSubContent as Pe, MenuSubTrigger as ve, MenuTrigger as he } from "./components/menu/Menu.js";
|
|
43
|
+
import { Quote as Re } from "./components/quote/Quote.js";
|
|
44
|
+
import { ResizableHandle as ye, ResizablePanel as Ge, ResizablePanelGroup as ze } from "./components/resizable/Resizable.js";
|
|
45
|
+
import { Row as Ve } from "./components/row/Row.js";
|
|
46
|
+
import { ScrollArea as Ee, ScrollAreaCorner as He, ScrollAreaScrollbar as Oe, ScrollAreaThumb as Qe, ScrollAreaViewport as Ne } from "./components/scroll-area/ScrollArea.js";
|
|
47
|
+
import { SegmentedControl as je, SegmentedControlItem as qe } from "./components/segmented-control/SegmentedControl.js";
|
|
48
|
+
import { Spacing as Ke } from "./components/spacing/Spacing.js";
|
|
49
|
+
import { Tab as We, TabContent as Xe, TabList as Ye, TabTrigger as _e } from "./components/tab/Tab.js";
|
|
50
|
+
import { Text as or } from "./components/text/Text.js";
|
|
51
|
+
import { Toast as rr, toast as tr } from "./components/toast/Toast.js";
|
|
52
|
+
import { Tooltip as ar, TooltipArrow as pr, TooltipContent as mr, TooltipPortal as ur, TooltipTrigger as ir } from "./components/tooltip/Tooltip.js";
|
|
53
|
+
import { ContextStore as lr, ContextStoreProvider as fr, useService as Cr, useStore as gr } from "./utils/contextStore.js";
|
|
55
54
|
import { ReactiveArrayService as sr, useReactiveArrayService as Tr } from "./utils/reactiveArrayService.js";
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
55
|
+
import { mergeComponentProps as dr } from "./utils/component.js";
|
|
56
|
+
import { Colors as Ir, hashToColor as cr, withAlpha as Dr } from "./utils/color.js";
|
|
57
|
+
import { getDOMSizeFromCodeZeroSize as Fr } from "./utils/size.js";
|
|
58
58
|
export {
|
|
59
59
|
r as Alert,
|
|
60
60
|
n as AuroraBackground,
|
|
@@ -63,127 +63,126 @@ export {
|
|
|
63
63
|
x as Breadcrumb,
|
|
64
64
|
f as Button,
|
|
65
65
|
g as ButtonGroup,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
s as Card,
|
|
67
|
+
Do as CheckboxInput,
|
|
68
|
+
b as Col,
|
|
69
69
|
Ir as Colors,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
M as Command,
|
|
71
|
+
I as CommandDialog,
|
|
72
|
+
c as CommandEmpty,
|
|
73
73
|
D as CommandGroup,
|
|
74
74
|
A as CommandInput,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
F as CommandItem,
|
|
76
|
+
P as CommandList,
|
|
77
|
+
v as CommandSeparator,
|
|
78
|
+
h as CommandShortcut,
|
|
79
|
+
R as Container,
|
|
80
|
+
y as ContextMenu,
|
|
81
81
|
G as ContextMenuArrow,
|
|
82
82
|
z as ContextMenuContent,
|
|
83
83
|
B as ContextMenuGroup,
|
|
84
|
-
|
|
84
|
+
V as ContextMenuItem,
|
|
85
85
|
k as ContextMenuLabel,
|
|
86
86
|
E as ContextMenuPortal,
|
|
87
87
|
H as ContextMenuSeparator,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
O as ContextMenuSub,
|
|
89
|
+
Q as ContextMenuSubContent,
|
|
90
|
+
N as ContextMenuSubTrigger,
|
|
91
|
+
Z as ContextMenuTrigger,
|
|
92
|
+
lr as ContextStore,
|
|
93
|
+
fr as ContextStoreProvider,
|
|
94
94
|
q as DataTable,
|
|
95
95
|
K as DataTableColumn,
|
|
96
96
|
W as DataTableFilterInput,
|
|
97
97
|
_ as DataTableFilterSuggestionMenu,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
We as RadioInput,
|
|
98
|
+
oo as Dialog,
|
|
99
|
+
eo as DialogClose,
|
|
100
|
+
ro as DialogContent,
|
|
101
|
+
to as DialogDescription,
|
|
102
|
+
no as DialogFooter,
|
|
103
|
+
ao as DialogHeader,
|
|
104
|
+
po as DialogOverlay,
|
|
105
|
+
mo as DialogPortal,
|
|
106
|
+
uo as DialogTitle,
|
|
107
|
+
io as DialogTrigger,
|
|
108
|
+
lo as Editor,
|
|
109
|
+
Fo as EmailInput,
|
|
110
|
+
So as FileTabs,
|
|
111
|
+
so as FileTabsContent,
|
|
112
|
+
To as FileTabsList,
|
|
113
|
+
Co as FileTabsService,
|
|
114
|
+
bo as FileTabsTrigger,
|
|
115
|
+
Io as Flex,
|
|
116
|
+
ue as FullScreen,
|
|
117
|
+
xe as Gantt,
|
|
118
|
+
ho as Input,
|
|
119
|
+
Ro as InputDescription,
|
|
120
|
+
yo as InputLabel,
|
|
121
|
+
zo as InputMessage,
|
|
122
|
+
Vo as InputSuggestionMenuContent,
|
|
123
|
+
ko as InputSuggestionMenuContentItems,
|
|
124
|
+
Ce as Layout,
|
|
125
|
+
Se as Menu,
|
|
126
|
+
se as MenuArrow,
|
|
127
|
+
Te as MenuCheckboxItem,
|
|
128
|
+
be as MenuContent,
|
|
129
|
+
de as MenuGroup,
|
|
130
|
+
Me as MenuItem,
|
|
131
|
+
Ie as MenuItemIndicator,
|
|
132
|
+
ce as MenuLabel,
|
|
133
|
+
De as MenuPortal,
|
|
134
|
+
Ae as MenuSeparator,
|
|
135
|
+
Fe as MenuSub,
|
|
136
|
+
Pe as MenuSubContent,
|
|
137
|
+
ve as MenuSubTrigger,
|
|
138
|
+
he as MenuTrigger,
|
|
139
|
+
Ho as NumberInput,
|
|
140
|
+
Qo as PasswordInput,
|
|
141
|
+
jo as PinInput,
|
|
142
|
+
qo as PinInputField,
|
|
143
|
+
Jo as PinInputHiddenField,
|
|
144
|
+
Re as Quote,
|
|
145
|
+
Uo as RadioGroup,
|
|
146
|
+
Xo as RadioInput,
|
|
148
147
|
sr as ReactiveArrayService,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
148
|
+
ye as ResizableHandle,
|
|
149
|
+
Ge as ResizablePanel,
|
|
150
|
+
ze as ResizablePanelGroup,
|
|
151
|
+
Ve as Row,
|
|
152
|
+
Ee as ScrollArea,
|
|
153
|
+
He as ScrollAreaCorner,
|
|
154
|
+
Oe as ScrollAreaScrollbar,
|
|
155
|
+
Qe as ScrollAreaThumb,
|
|
156
|
+
Ne as ScrollAreaViewport,
|
|
157
|
+
je as SegmentedControl,
|
|
158
|
+
qe as SegmentedControlItem,
|
|
159
|
+
Ke as Spacing,
|
|
160
|
+
_o as SwitchInput,
|
|
161
|
+
We as Tab,
|
|
162
|
+
Xe as TabContent,
|
|
163
|
+
Ye as TabList,
|
|
164
|
+
_e as TabTrigger,
|
|
165
|
+
or as Text,
|
|
166
|
+
oe as TextAreaInput,
|
|
167
|
+
re as TextInput,
|
|
168
|
+
rr as Toast,
|
|
169
|
+
ar as Tooltip,
|
|
170
|
+
pr as TooltipArrow,
|
|
171
|
+
mr as TooltipContent,
|
|
172
|
+
ur as TooltipPortal,
|
|
173
|
+
ir as TooltipTrigger,
|
|
174
|
+
pe as buildDefaultSyntax,
|
|
176
175
|
X as createFilterQueryLanguage,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
to as useForm,
|
|
176
|
+
Po as emailValidation,
|
|
177
|
+
Fr as getDOMSizeFromCodeZeroSize,
|
|
178
|
+
le as getRelativeValue,
|
|
179
|
+
cr as hashToColor,
|
|
180
|
+
dr as mergeComponentProps,
|
|
181
|
+
No as passwordValidation,
|
|
182
|
+
tr as toast,
|
|
183
|
+
ne as useForm,
|
|
186
184
|
Tr as useReactiveArrayService,
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
Cr as useService,
|
|
186
|
+
gr as useStore,
|
|
187
|
+
Dr as withAlpha
|
|
189
188
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type Color = "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error";
|
|
2
|
+
export declare const Colors: Color[];
|
|
3
|
+
export declare const hashToColor: (s: string, from?: number, to?: number) => string;
|
|
4
|
+
export declare const withAlpha: (color: string, alpha: number) => string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { md5 as s } from "js-md5";
|
|
2
|
+
const i = ["primary", "secondary", "info", "success", "warning", "error"], u = 137.50776405003785, d = (r) => {
|
|
3
|
+
const t = r.match(/\/(\d+)\s*$/);
|
|
4
|
+
return t ? Number(t[1]) : null;
|
|
5
|
+
}, p = (r, t = 25, n = 320) => {
|
|
6
|
+
const o = n - t, e = d(r);
|
|
7
|
+
if (e != null)
|
|
8
|
+
return `hsl(${t + e * u % o}, 100%, 72%)`;
|
|
9
|
+
const c = s(s(r)), a = parseInt(c.slice(0, 8), 16);
|
|
10
|
+
return `hsl(${t + a % o}, 100%, 72%)`;
|
|
11
|
+
}, m = (r) => {
|
|
12
|
+
if (typeof document > "u")
|
|
13
|
+
return {
|
|
14
|
+
r: 0,
|
|
15
|
+
g: 0,
|
|
16
|
+
b: 0,
|
|
17
|
+
a: 1
|
|
18
|
+
};
|
|
19
|
+
const t = document.createElement("span");
|
|
20
|
+
t.style.color = r, document.body.appendChild(t);
|
|
21
|
+
const n = getComputedStyle(t).color;
|
|
22
|
+
document.body.removeChild(t);
|
|
23
|
+
const o = n.match(/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)/);
|
|
24
|
+
return o ? {
|
|
25
|
+
r: Math.round(Number(o[1])),
|
|
26
|
+
g: Math.round(Number(o[2])),
|
|
27
|
+
b: Math.round(Number(o[3])),
|
|
28
|
+
a: o[4] !== void 0 ? Number(o[4]) : 1
|
|
29
|
+
} : {
|
|
30
|
+
r: 0,
|
|
31
|
+
g: 0,
|
|
32
|
+
b: 0,
|
|
33
|
+
a: 1
|
|
34
|
+
};
|
|
35
|
+
}, l = (r) => Math.min(Math.max(r, 0), 1), g = (r, t) => {
|
|
36
|
+
const n = m(r);
|
|
37
|
+
return `rgba(${n.r}, ${n.g}, ${n.b}, ${l(t)})`;
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
i as Colors,
|
|
41
|
+
p as hashToColor,
|
|
42
|
+
g as withAlpha
|
|
43
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { default as React, HTMLProps } from 'react';
|
|
2
|
+
import { FontSizes } from './size';
|
|
3
|
+
type StyleProp<Value> = Value;
|
|
4
|
+
export interface ComponentProps {
|
|
5
|
+
m?: StyleProp<number | `${number}`>;
|
|
6
|
+
my?: StyleProp<number | `${number}`>;
|
|
7
|
+
mx?: StyleProp<number | `${number}`>;
|
|
8
|
+
mt?: StyleProp<number | `${number}`>;
|
|
9
|
+
mb?: StyleProp<number | `${number}`>;
|
|
10
|
+
ml?: StyleProp<number | `${number}`>;
|
|
11
|
+
mr?: StyleProp<number | `${number}`>;
|
|
12
|
+
p?: StyleProp<number | `${number}`>;
|
|
13
|
+
py?: StyleProp<number | `${number}`>;
|
|
14
|
+
px?: StyleProp<number | `${number}`>;
|
|
15
|
+
pt?: StyleProp<number | `${number}`>;
|
|
16
|
+
pb?: StyleProp<number | `${number}`>;
|
|
17
|
+
pl?: StyleProp<number | `${number}`>;
|
|
18
|
+
pr?: StyleProp<number | `${number}`>;
|
|
19
|
+
bg?: React.CSSProperties['backgroundColor'];
|
|
20
|
+
c?: React.CSSProperties['color'];
|
|
21
|
+
opacity?: React.CSSProperties['opacity'];
|
|
22
|
+
ff?: StyleProp<'mono' | 'text' | 'heading' | (string & {})>;
|
|
23
|
+
fz?: StyleProp<FontSizes | number | `${number}`>;
|
|
24
|
+
fw?: StyleProp<React.CSSProperties['fontWeight']>;
|
|
25
|
+
lts?: StyleProp<React.CSSProperties['letterSpacing']>;
|
|
26
|
+
ta?: StyleProp<React.CSSProperties['textAlign']>;
|
|
27
|
+
lh?: StyleProp<number | (string & {})>;
|
|
28
|
+
fs?: StyleProp<React.CSSProperties['fontStyle']>;
|
|
29
|
+
tt?: StyleProp<React.CSSProperties['textTransform']>;
|
|
30
|
+
td?: StyleProp<React.CSSProperties['textDecoration']>;
|
|
31
|
+
w?: StyleProp<React.CSSProperties['width']>;
|
|
32
|
+
miw?: StyleProp<React.CSSProperties['minWidth']>;
|
|
33
|
+
maw?: StyleProp<React.CSSProperties['maxWidth']>;
|
|
34
|
+
h?: StyleProp<React.CSSProperties['height']>;
|
|
35
|
+
mih?: StyleProp<React.CSSProperties['minHeight']>;
|
|
36
|
+
mah?: StyleProp<React.CSSProperties['maxHeight']>;
|
|
37
|
+
bgsz?: StyleProp<React.CSSProperties['backgroundSize']>;
|
|
38
|
+
bgp?: StyleProp<React.CSSProperties['backgroundPosition']>;
|
|
39
|
+
bgr?: StyleProp<React.CSSProperties['backgroundRepeat']>;
|
|
40
|
+
bga?: StyleProp<React.CSSProperties['backgroundAttachment']>;
|
|
41
|
+
pos?: StyleProp<React.CSSProperties['position']>;
|
|
42
|
+
top?: StyleProp<React.CSSProperties['top']>;
|
|
43
|
+
left?: StyleProp<React.CSSProperties['left']>;
|
|
44
|
+
bottom?: StyleProp<React.CSSProperties['bottom']>;
|
|
45
|
+
right?: StyleProp<React.CSSProperties['right']>;
|
|
46
|
+
inset?: StyleProp<React.CSSProperties['inset']>;
|
|
47
|
+
display?: StyleProp<React.CSSProperties['display']>;
|
|
48
|
+
flex?: StyleProp<React.CSSProperties['flex']>;
|
|
49
|
+
align?: StyleProp<React.CSSProperties['alignItems']>;
|
|
50
|
+
justify?: StyleProp<React.CSSProperties['justifyContent']>;
|
|
51
|
+
tf?: StyleProp<React.CSSProperties['transform']>;
|
|
52
|
+
}
|
|
53
|
+
export type Component<T> = ComponentProps & HTMLProps<T>;
|
|
54
|
+
export declare const mergeComponentProps: (cn: string, rest: object) => {
|
|
55
|
+
m?: StyleProp<number | `${number}`> | undefined;
|
|
56
|
+
my?: StyleProp<number | `${number}`> | undefined;
|
|
57
|
+
mx?: StyleProp<number | `${number}`> | undefined;
|
|
58
|
+
mt?: StyleProp<number | `${number}`> | undefined;
|
|
59
|
+
mb?: StyleProp<number | `${number}`> | undefined;
|
|
60
|
+
ml?: StyleProp<number | `${number}`> | undefined;
|
|
61
|
+
mr?: StyleProp<number | `${number}`> | undefined;
|
|
62
|
+
p?: StyleProp<number | `${number}`> | undefined;
|
|
63
|
+
py?: StyleProp<number | `${number}`> | undefined;
|
|
64
|
+
px?: StyleProp<number | `${number}`> | undefined;
|
|
65
|
+
pt?: StyleProp<number | `${number}`> | undefined;
|
|
66
|
+
pb?: StyleProp<number | `${number}`> | undefined;
|
|
67
|
+
pl?: StyleProp<number | `${number}`> | undefined;
|
|
68
|
+
pr?: StyleProp<number | `${number}`> | undefined;
|
|
69
|
+
bg?: import("csstype").Property.BackgroundColor | undefined;
|
|
70
|
+
c?: import("csstype").Property.Color | undefined;
|
|
71
|
+
opacity?: import("csstype").Property.Opacity | undefined;
|
|
72
|
+
ff?: StyleProp<"mono" | "text" | "heading" | (string & {})> | undefined;
|
|
73
|
+
fz?: StyleProp<FontSizes | number | `${number}`> | undefined;
|
|
74
|
+
fw?: import("csstype").Property.FontWeight | undefined;
|
|
75
|
+
lts?: import("csstype").Property.LetterSpacing<string | number> | undefined;
|
|
76
|
+
ta?: import("csstype").Property.TextAlign | undefined;
|
|
77
|
+
lh?: StyleProp<number | (string & {})> | undefined;
|
|
78
|
+
fs?: import("csstype").Property.FontStyle | undefined;
|
|
79
|
+
tt?: import("csstype").Property.TextTransform | undefined;
|
|
80
|
+
td?: import("csstype").Property.TextDecoration<string | number> | undefined;
|
|
81
|
+
w?: import("csstype").Property.Width<string | number> | undefined;
|
|
82
|
+
miw?: import("csstype").Property.MinWidth<string | number> | undefined;
|
|
83
|
+
maw?: import("csstype").Property.MaxWidth<string | number> | undefined;
|
|
84
|
+
h?: import("csstype").Property.Height<string | number> | undefined;
|
|
85
|
+
mih?: import("csstype").Property.MinHeight<string | number> | undefined;
|
|
86
|
+
mah?: import("csstype").Property.MaxHeight<string | number> | undefined;
|
|
87
|
+
bgsz?: import("csstype").Property.BackgroundSize<string | number> | undefined;
|
|
88
|
+
bgp?: import("csstype").Property.BackgroundPosition<string | number> | undefined;
|
|
89
|
+
bgr?: import("csstype").Property.BackgroundRepeat | undefined;
|
|
90
|
+
bga?: import("csstype").Property.BackgroundAttachment | undefined;
|
|
91
|
+
pos?: import("csstype").Property.Position | undefined;
|
|
92
|
+
top?: import("csstype").Property.Top<string | number> | undefined;
|
|
93
|
+
left?: import("csstype").Property.Left<string | number> | undefined;
|
|
94
|
+
bottom?: import("csstype").Property.Bottom<string | number> | undefined;
|
|
95
|
+
right?: import("csstype").Property.Right<string | number> | undefined;
|
|
96
|
+
inset?: import("csstype").Property.Inset<string | number> | undefined;
|
|
97
|
+
display?: import("csstype").Property.Display | undefined;
|
|
98
|
+
flex?: import("csstype").Property.Flex<string | number> | undefined;
|
|
99
|
+
align?: import("csstype").Property.AlignItems | undefined;
|
|
100
|
+
justify?: import("csstype").Property.JustifyContent | undefined;
|
|
101
|
+
tf?: import("csstype").Property.Transform | undefined;
|
|
102
|
+
style?: React.CSSProperties | undefined;
|
|
103
|
+
className: string;
|
|
104
|
+
};
|
|
105
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import a from "merge-props";
|
|
2
|
+
const g = (m) => ({
|
|
3
|
+
...m.m ? {
|
|
4
|
+
margin: `${m.m}rem`
|
|
5
|
+
} : {},
|
|
6
|
+
...m.my ? {
|
|
7
|
+
marginTop: `${m.my}rem`,
|
|
8
|
+
marginBottom: `${m.my}rem`
|
|
9
|
+
} : {},
|
|
10
|
+
...m.mx ? {
|
|
11
|
+
marginLeft: `${m.mx}rem`,
|
|
12
|
+
marginRight: `${m.mx}rem`
|
|
13
|
+
} : {},
|
|
14
|
+
...m.mt ? {
|
|
15
|
+
marginTop: `${m.mt}rem`
|
|
16
|
+
} : {},
|
|
17
|
+
...m.mb ? {
|
|
18
|
+
marginBottom: `${m.mb}rem`
|
|
19
|
+
} : {},
|
|
20
|
+
...m.ml ? {
|
|
21
|
+
marginLeft: `${m.ml}rem`
|
|
22
|
+
} : {},
|
|
23
|
+
...m.mr ? {
|
|
24
|
+
marginRight: `${m.mr}rem`
|
|
25
|
+
} : {},
|
|
26
|
+
...m.p ? {
|
|
27
|
+
padding: `${m.p}rem`
|
|
28
|
+
} : {},
|
|
29
|
+
...m.py ? {
|
|
30
|
+
paddingTop: `${m.py}rem`,
|
|
31
|
+
paddingBottom: `${m.py}rem`
|
|
32
|
+
} : {},
|
|
33
|
+
...m.px ? {
|
|
34
|
+
paddingLeft: `${m.px}rem`,
|
|
35
|
+
paddingRight: `${m.px}rem`
|
|
36
|
+
} : {},
|
|
37
|
+
...m.pt ? {
|
|
38
|
+
paddingTop: `${m.pt}rem`
|
|
39
|
+
} : {},
|
|
40
|
+
...m.pb ? {
|
|
41
|
+
paddingBottom: `${m.pb}rem`
|
|
42
|
+
} : {},
|
|
43
|
+
...m.pl ? {
|
|
44
|
+
paddingLeft: `${m.pl}rem`
|
|
45
|
+
} : {},
|
|
46
|
+
...m.pr ? {
|
|
47
|
+
paddingRight: `${m.pr}rem`
|
|
48
|
+
} : {},
|
|
49
|
+
...m.bg ? {
|
|
50
|
+
backgroundColor: m.bg
|
|
51
|
+
} : {},
|
|
52
|
+
...m.c ? {
|
|
53
|
+
color: m.c
|
|
54
|
+
} : {},
|
|
55
|
+
...m.opacity ? {
|
|
56
|
+
opacity: m.opacity
|
|
57
|
+
} : {},
|
|
58
|
+
...m.ff ? {
|
|
59
|
+
fontFamily: m.ff
|
|
60
|
+
} : {},
|
|
61
|
+
...m.fz ? {
|
|
62
|
+
fontSize: `${m.fz}rem`
|
|
63
|
+
} : {},
|
|
64
|
+
...m.ta ? {
|
|
65
|
+
textAlign: m.ta
|
|
66
|
+
} : {},
|
|
67
|
+
...m.w ? {
|
|
68
|
+
width: m.w
|
|
69
|
+
} : {},
|
|
70
|
+
...m.miw ? {
|
|
71
|
+
minWidth: m.miw
|
|
72
|
+
} : {},
|
|
73
|
+
...m.maw ? {
|
|
74
|
+
maxWidth: m.maw
|
|
75
|
+
} : {},
|
|
76
|
+
...m.h ? {
|
|
77
|
+
height: m.h
|
|
78
|
+
} : {},
|
|
79
|
+
...m.mih ? {
|
|
80
|
+
minHeight: m.mih
|
|
81
|
+
} : {},
|
|
82
|
+
...m.mah ? {
|
|
83
|
+
maxHeight: m.mah
|
|
84
|
+
} : {},
|
|
85
|
+
...m.pos ? {
|
|
86
|
+
position: m.pos
|
|
87
|
+
} : {},
|
|
88
|
+
...m.top ? {
|
|
89
|
+
top: m.top
|
|
90
|
+
} : {},
|
|
91
|
+
...m.left ? {
|
|
92
|
+
left: m.left
|
|
93
|
+
} : {},
|
|
94
|
+
...m.bottom ? {
|
|
95
|
+
bottom: m.bottom
|
|
96
|
+
} : {},
|
|
97
|
+
...m.right ? {
|
|
98
|
+
right: m.right
|
|
99
|
+
} : {},
|
|
100
|
+
...m.display ? {
|
|
101
|
+
display: m.display
|
|
102
|
+
} : {},
|
|
103
|
+
...m.flex ? {
|
|
104
|
+
flex: m.flex
|
|
105
|
+
} : {},
|
|
106
|
+
...m.align ? {
|
|
107
|
+
alignItems: m.align
|
|
108
|
+
} : {},
|
|
109
|
+
...m.justify ? {
|
|
110
|
+
justifyContent: m.justify
|
|
111
|
+
} : {},
|
|
112
|
+
...m.tf ? {
|
|
113
|
+
transform: m.tf
|
|
114
|
+
} : {}
|
|
115
|
+
}), d = (m, i) => {
|
|
116
|
+
const p = g(i), o = {
|
|
117
|
+
...i
|
|
118
|
+
};
|
|
119
|
+
return ["m", "my", "mx", "mt", "mb", "ml", "mr", "p", "py", "px", "pt", "pb", "pl", "pr", "bg", "c", "opacity", "ff", "fz", "fw", "lts", "ta", "lh", "fs", "tt", "td", "w", "miw", "maw", "h", "mih", "mah", "bgsz", "bgp", "bgr", "bga", "pos", "top", "left", "bottom", "right", "inset", "display", "flex", "align", "justify", "tf"].forEach((r) => {
|
|
120
|
+
delete o[r];
|
|
121
|
+
}), a(o, {
|
|
122
|
+
className: m,
|
|
123
|
+
...Object.keys(p).length !== 0 ? {
|
|
124
|
+
style: p
|
|
125
|
+
} : {}
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
d as mergeComponentProps
|
|
130
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './arrayService';
|
|
2
2
|
export * from './contextStore';
|
|
3
|
-
export * from './nonReactiveArrayService';
|
|
4
|
-
export * from './objectStore';
|
|
5
3
|
export * from './reactiveArrayService';
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
4
|
+
export * from './component';
|
|
5
|
+
export * from './color';
|
|
6
|
+
export * from './size';
|