@digitalpromise/design 3.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/components/forms/checkbox.d.ts +7 -0
  2. package/dist/components/forms/checkbox.d.ts.map +1 -0
  3. package/dist/components/forms/dropzone.d.ts +11 -0
  4. package/dist/components/forms/dropzone.d.ts.map +1 -0
  5. package/dist/components/forms/form-field.d.ts +11 -0
  6. package/dist/components/forms/form-field.d.ts.map +1 -0
  7. package/dist/components/forms/form.d.ts +5 -0
  8. package/dist/components/forms/form.d.ts.map +1 -0
  9. package/dist/components/forms/index.d.ts +9 -0
  10. package/dist/components/forms/index.d.ts.map +1 -0
  11. package/dist/components/forms/label.d.ts +8 -0
  12. package/dist/components/forms/label.d.ts.map +1 -0
  13. package/dist/components/forms/list.d.ts +8 -0
  14. package/dist/components/forms/list.d.ts.map +1 -0
  15. package/dist/components/forms/select.d.ts +10 -0
  16. package/dist/components/forms/select.d.ts.map +1 -0
  17. package/dist/components/forms/text-input.d.ts +7 -0
  18. package/dist/components/forms/text-input.d.ts.map +1 -0
  19. package/dist/components/forms/textarea.d.ts +7 -0
  20. package/dist/components/forms/textarea.d.ts.map +1 -0
  21. package/dist/components/forms/types.d.ts +9 -0
  22. package/dist/components/forms/types.d.ts.map +1 -0
  23. package/dist/components/icon.d.ts +14 -0
  24. package/dist/components/icon.d.ts.map +1 -0
  25. package/dist/components/index.d.ts +8 -0
  26. package/dist/components/index.d.ts.map +1 -0
  27. package/dist/components/search.d.ts.map +1 -1
  28. package/dist/components/tab-list.d.ts +11 -0
  29. package/dist/components/tab-list.d.ts.map +1 -0
  30. package/dist/components/tag-list.d.ts +4 -0
  31. package/dist/components/tag-list.d.ts.map +1 -0
  32. package/dist/forms.cjs +1 -0
  33. package/dist/forms.js +199 -0
  34. package/dist/icon-CkLgh924.js +2636 -0
  35. package/dist/icon-zoFkg03T.cjs +1 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.js +85 -91
  38. package/package.json +14 -8
  39. package/dist/index.d.ts +0 -8
  40. package/dist/index.d.ts.map +0 -1
  41. /package/dist/{main.css → theme.css} +0 -0
