magic-pill 9.2.0 → 9.4.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/MIGRATING.md +2 -0
- package/README.md +158 -17
- package/dist/MagicPill/MagicPill.d.mts +43 -1
- package/dist/MagicPill/MagicPill.d.ts +43 -1
- package/dist/MagicPill/MagicPill.js +53 -6
- package/dist/MagicPill/MagicPill.mjs +56 -9
- package/dist/MagicPill/flag.js +1 -59
- package/dist/MagicPill/flag.mjs +1 -58
- package/dist/MagicPill/useChoreography.js +2 -1
- package/dist/MagicPill/useChoreography.mjs +3 -2
- package/dist/Pill/PillProgress.d.mts +12 -0
- package/dist/Pill/PillProgress.d.ts +12 -0
- package/dist/Pill/PillProgress.js +42 -0
- package/dist/Pill/PillProgress.mjs +42 -0
- package/dist/Pill/goo.js +353 -0
- package/dist/Pill/goo.mjs +347 -0
- package/dist/Pill/modal.js +2 -1
- package/dist/Pill/modal.mjs +3 -2
- package/dist/Pill/morph.js +7 -4
- package/dist/Pill/morph.mjs +8 -5
- package/dist/Pill/travel.js +2 -1
- package/dist/Pill/travel.mjs +3 -2
- package/dist/Pill/zone.js +3 -2
- package/dist/Pill/zone.mjs +4 -3
- package/dist/PillForm/PillSubmit.js +1 -1
- package/dist/PillForm/PillSubmit.mjs +3 -3
- package/dist/PillForm/popover.js +2 -1
- package/dist/PillForm/popover.mjs +3 -2
- package/dist/PillNavbar/PillNavbar.d.mts +8 -0
- package/dist/PillNavbar/PillNavbar.d.ts +8 -0
- package/dist/PillNavbar/PillNavbar.js +3 -2
- package/dist/PillNavbar/PillNavbar.mjs +3 -2
- package/dist/PillNavbar/room.d.mts +3 -0
- package/dist/PillNavbar/room.d.ts +2 -0
- package/dist/PillNavbar/room.js +89 -17
- package/dist/PillNavbar/room.mjs +89 -18
- package/dist/PillOptics/PillOptics.js +2 -1
- package/dist/PillOptics/PillOptics.mjs +3 -2
- package/dist/forms.css +2 -1
- package/dist/index.d.mts +30 -15
- package/dist/index.d.ts +30 -15
- package/dist/index.js +40 -12
- package/dist/index.mjs +40 -13
- package/dist/satellites/Actions.d.mts +12 -0
- package/dist/satellites/Actions.d.ts +11 -0
- package/dist/satellites/Actions.js +59 -0
- package/dist/satellites/Actions.mjs +56 -0
- package/dist/satellites/Orbitals.js +554 -0
- package/dist/satellites/Orbitals.mjs +554 -0
- package/dist/satellites/Satellites.js +400 -0
- package/dist/satellites/Satellites.mjs +400 -0
- package/dist/satellites/layout.js +156 -0
- package/dist/satellites/layout.mjs +156 -0
- package/dist/satellites/measure.js +25 -0
- package/dist/satellites/measure.mjs +24 -0
- package/dist/satellites/orbits.js +139 -0
- package/dist/satellites/orbits.mjs +136 -0
- package/dist/satellites/types.d.mts +54 -0
- package/dist/satellites/types.d.ts +54 -0
- package/dist/satellites.d.mts +5 -0
- package/dist/satellites.d.ts +5 -0
- package/dist/satellites.js +14 -0
- package/dist/satellites.mjs +12 -0
- package/dist/store/store.d.mts +103 -0
- package/dist/store/store.d.ts +103 -0
- package/dist/store/store.js +52 -1
- package/dist/store/store.mjs +52 -2
- package/dist/styles.css +174 -10
- package/dist/utils/react.js +8 -1
- package/dist/utils/react.mjs +8 -2
- package/package.json +12 -2
- package/dist/icons/ArrowIcon.d.mts +0 -4
- package/dist/icons/ArrowIcon.d.ts +0 -4
- package/dist/icons/BoxIcon.d.mts +0 -4
- package/dist/icons/BoxIcon.d.ts +0 -4
- package/dist/icons/CheckIcon.d.mts +0 -4
- package/dist/icons/CheckIcon.d.ts +0 -4
- package/dist/icons/CloseIcon.d.mts +0 -4
- package/dist/icons/CloseIcon.d.ts +0 -4
- package/dist/icons/CouponIcon.d.mts +0 -4
- package/dist/icons/CouponIcon.d.ts +0 -4
- package/dist/icons/DocumentIcon.d.mts +0 -4
- package/dist/icons/DocumentIcon.d.ts +0 -4
- package/dist/icons/HelpIcon.d.mts +0 -4
- package/dist/icons/HelpIcon.d.ts +0 -4
- package/dist/icons/InfoIcon.d.mts +0 -4
- package/dist/icons/InfoIcon.d.ts +0 -4
- package/dist/icons/MailIcon.d.mts +0 -4
- package/dist/icons/MailIcon.d.ts +0 -4
- package/dist/icons/PhoneIcon.d.mts +0 -4
- package/dist/icons/PhoneIcon.d.ts +0 -4
- package/dist/icons/PlusIcon.d.mts +0 -4
- package/dist/icons/PlusIcon.d.ts +0 -4
- package/dist/icons/UndoIcon.d.mts +0 -4
- package/dist/icons/UndoIcon.d.ts +0 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
let react = require("react");
|
|
4
|
+
const require_react = require("../utils/react.js");
|
|
4
5
|
const require_themed = require("../Pill/themed.js");
|
|
5
6
|
const require_adaptive = require("./adaptive.js");
|
|
6
7
|
const require_lens = require("./lens.js");
|
|
@@ -119,7 +120,7 @@ function PillOptics() {
|
|
|
119
120
|
else element.style.removeProperty(property);
|
|
120
121
|
});
|
|
121
122
|
};
|
|
122
|
-
|
|
123
|
+
require_react.useIsomorphicLayoutEffect(apply, [lenses]);
|
|
123
124
|
(0, react.useEffect)(() => {
|
|
124
125
|
let stopped = false;
|
|
125
126
|
let pending = false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { Fragment, useEffect,
|
|
3
|
+
import { Fragment, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { useIsomorphicLayoutEffect } from "../utils/react.mjs";
|
|
4
5
|
import { onThemedPills, themedPills } from "../Pill/themed.mjs";
|
|
5
6
|
import { adapt } from "./adaptive.mjs";
|
|
6
7
|
import { canRefract, lensId, lensMap, makeLens } from "./lens.mjs";
|
|
@@ -119,7 +120,7 @@ function PillOptics() {
|
|
|
119
120
|
else element.style.removeProperty(property);
|
|
120
121
|
});
|
|
121
122
|
};
|
|
122
|
-
|
|
123
|
+
useIsomorphicLayoutEffect(apply, [lenses]);
|
|
123
124
|
useEffect(() => {
|
|
124
125
|
let stopped = false;
|
|
125
126
|
let pending = false;
|
package/dist/forms.css
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Pill from "./Pill/Pill.mjs";
|
|
2
2
|
import { PillActions, PillDivider, PillIcon, PillMessage } from "./Pill/parts.mjs";
|
|
3
|
+
import { PillProgress, PillProgressProps } from "./Pill/PillProgress.mjs";
|
|
3
4
|
import PillAction from "./Pill/PillAction.mjs";
|
|
4
5
|
import { PillPanel, PillPanelTrigger } from "./Pill/PillPanel.mjs";
|
|
5
6
|
import { usePill } from "./Pill/PillContext.mjs";
|
|
@@ -28,19 +29,33 @@ import { CalendarLabels } from "./PillForm/Calendar.mjs";
|
|
|
28
29
|
import { DateType } from "./PillForm/dates.mjs";
|
|
29
30
|
import { PillColor, PillColorProps } from "./PillForm/PillColor.mjs";
|
|
30
31
|
import MagicPill, { MagicPillProps } from "./MagicPill/MagicPill.mjs";
|
|
31
|
-
import { DismissReason, NotifyInput, NotifyOptions, NotifyRenderOptions, PillController, PillQueueState, QueuedNotification, pill } from "./store/store.mjs";
|
|
32
|
+
import { DismissReason, Electron, ElectronOptions, NotifyInput, NotifyOptions, NotifyRenderOptions, Orbital, PillActionItem, PillController, PillQueueState, QueuedNotification, pill } from "./store/store.mjs";
|
|
32
33
|
import { usePillQueue } from "./store/usePillQueue.mjs";
|
|
33
|
-
import
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
import { IconProps as IconProps$1 } from "./icons/types.mjs";
|
|
35
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
36
|
+
export declare const ArrowIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
37
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
38
|
+
export declare const BoxIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
39
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
40
|
+
export declare const CheckIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
41
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
42
|
+
export declare const CloseIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
43
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
44
|
+
export declare const CouponIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
45
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
46
|
+
export declare const DocumentIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
47
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
48
|
+
export declare const HelpIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
49
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
50
|
+
export declare const InfoIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
51
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
52
|
+
export declare const MailIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
53
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
54
|
+
export declare const PhoneIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
55
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
56
|
+
export declare const PlusIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
57
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
58
|
+
export declare const UndoIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
59
|
+
/** @deprecated The props of the built-in icons, which are deprecated: any `<svg>` attribute, `ComponentPropsWithoutRef<"svg">`. */
|
|
60
|
+
export type IconProps = IconProps$1;
|
|
61
|
+
export { type CalendarLabels, type DateType, type DismissReason, type Electron, type ElectronOptions, type FieldControlProps, type FieldProps, type LinkComponent, MagicPill, type MagicPillProps, type NavActionItem, type NavItem, type NavLinkItem, type NavPanelItem, type NotificationAction, type NotificationLayout, type NotificationPanel, type NotifyInput, type NotifyOptions, type NotifyRenderOptions, type Orbital, Pill, PillAction, type PillActionItem, type PillActionProps, PillActions, type PillButtonActionProps, PillCheckbox, type PillCheckboxProps, type PillChoice, PillChoices, type PillChoicesProps, PillCode, type PillCodeProps, PillColor, type PillColorProps, type PillContextValue, type PillController, PillDate, type PillDateProps, PillDivider, PillField, type PillFieldProps, PillFields, type PillFieldsProps, PillFile, type PillFileProps, PillForm, PillFormPanel, type PillFormPanelProps, type PillFormProps, PillIcon, PillInput, type PillInputProps, type PillInputType, type PillLinkActionProps, PillMessage, type PillMultipleChoiceProps, PillNavbar, type PillNavbarProps, PillNotification, type PillNotificationClassNames, type PillNotificationProps, PillOptics, type PillOption, type PillOptionGroup, type PillOrientation, PillPanel, type PillPanelProps, PillPanelTrigger, type PillPanelTriggerProps, type PillPlacement, type PillPresence, PillProgress, type PillProgressProps, type PillProps, type PillQueueState, PillSelect, type PillSelectProps, type PillSingleChoiceProps, PillSlider, type PillSliderProps, PillStepper, type PillStepperProps, PillSubmit, type PillSubmitProps, PillSwitch, type PillSwitchProps, PillTextarea, type PillTextareaProps, type PillTheme, type PillVariant, type QueuedNotification, type SceneChange, type SendHandler, pill, usePill, usePillQueue };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Pill from "./Pill/Pill.js";
|
|
2
2
|
import { PillActions, PillDivider, PillIcon, PillMessage } from "./Pill/parts.js";
|
|
3
|
+
import { PillProgress, PillProgressProps } from "./Pill/PillProgress.js";
|
|
3
4
|
import PillAction from "./Pill/PillAction.js";
|
|
4
5
|
import { PillPanel, PillPanelTrigger } from "./Pill/PillPanel.js";
|
|
5
6
|
import { usePill } from "./Pill/PillContext.js";
|
|
@@ -28,19 +29,33 @@ import { CalendarLabels } from "./PillForm/Calendar.js";
|
|
|
28
29
|
import { DateType } from "./PillForm/dates.js";
|
|
29
30
|
import { PillColor, PillColorProps } from "./PillForm/PillColor.js";
|
|
30
31
|
import MagicPill, { MagicPillProps } from "./MagicPill/MagicPill.js";
|
|
31
|
-
import { DismissReason, NotifyInput, NotifyOptions, NotifyRenderOptions, PillController, PillQueueState, QueuedNotification, pill } from "./store/store.js";
|
|
32
|
+
import { DismissReason, Electron, ElectronOptions, NotifyInput, NotifyOptions, NotifyRenderOptions, Orbital, PillActionItem, PillController, PillQueueState, QueuedNotification, pill } from "./store/store.js";
|
|
32
33
|
import { usePillQueue } from "./store/usePillQueue.js";
|
|
33
|
-
import
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
import { IconProps as IconProps$1 } from "./icons/types.js";
|
|
35
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
36
|
+
export declare const ArrowIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
37
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
38
|
+
export declare const BoxIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
39
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
40
|
+
export declare const CheckIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
41
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
42
|
+
export declare const CloseIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
43
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
44
|
+
export declare const CouponIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
45
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
46
|
+
export declare const DocumentIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
47
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
48
|
+
export declare const HelpIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
49
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
50
|
+
export declare const InfoIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
51
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
52
|
+
export declare const MailIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
53
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
54
|
+
export declare const PhoneIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
55
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
56
|
+
export declare const PlusIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
57
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
58
|
+
export declare const UndoIcon: (props: IconProps$1) => import("react").JSX.Element;
|
|
59
|
+
/** @deprecated The props of the built-in icons, which are deprecated: any `<svg>` attribute, `ComponentPropsWithoutRef<"svg">`. */
|
|
60
|
+
export type IconProps = IconProps$1;
|
|
61
|
+
export { type CalendarLabels, type DateType, type DismissReason, type Electron, type ElectronOptions, type FieldControlProps, type FieldProps, type LinkComponent, MagicPill, type MagicPillProps, type NavActionItem, type NavItem, type NavLinkItem, type NavPanelItem, type NotificationAction, type NotificationLayout, type NotificationPanel, type NotifyInput, type NotifyOptions, type NotifyRenderOptions, type Orbital, Pill, PillAction, type PillActionItem, type PillActionProps, PillActions, type PillButtonActionProps, PillCheckbox, type PillCheckboxProps, type PillChoice, PillChoices, type PillChoicesProps, PillCode, type PillCodeProps, PillColor, type PillColorProps, type PillContextValue, type PillController, PillDate, type PillDateProps, PillDivider, PillField, type PillFieldProps, PillFields, type PillFieldsProps, PillFile, type PillFileProps, PillForm, PillFormPanel, type PillFormPanelProps, type PillFormProps, PillIcon, PillInput, type PillInputProps, type PillInputType, type PillLinkActionProps, PillMessage, type PillMultipleChoiceProps, PillNavbar, type PillNavbarProps, PillNotification, type PillNotificationClassNames, type PillNotificationProps, PillOptics, type PillOption, type PillOptionGroup, type PillOrientation, PillPanel, type PillPanelProps, PillPanelTrigger, type PillPanelTriggerProps, type PillPlacement, type PillPresence, PillProgress, type PillProgressProps, type PillProps, type PillQueueState, PillSelect, type PillSelectProps, type PillSingleChoiceProps, PillSlider, type PillSliderProps, PillStepper, type PillStepperProps, PillSubmit, type PillSubmitProps, PillSwitch, type PillSwitchProps, PillTextarea, type PillTextareaProps, type PillTheme, type PillVariant, type QueuedNotification, type SceneChange, type SendHandler, pill, usePill, usePillQueue };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_Pill = require("./Pill/Pill.js");
|
|
3
3
|
const require_parts = require("./Pill/parts.js");
|
|
4
|
+
const require_PillProgress = require("./Pill/PillProgress.js");
|
|
4
5
|
const require_PillAction = require("./Pill/PillAction.js");
|
|
5
6
|
const require_PillPanel = require("./Pill/PillPanel.js");
|
|
6
7
|
const require_PillContext = require("./Pill/PillContext.js");
|
|
@@ -40,17 +41,43 @@ const require_PhoneIcon = require("./icons/PhoneIcon.js");
|
|
|
40
41
|
const require_PlusIcon = require("./icons/PlusIcon.js");
|
|
41
42
|
const require_UndoIcon = require("./icons/UndoIcon.js");
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
// src/index.ts
|
|
45
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
46
|
+
const ArrowIcon = require_ArrowIcon;
|
|
47
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
48
|
+
const BoxIcon = require_BoxIcon;
|
|
49
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
50
|
+
const CheckIcon = require_CheckIcon;
|
|
51
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
52
|
+
const CloseIcon = require_CloseIcon;
|
|
53
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
54
|
+
const CouponIcon = require_CouponIcon;
|
|
55
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
56
|
+
const DocumentIcon = require_DocumentIcon;
|
|
57
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
58
|
+
const HelpIcon = require_HelpIcon;
|
|
59
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
60
|
+
const InfoIcon = require_InfoIcon;
|
|
61
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
62
|
+
const MailIcon = require_MailIcon;
|
|
63
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
64
|
+
const PhoneIcon = require_PhoneIcon;
|
|
65
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
66
|
+
const PlusIcon = require_PlusIcon;
|
|
67
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
68
|
+
const UndoIcon = require_UndoIcon;
|
|
69
|
+
|
|
70
|
+
exports.ArrowIcon = ArrowIcon;
|
|
71
|
+
exports.BoxIcon = BoxIcon;
|
|
72
|
+
exports.CheckIcon = CheckIcon;
|
|
73
|
+
exports.CloseIcon = CloseIcon;
|
|
74
|
+
exports.CouponIcon = CouponIcon;
|
|
75
|
+
exports.DocumentIcon = DocumentIcon;
|
|
76
|
+
exports.HelpIcon = HelpIcon;
|
|
77
|
+
exports.InfoIcon = InfoIcon;
|
|
51
78
|
exports.MagicPill = require_MagicPill;
|
|
52
|
-
exports.MailIcon =
|
|
53
|
-
exports.PhoneIcon =
|
|
79
|
+
exports.MailIcon = MailIcon;
|
|
80
|
+
exports.PhoneIcon = PhoneIcon;
|
|
54
81
|
exports.Pill = require_Pill;
|
|
55
82
|
exports.PillAction = require_PillAction;
|
|
56
83
|
exports.PillActions = require_parts.PillActions;
|
|
@@ -73,14 +100,15 @@ exports.PillNotification = require_PillNotification.PillNotification;
|
|
|
73
100
|
exports.PillOptics = require_PillOptics.PillOptics;
|
|
74
101
|
exports.PillPanel = require_PillPanel.PillPanel;
|
|
75
102
|
exports.PillPanelTrigger = require_PillPanel.PillPanelTrigger;
|
|
103
|
+
exports.PillProgress = require_PillProgress.PillProgress;
|
|
76
104
|
exports.PillSelect = require_PillSelect.PillSelect;
|
|
77
105
|
exports.PillSlider = require_PillSlider.PillSlider;
|
|
78
106
|
exports.PillStepper = require_PillStepper.PillStepper;
|
|
79
107
|
exports.PillSubmit = require_PillSubmit.PillSubmit;
|
|
80
108
|
exports.PillSwitch = require_PillSwitch.PillSwitch;
|
|
81
109
|
exports.PillTextarea = require_PillTextarea.PillTextarea;
|
|
82
|
-
exports.PlusIcon =
|
|
83
|
-
exports.UndoIcon =
|
|
110
|
+
exports.PlusIcon = PlusIcon;
|
|
111
|
+
exports.UndoIcon = UndoIcon;
|
|
84
112
|
exports.pill = require_store.pill;
|
|
85
113
|
exports.usePill = require_PillContext.usePill;
|
|
86
114
|
exports.usePillQueue = require_usePillQueue.usePillQueue;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Pill from "./Pill/Pill.mjs";
|
|
2
2
|
import { PillActions, PillDivider, PillIcon, PillMessage } from "./Pill/parts.mjs";
|
|
3
|
+
import { PillProgress } from "./Pill/PillProgress.mjs";
|
|
3
4
|
import PillAction from "./Pill/PillAction.mjs";
|
|
4
5
|
import { PillPanel, PillPanelTrigger } from "./Pill/PillPanel.mjs";
|
|
5
6
|
import { usePill } from "./Pill/PillContext.mjs";
|
|
@@ -26,17 +27,43 @@ import { PillColor } from "./PillForm/PillColor.mjs";
|
|
|
26
27
|
import MagicPill from "./MagicPill/MagicPill.mjs";
|
|
27
28
|
import { pill } from "./store/store.mjs";
|
|
28
29
|
import { usePillQueue } from "./store/usePillQueue.mjs";
|
|
29
|
-
import ArrowIcon from "./icons/ArrowIcon.mjs";
|
|
30
|
-
import BoxIcon from "./icons/BoxIcon.mjs";
|
|
31
|
-
import CheckIcon from "./icons/CheckIcon.mjs";
|
|
32
|
-
import CloseIcon from "./icons/CloseIcon.mjs";
|
|
33
|
-
import CouponIcon from "./icons/CouponIcon.mjs";
|
|
34
|
-
import DocumentIcon from "./icons/DocumentIcon.mjs";
|
|
35
|
-
import HelpIcon from "./icons/HelpIcon.mjs";
|
|
36
|
-
import InfoIcon from "./icons/InfoIcon.mjs";
|
|
37
|
-
import MailIcon from "./icons/MailIcon.mjs";
|
|
38
|
-
import PhoneIcon from "./icons/PhoneIcon.mjs";
|
|
39
|
-
import PlusIcon from "./icons/PlusIcon.mjs";
|
|
40
|
-
import UndoIcon from "./icons/UndoIcon.mjs";
|
|
30
|
+
import ArrowIcon$1 from "./icons/ArrowIcon.mjs";
|
|
31
|
+
import BoxIcon$1 from "./icons/BoxIcon.mjs";
|
|
32
|
+
import CheckIcon$1 from "./icons/CheckIcon.mjs";
|
|
33
|
+
import CloseIcon$1 from "./icons/CloseIcon.mjs";
|
|
34
|
+
import CouponIcon$1 from "./icons/CouponIcon.mjs";
|
|
35
|
+
import DocumentIcon$1 from "./icons/DocumentIcon.mjs";
|
|
36
|
+
import HelpIcon$1 from "./icons/HelpIcon.mjs";
|
|
37
|
+
import InfoIcon$1 from "./icons/InfoIcon.mjs";
|
|
38
|
+
import MailIcon$1 from "./icons/MailIcon.mjs";
|
|
39
|
+
import PhoneIcon$1 from "./icons/PhoneIcon.mjs";
|
|
40
|
+
import PlusIcon$1 from "./icons/PlusIcon.mjs";
|
|
41
|
+
import UndoIcon$1 from "./icons/UndoIcon.mjs";
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
// src/index.ts
|
|
44
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
45
|
+
const ArrowIcon = ArrowIcon$1;
|
|
46
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
47
|
+
const BoxIcon = BoxIcon$1;
|
|
48
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
49
|
+
const CheckIcon = CheckIcon$1;
|
|
50
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
51
|
+
const CloseIcon = CloseIcon$1;
|
|
52
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
53
|
+
const CouponIcon = CouponIcon$1;
|
|
54
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
55
|
+
const DocumentIcon = DocumentIcon$1;
|
|
56
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
57
|
+
const HelpIcon = HelpIcon$1;
|
|
58
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
59
|
+
const InfoIcon = InfoIcon$1;
|
|
60
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
61
|
+
const MailIcon = MailIcon$1;
|
|
62
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
63
|
+
const PhoneIcon = PhoneIcon$1;
|
|
64
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
65
|
+
const PlusIcon = PlusIcon$1;
|
|
66
|
+
/** @deprecated Bring your own icons: any svg, image or icon component works (README, "Icons"). The built-in ones go in the next major version. */
|
|
67
|
+
const UndoIcon = UndoIcon$1;
|
|
68
|
+
|
|
69
|
+
export { ArrowIcon, BoxIcon, CheckIcon, CloseIcon, CouponIcon, DocumentIcon, HelpIcon, InfoIcon, MagicPill, MailIcon, PhoneIcon, Pill, PillAction, PillActions, PillCheckbox, PillChoices, PillCode, PillColor, PillDate, PillDivider, PillField, PillFields, PillFile, PillForm, PillFormPanel, PillIcon, PillInput, PillMessage, PillNavbar, PillNotification, PillOptics, PillPanel, PillPanelTrigger, PillProgress, PillSelect, PillSlider, PillStepper, PillSubmit, PillSwitch, PillTextarea, PlusIcon, UndoIcon, pill, usePill, usePillQueue };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { PillActionItem } from "../store/store.mjs";
|
|
3
|
+
import "./types.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Sets the current page's actions while the calling component is mounted:
|
|
6
|
+
* call it in a page, and they show next to the pill there, and go when the
|
|
7
|
+
* page goes. `null` or none: no actions. Give a stable array (a constant or
|
|
8
|
+
* `useMemo`), or they're set again at every render.
|
|
9
|
+
*/
|
|
10
|
+
export declare function usePillActions(items: readonly PillActionItem[] | null, options?: {
|
|
11
|
+
pill?: string;
|
|
12
|
+
}): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PillActionItem } from "../store/store.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Sets the current page's actions while the calling component is mounted:
|
|
5
|
+
* call it in a page, and they show next to the pill there, and go when the
|
|
6
|
+
* page goes. `null` or none: no actions. Give a stable array (a constant or
|
|
7
|
+
* `useMemo`), or they're set again at every render.
|
|
8
|
+
*/
|
|
9
|
+
export declare function usePillActions(items: readonly PillActionItem[] | null, options?: {
|
|
10
|
+
pill?: string;
|
|
11
|
+
}): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
let react = require("react");
|
|
4
|
+
const require_PillAction = require("../Pill/PillAction.js");
|
|
5
|
+
const require_parts = require("../Pill/parts.js");
|
|
6
|
+
const require_store = require("../store/store.js");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
|
|
9
|
+
// src/satellites/Actions.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Sets the current page's actions while the calling component is mounted:
|
|
12
|
+
* call it in a page, and they show next to the pill there, and go when the
|
|
13
|
+
* page goes. `null` or none: no actions. Give a stable array (a constant or
|
|
14
|
+
* `useMemo`), or they're set again at every render.
|
|
15
|
+
*/
|
|
16
|
+
function usePillActions(items, options = {}) {
|
|
17
|
+
const store = require_store.getStore(options.pill ?? "main");
|
|
18
|
+
(0, react.useEffect)(() => {
|
|
19
|
+
store.setActions(items);
|
|
20
|
+
return () => {
|
|
21
|
+
if (store.getActions() === items) store.setActions(null);
|
|
22
|
+
};
|
|
23
|
+
}, [store, items]);
|
|
24
|
+
}
|
|
25
|
+
/** The host's page actions, as they change. */
|
|
26
|
+
function useHostActions(host) {
|
|
27
|
+
return (0, react.useSyncExternalStore)(host.store.subscribe, host.store.getActions, () => null);
|
|
28
|
+
}
|
|
29
|
+
/** The actions themselves, as the pill's own: their label on hover and focus, a link or a button. */
|
|
30
|
+
function ActionList({ items, host }) {
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_parts.PillActions, { children: items.map((item) => item.href !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PillAction, {
|
|
32
|
+
icon: item.icon,
|
|
33
|
+
label: item.label,
|
|
34
|
+
expanded: item.expanded,
|
|
35
|
+
href: item.href,
|
|
36
|
+
linkComponent: host.linkComponent,
|
|
37
|
+
onClick: item.onClick
|
|
38
|
+
}, item.id ?? item.label) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PillAction, {
|
|
39
|
+
icon: item.icon,
|
|
40
|
+
label: item.label,
|
|
41
|
+
expanded: item.expanded,
|
|
42
|
+
onClick: item.onClick
|
|
43
|
+
}, item.id ?? item.label)) });
|
|
44
|
+
}
|
|
45
|
+
/** In the pill itself (`actionsStyle="inside"`): the actions, then a divider (the other way round on the end side). */
|
|
46
|
+
function InsideActions({ host }) {
|
|
47
|
+
const items = useHostActions(host);
|
|
48
|
+
if (!items) return null;
|
|
49
|
+
const list = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionList, {
|
|
50
|
+
items,
|
|
51
|
+
host
|
|
52
|
+
});
|
|
53
|
+
return host.actionsSide === "end" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_parts.PillDivider, {}), list] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [list, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_parts.PillDivider, {})] });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
exports.ActionList = ActionList;
|
|
57
|
+
exports.InsideActions = InsideActions;
|
|
58
|
+
exports.useHostActions = useHostActions;
|
|
59
|
+
exports.usePillActions = usePillActions;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useSyncExternalStore } from "react";
|
|
4
|
+
import PillAction from "../Pill/PillAction.mjs";
|
|
5
|
+
import { PillActions, PillDivider } from "../Pill/parts.mjs";
|
|
6
|
+
import { getStore } from "../store/store.mjs";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
// src/satellites/Actions.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Sets the current page's actions while the calling component is mounted:
|
|
12
|
+
* call it in a page, and they show next to the pill there, and go when the
|
|
13
|
+
* page goes. `null` or none: no actions. Give a stable array (a constant or
|
|
14
|
+
* `useMemo`), or they're set again at every render.
|
|
15
|
+
*/
|
|
16
|
+
function usePillActions(items, options = {}) {
|
|
17
|
+
const store = getStore(options.pill ?? "main");
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
store.setActions(items);
|
|
20
|
+
return () => {
|
|
21
|
+
if (store.getActions() === items) store.setActions(null);
|
|
22
|
+
};
|
|
23
|
+
}, [store, items]);
|
|
24
|
+
}
|
|
25
|
+
/** The host's page actions, as they change. */
|
|
26
|
+
function useHostActions(host) {
|
|
27
|
+
return useSyncExternalStore(host.store.subscribe, host.store.getActions, () => null);
|
|
28
|
+
}
|
|
29
|
+
/** The actions themselves, as the pill's own: their label on hover and focus, a link or a button. */
|
|
30
|
+
function ActionList({ items, host }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(PillActions, { children: items.map((item) => item.href !== void 0 ? /* @__PURE__ */ jsx(PillAction, {
|
|
32
|
+
icon: item.icon,
|
|
33
|
+
label: item.label,
|
|
34
|
+
expanded: item.expanded,
|
|
35
|
+
href: item.href,
|
|
36
|
+
linkComponent: host.linkComponent,
|
|
37
|
+
onClick: item.onClick
|
|
38
|
+
}, item.id ?? item.label) : /* @__PURE__ */ jsx(PillAction, {
|
|
39
|
+
icon: item.icon,
|
|
40
|
+
label: item.label,
|
|
41
|
+
expanded: item.expanded,
|
|
42
|
+
onClick: item.onClick
|
|
43
|
+
}, item.id ?? item.label)) });
|
|
44
|
+
}
|
|
45
|
+
/** In the pill itself (`actionsStyle="inside"`): the actions, then a divider (the other way round on the end side). */
|
|
46
|
+
function InsideActions({ host }) {
|
|
47
|
+
const items = useHostActions(host);
|
|
48
|
+
if (!items) return null;
|
|
49
|
+
const list = /* @__PURE__ */ jsx(ActionList, {
|
|
50
|
+
items,
|
|
51
|
+
host
|
|
52
|
+
});
|
|
53
|
+
return host.actionsSide === "end" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(PillDivider, {}), list] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [list, /* @__PURE__ */ jsx(PillDivider, {})] });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { ActionList, InsideActions, useHostActions, usePillActions };
|