@tpc-mare/mare-ui-components-react 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/avatar/Avatar.d.ts +2 -0
  2. package/dist/avatar/Avatar.types.d.ts +26 -0
  3. package/dist/avatar/index.d.ts +2 -0
  4. package/dist/avatar/index.js +4 -0
  5. package/dist/drawer/Drawer.d.ts +2 -0
  6. package/dist/drawer/Drawer.types.d.ts +53 -0
  7. package/dist/drawer/DrawerFooter.d.ts +2 -0
  8. package/dist/drawer/DrawerHeader.d.ts +2 -0
  9. package/dist/drawer/index.d.ts +4 -0
  10. package/dist/drawer/index.js +6 -0
  11. package/dist/index/index.d.ts +8 -0
  12. package/dist/index/index.js +42 -31
  13. package/dist/input-number/index.js +1 -1
  14. package/dist/input-text/IconField.d.ts +10 -1
  15. package/dist/input-text/field-layout.d.ts +7 -1
  16. package/dist/input-text/index.js +8 -7
  17. package/dist/menu/Menu.d.ts +2 -0
  18. package/dist/menu/Menu.types.d.ts +19 -0
  19. package/dist/menu/index.d.ts +2 -0
  20. package/dist/menu/index.js +4 -0
  21. package/dist/search-field/SearchField.d.ts +2 -0
  22. package/dist/search-field/SearchField.types.d.ts +26 -0
  23. package/dist/search-field/index.d.ts +2 -0
  24. package/dist/search-field/index.js +4 -0
  25. package/dist/shared/Avatar-D3QlO3Tz.js +59 -0
  26. package/dist/shared/DrawerFooter-DvUgumx0.js +172 -0
  27. package/dist/shared/HelperText-CVWWvLCI.js +46 -0
  28. package/dist/shared/IconField-Dh6j6SL1.js +78 -0
  29. package/dist/shared/{InputNumber-D1KL6s55.js → InputNumber-D48wsE-o.js} +1 -1
  30. package/dist/shared/Menu-Cv9dU1iA.js +104 -0
  31. package/dist/shared/SearchField-CgDz_s1O.js +63 -0
  32. package/dist/shared/{Textarea-0XAczkH1.js → Textarea-iJhYTZos.js} +1 -1
  33. package/dist/shared/{field-layout-BXKpp5E_.js → field-layout-D34MpDMB.js} +16 -12
  34. package/dist/styles.css +1 -1
  35. package/dist/textarea/index.js +1 -1
  36. package/package.json +13 -13
  37. package/dist/shared/HelperText-D656H0Lf.js +0 -103
