magic-pill 8.0.3 → 9.0.0-next.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 (190) hide show
  1. package/CHANGELOG.md +120 -31
  2. package/MIGRATING.md +224 -0
  3. package/README.md +322 -252
  4. package/dist/MagicPill/MagicPill.d.mts +27 -0
  5. package/dist/MagicPill/MagicPill.d.ts +27 -0
  6. package/dist/MagicPill/MagicPill.js +2 -0
  7. package/dist/MagicPill/MagicPill.js.map +1 -0
  8. package/dist/MagicPill/MagicPill.mjs +2 -0
  9. package/dist/MagicPill/MagicPill.mjs.map +1 -0
  10. package/dist/MagicPill/choreography.js +2 -0
  11. package/dist/MagicPill/choreography.js.map +1 -0
  12. package/dist/MagicPill/choreography.mjs +2 -0
  13. package/dist/MagicPill/choreography.mjs.map +1 -0
  14. package/dist/Pill/Pill.d.mts +7 -0
  15. package/dist/Pill/Pill.d.ts +7 -0
  16. package/dist/Pill/Pill.js +2 -0
  17. package/dist/Pill/Pill.js.map +1 -0
  18. package/dist/Pill/Pill.mjs +2 -0
  19. package/dist/Pill/Pill.mjs.map +1 -0
  20. package/dist/Pill/PillAction.d.mts +7 -0
  21. package/dist/Pill/PillAction.d.ts +7 -0
  22. package/dist/Pill/PillAction.js +2 -0
  23. package/dist/Pill/PillAction.js.map +1 -0
  24. package/dist/Pill/PillAction.mjs +2 -0
  25. package/dist/Pill/PillAction.mjs.map +1 -0
  26. package/dist/Pill/PillContext.d.mts +3 -0
  27. package/dist/Pill/PillContext.d.ts +3 -0
  28. package/dist/Pill/PillContext.js +2 -0
  29. package/dist/Pill/PillContext.js.map +1 -0
  30. package/dist/Pill/PillContext.mjs +2 -0
  31. package/dist/Pill/PillContext.mjs.map +1 -0
  32. package/dist/Pill/PillPanel.d.mts +9 -0
  33. package/dist/Pill/PillPanel.d.ts +9 -0
  34. package/dist/Pill/PillPanel.js +2 -0
  35. package/dist/Pill/PillPanel.js.map +1 -0
  36. package/dist/Pill/PillPanel.mjs +2 -0
  37. package/dist/Pill/PillPanel.mjs.map +1 -0
  38. package/dist/Pill/parts.d.mts +10 -0
  39. package/dist/Pill/parts.d.ts +10 -0
  40. package/dist/Pill/parts.js +2 -0
  41. package/dist/Pill/parts.js.map +1 -0
  42. package/dist/Pill/parts.mjs +2 -0
  43. package/dist/Pill/parts.mjs.map +1 -0
  44. package/dist/Pill/types.d.mts +88 -0
  45. package/dist/Pill/types.d.ts +88 -0
  46. package/dist/PillNavbar/PillNavbar.d.mts +31 -0
  47. package/dist/PillNavbar/PillNavbar.d.ts +31 -0
  48. package/dist/PillNavbar/PillNavbar.js +2 -0
  49. package/dist/PillNavbar/PillNavbar.js.map +1 -0
  50. package/dist/PillNavbar/PillNavbar.mjs +2 -0
  51. package/dist/PillNavbar/PillNavbar.mjs.map +1 -0
  52. package/dist/PillNavbar/matchPath.d.mts +2 -0
  53. package/dist/PillNavbar/matchPath.d.ts +2 -0
  54. package/dist/PillNavbar/matchPath.js +2 -0
  55. package/dist/PillNavbar/matchPath.js.map +1 -0
  56. package/dist/PillNavbar/matchPath.mjs +2 -0
  57. package/dist/PillNavbar/matchPath.mjs.map +1 -0
  58. package/dist/PillNotification/PillNotification.d.mts +51 -0
  59. package/dist/PillNotification/PillNotification.d.ts +51 -0
  60. package/dist/PillNotification/PillNotification.js +2 -0
  61. package/dist/PillNotification/PillNotification.js.map +1 -0
  62. package/dist/PillNotification/PillNotification.mjs +2 -0
  63. package/dist/PillNotification/PillNotification.mjs.map +1 -0
  64. package/dist/icons/ArrowIcon.d.mts +4 -0
  65. package/dist/icons/ArrowIcon.d.ts +4 -0
  66. package/dist/icons/ArrowIcon.js +2 -0
  67. package/dist/icons/ArrowIcon.js.map +1 -0
  68. package/dist/icons/ArrowIcon.mjs +2 -0
  69. package/dist/icons/ArrowIcon.mjs.map +1 -0
  70. package/dist/icons/BoxIcon.d.mts +4 -0
  71. package/dist/icons/BoxIcon.d.ts +4 -0
  72. package/dist/icons/BoxIcon.js +2 -0
  73. package/dist/icons/BoxIcon.js.map +1 -0
  74. package/dist/icons/BoxIcon.mjs +2 -0
  75. package/dist/icons/BoxIcon.mjs.map +1 -0
  76. package/dist/icons/CheckIcon.d.mts +4 -0
  77. package/dist/icons/CheckIcon.d.ts +4 -0
  78. package/dist/icons/CheckIcon.js +2 -0
  79. package/dist/icons/CheckIcon.js.map +1 -0
  80. package/dist/icons/CheckIcon.mjs +2 -0
  81. package/dist/icons/CheckIcon.mjs.map +1 -0
  82. package/dist/icons/CloseIcon.d.mts +4 -0
  83. package/dist/icons/CloseIcon.d.ts +4 -0
  84. package/dist/icons/CloseIcon.js +2 -0
  85. package/dist/icons/CloseIcon.js.map +1 -0
  86. package/dist/icons/CloseIcon.mjs +2 -0
  87. package/dist/icons/CloseIcon.mjs.map +1 -0
  88. package/dist/icons/CouponIcon.d.mts +4 -0
  89. package/dist/icons/CouponIcon.d.ts +4 -0
  90. package/dist/icons/CouponIcon.js +2 -0
  91. package/dist/icons/CouponIcon.js.map +1 -0
  92. package/dist/icons/CouponIcon.mjs +2 -0
  93. package/dist/icons/CouponIcon.mjs.map +1 -0
  94. package/dist/icons/DocumentIcon.d.mts +4 -0
  95. package/dist/icons/DocumentIcon.d.ts +4 -0
  96. package/dist/icons/DocumentIcon.js +2 -0
  97. package/dist/icons/DocumentIcon.js.map +1 -0
  98. package/dist/icons/DocumentIcon.mjs +2 -0
  99. package/dist/icons/DocumentIcon.mjs.map +1 -0
  100. package/dist/icons/HelpIcon.d.mts +4 -0
  101. package/dist/icons/HelpIcon.d.ts +4 -0
  102. package/dist/icons/HelpIcon.js +2 -0
  103. package/dist/icons/HelpIcon.js.map +1 -0
  104. package/dist/icons/HelpIcon.mjs +2 -0
  105. package/dist/icons/HelpIcon.mjs.map +1 -0
  106. package/dist/icons/InfoIcon.d.mts +4 -0
  107. package/dist/icons/InfoIcon.d.ts +4 -0
  108. package/dist/icons/InfoIcon.js +2 -0
  109. package/dist/icons/InfoIcon.js.map +1 -0
  110. package/dist/icons/InfoIcon.mjs +2 -0
  111. package/dist/icons/InfoIcon.mjs.map +1 -0
  112. package/dist/icons/MailIcon.d.mts +4 -0
  113. package/dist/icons/MailIcon.d.ts +4 -0
  114. package/dist/icons/MailIcon.js +2 -0
  115. package/dist/icons/MailIcon.js.map +1 -0
  116. package/dist/icons/MailIcon.mjs +2 -0
  117. package/dist/icons/MailIcon.mjs.map +1 -0
  118. package/dist/icons/PhoneIcon.d.mts +4 -0
  119. package/dist/icons/PhoneIcon.d.ts +4 -0
  120. package/dist/icons/PhoneIcon.js +2 -0
  121. package/dist/icons/PhoneIcon.js.map +1 -0
  122. package/dist/icons/PhoneIcon.mjs +2 -0
  123. package/dist/icons/PhoneIcon.mjs.map +1 -0
  124. package/dist/icons/PlusIcon.d.mts +4 -0
  125. package/dist/icons/PlusIcon.d.ts +4 -0
  126. package/dist/icons/PlusIcon.js +2 -0
  127. package/dist/icons/PlusIcon.js.map +1 -0
  128. package/dist/icons/PlusIcon.mjs +2 -0
  129. package/dist/icons/PlusIcon.mjs.map +1 -0
  130. package/dist/icons/UndoIcon.d.mts +4 -0
  131. package/dist/icons/UndoIcon.d.ts +4 -0
  132. package/dist/icons/UndoIcon.js +2 -0
  133. package/dist/icons/UndoIcon.js.map +1 -0
  134. package/dist/icons/UndoIcon.mjs +2 -0
  135. package/dist/icons/UndoIcon.mjs.map +1 -0
  136. package/dist/icons/types.d.mts +3 -0
  137. package/dist/icons/types.d.ts +3 -0
  138. package/dist/index.d.mts +25 -0
  139. package/dist/index.d.ts +25 -5
  140. package/dist/index.js +1 -2
  141. package/dist/index.mjs +1 -0
  142. package/dist/store/store.d.mts +63 -0
  143. package/dist/store/store.d.ts +63 -0
  144. package/dist/store/store.js +2 -0
  145. package/dist/store/store.js.map +1 -0
  146. package/dist/store/store.mjs +2 -0
  147. package/dist/store/store.mjs.map +1 -0
  148. package/dist/store/usePillQueue.d.mts +6 -0
  149. package/dist/store/usePillQueue.d.ts +6 -0
  150. package/dist/store/usePillQueue.js +2 -0
  151. package/dist/store/usePillQueue.js.map +1 -0
  152. package/dist/store/usePillQueue.mjs +2 -0
  153. package/dist/store/usePillQueue.mjs.map +1 -0
  154. package/dist/styles.css +427 -0
  155. package/dist/utils/react.js +2 -0
  156. package/dist/utils/react.js.map +1 -0
  157. package/dist/utils/react.mjs +2 -0
  158. package/dist/utils/react.mjs.map +1 -0
  159. package/dist/utils/url.js +2 -0
  160. package/dist/utils/url.js.map +1 -0
  161. package/dist/utils/url.mjs +2 -0
  162. package/dist/utils/url.mjs.map +1 -0
  163. package/package.json +37 -24
  164. package/dist/MagicPill.d.ts +0 -8
  165. package/dist/Navbar/Navbar.d.ts +0 -9
  166. package/dist/Notification/Notification.d.ts +0 -9
  167. package/dist/defaultPillData.d.ts +0 -2
  168. package/dist/icons/arrow_label.d.ts +0 -3
  169. package/dist/icons/box_label.d.ts +0 -3
  170. package/dist/icons/checkmark.d.ts +0 -3
  171. package/dist/icons/checkmark_label.d.ts +0 -3
  172. package/dist/icons/coupon.d.ts +0 -3
  173. package/dist/icons/cross_label.d.ts +0 -3
  174. package/dist/icons/info.d.ts +0 -3
  175. package/dist/icons/mail_label.d.ts +0 -3
  176. package/dist/icons/plus_label.d.ts +0 -3
  177. package/dist/icons/questionmark.d.ts +0 -3
  178. package/dist/icons/quotation_label.d.ts +0 -3
  179. package/dist/icons/tel_label.d.ts +0 -3
  180. package/dist/icons/undo_label.d.ts +0 -3
  181. package/dist/index.esm.js +0 -2
  182. package/dist/index.esm.js.map +0 -1
  183. package/dist/index.js.map +0 -1
  184. package/dist/magicpill.css +0 -267
  185. package/dist/types/index.d.ts +0 -3
  186. package/dist/types/magicPill.d.ts +0 -50
  187. package/dist/types/navbar.d.ts +0 -27
  188. package/dist/types/notification.d.ts +0 -140
  189. package/dist/utils/handlers.d.ts +0 -19
  190. package/dist/utils/icons.d.ts +0 -18
