@pathscale/ui 1.1.44 → 1.1.46
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/components/accordion/Accordion.js +44 -44
- package/dist/components/accordion/index.js +2 -9
- package/dist/components/alert/Alert.js +30 -30
- package/dist/components/alert/index.js +2 -8
- package/dist/components/avatar/Avatar.js +27 -27
- package/dist/components/avatar/AvatarGroup.js +11 -11
- package/dist/components/avatar/index.js +2 -6
- package/dist/components/badge/Badge.js +19 -19
- package/dist/components/badge/index.js +6 -9
- package/dist/components/breadcrumbs/Breadcrumbs.js +25 -25
- package/dist/components/breadcrumbs/index.js +2 -5
- package/dist/components/button/Button.js +22 -22
- package/dist/components/button/index.js +2 -3
- package/dist/components/button-group/ButtonGroup.js +14 -14
- package/dist/components/button-group/context.js +2 -2
- package/dist/components/button-group/index.js +2 -6
- package/dist/components/calendar/Calendar.js +85 -85
- package/dist/components/calendar/index.js +2 -3
- package/dist/components/card/Card.js +21 -21
- package/dist/components/card/index.js +2 -8
- package/dist/components/chatbubble/ChatBubble.js +19 -19
- package/dist/components/chatbubble/ChatBubbleAvatar.js +8 -8
- package/dist/components/chatbubble/ChatBubbleFooter.js +11 -11
- package/dist/components/chatbubble/ChatBubbleHeader.js +8 -8
- package/dist/components/chatbubble/ChatBubbleMessage.js +12 -12
- package/dist/components/chatbubble/ChatBubbleTime.js +11 -11
- package/dist/components/chatbubble/index.js +2 -3
- package/dist/components/checkbox/Checkbox.js +29 -29
- package/dist/components/checkbox/index.js +2 -3
- package/dist/components/checkbox-group/CheckboxGroup.js +16 -16
- package/dist/components/checkbox-group/context.js +2 -2
- package/dist/components/checkbox-group/index.js +3 -4
- package/dist/components/chip/Chip.js +32 -32
- package/dist/components/chip/index.js +5 -7
- package/dist/components/close-button/CloseButton.js +22 -22
- package/dist/components/close-button/index.js +2 -3
- package/dist/components/color-area/ColorArea.js +13 -13
- package/dist/components/color-area/index.js +2 -2
- package/dist/components/color-field/ColorField.js +23 -23
- package/dist/components/color-field/index.js +2 -2
- package/dist/components/color-picker/ColorPicker.js +44 -44
- package/dist/components/color-picker/index.js +2 -8
- package/dist/components/color-slider/ColorSlider.js +21 -21
- package/dist/components/color-slider/index.js +2 -2
- package/dist/components/color-swatch/ColorSwatch.js +14 -14
- package/dist/components/color-swatch/index.js +2 -2
- package/dist/components/color-swatch-picker/ColorSwatchPicker.js +14 -14
- package/dist/components/color-swatch-picker/index.js +2 -5
- package/dist/components/color-wheel-flower/ColorWheelFlower.js +83 -83
- package/dist/components/color-wheel-flower/colorWheelFlowerContext.js +3 -3
- package/dist/components/color-wheel-flower/index.js +3 -6
- package/dist/components/combo-box/ComboBox.js +90 -90
- package/dist/components/combo-box/index.js +2 -10
- package/dist/components/date-field/DateField.js +41 -41
- package/dist/components/date-field/index.js +2 -11
- package/dist/components/date-picker/DatePicker.js +40 -40
- package/dist/components/date-picker/index.js +2 -3
- package/dist/components/date-range-picker/DateRangePicker.js +55 -55
- package/dist/components/date-range-picker/index.js +2 -3
- package/dist/components/description/Description.js +9 -9
- package/dist/components/description/index.js +2 -5
- package/dist/components/disclosure/Disclosure.js +40 -40
- package/dist/components/disclosure/index.js +3 -9
- package/dist/components/disclosure-group/DisclosureGroup.js +13 -13
- package/dist/components/disclosure-group/index.js +4 -6
- package/dist/components/disclosure-group/useDisclosureGroupNavigation.js +4 -4
- package/dist/components/drawer/Drawer.css +39 -0
- package/dist/components/drawer/Drawer.d.ts +6 -0
- package/dist/components/drawer/Drawer.js +101 -80
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.js +2 -15
- package/dist/components/dropdown/Dropdown.js +60 -60
- package/dist/components/dropdown/index.js +2 -4
- package/dist/components/empty-state/EmptyState.js +25 -25
- package/dist/components/empty-state/index.js +2 -8
- package/dist/components/error-message/ErrorMessage.js +12 -12
- package/dist/components/error-message/index.js +2 -5
- package/dist/components/field-error/FieldError.js +16 -16
- package/dist/components/field-error/index.js +2 -5
- package/dist/components/fieldset/Fieldset.js +21 -21
- package/dist/components/fieldset/index.js +2 -8
- package/dist/components/flex/Flex.js +14 -14
- package/dist/components/flex/index.js +2 -3
- package/dist/components/floating-dock/FloatingDock.js +76 -76
- package/dist/components/floating-dock/index.js +2 -3
- package/dist/components/footer/Footer.js +11 -11
- package/dist/components/footer/FooterTitle.js +9 -9
- package/dist/components/footer/index.js +2 -3
- package/dist/components/form/Form.js +8 -8
- package/dist/components/form/index.js +2 -5
- package/dist/components/glass-panel/GlassPanel.js +29 -29
- package/dist/components/glass-panel/index.js +2 -3
- package/dist/components/glow-card/GlowCard.js +10 -10
- package/dist/components/glow-card/index.js +2 -3
- package/dist/components/grid/Grid.js +15 -15
- package/dist/components/grid/index.js +2 -3
- package/dist/components/header/Header.js +12 -12
- package/dist/components/header/index.js +2 -5
- package/dist/components/icon/Icon.js +8 -8
- package/dist/components/icon/index.js +2 -3
- package/dist/components/immersive-landing/ImmersiveLanding.js +44 -44
- package/dist/components/immersive-landing/ImmersiveLandingArrows.js +17 -17
- package/dist/components/immersive-landing/ImmersiveLandingContext.js +3 -3
- package/dist/components/immersive-landing/ImmersiveLandingNavigation.js +36 -36
- package/dist/components/immersive-landing/ImmersiveLandingPage.js +15 -15
- package/dist/components/immersive-landing/components/CookieConsent.js +71 -71
- package/dist/components/immersive-landing/components/FirefoxPWABanner.js +42 -42
- package/dist/components/immersive-landing/components/PWAInstallPrompt.js +40 -40
- package/dist/components/immersive-landing/index.js +7 -14
- package/dist/components/immersive-landing/useImmersiveLanding.js +7 -7
- package/dist/components/input/Input.js +48 -48
- package/dist/components/input/index.js +2 -2
- package/dist/components/input-group/InputGroup.js +33 -33
- package/dist/components/input-group/index.js +2 -9
- package/dist/components/input-otp/InputOTP.js +48 -48
- package/dist/components/input-otp/index.js +2 -11
- package/dist/components/join/Join.js +14 -14
- package/dist/components/join/index.js +2 -3
- package/dist/components/kbd/Kbd.js +20 -20
- package/dist/components/kbd/index.js +2 -8
- package/dist/components/label/Label.js +9 -9
- package/dist/components/label/index.js +2 -5
- package/dist/components/language-switcher/LanguageSwitcher.js +26 -26
- package/dist/components/language-switcher/createI18n.js +8 -8
- package/dist/components/language-switcher/index.js +3 -8
- package/dist/components/link/Link.js +22 -22
- package/dist/components/link/index.js +2 -5
- package/dist/components/list-box/ListBox.js +17 -17
- package/dist/components/list-box/ListBoxItem.js +32 -32
- package/dist/components/list-box/ListBoxSection.js +13 -13
- package/dist/components/list-box/context.js +2 -2
- package/dist/components/list-box/index.js +9 -15
- package/dist/components/live-chat/LiveChatBubble.js +27 -27
- package/dist/components/live-chat/LiveChatPanel.js +62 -62
- package/dist/components/live-chat/index.js +3 -5
- package/dist/components/menu/Menu.js +25 -30
- package/dist/components/menu/MenuItem.js +38 -38
- package/dist/components/menu/MenuSection.js +13 -13
- package/dist/components/menu/context.js +2 -2
- package/dist/components/menu/index.js +3 -12
- package/dist/components/meter/Meter.js +31 -31
- package/dist/components/meter/index.js +2 -8
- package/dist/components/modal/Modal.js +80 -80
- package/dist/components/modal/index.js +2 -13
- package/dist/components/navbar/Navbar.js +18 -18
- package/dist/components/navbar/NavbarRow.js +10 -10
- package/dist/components/navbar/NavbarSection.js +9 -9
- package/dist/components/navbar/NavbarStack.js +10 -10
- package/dist/components/navbar/index.js +2 -3
- package/dist/components/noise-background/NoiseBackground.js +35 -35
- package/dist/components/noise-background/index.js +2 -3
- package/dist/components/number-field/NumberField.js +42 -42
- package/dist/components/number-field/index.js +2 -9
- package/dist/components/pagination/Pagination.js +34 -34
- package/dist/components/pagination/index.js +2 -3
- package/dist/components/popover/Popover.js +44 -44
- package/dist/components/popover/index.js +3 -9
- package/dist/components/progress-bar/ProgressBar.js +27 -27
- package/dist/components/progress-bar/index.js +2 -3
- package/dist/components/progress-circle/ProgressCircle.js +32 -32
- package/dist/components/progress-circle/index.js +2 -3
- package/dist/components/radio/Radio.js +27 -27
- package/dist/components/radio/index.js +2 -3
- package/dist/components/radio-group/RadioGroup.js +33 -33
- package/dist/components/radio-group/context.js +2 -2
- package/dist/components/radio-group/index.js +3 -4
- package/dist/components/range-calendar/RangeCalendar.js +15 -15
- package/dist/components/range-calendar/index.js +2 -3
- package/dist/components/scroll-shadow/ScrollShadow.js +19 -19
- package/dist/components/scroll-shadow/index.js +2 -3
- package/dist/components/scroll-shadow/useScrollShadow.js +3 -3
- package/dist/components/search-field/SearchField.js +38 -38
- package/dist/components/search-field/index.js +2 -9
- package/dist/components/select/Select.js +123 -123
- package/dist/components/select/index.js +2 -3
- package/dist/components/separator/Separator.js +11 -11
- package/dist/components/separator/index.js +2 -4
- package/dist/components/size-picker/SizePicker.js +17 -17
- package/dist/components/size-picker/index.js +3 -6
- package/dist/components/size-picker/sizeStore.js +3 -3
- package/dist/components/skeleton/Skeleton.js +8 -8
- package/dist/components/skeleton/index.js +2 -3
- package/dist/components/slider/Slider.js +26 -26
- package/dist/components/slider/index.js +2 -3
- package/dist/components/spinner/Spinner.js +19 -19
- package/dist/components/spinner/index.js +2 -5
- package/dist/components/surface/Surface.js +9 -9
- package/dist/components/surface/index.js +2 -4
- package/dist/components/table/Table.js +80 -80
- package/dist/components/table/index.js +3 -28
- package/dist/components/tabs/Tabs.js +59 -59
- package/dist/components/tabs/index.js +2 -4
- package/dist/components/tag/Tag.js +40 -40
- package/dist/components/tag/index.js +2 -6
- package/dist/components/tag-group/TagGroup.js +20 -20
- package/dist/components/tag-group/context.js +2 -2
- package/dist/components/tag-group/index.js +2 -6
- package/dist/components/text/Text.js +9 -9
- package/dist/components/text/index.js +2 -5
- package/dist/components/text-area/TextArea.js +10 -10
- package/dist/components/text-area/index.js +2 -5
- package/dist/components/text-field/TextField.js +15 -15
- package/dist/components/text-field/index.js +2 -7
- package/dist/components/textarea/Textarea.js +11 -13
- package/dist/components/textarea/index.js +2 -6
- package/dist/components/theme-color-picker/ThemeColorPicker.js +43 -43
- package/dist/components/theme-color-picker/hueShift.js +3 -3
- package/dist/components/theme-color-picker/index.js +3 -7
- package/dist/components/time-field/TimeField.js +41 -41
- package/dist/components/time-field/index.js +2 -11
- package/dist/components/toast/Toast.js +98 -98
- package/dist/components/toast/index.js +2 -19
- package/dist/components/toggle/Toggle.js +31 -31
- package/dist/components/toggle/index.js +2 -3
- package/dist/components/toolbar/Toolbar.js +10 -10
- package/dist/components/toolbar/index.js +2 -5
- package/dist/components/tooltip/Tooltip.js +28 -28
- package/dist/components/tooltip/index.js +2 -7
- package/dist/components/utils.js +6 -7
- package/dist/components/video-preview/VideoPreview.js +15 -15
- package/dist/components/video-preview/index.js +2 -3
- package/dist/hooks/date/useCalendarNavigation.js +18 -18
- package/dist/hooks/date/useCalendarState.js +19 -19
- package/dist/hooks/date/useDateSelection.js +7 -7
- package/dist/hooks/date/usePickerOpenState.js +8 -8
- package/dist/hooks/date/useRangeSelection.js +16 -16
- package/dist/hooks/form/index.js +6 -12
- package/dist/hooks/form/useField.js +4 -4
- package/dist/hooks/form/useFieldError.js +2 -2
- package/dist/hooks/form/useFieldMeta.js +10 -10
- package/dist/hooks/form/useFieldProps.js +2 -2
- package/dist/hooks/form/useForm.js +4 -4
- package/dist/hooks/layout/index.js +2 -3
- package/dist/hooks/layout/useDesktop.js +4 -4
- package/dist/hooks/table/index.js +9 -18
- package/dist/hooks/table/useAnchoredOverlayPosition.js +4 -4
- package/dist/hooks/table/useTableExpansion.js +4 -4
- package/dist/hooks/table/useTableFiltering.js +8 -8
- package/dist/hooks/table/useTableModel.js +10 -10
- package/dist/hooks/table/useTablePagination.js +4 -4
- package/dist/hooks/table/useTableSelection.js +4 -4
- package/dist/hooks/table/useTableSorting.js +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +97 -366
- package/dist/lib/refs/index.js +2 -3
- package/dist/lib/refs/mergeRefs.js +2 -2
- package/dist/lib/style/index.js +2 -4
- package/dist/lib/tag/createIsButton.js +4 -4
- package/dist/lib/tag/createTagName.js +2 -2
- package/dist/lib/tag/index.js +3 -7
- package/dist/motion/engine.js +4 -4
- package/dist/motion/index.js +11 -34
- package/dist/motion/popmotion.js +2 -2
- package/dist/motion/presets.js +4 -4
- package/dist/motion/route.js +7 -7
- package/dist/motion/solid/MotionDiv.js +13 -13
- package/dist/motion/solid/index.js +2 -3
- package/dist/motion/system.js +9 -9
- package/dist/primitives/streaming/index.js +3 -5
- package/dist/primitives/streaming/useStreamingBuffer.js +2 -2
- package/dist/primitives/streaming/useStreamingSubscription.js +7 -7
- package/dist/primitives/virtualizer/index.js +2 -3
- package/dist/primitives/virtualizer/useVirtualRows.js +7 -7
- package/dist/purge-manifest.json +2287 -2287
- package/package.json +1 -1
|
@@ -150,6 +150,45 @@
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
/* -------------------------------------------------------------------------------------------------
|
|
154
|
+
* Dialog — semantic prop: custom size (width / maxWidth)
|
|
155
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
156
|
+
.drawer__dialog--custom-size {
|
|
157
|
+
width: var(--drawer-dialog-width, 20rem);
|
|
158
|
+
max-width: var(--drawer-dialog-max-width, 85vw);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (min-width: 640px) {
|
|
162
|
+
.drawer__dialog--custom-size {
|
|
163
|
+
width: var(--drawer-dialog-width, 24rem);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* -------------------------------------------------------------------------------------------------
|
|
168
|
+
* Dialog — semantic prop: custom padding
|
|
169
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
170
|
+
.drawer__dialog--custom-padding {
|
|
171
|
+
padding: var(--drawer-dialog-padding);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* -------------------------------------------------------------------------------------------------
|
|
175
|
+
* Dialog — semantic prop: side (border indicator)
|
|
176
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
177
|
+
.drawer__dialog--side-left {
|
|
178
|
+
border-right: 1px solid color-mix(in oklab, var(--color-base-content) 10%, transparent);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.drawer__dialog--side-right {
|
|
182
|
+
border-left: 1px solid color-mix(in oklab, var(--color-base-content) 10%, transparent);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* -------------------------------------------------------------------------------------------------
|
|
186
|
+
* Dialog — semantic prop: bg (any CSS color via custom property)
|
|
187
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
188
|
+
.drawer__dialog--custom-bg {
|
|
189
|
+
background-color: var(--drawer-dialog-bg, var(--color-base-100));
|
|
190
|
+
}
|
|
191
|
+
|
|
153
192
|
/* Slide transitions — open state */
|
|
154
193
|
.drawer__content--left .drawer__dialog,
|
|
155
194
|
.drawer__content--right .drawer__dialog,
|
|
@@ -21,8 +21,14 @@ export type DrawerContentProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "child
|
|
|
21
21
|
children: JSX.Element;
|
|
22
22
|
placement?: DrawerPlacement;
|
|
23
23
|
};
|
|
24
|
+
export type DrawerDialogSide = "left" | "right";
|
|
24
25
|
export type DrawerDialogProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
25
26
|
children: JSX.Element;
|
|
27
|
+
side?: DrawerDialogSide;
|
|
28
|
+
width?: string;
|
|
29
|
+
maxWidth?: string;
|
|
30
|
+
bg?: string;
|
|
31
|
+
padding?: string;
|
|
26
32
|
};
|
|
27
33
|
export type DrawerHeaderProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
28
34
|
children: JSX.Element;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Portal, createComponent, delegateEvents, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
2
2
|
import "./Drawer.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/
|
|
7
|
-
const DrawerContext =
|
|
3
|
+
import { Show, createContext, createEffect, createSignal, onCleanup, splitProps, useContext } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { CLASSES } from "./Drawer.classes.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template("<button>"), _tmpl$2 = /*#__PURE__*/ template("<div>"), _tmpl$3 = /*#__PURE__*/ template("<h2>"), _tmpl$4 = /*#__PURE__*/ template("<div><div data-slot=drawer-handle-bar>"), _tmpl$5 = /*#__PURE__*/ template("<span>"), _tmpl$6 = /*#__PURE__*/ template("<span data-slot=drawer-close>");
|
|
7
|
+
const DrawerContext = createContext();
|
|
8
8
|
const useDrawerContext = ()=>{
|
|
9
|
-
const ctx =
|
|
9
|
+
const ctx = useContext(DrawerContext);
|
|
10
10
|
if (!ctx) throw new Error("Drawer compound components must be used within <Drawer>");
|
|
11
11
|
return ctx;
|
|
12
12
|
};
|
|
13
13
|
const DrawerRoot = (props)=>{
|
|
14
|
-
const [local, _others] =
|
|
14
|
+
const [local, _others] = splitProps(props, [
|
|
15
15
|
"children",
|
|
16
16
|
"isOpen",
|
|
17
17
|
"defaultOpen",
|
|
@@ -21,7 +21,7 @@ const DrawerRoot = (props)=>{
|
|
|
21
21
|
"className",
|
|
22
22
|
"style"
|
|
23
23
|
]);
|
|
24
|
-
const [internalOpen, setInternalOpen] =
|
|
24
|
+
const [internalOpen, setInternalOpen] = createSignal(Boolean(local.defaultOpen));
|
|
25
25
|
const isControlled = ()=>void 0 !== local.isOpen;
|
|
26
26
|
const isOpen = ()=>isControlled() ? Boolean(local.isOpen) : internalOpen();
|
|
27
27
|
const setIsOpen = (v)=>{
|
|
@@ -35,7 +35,7 @@ const DrawerRoot = (props)=>{
|
|
|
35
35
|
isDismissable: ()=>true,
|
|
36
36
|
animState: ()=>"closed"
|
|
37
37
|
};
|
|
38
|
-
return
|
|
38
|
+
return createComponent(DrawerContext.Provider, {
|
|
39
39
|
value: ctx,
|
|
40
40
|
get children () {
|
|
41
41
|
return local.children;
|
|
@@ -43,7 +43,7 @@ const DrawerRoot = (props)=>{
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
const DrawerTrigger = (props)=>{
|
|
46
|
-
const [local, others] =
|
|
46
|
+
const [local, others] = splitProps(props, [
|
|
47
47
|
"children",
|
|
48
48
|
"class",
|
|
49
49
|
"className",
|
|
@@ -58,10 +58,10 @@ const DrawerTrigger = (props)=>{
|
|
|
58
58
|
};
|
|
59
59
|
return (()=>{
|
|
60
60
|
var _el$ = _tmpl$();
|
|
61
|
-
|
|
61
|
+
spread(_el$, mergeProps(others, {
|
|
62
62
|
type: "button"
|
|
63
63
|
}, ()=>({
|
|
64
|
-
class:
|
|
64
|
+
class: twMerge(CLASSES.slot.trigger, local.class, local.className)
|
|
65
65
|
}), {
|
|
66
66
|
"data-slot": "drawer-trigger",
|
|
67
67
|
get ["data-theme"] () {
|
|
@@ -72,17 +72,17 @@ const DrawerTrigger = (props)=>{
|
|
|
72
72
|
},
|
|
73
73
|
onClick: handleClick
|
|
74
74
|
}), false, true);
|
|
75
|
-
|
|
75
|
+
insert(_el$, ()=>local.children);
|
|
76
76
|
return _el$;
|
|
77
77
|
})();
|
|
78
78
|
};
|
|
79
79
|
const BACKDROP_VARIANT_MAP = {
|
|
80
|
-
opaque:
|
|
81
|
-
blur:
|
|
82
|
-
transparent:
|
|
80
|
+
opaque: CLASSES.backdrop.opaque,
|
|
81
|
+
blur: CLASSES.backdrop.blur,
|
|
82
|
+
transparent: CLASSES.backdrop.transparent
|
|
83
83
|
};
|
|
84
84
|
const DrawerBackdrop = (props)=>{
|
|
85
|
-
const [local, others] =
|
|
85
|
+
const [local, others] = splitProps(props, [
|
|
86
86
|
"children",
|
|
87
87
|
"class",
|
|
88
88
|
"className",
|
|
@@ -95,8 +95,8 @@ const DrawerBackdrop = (props)=>{
|
|
|
95
95
|
const ctx = useDrawerContext();
|
|
96
96
|
const variant = ()=>local.variant ?? "opaque";
|
|
97
97
|
const isDismissable = ()=>false !== local.isDismissable;
|
|
98
|
-
const [animState, setAnimState] =
|
|
99
|
-
|
|
98
|
+
const [animState, setAnimState] = createSignal("closed");
|
|
99
|
+
createEffect(()=>{
|
|
100
100
|
if (ctx.isOpen()) {
|
|
101
101
|
setAnimState("entering");
|
|
102
102
|
requestAnimationFrame(()=>{
|
|
@@ -111,23 +111,23 @@ const DrawerBackdrop = (props)=>{
|
|
|
111
111
|
if (e.target === e.currentTarget && isDismissable()) ctx.setIsOpen(false);
|
|
112
112
|
if ("function" == typeof local.onClick) local.onClick(e);
|
|
113
113
|
};
|
|
114
|
-
|
|
114
|
+
createEffect(()=>{
|
|
115
115
|
const state = animState();
|
|
116
116
|
if ("entering" === state || "open" === state) {
|
|
117
117
|
const prev = document.body.style.overflow;
|
|
118
118
|
document.body.style.overflow = "hidden";
|
|
119
|
-
|
|
119
|
+
onCleanup(()=>{
|
|
120
120
|
document.body.style.overflow = prev;
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
createEffect(()=>{
|
|
125
125
|
if (!ctx.isOpen() || !isDismissable()) return;
|
|
126
126
|
const handler = (e)=>{
|
|
127
127
|
if ("Escape" === e.key) ctx.setIsOpen(false);
|
|
128
128
|
};
|
|
129
129
|
document.addEventListener("keydown", handler);
|
|
130
|
-
|
|
130
|
+
onCleanup(()=>document.removeEventListener("keydown", handler));
|
|
131
131
|
});
|
|
132
132
|
const updatedCtx = {
|
|
133
133
|
isOpen: ctx.isOpen,
|
|
@@ -136,19 +136,19 @@ const DrawerBackdrop = (props)=>{
|
|
|
136
136
|
isDismissable,
|
|
137
137
|
animState
|
|
138
138
|
};
|
|
139
|
-
return
|
|
139
|
+
return createComponent(Show, {
|
|
140
140
|
get when () {
|
|
141
141
|
return "closed" !== animState();
|
|
142
142
|
},
|
|
143
143
|
get children () {
|
|
144
|
-
return
|
|
144
|
+
return createComponent(Portal, {
|
|
145
145
|
get children () {
|
|
146
|
-
return
|
|
146
|
+
return createComponent(DrawerContext.Provider, {
|
|
147
147
|
value: updatedCtx,
|
|
148
148
|
get children () {
|
|
149
149
|
var _el$2 = _tmpl$2();
|
|
150
|
-
|
|
151
|
-
class:
|
|
150
|
+
spread(_el$2, mergeProps(others, ()=>({
|
|
151
|
+
class: twMerge(CLASSES.slot.backdrop, BACKDROP_VARIANT_MAP[variant()], local.class, local.className)
|
|
152
152
|
}), {
|
|
153
153
|
"data-slot": "drawer-backdrop",
|
|
154
154
|
get ["data-entering"] () {
|
|
@@ -166,7 +166,7 @@ const DrawerBackdrop = (props)=>{
|
|
|
166
166
|
onClick: handleBackdropClick,
|
|
167
167
|
onTransitionEnd: handleTransitionEnd
|
|
168
168
|
}), false, true);
|
|
169
|
-
|
|
169
|
+
insert(_el$2, ()=>local.children);
|
|
170
170
|
return _el$2;
|
|
171
171
|
}
|
|
172
172
|
});
|
|
@@ -176,13 +176,13 @@ const DrawerBackdrop = (props)=>{
|
|
|
176
176
|
});
|
|
177
177
|
};
|
|
178
178
|
const PLACEMENT_CLASS_MAP = {
|
|
179
|
-
top:
|
|
180
|
-
bottom:
|
|
181
|
-
left:
|
|
182
|
-
right:
|
|
179
|
+
top: CLASSES.placement.top,
|
|
180
|
+
bottom: CLASSES.placement.bottom,
|
|
181
|
+
left: CLASSES.placement.left,
|
|
182
|
+
right: CLASSES.placement.right
|
|
183
183
|
};
|
|
184
184
|
const DrawerContent = (props)=>{
|
|
185
|
-
const [local, others] =
|
|
185
|
+
const [local, others] = splitProps(props, [
|
|
186
186
|
"children",
|
|
187
187
|
"class",
|
|
188
188
|
"className",
|
|
@@ -199,12 +199,12 @@ const DrawerContent = (props)=>{
|
|
|
199
199
|
animState: parentCtx.animState,
|
|
200
200
|
placement
|
|
201
201
|
};
|
|
202
|
-
return
|
|
202
|
+
return createComponent(DrawerContext.Provider, {
|
|
203
203
|
value: updatedCtx,
|
|
204
204
|
get children () {
|
|
205
205
|
var _el$3 = _tmpl$2();
|
|
206
|
-
|
|
207
|
-
class:
|
|
206
|
+
spread(_el$3, mergeProps(others, ()=>({
|
|
207
|
+
class: twMerge(CLASSES.slot.content, PLACEMENT_CLASS_MAP[placement()], local.class, local.className)
|
|
208
208
|
}), {
|
|
209
209
|
"data-slot": "drawer-content",
|
|
210
210
|
get ["data-placement"] () {
|
|
@@ -223,27 +223,48 @@ const DrawerContent = (props)=>{
|
|
|
223
223
|
return local.style;
|
|
224
224
|
}
|
|
225
225
|
}), false, true);
|
|
226
|
-
|
|
226
|
+
insert(_el$3, ()=>local.children);
|
|
227
227
|
return _el$3;
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
};
|
|
231
|
+
const SIDE_MAP = {
|
|
232
|
+
left: "drawer__dialog--side-left",
|
|
233
|
+
right: "drawer__dialog--side-right"
|
|
234
|
+
};
|
|
231
235
|
const DrawerDialog = (props)=>{
|
|
232
|
-
const [local, others] =
|
|
236
|
+
const [local, others] = splitProps(props, [
|
|
233
237
|
"children",
|
|
234
238
|
"class",
|
|
235
239
|
"className",
|
|
236
240
|
"dataTheme",
|
|
237
|
-
"style"
|
|
241
|
+
"style",
|
|
242
|
+
"side",
|
|
243
|
+
"width",
|
|
244
|
+
"maxWidth",
|
|
245
|
+
"bg",
|
|
246
|
+
"padding"
|
|
238
247
|
]);
|
|
239
248
|
const ctx = useDrawerContext();
|
|
249
|
+
const mergedStyle = ()=>{
|
|
250
|
+
const s = {};
|
|
251
|
+
if ("object" == typeof local.style && local.style) Object.assign(s, local.style);
|
|
252
|
+
if (local.width) s["--drawer-dialog-width"] = local.width;
|
|
253
|
+
if (local.maxWidth) s["--drawer-dialog-max-width"] = local.maxWidth;
|
|
254
|
+
if (local.bg) s["--drawer-dialog-bg"] = local.bg;
|
|
255
|
+
if (local.padding) s["--drawer-dialog-padding"] = local.padding;
|
|
256
|
+
return s;
|
|
257
|
+
};
|
|
258
|
+
const hasCustomSize = ()=>Boolean(local.width || local.maxWidth);
|
|
259
|
+
const hasCustomPadding = ()=>Boolean(local.padding);
|
|
260
|
+
const hasCustomBg = ()=>Boolean(local.bg);
|
|
240
261
|
return (()=>{
|
|
241
262
|
var _el$4 = _tmpl$2();
|
|
242
|
-
|
|
263
|
+
spread(_el$4, mergeProps(others, {
|
|
243
264
|
role: "dialog",
|
|
244
265
|
"aria-modal": "true"
|
|
245
266
|
}, ()=>({
|
|
246
|
-
class:
|
|
267
|
+
class: twMerge(CLASSES.slot.dialog, local.side ? SIDE_MAP[local.side] : void 0, hasCustomBg() ? "drawer__dialog--custom-bg" : void 0, hasCustomSize() ? "drawer__dialog--custom-size" : void 0, hasCustomPadding() ? "drawer__dialog--custom-padding" : void 0, local.class, local.className)
|
|
247
268
|
}), {
|
|
248
269
|
"data-slot": "drawer-dialog",
|
|
249
270
|
get ["data-placement"] () {
|
|
@@ -253,15 +274,15 @@ const DrawerDialog = (props)=>{
|
|
|
253
274
|
return local.dataTheme;
|
|
254
275
|
},
|
|
255
276
|
get style () {
|
|
256
|
-
return
|
|
277
|
+
return mergedStyle();
|
|
257
278
|
}
|
|
258
279
|
}), false, true);
|
|
259
|
-
|
|
280
|
+
insert(_el$4, ()=>local.children);
|
|
260
281
|
return _el$4;
|
|
261
282
|
})();
|
|
262
283
|
};
|
|
263
284
|
const DrawerHeader = (props)=>{
|
|
264
|
-
const [local, others] =
|
|
285
|
+
const [local, others] = splitProps(props, [
|
|
265
286
|
"children",
|
|
266
287
|
"class",
|
|
267
288
|
"className",
|
|
@@ -270,8 +291,8 @@ const DrawerHeader = (props)=>{
|
|
|
270
291
|
]);
|
|
271
292
|
return (()=>{
|
|
272
293
|
var _el$5 = _tmpl$2();
|
|
273
|
-
|
|
274
|
-
class:
|
|
294
|
+
spread(_el$5, mergeProps(others, ()=>({
|
|
295
|
+
class: twMerge(CLASSES.slot.header, local.class, local.className)
|
|
275
296
|
}), {
|
|
276
297
|
"data-slot": "drawer-header",
|
|
277
298
|
get ["data-theme"] () {
|
|
@@ -281,12 +302,12 @@ const DrawerHeader = (props)=>{
|
|
|
281
302
|
return local.style;
|
|
282
303
|
}
|
|
283
304
|
}), false, true);
|
|
284
|
-
|
|
305
|
+
insert(_el$5, ()=>local.children);
|
|
285
306
|
return _el$5;
|
|
286
307
|
})();
|
|
287
308
|
};
|
|
288
309
|
const DrawerHeading = (props)=>{
|
|
289
|
-
const [local, others] =
|
|
310
|
+
const [local, others] = splitProps(props, [
|
|
290
311
|
"children",
|
|
291
312
|
"class",
|
|
292
313
|
"className",
|
|
@@ -295,8 +316,8 @@ const DrawerHeading = (props)=>{
|
|
|
295
316
|
]);
|
|
296
317
|
return (()=>{
|
|
297
318
|
var _el$6 = _tmpl$3();
|
|
298
|
-
|
|
299
|
-
class:
|
|
319
|
+
spread(_el$6, mergeProps(others, ()=>({
|
|
320
|
+
class: twMerge(CLASSES.slot.heading, local.class, local.className)
|
|
300
321
|
}), {
|
|
301
322
|
"data-slot": "drawer-heading",
|
|
302
323
|
get ["data-theme"] () {
|
|
@@ -306,12 +327,12 @@ const DrawerHeading = (props)=>{
|
|
|
306
327
|
return local.style;
|
|
307
328
|
}
|
|
308
329
|
}), false, true);
|
|
309
|
-
|
|
330
|
+
insert(_el$6, ()=>local.children);
|
|
310
331
|
return _el$6;
|
|
311
332
|
})();
|
|
312
333
|
};
|
|
313
334
|
const DrawerBody = (props)=>{
|
|
314
|
-
const [local, others] =
|
|
335
|
+
const [local, others] = splitProps(props, [
|
|
315
336
|
"children",
|
|
316
337
|
"class",
|
|
317
338
|
"className",
|
|
@@ -320,8 +341,8 @@ const DrawerBody = (props)=>{
|
|
|
320
341
|
]);
|
|
321
342
|
return (()=>{
|
|
322
343
|
var _el$7 = _tmpl$2();
|
|
323
|
-
|
|
324
|
-
class:
|
|
344
|
+
spread(_el$7, mergeProps(others, ()=>({
|
|
345
|
+
class: twMerge(CLASSES.slot.body, local.class, local.className)
|
|
325
346
|
}), {
|
|
326
347
|
"data-slot": "drawer-body",
|
|
327
348
|
get ["data-theme"] () {
|
|
@@ -333,12 +354,12 @@ const DrawerBody = (props)=>{
|
|
|
333
354
|
});
|
|
334
355
|
}
|
|
335
356
|
}), false, true);
|
|
336
|
-
|
|
357
|
+
insert(_el$7, ()=>local.children);
|
|
337
358
|
return _el$7;
|
|
338
359
|
})();
|
|
339
360
|
};
|
|
340
361
|
const DrawerFooter = (props)=>{
|
|
341
|
-
const [local, others] =
|
|
362
|
+
const [local, others] = splitProps(props, [
|
|
342
363
|
"children",
|
|
343
364
|
"class",
|
|
344
365
|
"className",
|
|
@@ -347,8 +368,8 @@ const DrawerFooter = (props)=>{
|
|
|
347
368
|
]);
|
|
348
369
|
return (()=>{
|
|
349
370
|
var _el$8 = _tmpl$2();
|
|
350
|
-
|
|
351
|
-
class:
|
|
371
|
+
spread(_el$8, mergeProps(others, ()=>({
|
|
372
|
+
class: twMerge(CLASSES.slot.footer, local.class, local.className)
|
|
352
373
|
}), {
|
|
353
374
|
"data-slot": "drawer-footer",
|
|
354
375
|
get ["data-theme"] () {
|
|
@@ -358,12 +379,12 @@ const DrawerFooter = (props)=>{
|
|
|
358
379
|
return local.style;
|
|
359
380
|
}
|
|
360
381
|
}), false, true);
|
|
361
|
-
|
|
382
|
+
insert(_el$8, ()=>local.children);
|
|
362
383
|
return _el$8;
|
|
363
384
|
})();
|
|
364
385
|
};
|
|
365
386
|
const DrawerHandle = (props)=>{
|
|
366
|
-
const [local, others] =
|
|
387
|
+
const [local, others] = splitProps(props, [
|
|
367
388
|
"class",
|
|
368
389
|
"className",
|
|
369
390
|
"dataTheme",
|
|
@@ -371,10 +392,10 @@ const DrawerHandle = (props)=>{
|
|
|
371
392
|
]);
|
|
372
393
|
return (()=>{
|
|
373
394
|
var _el$9 = _tmpl$4();
|
|
374
|
-
|
|
395
|
+
spread(_el$9, mergeProps(others, {
|
|
375
396
|
"aria-hidden": "true"
|
|
376
397
|
}, ()=>({
|
|
377
|
-
class:
|
|
398
|
+
class: twMerge(CLASSES.slot.handle, local.class, local.className)
|
|
378
399
|
}), {
|
|
379
400
|
"data-slot": "drawer-handle",
|
|
380
401
|
get ["data-theme"] () {
|
|
@@ -388,7 +409,7 @@ const DrawerHandle = (props)=>{
|
|
|
388
409
|
})();
|
|
389
410
|
};
|
|
390
411
|
const DrawerCloseTrigger = (props)=>{
|
|
391
|
-
const [local, others] =
|
|
412
|
+
const [local, others] = splitProps(props, [
|
|
392
413
|
"children",
|
|
393
414
|
"class",
|
|
394
415
|
"className",
|
|
@@ -405,10 +426,10 @@ const DrawerCloseTrigger = (props)=>{
|
|
|
405
426
|
};
|
|
406
427
|
return (()=>{
|
|
407
428
|
var _el$0 = _tmpl$();
|
|
408
|
-
|
|
429
|
+
spread(_el$0, mergeProps(others, {
|
|
409
430
|
type: "button"
|
|
410
431
|
}, ()=>({
|
|
411
|
-
class:
|
|
432
|
+
class: twMerge(CLASSES.slot.closeTrigger, local.class, local.className)
|
|
412
433
|
}), {
|
|
413
434
|
"data-slot": "drawer-close-trigger",
|
|
414
435
|
get ["data-theme"] () {
|
|
@@ -420,30 +441,30 @@ const DrawerCloseTrigger = (props)=>{
|
|
|
420
441
|
"aria-label": "Close",
|
|
421
442
|
onClick: handleClick
|
|
422
443
|
}), false, true);
|
|
423
|
-
|
|
424
|
-
var _c$ =
|
|
444
|
+
insert(_el$0, (()=>{
|
|
445
|
+
var _c$ = memo(()=>!!local.startIcon);
|
|
425
446
|
return ()=>_c$() ? (()=>{
|
|
426
447
|
var _el$1 = _tmpl$5();
|
|
427
|
-
|
|
428
|
-
class:
|
|
448
|
+
spread(_el$1, mergeProps(()=>({
|
|
449
|
+
class: twMerge(CLASSES.slot.closeIcon, CLASSES.closeIconStart)
|
|
429
450
|
}), {
|
|
430
451
|
"data-slot": "drawer-close-trigger-start-icon"
|
|
431
452
|
}), false, true);
|
|
432
|
-
|
|
453
|
+
insert(_el$1, ()=>local.startIcon);
|
|
433
454
|
return _el$1;
|
|
434
455
|
})() : null;
|
|
435
456
|
})(), null);
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
var _c$2 =
|
|
457
|
+
insert(_el$0, ()=>local.children, null);
|
|
458
|
+
insert(_el$0, (()=>{
|
|
459
|
+
var _c$2 = memo(()=>!!local.endIcon);
|
|
439
460
|
return ()=>_c$2() ? (()=>{
|
|
440
461
|
var _el$10 = _tmpl$5();
|
|
441
|
-
|
|
442
|
-
class:
|
|
462
|
+
spread(_el$10, mergeProps(()=>({
|
|
463
|
+
class: twMerge(CLASSES.slot.closeIcon, CLASSES.closeIconEnd)
|
|
443
464
|
}), {
|
|
444
465
|
"data-slot": "drawer-close-trigger-end-icon"
|
|
445
466
|
}), false, true);
|
|
446
|
-
|
|
467
|
+
insert(_el$10, ()=>local.endIcon);
|
|
447
468
|
return _el$10;
|
|
448
469
|
})() : null;
|
|
449
470
|
})(), null);
|
|
@@ -458,7 +479,7 @@ const DrawerClose = (props)=>{
|
|
|
458
479
|
return (()=>{
|
|
459
480
|
var _el$11 = _tmpl$6();
|
|
460
481
|
_el$11.$$click = handleClick;
|
|
461
|
-
|
|
482
|
+
insert(_el$11, ()=>props.children);
|
|
462
483
|
return _el$11;
|
|
463
484
|
})();
|
|
464
485
|
};
|
|
@@ -477,7 +498,7 @@ const Drawer = Object.assign(DrawerRoot, {
|
|
|
477
498
|
Close: DrawerClose
|
|
478
499
|
});
|
|
479
500
|
const drawer_Drawer = Drawer;
|
|
480
|
-
|
|
501
|
+
delegateEvents([
|
|
481
502
|
"click"
|
|
482
503
|
]);
|
|
483
504
|
export { DrawerBackdrop, DrawerBody, DrawerClose, DrawerCloseTrigger, DrawerContent, DrawerDialog, DrawerFooter, DrawerHandle, DrawerHeader, DrawerHeading, DrawerRoot, DrawerTrigger, drawer_Drawer as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, DrawerRoot, DrawerTrigger, DrawerBackdrop, DrawerContent, DrawerDialog, DrawerHeader, DrawerHeading, DrawerBody, DrawerFooter, DrawerHandle, DrawerCloseTrigger, DrawerClose, type DrawerPlacement, type DrawerBackdropVariant, type DrawerRootProps, type DrawerTriggerProps, type DrawerBackdropProps, type DrawerContentProps, type DrawerDialogProps, type DrawerHeaderProps, type DrawerHeadingProps, type DrawerBodyProps, type DrawerFooterProps, type DrawerHandleProps, type DrawerCloseTriggerProps, type DrawerCloseProps, } from "./Drawer";
|
|
1
|
+
export { default, DrawerRoot, DrawerTrigger, DrawerBackdrop, DrawerContent, DrawerDialog, DrawerHeader, DrawerHeading, DrawerBody, DrawerFooter, DrawerHandle, DrawerCloseTrigger, DrawerClose, type DrawerPlacement, type DrawerBackdropVariant, type DrawerDialogSide, type DrawerRootProps, type DrawerTriggerProps, type DrawerBackdropProps, type DrawerContentProps, type DrawerDialogProps, type DrawerHeaderProps, type DrawerHeadingProps, type DrawerBodyProps, type DrawerFooterProps, type DrawerHandleProps, type DrawerCloseTriggerProps, type DrawerCloseProps, } from "./Drawer";
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var __webpack_exports__DrawerBody = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerBody;
|
|
4
|
-
var __webpack_exports__DrawerClose = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerClose;
|
|
5
|
-
var __webpack_exports__DrawerCloseTrigger = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerCloseTrigger;
|
|
6
|
-
var __webpack_exports__DrawerContent = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerContent;
|
|
7
|
-
var __webpack_exports__DrawerDialog = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerDialog;
|
|
8
|
-
var __webpack_exports__DrawerFooter = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerFooter;
|
|
9
|
-
var __webpack_exports__DrawerHandle = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerHandle;
|
|
10
|
-
var __webpack_exports__DrawerHeader = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerHeader;
|
|
11
|
-
var __webpack_exports__DrawerHeading = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerHeading;
|
|
12
|
-
var __webpack_exports__DrawerRoot = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerRoot;
|
|
13
|
-
var __webpack_exports__DrawerTrigger = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__.DrawerTrigger;
|
|
14
|
-
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Drawer_js_d34b0417__["default"];
|
|
15
|
-
export { __webpack_exports__DrawerBackdrop as DrawerBackdrop, __webpack_exports__DrawerBody as DrawerBody, __webpack_exports__DrawerClose as DrawerClose, __webpack_exports__DrawerCloseTrigger as DrawerCloseTrigger, __webpack_exports__DrawerContent as DrawerContent, __webpack_exports__DrawerDialog as DrawerDialog, __webpack_exports__DrawerFooter as DrawerFooter, __webpack_exports__DrawerHandle as DrawerHandle, __webpack_exports__DrawerHeader as DrawerHeader, __webpack_exports__DrawerHeading as DrawerHeading, __webpack_exports__DrawerRoot as DrawerRoot, __webpack_exports__DrawerTrigger as DrawerTrigger, __webpack_exports__default as default };
|
|
1
|
+
import external_Drawer_js_default, { DrawerBackdrop, DrawerBody, DrawerClose, DrawerCloseTrigger, DrawerContent, DrawerDialog, DrawerFooter, DrawerHandle, DrawerHeader, DrawerHeading, DrawerRoot, DrawerTrigger } from "./Drawer.js";
|
|
2
|
+
export { DrawerBackdrop, DrawerBody, DrawerClose, DrawerCloseTrigger, DrawerContent, DrawerDialog, DrawerFooter, DrawerHandle, DrawerHeader, DrawerHeading, DrawerRoot, DrawerTrigger, external_Drawer_js_default as default };
|