@@ -0,0 +1,2 @@
1
+ import { AvatarProperties } from './Avatar.types';
2
+ export declare function Avatar({ image, alt, label, size, id, }: AvatarProperties): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { AvatarSize } from '@tpc-development/mare-ui-components-core/avatar';
2
+ export type { AvatarSize } from '@tpc-development/mare-ui-components-core/avatar';
3
+ export interface AvatarProperties {
4
+ /**
5
+ * Image URL. Falls back to the initials derived from `label` while it's
6
+ * loading, missing, or fails to load.
7
+ */
8
+ image?: string;
9
+ /**
10
+ * `alt` text for the image.
11
+ */
12
+ alt?: string;
13
+ /**
14
+ * Full name used to derive the fallback initials (e.g. "Tomás Palacio" → "TP").
15
+ */
16
+ label?: string;
17
+ /**
18
+ * Size variant.
19
+ * @default 'small'
20
+ */
21
+ size?: AvatarSize;
22
+ /**
23
+ * Unique identifier for the avatar.
24
+ */
25
+ id?: string;
26
+ }
@@ -0,0 +1,2 @@
1
+ export { Avatar } from './Avatar';
2
+ export type { AvatarProperties, AvatarSize } from './Avatar.types';
@@ -0,0 +1,4 @@
1
+ import { A as o } from "../shared/Avatar-D3QlO3Tz.js";
2
+ export {
3
+ o as Avatar
4
+ };
@@ -0,0 +1,2 @@
1
+ import { DrawerProperties } from './Drawer.types';
2
+ export declare function Drawer({ open, onOpenChange, position, modal, closeOnEscape, dismissableMask, maskColor, shadow, portalContainer, header, footer, children, 'aria-label': ariaLabel, }: DrawerProperties): import("react").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ import { DrawerPosition } from '@tpc-development/mare-ui-components-core/drawer';
3
+ export type { DrawerPosition } from '@tpc-development/mare-ui-components-core/drawer';
4
+ export interface DrawerProperties {
5
+ /** Controlled open state. */
6
+ open: boolean;
7
+ /** Change handler — receives the next open state. */
8
+ onOpenChange?: (open: boolean) => void;
9
+ /** Which edge the panel docks to and slides in from. @default 'left' */
10
+ position?: DrawerPosition;
11
+ /** @default true */
12
+ modal?: boolean;
13
+ /** @default true */
14
+ closeOnEscape?: boolean;
15
+ /** Close when clicking the backdrop. @default true */
16
+ dismissableMask?: boolean;
17
+ /** Overrides the backdrop's background class. @default undefined (uses the token overlay color) */
18
+ maskColor?: string;
19
+ /** @default true */
20
+ shadow?: boolean;
21
+ /** Where the drawer portals to. Ark defaults to `document.body` — override
22
+ * this if your app scopes `data-theme` (or any other CSS custom property)
23
+ * to a sub-tree rather than the document root, otherwise the portaled
24
+ * drawer renders outside that scope and loses the tokens. */
25
+ portalContainer?: RefObject<HTMLElement | null>;
26
+ /** Typically a `<DrawerHeader />`. */
27
+ header?: ReactNode;
28
+ /** Typically a `<DrawerFooter>` with action buttons. */
29
+ footer?: ReactNode;
30
+ /** The scrollable body, between header and footer. */
31
+ children?: ReactNode;
32
+ /** Fallback accessible label when no title is rendered in the header. */
33
+ 'aria-label'?: string;
34
+ }
35
+ export interface DrawerHeaderProperties {
36
+ title?: string;
37
+ /** Closes the drawer on click (matches the legacy header: the LEFT icon
38
+ * always closes, regardless of which glyph it shows). @default a close (X) icon */
39
+ leftIcon?: ReactNode;
40
+ /** Does NOT close the drawer on click — wire that yourself if you need it. @default undefined (no button) */
41
+ rightIcon?: ReactNode;
42
+ onLeftIconClick?: () => void;
43
+ onRightIconClick?: () => void;
44
+ /** @default false */
45
+ border?: boolean;
46
+ /** Shorter header, smaller inline padding — legacy's "slim" variant. @default false */
47
+ compact?: boolean;
48
+ }
49
+ export interface DrawerFooterProperties {
50
+ /** @default false */
51
+ border?: boolean;
52
+ children?: ReactNode;
53
+ }
@@ -0,0 +1,2 @@
1
+ import { DrawerFooterProperties } from './Drawer.types';
2
+ export declare function DrawerFooter({ border, children, }: DrawerFooterProperties): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DrawerHeaderProperties } from './Drawer.types';
2
+ export declare function DrawerHeader({ title, leftIcon, rightIcon, onLeftIconClick, onRightIconClick, border, compact, }: DrawerHeaderProperties): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { Drawer } from './Drawer';
2
+ export { DrawerHeader } from './DrawerHeader';
3
+ export { DrawerFooter } from './DrawerFooter';
4
+ export type { DrawerProperties, DrawerPosition, DrawerHeaderProperties, DrawerFooterProperties, } from './Drawer.types';
@@ -0,0 +1,6 @@
1
+ import { D as e, a as o, b as D } from "../shared/DrawerFooter-DvUgumx0.js";
2
+ export {
3
+ e as Drawer,
4
+ o as DrawerFooter,
5
+ D as DrawerHeader
6
+ };
@@ -1,3 +1,5 @@
1
+ export { Avatar } from '../avatar';
2
+ export type { AvatarProperties, AvatarSize } from '../avatar';
1
3
  export { Button } from '../button';
2
4
  export type { ButtonProperties, ButtonSeverity, ButtonSize, ButtonVariant, IconPosition, } from '../button';