@@ -0,0 +1,88 @@
1
+ import { AnchorHTMLAttributes, ComponentPropsWithoutRef, ComponentType, ReactNode, Ref } from "react";
2
+ /**
3
+ * How much room the pill takes. The pill animates between levels.
4
+ * - `hidden`: not shown, and out of the accessibility tree
5
+ * - `rest`: a circle showing only the leading icon
6
+ * - `compact`: the pill; actions show their icon only
7
+ * - `expanded`: the pill; every action shows icon + label
8
+ * - `panel`: the pill grows into a panel showing its <PillPanel>
9
+ */
10
+ export type PillPresence = "hidden" | "rest" | "compact" | "expanded" | "panel";
11
+ /**
12
+ * Where the pill sits.
13
+ * - Edges are `position: fixed`; `start`/`end` follow the text direction.
14
+ * - `inline` stays in the normal page flow.
15
+ * - `overlay` is a modal: a native <dialog> opened with showModal().
16
+ */
17
+ export type PillPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "right" | "inline" | "overlay";
18
+ /** Defaults to `vertical` for `left`/`right`, `horizontal` everywhere else. */
19
+ export type PillOrientation = "horizontal" | "vertical";
20
+ /**
21
+ * Colour scheme. Any other string is written to `data-variant` so you can
22
+ * define your own: `[data-mp="pill"][data-variant="brand"] { --mp-surface: … }`.
23
+ */
24
+ export type PillVariant = "neutral" | "success" | "danger" | (string & {});
25
+ /**
26
+ * A component that renders a link from an `href`, such as Next's `Link`.
27
+ * React Router's `Link` takes `to`: wrap it.
28
+ */
29
+ export type LinkComponent = ComponentType<AnchorHTMLAttributes<HTMLAnchorElement> & {
30
+ href: string;
31
+ ref?: Ref<HTMLAnchorElement>;
32
+ }>;
33
+ export interface PillProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
34
+ children?: ReactNode;
35
+ /** Controlled presence. */
36
+ presence?: PillPresence;
37
+ /** Uncontrolled initial presence. Default `compact`. */
38
+ defaultPresence?: PillPresence;
39
+ /** Called when the pill asks to change level (panel trigger, close button, Escape). */
40
+ onPresenceChange?: (presence: PillPresence) => void;
41
+ /** Default `inline`. */
42
+ placement?: PillPlacement;
43
+ orientation?: PillOrientation;
44
+ /** Default `neutral`. */
45
+ variant?: PillVariant;
46
+ /** Keeps the behaviour and the data attributes, drops the visual styles. */
47
+ unstyled?: boolean;
48
+ }
49
+ interface PillActionBase {
50
+ /** Shown at every level. */
51
+ icon?: ReactNode;
52
+ /**
53
+ * Always required: it's the accessible name when only the icon shows.
54
+ * Visible on hover and focus, when `aria-current`/`expanded` is set, or at
55
+ * the `expanded` and `panel` levels.
56
+ */
57
+ label: string;
58
+ /** Force the label to show. */
59
+ expanded?: boolean;
60
+ }
61
+ /** An action that runs code: renders a <button>. */
62
+ export interface PillButtonActionProps extends PillActionBase, Omit<ComponentPropsWithoutRef<"button">, "children"> {
63
+ href?: undefined;
64
+ }
65
+ /**
66
+ * An action that navigates: renders `linkComponent` (default <a>).
67
+ * Only relative, `http(s):`, `mailto:` and `tel:` URLs are rendered.
68
+ */
69
+ export interface PillLinkActionProps extends PillActionBase, Omit<ComponentPropsWithoutRef<"a">, "children" | "href"> {
70
+ href: string;
71
+ linkComponent?: LinkComponent;
72
+ }
73
+ export type PillActionProps = PillButtonActionProps | PillLinkActionProps;
74
+ export interface PillPanelProps extends Omit<ComponentPropsWithoutRef<"div">, "title"> {
75
+ title?: ReactNode;
76
+ /** Default "Close". */
77
+ closeLabel?: string;
78
+ /** Default <CloseIcon />. */
79
+ closeIcon?: ReactNode;
80
+ }
81
+ export interface PillContextValue {
82
+ presence: PillPresence;
83
+ setPresence: (presence: PillPresence) => void;
84
+ placement: PillPlacement;
85
+ orientation: PillOrientation;
86
+ variant: PillVariant;
87
+ }
88
+ export {};
@@ -0,0 +1,88 @@
1
+ import { AnchorHTMLAttributes, ComponentPropsWithoutRef, ComponentType, ReactNode, Ref } from "react";
2
+ /**
3
+ * How much room the pill takes. The pill animates between levels.
4
+ * - `hidden`: not shown, and out of the accessibility tree
5
+ * - `rest`: a circle showing only the leading icon
6
+ * - `compact`: the pill; actions show their icon only
7
+ * - `expanded`: the pill; every action shows icon + label
8
+ * - `panel`: the pill grows into a panel showing its <PillPanel>
9
+ */
10
+ export type PillPresence = "hidden" | "rest" | "compact" | "expanded" | "panel";
11
+ /**
12
+ * Where the pill sits.
13
+ * - Edges are `position: fixed`; `start`/`end` follow the text direction.
14
+ * - `inline` stays in the normal page flow.
15
+ * - `overlay` is a modal: a native <dialog> opened with showModal().
16
+ */
17
+ export type PillPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "right" | "inline" | "overlay";
18
+ /** Defaults to `vertical` for `left`/`right`, `horizontal` everywhere else. */
19
+ export type PillOrientation = "horizontal" | "vertical";
20
+ /**
21
+ * Colour scheme. Any other string is written to `data-variant` so you can
22
+ * define your own: `[data-mp="pill"][data-variant="brand"] { --mp-surface: … }`.
23
+ */
24
+ export type PillVariant = "neutral" | "success" | "danger" | (string & {});
25
+ /**
26
+ * A component that renders a link from an `href`, such as Next's `Link`.
27
+ * React Router's `Link` takes `to`: wrap it.
28
+ */
29
+ export type LinkComponent = ComponentType<AnchorHTMLAttributes<HTMLAnchorElement> & {
30
+ href: string;
31
+ ref?: Ref<HTMLAnchorElement>;
32
+ }>;
33
+ export interface PillProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
34
+ children?: ReactNode;
35
+ /** Controlled presence. */
36
+ presence?: PillPresence;
37
+ /** Uncontrolled initial presence. Default `compact`. */
38
+ defaultPresence?: PillPresence;
39
+ /** Called when the pill asks to change level (panel trigger, close button, Escape). */
40
+ onPresenceChange?: (presence: PillPresence) => void;
41
+ /** Default `inline`. */
42
+ placement?: PillPlacement;
43
+ orientation?: PillOrientation;
44
+ /** Default `neutral`. */
45
+ variant?: PillVariant;
46
+ /** Keeps the behaviour and the data attributes, drops the visual styles. */
47
+ unstyled?: boolean;
48
+ }
49
+ interface PillActionBase {
50
+ /** Shown at every level. */
51
+ icon?: ReactNode;
52
+ /**
53
+ * Always required: it's the accessible name when only the icon shows.
54
+ * Visible on hover and focus, when `aria-current`/`expanded` is set, or at
55
+ * the `expanded` and `panel` levels.
56
+ */
57
+ label: string;
58
+ /** Force the label to show. */
59
+ expanded?: boolean;
60
+ }
61
+ /** An action that runs code: renders a <button>. */
62
+ export interface PillButtonActionProps extends PillActionBase, Omit<ComponentPropsWithoutRef<"button">, "children"> {
63
+ href?: undefined;
64
+ }
65
+ /**
66
+ * An action that navigates: renders `linkComponent` (default <a>).
67
+ * Only relative, `http(s):`, `mailto:` and `tel:` URLs are rendered.
68
+ */
69
+ export interface PillLinkActionProps extends PillActionBase, Omit<ComponentPropsWithoutRef<"a">, "children" | "href"> {
70
+ href: string;
71
+ linkComponent?: LinkComponent;
72
+ }
73
+ export type PillActionProps = PillButtonActionProps | PillLinkActionProps;
74
+ export interface PillPanelProps extends Omit<ComponentPropsWithoutRef<"div">, "title"> {
75
+ title?: ReactNode;
76
+ /** Default "Close". */
77
+ closeLabel?: string;
78
+ /** Default <CloseIcon />. */
79
+ closeIcon?: ReactNode;
80
+ }
81
+ export interface PillContextValue {
82
+ presence: PillPresence;
83
+ setPresence: (presence: PillPresence) => void;
84
+ placement: PillPlacement;
85
+ orientation: PillOrientation;
86
+ variant: PillVariant;
87
+ }
88
+ export {};
@@ -0,0 +1,31 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import { LinkComponent } from "../Pill/types.mjs";
3
+ import { NavMatch } from "./matchPath.mjs";
4
+ export interface NavItem {
5
+ href: string;
6
+ label: string;
7
+ icon?: ReactNode;
8
+ /**
9
+ * How the item matches the current `pathname`. Default `prefix`, on whole
10
+ * path segments (`/blog` matches `/blog/post`, not `/blogroll`); `/` is
11
+ * always exact. The longest match wins, so only one item is active.
12
+ */
13
+ match?: NavMatch;
14
+ }
15
+ export interface PillNavbarProps extends Omit<ComponentPropsWithoutRef<"nav">, "children"> {
16
+ items: readonly NavItem[];
17
+ /**
18
+ * The current path, e.g. Next's `usePathname()`. Without it, the navbar
19
+ * reads `window.location.pathname` after mounting and on `popstate`, which
20
+ * misses client-side navigations.
21
+ */
22
+ pathname?: string;
23
+ linkComponent?: LinkComponent;
24
+ /** Default "Main". */
25
+ "aria-label"?: string;
26
+ }
27
+ /**
28
+ * A <nav> of icon links. The active one shows its label and gets
29
+ * `aria-current="page"`. Render it inside a <Pill>, or as the base layer of a <MagicPill>.
30
+ */
31
+ export declare const PillNavbar: import("react").ForwardRefExoticComponent<PillNavbarProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,31 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import { LinkComponent } from "../Pill/types.js";
3
+ import { NavMatch } from "./matchPath.js";
4
+ export interface NavItem {
5
+ href: string;
6
+ label: string;
7
+ icon?: ReactNode;
8
+ /**
9
+ * How the item matches the current `pathname`. Default `prefix`, on whole
10
+ * path segments (`/blog` matches `/blog/post`, not `/blogroll`); `/` is
11
+ * always exact. The longest match wins, so only one item is active.
12
+ */
13
+ match?: NavMatch;
14
+ }
15
+ export interface PillNavbarProps extends Omit<ComponentPropsWithoutRef<"nav">, "children"> {
16
+ items: readonly NavItem[];
17
+ /**
18
+ * The current path, e.g. Next's `usePathname()`. Without it, the navbar
19
+ * reads `window.location.pathname` after mounting and on `popstate`, which
20
+ * misses client-side navigations.
21
+ */
22
+ pathname?: string;
23
+ linkComponent?: LinkComponent;
24
+ /** Default "Main". */
25
+ "aria-label"?: string;
26
+ }
27
+ /**
28
+ * A <nav> of icon links. The active one shows its label and gets
29
+ * `aria-current="page"`. Render it inside a <Pill>, or as the base layer of a <MagicPill>.
30
+ */
31
+ export declare const PillNavbar: import("react").ForwardRefExoticComponent<PillNavbarProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ "use client";let e=require("react");const t=require("../Pill/parts.js"),n=require("../Pill/PillAction.js"),r=require("./matchPath.js");let i=require("react/jsx-runtime");function a(t){let[n,r]=(0,e.useState)(void 0);return(0,e.useEffect)(()=>{if(!t)return;let e=()=>r(window.location.pathname);return e(),window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[t]),n}const o=(0,e.forwardRef)(function({items:e,pathname:o,linkComponent:s,"aria-label":c=`Main`,...l},u){let d=a(o===void 0),f=r.findActiveIndex(o??d,e);return/* @__PURE__ */ (0,i.jsx)(`nav`,{"aria-label":c,...l,ref:u,"data-mp":`navbar`,children:/* @__PURE__ */ (0,i.jsx)(t.PillActions,{children:e.map((e,t)=>/* @__PURE__ */ (0,i.jsx)(n,{icon:e.icon,label:e.label,href:e.href,linkComponent:s,"aria-current":t===f?`page`:void 0},e.href))})})});exports.PillNavbar=o;
2
+ //# sourceMappingURL=PillNavbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PillNavbar.js","names":["useState","useEffect","forwardRef","findActiveIndex","PillActions","PillAction","react","require_parts","require_PillAction","require_matchPath","react_jsx_runtime","useLocationPathname","enabled","pathname","setPathname","update","PillNavbar","items","linkComponent","ariaLabel","rest","ref","locationPathname","activeIndex","item","index"],"sources":["../../src/PillNavbar/PillNavbar.tsx"],"sourcesContent":["\"use client\"\nimport { forwardRef, useEffect, useState, type ComponentPropsWithoutRef, type ReactNode } from \"react\";\n\nimport { PillActions } from \"../Pill/parts\";\nimport PillAction from \"../Pill/PillAction\";\nimport type { LinkComponent } from \"../Pill/types\";\nimport { findActiveIndex, type NavMatch } from \"./matchPath\";\n\nexport interface NavItem {\n href: string;\n label: string;\n icon?: ReactNode;\n /**\n * How the item matches the current `pathname`. Default `prefix`, on whole\n * path segments (`/blog` matches `/blog/post`, not `/blogroll`); `/` is\n * always exact. The longest match wins, so only one item is active.\n */\n match?: NavMatch;\n}\n\nexport interface PillNavbarProps extends Omit<ComponentPropsWithoutRef<\"nav\">, \"children\"> {\n items: readonly NavItem[];\n /**\n * The current path, e.g. Next's `usePathname()`. Without it, the navbar\n * reads `window.location.pathname` after mounting and on `popstate`, which\n * misses client-side navigations.\n */\n pathname?: string;\n linkComponent?: LinkComponent;\n /** Default \"Main\". */\n \"aria-label\"?: string;\n}\n\n/** Without a `pathname` prop: the browser's path, read after mounting (no hydration mismatch). */\nfunction useLocationPathname(enabled: boolean): string | undefined {\n const [pathname, setPathname] = useState<string | undefined>(undefined);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setPathname(window.location.pathname);\n update();\n window.addEventListener(\"popstate\", update);\n return () => window.removeEventListener(\"popstate\", update);\n }, [enabled]);\n return pathname;\n}\n\n/**\n * A <nav> of icon links. The active one shows its label and gets\n * `aria-current=\"page\"`. Render it inside a <Pill>, or as the base layer of a <MagicPill>.\n */\nexport const PillNavbar = forwardRef<HTMLElement, PillNavbarProps>(function PillNavbar(\n { items, pathname, linkComponent, \"aria-label\": ariaLabel = \"Main\", ...rest },\n ref,\n) {\n const locationPathname = useLocationPathname(pathname === undefined);\n const activeIndex = findActiveIndex(pathname ?? locationPathname, items);\n\n return (\n <nav aria-label={ariaLabel} {...rest} ref={ref} data-mp=\"navbar\">\n <PillActions>\n {items.map((item, index) => (\n <PillAction\n key={item.href}\n icon={item.icon}\n label={item.label}\n href={item.href}\n linkComponent={linkComponent}\n aria-current={index === activeIndex ? \"page\" : undefined}\n />\n ))}\n </PillActions>\n </nav>\n );\n});\n"],"mappings":"A,0KAkCA,SAASW,EAAoBC,EAAsC,CACjE,GAAM,CAACC,EAAUC,IAAA,EAAed,EAAAA,SAAAA,CAA6B,IAAA,EAAS,EAQtE,OAPAC,EAAAA,EAAAA,UAAAA,KAAgB,CACd,GAAI,CAACW,EAAS,OACd,IAAMG,MAAeD,EAAY,OAAO,SAAS,QAAQ,EAGzD,OAFAC,EAAO,EACP,OAAO,iBAAiB,WAAYA,CAAM,MAC7B,OAAO,oBAAoB,WAAYA,CAAM,CAC5D,EAAG,CAACH,CAAO,CAAC,EACLC,CACT,CAMA,MAAaG,GAAA,EAAad,EAAAA,WAAAA,CAAyC,SACjE,CAAEe,QAAOJ,WAAUK,gBAAe,aAAcC,EAAY,OAAQ,GAAGC,GACvEC,EACA,CACA,IAAMC,EAAmBX,EAAoBE,IAAa,IAAA,EAAS,EAC7DU,EAAcpB,EAAAA,gBAAgBU,GAAYS,EAAkBL,CAAK,EAEvE,MACE,iBAAA,EAAAP,EAAA,IAAA,CAAC,MAAD,CAAK,aAAYS,EAAW,GAAIC,EAAWC,MAAK,UAAQ,SACtD,SAAA,iBAAA,EAAAX,EAAA,IAAA,CAACN,EAAAA,YAAD,CAAA,SACGa,EAAM,KAAKO,EAAMC,IAChB,iBAAA,EAAAf,EAAA,IAAA,CAACL,EAAD,CAEE,KAAMmB,EAAK,KACX,MAAOA,EAAK,MACZ,KAAMA,EAAK,KACIN,gBACf,eAAcO,IAAUF,EAAc,OAAS,IAAA,EAChD,EANMC,EAAK,IAMX,CACF,CACU,CAAA,CACV,CAAA,CAET,CAAC,E"}
@@ -0,0 +1,2 @@
1
+ "use client";import{forwardRef as e,useEffect as t,useState as n}from"react";import{PillActions as r}from"../Pill/parts.mjs";import i from"../Pill/PillAction.mjs";import{findActiveIndex as a}from"./matchPath.mjs";import{jsx as o}from"react/jsx-runtime";function s(e){let[r,i]=n(void 0);return t(()=>{if(!e)return;let t=()=>i(window.location.pathname);return t(),window.addEventListener(`popstate`,t),()=>window.removeEventListener(`popstate`,t)},[e]),r}const c=e(function({items:e,pathname:t,linkComponent:n,"aria-label":c=`Main`,...l},u){let d=s(t===void 0),f=a(t??d,e);return/* @__PURE__ */ o(`nav`,{"aria-label":c,...l,ref:u,"data-mp":`navbar`,children:/* @__PURE__ */ o(r,{children:e.map((e,t)=>/* @__PURE__ */ o(i,{icon:e.icon,label:e.label,href:e.href,linkComponent:n,"aria-current":t===f?`page`:void 0},e.href))})})});export{c as PillNavbar};
2
+ //# sourceMappingURL=PillNavbar.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PillNavbar.mjs","names":["forwardRef","useEffect","useState","PillActions","PillAction","findActiveIndex","jsx","useLocationPathname","enabled","pathname","setPathname","update","PillNavbar","items","linkComponent","ariaLabel","rest","ref","locationPathname","activeIndex","item","index"],"sources":["../../src/PillNavbar/PillNavbar.tsx"],"sourcesContent":["\"use client\"\nimport { forwardRef, useEffect, useState, type ComponentPropsWithoutRef, type ReactNode } from \"react\";\n\nimport { PillActions } from \"../Pill/parts\";\nimport PillAction from \"../Pill/PillAction\";\nimport type { LinkComponent } from \"../Pill/types\";\nimport { findActiveIndex, type NavMatch } from \"./matchPath\";\n\nexport interface NavItem {\n href: string;\n label: string;\n icon?: ReactNode;\n /**\n * How the item matches the current `pathname`. Default `prefix`, on whole\n * path segments (`/blog` matches `/blog/post`, not `/blogroll`); `/` is\n * always exact. The longest match wins, so only one item is active.\n */\n match?: NavMatch;\n}\n\nexport interface PillNavbarProps extends Omit<ComponentPropsWithoutRef<\"nav\">, \"children\"> {\n items: readonly NavItem[];\n /**\n * The current path, e.g. Next's `usePathname()`. Without it, the navbar\n * reads `window.location.pathname` after mounting and on `popstate`, which\n * misses client-side navigations.\n */\n pathname?: string;\n linkComponent?: LinkComponent;\n /** Default \"Main\". */\n \"aria-label\"?: string;\n}\n\n/** Without a `pathname` prop: the browser's path, read after mounting (no hydration mismatch). */\nfunction useLocationPathname(enabled: boolean): string | undefined {\n const [pathname, setPathname] = useState<string | undefined>(undefined);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setPathname(window.location.pathname);\n update();\n window.addEventListener(\"popstate\", update);\n return () => window.removeEventListener(\"popstate\", update);\n }, [enabled]);\n return pathname;\n}\n\n/**\n * A <nav> of icon links. The active one shows its label and gets\n * `aria-current=\"page\"`. Render it inside a <Pill>, or as the base layer of a <MagicPill>.\n */\nexport const PillNavbar = forwardRef<HTMLElement, PillNavbarProps>(function PillNavbar(\n { items, pathname, linkComponent, \"aria-label\": ariaLabel = \"Main\", ...rest },\n ref,\n) {\n const locationPathname = useLocationPathname(pathname === undefined);\n const activeIndex = findActiveIndex(pathname ?? locationPathname, items);\n\n return (\n <nav aria-label={ariaLabel} {...rest} ref={ref} data-mp=\"navbar\">\n <PillActions>\n {items.map((item, index) => (\n <PillAction\n key={item.href}\n icon={item.icon}\n label={item.label}\n href={item.href}\n linkComponent={linkComponent}\n aria-current={index === activeIndex ? \"page\" : undefined}\n />\n ))}\n </PillActions>\n </nav>\n );\n});\n"],"mappings":"A,6PAkCA,SAASO,EAAoBC,EAAsC,CACjE,GAAM,CAACC,EAAUC,GAAeR,EAA6B,IAAA,EAAS,EAQtE,OAPAD,MAAgB,CACd,GAAI,CAACO,EAAS,OACd,IAAMG,MAAeD,EAAY,OAAO,SAAS,QAAQ,EAGzD,OAFAC,EAAO,EACP,OAAO,iBAAiB,WAAYA,CAAM,MAC7B,OAAO,oBAAoB,WAAYA,CAAM,CAC5D,EAAG,CAACH,CAAO,CAAC,EACLC,CACT,CAMA,MAAaG,EAAaZ,EAAyC,SACjE,CAAEa,QAAOJ,WAAUK,gBAAe,aAAcC,EAAY,OAAQ,GAAGC,GACvEC,EACA,CACA,IAAMC,EAAmBX,EAAoBE,IAAa,IAAA,EAAS,EAC7DU,EAAcd,EAAgBI,GAAYS,EAAkBL,CAAK,EAEvE,MACEP,kBAAC,MAAD,CAAK,aAAYS,EAAW,GAAIC,EAAWC,MAAK,UAAQ,SACtD,SAAAX,kBAACH,EAAD,CAAA,SACGU,EAAM,KAAKO,EAAMC,IAChBf,kBAACF,EAAD,CAEE,KAAMgB,EAAK,KACX,MAAOA,EAAK,MACZ,KAAMA,EAAK,KACIN,gBACf,eAAcO,IAAUF,EAAc,OAAS,IAAA,EAChD,EANMC,EAAK,IAMX,CACF,CACU,CAAA,CACV,CAAA,CAET,CAAC,E"}
@@ -0,0 +1,2 @@
1
+ /** How a nav item matches the current path (L8). */
2
+ export type NavMatch = "exact" | "prefix" | ((pathname: string) => boolean);
@@ -0,0 +1,2 @@
1
+ /** How a nav item matches the current path (L8). */
2
+ export type NavMatch = "exact" | "prefix" | ((pathname: string) => boolean);
@@ -0,0 +1,2 @@
1
+ function e(e){let t=e.split(/[?#]/,1)[0];return t.length>1?t.replace(/\/+$/,``)||`/`:t}function t(t,n){if(typeof n.match==`function`)return n.match(t);if(!n.href.startsWith(`/`)||n.href.startsWith(`//`))return!1;let r=e(t),i=e(n.href);return n.match===`exact`||i===`/`?r===i:r===i||r.startsWith(`${i}/`)}exports.findActiveIndex=function(n,r){if(n===void 0)return-1;let i=-1,a=-1;return r.forEach((r,o)=>{let s=e(r.href).length;s>a&&t(n,r)&&(i=o,a=s)}),i};
2
+ //# sourceMappingURL=matchPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchPath.js","names":["normalisePath","path","withoutSuffix","matches","pathname","item","href","items","activeIndex","activeLength","index","length"],"sources":["../../src/PillNavbar/matchPath.ts"],"sourcesContent":["/** How a nav item matches the current path (L8). */\nexport type NavMatch = \"exact\" | \"prefix\" | ((pathname: string) => boolean);\n\nexport interface MatchableItem {\n href: string;\n match?: NavMatch;\n}\n\n/** \"/blog/?q=1#top\" → \"/blog\": no query, no hash, no trailing slash (except the root). */\nfunction normalisePath(path: string): string {\n const withoutSuffix = path.split(/[?#]/, 1)[0];\n return withoutSuffix.length > 1 ? withoutSuffix.replace(/\\/+$/, \"\") || \"/\" : withoutSuffix;\n}\n\nfunction matches(pathname: string, item: MatchableItem): boolean {\n if (typeof item.match === \"function\") {\n return item.match(pathname);\n }\n // Only same-site paths can match by themselves; anything else needs a function\n if (!item.href.startsWith(\"/\") || item.href.startsWith(\"//\")) {\n return false;\n }\n const path = normalisePath(pathname);\n const href = normalisePath(item.href);\n if (item.match === \"exact\" || href === \"/\") {\n return path === href;\n }\n // Whole segments only: \"/blog\" matches \"/blog\" and \"/blog/post\", not \"/blogroll\"\n return path === href || path.startsWith(`${href}/`);\n}\n\n/**\n * The index of the active item, or -1. Several items can match (\"/blog\" and\n * \"/blog/drafts\" on \"/blog/drafts/1\"): the longest href wins, so exactly one\n * item is active.\n */\nexport function findActiveIndex(pathname: string | undefined, items: readonly MatchableItem[]): number {\n if (pathname === undefined) {\n return -1;\n }\n let activeIndex = -1;\n let activeLength = -1;\n items.forEach((item, index) => {\n const length = normalisePath(item.href).length;\n if (length > activeLength && matches(pathname, item)) {\n activeIndex = index;\n activeLength = length;\n }\n });\n return activeIndex;\n}\n"],"mappings":"AASA,SAASA,EAAcC,EAAsB,CAC3C,IAAMC,EAAgBD,EAAK,MAAM,OAAQ,CAAC,CAAC,CAAC,GAC5C,OAAOC,EAAc,OAAS,EAAIA,EAAc,QAAQ,OAAQ,EAAE,GAAK,IAAMA,CAC/E,CAEA,SAASC,EAAQC,EAAkBC,EAA8B,CAC/D,GAAI,OAAOA,EAAK,OAAU,WACxB,OAAOA,EAAK,MAAMD,CAAQ,EAG5B,GAAI,CAACC,EAAK,KAAK,WAAW,GAAG,GAAKA,EAAK,KAAK,WAAW,IAAI,EACzD,MAAO,GAET,IAAMJ,EAAOD,EAAcI,CAAQ,EAC7BE,EAAON,EAAcK,EAAK,IAAI,EAKpC,OAJIA,EAAK,QAAU,SAAWC,IAAS,IAC9BL,IAASK,EAGXL,IAASK,GAAQL,EAAK,WAAW,GAAGK,EAAK,EAAE,CACpD,C,wBAOA,SAAgCF,EAA8BG,EAAyC,CACrG,GAAIH,IAAa,IAAA,GACf,MAAO,GAET,IAAII,EAAc,GACdC,EAAe,GAQnB,OAPAF,EAAM,SAASF,EAAMK,IAAU,CAC7B,IAAMC,EAASX,EAAcK,EAAK,IAAI,CAAC,CAAC,OACpCM,EAASF,GAAgBN,EAAQC,EAAUC,CAAI,IACjDG,EAAcE,EACdD,EAAeE,EAEnB,CAAC,EACMH,CACT"}
@@ -0,0 +1,2 @@
1
+ function e(e){let t=e.split(/[?#]/,1)[0];return t.length>1?t.replace(/\/+$/,``)||`/`:t}function t(t,n){if(typeof n.match==`function`)return n.match(t);if(!n.href.startsWith(`/`)||n.href.startsWith(`//`))return!1;let r=e(t),i=e(n.href);return n.match===`exact`||i===`/`?r===i:r===i||r.startsWith(`${i}/`)}function n(n,r){if(n===void 0)return-1;let i=-1,a=-1;return r.forEach((r,o)=>{let s=e(r.href).length;s>a&&t(n,r)&&(i=o,a=s)}),i}export{n as findActiveIndex};
2
+ //# sourceMappingURL=matchPath.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchPath.mjs","names":["normalisePath","path","withoutSuffix","matches","pathname","item","href","findActiveIndex","items","activeIndex","activeLength","index","length"],"sources":["../../src/PillNavbar/matchPath.ts"],"sourcesContent":["/** How a nav item matches the current path (L8). */\nexport type NavMatch = \"exact\" | \"prefix\" | ((pathname: string) => boolean);\n\nexport interface MatchableItem {\n href: string;\n match?: NavMatch;\n}\n\n/** \"/blog/?q=1#top\" → \"/blog\": no query, no hash, no trailing slash (except the root). */\nfunction normalisePath(path: string): string {\n const withoutSuffix = path.split(/[?#]/, 1)[0];\n return withoutSuffix.length > 1 ? withoutSuffix.replace(/\\/+$/, \"\") || \"/\" : withoutSuffix;\n}\n\nfunction matches(pathname: string, item: MatchableItem): boolean {\n if (typeof item.match === \"function\") {\n return item.match(pathname);\n }\n // Only same-site paths can match by themselves; anything else needs a function\n if (!item.href.startsWith(\"/\") || item.href.startsWith(\"//\")) {\n return false;\n }\n const path = normalisePath(pathname);\n const href = normalisePath(item.href);\n if (item.match === \"exact\" || href === \"/\") {\n return path === href;\n }\n // Whole segments only: \"/blog\" matches \"/blog\" and \"/blog/post\", not \"/blogroll\"\n return path === href || path.startsWith(`${href}/`);\n}\n\n/**\n * The index of the active item, or -1. Several items can match (\"/blog\" and\n * \"/blog/drafts\" on \"/blog/drafts/1\"): the longest href wins, so exactly one\n * item is active.\n */\nexport function findActiveIndex(pathname: string | undefined, items: readonly MatchableItem[]): number {\n if (pathname === undefined) {\n return -1;\n }\n let activeIndex = -1;\n let activeLength = -1;\n items.forEach((item, index) => {\n const length = normalisePath(item.href).length;\n if (length > activeLength && matches(pathname, item)) {\n activeIndex = index;\n activeLength = length;\n }\n });\n return activeIndex;\n}\n"],"mappings":"AASA,SAASA,EAAcC,EAAsB,CAC3C,IAAMC,EAAgBD,EAAK,MAAM,OAAQ,CAAC,CAAC,CAAC,GAC5C,OAAOC,EAAc,OAAS,EAAIA,EAAc,QAAQ,OAAQ,EAAE,GAAK,IAAMA,CAC/E,CAEA,SAASC,EAAQC,EAAkBC,EAA8B,CAC/D,GAAI,OAAOA,EAAK,OAAU,WACxB,OAAOA,EAAK,MAAMD,CAAQ,EAG5B,GAAI,CAACC,EAAK,KAAK,WAAW,GAAG,GAAKA,EAAK,KAAK,WAAW,IAAI,EACzD,MAAO,GAET,IAAMJ,EAAOD,EAAcI,CAAQ,EAC7BE,EAAON,EAAcK,EAAK,IAAI,EAKpC,OAJIA,EAAK,QAAU,SAAWC,IAAS,IAC9BL,IAASK,EAGXL,IAASK,GAAQL,EAAK,WAAW,GAAGK,EAAK,EAAE,CACpD,CAOA,SAAgBC,EAAgBH,EAA8BI,EAAyC,CACrG,GAAIJ,IAAa,IAAA,GACf,MAAO,GAET,IAAIK,EAAc,GACdC,EAAe,GAQnB,OAPAF,EAAM,SAASH,EAAMM,IAAU,CAC7B,IAAMC,EAASZ,EAAcK,EAAK,IAAI,CAAC,CAAC,OACpCO,EAASF,GAAgBP,EAAQC,EAAUC,CAAI,IACjDI,EAAcE,EACdD,EAAeE,EAEnB,CAAC,EACMH,CACT,C"}
@@ -0,0 +1,51 @@
1
+ import { MouseEvent, ReactNode } from "react";
2
+ import { LinkComponent } from "../Pill/types.mjs";
3
+ /** Same rules as the matching <PillAction> props. */
4
+ export type NotificationAction = {
5
+ icon?: ReactNode;
6
+ label: string;
7
+ /**
8
+ * Inside a <MagicPill>, clicking an action dismisses the notification.
9
+ * Call `event.preventDefault()` to keep it open.
10
+ */
11
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void;
12
+ href?: undefined;
13
+ } | {
14
+ icon?: ReactNode;
15
+ label: string;
16
+ href: string;
17
+ onClick?: undefined;
18
+ };
19
+ export interface NotificationPanel {
20
+ title?: ReactNode;
21
+ content: ReactNode;
22
+ /** The action that opens the panel. Default `{ icon: <PlusIcon />, label: "Learn more" }`. */
23
+ trigger?: {
24
+ icon?: ReactNode;
25
+ label: string;
26
+ };
27
+ /** Default "Close". */
28
+ closeLabel?: string;
29
+ }
30
+ export interface PillNotificationClassNames {
31
+ icon?: string;
32
+ divider?: string;
33
+ message?: string;
34
+ actions?: string;
35
+ action?: string;
36
+ panel?: string;
37
+ }
38
+ export interface PillNotificationProps {
39
+ icon?: ReactNode;
40
+ /** Any content: strings, emphasis, live data. Never parsed as HTML (L3). */
41
+ message: ReactNode;
42
+ action?: NotificationAction;
43
+ panel?: NotificationPanel;
44
+ linkComponent?: LinkComponent;
45
+ classNames?: PillNotificationClassNames;
46
+ }
47
+ /**
48
+ * Icon · divider · message · action, with an optional expandable panel.
49
+ * Render it inside a <Pill>, or let <MagicPill> render it for pill().notify().
50
+ */
51
+ export declare const PillNotification: (props: PillNotificationProps) => ReactNode;
@@ -0,0 +1,51 @@
1
+ import { MouseEvent, ReactNode } from "react";
2
+ import { LinkComponent } from "../Pill/types.js";
3
+ /** Same rules as the matching <PillAction> props. */
4
+ export type NotificationAction = {
5
+ icon?: ReactNode;
6
+ label: string;
7
+ /**
8
+ * Inside a <MagicPill>, clicking an action dismisses the notification.
9
+ * Call `event.preventDefault()` to keep it open.
10
+ */
11
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void;
12
+ href?: undefined;
13
+ } | {
14
+ icon?: ReactNode;
15
+ label: string;
16
+ href: string;
17
+ onClick?: undefined;
18
+ };
19
+ export interface NotificationPanel {
20
+ title?: ReactNode;
21
+ content: ReactNode;
22
+ /** The action that opens the panel. Default `{ icon: <PlusIcon />, label: "Learn more" }`. */
23
+ trigger?: {
24
+ icon?: ReactNode;
25
+ label: string;
26
+ };
27
+ /** Default "Close". */
28
+ closeLabel?: string;
29
+ }
30
+ export interface PillNotificationClassNames {
31
+ icon?: string;
32
+ divider?: string;
33
+ message?: string;
34
+ actions?: string;
35
+ action?: string;
36
+ panel?: string;
37
+ }
38
+ export interface PillNotificationProps {
39
+ icon?: ReactNode;
40
+ /** Any content: strings, emphasis, live data. Never parsed as HTML (L3). */
41
+ message: ReactNode;
42
+ action?: NotificationAction;
43
+ panel?: NotificationPanel;
44
+ linkComponent?: LinkComponent;
45
+ classNames?: PillNotificationClassNames;
46
+ }
47
+ /**
48
+ * Icon · divider · message · action, with an optional expandable panel.
49
+ * Render it inside a <Pill>, or let <MagicPill> render it for pill().notify().
50
+ */
51
+ export declare const PillNotification: (props: PillNotificationProps) => ReactNode;
@@ -0,0 +1,2 @@
1
+ const e=require("../Pill/parts.js"),t=require("../Pill/PillAction.js"),n=require("../Pill/PillPanel.js"),r=require("../icons/PlusIcon.js");let i=require("react/jsx-runtime");function a({icon:a,message:o,action:s,panel:c,linkComponent:l,classNames:u={},onAction:d}){let f=a!=null;return/* @__PURE__ */ (0,i.jsxs)(i.Fragment,{children:[f&&/* @__PURE__ */ (0,i.jsxs)(i.Fragment,{children:[/* @__PURE__ */ (0,i.jsx)(e.PillIcon,{className:u.icon,children:a}),/* @__PURE__ */ (0,i.jsx)(e.PillDivider,{className:u.divider})]}),/* @__PURE__ */ (0,i.jsx)(e.PillMessage,{className:u.message,children:o}),(s||c)&&/* @__PURE__ */ (0,i.jsxs)(e.PillActions,{className:u.actions,children:[s&&(e=>{let{icon:n,label:r}=e;if(e.href!==void 0)return/* @__PURE__ */ (0,i.jsx)(t,{icon:n,label:r,href:e.href,linkComponent:l,className:u.action,onClick:d});let{onClick:a}=e;return/* @__PURE__ */ (0,i.jsx)(t,{icon:n,label:r,className:u.action,onClick:e=>{a(e),d?.(e)}})})(s),c&&/* @__PURE__ */ (0,i.jsx)(n.PillPanelTrigger,{icon:c.trigger?c.trigger.icon:/* @__PURE__ */ (0,i.jsx)(r,{}),label:c.trigger?.label??`Learn more`,className:u.action})]}),c&&/* @__PURE__ */ (0,i.jsx)(n.PillPanel,{title:c.title,closeLabel:c.closeLabel,className:u.panel,children:c.content})]})}const o=a;exports.NotificationContent=a,exports.PillNotification=o;
2
+ //# sourceMappingURL=PillNotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PillNotification.js","names":["PillAction","PillIcon","PillDivider","PillMessage","PillActions","PillPanelTrigger","PlusIcon","PillPanel","require_parts","require_PillAction","require_PillPanel","require_PlusIcon","react_jsx_runtime","NotificationContent","icon","message","action","panel","linkComponent","classNames","onAction","hasIcon","notificationAction","actionIcon","label","onClick","event","PillNotification"],"sources":["../../src/PillNotification/PillNotification.tsx"],"sourcesContent":["// No \"use client\": the template holds no state. A Server Component can render\n// it (with `href` actions); the panel parts it uses are client components.\nimport type { MouseEvent, ReactNode } from \"react\";\n\nimport { PillActions, PillDivider, PillIcon, PillMessage } from \"../Pill/parts\";\nimport PillAction from \"../Pill/PillAction\";\nimport { PillPanel, PillPanelTrigger } from \"../Pill/PillPanel\";\nimport type { LinkComponent } from \"../Pill/types\";\nimport PlusIcon from \"../icons/PlusIcon\";\n\n/** Same rules as the matching <PillAction> props. */\nexport type NotificationAction =\n | {\n icon?: ReactNode;\n label: string;\n /**\n * Inside a <MagicPill>, clicking an action dismisses the notification.\n * Call `event.preventDefault()` to keep it open.\n */\n onClick: (event: MouseEvent<HTMLButtonElement>) => void;\n href?: undefined;\n }\n | { icon?: ReactNode; label: string; href: string; onClick?: undefined };\n\nexport interface NotificationPanel {\n title?: ReactNode;\n content: ReactNode;\n /** The action that opens the panel. Default `{ icon: <PlusIcon />, label: \"Learn more\" }`. */\n trigger?: { icon?: ReactNode; label: string };\n /** Default \"Close\". */\n closeLabel?: string;\n}\n\nexport interface PillNotificationClassNames {\n icon?: string;\n divider?: string;\n message?: string;\n actions?: string;\n action?: string;\n panel?: string;\n}\n\nexport interface PillNotificationProps {\n icon?: ReactNode;\n /** Any content: strings, emphasis, live data. Never parsed as HTML (L3). */\n message: ReactNode;\n action?: NotificationAction;\n panel?: NotificationPanel;\n linkComponent?: LinkComponent;\n classNames?: PillNotificationClassNames;\n}\n\ninterface NotificationContentProps extends PillNotificationProps {\n /**\n * Internal: <MagicPill> uses it to dismiss the notification after an action\n * click (link or button), unless the action's handler prevented the default.\n */\n onAction?: (event: MouseEvent<HTMLElement>) => void;\n}\n\n/** The implementation, with the host-only `onAction` hook. */\nexport function NotificationContent({\n icon,\n message,\n action,\n panel,\n linkComponent,\n classNames = {},\n onAction,\n}: NotificationContentProps) {\n const hasIcon = icon !== undefined && icon !== null;\n\n const renderAction = (notificationAction: NotificationAction) => {\n const { icon: actionIcon, label } = notificationAction;\n if (notificationAction.href !== undefined) {\n return (\n <PillAction\n icon={actionIcon}\n label={label}\n href={notificationAction.href}\n linkComponent={linkComponent}\n className={classNames.action}\n onClick={onAction}\n />\n );\n }\n const { onClick } = notificationAction;\n return (\n <PillAction\n icon={actionIcon}\n label={label}\n className={classNames.action}\n onClick={(event) => {\n onClick(event);\n onAction?.(event);\n }}\n />\n );\n };\n\n return (\n <>\n {hasIcon && (\n <>\n <PillIcon className={classNames.icon}>{icon}</PillIcon>\n <PillDivider className={classNames.divider} />\n </>\n )}\n <PillMessage className={classNames.message}>{message}</PillMessage>\n {(action || panel) && (\n <PillActions className={classNames.actions}>\n {action && renderAction(action)}\n {panel && (\n <PillPanelTrigger\n icon={panel.trigger ? panel.trigger.icon : <PlusIcon />}\n label={panel.trigger?.label ?? \"Learn more\"}\n className={classNames.action}\n />\n )}\n </PillActions>\n )}\n {panel && (\n <PillPanel title={panel.title} closeLabel={panel.closeLabel} className={classNames.panel}>\n {panel.content}\n </PillPanel>\n )}\n </>\n );\n}\n\n/**\n * Icon · divider · message · action, with an optional expandable panel.\n * Render it inside a <Pill>, or let <MagicPill> render it for pill().notify().\n */\nexport const PillNotification = NotificationContent as (props: PillNotificationProps) => ReactNode;\n"],"mappings":"A,8KA6DA,SAAgBa,EAAoB,CAClCC,OACAC,UACAC,SACAC,QACAC,gBACAC,aAAa,CAAC,EACdC,YAC2B,CAC3B,IAAMC,EAAUP,GAA+B,KA8B/C,MACE,iBAAA,EAAAF,EAAA,KAAA,CAAAA,EAAA,SAAA,CAAA,SAAA,CACGS,GACC,iBAAA,EAAAT,EAAA,KAAA,CAAAA,EAAA,SAAA,CAAA,SAAA,CACE,iBAAA,EAAAA,EAAA,IAAA,CAACX,EAAAA,SAAD,CAAU,UAAWkB,EAAW,KAAO,SAAAL,CAAe,CAAA,EACtD,iBAAA,EAAAF,EAAA,IAAA,CAACV,EAAAA,YAAD,CAAa,UAAWiB,EAAW,OAAU,CAAA,CAC7C,CAAA,CAAA,EAEJ,iBAAA,EAAAP,EAAA,IAAA,CAACT,EAAAA,YAAD,CAAa,UAAWgB,EAAW,QAAU,SAAAJ,CAAqB,CAAA,GAChEC,GAAUC,IACV,iBAAA,EAAAL,EAAA,KAAA,CAACR,EAAAA,YAAD,CAAa,UAAWe,EAAW,QAAnC,SAAA,CACGH,IAvCaM,GAA2C,CAC/D,GAAM,CAAE,KAAMC,EAAYC,SAAUF,EACpC,GAAIA,EAAmB,OAAS,IAAA,GAC9B,MACE,iBAAA,EAAAV,EAAA,IAAA,CAACZ,EAAD,CACE,KAAMuB,EACCC,QACP,KAAMF,EAAmB,KACVJ,gBACf,UAAWC,EAAW,OACtB,QAASC,CACV,CAAA,EAGL,GAAM,CAAEK,WAAYH,EACpB,MACE,iBAAA,EAAAV,EAAA,IAAA,CAACZ,EAAD,CACE,KAAMuB,EACCC,QACP,UAAWL,EAAW,OACtB,QAAUO,GAAU,CAClBD,EAAQC,CAAK,EACbN,IAAWM,CAAK,CAClB,CACD,CAAA,CAEL,EAamB,CAAaV,CAAM,EAC7BC,GACC,iBAAA,EAAAL,EAAA,IAAA,CAACP,EAAAA,iBAAD,CACE,KAAMY,EAAM,QAAUA,EAAM,QAAQ,KAAO,iBAAA,EAAAL,EAAA,IAAA,CAACN,EAAD,CAAW,CAAA,EACtD,MAAOW,EAAM,SAAS,OAAS,aAC/B,UAAWE,EAAW,MACvB,CAAA,CAEQ,C,GAEdF,GACC,iBAAA,EAAAL,EAAA,IAAA,CAACL,EAAAA,UAAD,CAAW,MAAOU,EAAM,MAAO,WAAYA,EAAM,WAAY,UAAWE,EAAW,MAChF,SAAAF,EAAM,OACE,CAAA,CAEb,CAAA,CAAA,CAEN,CAMA,MAAaU,EAAmBd,E"}
@@ -0,0 +1,2 @@
1
+ import{PillActions as e,PillDivider as t,PillIcon as n,PillMessage as r}from"../Pill/parts.mjs";import i from"../Pill/PillAction.mjs";import{PillPanel as a,PillPanelTrigger as o}from"../Pill/PillPanel.mjs";import s from"../icons/PlusIcon.mjs";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";function d({icon:d,message:f,action:p,panel:m,linkComponent:h,classNames:g={},onAction:_}){return/* @__PURE__ */ u(c,{children:[d!=null&&/* @__PURE__ */ u(c,{children:[/* @__PURE__ */ l(n,{className:g.icon,children:d}),/* @__PURE__ */ l(t,{className:g.divider})]}),/* @__PURE__ */ l(r,{className:g.message,children:f}),(p||m)&&/* @__PURE__ */ u(e,{className:g.actions,children:[p&&(e=>{let{icon:t,label:n}=e;if(e.href!==void 0)return/* @__PURE__ */ l(i,{icon:t,label:n,href:e.href,linkComponent:h,className:g.action,onClick:_});let{onClick:r}=e;return/* @__PURE__ */ l(i,{icon:t,label:n,className:g.action,onClick:e=>{r(e),_?.(e)}})})(p),m&&/* @__PURE__ */ l(o,{icon:m.trigger?m.trigger.icon:/* @__PURE__ */ l(s,{}),label:m.trigger?.label??`Learn more`,className:g.action})]}),m&&/* @__PURE__ */ l(a,{title:m.title,closeLabel:m.closeLabel,className:g.panel,children:m.content})]})}const f=d;export{d as NotificationContent,f as PillNotification};
2
+ //# sourceMappingURL=PillNotification.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PillNotification.mjs","names":["PillActions","PillDivider","PillIcon","PillMessage","PillAction","PillPanel","PillPanelTrigger","PlusIcon","Fragment","jsx","jsxs","NotificationContent","icon","message","action","panel","linkComponent","classNames","onAction","notificationAction","actionIcon","label","onClick","event","PillNotification"],"sources":["../../src/PillNotification/PillNotification.tsx"],"sourcesContent":["// No \"use client\": the template holds no state. A Server Component can render\n// it (with `href` actions); the panel parts it uses are client components.\nimport type { MouseEvent, ReactNode } from \"react\";\n\nimport { PillActions, PillDivider, PillIcon, PillMessage } from \"../Pill/parts\";\nimport PillAction from \"../Pill/PillAction\";\nimport { PillPanel, PillPanelTrigger } from \"../Pill/PillPanel\";\nimport type { LinkComponent } from \"../Pill/types\";\nimport PlusIcon from \"../icons/PlusIcon\";\n\n/** Same rules as the matching <PillAction> props. */\nexport type NotificationAction =\n | {\n icon?: ReactNode;\n label: string;\n /**\n * Inside a <MagicPill>, clicking an action dismisses the notification.\n * Call `event.preventDefault()` to keep it open.\n */\n onClick: (event: MouseEvent<HTMLButtonElement>) => void;\n href?: undefined;\n }\n | { icon?: ReactNode; label: string; href: string; onClick?: undefined };\n\nexport interface NotificationPanel {\n title?: ReactNode;\n content: ReactNode;\n /** The action that opens the panel. Default `{ icon: <PlusIcon />, label: \"Learn more\" }`. */\n trigger?: { icon?: ReactNode; label: string };\n /** Default \"Close\". */\n closeLabel?: string;\n}\n\nexport interface PillNotificationClassNames {\n icon?: string;\n divider?: string;\n message?: string;\n actions?: string;\n action?: string;\n panel?: string;\n}\n\nexport interface PillNotificationProps {\n icon?: ReactNode;\n /** Any content: strings, emphasis, live data. Never parsed as HTML (L3). */\n message: ReactNode;\n action?: NotificationAction;\n panel?: NotificationPanel;\n linkComponent?: LinkComponent;\n classNames?: PillNotificationClassNames;\n}\n\ninterface NotificationContentProps extends PillNotificationProps {\n /**\n * Internal: <MagicPill> uses it to dismiss the notification after an action\n * click (link or button), unless the action's handler prevented the default.\n */\n onAction?: (event: MouseEvent<HTMLElement>) => void;\n}\n\n/** The implementation, with the host-only `onAction` hook. */\nexport function NotificationContent({\n icon,\n message,\n action,\n panel,\n linkComponent,\n classNames = {},\n onAction,\n}: NotificationContentProps) {\n const hasIcon = icon !== undefined && icon !== null;\n\n const renderAction = (notificationAction: NotificationAction) => {\n const { icon: actionIcon, label } = notificationAction;\n if (notificationAction.href !== undefined) {\n return (\n <PillAction\n icon={actionIcon}\n label={label}\n href={notificationAction.href}\n linkComponent={linkComponent}\n className={classNames.action}\n onClick={onAction}\n />\n );\n }\n const { onClick } = notificationAction;\n return (\n <PillAction\n icon={actionIcon}\n label={label}\n className={classNames.action}\n onClick={(event) => {\n onClick(event);\n onAction?.(event);\n }}\n />\n );\n };\n\n return (\n <>\n {hasIcon && (\n <>\n <PillIcon className={classNames.icon}>{icon}</PillIcon>\n <PillDivider className={classNames.divider} />\n </>\n )}\n <PillMessage className={classNames.message}>{message}</PillMessage>\n {(action || panel) && (\n <PillActions className={classNames.actions}>\n {action && renderAction(action)}\n {panel && (\n <PillPanelTrigger\n icon={panel.trigger ? panel.trigger.icon : <PlusIcon />}\n label={panel.trigger?.label ?? \"Learn more\"}\n className={classNames.action}\n />\n )}\n </PillActions>\n )}\n {panel && (\n <PillPanel title={panel.title} closeLabel={panel.closeLabel} className={classNames.panel}>\n {panel.content}\n </PillPanel>\n )}\n </>\n );\n}\n\n/**\n * Icon · divider · message · action, with an optional expandable panel.\n * Render it inside a <Pill>, or let <MagicPill> render it for pill().notify().\n */\nexport const PillNotification = NotificationContent as (props: PillNotificationProps) => ReactNode;\n"],"mappings":"A,mTA6DA,SAAgBW,EAAoB,CAClCC,OACAC,UACAC,SACAC,QACAC,gBACAC,aAAa,CAAC,EACdC,YAC2B,CA+B3B,MACER,kBAAAF,EAAA,CAAA,SAAA,CA/BcI,GAA+B,MAiCzCF,kBAAAF,EAAA,CAAA,SAAA,CACEC,kBAACP,EAAD,CAAU,UAAWe,EAAW,KAAO,SAAAL,CAAe,CAAA,EACtDH,kBAACR,EAAD,CAAa,UAAWgB,EAAW,OAAU,CAAA,CAC7C,CAAA,CAAA,EAEJR,kBAACN,EAAD,CAAa,UAAWc,EAAW,QAAU,SAAAJ,CAAqB,CAAA,GAChEC,GAAUC,IACVL,kBAACV,EAAD,CAAa,UAAWiB,EAAW,QAAnC,SAAA,CACGH,IAvCaK,GAA2C,CAC/D,GAAM,CAAE,KAAMC,EAAYC,SAAUF,EACpC,GAAIA,EAAmB,OAAS,IAAA,GAC9B,MACEV,kBAACL,EAAD,CACE,KAAMgB,EACCC,QACP,KAAMF,EAAmB,KACVH,gBACf,UAAWC,EAAW,OACtB,QAASC,CACV,CAAA,EAGL,GAAM,CAAEI,WAAYH,EACpB,MACEV,kBAACL,EAAD,CACE,KAAMgB,EACCC,QACP,UAAWJ,EAAW,OACtB,QAAUM,GAAU,CAClBD,EAAQC,CAAK,EACbL,IAAWK,CAAK,CAClB,CACD,CAAA,CAEL,EAamB,CAAaT,CAAM,EAC7BC,GACCN,kBAACH,EAAD,CACE,KAAMS,EAAM,QAAUA,EAAM,QAAQ,KAAON,kBAACF,EAAD,CAAW,CAAA,EACtD,MAAOQ,EAAM,SAAS,OAAS,aAC/B,UAAWE,EAAW,MACvB,CAAA,CAEQ,C,GAEdF,GACCN,kBAACJ,EAAD,CAAW,MAAOU,EAAM,MAAO,WAAYA,EAAM,WAAY,UAAWE,EAAW,MAChF,SAAAF,EAAM,OACE,CAAA,CAEb,CAAA,CAAA,CAEN,CAMA,MAAaS,EAAmBb,E"}
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.mjs";
2
+ /** v9 icon (from `arrow_label`): drawn in `currentColor`, decorative by default. */
3
+ declare const ArrowIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export { ArrowIcon as default };
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.js";
2
+ /** v9 icon (from `arrow_label`): drawn in `currentColor`, decorative by default. */
3
+ declare const ArrowIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export = ArrowIcon;
@@ -0,0 +1,2 @@
1
+ let e=require("react/jsx-runtime");const t=t=>/* @__PURE__ */ (0,e.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 31 20`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ (0,e.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.813004 10.2755C0.813004 9.69059 1.28715 9.21645 1.87204 9.21645L26.8501 9.21645L20.1858 2.55207C19.7722 2.1385 19.7722 1.46795 20.1858 1.05438C20.5993 0.640799 21.2699 0.640799 21.6835 1.05438L30.1557 9.52663C30.5693 9.94021 30.5693 10.6107 30.1557 11.0243L21.6835 19.4966C21.2699 19.9102 20.5993 19.9102 20.1858 19.4966C19.7722 19.083 19.7722 18.4125 20.1858 17.9989L26.8501 11.3345L1.87204 11.3345C1.28715 11.3345 0.813004 10.8604 0.813004 10.2755Z`})});module.exports=t;
2
+ //# sourceMappingURL=ArrowIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowIcon.js","names":["react_jsx_runtime","ArrowIcon","props"],"sources":["../../src/icons/ArrowIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `arrow_label`): drawn in `currentColor`, decorative by default. */\nconst ArrowIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 31 20\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M0.813004 10.2755C0.813004 9.69059 1.28715 9.21645 1.87204 9.21645L26.8501 9.21645L20.1858 2.55207C19.7722 2.1385 19.7722 1.46795 20.1858 1.05438C20.5993 0.640799 21.2699 0.640799 21.6835 1.05438L30.1557 9.52663C30.5693 9.94021 30.5693 10.6107 30.1557 11.0243L21.6835 19.4966C21.2699 19.9102 20.5993 19.9102 20.1858 19.4966C19.7722 19.083 19.7722 18.4125 20.1858 17.9989L26.8501 11.3345L1.87204 11.3345C1.28715 11.3345 0.813004 10.8604 0.813004 10.2755Z\" />\n </svg>\n);\n\nexport default ArrowIcon;\n"],"mappings":"A,mCAGA,MAAMC,EAAaC,GACjB,iBAAA,EAAAF,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAA,iBAAA,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAM,SAAS,UAAU,SAAS,UAAU,EAAE,ucAAyc,CAAA,CACpf,CAAA,E"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";const t=t=>/* @__PURE__ */ e(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 31 20`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ e(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.813004 10.2755C0.813004 9.69059 1.28715 9.21645 1.87204 9.21645L26.8501 9.21645L20.1858 2.55207C19.7722 2.1385 19.7722 1.46795 20.1858 1.05438C20.5993 0.640799 21.2699 0.640799 21.6835 1.05438L30.1557 9.52663C30.5693 9.94021 30.5693 10.6107 30.1557 11.0243L21.6835 19.4966C21.2699 19.9102 20.5993 19.9102 20.1858 19.4966C19.7722 19.083 19.7722 18.4125 20.1858 17.9989L26.8501 11.3345L1.87204 11.3345C1.28715 11.3345 0.813004 10.8604 0.813004 10.2755Z`})});export{t as default};
2
+ //# sourceMappingURL=ArrowIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowIcon.mjs","names":["jsx","ArrowIcon","props"],"sources":["../../src/icons/ArrowIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `arrow_label`): drawn in `currentColor`, decorative by default. */\nconst ArrowIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 31 20\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M0.813004 10.2755C0.813004 9.69059 1.28715 9.21645 1.87204 9.21645L26.8501 9.21645L20.1858 2.55207C19.7722 2.1385 19.7722 1.46795 20.1858 1.05438C20.5993 0.640799 21.2699 0.640799 21.6835 1.05438L30.1557 9.52663C30.5693 9.94021 30.5693 10.6107 30.1557 11.0243L21.6835 19.4966C21.2699 19.9102 20.5993 19.9102 20.1858 19.4966C19.7722 19.083 19.7722 18.4125 20.1858 17.9989L26.8501 11.3345L1.87204 11.3345C1.28715 11.3345 0.813004 10.8604 0.813004 10.2755Z\" />\n </svg>\n);\n\nexport default ArrowIcon;\n"],"mappings":"A,wCAGA,MAAMC,EAAaC,GACjBF,kBAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAAF,kBAAC,OAAD,CAAM,SAAS,UAAU,SAAS,UAAU,EAAE,ucAAyc,CAAA,CACpf,CAAA,E"}
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.mjs";
2
+ /** v9 icon (from `box_label`): drawn in `currentColor`, decorative by default. */
3
+ declare const BoxIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export { BoxIcon as default };
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.js";
2
+ /** v9 icon (from `box_label`): drawn in `currentColor`, decorative by default. */
3
+ declare const BoxIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export = BoxIcon;
@@ -0,0 +1,2 @@
1
+ let e=require("react/jsx-runtime");const t=t=>/* @__PURE__ */ (0,e.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 27 26`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ (0,e.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M25.5226 4.8102C25.9834 4.99448 26.2855 5.4407 26.2855 5.9369V19.9512C26.2855 20.4474 25.9834 20.8936 25.5226 21.0779L13.7921 25.7701C13.5028 25.8858 13.1801 25.8858 12.8908 25.7701L1.16028 21.0779C0.699563 20.8936 0.397461 20.4474 0.397461 19.9512V5.9369C0.397461 5.4407 0.699563 4.99448 1.16028 4.8102L12.4401 0.298213C12.4451 0.296221 12.4501 0.294245 12.4551 0.292286L12.8908 0.117998C13.1801 0.00227327 13.5028 0.00227283 13.7921 0.117998L14.2279 0.292303C14.2329 0.294256 14.2379 0.296226 14.2428 0.298213L25.5226 4.8102ZM17.2306 3.23602L7.27396 7.21868L3.38482 5.66302L2.01546 6.21076V6.85792L12.5325 11.0647V23.8841L13.3415 24.2077L14.1505 23.8841V11.0647L24.6675 6.85792V6.21076L23.2981 5.66302L13.3415 9.64568L9.45226 8.09L19.4089 4.10734L17.2306 3.23602Z`})});module.exports=t;
2
+ //# sourceMappingURL=BoxIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoxIcon.js","names":["react_jsx_runtime","BoxIcon","props"],"sources":["../../src/icons/BoxIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `box_label`): drawn in `currentColor`, decorative by default. */\nconst BoxIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 27 26\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M25.5226 4.8102C25.9834 4.99448 26.2855 5.4407 26.2855 5.9369V19.9512C26.2855 20.4474 25.9834 20.8936 25.5226 21.0779L13.7921 25.7701C13.5028 25.8858 13.1801 25.8858 12.8908 25.7701L1.16028 21.0779C0.699563 20.8936 0.397461 20.4474 0.397461 19.9512V5.9369C0.397461 5.4407 0.699563 4.99448 1.16028 4.8102L12.4401 0.298213C12.4451 0.296221 12.4501 0.294245 12.4551 0.292286L12.8908 0.117998C13.1801 0.00227327 13.5028 0.00227283 13.7921 0.117998L14.2279 0.292303C14.2329 0.294256 14.2379 0.296226 14.2428 0.298213L25.5226 4.8102ZM17.2306 3.23602L7.27396 7.21868L3.38482 5.66302L2.01546 6.21076V6.85792L12.5325 11.0647V23.8841L13.3415 24.2077L14.1505 23.8841V11.0647L24.6675 6.85792V6.21076L23.2981 5.66302L13.3415 9.64568L9.45226 8.09L19.4089 4.10734L17.2306 3.23602Z\" />\n </svg>\n);\n\nexport default BoxIcon;\n"],"mappings":"A,mCAGA,MAAMC,EAAWC,GACf,iBAAA,EAAAF,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAA,iBAAA,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAM,SAAS,UAAU,SAAS,UAAU,EAAE,+vBAAiwB,CAAA,CAC5yB,CAAA,E"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";const t=t=>/* @__PURE__ */ e(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 27 26`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ e(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M25.5226 4.8102C25.9834 4.99448 26.2855 5.4407 26.2855 5.9369V19.9512C26.2855 20.4474 25.9834 20.8936 25.5226 21.0779L13.7921 25.7701C13.5028 25.8858 13.1801 25.8858 12.8908 25.7701L1.16028 21.0779C0.699563 20.8936 0.397461 20.4474 0.397461 19.9512V5.9369C0.397461 5.4407 0.699563 4.99448 1.16028 4.8102L12.4401 0.298213C12.4451 0.296221 12.4501 0.294245 12.4551 0.292286L12.8908 0.117998C13.1801 0.00227327 13.5028 0.00227283 13.7921 0.117998L14.2279 0.292303C14.2329 0.294256 14.2379 0.296226 14.2428 0.298213L25.5226 4.8102ZM17.2306 3.23602L7.27396 7.21868L3.38482 5.66302L2.01546 6.21076V6.85792L12.5325 11.0647V23.8841L13.3415 24.2077L14.1505 23.8841V11.0647L24.6675 6.85792V6.21076L23.2981 5.66302L13.3415 9.64568L9.45226 8.09L19.4089 4.10734L17.2306 3.23602Z`})});export{t as default};
2
+ //# sourceMappingURL=BoxIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoxIcon.mjs","names":["jsx","BoxIcon","props"],"sources":["../../src/icons/BoxIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `box_label`): drawn in `currentColor`, decorative by default. */\nconst BoxIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 27 26\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M25.5226 4.8102C25.9834 4.99448 26.2855 5.4407 26.2855 5.9369V19.9512C26.2855 20.4474 25.9834 20.8936 25.5226 21.0779L13.7921 25.7701C13.5028 25.8858 13.1801 25.8858 12.8908 25.7701L1.16028 21.0779C0.699563 20.8936 0.397461 20.4474 0.397461 19.9512V5.9369C0.397461 5.4407 0.699563 4.99448 1.16028 4.8102L12.4401 0.298213C12.4451 0.296221 12.4501 0.294245 12.4551 0.292286L12.8908 0.117998C13.1801 0.00227327 13.5028 0.00227283 13.7921 0.117998L14.2279 0.292303C14.2329 0.294256 14.2379 0.296226 14.2428 0.298213L25.5226 4.8102ZM17.2306 3.23602L7.27396 7.21868L3.38482 5.66302L2.01546 6.21076V6.85792L12.5325 11.0647V23.8841L13.3415 24.2077L14.1505 23.8841V11.0647L24.6675 6.85792V6.21076L23.2981 5.66302L13.3415 9.64568L9.45226 8.09L19.4089 4.10734L17.2306 3.23602Z\" />\n </svg>\n);\n\nexport default BoxIcon;\n"],"mappings":"A,wCAGA,MAAMC,EAAWC,GACfF,kBAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAAF,kBAAC,OAAD,CAAM,SAAS,UAAU,SAAS,UAAU,EAAE,+vBAAiwB,CAAA,CAC5yB,CAAA,E"}
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.mjs";
2
+ /** v9 icon (from `checkmark`): drawn in `currentColor`, decorative by default. */
3
+ declare const CheckIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export { CheckIcon as default };
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.js";
2
+ /** v9 icon (from `checkmark`): drawn in `currentColor`, decorative by default. */
3
+ declare const CheckIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export = CheckIcon;
@@ -0,0 +1,2 @@
1
+ let e=require("react/jsx-runtime");const t=t=>/* @__PURE__ */ (0,e.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 36 28`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ (0,e.jsx)(`path`,{d:`M31.7745 0.900854C32.7099 -0.0470194 34.2265 -0.0470194 35.1619 0.900854C36.0859 1.8371 36.0972 3.34793 35.1959 4.29828L16.0585 26.9205C16.0401 26.9438 16.0204 26.966 15.9996 26.9872C15.0641 27.935 13.5475 27.935 12.6121 26.9872L0.966345 15.1863C0.0309227 14.2385 0.0309227 12.7017 0.966344 11.7538C1.90177 10.8059 3.41838 10.8059 4.35381 11.7538L14.2337 21.7652L31.7109 0.97346C31.7307 0.947992 31.7519 0.923746 31.7745 0.900854Z`})});module.exports=t;
2
+ //# sourceMappingURL=CheckIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckIcon.js","names":["react_jsx_runtime","CheckIcon","props"],"sources":["../../src/icons/CheckIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `checkmark`): drawn in `currentColor`, decorative by default. */\nconst CheckIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 36 28\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M31.7745 0.900854C32.7099 -0.0470194 34.2265 -0.0470194 35.1619 0.900854C36.0859 1.8371 36.0972 3.34793 35.1959 4.29828L16.0585 26.9205C16.0401 26.9438 16.0204 26.966 15.9996 26.9872C15.0641 27.935 13.5475 27.935 12.6121 26.9872L0.966345 15.1863C0.0309227 14.2385 0.0309227 12.7017 0.966344 11.7538C1.90177 10.8059 3.41838 10.8059 4.35381 11.7538L14.2337 21.7652L31.7109 0.97346C31.7307 0.947992 31.7519 0.923746 31.7745 0.900854Z\" />\n </svg>\n);\n\nexport default CheckIcon;\n"],"mappings":"A,mCAGA,MAAMC,EAAaC,GACjB,iBAAA,EAAAF,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAA,iBAAA,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,gbAAkb,CAAA,CACvb,CAAA,E"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";const t=t=>/* @__PURE__ */ e(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 36 28`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ e(`path`,{d:`M31.7745 0.900854C32.7099 -0.0470194 34.2265 -0.0470194 35.1619 0.900854C36.0859 1.8371 36.0972 3.34793 35.1959 4.29828L16.0585 26.9205C16.0401 26.9438 16.0204 26.966 15.9996 26.9872C15.0641 27.935 13.5475 27.935 12.6121 26.9872L0.966345 15.1863C0.0309227 14.2385 0.0309227 12.7017 0.966344 11.7538C1.90177 10.8059 3.41838 10.8059 4.35381 11.7538L14.2337 21.7652L31.7109 0.97346C31.7307 0.947992 31.7519 0.923746 31.7745 0.900854Z`})});export{t as default};
2
+ //# sourceMappingURL=CheckIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckIcon.mjs","names":["jsx","CheckIcon","props"],"sources":["../../src/icons/CheckIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `checkmark`): drawn in `currentColor`, decorative by default. */\nconst CheckIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 36 28\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M31.7745 0.900854C32.7099 -0.0470194 34.2265 -0.0470194 35.1619 0.900854C36.0859 1.8371 36.0972 3.34793 35.1959 4.29828L16.0585 26.9205C16.0401 26.9438 16.0204 26.966 15.9996 26.9872C15.0641 27.935 13.5475 27.935 12.6121 26.9872L0.966345 15.1863C0.0309227 14.2385 0.0309227 12.7017 0.966344 11.7538C1.90177 10.8059 3.41838 10.8059 4.35381 11.7538L14.2337 21.7652L31.7109 0.97346C31.7307 0.947992 31.7519 0.923746 31.7745 0.900854Z\" />\n </svg>\n);\n\nexport default CheckIcon;\n"],"mappings":"A,wCAGA,MAAMC,EAAaC,GACjBF,kBAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAAF,kBAAC,OAAD,CAAM,EAAE,gbAAkb,CAAA,CACvb,CAAA,E"}
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.mjs";
2
+ /** v9 icon (from `cross_label`): drawn in `currentColor`, decorative by default. */
3
+ declare const CloseIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export { CloseIcon as default };
@@ -0,0 +1,4 @@
1
+ import { IconProps } from "./types.js";
2
+ /** v9 icon (from `cross_label`): drawn in `currentColor`, decorative by default. */
3
+ declare const CloseIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export = CloseIcon;
@@ -0,0 +1,2 @@
1
+ let e=require("react/jsx-runtime");const t=t=>/* @__PURE__ */ (0,e.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ (0,e.jsx)(`path`,{d:`M0.808942 1.61705C0.493007 1.30112 0.493007 0.788885 0.808942 0.472951C1.12488 0.157017 1.63711 0.157017 1.95304 0.472951L10.28 8.7999L18.6069 0.472951C18.9229 0.157017 19.4351 0.157017 19.751 0.472951C20.067 0.788885 20.067 1.30112 19.751 1.61705L11.4241 9.944L19.751 18.271C20.067 18.5869 20.067 19.0991 19.751 19.4151C19.4351 19.731 18.9229 19.731 18.6069 19.4151L10.28 11.0881L1.95304 19.4151C1.63711 19.731 1.12488 19.731 0.808943 19.4151C0.493008 19.0991 0.493008 18.5869 0.808943 18.271L9.13589 9.944L0.808942 1.61705Z`})});module.exports=t;
2
+ //# sourceMappingURL=CloseIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloseIcon.js","names":["react_jsx_runtime","CloseIcon","props"],"sources":["../../src/icons/CloseIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `cross_label`): drawn in `currentColor`, decorative by default. */\nconst CloseIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M0.808942 1.61705C0.493007 1.30112 0.493007 0.788885 0.808942 0.472951C1.12488 0.157017 1.63711 0.157017 1.95304 0.472951L10.28 8.7999L18.6069 0.472951C18.9229 0.157017 19.4351 0.157017 19.751 0.472951C20.067 0.788885 20.067 1.30112 19.751 1.61705L11.4241 9.944L19.751 18.271C20.067 18.5869 20.067 19.0991 19.751 19.4151C19.4351 19.731 18.9229 19.731 18.6069 19.4151L10.28 11.0881L1.95304 19.4151C1.63711 19.731 1.12488 19.731 0.808943 19.4151C0.493008 19.0991 0.493008 18.5869 0.808943 18.271L9.13589 9.944L0.808942 1.61705Z\" />\n </svg>\n);\n\nexport default CloseIcon;\n"],"mappings":"A,mCAGA,MAAMC,EAAaC,GACjB,iBAAA,EAAAF,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAA,iBAAA,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,+gBAAihB,CAAA,CACthB,CAAA,E"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";const t=t=>/* @__PURE__ */ e(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,xmlns:`http://www.w3.org/2000/svg`,...t,children:/* @__PURE__ */ e(`path`,{d:`M0.808942 1.61705C0.493007 1.30112 0.493007 0.788885 0.808942 0.472951C1.12488 0.157017 1.63711 0.157017 1.95304 0.472951L10.28 8.7999L18.6069 0.472951C18.9229 0.157017 19.4351 0.157017 19.751 0.472951C20.067 0.788885 20.067 1.30112 19.751 1.61705L11.4241 9.944L19.751 18.271C20.067 18.5869 20.067 19.0991 19.751 19.4151C19.4351 19.731 18.9229 19.731 18.6069 19.4151L10.28 11.0881L1.95304 19.4151C1.63711 19.731 1.12488 19.731 0.808943 19.4151C0.493008 19.0991 0.493008 18.5869 0.808943 18.271L9.13589 9.944L0.808942 1.61705Z`})});export{t as default};
2
+ //# sourceMappingURL=CloseIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloseIcon.mjs","names":["jsx","CloseIcon","props"],"sources":["../../src/icons/CloseIcon.tsx"],"sourcesContent":["import type { IconProps } from \"./types\";\n\n/** v9 icon (from `cross_label`): drawn in `currentColor`, decorative by default. */\nconst CloseIcon = (props: IconProps) => (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M0.808942 1.61705C0.493007 1.30112 0.493007 0.788885 0.808942 0.472951C1.12488 0.157017 1.63711 0.157017 1.95304 0.472951L10.28 8.7999L18.6069 0.472951C18.9229 0.157017 19.4351 0.157017 19.751 0.472951C20.067 0.788885 20.067 1.30112 19.751 1.61705L11.4241 9.944L19.751 18.271C20.067 18.5869 20.067 19.0991 19.751 19.4151C19.4351 19.731 18.9229 19.731 18.6069 19.4151L10.28 11.0881L1.95304 19.4151C1.63711 19.731 1.12488 19.731 0.808943 19.4151C0.493008 19.0991 0.493008 18.5869 0.808943 18.271L9.13589 9.944L0.808942 1.61705Z\" />\n </svg>\n);\n\nexport default CloseIcon;\n"],"mappings":"A,wCAGA,MAAMC,EAAaC,GACjBF,kBAAC,MAAD,CAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,YAAY,KAAK,eAAe,cAAY,OAAO,UAAU,QAAQ,MAAM,6BAA6B,GAAIE,EAChJ,SAAAF,kBAAC,OAAD,CAAM,EAAE,+gBAAihB,CAAA,CACthB,CAAA,E"}