pentatrion-design 1.0.1 → 1.0.2
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/README.md +15 -31
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/Badge.d.ts.map +1 -1
- package/dist/components/badge/Badge.js +2 -8
- package/dist/components/button/Button.d.ts +3 -3
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +7 -6
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.js +3 -3
- package/dist/components/dropdown-menu/DropdownMenuItem.js +2 -2
- package/dist/components/dropdown-menu/interface.d.ts +1 -0
- package/dist/components/dropdown-menu/interface.d.ts.map +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +2 -1
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.js +3 -1
- package/dist/components/dropdown-menu/useDropdownMenuContext.d.ts +1 -0
- package/dist/components/dropdown-menu/useDropdownMenuContext.d.ts.map +1 -1
- package/dist/components/flash/Flash.d.ts.map +1 -1
- package/dist/components/flash/Flash.js +1 -2
- package/dist/components/input/Checkbox.d.ts +5 -4
- package/dist/components/input/Checkbox.d.ts.map +1 -1
- package/dist/components/input/Checkbox.js +6 -2
- package/dist/components/loader/Loader.d.ts.map +1 -1
- package/dist/components/loader/Loader.js +1 -2
- package/dist/components/media-preview/util.d.ts +1 -1
- package/dist/components/media-preview/util.d.ts.map +1 -1
- package/dist/components/modal/useModal.d.ts.map +1 -1
- package/dist/components/modal/useModalContext.d.ts.map +1 -1
- package/dist/components/popover/usePopover.d.ts.map +1 -1
- package/dist/components/popover/usePopoverContext.d.ts.map +1 -1
- package/dist/components/tooltip/useTooltip.d.ts.map +1 -1
- package/dist/components/tooltip/useTooltipContext.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +0 -1
- package/eslint.config.js +28 -28
- package/package.json +22 -28
- package/src/components/accordion/Accordion.stories.tsx +1 -1
- package/src/components/autocomplete/Autocomplete.stories.tsx +2 -2
- package/src/components/badge/Badge.stories.tsx +2 -2
- package/src/components/badge/Badge.tsx +9 -11
- package/src/components/button/Button.stories.tsx +2 -2
- package/src/components/button/Button.tsx +8 -7
- package/src/components/button/ButtonGroup.stories.tsx +1 -1
- package/src/components/button/HrefButton.stories.tsx +1 -1
- package/src/components/card/Card.stories.tsx +1 -1
- package/src/components/context-menu/ContextMenu.stories.tsx +2 -2
- package/src/components/dialog/Dialog.stories.tsx +35 -23
- package/src/components/draggable/Draggable.stories.tsx +1 -1
- package/src/components/draggable-advanced/DraggableAdvanced.stories.tsx +1 -1
- package/src/components/dropdown-menu/DropdownMenu.stories.tsx +1 -1
- package/src/components/dropdown-menu/DropdownMenu.tsx +6 -2
- package/src/components/dropdown-menu/DropdownMenuItem.tsx +2 -2
- package/src/components/dropdown-menu/interface.ts +1 -0
- package/src/components/dropdown-menu/useDropdownMenu.ts +3 -0
- package/src/components/dropdown-menu-nested/DropdownMenuNested.stories.tsx +1 -1
- package/src/components/flash/Flash.stories.tsx +1 -1
- package/src/components/flash/Flash.tsx +2 -3
- package/src/components/form/InputField.stories.tsx +1 -1
- package/src/components/form/SelectField.stories.tsx +1 -1
- package/src/components/form/form.stories.tsx +1 -1
- package/src/components/highlight/Highlight.stories.tsx +1 -1
- package/src/components/input/Checkbox.stories.tsx +36 -21
- package/src/components/input/Checkbox.tsx +17 -5
- package/src/components/input/Color.stories.tsx +1 -1
- package/src/components/input/Input.stories.tsx +1 -1
- package/src/components/input/InputButton.stories.tsx +1 -1
- package/src/components/input/MappedStars.stories.tsx +1 -1
- package/src/components/input/Radio.stories.tsx +1 -1
- package/src/components/input/Range.stories.tsx +1 -1
- package/src/components/input/Stars.stories.tsx +1 -1
- package/src/components/input/Toggle.stories.tsx +1 -1
- package/src/components/input/TotpInput.stories.tsx +1 -1
- package/src/components/loader/Loader.stories.tsx +1 -1
- package/src/components/loader/Loader.tsx +2 -2
- package/src/components/media-preview/MediaPreview.stories.tsx +1 -1
- package/src/components/media-preview/util.ts +1 -1
- package/src/components/modal/Modal.stories.tsx +1 -1
- package/src/components/notification/Notification.stories.tsx +2 -2
- package/src/components/popover/Popover.stories.tsx +1 -1
- package/src/components/quick-settings/QuickSettings.stories.tsx +1 -1
- package/src/components/resizable/Resizable.stories.tsx +1 -1
- package/src/components/resize-area/ResizeArea.stories.tsx +1 -1
- package/src/components/select/Select.stories.tsx +2 -2
- package/src/components/snack/Snack.stories.tsx +1 -1
- package/src/components/steps/Steps.stories.tsx +1 -1
- package/src/components/tabs/Tabs.stories.tsx +1 -1
- package/src/components/textarea/Textarea.stories.tsx +1 -1
- package/src/components/toast/Toast.stories.tsx +2 -2
- package/src/components/tooltip/Tooltip.stories.tsx +2 -2
- package/src/lib/index.ts +0 -1
- package/src/styles/Animation.stories.tsx +1 -1
- package/src/styles/Icons.stories.tsx +1 -1
- package/src/styles/Shadow.stories.tsx +1 -1
- package/src/styles/Themes.stories.tsx +1 -1
- package/src/styles/Typography.stories.tsx +1 -1
- package/src/tailwind/base.css +5 -0
- package/src/tailwind/components/index.css +10 -0
- package/src/tailwind/{components.css → components/others.css} +10 -2
- package/src/tailwind/index.css +3 -19
- package/src/tailwind/utilities.css +7 -0
- package/src/lib/tailwindVariants.ts +0 -34
- package/tailwind.config.ts +0 -18
- /package/src/tailwind/{utilities-dialog.css → components/dialog.css} +0 -0
- /package/src/tailwind/{components-input-outline.css → components/input-outline.css} +0 -0
- /package/src/tailwind/{components-range.css → components/range.css} +0 -0
- /package/src/tailwind/{components-resize-area.css → components/resize-area.css} +0 -0
- /package/src/tailwind/{components-step.css → components/step.css} +0 -0
package/README.md
CHANGED
|
@@ -46,19 +46,27 @@ export default defineConfig({
|
|
|
46
46
|
|
|
47
47
|
Mettre à jour le fichier `src/index.css`
|
|
48
48
|
|
|
49
|
+
Configuration recommandée
|
|
50
|
+
|
|
49
51
|
```css
|
|
50
52
|
/* src/index.css */
|
|
51
53
|
@import "tailwindcss";
|
|
52
54
|
|
|
53
|
-
@source "./node_modules/pentatrion-design/dist/lib";
|
|
54
55
|
@source "./node_modules/pentatrion-design/dist/components";
|
|
55
|
-
@source "./node_modules/pentatrion-design/dist/hooks";
|
|
56
|
-
@source "./node_modules/pentatrion-design/dist/redux";
|
|
57
56
|
|
|
58
|
-
@import "pentatrion-design/tailwind
|
|
57
|
+
@import "pentatrion-design/tailwind";
|
|
59
58
|
|
|
60
59
|
/* facultatif */
|
|
61
60
|
@import "pentatrion-design/tailwind/prose.css";
|
|
61
|
+
|
|
62
|
+
html {
|
|
63
|
+
font-size: 16px;
|
|
64
|
+
line-height: 24px;
|
|
65
|
+
color-scheme: normal;
|
|
66
|
+
}
|
|
67
|
+
body {
|
|
68
|
+
@apply bg-gray-0 text-gray-7 font-sans;
|
|
69
|
+
}
|
|
62
70
|
```
|
|
63
71
|
|
|
64
72
|
si on désire plus de contrôle sur nos imports
|
|
@@ -67,24 +75,13 @@ si on désire plus de contrôle sur nos imports
|
|
|
67
75
|
/* src/index.css */
|
|
68
76
|
@import "tailwindcss";
|
|
69
77
|
|
|
70
|
-
@source "./node_modules/pentatrion-design/dist/lib";
|
|
71
78
|
@source "./node_modules/pentatrion-design/dist/components";
|
|
72
|
-
@source "./node_modules/pentatrion-design/dist/hooks";
|
|
73
|
-
@source "./node_modules/pentatrion-design/dist/redux";
|
|
74
79
|
|
|
80
|
+
@import "pentatrion-design/tailwind/theme.css";
|
|
75
81
|
@import "pentatrion-design/tailwind/variants.css";
|
|
76
|
-
|
|
77
|
-
@import "pentatrion-design/tailwind/theme.css" layer(theme);
|
|
78
|
-
@import "pentatrion-design/tailwind/base.css" layer(base);
|
|
79
|
-
|
|
80
|
-
@import "pentatrion-design/tailwind/components-input-outline.css" layer(components);
|
|
81
|
-
@import "pentatrion-design/tailwind/components-range.css" layer(components);
|
|
82
|
-
@import "pentatrion-design/tailwind/components-resize-area.css" layer(components);
|
|
83
|
-
@import "pentatrion-design/tailwind/components-step.css" layer(components);
|
|
84
|
-
@import "pentatrion-design/tailwind/components.css" layer(components);
|
|
85
|
-
|
|
86
82
|
@import "pentatrion-design/tailwind/utilities.css";
|
|
87
|
-
@import "pentatrion-design/tailwind/
|
|
83
|
+
@import "pentatrion-design/tailwind/base.css" layer(base);
|
|
84
|
+
@import "pentatrion-design/tailwind/components/index.css" layer(components);
|
|
88
85
|
|
|
89
86
|
@import "pentatrion-design/tailwind/prose.css";
|
|
90
87
|
```
|
|
@@ -132,19 +129,6 @@ Create a `.vscode/settings.json` file
|
|
|
132
129
|
}
|
|
133
130
|
```
|
|
134
131
|
|
|
135
|
-
## Développement avec watch
|
|
136
|
-
|
|
137
|
-
anciennement dans le `package.json`. plus nécessaire pour le moment
|
|
138
|
-
|
|
139
|
-
```json
|
|
140
|
-
{
|
|
141
|
-
"scripts": {
|
|
142
|
-
"dev:tsc": "tsc -w -p tsconfig.build.json",
|
|
143
|
-
"dev:alias": "tsc-alias -w -p tsconfig.build.json",
|
|
144
|
-
"dev": "run-p dev:tsc dev:alias",
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
132
|
|
|
149
133
|
## Inclure le design-system dans un autre projet sans dépendance npm
|
|
150
134
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAO,EACP,GAAG,EACH,KAAgB,GACjB,EAAE,KAAK,2CAyCP"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { buttonVariants } from "../button/Button";
|
|
4
3
|
import { Tooltip } from "../tooltip/Tooltip";
|
|
5
4
|
import { TooltipContent } from "../tooltip/TooltipContent";
|
|
6
5
|
import { TooltipTrigger } from "../tooltip/TooltipTrigger";
|
|
7
6
|
export function Badge({ children, className, onRemove, onClick, tooltip, url, color = "yellow", }) {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
icon: null,
|
|
11
|
-
size: null,
|
|
12
|
-
clickable: onClick !== undefined,
|
|
13
|
-
width: "custom",
|
|
14
|
-
}), className), children: [onClick ? (_jsx("button", { className: "px-2", onClick: onClick, children: children })) : (_jsx("span", { className: "px-2", children: children })), onRemove && (_jsx("button", { className: "remove rounded-r-full pr-1 pl-0.5", onClick: onRemove, children: _jsx("i", { className: "fe-cancel" }) }))] }));
|
|
7
|
+
const clickable = onClick !== undefined || url !== undefined;
|
|
8
|
+
const badge = (_jsxs("span", { "data-color": color, className: clsx("bg-custom-2/50 text-gray-text relative box-border inline-flex h-(--h-button) items-center truncate leading-5 no-underline [--h-button:1.5rem]", clickable && "cursor-pointer active:translate-y-[1px]", "text-body-xs w-fit rounded-full", className), children: [onClick ? (_jsx("button", { className: "cursor-pointer px-2", onClick: onClick, children: children })) : (_jsx("span", { className: "px-2", children: children })), onRemove && (_jsx("button", { className: "remove cursor-pointer rounded-r-full pr-1 pl-0.5 active:translate-y-[1px]", onClick: onRemove, children: _jsx("i", { className: "fe-cancel" }) }))] }));
|
|
15
9
|
const wrappedBadge = url ? _jsx("a", { href: url, children: badge }) : badge;
|
|
16
10
|
if (!tooltip) {
|
|
17
11
|
return wrappedBadge;
|
|
@@ -3,7 +3,7 @@ import { ThemeColor } from "../../types";
|
|
|
3
3
|
export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
|
|
4
4
|
withRipple?: boolean;
|
|
5
5
|
variant?: "contained" | "light" | "outlined" | "text" | "ghost";
|
|
6
|
-
size?: "small" | "medium" | "large" | "custom" | "input";
|
|
6
|
+
size?: "small" | "medium" | "large" | "custom" | "input" | "scalable";
|
|
7
7
|
color?: ThemeColor | "yellow-alpha" | "gray-alpha";
|
|
8
8
|
width?: "fit" | "full" | "custom";
|
|
9
9
|
loading?: boolean;
|
|
@@ -19,10 +19,10 @@ export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const buttonVariants: (props?: ({
|
|
21
21
|
clickable?: boolean | null | undefined;
|
|
22
|
-
size?: "small" | "input" | "medium" | "large" | "custom" | null | undefined;
|
|
22
|
+
size?: "small" | "input" | "medium" | "large" | "custom" | "scalable" | null | undefined;
|
|
23
23
|
icon?: boolean | "custom" | null | undefined;
|
|
24
24
|
width?: "custom" | "fit" | "full" | null | undefined;
|
|
25
|
-
variant?: "light" | "text" | "
|
|
25
|
+
variant?: "light" | "text" | "ghost" | "contained" | "outlined" | null | undefined;
|
|
26
26
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
27
27
|
export declare function Button({ withRipple, variant, loading, color, size, focusable, className, disabled, children, selected, icon, asChild, width, ref, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAM/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAazC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAM/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAazC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;IAEtE,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;IAEnD,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IAElC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,cAAc;;;;;;8EAqD1B,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,UAAiB,EACjB,OAAqB,EACrB,OAAe,EACf,KAAgB,EAChB,IAAe,EACf,SAAgB,EAChB,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,QAAgB,EAChB,IAAY,EACZ,OAAe,EACf,KAAa,EACb,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,2CAyDb"}
|
|
@@ -15,18 +15,19 @@ function loaderColor(color) {
|
|
|
15
15
|
return color;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
export const buttonVariants = cva("relative box-border inline-flex items-center leading-5 no-underline focus-visible-has:outline-2
|
|
18
|
+
export const buttonVariants = cva("relative box-border inline-flex items-center leading-5 no-underline focus-visible-has:outline-2", {
|
|
19
19
|
variants: {
|
|
20
20
|
clickable: {
|
|
21
21
|
true: "cursor-pointer active:translate-y-[1px] focus-visible-has:z-10",
|
|
22
22
|
false: "pointer-events-none",
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
25
|
-
small: "[--h-button:1.5rem] h-(--h-button)",
|
|
26
|
-
medium: "[--h-button:2rem] h-(--h-button)",
|
|
27
|
-
large: "[--h-button:3rem] h-(--h-button)",
|
|
28
|
-
input: "[--h-button:calc(var(--h-input)-2px)] h-(--h-button)",
|
|
29
|
-
custom: "",
|
|
25
|
+
small: "[--h-button:1.5rem] h-(--h-button) truncate",
|
|
26
|
+
medium: "[--h-button:2rem] h-(--h-button) truncate",
|
|
27
|
+
large: "[--h-button:3rem] h-(--h-button) truncate",
|
|
28
|
+
input: "[--h-button:calc(var(--h-input)-2px)] h-(--h-button) truncate",
|
|
29
|
+
custom: "truncate",
|
|
30
|
+
scalable: "",
|
|
30
31
|
},
|
|
31
32
|
icon: {
|
|
32
33
|
true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg,strong)]:pr-4",
|
|
@@ -6,6 +6,6 @@ type DropdownMenuProps = ComponentProps<"div"> & UseDropdownMenuOptions & {
|
|
|
6
6
|
ref?: RefObject<HTMLDivElement>;
|
|
7
7
|
listClassName?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const DropdownMenu: ({ trigger, initialOpen, placement, open, onOpen, color, modal, style, className, listClassName, children, ref, ...props }: DropdownMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const DropdownMenu: ({ trigger, initialOpen, placement, open, onOpen, color, modal, presentation, style, className, listClassName, children, ref, ...props }: DropdownMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=DropdownMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,KAAK,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,sBAAsB,GAAG;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,eAAO,MAAM,YAAY,GAAI,
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,KAAK,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,sBAAsB,GAAG;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,eAAO,MAAM,YAAY,GAAI,yIAkB1B,iBAAiB,4CA6CnB,CAAC"}
|
|
@@ -7,12 +7,12 @@ import { Dialog } from "../dialog";
|
|
|
7
7
|
import { Slot } from "../slot";
|
|
8
8
|
export const DropdownMenu = ({
|
|
9
9
|
// options
|
|
10
|
-
trigger, initialOpen, placement, open, onOpen, color, modal,
|
|
10
|
+
trigger, initialOpen, placement, open, onOpen, color, modal, presentation,
|
|
11
11
|
// ComponentProps
|
|
12
12
|
style, className, listClassName, children, ref, ...props }) => {
|
|
13
|
-
const options = { initialOpen, placement, open, onOpen, color, modal };
|
|
13
|
+
const options = { initialOpen, placement, open, onOpen, color, modal, presentation };
|
|
14
14
|
const popover = useDropdownMenu(options);
|
|
15
15
|
const floatingContext = popover.context;
|
|
16
16
|
const mergedRef = useMergeRefs([popover.refs.setFloating, ref]);
|
|
17
|
-
return (_jsxs(DropdownMenuContext.Provider, { value: popover, children: [_jsx(Slot, { ref: popover.refs.setReference, "data-state": popover.open ? "open" : "closed", ...popover.getReferenceProps(), children: trigger }), popover.open && (_jsx(FloatingPortal, { children: _jsx(FloatingFocusManager, { context: floatingContext, modal: popover.modal, children: _jsx("div", { ref: mergedRef, className: clsx("z-dialog outline-hidden", className), style: { ...popover.floatingStyles, ...style }, ...popover.getFloatingProps(props), children: _jsx(Dialog, { placement: popover.placement, color: popover.color, className: "motion-safe:animate-fade-in p-1", children: _jsx("div", { className: clsx("box", listClassName), children: _jsx(FloatingList, { elementsRef: popover.elementsRef, labelsRef: popover.labelsRef, children: children }) }) }) }) }) }))] }));
|
|
17
|
+
return (_jsxs(DropdownMenuContext.Provider, { value: popover, children: [_jsx(Slot, { ref: popover.refs.setReference, "data-state": popover.open ? "open" : "closed", ...popover.getReferenceProps(), children: trigger }), popover.open && (_jsx(FloatingPortal, { children: _jsx(FloatingFocusManager, { context: floatingContext, modal: popover.modal, children: _jsx("div", { ref: mergedRef, className: clsx("z-dialog outline-hidden", className), style: { ...popover.floatingStyles, ...style }, ...popover.getFloatingProps(props), children: _jsx(Dialog, { placement: popover.placement, color: popover.color, className: clsx("motion-safe:animate-fade-in", popover.presentation === "large" && "p-1"), children: _jsx("div", { className: clsx("box", listClassName), children: _jsx(FloatingList, { elementsRef: popover.elementsRef, labelsRef: popover.labelsRef, children: children }) }) }) }) }) }))] }));
|
|
18
18
|
};
|
|
@@ -4,11 +4,11 @@ import clsx from "clsx";
|
|
|
4
4
|
import { useDropdownMenuContext } from "./useDropdownMenuContext";
|
|
5
5
|
import { Slot } from "../slot";
|
|
6
6
|
export function DropdownMenuItem({ children, className, onClick, type, asChild = false, ...rest }) {
|
|
7
|
-
const { activeIndex, getItemProps, handleSelect } = useDropdownMenuContext();
|
|
7
|
+
const { activeIndex, getItemProps, handleSelect, presentation } = useDropdownMenuContext();
|
|
8
8
|
const { ref, index } = useListItem({ label: children?.toString() });
|
|
9
9
|
const isActive = activeIndex === index;
|
|
10
10
|
const Comp = asChild ? Slot : "button";
|
|
11
|
-
return (_jsx(Comp, { className: clsx("option", isActive && "bg-gray-1", className), ref: ref, role: "menuitem", "data-presentation":
|
|
11
|
+
return (_jsx(Comp, { className: clsx("option", isActive && "bg-gray-1", className), ref: ref, role: "menuitem", "data-presentation": presentation, "aria-selected": isActive, tabIndex: isActive ? 0 : -1, ...getItemProps({
|
|
12
12
|
...rest,
|
|
13
13
|
onClick: (e) => {
|
|
14
14
|
onClick?.(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CACpC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { UseDropdownMenuOptions } from "./interface";
|
|
2
|
-
export declare function useDropdownMenu({ initialOpen, placement, open: controlledOpen, onOpen: setControlledOpen, color, modal, }: UseDropdownMenuOptions): {
|
|
2
|
+
export declare function useDropdownMenu({ initialOpen, placement, open: controlledOpen, onOpen: setControlledOpen, color, modal, presentation, }: UseDropdownMenuOptions): {
|
|
3
3
|
elementsRef: import("react").RefObject<(HTMLElement | null)[]>;
|
|
4
4
|
labelsRef: import("react").RefObject<(string | null)[]>;
|
|
5
5
|
color: import("../../types").ThemeColor | undefined;
|
|
6
6
|
modal: boolean;
|
|
7
7
|
activeIndex: number | null;
|
|
8
8
|
handleSelect: () => void;
|
|
9
|
+
presentation: "large" | "compact";
|
|
9
10
|
placement: import("@floating-ui/react-dom").Placement;
|
|
10
11
|
strategy: import("@floating-ui/react-dom").Strategy;
|
|
11
12
|
middlewareData: import("@floating-ui/react-dom").MiddlewareData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenu.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAiB1D,wBAAgB,eAAe,CAAC,EAC9B,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,
|
|
1
|
+
{"version":3,"file":"useDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenu.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAiB1D,wBAAgB,eAAe,CAAC,EAC9B,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,EACb,YAAsB,GACvB,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA4F6xjC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EAD1+jC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { autoUpdate, flip, offset, shift, useClick, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTypeahead, } from "@floating-ui/react";
|
|
3
3
|
const arrowWidth = 12;
|
|
4
|
-
export function useDropdownMenu({ initialOpen = false, placement = "bottom", open: controlledOpen, onOpen: setControlledOpen, color, modal = false, }) {
|
|
4
|
+
export function useDropdownMenu({ initialOpen = false, placement = "bottom", open: controlledOpen, onOpen: setControlledOpen, color, modal = false, presentation = "large", }) {
|
|
5
5
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(initialOpen);
|
|
6
6
|
const isUncontrolled = controlledOpen === null || controlledOpen === undefined;
|
|
7
7
|
const open = isUncontrolled ? uncontrolledOpen : controlledOpen;
|
|
@@ -65,6 +65,7 @@ export function useDropdownMenu({ initialOpen = false, placement = "bottom", ope
|
|
|
65
65
|
modal,
|
|
66
66
|
activeIndex,
|
|
67
67
|
handleSelect,
|
|
68
|
+
presentation,
|
|
68
69
|
}), [
|
|
69
70
|
open,
|
|
70
71
|
setOpen,
|
|
@@ -75,5 +76,6 @@ export function useDropdownMenu({ initialOpen = false, placement = "bottom", ope
|
|
|
75
76
|
activeIndex,
|
|
76
77
|
// getItemProps,
|
|
77
78
|
handleSelect,
|
|
79
|
+
presentation,
|
|
78
80
|
]);
|
|
79
81
|
}
|
|
@@ -8,6 +8,7 @@ export declare function useDropdownMenuContext(): {
|
|
|
8
8
|
modal: boolean;
|
|
9
9
|
activeIndex: number | null;
|
|
10
10
|
handleSelect: () => void;
|
|
11
|
+
presentation: "large" | "compact";
|
|
11
12
|
placement: import("@floating-ui/react-dom").Placement;
|
|
12
13
|
strategy: import("@floating-ui/react-dom").Strategy;
|
|
13
14
|
middlewareData: import("@floating-ui/react-dom").MiddlewareData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdownMenuContext.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenuContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAAC;AAE7D,eAAO,MAAM,mBAAmB,sCAAmC,CAAC;AAEpE,wBAAgB,sBAAsB
|
|
1
|
+
{"version":3,"file":"useDropdownMenuContext.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenuContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAAC;AAE7D,eAAO,MAAM,mBAAmB,sCAAmC,CAAC;AAEpE,wBAAgB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASq3nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EAD/koC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flash.d.ts","sourceRoot":"","sources":["../../../src/components/flash/Flash.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Flash.d.ts","sourceRoot":"","sources":["../../../src/components/flash/Flash.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,EAAE,KAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,2CAcrE"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { colorVariants } from "../../lib/tailwindVariants";
|
|
4
3
|
export function Flash({ color = "yellow", children, className }) {
|
|
5
|
-
return (_jsx("div", { className: clsx("bg-gray-0 dark:shadow-dark border-l-4 p-2 shadow-sm [&_p]:m-0",
|
|
4
|
+
return (_jsx("div", { "data-color": color, className: clsx("bg-gray-0 dark:shadow-dark border-custom-3 border-l-4 p-2 shadow-sm [&_p]:m-0", className), "aria-live": color !== "red" ? "polite" : "assertive", role: color !== "red" ? "status" : "alert", children: children }));
|
|
6
5
|
}
|
|
@@ -11,12 +11,13 @@ export declare function Checkbox({ color, indeterminate, disabled, className, ch
|
|
|
11
11
|
interface CheckboxButtonProps extends Omit<ComponentProps<"input">, "size"> {
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
color?: ButtonProps["color"];
|
|
14
|
-
variant?: "
|
|
15
|
-
size?: "
|
|
16
|
-
width?: "
|
|
14
|
+
variant?: ButtonProps["variant"];
|
|
15
|
+
size?: ButtonProps["size"];
|
|
16
|
+
width?: ButtonProps["width"];
|
|
17
17
|
icon?: boolean;
|
|
18
|
+
showInput?: boolean;
|
|
18
19
|
ref?: RefObject<HTMLInputElement>;
|
|
19
20
|
}
|
|
20
|
-
export declare function CheckboxButton({ color, disabled, width, size, icon, variant, className, children, ref, ...rest }: CheckboxButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function CheckboxButton({ color, disabled, width, size, icon, showInput, variant, className, children, ref, ...rest }: CheckboxButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export {};
|
|
22
23
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/input/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAgB,EAChB,aAAa,EACb,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,aAAa,2CAmBf;AAED,UAAU,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/input/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAgB,EAChB,aAAa,EACb,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,aAAa,2CAmBf;AAED,UAAU,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CACnC;AACD,wBAAgB,cAAc,CAAC,EAC7B,KAAgB,EAChB,QAAgB,EAChB,KAAa,EACb,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,mBAAmB,2CA2BrB"}
|
|
@@ -4,6 +4,10 @@ import { buttonVariants } from "../button";
|
|
|
4
4
|
export function Checkbox({ color = "yellow", indeterminate, disabled = false, className, children, ref, ...rest }) {
|
|
5
5
|
return (_jsxs("label", { "aria-disabled": disabled, className: clsx("flex cursor-pointer items-center"), children: [_jsx("input", { "data-color": color, ref: ref, disabled: disabled, type: "checkbox", className: clsx("p8n-input-checkbox", "my-1 mr-2 inline-block h-6 w-6 shrink-0 cursor-pointer appearance-none rounded-sm bg-origin-border p-0 outline-offset-0 select-none", indeterminate && "indeterminate", className), ...rest }), children] }));
|
|
6
6
|
}
|
|
7
|
-
export function CheckboxButton({ color = "yellow", disabled = false, width = "fit", size, icon, variant, className, children, ref, ...rest }) {
|
|
8
|
-
return (_jsxs("label", { "aria-disabled": disabled, className: clsx(className, buttonVariants({ variant, size, icon, width })), "data-color": color, children: [_jsx("input", { ref: ref, disabled: disabled, type: "checkbox", className:
|
|
7
|
+
export function CheckboxButton({ color = "yellow", disabled = false, width = "fit", size, icon, showInput, variant, className, children, ref, ...rest }) {
|
|
8
|
+
return (_jsxs("label", { "aria-disabled": disabled, className: clsx(className, showInput && "pr-2 pl-1", buttonVariants({ variant, size, icon: icon || showInput, width })), "data-color": color, children: [_jsx("input", { ref: ref, disabled: disabled, type: "checkbox", className: clsx(showInput
|
|
9
|
+
? "p8n-input-checkbox my-1 mr-2 inline-block h-6 w-6 shrink-0 cursor-pointer appearance-none rounded-2xl bg-origin-border p-0 outline-offset-0 select-none"
|
|
10
|
+
: "h-0 w-0 -translate-x-[9999px] overflow-hidden",
|
|
11
|
+
//indeterminate && "indeterminate",
|
|
12
|
+
className), ...rest }), children] }));
|
|
9
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/components/loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,SAAS,EAAS,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/components/loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,SAAS,EAAS,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,UAAU,KAAM,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrD,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IAC9C,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACtC;AA0BD,wBAAgB,MAAM,CAAC,EACrB,IAAe,EACf,KAAc,EACd,OAAc,EACd,SAAS,EACT,QAAqB,EACrB,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,KAAK,2CAwCP"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { colorVariants } from "../../lib/tailwindVariants";
|
|
5
4
|
const sizeConfig = {
|
|
6
5
|
small: "[--h-button:1.5rem]",
|
|
7
6
|
medium: "[--h-button:2rem]",
|
|
@@ -25,5 +24,5 @@ const circleStyle = {
|
|
|
25
24
|
};
|
|
26
25
|
export function Loader({ size = "medium", color = "blue", loading = true, className, position = "relative", children, ...rest }) {
|
|
27
26
|
const id = useId();
|
|
28
|
-
return (_jsxs("div", { className: clsx("inline-block h-(--h-button) w-(--h-button)", position, sizeConfig[size], className), ...rest, children: [loading && (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: clsx("inline-block h-(--h-button) w-(--h-button)", color !== "custom" &&
|
|
27
|
+
return (_jsxs("div", { "data-color": color, className: clsx("inline-block h-(--h-button) w-(--h-button)", position, sizeConfig[size], className), ...rest, children: [loading && (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: clsx("inline-block h-(--h-button) w-(--h-button)", color !== "custom" && "text-custom-4"), viewBox: "0 0 16 16", children: [_jsx("defs", { children: _jsx("circle", { id: id, cx: "8", cy: "8", r: "7" }) }), _jsx("use", { href: `#${id}`, className: "fill-none stroke-current opacity-25", style: trackStyle }), _jsx("use", { href: `#${id}`, className: "animate-loader-stroke fill-none stroke-current", style: circleStyle })] })), children && (_jsx("div", { className: "absolute top-0 left-0 inline-flex h-(--h-button) w-(--h-button) items-center justify-center", children: children }))] }));
|
|
29
28
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BasicMedia, BasicMediaImage } from "./types";
|
|
2
|
-
export declare function isMediaImage(media: BasicMedia | null): media is BasicMediaImage;
|
|
2
|
+
export declare function isMediaImage(media: BasicMedia | null | undefined): media is BasicMediaImage;
|
|
3
3
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/components/media-preview/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEtD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,KAAK,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/components/media-preview/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEtD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,eAAe,CAQ3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAgB,QAAQ,CAAC,EACvB,WAAmB,EACnB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,GACN,GAAE,YAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useModal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAgB,QAAQ,CAAC,EACvB,WAAmB,EACnB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,GACN,GAAE,YAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAuCm/lC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EAD3rmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModalContext.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModalContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC;AAEtD,eAAO,MAAM,YAAY,sCAAmC,CAAC;AAE7D,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useModalContext.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModalContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC;AAEtD,eAAO,MAAM,YAAY,sCAAmC,CAAC;AAE7D,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASo7nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADvooC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopover.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,GACd,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopover.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,GACd,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAwD+glC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADptlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopoverContext.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopoverContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"usePopoverContext.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopoverContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASk6nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADvnoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAiB,EACjB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,SAAe,EACf,UAAgB,EAChB,KAAgB,GACjB,GAAE,cAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAiB,EACjB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,SAAe,EACf,UAAgB,EAChB,KAAgB,GACjB,GAAE,cAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA4DgilC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EAD1ulC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltipContext.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltipContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useTooltipContext.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltipContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASk6nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADvnoC"}
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
package/dist/lib/index.js
CHANGED
package/eslint.config.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
|
|
2
|
+
import storybook from "eslint-plugin-storybook";
|
|
3
|
+
|
|
1
4
|
import js from "@eslint/js";
|
|
2
5
|
import globals from "globals";
|
|
3
6
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
7
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
5
8
|
import tseslint from "typescript-eslint";
|
|
6
9
|
|
|
7
|
-
export default tseslint.config(
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
],
|
|
32
|
-
"@typescript-eslint/no-unused-expressions": "off",
|
|
33
|
-
},
|
|
10
|
+
export default tseslint.config({ ignores: ["dist", "storybook-static"] }, {
|
|
11
|
+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
12
|
+
files: ["src/**/*.{ts,tsx}", ".storybook/**/*.{ts,tsx}"],
|
|
13
|
+
languageOptions: {
|
|
14
|
+
ecmaVersion: 2020,
|
|
15
|
+
globals: globals.browser,
|
|
16
|
+
},
|
|
17
|
+
plugins: {
|
|
18
|
+
"react-hooks": reactHooks,
|
|
19
|
+
"react-refresh": reactRefresh,
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
...reactHooks.configs.recommended.rules,
|
|
23
|
+
"react-refresh/only-export-components": "off",
|
|
24
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
25
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
26
|
+
"@typescript-eslint/ban-types": "off",
|
|
27
|
+
"@typescript-eslint/no-unused-vars": [
|
|
28
|
+
"error",
|
|
29
|
+
{
|
|
30
|
+
varsIgnorePattern: "_",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
34
34
|
},
|
|
35
|
-
);
|
|
35
|
+
}, storybook.configs["flat/recommended"]);
|