3
5
  export { SelectField } from '../select-field';
@@ -12,6 +14,8 @@ export { InputText, CharacterCount, FormField, FloatLabel, IconField, HelperText
12
14
  export type { InputTextProperties, InputTextSize, CharacterCountProperties, } from '../input-text';
13
15
  export { Textarea } from '../textarea';
14
16
  export type { TextareaProperties } from '../textarea';
17
+ export { SearchField } from '../search-field';
18
+ export type { SearchFieldProperties } from '../search-field';
15
19
  export { InputNumber } from '../input-number';
16
20
  export type { InputNumberProperties, InputNumberSize, } from '../input-number';
17
21
  export { Checkbox } from '../checkbox';
@@ -22,3 +26,7 @@ export { Switch } from '../switch';
22
26
  export type { SwitchProperties, SwitchSize } from '../switch';
23
27
  export { Dialog, DialogHeader, DialogFooter } from '../dialog';
24
28
  export type { DialogProperties, DialogSize, DialogHeaderProperties, DialogFooterProperties, DialogFooterLayout, } from '../dialog';
29
+ export { Drawer, DrawerHeader, DrawerFooter } from '../drawer';
30
+ export type { DrawerProperties, DrawerPosition, DrawerHeaderProperties, DrawerFooterProperties, } from '../drawer';
31
+ export { Menu } from '../menu';
32
+ export type { MenuProperties, MenuItemData, MenuSeparatorEntry, MenuGroupEntry, MenuEntry, } from '../menu';
@@ -1,33 +1,44 @@
1
- import { B as a } from "../shared/Button-AfMqNCme.js";
2
- import { S as t } from "../shared/SelectField-BSTmWjYy.js";
3
- import { C as p } from "../shared/Combobox-DeUG_muZ.js";
4
- import { T as m } from "../shared/Tabs-BqIorZYD.js";
5
- import { P as l } from "../shared/ProgressSpinner-B-lrS-tu.js";
6
- import { C as b, F as n, a as C, H as F, I as u, b as T } from "../shared/HelperText-D656H0Lf.js";
7
- import { T as d } from "../shared/Textarea-0XAczkH1.js";
8
- import { I as S } from "../shared/InputNumber-D1KL6s55.js";
9
- import { C as D } from "../shared/Checkbox-DsM70wQl.js";
10
- import { R as H } from "../shared/RadioGroup-lw27DCoV.js";
11
- import { S as P } from "../shared/Switch-D6E2OmgE.js";
12
- import { D as k, a as w, b as G } from "../shared/DialogFooter-DLWy6Mln.js";
1
+ import { A as a } from "../shared/Avatar-D3QlO3Tz.js";
2
+ import { B as t } from "../shared/Button-AfMqNCme.js";
3
+ import { S as p } from "../shared/SelectField-BSTmWjYy.js";
4
+ import { C as m } from "../shared/Combobox-DeUG_muZ.js";
5
+ import { T as l } from "../shared/Tabs-BqIorZYD.js";
6
+ import { P as F } from "../shared/ProgressSpinner-B-lrS-tu.js";
7
+ import { I as n, a as D } from "../shared/IconField-Dh6j6SL1.js";
8
+ import { C as u, F as C, a as S, H as c } from "../shared/HelperText-CVWWvLCI.js";
9
+ import { T as I } from "../shared/Textarea-iJhYTZos.js";
10
+ import { S as h } from "../shared/SearchField-CgDz_s1O.js";
11
+ import { I as H } from "../shared/InputNumber-D48wsE-o.js";
12
+ import { C as B } from "../shared/Checkbox-DsM70wQl.js";
13
+ import { R as P } from "../shared/RadioGroup-lw27DCoV.js";
14
+ import { S as k } from "../shared/Switch-D6E2OmgE.js";
15
+ import { D as G, a as L, b as N } from "../shared/DialogFooter-DLWy6Mln.js";
16
+ import { D as q, a as y, b as z } from "../shared/DrawerFooter-DvUgumx0.js";
17
+ import { M as J } from "../shared/Menu-Cv9dU1iA.js";
13
18
  export {
14
- a as Button,
15
- b as CharacterCount,
16
- D as Checkbox,
17
- p as Combobox,
18
- k as Dialog,
19
- w as DialogFooter,
20
- G as DialogHeader,
21
- n as FloatLabel,
22
- C as FormField,
23
- F as HelperText,
24
- u as IconField,
25
- S as InputNumber,
26
- T as InputText,
27
- l as ProgressSpinner,
28
- H as RadioGroup,
29
- t as SelectField,
30
- P as Switch,
31
- m as Tabs,
32
- d as Textarea
19
+ a as Avatar,
20
+ t as Button,
21
+ u as CharacterCount,
22
+ B as Checkbox,
23
+ m as Combobox,
24
+ G as Dialog,
25
+ L as DialogFooter,
26
+ N as DialogHeader,
27
+ q as Drawer,
28
+ y as DrawerFooter,
29
+ z as DrawerHeader,
30
+ C as FloatLabel,
31
+ S as FormField,
32
+ c as HelperText,
33
+ n as IconField,
34
+ H as InputNumber,
35
+ D as InputText,
36
+ J as Menu,
37
+ F as ProgressSpinner,
38
+ P as RadioGroup,
39
+ h as SearchField,
40
+ p as SelectField,
41
+ k as Switch,
42
+ l as Tabs,
43
+ I as Textarea
33
44
  };
@@ -1,4 +1,4 @@
1
- import { I as m } from "../shared/InputNumber-D1KL6s55.js";
1
+ import { I as m } from "../shared/InputNumber-D48wsE-o.js";
2
2
  export {
3
3
  m as InputNumber
4
4
  };
@@ -2,6 +2,15 @@ import { ReactNode } from 'react';
2
2
  export interface IconFieldProperties {
3
3
  icon: ReactNode;
4
4
  position?: 'left' | 'right';
5
+ /** Dims the icon to match a disabled sibling input. IconField can't see
6
+ * that prop on its own (it lives on the input, not on IconField) — pass
7
+ * it through explicitly when composing (see SearchField). @default false */
8
+ disabled?: boolean;
9
+ /** Makes the icon a real click target (a `<button>`, not a decorative
10
+ * `<span>`). @default undefined (decorative) */
11
+ onIconClick?: () => void;
12
+ /** Accessible name for the button, when `onIconClick` is set. */
13
+ iconLabel?: string;
5
14
  children?: ReactNode;
6
15
  }
7
- export declare function IconField({ icon, position, children, }: IconFieldProperties): import("react").JSX.Element;
16
+ export declare function IconField({ icon, position, disabled, onIconClick, iconLabel, children, }: IconFieldProperties): import("react").JSX.Element;
@@ -1,6 +1,12 @@
1
1
  export interface FieldLayout {
2
2
  hasFloatLabel: boolean;
3
- iconSide: 'left' | 'right' | null;
3
+ iconSide: 'left' | 'right' | 'both' | null;
4
4
  }
5
5
  export declare const FieldLayoutContext: import('react').Context<FieldLayout | null>;
6
6
  export declare const useFieldLayout: () => FieldLayout | null;
7
+ /** Combines a parent IconField's side (if any) with this one's — nesting two
8
+ * IconFields (one 'left', one 'right') around the same input, e.g.
9
+ * SearchField's search + clear icons, needs both padded, not just the
10
+ * nearest one. Two IconFields on the SAME side is a consumer error; last one
11
+ * wins rather than throwing. */
12
+ export declare const mergeIconSide: (parentSide: FieldLayout["iconSide"], ownSide: "left" | "right") => FieldLayout["iconSide"];
@@ -1,9 +1,10 @@
1
- import { C as t, F as o, a as r, H as s, I as l, b as F } from "../shared/HelperText-D656H0Lf.js";
1
+ import { I as o, a as r } from "../shared/IconField-Dh6j6SL1.js";
2
+ import { C as s, F as l, a as F, H as p } from "../shared/HelperText-CVWWvLCI.js";
2
3
  export {
3
- t as CharacterCount,
4
- o as FloatLabel,
5
- r as FormField,
6
- s as HelperText,
7
- l as IconField,
8
- F as InputText
4
+ s as CharacterCount,
5
+ l as FloatLabel,
6
+ F as FormField,
7
+ p as HelperText,
8
+ o as IconField,
9
+ r as InputText
9
10
  };
@@ -0,0 +1,2 @@
1
+ import { MenuProperties } from './Menu.types';
2
+ export declare function Menu({ trigger, items, onSelect, renderItem, portalContainer, }: MenuProperties): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ import { MenuEntry, MenuItemData } from '@tpc-development/mare-ui-components-core/menu';
3
+ export type { MenuItemData, MenuSeparatorEntry, MenuGroupEntry, MenuEntry, } from '@tpc-development/mare-ui-components-core/menu';
4
+ export interface MenuProperties {
5
+ /** The element that opens the menu on click — typically a `<Button>`. */
6
+ trigger: ReactNode;
7
+ items: MenuEntry[];
8
+ /** Called with the selected item's `value` when an item (or an item
9
+ * inside a group) is chosen. */
10
+ onSelect?: (value: string) => void;
11
+ /** Custom render for an item's content (icon + label). Defaults to
12
+ * `item.icon` (if any) + `item.label`. */
13
+ renderItem?: (item: MenuItemData) => ReactNode;
14
+ /** Where the menu portals to. Ark defaults to `document.body` — override
15
+ * this if your app scopes `data-theme` (or any other CSS custom property)
16
+ * to a sub-tree rather than the document root, otherwise the portaled
17
+ * menu renders outside that scope and loses the tokens. */
18
+ portalContainer?: RefObject<HTMLElement | null>;
19
+ }
@@ -0,0 +1,2 @@
1
+ export { Menu } from './Menu';
2
+ export type { MenuProperties, MenuItemData, MenuSeparatorEntry, MenuGroupEntry, MenuEntry, } from './Menu.types';
@@ -0,0 +1,4 @@
1
+ import { M as r } from "../shared/Menu-Cv9dU1iA.js";
2
+ export {
3
+ r as Menu
4
+ };
@@ -0,0 +1,2 @@
1
+ import { SearchFieldProperties } from './SearchField.types';
2
+ export declare function SearchField({ value, onValueChange, loading, clearable, disabled, leftIcon, clearIcon, rightIcon, onClear, ...native }: SearchFieldProperties): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ import { InputTextProperties } from '../InputText';
3
+ /** Native passthrough same as InputText, minus what SearchField owns/reshapes. */
4
+ type ForwardedInputProperties = Omit<InputTextProperties, 'value' | 'onValueChange' | 'rounded'>;
5
+ export interface SearchFieldProperties extends ForwardedInputProperties {
6
+ /** Controlled value. */
7
+ value?: string;
8
+ /** Controlled change handler — receives the next string value. */
9
+ onValueChange?: (value: string) => void;
10
+ /** Shows a spinner instead of the clear icon. @default false */
11
+ loading?: boolean;
12
+ /** Shows a clear (X) button when there's a value. @default false */
13
+ clearable?: boolean;
14
+ /** Overrides the left icon. @default a search icon */
15
+ leftIcon?: ReactNode;
16
+ /** Overrides the clear button's icon. @default a close (X) icon */
17
+ clearIcon?: ReactNode;
18
+ /** Replaces the clear/spinner logic entirely with your own right-side
19
+ * content (matches the legacy: a custom right icon takes over from the
20
+ * built-in clear button). @default undefined */
21
+ rightIcon?: ReactNode;
22
+ /** Fires when the built-in clear button is clicked (clears `value` too).
23
+ * Does NOT fire for a custom `rightIcon` — wire that yourself. */
24
+ onClear?: () => void;
25
+ }
26
+ export {};
@@ -0,0 +1,2 @@
1
+ export { SearchField } from './SearchField';
2
+ export type { SearchFieldProperties } from './SearchField.types';
@@ -0,0 +1,4 @@
1
+ import { S as a } from "../shared/SearchField-CgDz_s1O.js";
2
+ export {
3
+ a as SearchField
4
+ };
@@ -0,0 +1,59 @@
1
+ import { jsxs as o, jsx as l } from "react/jsx-runtime";
2
+ import { Avatar as m } from "@ark-ui/react/avatar";
3
+ const s = (a) => a.normalize("NFD").replaceAll(/[̀-ͯ]/g, ""), d = (a) => {
4
+ if (!a) return "";
5
+ const e = a.trim().split(/\s+/).filter(Boolean);
6
+ if (e.length === 1)
7
+ return s(e[0].slice(0, 2)).toUpperCase();
8
+ const t = s(e[0][0]), r = s(e.at(-1)?.[0] ?? "");
9
+ return (t + r).toUpperCase();
10
+ }, n = `
11
+ mare:inline-flex mare:items-center mare:justify-center
12
+ mare:rounded-full mare:bg-accent-weak mare:text-accent
13
+
14
+ mare:data-size-small:h-8 mare:data-size-small:w-8 mare:data-size-small:text-base
15
+ mare:data-size-medium:h-10 mare:data-size-medium:w-10 mare:data-size-medium:text-base
16
+ `, c = `
17
+ mare:h-full mare:w-full mare:rounded-full mare:object-cover
18
+ `, u = `
19
+ mare:rounded-full
20
+ mare:data-size-small:tpc-typography-body-s
21
+ mare:data-size-medium:tpc-typography-body-m
22
+ `;
23
+ function z({
24
+ image: a,
25
+ alt: e = "",
26
+ label: t = "",
27
+ size: r = "small",
28
+ id: i
29
+ }) {
30
+ return /* @__PURE__ */ o(
31
+ m.Root,
32
+ {
33
+ id: i,
34
+ className: n,
35
+ "data-size": r,
36
+ children: [
37
+ /* @__PURE__ */ l(
38
+ m.Fallback,
39
+ {
40
+ className: u,
41
+ "data-size": r,
42
+ children: d(t)
43
+ }
44
+ ),
45
+ a && /* @__PURE__ */ l(
46
+ m.Image,
47
+ {
48
+ className: c,
49
+ src: a,
50
+ alt: e
51
+ }
52
+ )
53
+ ]
54
+ }
55
+ );
56
+ }
57
+ export {
58
+ z as A
59
+ };
@@ -0,0 +1,172 @@
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { Dialog as t } from "@ark-ui/react/dialog";
3
+ import { Portal as g } from "@ark-ui/react/portal";
4
+ import { B as d } from "./Button-AfMqNCme.js";
5
+ import { c as y } from "./icons-DeVfnVLm.js";
6
+ const _ = (e) => {
7
+ switch (e) {
8
+ case "left":
9
+ return "translateX(-100%)";
10
+ case "right":
11
+ return "translateX(100%)";
12
+ case "top":
13
+ return "translateY(-100%)";
14
+ case "bottom":
15
+ case "full":
16
+ return "translateY(100%)";
17
+ }
18
+ }, k = (e) => `
19
+ mare:fixed mare:inset-0 mare:z-40
20
+ ${e ?? "mare:bg-overlay"}
21
+ mare:ark-open:[animation:mare-dialog-backdrop-enter_300ms_ease-out]
22
+ mare:ark-closed:[animation:mare-dialog-backdrop-exit_200ms_ease-in]
23
+ `, v = {
24
+ left: "mare:justify-start",
25
+ right: "mare:justify-end",
26
+ top: "mare:flex-col mare:justify-start",
27
+ bottom: "mare:flex-col mare:justify-end",
28
+ full: ""
29
+ }, N = (e) => `
30
+ mare:fixed mare:inset-0 mare:z-50 mare:flex
31
+ ${v[e]}
32
+ `, $ = {
33
+ left: "mare:w-screen mare:md:w-120",
34
+ right: "mare:w-screen mare:md:w-120",
35
+ top: "mare:border-b mare:border-default",
36
+ bottom: "mare:border-t mare:border-default",
37
+ full: "mare:w-screen mare:h-screen mare:max-h-full"
38
+ }, j = (e) => `
39
+ mare:group/drawer mare:flex mare:flex-col
40
+ mare:bg-default mare:text-default
41
+ mare:outline-none
42
+ ${e.shadow ? "mare:shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.10),0px_4px_6px_-2px_rgba(0,0,0,0.05)]" : ""}
43
+ ${$[e.position]}
44
+ mare:ark-open:[animation:mare-drawer-enter_300ms_ease-out]
45
+ mare:ark-closed:[animation:mare-drawer-exit_200ms_ease-in]
46
+ `, C = (e) => `
47
+ mare:grow mare:overflow-y-auto mare:px-6 mare:pb-6
48
+ ${e ? "mare:pt-6" : "mare:pt-0"}
49
+ `, O = (e) => `
50
+ mare:flex mare:w-full mare:items-center mare:justify-between mare:shrink-0
51
+ mare:px-6
52
+ ${e.compact ? "mare:h-auto mare:py-4" : "mare:h-14 mare:md:h-16"}
53
+ ${e.border ? "mare:border-b mare:border-default" : ""}
54
+ `, z = "mare:-ml-1.5", D = "mare:-mr-1.5", u = (e) => `
55
+ mare:grow mare:w-full mare:truncate mare:text-center
56
+ mare:tpc-typography-label-m mare:text-default
57
+ ${e.hasRightIcon ? "" : "mare:mr-6.5"}
58
+ ${e.hasLeftIcon ? "" : "mare:ml-6.5"}
59
+ `, R = (e) => `
60
+ mare:flex mare:flex-col-reverse mare:sm:flex-row mare:justify-end
61
+ mare:gap-3 mare:sm:gap-4 mare:w-full
62
+ mare:*:w-full mare:sm:*:flex-1
63
+ mare:px-6 mare:pb-4 mare:sm:pb-6
64
+ ${e ? "mare:pt-3 mare:sm:pt-6 mare:border-t mare:border-t-default" : "mare:pt-0"}
65
+ `;
66
+ function X({
67
+ open: e,
68
+ onOpenChange: a,
69
+ position: m = "left",
70
+ modal: l = !0,
71
+ closeOnEscape: s = !0,
72
+ dismissableMask: o = !0,
73
+ maskColor: n,
74
+ shadow: f = !0,
75
+ portalContainer: p,
76
+ header: c,
77
+ footer: x,
78
+ children: h,
79
+ "aria-label": b
80
+ }) {
81
+ return /* @__PURE__ */ r(
82
+ t.Root,
83
+ {
84
+ open: e,
85
+ onOpenChange: (w) => a?.(w.open),
86
+ modal: l,
87
+ closeOnEscape: s,
88
+ closeOnInteractOutside: o,
89
+ "aria-label": b,
90
+ lazyMount: !0,
91
+ unmountOnExit: !0,
92
+ children: /* @__PURE__ */ i(g, { container: p, children: [
93
+ /* @__PURE__ */ r(t.Backdrop, { className: k(n) }),
94
+ /* @__PURE__ */ r(t.Positioner, { className: N(m), children: /* @__PURE__ */ i(
95
+ t.Content,
96
+ {
97
+ className: j({ position: m, shadow: f }),
98
+ style: {
99
+ "--mare-drawer-from": _(m)
100
+ },
101
+ children: [
102
+ c,
103
+ /* @__PURE__ */ r("div", { className: C(!!c), children: h }),
104
+ x
105
+ ]
106
+ }
107
+ ) })
108
+ ] })
109
+ }
110
+ );
111
+ }
112
+ function Y({
113
+ title: e,
114
+ leftIcon: a = /* @__PURE__ */ r(y, {}),
115
+ rightIcon: m,
116
+ onLeftIconClick: l,
117
+ onRightIconClick: s,
118
+ border: o = !1,
119
+ compact: n = !1
120
+ }) {
121
+ return /* @__PURE__ */ i("div", { className: O({ border: o, compact: n }), children: [
122
+ a ? /* @__PURE__ */ r("div", { className: z, children: /* @__PURE__ */ r(t.CloseTrigger, { asChild: !0, children: /* @__PURE__ */ r(
123
+ d,
124
+ {
125
+ severity: "ghost",
126
+ iconOnly: !0,
127
+ size: "xsmall",
128
+ icon: a,
129
+ onClick: l
130
+ }
131
+ ) }) }) : null,
132
+ e ? /* @__PURE__ */ r(
133
+ t.Title,
134
+ {
135
+ className: u({
136
+ hasLeftIcon: !!a,
137
+ hasRightIcon: !!m
138
+ }),
139
+ children: e
140
+ }
141
+ ) : /* @__PURE__ */ r(
142
+ "span",
143
+ {
144
+ className: u({
145
+ hasLeftIcon: !!a,
146
+ hasRightIcon: !!m
147
+ })
148
+ }
149
+ ),
150
+ m ? /* @__PURE__ */ r("div", { className: D, children: /* @__PURE__ */ r(
151
+ d,
152
+ {
153
+ severity: "ghost",
154
+ iconOnly: !0,
155
+ size: "xsmall",
156
+ icon: m,
157
+ onClick: s
158
+ }
159
+ ) }) : null
160
+ ] });
161
+ }
162
+ function E({
163
+ border: e = !1,
164
+ children: a
165
+ }) {
166
+ return /* @__PURE__ */ r("div", { className: R(e), children: a });
167
+ }
168
+ export {
169
+ X as D,
170
+ E as a,
171
+ Y as b
172
+ };
@@ -0,0 +1,46 @@
1
+ import { jsxs as i, jsx as r, Fragment as m } from "react/jsx-runtime";
2
+ import { useFieldContext as s, FieldRoot as c, FieldLabel as d, FieldErrorText as u, FieldHelperText as h } from "@ark-ui/react/field";
3
+ import { x as f, g, F as x, p as l, h as y } from "./field-layout-D34MpDMB.js";
4
+ function L({ value: e, max: o }) {
5
+ const a = s()?.disabled ?? !1;
6
+ return /* @__PURE__ */ i("span", { className: f(a), children: [
7
+ e.length,
8
+ "/",
9
+ o
10
+ ] });
11
+ }
12
+ function N({
13
+ invalid: e = !1,
14
+ disabled: o = !1,
15
+ required: t = !1,
16
+ children: a
17
+ }) {
18
+ return /* @__PURE__ */ r(
19
+ c,
20
+ {
21
+ invalid: e,
22
+ disabled: o,
23
+ required: t,
24
+ className: g,
25
+ children: a
26
+ }
27
+ );
28
+ }
29
+ const F = "mare:pointer-events-none mare:absolute mare:left-3 mare:origin-[0] mare:transition-all mare:duration-150 mare:tpc-typography-body-m mare:text-weak mare:top-1/2 mare:-translate-y-1/2 mare:group-focus-within:top-2 mare:group-focus-within:translate-y-0 mare:group-focus-within:tpc-typography-body-xs mare:group-has-[:is(input,textarea):not(:placeholder-shown)]:top-2 mare:group-has-[:is(input,textarea):not(:placeholder-shown)]:translate-y-0 mare:group-has-[:is(input,textarea):not(:placeholder-shown)]:tpc-typography-body-xs";
30
+ function S({ label: e, children: o }) {
31
+ const t = { hasFloatLabel: !0, iconSide: null }, a = `${F} mare:group-has-[.mare-icon-left_svg]:left-10 mare:group-has-[textarea]:top-2 mare:group-has-[textarea]:translate-y-0`, n = /* @__PURE__ */ i(m, { children: [
32
+ o,
33
+ /* @__PURE__ */ r(d, { className: a, children: e })
34
+ ] }), p = !s() ? /* @__PURE__ */ r(c, { className: l, children: n }) : /* @__PURE__ */ r("div", { className: l, children: n });
35
+ return /* @__PURE__ */ r(x.Provider, { value: t, children: p });
36
+ }
37
+ function H({ children: e }) {
38
+ const t = s()?.invalid ?? !1, a = y(t);
39
+ return t ? /* @__PURE__ */ r(u, { className: a, children: e }) : /* @__PURE__ */ r(h, { className: a, children: e });
40
+ }
41
+ export {
42
+ L as C,
43
+ S as F,
44
+ H,
45
+ N as a
46
+ };