@@ -0,0 +1,7 @@
1
+ import type { FormInputProps, InputPropsWithoutType } from "./types";
2
+ type CheckboxProps = InputPropsWithoutType & FormInputProps & {
3
+ label: string;
4
+ };
5
+ export declare const Checkbox: ({ error, className, label, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/forms/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErE,KAAK,aAAa,GAAG,qBAAqB,GACxC,cAAc,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEJ,eAAO,MAAM,QAAQ,GAAI,uCAKtB,aAAa,4CAoBf,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { ReactElement, type ComponentPropsWithRef } from "react";
2
+ import type { FormInputProps } from "./types";
3
+ interface DropzoneProps extends Omit<ComponentPropsWithRef<"input">, "type">, FormInputProps {
4
+ instructions?: string;
5
+ remover?: ReactElement;
6
+ }
7
+ export declare const Dropzone: ({ children, error, instructions, className, onChange: userOnChange, remover, ...props }: DropzoneProps) => import("react/jsx-runtime").JSX.Element;
8
+ type SingleImageDropzoneProps = Omit<DropzoneProps, "multiple" | "accept" | "children">;
9
+ export declare const SingleImageDropzone: (props: SingleImageDropzoneProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=dropzone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropzone.d.ts","sourceRoot":"","sources":["../../../src/components/forms/dropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,YAAY,EAGZ,KAAK,qBAAqB,EAC3B,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,UAAU,aACR,SAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EAClD,cAAc;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,QAAQ,GAAI,yFAQtB,aAAa,4CAiHf,CAAC;AAEF,KAAK,wBAAwB,GAAG,IAAI,CAClC,aAAa,EACb,UAAU,GAAG,QAAQ,GAAG,UAAU,CACnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CAelE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { FormInputProps } from "./types";
2
+ interface FormFieldProps<C extends FormInputProps> {
3
+ Input: React.ComponentType<C>;
4
+ inputProps: C;
5
+ errorMessage?: string;
6
+ label: string;
7
+ labelClassname?: string;
8
+ }
9
+ export declare const FormField: <P extends FormInputProps>({ Input, inputProps, errorMessage, label, labelClassname, }: FormFieldProps<P>) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=form-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["../../../src/components/forms/form-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,UAAU,cAAc,CAAC,CAAC,SAAS,cAAc;IAC/C,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC9B,UAAU,EAAE,CAAC,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,cAAc,EAAE,6DAMjD,cAAc,CAAC,CAAC,CAAC,4CAmBnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ComponentPropsWithRef } from "react";
2
+ type FormProps = ComponentPropsWithRef<"form">;
3
+ export declare const Form: ({ noValidate, className, ...props }: FormProps) => import("react/jsx-runtime").JSX.Element;
4
+ export {};
5
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/forms/form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAE9C,KAAK,SAAS,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAE/C,eAAO,MAAM,IAAI,GAAI,qCAAqC,SAAS,4CAQlE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Checkbox } from "./checkbox";
2
+ import { Dropzone, SingleImageDropzone } from "./dropzone";
3
+ import { Form } from "./form";
4
+ import { FormField } from "./form-field";
5
+ import { Select } from "./select";
6
+ import { TextInput } from "./text-input";
7
+ import { Textarea } from "./textarea";
8
+ export { Checkbox, Dropzone, SingleImageDropzone, Form, FormField, Select, Textarea, TextInput, };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,IAAI,EACJ,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,GACV,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ComponentPropsWithRef } from "react";
2
+ export interface LabelProps extends ComponentPropsWithRef<"label"> {
3
+ label: string;
4
+ error?: boolean;
5
+ required?: boolean;
6
+ }
7
+ export declare const Label: ({ className, label, required, error, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/components/forms/label.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,WAAW,UAAW,SAAQ,qBAAqB,CAAC,OAAO,CAAC;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,KAAK,GAAI,iDAMnB,UAAU,4CAWZ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { FormInputProps } from "./types";
2
+ type ListInputProps = FormInputProps & {
3
+ onChange?: (list: string[]) => void;
4
+ defaultValue?: string[];
5
+ };
6
+ export declare const ListInput: ({ onChange, defaultValue }: ListInputProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/forms/list.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,cAAc,GAAG,cAAc,GAAG;IACrC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,4BAA4B,cAAc,4CAmEnE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithRef } from "react";
2
+ import { FormInputProps } from "./types";
3
+ export interface SelectProps extends ComponentPropsWithRef<"select">, FormInputProps {
4
+ options: {
5
+ value: string;
6
+ label: string;
7
+ }[];
8
+ }
9
+ export declare const Select: ({ options, error, className, ...props }: SelectProps) => import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/forms/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,WAAY,SAAQ,qBAAqB,CAAC,QAAQ,CAAC,EAAE,cAAc;IAClF,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C;AAED,eAAO,MAAM,MAAM,GAAI,yCAKpB,WAAW,4CAcb,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import type { FormInputProps } from "./types";
3
+ interface TextInputProps extends ComponentPropsWithRef<"input">, FormInputProps {
4
+ }
5
+ export declare const TextInput: ({ error, className, ...props }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=text-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-input.d.ts","sourceRoot":"","sources":["../../../src/components/forms/text-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,UAAU,cAAe,SAAQ,qBAAqB,CAAC,OAAO,CAAC,EAAE,cAAc;CAAG;AAElF,eAAO,MAAM,SAAS,GAAI,gCAAgC,cAAc,4CASvE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import type { FormInputProps } from "./types";
3
+ interface TextareaProps extends ComponentPropsWithRef<"textarea">, FormInputProps {
4
+ }
5
+ export declare const Textarea: ({ className, error, ...props }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=textarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/forms/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,UAAU,aAAc,SAAQ,qBAAqB,CAAC,UAAU,CAAC,EAAE,cAAc;CAAG;AAEpF,eAAO,MAAM,QAAQ,GAAI,gCAAgC,aAAa,4CAQrE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ export interface FormInputProps {
3
+ id?: string;
4
+ name?: string;
5
+ error?: boolean;
6
+ required?: boolean;
7
+ }
8
+ export type InputPropsWithoutType = Omit<ComponentPropsWithRef<"input">, "type">;
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/forms/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,qBAAqB,CAAC,OAAO,CAAC,EAC9B,MAAM,CACP,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type DPGIconName } from "@digitalpromise/icons";
2
+ import { type ComponentPropsWithRef } from "react";
3
+ interface IconProps extends ComponentPropsWithRef<"svg"> {
4
+ name: DPGIconName;
5
+ }
6
+ export declare const Icon: ({ name, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
7
+ type IconButtonProps = Omit<ComponentPropsWithRef<"button">, "type"> & {
8
+ icon: DPGIconName;
9
+ iconClassName?: string;
10
+ label?: string;
11
+ };
12
+ export declare const IconButton: ({ label, className, icon, iconClassName, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/components/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,UAAU,SAAU,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACtD,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,eAAO,MAAM,IAAI,GAAI,+BAA+B,SAAS,4CAQ5D,CAAC;AAEF,KAAK,eAAe,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG;IACrE,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,qDAMxB,eAAe,4CAWjB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { default as Button } from "./button";
2
+ import { default as Logo } from "./logo";
3
+ import { default as Pagination } from "./pagination";
4
+ import { default as Search } from "./search";
5
+ import { default as Table } from "./table";
6
+ export type { TableColumn } from "./table";
7
+ export { Button, Logo, Pagination, Search, Table };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/components/search.tsx"],"names":[],"mappings":"AAKA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAgB,EAChB,EAAa,EACb,QAAc,GACf,EAAE,WAAW,2CA8Fb"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/components/search.tsx"],"names":[],"mappings":"AAMA,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAgB,EAChB,EAAa,EACb,QAAc,GACf,EAAE,WAAW,2CA+Fb"}
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from "react";
2
+ export interface TabProps {
3
+ id: string;
4
+ label: ReactNode;
5
+ content: ReactNode;
6
+ }
7
+ export interface TabListProps {
8
+ tabs: TabProps[];
9
+ }
10
+ export declare const TabList: ({ tabs }: TabListProps) => import("react/jsx-runtime").JSX.Element | ReactNode[];
11
+ //# sourceMappingURL=tab-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab-list.d.ts","sourceRoot":"","sources":["../../src/components/tab-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,OAAO,GAAI,UAAU,YAAY,0DA8B7C,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const TagList: ({ tags }: {
2
+ tags: string[];
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=tag-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-list.d.ts","sourceRoot":"","sources":["../../src/components/tag-list.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,GAAI,UAAU;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,4CAenD,CAAC"}
package/dist/forms.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),g=require("./icon-zoFkg03T.cjs"),I=({error:a,className:r,label:t,...l})=>{const n=l.id||l.name;return e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx("input",{type:"checkbox",className:`transition-colors appearance-none cursor-pointer bg-neutral-1 border-2 border-gray-5 rounded-sm w-5 h-5 grid place-content-center hover:bg-gray-1 hover:border-neutral-5 before:hidden before:content-['\\2713'] before:text-neutral-1 before:font-bold checked:bg-blue-3 checked:border-blue-4 checked:hover:bg-blue-4 checked:hover:border-blue-5 checked:before:inline-block ${r??""}`.trim(),...l,id:n}),e.jsx("label",{"data-error":a||null,htmlFor:n,className:"data-error:text-red-4",children:t})]})},p=({children:a,error:r,instructions:t,className:l,onChange:n,remover:d,...i})=>{const s=u.useRef(null),[v,m]=u.useState(!1),[b,j]=u.useState([]),h=b.length>0,w=o=>{o.preventDefault(),m(!1),s.current&&o.dataTransfer.files.length>0&&(s.current.files=o.dataTransfer.files,o.dataTransfer.clearData(),s.current.dispatchEvent(new Event("change",{bubbles:!0})))},y=o=>{n&&n(o);const k=Array.from(o.currentTarget.files??[]).map(c=>{if(c.type.includes("image")){const F=URL.createObjectURL(c);return e.jsx("img",{alt:"",src:F,className:"max-h-full max-w-full object-contain"},c.name)}else return e.jsx("p",{children:c.name},c.name)});j(k)},N=()=>{s.current&&(s.current.value="",s.current.files=null,s.current.dispatchEvent(new Event("change",{bubbles:!0})))},x={onClick:o=>{o.preventDefault(),N()}},D=d?u.cloneElement(d,x):e.jsx(g.Button,{type:"button",variant:"tertiary",state:"decolor",...x,children:"Remove Files"}),f=o=>{o.preventDefault(),m(!0)};return e.jsxs("div",{children:[e.jsxs("label",{"data-showing-preview":h||null,"data-is-dragging":v||null,onDragLeave:()=>m(!1),onDragEnter:f,onDragOver:f,onDrop:w,htmlFor:i.id,"data-error":r||null,className:`flex items-center justify-center rounded-lg border border-dashed border-blue-3 px-7 py-8 font-medium text-blue-3 data-showing-preview:w-max data-showing-preview:border-gray-3 data-showing-preview:text-gray-3 data-is-dragging:border-blue-5 data-is-dragging:bg-blue-1 data-showing-preview:py-5 data-is-dragging:text-blue-4 ${l??""} cursor-default`.trim(),children:[e.jsx("input",{...i,ref:s,onChange:y,className:"sr-only",type:"file"}),h?e.jsxs(e.Fragment,{children:[e.jsx("aside",{className:"grid grid-cols-2 grid-rows-2 w-11 h-11",children:b}),D]}):a??e.jsxs("p",{className:"pointer-events-none select-none",children:[e.jsx(g.Icon,{name:"Upload"})," Click or drop to upload"]})]}),t&&e.jsx("p",{className:"font-light leading-6",children:t})]})},T=a=>{const r=e.jsx(g.Button,{type:"button",variant:"tertiary",state:"decolor",children:"Remove Image"});return e.jsx(p,{...a,multiple:!1,remover:r,accept:"image/png image/svg+xml"})},q=({noValidate:a,className:r,...t})=>e.jsx("form",{className:`container flex flex-col gap-7 max-w-[45rem] ${r??""}`.trim(),...t,noValidate:a??!0}),C=({className:a,label:r,required:t,error:l,...n})=>e.jsx("label",{"data-required":t||null,"data-error":l||null,...n,className:`text-base font-medium leading-5 data-error:text-red-4 data-required:after:content-['*'] data-required:after:text-red-4 data-required:after:ml-1 ${a??""}`.trim(),children:r}),S=({Input:a,inputProps:r,errorMessage:t,label:l,labelClassname:n})=>{const d=!!t,i=r?.id||r?.name;return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(C,{label:l,className:n,htmlFor:i,required:r?.required,error:d}),e.jsx(a,{error:d,...r,id:i}),t&&e.jsx("p",{className:"text-red-4",children:t})]})},E=({options:a,error:r,className:t,...l})=>e.jsx("select",{...l,"data-error":r||null,className:`border border-gray-5 rounded-sm text-base leading-5 px-[0.94rem] py-[0.69rem] focus-within:border-transparent focus-within:outline-blue-4 data-error:border-red-4 data-error:outline-red-4 ${t??""}`.trim(),children:a.map(n=>e.jsx("option",{className:"hover:bg-gray-3",value:n.value,children:n.label},[l.name,n.label].join()))}),R=({error:a,className:r,...t})=>e.jsx("input",{"data-error":a||null,className:`border border-gray-5 rounded-sm text-base leading-5 px-[0.94rem] py-[0.69rem] focus-within:border-transparent focus-within:outline-blue-4 data-error:border-red-4 data-error:outline-red-4 ${r??""}`.trim(),...t,type:"text"}),$=({className:a,error:r,...t})=>e.jsx("textarea",{"data-error":r||null,className:`border border-gray-5 rounded-sm text-base leading-5 px-[0.94rem] py-[0.69rem] focus-within:border-transparent focus-within:outline-blue-4 data-error:border-red-4 data-error:outline-red-4 ${a??""}`.trim(),...t});exports.Checkbox=I;exports.Dropzone=p;exports.Form=q;exports.FormField=S;exports.Select=E;exports.SingleImageDropzone=T;exports.TextInput=R;exports.Textarea=$;
package/dist/forms.js ADDED
@@ -0,0 +1,199 @@
1
+ import { jsxs as i, jsx as e, Fragment as C } from "react/jsx-runtime";
2
+ import { useRef as E, useState as p, cloneElement as T } from "react";
3
+ import { B as v, I as $ } from "./icon-CkLgh924.js";
4
+ const S = ({
5
+ error: a,
6
+ className: r,
7
+ label: t,
8
+ ...l
9
+ }) => {
10
+ const n = l.id || l.name;
11
+ return /* @__PURE__ */ i("div", { className: "flex gap-3 items-center", children: [
12
+ /* @__PURE__ */ e(
13
+ "input",
14
+ {
15
+ type: "checkbox",
16
+ className: `transition-colors appearance-none cursor-pointer bg-neutral-1 border-2 border-gray-5 rounded-sm w-5 h-5 grid place-content-center hover:bg-gray-1 hover:border-neutral-5 before:hidden before:content-['\\2713'] before:text-neutral-1 before:font-bold checked:bg-blue-3 checked:border-blue-4 checked:hover:bg-blue-4 checked:hover:border-blue-5 checked:before:inline-block ${r ?? ""}`.trim(),
17
+ ...l,
18
+ id: n
19
+ }
20
+ ),
21
+ /* @__PURE__ */ e(
22
+ "label",
23
+ {
24
+ "data-error": a || null,
25
+ htmlFor: n,
26
+ className: "data-error:text-red-4",
27
+ children: t
28
+ }
29
+ )
30
+ ] });
31
+ }, j = ({
32
+ children: a,
33
+ error: r,
34
+ instructions: t,
35
+ className: l,
36
+ onChange: n,
37
+ remover: s,
38
+ ...c
39
+ }) => {
40
+ const d = E(null), [x, m] = p(!1), [g, w] = p([]), b = g.length > 0, y = (o) => {
41
+ o.preventDefault(), m(!1), d.current && o.dataTransfer.files.length > 0 && (d.current.files = o.dataTransfer.files, o.dataTransfer.clearData(), d.current.dispatchEvent(
42
+ new Event("change", { bubbles: !0 })
43
+ ));
44
+ }, N = (o) => {
45
+ n && n(o);
46
+ const k = Array.from(o.currentTarget.files ?? []).map((u) => {
47
+ if (u.type.includes("image")) {
48
+ const F = URL.createObjectURL(u);
49
+ return /* @__PURE__ */ e(
50
+ "img",
51
+ {
52
+ alt: "",
53
+ src: F,
54
+ className: "max-h-full max-w-full object-contain"
55
+ },
56
+ u.name
57
+ );
58
+ } else
59
+ return /* @__PURE__ */ e("p", { children: u.name }, u.name);
60
+ });
61
+ w(k);
62
+ }, D = () => {
63
+ d.current && (d.current.value = "", d.current.files = null, d.current.dispatchEvent(
64
+ new Event("change", { bubbles: !0 })
65
+ ));
66
+ }, h = {
67
+ onClick: (o) => {
68
+ o.preventDefault(), D();
69
+ }
70
+ }, I = s ? T(s, h) : /* @__PURE__ */ e(v, { type: "button", variant: "tertiary", state: "decolor", ...h, children: "Remove Files" }), f = (o) => {
71
+ o.preventDefault(), m(!0);
72
+ };
73
+ return /* @__PURE__ */ i("div", { children: [
74
+ /* @__PURE__ */ i(
75
+ "label",
76
+ {
77
+ "data-showing-preview": b || null,
78
+ "data-is-dragging": x || null,
79
+ onDragLeave: () => m(!1),
80
+ onDragEnter: f,
81
+ onDragOver: f,
82
+ onDrop: y,
83
+ htmlFor: c.id,
84
+ "data-error": r || null,
85
+ className: `flex items-center justify-center rounded-lg border border-dashed border-blue-3 px-7 py-8 font-medium text-blue-3 data-showing-preview:w-max data-showing-preview:border-gray-3 data-showing-preview:text-gray-3 data-is-dragging:border-blue-5 data-is-dragging:bg-blue-1 data-showing-preview:py-5 data-is-dragging:text-blue-4 ${l ?? ""} cursor-default`.trim(),
86
+ children: [
87
+ /* @__PURE__ */ e(
88
+ "input",
89
+ {
90
+ ...c,
91
+ ref: d,
92
+ onChange: N,
93
+ className: "sr-only",
94
+ type: "file"
95
+ }
96
+ ),
97
+ b ? /* @__PURE__ */ i(C, { children: [
98
+ /* @__PURE__ */ e("aside", { className: "grid grid-cols-2 grid-rows-2 w-11 h-11", children: g }),
99
+ I
100
+ ] }) : a ?? /* @__PURE__ */ i("p", { className: "pointer-events-none select-none", children: [
101
+ /* @__PURE__ */ e($, { name: "Upload" }),
102
+ " Click or drop to upload"
103
+ ] })
104
+ ]
105
+ }
106
+ ),
107
+ t && /* @__PURE__ */ e("p", { className: "font-light leading-6", children: t })
108
+ ] });
109
+ }, U = (a) => /* @__PURE__ */ e(
110
+ j,
111
+ {
112
+ ...a,
113
+ multiple: !1,
114
+ remover: /* @__PURE__ */ e(v, { type: "button", variant: "tertiary", state: "decolor", children: "Remove Image" }),
115
+ accept: "image/png image/svg+xml"
116
+ }
117
+ ), z = ({ noValidate: a, className: r, ...t }) => /* @__PURE__ */ e(
118
+ "form",
119
+ {
120
+ className: `container flex flex-col gap-7 max-w-[45rem] ${r ?? ""}`.trim(),
121
+ ...t,
122
+ noValidate: a ?? !0
123
+ }
124
+ ), q = ({
125
+ className: a,
126
+ label: r,
127
+ required: t,
128
+ error: l,
129
+ ...n
130
+ }) => /* @__PURE__ */ e(
131
+ "label",
132
+ {
133
+ "data-required": t || null,
134
+ "data-error": l || null,
135
+ ...n,
136
+ className: `text-base font-medium leading-5 data-error:text-red-4 data-required:after:content-['*'] data-required:after:text-red-4 data-required:after:ml-1 ${a ?? ""}`.trim(),
137
+ children: r
138
+ }
139
+ ), P = ({
140
+ Input: a,
141
+ inputProps: r,
142
+ errorMessage: t,
143
+ label: l,
144
+ labelClassname: n
145
+ }) => {
146
+ const s = !!t, c = r?.id || r?.name;
147
+ return /* @__PURE__ */ i("div", { className: "flex flex-col gap-3", children: [
148
+ /* @__PURE__ */ e(
149
+ q,
150
+ {
151
+ label: l,
152
+ className: n,
153
+ htmlFor: c,
154
+ required: r?.required,
155
+ error: s
156
+ }
157
+ ),
158
+ /* @__PURE__ */ e(a, { error: s, ...r, id: c }),
159
+ t && /* @__PURE__ */ e("p", { className: "text-red-4", children: t })
160
+ ] });
161
+ }, A = ({
162
+ options: a,
163
+ error: r,
164
+ className: t,
165
+ ...l
166
+ }) => /* @__PURE__ */ e(
167
+ "select",
168
+ {
169
+ ...l,
170
+ "data-error": r || null,
171
+ className: `border border-gray-5 rounded-sm text-base leading-5 px-[0.94rem] py-[0.69rem] focus-within:border-transparent focus-within:outline-blue-4 data-error:border-red-4 data-error:outline-red-4 ${t ?? ""}`.trim(),
172
+ children: a.map((n) => /* @__PURE__ */ e("option", { className: "hover:bg-gray-3", value: n.value, children: n.label }, [l.name, n.label].join()))
173
+ }
174
+ ), O = ({ error: a, className: r, ...t }) => /* @__PURE__ */ e(
175
+ "input",
176
+ {
177
+ "data-error": a || null,
178
+ className: `border border-gray-5 rounded-sm text-base leading-5 px-[0.94rem] py-[0.69rem] focus-within:border-transparent focus-within:outline-blue-4 data-error:border-red-4 data-error:outline-red-4 ${r ?? ""}`.trim(),
179
+ ...t,
180
+ type: "text"
181
+ }
182
+ ), V = ({ className: a, error: r, ...t }) => /* @__PURE__ */ e(
183
+ "textarea",
184
+ {
185
+ "data-error": r || null,
186
+ className: `border border-gray-5 rounded-sm text-base leading-5 px-[0.94rem] py-[0.69rem] focus-within:border-transparent focus-within:outline-blue-4 data-error:border-red-4 data-error:outline-red-4 ${a ?? ""}`.trim(),
187
+ ...t
188
+ }
189
+ );
190
+ export {
191
+ S as Checkbox,
192
+ j as Dropzone,
193
+ z as Form,
194
+ P as FormField,
195
+ A as Select,
196
+ U as SingleImageDropzone,
197
+ O as TextInput,
198
+ V as Textarea
199
+ };