@oneplatformdev/ui 0.1.99-beta.19 → 0.1.99-beta.196
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/Accordion/Accordion.d.ts +1 -1
- package/Accordion/Accordion.d.ts.map +1 -1
- package/Accordion/Accordion.js +48 -26
- package/Accordion/Accordion.js.map +1 -1
- package/AlertDialog/AlertDialog.stories.js +3 -2
- package/AlertDialog/AlertDialog.stories.js.map +1 -1
- package/AlertDialog/AlertDialogRoot.d.ts.map +1 -1
- package/AlertDialog/AlertDialogRoot.js +26 -24
- package/AlertDialog/AlertDialogRoot.js.map +1 -1
- package/Button/Button.d.ts.map +1 -1
- package/Button/Button.js +43 -43
- package/Button/Button.js.map +1 -1
- package/Button/Button.utils.d.ts +3 -0
- package/Button/Button.utils.d.ts.map +1 -0
- package/Button/Button.utils.js +14 -0
- package/Button/Button.utils.js.map +1 -0
- package/Button/buttonVariants.d.ts.map +1 -1
- package/Button/buttonVariants.js +2 -1
- package/Button/buttonVariants.js.map +1 -1
- package/Button/index.d.ts +1 -0
- package/Button/index.d.ts.map +1 -1
- package/Button/index.js +8 -6
- package/Button/index.js.map +1 -1
- package/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/ButtonIcon/ButtonIcon.js +41 -39
- package/ButtonIcon/ButtonIcon.js.map +1 -1
- package/ButtonIcon/ButtonIcon.stories.js +35 -33
- package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
- package/ButtonIcon/buttonIconVariants.d.ts.map +1 -1
- package/ButtonIcon/buttonIconVariants.js +3 -2
- package/ButtonIcon/buttonIconVariants.js.map +1 -1
- package/CHANGELOG.md +855 -0
- package/Calendar/Calendar.js +5 -4
- package/Calendar/Calendar.js.map +1 -1
- package/Checkbox/Checkbox.d.ts.map +1 -1
- package/Checkbox/Checkbox.js +32 -30
- package/Checkbox/Checkbox.js.map +1 -1
- package/Checkbox/Checkbox.stories.js +108 -0
- package/Checkbox/Checkbox.stories.js.map +1 -0
- package/Combobox/Combobox.d.ts +1 -1
- package/Combobox/Combobox.d.ts.map +1 -1
- package/Combobox/Combobox.js +205 -190
- package/Combobox/Combobox.js.map +1 -1
- package/Combobox/Combobox.stories.js +212 -0
- package/Combobox/Combobox.stories.js.map +1 -0
- package/Combobox/Combobox.types.d.ts +34 -19
- package/Combobox/Combobox.types.d.ts.map +1 -1
- package/Combobox/ComboboxOptionItem.d.ts +4 -3
- package/Combobox/ComboboxOptionItem.d.ts.map +1 -1
- package/Combobox/ComboboxOptionItem.js +49 -22
- package/Combobox/ComboboxOptionItem.js.map +1 -1
- package/Combobox/ComboboxOptions.d.ts +2 -2
- package/Combobox/ComboboxOptions.d.ts.map +1 -1
- package/Combobox/ComboboxOptions.js +48 -48
- package/Combobox/ComboboxOptions.js.map +1 -1
- package/Command/Command.d.ts +6 -1
- package/Command/Command.d.ts.map +1 -1
- package/Command/Command.js +50 -35
- package/Command/Command.js.map +1 -1
- package/DataTable/DataTable.js +16 -15
- package/DataTable/DataTable.js.map +1 -1
- package/Dialog/Dialog.d.ts +4 -1
- package/Dialog/Dialog.d.ts.map +1 -1
- package/Dialog/Dialog.js +70 -37
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/Dialog.stories.js +102 -0
- package/Dialog/Dialog.stories.js.map +1 -0
- package/Dialog/Dialog.types.d.ts +4 -0
- package/Dialog/Dialog.types.d.ts.map +1 -0
- package/Dialog/Dialog.types.js +2 -0
- package/Dialog/Dialog.types.js.map +1 -0
- package/Dialog/index.d.ts +1 -0
- package/Dialog/index.d.ts.map +1 -1
- package/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/DropdownMenu/DropdownMenu.js +33 -20
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/Form/Form.d.ts.map +1 -1
- package/Form/Form.js.map +1 -1
- package/Form/FormRenderControl.d.ts +1 -1
- package/Form/FormRenderControl.d.ts.map +1 -1
- package/Form/FormRenderControl.js +54 -14
- package/Form/FormRenderControl.js.map +1 -1
- package/Form/FormRenderControl.types.d.ts +4 -1
- package/Form/FormRenderControl.types.d.ts.map +1 -1
- package/FormCombobox/FormCombobox.d.ts.map +1 -1
- package/FormCombobox/FormCombobox.js +15 -13
- package/FormCombobox/FormCombobox.js.map +1 -1
- package/FormDatePicker/FormDatePicker.d.ts.map +1 -1
- package/FormDatePicker/FormDatePicker.js +18 -16
- package/FormDatePicker/FormDatePicker.js.map +1 -1
- package/FormDropzone/FormDropzone.d.ts.map +1 -1
- package/FormDropzone/FormDropzone.js +11 -9
- package/FormDropzone/FormDropzone.js.map +1 -1
- package/FormInput/FormInput.d.ts.map +1 -1
- package/FormInput/FormInput.js +46 -27
- package/FormInput/FormInput.js.map +1 -1
- package/FormInput/FormInput.stories.js +57 -0
- package/FormInput/FormInput.stories.js.map +1 -0
- package/FormSelect/FormSelect.d.ts.map +1 -1
- package/FormSelect/FormSelect.js +21 -17
- package/FormSelect/FormSelect.js.map +1 -1
- package/FormTextarea/FormTextarea.d.ts.map +1 -1
- package/FormTextarea/FormTextarea.js +15 -13
- package/FormTextarea/FormTextarea.js.map +1 -1
- package/InfoBlock/InfoBlock.d.ts +7 -0
- package/InfoBlock/InfoBlock.d.ts.map +1 -0
- package/InfoBlock/InfoBlock.js +28 -0
- package/InfoBlock/InfoBlock.js.map +1 -0
- package/InfoBlock/InfoBlock.stories.js +50 -0
- package/InfoBlock/InfoBlock.stories.js.map +1 -0
- package/InfoBlock/InfoBlock.types.d.ts +9 -0
- package/InfoBlock/InfoBlock.types.d.ts.map +1 -0
- package/InfoBlock/InfoBlock.types.js +2 -0
- package/InfoBlock/InfoBlock.types.js.map +1 -0
- package/InfoBlock/index.d.ts +3 -0
- package/InfoBlock/index.d.ts.map +1 -0
- package/InfoBlock/index.js +5 -0
- package/InfoBlock/index.js.map +1 -0
- package/InfoBlock/infoBlockVariants.d.ts +6 -0
- package/InfoBlock/infoBlockVariants.d.ts.map +1 -0
- package/InfoBlock/infoBlockVariants.js +27 -0
- package/InfoBlock/infoBlockVariants.js.map +1 -0
- package/Input/Input.js +1 -1
- package/Input/Input.js.map +1 -1
- package/Input/inputVariants.d.ts.map +1 -1
- package/Input/inputVariants.js +5 -4
- package/Input/inputVariants.js.map +1 -1
- package/LoadingMask/LoadingMask.d.ts +1 -2
- package/LoadingMask/LoadingMask.d.ts.map +1 -1
- package/LoadingMask/LoadingMask.js +8 -8
- package/LoadingMask/LoadingMask.js.map +1 -1
- package/LoadingMask/LoadingMask.types.d.ts +1 -0
- package/LoadingMask/LoadingMask.types.d.ts.map +1 -1
- package/Resizable/Resizable.d.ts +1 -1
- package/Resizable/Resizable.d.ts.map +1 -1
- package/Resizable/Resizable.js +21 -16
- package/Resizable/Resizable.js.map +1 -1
- package/Search/Search.d.ts.map +1 -1
- package/Search/Search.js +41 -32
- package/Search/Search.js.map +1 -1
- package/Search/Search.stories.js +17 -0
- package/Search/Search.stories.js.map +1 -0
- package/Select/Select.d.ts.map +1 -1
- package/Select/Select.js +53 -48
- package/Select/Select.js.map +1 -1
- package/Select/Select.types.d.ts +4 -0
- package/Select/Select.types.d.ts.map +1 -1
- package/Select/SelectRoot.js +1 -1
- package/Select/SelectRoot.js.map +1 -1
- package/TablePagination/TablePagination.js +9 -8
- package/TablePagination/TablePagination.js.map +1 -1
- package/Textarea/Textarea.d.ts.map +1 -1
- package/Textarea/Textarea.js +48 -43
- package/Textarea/Textarea.js.map +1 -1
- package/Textarea/Textarea.stories.js +1 -1
- package/Textarea/Textarea.stories.js.map +1 -1
- package/Textarea/Textarea.types.d.ts +3 -1
- package/Textarea/Textarea.types.d.ts.map +1 -1
- package/Toast/Toast.d.ts +1 -1
- package/Toast/toastVariants.d.ts +1 -1
- package/Tooltip/Tooltip.d.ts.map +1 -1
- package/Tooltip/Tooltip.js +41 -29
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tooltip/Tooltip.types.d.ts +1 -0
- package/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/Tooltip/tooltipVariants.d.ts +4 -0
- package/Tooltip/tooltipVariants.d.ts.map +1 -0
- package/Tooltip/tooltipVariants.js +23 -0
- package/Tooltip/tooltipVariants.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +332 -328
- package/index.js.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { InfoBlock as o } from "./InfoBlock.js";
|
|
3
|
+
import { CircleAlert as n } from "lucide-react";
|
|
4
|
+
const a = {
|
|
5
|
+
title: "UI/InfoBlock",
|
|
6
|
+
component: o,
|
|
7
|
+
argTypes: {
|
|
8
|
+
variant: {
|
|
9
|
+
control: "select",
|
|
10
|
+
options: ["error", "info"],
|
|
11
|
+
description: "Defines the color scheme and default icon"
|
|
12
|
+
},
|
|
13
|
+
content: {
|
|
14
|
+
control: "text",
|
|
15
|
+
description: "Text or content inside the block"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
layout: "centered"
|
|
20
|
+
}
|
|
21
|
+
}, i = {
|
|
22
|
+
args: {
|
|
23
|
+
variant: "error",
|
|
24
|
+
content: "Увага! Перш ніж архівувати підрозділ “Підрозділ дизайну”, переведіть співробітників до іншого — інакше вони будуть автоматично звільнені."
|
|
25
|
+
}
|
|
26
|
+
}, s = {
|
|
27
|
+
args: {
|
|
28
|
+
variant: "info",
|
|
29
|
+
content: "Зміни вступлять в силу після збереження налаштувань профілю."
|
|
30
|
+
}
|
|
31
|
+
}, l = {
|
|
32
|
+
args: {
|
|
33
|
+
variant: "info",
|
|
34
|
+
icon: /* @__PURE__ */ t(n, { className: "text-blue-500" }),
|
|
35
|
+
content: "Цей блок використовує передану вручну іконку замість стандартної."
|
|
36
|
+
}
|
|
37
|
+
}, f = {
|
|
38
|
+
args: {
|
|
39
|
+
variant: "error",
|
|
40
|
+
content: "Дуже довгий текст: ".repeat(20)
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
l as CustomIcon,
|
|
45
|
+
i as Error,
|
|
46
|
+
s as Info,
|
|
47
|
+
f as LongContent,
|
|
48
|
+
a as default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=InfoBlock.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.stories.js","sources":["../../src/InfoBlock/InfoBlock.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite';\nimport { InfoBlock } from './InfoBlock';\nimport { CircleAlert } from 'lucide-react';\n\nconst meta = {\n title: 'UI/InfoBlock',\n component: InfoBlock,\n argTypes: {\n variant: {\n control: 'select',\n options: ['error', 'info'],\n description: 'Defines the color scheme and default icon',\n },\n content: {\n control: 'text',\n description: 'Text or content inside the block',\n },\n },\n parameters: {\n layout: 'centered',\n },\n} satisfies Meta<typeof InfoBlock>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Error: Story = {\n args: {\n variant: 'error',\n content: 'Увага! Перш ніж архівувати підрозділ “Підрозділ дизайну”, переведіть співробітників до іншого — інакше вони будуть автоматично звільнені.',\n },\n};\n\nexport const Info: Story = {\n args: {\n variant: 'info',\n content: 'Зміни вступлять в силу після збереження налаштувань профілю.',\n },\n};\n\nexport const CustomIcon: Story = {\n args: {\n variant: 'info',\n icon: <CircleAlert className=\"text-blue-500\" />,\n content: 'Цей блок використовує передану вручну іконку замість стандартної.',\n },\n};\n\nexport const LongContent: Story = {\n args: {\n variant: 'error',\n content: 'Дуже довгий текст: '.repeat(20),\n },\n};\n"],"names":["meta","InfoBlock","Error","Info","CustomIcon","jsx","CircleAlert","LongContent"],"mappings":";;;AAIA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,SAAS,CAAC,SAAS,MAAM;AAAA,MACzB,aAAa;AAAA,IAAA;AAAA,IAEf,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,YAAY;AAAA,IACV,QAAQ;AAAA,EAAA;AAEZ,GAMaC,IAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAEb,GAEaC,IAAc;AAAA,EACzB,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAEb,GAEaC,IAAoB;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,gBAAAC,EAACC,GAAA,EAAY,WAAU,gBAAA,CAAgB;AAAA,IAC7C,SAAS;AAAA,EAAA;AAEb,GAEaC,IAAqB;AAAA,EAChC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS,sBAAsB,OAAO,EAAE;AAAA,EAAA;AAE5C;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InfoBlockVariantsProps } from './infoBlockVariants';
|
|
2
|
+
import { ComponentType, HTMLAttributes, PropsWithChildren, ReactElement, ReactNode, SVGProps } from 'react';
|
|
3
|
+
export type InfoBlockIconType = ComponentType<SVGProps<SVGSVGElement>> | ReactElement<SVGProps<SVGSVGElement>>;
|
|
4
|
+
export interface InfoBlockProps extends PropsWithChildren, InfoBlockVariantsProps, Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
5
|
+
content?: ReactNode;
|
|
6
|
+
node?: ReactNode;
|
|
7
|
+
icon?: InfoBlockIconType;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=InfoBlock.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.types.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/InfoBlock.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,iBAAiB,GACzB,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GACtC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE1C,MAAM,WAAW,cACf,SAAQ,iBAAiB,EACvB,sBAAsB,EACtB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const infoBlockVariants: (props?: ({
|
|
3
|
+
variant?: "error" | "info" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export type InfoBlockVariantsProps = VariantProps<typeof infoBlockVariants>;
|
|
6
|
+
//# sourceMappingURL=infoBlockVariants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoBlockVariants.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/infoBlockVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,iBAAiB;;8EAqB7B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cva as t } from "class-variance-authority";
|
|
2
|
+
const a = t(
|
|
3
|
+
[
|
|
4
|
+
"flex items-start gap-2",
|
|
5
|
+
"p-2.5 rounded-lg",
|
|
6
|
+
"font-medium text-base leading-normal text-[#06080D]",
|
|
7
|
+
"whitespace-pre-wrap break-words",
|
|
8
|
+
"[&>p]:m-0 [&>p]:p-0",
|
|
9
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-6",
|
|
10
|
+
"transition-transform duration-200 [&_svg]:transition-transform [&_svg]:duration-200"
|
|
11
|
+
],
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
error: "bg-[#DC26260F] [&>svg]:text-[#DC2626]",
|
|
16
|
+
info: "bg-[#9368FF0F] [&>svg]:text-[#9368FF]"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "error"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
export {
|
|
25
|
+
a as infoBlockVariants
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=infoBlockVariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoBlockVariants.js","sources":["../../src/InfoBlock/infoBlockVariants.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const infoBlockVariants = cva(\n [\n 'flex items-start gap-2',\n 'p-2.5 rounded-lg',\n 'font-medium text-base leading-normal text-[#06080D]',\n 'whitespace-pre-wrap break-words',\n '[&>p]:m-0 [&>p]:p-0',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-6\",\n 'transition-transform duration-200 [&_svg]:transition-transform [&_svg]:duration-200',\n ],\n {\n variants: {\n variant: {\n error: 'bg-[#DC26260F] [&>svg]:text-[#DC2626]',\n info: 'bg-[#9368FF0F] [&>svg]:text-[#9368FF]',\n },\n },\n defaultVariants: {\n variant: 'error',\n },\n }\n)\n\nexport type InfoBlockVariantsProps = VariantProps<typeof infoBlockVariants>;\n"],"names":["infoBlockVariants","cva"],"mappings":";AAEO,MAAMA,IAAoBC;AAAA,EAC/B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
|
package/Input/Input.js
CHANGED
package/Input/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { inputVariants } from './inputVariants';\n\nimport { cn } from '@oneplatformdev/utils';\nimport { InputProps } from './Input.types';\n\nexport const BaseInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n className,\n variant,\n type,\n slotProps: { input, wrapper } = {},\n onChange,\n onTransform,\n fullSize = false,\n ...rest\n } = props;\n const {\n startAdornment,\n className: classNameInputSlotProps,\n ...restInputSlotProps\n } = input || {};\n return (\n <div\n {...(wrapper || {})}\n className={cn(\n 'relative',\n fullSize && 'w-full',\n wrapper?.className\n )}>\n {Boolean(startAdornment) && (\n <span className=\"absolute left-[10px] top-1/2 -translate-y-1/2\">\n {startAdornment}\n </span>\n )}\n <input\n type={type}\n className={cn(\n inputVariants({ variant, className }),\n Boolean(startAdornment) && 'pl-
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { inputVariants } from './inputVariants';\n\nimport { cn } from '@oneplatformdev/utils';\nimport { InputProps } from './Input.types';\n\nexport const BaseInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n className,\n variant,\n type,\n slotProps: { input, wrapper } = {},\n onChange,\n onTransform,\n fullSize = false,\n ...rest\n } = props;\n const {\n startAdornment,\n className: classNameInputSlotProps,\n ...restInputSlotProps\n } = input || {};\n return (\n <div\n {...(wrapper || {})}\n className={cn(\n 'relative',\n fullSize && 'w-full',\n wrapper?.className\n )}>\n {Boolean(startAdornment) && (\n <span className=\"absolute left-[10px] top-1/2 -translate-y-1/2\">\n {startAdornment}\n </span>\n )}\n <input\n type={type}\n className={cn(\n inputVariants({ variant, className }),\n Boolean(startAdornment) && 'pl-10',\n classNameInputSlotProps,\n fullSize && 'min-w-auto',\n )}\n ref={ref}\n {...restInputSlotProps}\n {...rest}\n onChange={(e) => {\n if (typeof onTransform?.(e.target.value, e) === 'string') {\n e.target.value = onTransform(e.target.value, e);\n }\n if (onChange) onChange(e);\n }}\n />\n </div>\n );\n }\n);\nBaseInput.displayName = 'Input';\n\nexport const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const [isVisible, setIsVisible] = useState<boolean>(false);\n\n const inputType = isVisible ? 'text' : 'password';\n\n const toggleVisibility = () => {\n setIsVisible(!isVisible);\n };\n\n return (\n <div {...(props?.slotProps?.wrapper || {})} className={cn('relative', props?.slotProps?.wrapper?.className)}>\n <BaseInput {...props} type={inputType} className=\"pr-8\" ref={ref} />\n <VisibilityButton isVisible={isVisible} onClick={toggleVisibility} />\n </div>\n );\n }\n);\nPasswordInput.displayName = 'PasswordInput';\n\ntype VisibilityButtonProps = {\n isVisible: boolean\n onClick: () => void\n}\n\nconst VisibilityButton = ({ isVisible, onClick }:VisibilityButtonProps) => (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"absolute top-1/2 right-3 transform -translate-y-1/2\"\n >\n {isVisible ? <Eye size={16} /> : <EyeOff size={16} />}\n </button>\n);\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ type, ...props }, ref) => {\n if (type === 'password') return <PasswordInput type={type} {...props} ref={ref} />;\n return <BaseInput type={type} {...props} ref={ref} />;\n }\n);\nInput.displayName = 'Input';\n"],"names":["BaseInput","React","props","ref","className","variant","type","input","wrapper","onChange","onTransform","fullSize","rest","startAdornment","classNameInputSlotProps","restInputSlotProps","jsxs","cn","jsx","inputVariants","e","PasswordInput","isVisible","setIsVisible","useState","inputType","toggleVisibility","VisibilityButton","onClick","Eye","EyeOff","Input"],"mappings":";;;;;AAOO,MAAMA,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAW,EAAE,OAAAC,GAAO,SAAAC,EAAA,IAAY,CAAA;AAAA,MAChC,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,UAAAC,IAAW;AAAA,MACX,GAAGC;AAAA,IAAA,IACDV,GACE;AAAA,MACJ,gBAAAW;AAAA,MACA,WAAWC;AAAA,MACX,GAAGC;AAAA,IAAA,IACDR,KAAS,CAAA;AACb,WACE,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAIR,KAAW,CAAA;AAAA,QAChB,WAAWS;AAAA,UACT;AAAA,UACAN,KAAY;AAAA,UACZH,GAAS;AAAA,QAAA;AAAA,QAEV,UAAA;AAAA,UAAA,EAAQK,KACP,gBAAAK,EAAC,QAAA,EAAK,WAAU,iDACb,UAAAL,GACH;AAAA,UAEF,gBAAAK;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAAZ;AAAA,cACA,WAAWW;AAAA,gBACTE,EAAc,EAAE,SAAAd,GAAS,WAAAD,GAAW;AAAA,gBACpC,EAAQS,KAAmB;AAAA,gBAC3BC;AAAA,gBACAH,KAAY;AAAA,cAAA;AAAA,cAEd,KAAAR;AAAA,cACC,GAAGY;AAAA,cACH,GAAGH;AAAA,cACJ,UAAU,CAACQ,MAAM;AACf,gBAAI,OAAOV,IAAcU,EAAE,OAAO,OAAOA,CAAC,KAAM,aAC9CA,EAAE,OAAO,QAAQV,EAAYU,EAAE,OAAO,OAAOA,CAAC,IAE5CX,OAAmBW,CAAC;AAAA,cAC1B;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACApB,EAAU,cAAc;AAEjB,MAAMqB,IAAgBpB,EAAM;AAAA,EACjC,CAACC,GAAOC,MAAQ;AACd,UAAM,CAACmB,GAAWC,CAAY,IAAIC,EAAkB,EAAK,GAEnDC,IAAYH,IAAY,SAAS,YAEjCI,IAAmB,MAAM;AAC7B,MAAAH,EAAa,CAACD,CAAS;AAAA,IACzB;AAEA,WACE,gBAAAN,EAAC,OAAA,EAAK,GAAId,GAAO,WAAW,WAAW,CAAA,GAAK,WAAWe,EAAG,YAAYf,GAAO,WAAW,SAAS,SAAS,GACxG,UAAA;AAAA,MAAA,gBAAAgB,EAAClB,KAAW,GAAGE,GAAO,MAAMuB,GAAW,WAAU,QAAO,KAAAtB,GAAU;AAAA,MAClE,gBAAAe,EAACS,GAAA,EAAiB,WAAAL,GAAsB,SAASI,EAAA,CAAkB;AAAA,IAAA,GACrE;AAAA,EAEJ;AACF;AACAL,EAAc,cAAc;AAO5B,MAAMM,IAAmB,CAAC,EAAE,WAAAL,GAAW,SAAAM,QACrC,gBAAAV;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAAU;AAAA,IACA,WAAU;AAAA,IAET,UAAAN,sBAAaO,GAAA,EAAI,MAAM,IAAI,IAAK,gBAAAX,EAACY,GAAA,EAAO,MAAM,GAAA,CAAI;AAAA,EAAA;AACrD,GAGWC,IAAQ9B,EAAM;AAAA,EACzB,CAAC,EAAE,MAAAK,GAAM,GAAGJ,EAAA,GAASC,MACfG,MAAS,aAAmB,gBAAAY,EAACG,KAAc,MAAAf,GAAa,GAAGJ,GAAO,KAAAC,GAAU,IACzE,gBAAAe,EAAClB,GAAA,EAAU,MAAAM,GAAa,GAAGJ,GAAO,KAAAC,GAAU;AAEvD;AACA4B,EAAM,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputVariants.d.ts","sourceRoot":"","sources":["../../src/Input/inputVariants.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"inputVariants.d.ts","sourceRoot":"","sources":["../../src/Input/inputVariants.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;8EAoBzB,CAAC"}
|
package/Input/inputVariants.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { cva as
|
|
2
|
-
const t =
|
|
1
|
+
import { cva as r } from "class-variance-authority";
|
|
2
|
+
const t = r(
|
|
3
3
|
[
|
|
4
|
-
"flex h-10 w-full rounded-
|
|
4
|
+
"flex h-10 w-full rounded-lg border border-input px-3 py-2",
|
|
5
5
|
"text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground",
|
|
6
6
|
"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7
7
|
"group-data-[state=invalid]/form-control:border-destructive",
|
|
8
|
-
"group-data-[state=valid]/form-control:border-input"
|
|
8
|
+
"group-data-[state=valid]/form-control:border-input",
|
|
9
|
+
"box-border"
|
|
9
10
|
],
|
|
10
11
|
{
|
|
11
12
|
variants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputVariants.js","sources":["../../src/Input/inputVariants.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const inputVariants = cva(\n [\n 'flex h-10 w-full rounded-
|
|
1
|
+
{"version":3,"file":"inputVariants.js","sources":["../../src/Input/inputVariants.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const inputVariants = cva(\n [\n 'flex h-10 w-full rounded-lg border border-input px-3 py-2',\n 'text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n 'group-data-[state=invalid]/form-control:border-destructive',\n 'group-data-[state=valid]/form-control:border-input',\n 'box-border',\n ],\n {\n variants: {\n variant: {\n default: 'bg-background',\n grey: 'bg-slate-200',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n"],"names":["inputVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC;AAAA,EAC3B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
1
|
import { ILoadingMaskProps } from './LoadingMask.types';
|
|
3
|
-
export declare const LoadingMask:
|
|
2
|
+
export declare const LoadingMask: (props: ILoadingMaskProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
3
|
//# sourceMappingURL=LoadingMask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingMask.d.ts","sourceRoot":"","sources":["../../src/LoadingMask/LoadingMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"LoadingMask.d.ts","sourceRoot":"","sources":["../../src/LoadingMask/LoadingMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,eAAO,MAAM,WAAW,GAAI,OAAO,iBAAiB,mDAgBnD,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { RenderLoadingMask as r } from "./RenderLoadingMask.js";
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
const { fullWidth: s = !1, className: i, ...
|
|
6
|
-
return s ? /* @__PURE__ */ e(
|
|
3
|
+
import { cn as a } from "@oneplatformdev/utils";
|
|
4
|
+
const c = (t) => {
|
|
5
|
+
const { loading: n = !0, fullWidth: s = !1, className: i, ...o } = t;
|
|
6
|
+
return n ? s ? /* @__PURE__ */ e(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
9
|
-
...
|
|
10
|
-
className:
|
|
9
|
+
...o,
|
|
10
|
+
className: a(
|
|
11
11
|
"absolute inset-0",
|
|
12
12
|
"flex items-center justify-center",
|
|
13
13
|
i
|
|
14
14
|
),
|
|
15
15
|
children: /* @__PURE__ */ e(r, {})
|
|
16
16
|
}
|
|
17
|
-
) : /* @__PURE__ */ e(r, {});
|
|
17
|
+
) : /* @__PURE__ */ e(r, {}) : null;
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
c as LoadingMask
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=LoadingMask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingMask.js","sources":["../../src/LoadingMask/LoadingMask.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"LoadingMask.js","sources":["../../src/LoadingMask/LoadingMask.tsx"],"sourcesContent":["import { ILoadingMaskProps } from './LoadingMask.types';\nimport { RenderLoadingMask } from './RenderLoadingMask';\nimport { cn } from '@oneplatformdev/utils';\n\nexport const LoadingMask = (props: ILoadingMaskProps) => {\n const { loading = true, fullWidth = false, className, ...rest } = props;\n if(!loading) return null;\n if (!fullWidth) return <RenderLoadingMask />;\n return (\n <div\n {...rest}\n className={cn(\n 'absolute inset-0',\n 'flex items-center justify-center',\n className\n )}\n >\n <RenderLoadingMask />\n </div>\n );\n};\n"],"names":["LoadingMask","props","loading","fullWidth","className","rest","jsx","cn","RenderLoadingMask"],"mappings":";;;AAIO,MAAMA,IAAc,CAACC,MAA6B;AACvD,QAAM,EAAE,SAAAC,IAAU,IAAM,WAAAC,IAAY,IAAO,WAAAC,GAAW,GAAGC,MAASJ;AAClE,SAAIC,IACCC,IAEH,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAH;AAAA,MAAA;AAAA,MAGF,4BAACI,GAAA,CAAA,CAAkB;AAAA,IAAA;AAAA,EAAA,IAVA,gBAAAF,EAACE,GAAA,CAAA,CAAkB,IADtB;AActB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingMask.types.d.ts","sourceRoot":"","sources":["../../src/LoadingMask/LoadingMask.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LoadingMask.types.d.ts","sourceRoot":"","sources":["../../src/LoadingMask/LoadingMask.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
package/Resizable/Resizable.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
3
|
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function ResizableHandle(
|
|
5
|
+
declare function ResizableHandle(props: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
6
6
|
withHandle?: boolean;
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resizable.d.ts","sourceRoot":"","sources":["../../src/Resizable/Resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAA;AAI5D,iBAAS,mBAAmB,CAAC,EACE,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,2CAWzF;AAED,iBAAS,cAAc,CAAC,EACE,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,2CAE/E;AAED,iBAAS,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"Resizable.d.ts","sourceRoot":"","sources":["../../src/Resizable/Resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAA;AAI5D,iBAAS,mBAAmB,CAAC,EACE,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,2CAWzF;AAED,iBAAS,cAAc,CAAC,EACE,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,2CAE/E;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,iBAAiB,CAAC,GAAG;IAClG,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,2CAwBA;AAED,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
|
package/Resizable/Resizable.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { GripVerticalIcon as
|
|
1
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { GripVerticalIcon as c } from "lucide-react";
|
|
3
3
|
import * as t from "react-resizable-panels";
|
|
4
4
|
import { cn as i } from "@oneplatformdev/utils";
|
|
5
|
-
function
|
|
5
|
+
function u({
|
|
6
6
|
className: e,
|
|
7
7
|
...r
|
|
8
8
|
}) {
|
|
@@ -18,32 +18,37 @@ function d({
|
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function b({
|
|
22
22
|
...e
|
|
23
23
|
}) {
|
|
24
24
|
return /* @__PURE__ */ a(t.Panel, { "data-slot": "resizable-panel", ...e });
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
function v(e) {
|
|
27
|
+
const {
|
|
28
|
+
withHandle: r,
|
|
29
|
+
className: l,
|
|
30
|
+
children: n,
|
|
31
|
+
...o
|
|
32
|
+
} = e;
|
|
33
|
+
return /* @__PURE__ */ s(
|
|
32
34
|
t.PanelResizeHandle,
|
|
33
35
|
{
|
|
34
36
|
"data-slot": "resizable-handle",
|
|
35
37
|
className: i(
|
|
36
38
|
"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
37
|
-
|
|
39
|
+
l
|
|
38
40
|
),
|
|
39
|
-
...
|
|
40
|
-
children:
|
|
41
|
+
...o,
|
|
42
|
+
children: [
|
|
43
|
+
n,
|
|
44
|
+
r && /* @__PURE__ */ a("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border", children: /* @__PURE__ */ a(c, { className: "size-2.5" }) })
|
|
45
|
+
]
|
|
41
46
|
}
|
|
42
47
|
);
|
|
43
48
|
}
|
|
44
49
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
v as ResizableHandle,
|
|
51
|
+
b as ResizablePanel,
|
|
52
|
+
u as ResizablePanelGroup
|
|
48
53
|
};
|
|
49
54
|
//# sourceMappingURL=Resizable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resizable.js","sources":["../../src/Resizable/Resizable.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { GripVerticalIcon } from \"lucide-react\"\nimport * as ResizablePrimitive from \"react-resizable-panels\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction ResizablePanelGroup({\n className,\n ...props\n }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {\n return (\n <ResizablePrimitive.PanelGroup\n data-slot=\"resizable-panel-group\"\n className={cn(\n \"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ResizablePanel({\n ...props\n }: React.ComponentProps<typeof ResizablePrimitive.Panel>) {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />\n}\n\nfunction ResizableHandle(
|
|
1
|
+
{"version":3,"file":"Resizable.js","sources":["../../src/Resizable/Resizable.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { GripVerticalIcon } from \"lucide-react\"\nimport * as ResizablePrimitive from \"react-resizable-panels\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction ResizablePanelGroup({\n className,\n ...props\n }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {\n return (\n <ResizablePrimitive.PanelGroup\n data-slot=\"resizable-panel-group\"\n className={cn(\n \"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ResizablePanel({\n ...props\n }: React.ComponentProps<typeof ResizablePrimitive.Panel>) {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />\n}\n\nfunction ResizableHandle(props: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean\n}) {\n const {\n withHandle,\n className,\n children,\n ...rest\n } = props;\n return (\n <ResizablePrimitive.PanelResizeHandle\n data-slot=\"resizable-handle\"\n className={cn(\n \"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90\",\n className\n )}\n {...rest}\n >\n {children}\n {withHandle && (\n <div className=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border\">\n <GripVerticalIcon className=\"size-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n )\n}\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle }\n"],"names":["ResizablePanelGroup","className","props","jsx","ResizablePrimitive","cn","ResizablePanel","ResizableHandle","withHandle","children","rest","jsxs","GripVerticalIcon"],"mappings":";;;;AAQA,SAASA,EAAoB;AAAA,EACE,WAAAC;AAAA,EACA,GAAGC;AACL,GAA+D;AAC1F,SACE,gBAAAC;AAAA,IAACC,EAAmB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASI,EAAe;AAAA,EACE,GAAGJ;AACL,GAA0D;AAChF,2BAAQE,EAAmB,OAAnB,EAAyB,aAAU,mBAAmB,GAAGF,GAAO;AAC1E;AAEA,SAASK,EAAgBL,GAEtB;AACD,QAAM;AAAA,IACJ,YAAAM;AAAA,IACA,WAAAP;AAAA,IACA,UAAAQ;AAAA,IACA,GAAGC;AAAA,EAAA,IACDR;AACJ,SACE,gBAAAS;AAAA,IAACP,EAAmB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGS;AAAA,MAEH,UAAA;AAAA,QAAAD;AAAA,QACAD,uBACE,OAAA,EAAI,WAAU,6EACb,UAAA,gBAAAL,EAACS,GAAA,EAAiB,WAAU,WAAA,CAAW,EAAA,CACzC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
package/Search/Search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../src/Search/Search.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,
|
|
1
|
+
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../src/Search/Search.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,4CAgExC,CAAC"}
|
package/Search/Search.js
CHANGED
|
@@ -1,48 +1,57 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Input as
|
|
4
|
-
import { useDebounceCallback as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { SearchIcon as
|
|
7
|
-
import { LoadedIcon as
|
|
8
|
-
const
|
|
2
|
+
import { useState as y, useRef as C, useEffect as k, useCallback as b } from "react";
|
|
3
|
+
import { Input as v } from "../Input/Input.js";
|
|
4
|
+
import { useDebounceCallback as x, useEventListener as D } from "@oneplatformdev/hooks";
|
|
5
|
+
import { cn as I } from "@oneplatformdev/utils";
|
|
6
|
+
import { SearchIcon as K } from "lucide-react";
|
|
7
|
+
import { LoadedIcon as L } from "../LoadedIcon/LoadedIcon.js";
|
|
8
|
+
const z = (s) => {
|
|
9
9
|
const {
|
|
10
|
-
search:
|
|
11
|
-
onChange:
|
|
12
|
-
onSearch:
|
|
13
|
-
placeholder:
|
|
14
|
-
className:
|
|
15
|
-
loading:
|
|
16
|
-
slotProps:
|
|
17
|
-
name:
|
|
10
|
+
search: o,
|
|
11
|
+
onChange: c,
|
|
12
|
+
onSearch: l,
|
|
13
|
+
placeholder: i = "Search",
|
|
14
|
+
className: u,
|
|
15
|
+
loading: m = !1,
|
|
16
|
+
slotProps: r,
|
|
17
|
+
name: f = "search",
|
|
18
18
|
...p
|
|
19
|
-
} =
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
} = s, [d, n] = y(o), h = x(l, 1e3), a = C(null), w = (e) => {
|
|
20
|
+
const g = e.target.value;
|
|
21
|
+
n(g), c?.(e), h(e.target.value);
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
|
|
23
|
+
k(() => {
|
|
24
|
+
n(o ?? "");
|
|
25
|
+
}, [o]);
|
|
26
|
+
const S = b((e) => {
|
|
27
|
+
(e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), a.current?.focus());
|
|
28
|
+
}, []);
|
|
29
|
+
return D(
|
|
30
|
+
"keydown",
|
|
31
|
+
S,
|
|
32
|
+
typeof window < "u" ? window : void 0
|
|
33
|
+
), /* @__PURE__ */ t(
|
|
34
|
+
v,
|
|
27
35
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
ref: a,
|
|
37
|
+
name: f,
|
|
38
|
+
placeholder: i,
|
|
39
|
+
value: d,
|
|
40
|
+
className: I("min-w-[340px]", u),
|
|
41
|
+
onChange: w,
|
|
33
42
|
...p,
|
|
34
|
-
...
|
|
43
|
+
...r || {},
|
|
35
44
|
slotProps: {
|
|
36
|
-
...
|
|
45
|
+
...r || {},
|
|
37
46
|
input: {
|
|
38
|
-
startAdornment: /* @__PURE__ */ t(
|
|
39
|
-
...
|
|
47
|
+
startAdornment: /* @__PURE__ */ t(L, { loading: m, children: /* @__PURE__ */ t(K, {}) }),
|
|
48
|
+
...r?.input || {}
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
52
|
);
|
|
44
53
|
};
|
|
45
54
|
export {
|
|
46
|
-
|
|
55
|
+
z as Search
|
|
47
56
|
};
|
|
48
57
|
//# sourceMappingURL=Search.js.map
|
package/Search/Search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sources":["../../src/Search/Search.tsx"],"sourcesContent":["'use client';\n\nimport { ChangeEvent, useEffect, useState } from 'react';\n\nimport { Input } from '../Input';\nimport { SearchProps } from './Search.types';\n\nimport { useDebounceCallback } from '@oneplatformdev/hooks';\nimport { cn } from '@oneplatformdev/utils';\nimport { SearchIcon } from 'lucide-react';\nimport { LoadedIcon } from '../LoadedIcon';\n\nexport const Search = (props: SearchProps) => {\n const {\n search: initialSearch,\n onChange: handleChange,\n onSearch,\n placeholder = 'Search',\n className,\n loading = false,\n slotProps,\n name = 'search',\n ...rest\n } = props;\n const [search, setSearch] = useState(initialSearch);\n const debounced = useDebounceCallback(onSearch, 1000);\n\n const onChange = (e: ChangeEvent<HTMLInputElement>) => {\n const v = e.target.value;\n setSearch(v);\n handleChange?.(e);\n debounced(e.target.value);\n };\n\n useEffect(() => {\n setSearch(initialSearch ?? '');\n }, [initialSearch]);\n\n return (\n <Input\n name={name}\n placeholder={placeholder}\n value={search}\n className={cn('min-w-[340px]', className)}\n onChange={onChange}\n {...rest}\n {...(slotProps || {})}\n slotProps={{\n ...(slotProps || {}),\n input: {\n startAdornment: (\n <LoadedIcon loading={loading}
|
|
1
|
+
{"version":3,"file":"Search.js","sources":["../../src/Search/Search.tsx"],"sourcesContent":["'use client';\n\nimport { ChangeEvent, useEffect, useState, KeyboardEvent, useRef, useCallback } from 'react';\n\nimport { Input } from '../Input';\nimport { SearchProps } from './Search.types';\n\nimport { useDebounceCallback, useEventListener } from '@oneplatformdev/hooks';\nimport { cn } from '@oneplatformdev/utils';\nimport { SearchIcon } from 'lucide-react';\nimport { LoadedIcon } from '../LoadedIcon';\n\nexport const Search = (props: SearchProps) => {\n const {\n search: initialSearch,\n onChange: handleChange,\n onSearch,\n placeholder = 'Search',\n className,\n loading = false,\n slotProps,\n name = 'search',\n ...rest\n } = props;\n const [ search, setSearch ] = useState(initialSearch);\n const debounced = useDebounceCallback(onSearch, 1000);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const onChange = (e: ChangeEvent<HTMLInputElement>) => {\n const v = e.target.value;\n setSearch(v);\n handleChange?.(e);\n debounced(e.target.value);\n };\n\n useEffect(() => {\n setSearch(initialSearch ?? '');\n }, [ initialSearch ]);\n\n const handleKeyDown = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'k') {\n event.preventDefault();\n inputRef.current?.focus();\n }\n }, []);\n\n useEventListener(\n 'keydown',\n handleKeyDown,\n typeof window !== 'undefined' ? window : undefined\n );\n\n return (\n <Input\n ref={inputRef}\n name={name}\n placeholder={placeholder}\n value={search}\n className={cn('min-w-[340px]', className)}\n onChange={onChange}\n {...rest}\n {...(slotProps || {})}\n slotProps={{\n ...(slotProps || {}),\n input: {\n startAdornment: (\n <LoadedIcon loading={loading}>\n <SearchIcon/>\n </LoadedIcon>\n ),\n ...(slotProps?.input || {}),\n },\n }}\n />\n );\n};\n"],"names":["Search","props","initialSearch","handleChange","onSearch","placeholder","className","loading","slotProps","name","rest","search","setSearch","useState","debounced","useDebounceCallback","inputRef","useRef","onChange","v","useEffect","handleKeyDown","useCallback","event","useEventListener","jsx","Input","cn","LoadedIcon","SearchIcon"],"mappings":";;;;;;;AAYO,MAAMA,IAAS,CAACC,MAAuB;AAC5C,QAAM;AAAA,IACJ,QAAQC;AAAA,IACR,UAAUC;AAAA,IACV,UAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EAAA,IACDT,GACE,CAAEU,GAAQC,CAAU,IAAIC,EAASX,CAAa,GAC9CY,IAAYC,EAAoBX,GAAU,GAAI,GAE9CY,IAAWC,EAAyB,IAAI,GAExCC,IAAW,CAAC,MAAqC;AACrD,UAAMC,IAAI,EAAE,OAAO;AACnB,IAAAP,EAAUO,CAAC,GACXhB,IAAe,CAAC,GAChBW,EAAU,EAAE,OAAO,KAAK;AAAA,EAC1B;AAEA,EAAAM,EAAU,MAAM;AACd,IAAAR,EAAUV,KAAiB,EAAE;AAAA,EAC/B,GAAG,CAAEA,CAAc,CAAC;AAEpB,QAAMmB,IAAgBC,EAAY,CAACC,MAA2C;AAC5E,KAAKA,EAAM,WAAWA,EAAM,YAAYA,EAAM,IAAI,YAAA,MAAkB,QAClEA,EAAM,eAAA,GACNP,EAAS,SAAS,MAAA;AAAA,EAEtB,GAAG,CAAA,CAAE;AAEL,SAAAQ;AAAA,IACE;AAAA,IACAH;AAAA,IACA,OAAO,SAAW,MAAc,SAAS;AAAA,EAAA,GAIzC,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAKV;AAAA,MACL,MAAAP;AAAA,MACA,aAAAJ;AAAA,MACA,OAAOM;AAAA,MACP,WAAWgB,EAAG,iBAAiBrB,CAAS;AAAA,MACxC,UAAAY;AAAA,MACC,GAAGR;AAAA,MACH,GAAIF,KAAa,CAAA;AAAA,MAClB,WAAW;AAAA,QACT,GAAIA,KAAa,CAAA;AAAA,QACjB,OAAO;AAAA,UACL,gBACE,gBAAAiB,EAACG,GAAA,EAAW,SAAArB,GACV,UAAA,gBAAAkB,EAACI,KAAU,GACb;AAAA,UAEF,GAAIrB,GAAW,SAAS,CAAA;AAAA,QAAC;AAAA,MAC3B;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Search as t } from "./Search.js";
|
|
2
|
+
const a = {
|
|
3
|
+
title: "Input/Search",
|
|
4
|
+
component: t
|
|
5
|
+
}, o = {
|
|
6
|
+
args: {
|
|
7
|
+
slotProps: {},
|
|
8
|
+
search: "search",
|
|
9
|
+
onSearch: () => {
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
o as Default,
|
|
15
|
+
a as default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Search.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search.stories.js","sources":["../../src/Search/Search.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite';\n\nimport { Search } from './Search';\n\nconst meta = {\n title: 'Input/Search',\n component: Search,\n} satisfies Meta<typeof Search>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n args: {\n slotProps: {},\n search: \"search\",\n onSearch: () => {}\n }\n};\n"],"names":["meta","Search","Default"],"mappings":";AAIA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AACb,GAMaC,IAAiB;AAAA,EAC5B,MAAM;AAAA,IACJ,WAAW,CAAA;AAAA,IACX,QAAQ;AAAA,IACR,UAAU,MAAM;AAAA,IAAC;AAAA,EAAA;AAErB;"}
|
package/Select/Select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,WAAW,EAIZ,MAAM,WAAW,CAAC;AAkGnB,eAAO,MAAM,MAAM,GAAI,gBAAgB,EACrC,OAAO,WAAW,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,WAAW,EAIZ,MAAM,WAAW,CAAC;AAkGnB,eAAO,MAAM,MAAM,GAAI,gBAAgB,EACrC,OAAO,WAAW,CAAC,gBAAgB,CAAC,4CAiDrC,CAAC"}
|