@sprawlify/primitives 0.0.109 → 0.0.110
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/dist/machines/accordion/index.d.cts +1 -1
- package/dist/machines/accordion/index.d.mts +1 -1
- package/dist/machines/carousel/index.d.cts +1 -1
- package/dist/machines/carousel/index.d.mts +1 -1
- package/dist/machines/cascade-select/index.d.cts +2 -2
- package/dist/machines/cascade-select/index.d.mts +2 -2
- package/dist/machines/checkbox/index.d.cts +1 -1
- package/dist/machines/checkbox/index.d.mts +1 -1
- package/dist/machines/clipboard/index.d.cts +1 -1
- package/dist/machines/clipboard/index.d.mts +1 -1
- package/dist/machines/collapsible/index.d.cts +1 -1
- package/dist/machines/collapsible/index.d.mts +1 -1
- package/dist/machines/color-picker/index.d.cts +1 -1
- package/dist/machines/color-picker/index.d.mts +1 -1
- package/dist/machines/combobox/index.d.cts +1 -1
- package/dist/machines/combobox/index.d.mts +1 -1
- package/dist/machines/date-picker/index.d.cts +1 -1
- package/dist/machines/date-picker/index.d.mts +1 -1
- package/dist/machines/dialog/index.d.cts +1 -1
- package/dist/machines/dialog/index.d.mts +1 -1
- package/dist/machines/{bottom-sheet → drawer}/index.cjs +19 -19
- package/dist/machines/drawer/index.d.cts +128 -0
- package/dist/machines/drawer/index.d.mts +128 -0
- package/dist/machines/{bottom-sheet → drawer}/index.mjs +19 -19
- package/dist/machines/dropdown-menu/index.d.cts +1 -1
- package/dist/machines/dropdown-menu/index.d.mts +1 -1
- package/dist/machines/editable/index.d.cts +1 -1
- package/dist/machines/editable/index.d.mts +1 -1
- package/dist/machines/file-upload/index.d.cts +1 -1
- package/dist/machines/file-upload/index.d.mts +1 -1
- package/dist/machines/floating-panel/index.d.cts +1 -1
- package/dist/machines/floating-panel/index.d.mts +1 -1
- package/dist/machines/listbox/index.d.cts +1 -1
- package/dist/machines/listbox/index.d.mts +1 -1
- package/dist/machines/marquee/index.d.cts +2 -2
- package/dist/machines/marquee/index.d.mts +2 -2
- package/dist/machines/navigation-menu/index.d.cts +1 -1
- package/dist/machines/navigation-menu/index.d.mts +1 -1
- package/dist/machines/number-input/index.d.cts +1 -1
- package/dist/machines/number-input/index.d.mts +1 -1
- package/dist/machines/password-input/index.d.cts +1 -1
- package/dist/machines/password-input/index.d.mts +1 -1
- package/dist/machines/pin-input/index.d.cts +1 -1
- package/dist/machines/pin-input/index.d.mts +1 -1
- package/dist/machines/popover/index.d.cts +1 -1
- package/dist/machines/popover/index.d.mts +1 -1
- package/dist/machines/progress/index.d.cts +1 -1
- package/dist/machines/progress/index.d.mts +1 -1
- package/dist/machines/radio-group/index.d.cts +1 -1
- package/dist/machines/radio-group/index.d.mts +1 -1
- package/dist/machines/select/index.d.cts +1 -1
- package/dist/machines/select/index.d.mts +1 -1
- package/dist/machines/signature-pad/index.d.cts +1 -1
- package/dist/machines/signature-pad/index.d.mts +1 -1
- package/dist/machines/slider/index.d.cts +1 -1
- package/dist/machines/slider/index.d.mts +1 -1
- package/dist/machines/steps/index.d.cts +1 -1
- package/dist/machines/steps/index.d.mts +1 -1
- package/dist/machines/tabs/index.d.cts +1 -1
- package/dist/machines/tabs/index.d.mts +1 -1
- package/dist/machines/tags-input/index.d.cts +1 -1
- package/dist/machines/tags-input/index.d.mts +1 -1
- package/dist/machines/timer/index.d.cts +1 -1
- package/dist/machines/timer/index.d.mts +1 -1
- package/dist/machines/toast/index.d.cts +1 -1
- package/dist/machines/toast/index.d.mts +1 -1
- package/dist/machines/tour/index.d.cts +1 -1
- package/dist/machines/tour/index.d.mts +1 -1
- package/dist/machines/tree-view/index.d.cts +1 -1
- package/dist/machines/tree-view/index.d.mts +1 -1
- package/package.json +11 -11
- package/dist/machines/bottom-sheet/index.d.cts +0 -239
- package/dist/machines/bottom-sheet/index.d.mts +0 -239
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMT
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/accordion/accordion.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "itemTrigger" | "itemContent">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/accordion/accordion.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rz
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/accordion/accordion.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "itemTrigger" | "itemContent">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/accordion/accordion.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMT
|
|
|
3
3
|
import { b as NormalizeProps, d as Orientation, f as OrientationProperty, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/carousel/carousel.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "control" | "indicator" | "itemGroup" | "item" | "nextTrigger" | "prevTrigger" | "indicatorGroup" | "autoplayTrigger" | "progressText">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/carousel/carousel.types.d.ts
|
|
9
9
|
interface PageChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rz
|
|
|
3
3
|
import { b as NormalizeProps, d as Orientation, f as OrientationProperty, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/carousel/carousel.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "control" | "indicator" | "itemGroup" | "item" | "nextTrigger" | "prevTrigger" | "indicatorGroup" | "autoplayTrigger" | "progressText">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/carousel/carousel.types.d.ts
|
|
9
9
|
interface PageChangeDetails {
|
|
@@ -8,8 +8,8 @@ import { c as Placement, d as PositioningOptions } from "../../types-CZAtqGqH.cj
|
|
|
8
8
|
import { a as Point } from "../../types-CLXYEgfm.cjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/cascade-select/cascade-select.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
12
|
-
declare const parts: Record<"root" | "content" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "label" | "control" | "indicator" | "trigger" | "valueText" | "item" | "clearTrigger" | "positioner" | "list" | "itemText" | "itemIndicator">;
|
|
12
|
+
declare const parts: Record<"root" | "content" | "label" | "control" | "indicator" | "trigger" | "valueText" | "item" | "clearTrigger" | "positioner" | "list" | "itemText" | "itemIndicator", AnatomyPart>;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/machines/cascade-select/cascade-select.collection.d.ts
|
|
15
15
|
declare const collection: {
|
|
@@ -8,8 +8,8 @@ import { p as PositioningOptions, u as Placement } from "../../index-fMh0VDkR.mj
|
|
|
8
8
|
import { a as Point } from "../../types-DU764tY_.mjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/cascade-select/cascade-select.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
12
|
-
declare const parts: Record<"root" | "content" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "label" | "control" | "indicator" | "trigger" | "valueText" | "item" | "clearTrigger" | "positioner" | "list" | "itemText" | "itemIndicator">;
|
|
12
|
+
declare const parts: Record<"root" | "content" | "label" | "control" | "indicator" | "trigger" | "valueText" | "item" | "clearTrigger" | "positioner" | "list" | "itemText" | "itemIndicator", AnatomyPart>;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/machines/cascade-select/cascade-select.collection.d.ts
|
|
15
15
|
declare const collection: {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMT
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/checkbox/checkbox.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "indicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/checkbox/checkbox.types.d.ts
|
|
9
9
|
type CheckedState = boolean | "indeterminate";
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rz
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/checkbox/checkbox.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "indicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/checkbox/checkbox.types.d.ts
|
|
9
9
|
type CheckedState = boolean | "indeterminate";
|
|
@@ -3,7 +3,7 @@ import { p as Machine, y as Service } from "../../types-B24gMTKq.cjs";
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/clipboard/clipboard.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "indicator" | "trigger" | "input">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/clipboard/clipboard.types.d.ts
|
|
9
9
|
interface CopyStatusDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, y as Service } from "../../types-DUM9rzfD.mjs";
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/clipboard/clipboard.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "indicator" | "trigger" | "input">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/clipboard/clipboard.types.d.ts
|
|
9
9
|
interface CopyStatusDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, y as Service } from "../../types-B24gMTKq.cjs";
|
|
|
3
3
|
import { b as NormalizeProps, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/collapsible/collapsible.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "indicator" | "trigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/collapsible/collapsible.types.d.ts
|
|
9
9
|
interface OpenChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, y as Service } from "../../types-DUM9rzfD.mjs";
|
|
|
3
3
|
import { b as NormalizeProps, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/collapsible/collapsible.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "indicator" | "trigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/collapsible/collapsible.types.d.ts
|
|
9
9
|
interface OpenChangeDetails {
|
|
@@ -6,7 +6,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
6
6
|
import { d as PositioningOptions } from "../../types-CZAtqGqH.cjs";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/color-picker/color-picker.anatomy.d.ts
|
|
9
|
-
declare const anatomy: Anatomy<"root" | "content" | "
|
|
9
|
+
declare const anatomy: Anatomy<"root" | "content" | "label" | "control" | "trigger" | "valueText" | "area" | "positioner" | "areaThumb" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/color-picker/color-picker.types.d.ts
|
|
12
12
|
type ExtendedColorChannel = ColorChannel | "hex" | "css";
|
|
@@ -6,7 +6,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
6
6
|
import { p as PositioningOptions } from "../../index-fMh0VDkR.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/color-picker/color-picker.anatomy.d.ts
|
|
9
|
-
declare const anatomy: Anatomy<"root" | "content" | "
|
|
9
|
+
declare const anatomy: Anatomy<"root" | "content" | "label" | "control" | "trigger" | "valueText" | "area" | "positioner" | "areaThumb" | "areaBackground" | "channelSlider" | "channelSliderLabel" | "channelSliderTrack" | "channelSliderThumb" | "channelSliderValueText" | "channelInput" | "transparencyGrid" | "swatchGroup" | "swatchTrigger" | "swatchIndicator" | "swatch" | "eyeDropperTrigger" | "formatTrigger" | "formatSelect">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/color-picker/color-picker.types.d.ts
|
|
12
12
|
type ExtendedColorChannel = ColorChannel | "hex" | "css";
|
|
@@ -7,7 +7,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
7
7
|
import { c as Placement, d as PositioningOptions } from "../../types-CZAtqGqH.cjs";
|
|
8
8
|
|
|
9
9
|
//#region src/machines/combobox/combobox.anatomy.d.ts
|
|
10
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
10
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "label" | "control" | "trigger" | "input" | "itemGroup" | "item" | "clearTrigger" | "positioner" | "list" | "itemText" | "itemIndicator" | "itemGroupLabel">;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/machines/combobox/combobox.collection.d.ts
|
|
13
13
|
declare const collection: {
|
|
@@ -7,7 +7,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
7
7
|
import { p as PositioningOptions, u as Placement } from "../../index-fMh0VDkR.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/machines/combobox/combobox.anatomy.d.ts
|
|
10
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
10
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "label" | "control" | "trigger" | "input" | "itemGroup" | "item" | "clearTrigger" | "positioner" | "list" | "itemText" | "itemIndicator" | "itemGroupLabel">;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/machines/combobox/combobox.collection.d.ts
|
|
13
13
|
declare const collection: {
|
|
@@ -8,7 +8,7 @@ import { c as Placement, d as PositioningOptions } from "../../types-CZAtqGqH.cj
|
|
|
8
8
|
import { Calendar, CalendarDate, CalendarDateTime, DateDuration, DateFormatter, ZonedDateTime } from "@internationalized/date";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/date-picker/date-picker.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "label" | "control" | "trigger" | "input" | "nextTrigger" | "prevTrigger" | "table" | "view" | "clearTrigger" | "positioner" | "monthSelect" | "presetTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewControl" | "viewTrigger" | "yearSelect">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/date-picker/date-picker.types.d.ts
|
|
14
14
|
type DateView = "day" | "month" | "year";
|
|
@@ -8,7 +8,7 @@ import { p as PositioningOptions, u as Placement } from "../../index-fMh0VDkR.mj
|
|
|
8
8
|
import { Calendar, CalendarDate, CalendarDateTime, DateDuration, DateFormatter, ZonedDateTime } from "@internationalized/date";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/date-picker/date-picker.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "content" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "label" | "control" | "trigger" | "input" | "nextTrigger" | "prevTrigger" | "table" | "view" | "clearTrigger" | "positioner" | "monthSelect" | "presetTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewControl" | "viewTrigger" | "yearSelect">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/date-picker/date-picker.types.d.ts
|
|
14
14
|
type DateView = "day" | "month" | "year";
|
|
@@ -5,7 +5,7 @@ import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOuts
|
|
|
5
5
|
import { r as PersistentElementOptions, t as DismissableElementHandlers } from "../../dismissable-layer-ZgyqN8AD.cjs";
|
|
6
6
|
|
|
7
7
|
//#region src/machines/dialog/dialog.anatomy.d.ts
|
|
8
|
-
declare const anatomy: AnatomyInstance<"content" | "trigger" | "
|
|
8
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "title" | "positioner" | "closeTrigger" | "description" | "backdrop">;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/machines/dialog/dialog.types.d.ts
|
|
11
11
|
interface OpenChangeDetails {
|
|
@@ -5,7 +5,7 @@ import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOuts
|
|
|
5
5
|
import { r as PersistentElementOptions, t as DismissableElementHandlers } from "../../dismissable-layer-h14gHVbJ.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/machines/dialog/dialog.anatomy.d.ts
|
|
8
|
-
declare const anatomy: AnatomyInstance<"content" | "trigger" | "
|
|
8
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "title" | "positioner" | "closeTrigger" | "description" | "backdrop">;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/machines/dialog/dialog.types.d.ts
|
|
11
11
|
interface OpenChangeDetails {
|
|
@@ -10,23 +10,23 @@ const require_dismissable = require("../../dismissable-ChwcJMHk.cjs");
|
|
|
10
10
|
const require_focus_trap = require("../../focus-trap-fucc6OU_.cjs");
|
|
11
11
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
12
12
|
const require_remove_scroll = require("../../remove-scroll-D9FAOapi.cjs");
|
|
13
|
-
//#region src/machines/
|
|
14
|
-
const anatomy = require_create_anatomy.createAnatomy("
|
|
13
|
+
//#region src/machines/drawer/drawer.anatomy.ts
|
|
14
|
+
const anatomy = require_create_anatomy.createAnatomy("drawer").parts("content", "title", "trigger", "backdrop", "grabber", "grabberIndicator", "closeTrigger");
|
|
15
15
|
const parts = anatomy.build();
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region src/machines/
|
|
18
|
-
const getContentId = (ctx) => ctx.ids?.content ?? `
|
|
19
|
-
const getTitleId = (ctx) => ctx.ids?.title ?? `
|
|
20
|
-
const getTriggerId = (ctx) => ctx.ids?.trigger ?? `
|
|
21
|
-
const getBackdropId = (ctx) => ctx.ids?.backdrop ?? `
|
|
22
|
-
const getGrabberId = (ctx) => ctx.ids?.grabber ?? `
|
|
23
|
-
const getGrabberIndicatorId = (ctx) => ctx.ids?.grabberIndicator ?? `
|
|
24
|
-
const getCloseTriggerId = (ctx) => ctx.ids?.closeTrigger ?? `
|
|
17
|
+
//#region src/machines/drawer/drawer.dom.ts
|
|
18
|
+
const getContentId = (ctx) => ctx.ids?.content ?? `drawer:${ctx.id}:content`;
|
|
19
|
+
const getTitleId = (ctx) => ctx.ids?.title ?? `drawer:${ctx.id}:title`;
|
|
20
|
+
const getTriggerId = (ctx) => ctx.ids?.trigger ?? `drawer:${ctx.id}:trigger`;
|
|
21
|
+
const getBackdropId = (ctx) => ctx.ids?.backdrop ?? `drawer:${ctx.id}:backdrop`;
|
|
22
|
+
const getGrabberId = (ctx) => ctx.ids?.grabber ?? `drawer:${ctx.id}:grabber`;
|
|
23
|
+
const getGrabberIndicatorId = (ctx) => ctx.ids?.grabberIndicator ?? `drawer:${ctx.id}:grabber-indicator`;
|
|
24
|
+
const getCloseTriggerId = (ctx) => ctx.ids?.closeTrigger ?? `drawer:${ctx.id}:close-trigger`;
|
|
25
25
|
const getContentEl = (ctx) => ctx.getById(getContentId(ctx));
|
|
26
26
|
const getTriggerEl = (ctx) => ctx.getById(getTriggerId(ctx));
|
|
27
27
|
const getCloseTriggerEl = (ctx) => ctx.getById(getCloseTriggerId(ctx));
|
|
28
28
|
//#endregion
|
|
29
|
-
//#region src/machines/
|
|
29
|
+
//#region src/machines/drawer/drawer.connect.ts
|
|
30
30
|
function connect(service, normalize) {
|
|
31
31
|
const { state, send, context, scope, prop } = service;
|
|
32
32
|
const open = state.hasTag("open");
|
|
@@ -86,9 +86,9 @@ function connect(service, normalize) {
|
|
|
86
86
|
hidden: !open,
|
|
87
87
|
"data-state": open ? "open" : "closed",
|
|
88
88
|
style: {
|
|
89
|
-
transform: "translate3d(0, var(--
|
|
89
|
+
transform: "translate3d(0, var(--drawer-translate, 0), 0)",
|
|
90
90
|
transitionDuration: dragging ? "0s" : void 0,
|
|
91
|
-
"--
|
|
91
|
+
"--drawer-translate": require_utils.toPx(translate),
|
|
92
92
|
willChange: "transform"
|
|
93
93
|
},
|
|
94
94
|
onPointerDown(event) {
|
|
@@ -151,7 +151,7 @@ function connect(service, normalize) {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
-
//#region src/machines/
|
|
154
|
+
//#region src/machines/drawer/utils/find-closest-snap-point.ts
|
|
155
155
|
function findClosestSnapPoint(offset, snapPoints) {
|
|
156
156
|
return snapPoints.reduce((acc, curr) => {
|
|
157
157
|
const closestDiff = Math.abs(offset - acc.offset);
|
|
@@ -159,7 +159,7 @@ function findClosestSnapPoint(offset, snapPoints) {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region src/machines/
|
|
162
|
+
//#region src/machines/drawer/utils/get-scroll-info.ts
|
|
163
163
|
function isScrollContainer(element) {
|
|
164
164
|
const overflow = getComputedStyle(element).overflowY;
|
|
165
165
|
return overflow === "auto" || overflow === "scroll";
|
|
@@ -184,7 +184,7 @@ function getScrollInfo(target, container) {
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
//#endregion
|
|
187
|
-
//#region src/machines/
|
|
187
|
+
//#region src/machines/drawer/utils/drag-manager.ts
|
|
188
188
|
const DRAG_START_THRESHOLD = .3;
|
|
189
189
|
var DragManager = class {
|
|
190
190
|
constructor() {
|
|
@@ -266,7 +266,7 @@ var DragManager = class {
|
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
//#endregion
|
|
269
|
-
//#region src/machines/
|
|
269
|
+
//#region src/machines/drawer/utils/resolve-snap-point.ts
|
|
270
270
|
function resolveSnapPoint(snapPoint, containerHeight) {
|
|
271
271
|
if (typeof snapPoint === "number") return {
|
|
272
272
|
value: snapPoint,
|
|
@@ -279,7 +279,7 @@ function resolveSnapPoint(snapPoint, containerHeight) {
|
|
|
279
279
|
throw new Error(`Invalid snap point: ${snapPoint}`);
|
|
280
280
|
}
|
|
281
281
|
//#endregion
|
|
282
|
-
//#region src/machines/
|
|
282
|
+
//#region src/machines/drawer/drawer.machine.ts
|
|
283
283
|
const machine = require_core.createMachine({
|
|
284
284
|
props({ props, scope }) {
|
|
285
285
|
const initialFocusEl = props.role === "alertdialog" ? () => getCloseTriggerEl(scope) : void 0;
|
|
@@ -627,7 +627,7 @@ const machine = require_core.createMachine({
|
|
|
627
627
|
}
|
|
628
628
|
});
|
|
629
629
|
//#endregion
|
|
630
|
-
//#region src/machines/
|
|
630
|
+
//#region src/machines/drawer/drawer.props.ts
|
|
631
631
|
const props = require_create_props.createProps()([
|
|
632
632
|
"id",
|
|
633
633
|
"ids",
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { n as AnatomyInstance } from "../../create-anatomy-9eFQs7lO.cjs";
|
|
2
|
+
import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMTKq.cjs";
|
|
3
|
+
import { b as NormalizeProps, g as RequiredBy, p as Point, r as DirectionProperty, s as MaybeElement, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
|
+
import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-DzWGFhcS.cjs";
|
|
5
|
+
import { t as DismissableElementHandlers } from "../../dismissable-layer-ZgyqN8AD.cjs";
|
|
6
|
+
|
|
7
|
+
//#region src/machines/drawer/drawer.anatomy.d.ts
|
|
8
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "title" | "closeTrigger" | "backdrop" | "grabber" | "grabberIndicator">;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/machines/drawer/utils/drag-manager.d.ts
|
|
11
|
+
declare class DragManager {
|
|
12
|
+
private pointerStart;
|
|
13
|
+
private dragOffset;
|
|
14
|
+
private lastPoint;
|
|
15
|
+
private lastTimestamp;
|
|
16
|
+
private velocity;
|
|
17
|
+
setPointerStart(point: Point): void;
|
|
18
|
+
clearPointerStart(): void;
|
|
19
|
+
getPointerStart(): Point | null;
|
|
20
|
+
setDragOffset(point: Point, resolvedActiveSnapPointOffset: number): void;
|
|
21
|
+
getDragOffset(): number | null;
|
|
22
|
+
clearDragOffset(): void;
|
|
23
|
+
getVelocity(): number | null;
|
|
24
|
+
clearVelocityTracking(): void;
|
|
25
|
+
clear(): void;
|
|
26
|
+
shouldStartDragging(point: Point, target: HTMLElement, container: HTMLElement | null, preventDragOnScroll: boolean): boolean;
|
|
27
|
+
findClosestSnapPoint(snapPoints: ResolvedSnapPoint[]): number | string;
|
|
28
|
+
shouldDismiss(contentHeight: number | null, snapPoints: ResolvedSnapPoint[], swipeVelocityThreshold: number, closeThreshold: number): boolean;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/machines/drawer/drawer.types.d.ts
|
|
32
|
+
interface OpenChangeDetails {
|
|
33
|
+
open: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface ResolvedSnapPoint {
|
|
36
|
+
value: number | string;
|
|
37
|
+
offset: number;
|
|
38
|
+
}
|
|
39
|
+
interface SnapPointChangeDetails {
|
|
40
|
+
snapPoint: number | string;
|
|
41
|
+
}
|
|
42
|
+
type ElementIds = Partial<{
|
|
43
|
+
backdrop: string;
|
|
44
|
+
content: string;
|
|
45
|
+
trigger: string;
|
|
46
|
+
grabber: string;
|
|
47
|
+
grabberIndicator: string;
|
|
48
|
+
closeTrigger: string;
|
|
49
|
+
}>;
|
|
50
|
+
interface DrawerProps extends DirectionProperty, CommonProperties, DismissableElementHandlers {
|
|
51
|
+
ids?: ElementIds;
|
|
52
|
+
trapFocus?: boolean | undefined;
|
|
53
|
+
preventScroll?: boolean | undefined;
|
|
54
|
+
modal?: boolean | undefined;
|
|
55
|
+
initialFocusEl?: (() => MaybeElement) | undefined;
|
|
56
|
+
finalFocusEl?: (() => MaybeElement) | undefined;
|
|
57
|
+
restoreFocus?: boolean | undefined;
|
|
58
|
+
role?: "dialog" | "alertdialog" | undefined;
|
|
59
|
+
open?: boolean | undefined;
|
|
60
|
+
defaultOpen?: boolean | undefined;
|
|
61
|
+
onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
|
|
62
|
+
closeOnInteractOutside?: boolean | undefined;
|
|
63
|
+
closeOnEscape?: boolean | undefined;
|
|
64
|
+
snapPoints?: (number | string)[] | undefined;
|
|
65
|
+
swipeVelocityThreshold?: number;
|
|
66
|
+
closeThreshold?: number;
|
|
67
|
+
preventDragOnScroll?: boolean;
|
|
68
|
+
activeSnapPoint?: number | string | undefined;
|
|
69
|
+
defaultActiveSnapPoint?: number | string | undefined;
|
|
70
|
+
onActiveSnapPointChange?: ((details: SnapPointChangeDetails) => void) | undefined;
|
|
71
|
+
}
|
|
72
|
+
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "trapFocus" | "restoreFocus" | "preventScroll" | "initialFocusEl" | "snapPoints" | "swipeVelocityThreshold" | "closeThreshold" | "preventDragOnScroll" | "defaultActiveSnapPoint";
|
|
73
|
+
interface DrawerSchema {
|
|
74
|
+
props: RequiredBy<DrawerProps, PropsWithDefault>;
|
|
75
|
+
state: "open" | "closed" | "closing";
|
|
76
|
+
tag: "open" | "closed";
|
|
77
|
+
context: {
|
|
78
|
+
dragOffset: number | null;
|
|
79
|
+
activeSnapPoint: number | string;
|
|
80
|
+
resolvedActiveSnapPoint: ResolvedSnapPoint | null;
|
|
81
|
+
contentHeight: number | null;
|
|
82
|
+
};
|
|
83
|
+
refs: {
|
|
84
|
+
dragManager: DragManager;
|
|
85
|
+
};
|
|
86
|
+
computed: {
|
|
87
|
+
resolvedSnapPoints: ResolvedSnapPoint[];
|
|
88
|
+
};
|
|
89
|
+
event: EventObject;
|
|
90
|
+
action: string;
|
|
91
|
+
guard: string;
|
|
92
|
+
effect: string;
|
|
93
|
+
}
|
|
94
|
+
type DrawerService = Service<DrawerSchema>;
|
|
95
|
+
type DrawerMachine = Machine<DrawerSchema>;
|
|
96
|
+
interface ContentProps {
|
|
97
|
+
draggable?: boolean | undefined;
|
|
98
|
+
}
|
|
99
|
+
interface DrawerApi<T extends PropTypes = PropTypes> {
|
|
100
|
+
open: boolean;
|
|
101
|
+
dragging: boolean;
|
|
102
|
+
setOpen: (open: boolean) => void;
|
|
103
|
+
snapPoints: (number | string)[];
|
|
104
|
+
activeSnapPoint: number | string;
|
|
105
|
+
setActiveSnapPoint: (snapPoint: number | string) => void;
|
|
106
|
+
getOpenPercentage: () => number;
|
|
107
|
+
getActiveSnapIndex: () => number;
|
|
108
|
+
getContentHeight: () => number | null;
|
|
109
|
+
getContentProps: (props?: ContentProps) => T["element"];
|
|
110
|
+
getTitleProps: () => T["element"];
|
|
111
|
+
getTriggerProps: () => T["element"];
|
|
112
|
+
getBackdropProps: () => T["element"];
|
|
113
|
+
getGrabberProps: () => T["element"];
|
|
114
|
+
getGrabberIndicatorProps: () => T["element"];
|
|
115
|
+
getCloseTriggerProps: () => T["element"];
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/machines/drawer/drawer.connect.d.ts
|
|
119
|
+
declare function connect<T extends PropTypes>(service: DrawerService, normalize: NormalizeProps<T>): DrawerApi<T>;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/machines/drawer/drawer.machine.d.ts
|
|
122
|
+
declare const machine: Machine<DrawerSchema>;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/machines/drawer/drawer.props.d.ts
|
|
125
|
+
declare const props: (keyof DrawerProps)[];
|
|
126
|
+
declare const splitProps: <Props extends Partial<DrawerProps>>(props: Props) => [Partial<DrawerProps>, Omit<Props, keyof DrawerProps>];
|
|
127
|
+
//#endregion
|
|
128
|
+
export { type DrawerApi as Api, type ContentProps, type ElementIds, type FocusOutsideEvent, type InteractOutsideEvent, type DrawerMachine as Machine, type OpenChangeDetails, type PointerDownOutsideEvent, type DrawerProps as Props, type ResolvedSnapPoint, type DrawerService as Service, type SnapPointChangeDetails, anatomy, connect, machine, props, splitProps };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
|
|
2
|
+
import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rzfD.mjs";
|
|
3
|
+
import { b as NormalizeProps, g as RequiredBy, p as Point, r as DirectionProperty, s as MaybeElement, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
|
+
import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-CGNNiDyE.mjs";
|
|
5
|
+
import { t as DismissableElementHandlers } from "../../dismissable-layer-h14gHVbJ.mjs";
|
|
6
|
+
|
|
7
|
+
//#region src/machines/drawer/drawer.anatomy.d.ts
|
|
8
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "title" | "closeTrigger" | "backdrop" | "grabber" | "grabberIndicator">;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/machines/drawer/utils/drag-manager.d.ts
|
|
11
|
+
declare class DragManager {
|
|
12
|
+
private pointerStart;
|
|
13
|
+
private dragOffset;
|
|
14
|
+
private lastPoint;
|
|
15
|
+
private lastTimestamp;
|
|
16
|
+
private velocity;
|
|
17
|
+
setPointerStart(point: Point): void;
|
|
18
|
+
clearPointerStart(): void;
|
|
19
|
+
getPointerStart(): Point | null;
|
|
20
|
+
setDragOffset(point: Point, resolvedActiveSnapPointOffset: number): void;
|
|
21
|
+
getDragOffset(): number | null;
|
|
22
|
+
clearDragOffset(): void;
|
|
23
|
+
getVelocity(): number | null;
|
|
24
|
+
clearVelocityTracking(): void;
|
|
25
|
+
clear(): void;
|
|
26
|
+
shouldStartDragging(point: Point, target: HTMLElement, container: HTMLElement | null, preventDragOnScroll: boolean): boolean;
|
|
27
|
+
findClosestSnapPoint(snapPoints: ResolvedSnapPoint[]): number | string;
|
|
28
|
+
shouldDismiss(contentHeight: number | null, snapPoints: ResolvedSnapPoint[], swipeVelocityThreshold: number, closeThreshold: number): boolean;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/machines/drawer/drawer.types.d.ts
|
|
32
|
+
interface OpenChangeDetails {
|
|
33
|
+
open: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface ResolvedSnapPoint {
|
|
36
|
+
value: number | string;
|
|
37
|
+
offset: number;
|
|
38
|
+
}
|
|
39
|
+
interface SnapPointChangeDetails {
|
|
40
|
+
snapPoint: number | string;
|
|
41
|
+
}
|
|
42
|
+
type ElementIds = Partial<{
|
|
43
|
+
backdrop: string;
|
|
44
|
+
content: string;
|
|
45
|
+
trigger: string;
|
|
46
|
+
grabber: string;
|
|
47
|
+
grabberIndicator: string;
|
|
48
|
+
closeTrigger: string;
|
|
49
|
+
}>;
|
|
50
|
+
interface DrawerProps extends DirectionProperty, CommonProperties, DismissableElementHandlers {
|
|
51
|
+
ids?: ElementIds;
|
|
52
|
+
trapFocus?: boolean | undefined;
|
|
53
|
+
preventScroll?: boolean | undefined;
|
|
54
|
+
modal?: boolean | undefined;
|
|
55
|
+
initialFocusEl?: (() => MaybeElement) | undefined;
|
|
56
|
+
finalFocusEl?: (() => MaybeElement) | undefined;
|
|
57
|
+
restoreFocus?: boolean | undefined;
|
|
58
|
+
role?: "dialog" | "alertdialog" | undefined;
|
|
59
|
+
open?: boolean | undefined;
|
|
60
|
+
defaultOpen?: boolean | undefined;
|
|
61
|
+
onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
|
|
62
|
+
closeOnInteractOutside?: boolean | undefined;
|
|
63
|
+
closeOnEscape?: boolean | undefined;
|
|
64
|
+
snapPoints?: (number | string)[] | undefined;
|
|
65
|
+
swipeVelocityThreshold?: number;
|
|
66
|
+
closeThreshold?: number;
|
|
67
|
+
preventDragOnScroll?: boolean;
|
|
68
|
+
activeSnapPoint?: number | string | undefined;
|
|
69
|
+
defaultActiveSnapPoint?: number | string | undefined;
|
|
70
|
+
onActiveSnapPointChange?: ((details: SnapPointChangeDetails) => void) | undefined;
|
|
71
|
+
}
|
|
72
|
+
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "trapFocus" | "restoreFocus" | "preventScroll" | "initialFocusEl" | "snapPoints" | "swipeVelocityThreshold" | "closeThreshold" | "preventDragOnScroll" | "defaultActiveSnapPoint";
|
|
73
|
+
interface DrawerSchema {
|
|
74
|
+
props: RequiredBy<DrawerProps, PropsWithDefault>;
|
|
75
|
+
state: "open" | "closed" | "closing";
|
|
76
|
+
tag: "open" | "closed";
|
|
77
|
+
context: {
|
|
78
|
+
dragOffset: number | null;
|
|
79
|
+
activeSnapPoint: number | string;
|
|
80
|
+
resolvedActiveSnapPoint: ResolvedSnapPoint | null;
|
|
81
|
+
contentHeight: number | null;
|
|
82
|
+
};
|
|
83
|
+
refs: {
|
|
84
|
+
dragManager: DragManager;
|
|
85
|
+
};
|
|
86
|
+
computed: {
|
|
87
|
+
resolvedSnapPoints: ResolvedSnapPoint[];
|
|
88
|
+
};
|
|
89
|
+
event: EventObject;
|
|
90
|
+
action: string;
|
|
91
|
+
guard: string;
|
|
92
|
+
effect: string;
|
|
93
|
+
}
|
|
94
|
+
type DrawerService = Service<DrawerSchema>;
|
|
95
|
+
type DrawerMachine = Machine<DrawerSchema>;
|
|
96
|
+
interface ContentProps {
|
|
97
|
+
draggable?: boolean | undefined;
|
|
98
|
+
}
|
|
99
|
+
interface DrawerApi<T extends PropTypes = PropTypes> {
|
|
100
|
+
open: boolean;
|
|
101
|
+
dragging: boolean;
|
|
102
|
+
setOpen: (open: boolean) => void;
|
|
103
|
+
snapPoints: (number | string)[];
|
|
104
|
+
activeSnapPoint: number | string;
|
|
105
|
+
setActiveSnapPoint: (snapPoint: number | string) => void;
|
|
106
|
+
getOpenPercentage: () => number;
|
|
107
|
+
getActiveSnapIndex: () => number;
|
|
108
|
+
getContentHeight: () => number | null;
|
|
109
|
+
getContentProps: (props?: ContentProps) => T["element"];
|
|
110
|
+
getTitleProps: () => T["element"];
|
|
111
|
+
getTriggerProps: () => T["element"];
|
|
112
|
+
getBackdropProps: () => T["element"];
|
|
113
|
+
getGrabberProps: () => T["element"];
|
|
114
|
+
getGrabberIndicatorProps: () => T["element"];
|
|
115
|
+
getCloseTriggerProps: () => T["element"];
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/machines/drawer/drawer.connect.d.ts
|
|
119
|
+
declare function connect<T extends PropTypes>(service: DrawerService, normalize: NormalizeProps<T>): DrawerApi<T>;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/machines/drawer/drawer.machine.d.ts
|
|
122
|
+
declare const machine: Machine<DrawerSchema>;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/machines/drawer/drawer.props.d.ts
|
|
125
|
+
declare const props: (keyof DrawerProps)[];
|
|
126
|
+
declare const splitProps: <Props extends Partial<DrawerProps>>(props: Props) => [Partial<DrawerProps>, Omit<Props, keyof DrawerProps>];
|
|
127
|
+
//#endregion
|
|
128
|
+
export { type DrawerApi as Api, type ContentProps, type ElementIds, type FocusOutsideEvent, type InteractOutsideEvent, type DrawerMachine as Machine, type OpenChangeDetails, type PointerDownOutsideEvent, type DrawerProps as Props, type ResolvedSnapPoint, type DrawerService as Service, type SnapPointChangeDetails, anatomy, connect, machine, props, splitProps };
|