pentatrion-design 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/.storybook/main.ts +33 -0
- package/.storybook/manager.ts +8 -0
- package/.storybook/preview-head.html +2 -0
- package/.storybook/preview.ts +26 -0
- package/.storybook/public/bg-map.jpg +0 -0
- package/.storybook/public/favicon-32x32.png +0 -0
- package/.storybook/public/favicon.svg +28 -0
- package/.storybook/public/movies.json +2153 -0
- package/.storybook/public/population.json +1178 -0
- package/.storybook/public/town-74.geojson +8995 -0
- package/.storybook/public/town-74.json +4062 -0
- package/.storybook/theme.ts +14 -0
- package/Makefile +14 -0
- package/README.md +40 -0
- package/TODO.md +5 -0
- package/dist/index.d.ts +1110 -0
- package/dist/index.js +3707 -0
- package/dist/redux/index.d.ts +43 -0
- package/dist/redux/index.js +583 -0
- package/dist/types.d-DlHa_IaW.d.ts +14 -0
- package/images/logo-shadow.svg +173 -0
- package/images/logo.svg +76 -0
- package/package.json +85 -0
- package/postcss.config.js +7 -0
- package/src/components/autocomplete/Autocomplete.stories.tsx +89 -0
- package/src/components/autocomplete/Autocomplete.tsx +316 -0
- package/src/components/autocomplete/AutocompleteOption.tsx +35 -0
- package/src/components/autocomplete/LazyAutocomplete.tsx +130 -0
- package/src/components/autocomplete/SimpleAutocomplete.tsx +74 -0
- package/src/components/autocomplete/index.ts +6 -0
- package/src/components/autocomplete/useAutocompleteContext.ts +20 -0
- package/src/components/autocomplete/util.ts +19 -0
- package/src/components/badge/Badge.stories.tsx +72 -0
- package/src/components/badge/Badge.tsx +70 -0
- package/src/components/button/Button.stories.tsx +189 -0
- package/src/components/button/Button.test.tsx +20 -0
- package/src/components/button/Button.tsx +200 -0
- package/src/components/button/ButtonGroup.stories.tsx +46 -0
- package/src/components/button/ButtonGroup.tsx +29 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/card/Card.stories.tsx +21 -0
- package/src/components/card/config.ts +4 -0
- package/src/components/card/index.ts +1 -0
- package/src/components/code/Code.tsx +15 -0
- package/src/components/context-menu/ContextMenu.stories.tsx +22 -0
- package/src/components/context-menu/ContextMenu.tsx +175 -0
- package/src/components/context-menu/ContextMenuItem.tsx +34 -0
- package/src/components/context-menu/index.ts +2 -0
- package/src/components/dialog/Dialog.stories.tsx +270 -0
- package/src/components/dialog/Dialog.tsx +46 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/dialog/util.ts +29 -0
- package/src/components/dropdown-menu/DropdownMenu.stories.tsx +19 -0
- package/src/components/dropdown-menu/DropdownMenu.tsx +12 -0
- package/src/components/dropdown-menu/DropdownMenuContent.tsx +46 -0
- package/src/components/dropdown-menu/DropdownMenuItem.tsx +33 -0
- package/src/components/dropdown-menu/DropdownMenuTrigger.tsx +42 -0
- package/src/components/dropdown-menu/index.ts +7 -0
- package/src/components/dropdown-menu/interface.d.ts +13 -0
- package/src/components/dropdown-menu/useDropdownMenu.tsx +115 -0
- package/src/components/dropdown-menu/useDropdownMenuContext.ts +16 -0
- package/src/components/dropdown-menu-nested/DropdownMenuNested.stories.tsx +33 -0
- package/src/components/dropdown-menu-nested/DropdownMenuNested.tsx +19 -0
- package/src/components/dropdown-menu-nested/MenuContext.ts +15 -0
- package/src/components/dropdown-menu-nested/MenuItem.tsx +43 -0
- package/src/components/dropdown-menu-nested/MenuItemWithChildren.tsx +204 -0
- package/src/components/dropdown-menu-nested/index.ts +3 -0
- package/src/components/flash/Flash.stories.tsx +34 -0
- package/src/components/flash/Flash.tsx +24 -0
- package/src/components/highlight/Highlight.stories.tsx +128 -0
- package/src/components/highlight/Highlight.tsx +29 -0
- package/src/components/href/Href.stories.tsx +55 -0
- package/src/components/href/Href.tsx +18 -0
- package/src/components/input/Checkbox.stories.tsx +52 -0
- package/src/components/input/Checkbox.tsx +41 -0
- package/src/components/input/Input.stories.tsx +103 -0
- package/src/components/input/Input.test.tsx +10 -0
- package/src/components/input/Input.tsx +60 -0
- package/src/components/input/RadioGroup.stories.tsx +76 -0
- package/src/components/input/RadioGroup.tsx +84 -0
- package/src/components/input/Toggle.stories.tsx +29 -0
- package/src/components/input/Toggle.tsx +35 -0
- package/src/components/input/index.ts +4 -0
- package/src/components/input-field/InputField.stories.tsx +227 -0
- package/src/components/input-field/InputField.tsx +62 -0
- package/src/components/loader/Loader.stories.tsx +37 -0
- package/src/components/loader/Loader.tsx +54 -0
- package/src/components/modal/Components.tsx +58 -0
- package/src/components/modal/Modal.stories.tsx +113 -0
- package/src/components/modal/Modal.tsx +13 -0
- package/src/components/modal/ModalContent.tsx +46 -0
- package/src/components/modal/ModalTrigger.tsx +41 -0
- package/src/components/modal/index.ts +7 -0
- package/src/components/modal/interface.d.ts +10 -0
- package/src/components/modal/useModal.ts +48 -0
- package/src/components/modal/useModalContext.ts +16 -0
- package/src/components/notification/Notification.stories.tsx +51 -0
- package/src/components/notification/NotificationsContext.ts +79 -0
- package/src/components/notification/NotificationsProvider.tsx +58 -0
- package/src/components/notification/index.ts +2 -0
- package/src/components/popover/Components.tsx +45 -0
- package/src/components/popover/Popover.stories.tsx +46 -0
- package/src/components/popover/Popover.test.tsx +21 -0
- package/src/components/popover/Popover.tsx +12 -0
- package/src/components/popover/PopoverContent.tsx +46 -0
- package/src/components/popover/PopoverTrigger.tsx +42 -0
- package/src/components/popover/index.ts +7 -0
- package/src/components/popover/interface.d.ts +13 -0
- package/src/components/popover/usePopover.tsx +80 -0
- package/src/components/popover/usePopoverContext.ts +16 -0
- package/src/components/portal/Portal.tsx +12 -0
- package/src/components/quick-settings/QuickSettings.stories.tsx +182 -0
- package/src/components/resize-area/ResizeArea.stories.css +40 -0
- package/src/components/resize-area/ResizeArea.stories.tsx +30 -0
- package/src/components/resize-area/ResizeArea.tsx +79 -0
- package/src/components/scroll/Scroll.stories.tsx +81 -0
- package/src/components/scroll/Scroll.tsx +111 -0
- package/src/components/select/Select.stories.tsx +248 -0
- package/src/components/select/Select.tsx +362 -0
- package/src/components/select/SelectOption.tsx +29 -0
- package/src/components/select/SelectSelection.tsx +13 -0
- package/src/components/select/index.ts +5 -0
- package/src/components/select/interface.d.ts +36 -0
- package/src/components/select/useSelectContext.ts +19 -0
- package/src/components/select/util.ts +12 -0
- package/src/components/snack/Snack.stories.tsx +33 -0
- package/src/components/snack/Snack.tsx +47 -0
- package/src/components/sortable/Sortable.stories.tsx +98 -0
- package/src/components/sortable/Sortable.tsx +37 -0
- package/src/components/sortable/index.ts +2 -0
- package/src/components/sortable/types.d.ts +12 -0
- package/src/components/steps/Step.tsx +41 -0
- package/src/components/steps/Steps.stories.tsx +141 -0
- package/src/components/steps/Steps.tsx +49 -0
- package/src/components/steps/index.ts +3 -0
- package/src/components/steps/util.ts +3 -0
- package/src/components/table/Table.stories.tsx +36 -0
- package/src/components/table/Table.tsx +13 -0
- package/src/components/table/TableBody.tsx +9 -0
- package/src/components/table/TableCell.tsx +16 -0
- package/src/components/table/TableFooter.tsx +9 -0
- package/src/components/table/TableHeader.tsx +14 -0
- package/src/components/table/TableHeaderCell.tsx +14 -0
- package/src/components/table/TableRow.tsx +14 -0
- package/src/components/table/index.ts +7 -0
- package/src/components/tabs/Tabs.stories.tsx +66 -0
- package/src/components/tabs/Tabs.tsx +80 -0
- package/src/components/tooltip/SimpleTooltip.tsx +17 -0
- package/src/components/tooltip/Tooltip.stories.tsx +129 -0
- package/src/components/tooltip/Tooltip.test.tsx +18 -0
- package/src/components/tooltip/Tooltip.tsx +13 -0
- package/src/components/tooltip/TooltipContent.tsx +41 -0
- package/src/components/tooltip/TooltipTrigger.tsx +36 -0
- package/src/components/tooltip/index.ts +6 -0
- package/src/components/tooltip/interface.d.ts +15 -0
- package/src/components/tooltip/useTooltip.ts +87 -0
- package/src/components/tooltip/useTooltipContext.ts +16 -0
- package/src/env.d.ts +27 -0
- package/src/hooks/index.ts +13 -0
- package/src/hooks/useCombinedRefs.test.tsx +42 -0
- package/src/hooks/useCombinedRefs.ts +21 -0
- package/src/hooks/useCopyToClipboard.ts +28 -0
- package/src/hooks/useDebounce.ts +59 -0
- package/src/hooks/useEventCallback.ts +13 -0
- package/src/hooks/useEventListener.ts +86 -0
- package/src/hooks/useFetch.tsx +21 -0
- package/src/hooks/useIsClosing.ts +25 -0
- package/src/hooks/useIsMounted.tsx +16 -0
- package/src/hooks/useIsomorphicLayoutEffect.ts +4 -0
- package/src/hooks/useNotifications.tsx +13 -0
- package/src/hooks/useOnClickOutside.ts +35 -0
- package/src/hooks/usePrevious.ts +9 -0
- package/src/hooks/useRipple.test.tsx +52 -0
- package/src/hooks/useRipple.tsx +79 -0
- package/src/index.css +14 -0
- package/src/index.ts +39 -0
- package/src/lib/arrUtil.ts +8 -0
- package/src/lib/error.ts +18 -0
- package/src/lib/fetch.test.ts +107 -0
- package/src/lib/fetch.ts +115 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/tailwindVariants.ts +35 -0
- package/src/redux/index.ts +1 -0
- package/src/redux/notification/components/NotificationConsumer.tsx +52 -0
- package/src/redux/notification/errorCatcherMiddleware.ts +17 -0
- package/src/redux/notification/hooks/useNotification.ts +26 -0
- package/src/redux/notification/index.ts +5 -0
- package/src/redux/notification/notificationSlice.ts +68 -0
- package/src/styles/Animation.stories.tsx +43 -0
- package/src/styles/Shadow.stories.tsx +43 -0
- package/src/styles/Themes.stories.tsx +31 -0
- package/src/styles/Typography.stories.tsx +101 -0
- package/src/tailwind/base.css +188 -0
- package/src/tailwind/components-input-outline.css +62 -0
- package/src/tailwind/components-resize-area.css +112 -0
- package/src/tailwind/components-step.css +161 -0
- package/src/tailwind/components.css +51 -0
- package/src/tailwind/keyframes.ts +69 -0
- package/src/tailwind/pentatrionTw.ts +147 -0
- package/src/tailwind/utilities-dialog.css +103 -0
- package/src/tailwind/utilities.css +3 -0
- package/src/types.d.ts +12 -0
- package/tailwind.config.js +18 -0
- package/tests/README.md +32 -0
- package/tests/setup.ts +1 -0
- package/tsconfig.json +14 -0
- package/tsup.config.ts +23 -0
- package/vite.config.ts +24 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import plugin from "tailwindcss/plugin";
|
|
2
|
+
import { keyframes } from "./keyframes";
|
|
3
|
+
|
|
4
|
+
import defaultTheme from "tailwindcss/defaultTheme";
|
|
5
|
+
|
|
6
|
+
export default plugin(
|
|
7
|
+
({ addVariant }) => {
|
|
8
|
+
addVariant("active-full", ["&:active", "&.active"]);
|
|
9
|
+
// addVariant("focus-full", ["&:focus-within", "&.focus", "&:focus"]);
|
|
10
|
+
addVariant("focus-full", ["&:has(input:focus)", "&.focus", "&:focus"]);
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
theme: {
|
|
14
|
+
zIndex: {
|
|
15
|
+
auto: "auto",
|
|
16
|
+
0: "0",
|
|
17
|
+
10: "10",
|
|
18
|
+
20: "20",
|
|
19
|
+
30: "30",
|
|
20
|
+
40: "40",
|
|
21
|
+
50: "50",
|
|
22
|
+
dialog: "100",
|
|
23
|
+
overlay: "100",
|
|
24
|
+
tooltip: "100",
|
|
25
|
+
"context-menu": "90",
|
|
26
|
+
notification: "80",
|
|
27
|
+
},
|
|
28
|
+
transitionDuration: {
|
|
29
|
+
...defaultTheme.transitionDuration,
|
|
30
|
+
DEFAULT: "300ms",
|
|
31
|
+
},
|
|
32
|
+
colors: {
|
|
33
|
+
transparent: "transparent",
|
|
34
|
+
current: "currentColor",
|
|
35
|
+
black: "rgb(var(--color-black) / <alpha-value>)",
|
|
36
|
+
white: "rgb(var(--color-white) / <alpha-value>)",
|
|
37
|
+
|
|
38
|
+
yellow: {
|
|
39
|
+
1: "rgb(var(--color-yellow-1) / <alpha-value>)",
|
|
40
|
+
2: "rgb(var(--color-yellow-2) / <alpha-value>)",
|
|
41
|
+
3: "rgb(var(--color-yellow-3) / <alpha-value>)",
|
|
42
|
+
4: "rgb(var(--color-yellow-4) / <alpha-value>)",
|
|
43
|
+
5: "rgb(var(--color-yellow-5) / <alpha-value>)",
|
|
44
|
+
// color of the text when bg is yellow 3
|
|
45
|
+
text: "rgb(var(--color-yellow-text) / <alpha-value>)",
|
|
46
|
+
},
|
|
47
|
+
green: {
|
|
48
|
+
1: "rgb(var(--color-green-1) / <alpha-value>)",
|
|
49
|
+
2: "rgb(var(--color-green-2) / <alpha-value>)",
|
|
50
|
+
3: "rgb(var(--color-green-3) / <alpha-value>)",
|
|
51
|
+
4: "rgb(var(--color-green-4) / <alpha-value>)",
|
|
52
|
+
5: "rgb(var(--color-green-5) / <alpha-value>)",
|
|
53
|
+
// color of the text when bg is green
|
|
54
|
+
text: "rgb(var(--color-green-text) / <alpha-value>)",
|
|
55
|
+
},
|
|
56
|
+
blue: {
|
|
57
|
+
1: "rgb(var(--color-blue-1) / <alpha-value>)",
|
|
58
|
+
2: "rgb(var(--color-blue-2) / <alpha-value>)",
|
|
59
|
+
3: "rgb(var(--color-blue-3) / <alpha-value>)",
|
|
60
|
+
4: "rgb(var(--color-blue-4) / <alpha-value>)",
|
|
61
|
+
5: "rgb(var(--color-blue-5) / <alpha-value>)",
|
|
62
|
+
// color of the text when bg is blue
|
|
63
|
+
text: "rgb(var(--color-blue-text) / <alpha-value>)",
|
|
64
|
+
},
|
|
65
|
+
orange: {
|
|
66
|
+
1: "rgb(var(--color-orange-1) / <alpha-value>)",
|
|
67
|
+
2: "rgb(var(--color-orange-2) / <alpha-value>)",
|
|
68
|
+
3: "rgb(var(--color-orange-3) / <alpha-value>)",
|
|
69
|
+
4: "rgb(var(--color-orange-4) / <alpha-value>)",
|
|
70
|
+
5: "rgb(var(--color-orange-5) / <alpha-value>)",
|
|
71
|
+
// color of the text when bg is orange
|
|
72
|
+
text: "rgb(var(--color-orange-text) / <alpha-value>)",
|
|
73
|
+
},
|
|
74
|
+
red: {
|
|
75
|
+
1: "rgb(var(--color-red-1) / <alpha-value>)",
|
|
76
|
+
2: "rgb(var(--color-red-2) / <alpha-value>)",
|
|
77
|
+
3: "rgb(var(--color-red-3) / <alpha-value>)",
|
|
78
|
+
4: "rgb(var(--color-red-4) / <alpha-value>)",
|
|
79
|
+
5: "rgb(var(--color-red-5) / <alpha-value>)",
|
|
80
|
+
// color of the text when bg is red
|
|
81
|
+
text: "rgb(var(--color-red-text) / <alpha-value>)",
|
|
82
|
+
},
|
|
83
|
+
gray: {
|
|
84
|
+
0: "rgb(var(--color-gray-0) / <alpha-value>)",
|
|
85
|
+
1: "rgb(var(--color-gray-1) / <alpha-value>)",
|
|
86
|
+
2: "rgb(var(--color-gray-2) / <alpha-value>)",
|
|
87
|
+
3: "rgb(var(--color-gray-3) / <alpha-value>)",
|
|
88
|
+
4: "rgb(var(--color-gray-4) / <alpha-value>)",
|
|
89
|
+
5: "rgb(var(--color-gray-5) / <alpha-value>)",
|
|
90
|
+
6: "rgb(var(--color-gray-6) / <alpha-value>)",
|
|
91
|
+
7: "rgb(var(--color-gray-7) / <alpha-value>)",
|
|
92
|
+
8: "rgb(var(--color-gray-8) / <alpha-value>)",
|
|
93
|
+
// color of the text when bg is gray
|
|
94
|
+
text: "rgb(var(--color-gray-text) / <alpha-value>)",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
boxShadow: {
|
|
98
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.1)",
|
|
99
|
+
DEFAULT: "0 1px 3px 0 rgb(0 0 0 / 0.15), 0 1px 2px -1px rgb(0 0 0 / 0.15)",
|
|
100
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.15)",
|
|
101
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -2px rgb(0 0 0 / 0.15)",
|
|
102
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15)",
|
|
103
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.35)",
|
|
104
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.1)",
|
|
105
|
+
dark: "0 0 0 1px rgb(var(--color-gray-2))",
|
|
106
|
+
none: "none",
|
|
107
|
+
},
|
|
108
|
+
fontFamily: {
|
|
109
|
+
sans: ["ui-sans-serif", "system-ui", "sans-serif"],
|
|
110
|
+
fontello: ["fontello"],
|
|
111
|
+
serif: defaultTheme.fontFamily.serif,
|
|
112
|
+
mono: defaultTheme.fontFamily.mono,
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
extend: {
|
|
116
|
+
// https://github.com/tailwindlabs/tailwindcss/blob/master/stubs/config.full.js
|
|
117
|
+
backgroundSize: {
|
|
118
|
+
full: "100%",
|
|
119
|
+
},
|
|
120
|
+
dropShadow: {
|
|
121
|
+
arrow: "0 1px 3px rgb(var(--color-gray-3))",
|
|
122
|
+
},
|
|
123
|
+
transitionProperty: {
|
|
124
|
+
"color-shadow":
|
|
125
|
+
"color, background-color, border-color, text-decoration-color, fill, stroke, box-shadow",
|
|
126
|
+
},
|
|
127
|
+
gridTemplateColumns: {
|
|
128
|
+
"repeat-fill-300": "repeat(auto-fill, minmax(300px, 1fr))",
|
|
129
|
+
"repeat-fill-160": "repeat(auto-fill, minmax(160px, 1fr))",
|
|
130
|
+
},
|
|
131
|
+
animation: {
|
|
132
|
+
ripple: "ripple .9s linear",
|
|
133
|
+
"fade-in": "fade-in 250ms ease both",
|
|
134
|
+
"fade-in-list": "fade-in-list 150ms ease both",
|
|
135
|
+
"fade-out": "fade-out 250ms ease both",
|
|
136
|
+
"fade-in-opacity": "fade-in-opacity 250ms ease both",
|
|
137
|
+
flash: "flash 1000ms ease both infinite",
|
|
138
|
+
"loader-stroke": "loader-stroke 1s linear infinite",
|
|
139
|
+
},
|
|
140
|
+
fontSize: {
|
|
141
|
+
"2xs": ["0.688rem", { lineHeight: "1rem" }],
|
|
142
|
+
},
|
|
143
|
+
keyframes,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
[data-placement^="top"] {
|
|
2
|
+
@apply origin-bottom;
|
|
3
|
+
/* border-top-width: 4px; */
|
|
4
|
+
|
|
5
|
+
& .p8n-arrow {
|
|
6
|
+
@apply w-0 h-0 absolute border-x-8 border-t-8 border-x-transparent border-t-current top-full drop-shadow-arrow dark:drop-shadow-[0_1px_0_rgb(var(--color-gray-2))];
|
|
7
|
+
clip: rect(0px, 16px, 12px, 0px);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-placement="top-start"] {
|
|
12
|
+
@apply origin-bottom-left;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[data-placement="top-end"] {
|
|
16
|
+
@apply origin-bottom-right;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-placement^="bottom"] {
|
|
20
|
+
@apply origin-top;
|
|
21
|
+
/* border-bottom-width: 4px; */
|
|
22
|
+
|
|
23
|
+
& .p8n-arrow {
|
|
24
|
+
@apply w-0 h-0 absolute border-x-8 border-b-8 border-x-transparent border-b-current bottom-full drop-shadow-arrow dark:drop-shadow-[0_-1px_0_rgb(var(--color-gray-2))];
|
|
25
|
+
clip: rect(-4px, 16px, 8px, 0px);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-placement="bottom-start"] {
|
|
30
|
+
@apply origin-top-left;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-placement="bottom-end"] {
|
|
34
|
+
@apply origin-top-right;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-placement^="left"] {
|
|
38
|
+
@apply origin-right;
|
|
39
|
+
/* border-left-width: 4px; */
|
|
40
|
+
|
|
41
|
+
& .p8n-arrow {
|
|
42
|
+
@apply w-0 h-0 absolute border-y-8 border-l-8 border-y-transparent border-l-current left-full drop-shadow-arrow dark:drop-shadow-[1px_0_0_rgb(var(--color-gray-2))];
|
|
43
|
+
clip: rect(0px, 12px, 16px, 0px);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[data-placement="left-start"] {
|
|
48
|
+
@apply origin-top-right;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-placement="left-end"] {
|
|
52
|
+
@apply origin-bottom-right;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[data-placement^="right"] {
|
|
56
|
+
/* border-right-width: 4px; */
|
|
57
|
+
@apply origin-left;
|
|
58
|
+
|
|
59
|
+
& .p8n-arrow {
|
|
60
|
+
@apply w-0 h-0 absolute border-y-8 border-r-8 border-y-transparent border-r-current right-full drop-shadow-arrow dark:drop-shadow-[-1px_0_0_rgb(var(--color-gray-2))];
|
|
61
|
+
clip: rect(0px, 8px, 16px, -4px);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[data-placement="right-start"] {
|
|
66
|
+
@apply origin-top-left;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-placement="right-end"] {
|
|
70
|
+
@apply origin-bottom-left;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-placement][data-color="yellow"] .p8n-arrow {
|
|
74
|
+
@apply text-gray-0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-placement][data-color="gray"] .p8n-arrow {
|
|
78
|
+
@apply text-gray-0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-placement][data-color="red"] .p8n-arrow {
|
|
82
|
+
@apply text-red-1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
[data-placement][data-color="orange"] .p8n-arrow {
|
|
86
|
+
@apply text-orange-1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-placement][data-color="blue"] .p8n-arrow {
|
|
90
|
+
@apply text-blue-1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-placement][data-color="green"] .p8n-arrow {
|
|
94
|
+
@apply text-green-1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.option[data-nested][data-open]:not([data-focus-inside]) {
|
|
98
|
+
@apply bg-gray-2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.option[data-focus-inside][data-open] {
|
|
102
|
+
@apply bg-gray-1;
|
|
103
|
+
}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ThemeColor = "yellow" | "gray" | "red" | "orange" | "green" | "blue";
|
|
2
|
+
|
|
3
|
+
export type MessageOptions = Partial<Omit<Message, "message" | "id">>;
|
|
4
|
+
|
|
5
|
+
export interface Message {
|
|
6
|
+
id: string;
|
|
7
|
+
content: string;
|
|
8
|
+
expiration: number; // in ms. if -1 never expire
|
|
9
|
+
color: ThemeColor;
|
|
10
|
+
canClose: boolean;
|
|
11
|
+
withLoader: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import pentatrionTw from "./src/tailwind/pentatrionTw";
|
|
2
|
+
|
|
3
|
+
/** @type {import('tailwindcss').Config} */
|
|
4
|
+
export default {
|
|
5
|
+
content: [
|
|
6
|
+
`./src/components/**/*.{ts,tsx}`,
|
|
7
|
+
`./src/hooks/**/*.{ts,tsx}`,
|
|
8
|
+
`./src/lib/**/*.{ts,tsx}`,
|
|
9
|
+
`./src/redux/**/*.{ts,tsx}`,
|
|
10
|
+
`./src/styles/**/*.{ts,tsx}`,
|
|
11
|
+
],
|
|
12
|
+
darkMode: ["class"],
|
|
13
|
+
theme: {
|
|
14
|
+
extend: {},
|
|
15
|
+
},
|
|
16
|
+
safelist: ["light", "dark"],
|
|
17
|
+
plugins: [pentatrionTw],
|
|
18
|
+
};
|
package/tests/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Testing library
|
|
2
|
+
|
|
3
|
+
## Matchers
|
|
4
|
+
|
|
5
|
+
custom Matchers : https://github.com/testing-library/jest-dom
|
|
6
|
+
|
|
7
|
+
`expect(...).toBeDisabled()`
|
|
8
|
+
|
|
9
|
+
- toBeDisabled
|
|
10
|
+
- toBeEnabled
|
|
11
|
+
- toBeEmptyDOMElement
|
|
12
|
+
- toBeInTheDocument
|
|
13
|
+
- toBeInvalid
|
|
14
|
+
- toBeRequired
|
|
15
|
+
- toBeValid
|
|
16
|
+
- toBeVisible
|
|
17
|
+
- toContainElement
|
|
18
|
+
- toContainHTML
|
|
19
|
+
- toHaveAccessibleDescription
|
|
20
|
+
- toHaveAccessibleErrorMessage
|
|
21
|
+
- toHaveAccessibleName
|
|
22
|
+
- toHaveAttribute
|
|
23
|
+
- toHaveClass
|
|
24
|
+
- toHaveFocus
|
|
25
|
+
- toHaveFormValues
|
|
26
|
+
- toHaveStyle
|
|
27
|
+
- toHaveTextContent
|
|
28
|
+
- toHaveValue
|
|
29
|
+
- toHaveDisplayValue
|
|
30
|
+
- toBeChecked
|
|
31
|
+
- toBePartiallyChecked
|
|
32
|
+
- toHaveErrorMessage
|
package/tests/setup.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom/vitest";
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"types": ["react/experimental", "@testing-library/jest-dom"],
|
|
7
|
+
"baseUrl": ".",
|
|
8
|
+
"paths": {
|
|
9
|
+
"~/*": ["./src/*"]
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"exclude": ["**/node_modules", "./dist"],
|
|
13
|
+
"include": ["src", "tests", ".storybook"]
|
|
14
|
+
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ["./src/index.ts", "./src/redux/index.ts"],
|
|
5
|
+
dts: true,
|
|
6
|
+
format: ["esm"],
|
|
7
|
+
esbuildOptions(options) {
|
|
8
|
+
options.external = [
|
|
9
|
+
"@floating-ui/react",
|
|
10
|
+
"clsx",
|
|
11
|
+
"react",
|
|
12
|
+
"react-dom",
|
|
13
|
+
"react-polymorphic-types",
|
|
14
|
+
"react-sortablejs",
|
|
15
|
+
"tailwindcss",
|
|
16
|
+
"react-redux",
|
|
17
|
+
"@reduxjs/toolkit",
|
|
18
|
+
];
|
|
19
|
+
},
|
|
20
|
+
splitting: false,
|
|
21
|
+
shims: true,
|
|
22
|
+
clean: true,
|
|
23
|
+
});
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
import react from "@vitejs/plugin-react-swc";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const projectDir = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [react()],
|
|
10
|
+
resolve: {
|
|
11
|
+
alias: {
|
|
12
|
+
"~": resolve(projectDir, "src"),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
test: {
|
|
16
|
+
// globals: true
|
|
17
|
+
environment: "jsdom",
|
|
18
|
+
setupFiles: ["./tests/setup.ts"],
|
|
19
|
+
|
|
20
|
+
// you might want to disable it, if you don't have tests that rely on CSS
|
|
21
|
+
// since parsing CSS is slow
|
|
22
|
+
css: false,
|
|
23
|
+
},
|
|
24
|
+
});
|