@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
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createComponent, insert, mergeProps, spread, template, use } from "solid-js/web";
|
|
2
2
|
import "./Toast.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
var _tmpl$ = /*#__PURE__*/
|
|
3
|
+
import { For, Show, createContext, createEffect, createMemo, createSignal, onCleanup, splitProps, useContext } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import index_js_default from "../button/index.js";
|
|
6
|
+
import external_close_button_index_js_default from "../close-button/index.js";
|
|
7
|
+
import { CLASSES } from "./Toast.classes.js";
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/ template('<svg><circle cx=12 cy=12 r=10></circle><path d="M12 16v-4"></path><path d="M12 8h.01">'), _tmpl$2 = /*#__PURE__*/ template('<svg><circle cx=12 cy=12 r=10></circle><path d="m9 12 2 2 4-4">'), _tmpl$3 = /*#__PURE__*/ template('<svg><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"></path><path d="M12 9v4"></path><path d="M12 17h.01">'), _tmpl$4 = /*#__PURE__*/ template('<svg><circle cx=12 cy=12 r=10></circle><path d="m15 9-6 6"></path><path d="m9 9 6 6">'), _tmpl$5 = /*#__PURE__*/ template('<svg><path d="m18 6-12 12"></path><path d="m6 6 12 12">'), _tmpl$6 = /*#__PURE__*/ template("<span>"), _tmpl$7 = /*#__PURE__*/ template("<div>"), _tmpl$8 = /*#__PURE__*/ template("<p>"), _tmpl$9 = /*#__PURE__*/ template("<div><div>");
|
|
9
9
|
const DEFAULT_GAP = 12;
|
|
10
10
|
const DEFAULT_MAX_VISIBLE_TOAST = 3;
|
|
11
11
|
const DEFAULT_SCALE_FACTOR = 0.05;
|
|
@@ -58,7 +58,7 @@ class ToastQueue {
|
|
|
58
58
|
keyCounter = 0;
|
|
59
59
|
exitDuration;
|
|
60
60
|
constructor(options){
|
|
61
|
-
const [toasts, setToasts] =
|
|
61
|
+
const [toasts, setToasts] = createSignal([]);
|
|
62
62
|
this.readToasts = toasts;
|
|
63
63
|
this.setToasts = setToasts;
|
|
64
64
|
this.maxVisibleToasts = options?.maxVisibleToasts;
|
|
@@ -203,16 +203,16 @@ class ToastQueue {
|
|
|
203
203
|
return this;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
const ToastItemContext =
|
|
206
|
+
const ToastItemContext = createContext();
|
|
207
207
|
const useToastItemContext = ()=>{
|
|
208
|
-
const context =
|
|
208
|
+
const context = useContext(ToastItemContext);
|
|
209
209
|
if (!context) throw new Error("Toast compound components must be used within <Toast>.");
|
|
210
210
|
return context;
|
|
211
211
|
};
|
|
212
212
|
const InfoIcon = ()=>(()=>{
|
|
213
213
|
var _el$ = _tmpl$();
|
|
214
|
-
|
|
215
|
-
class:
|
|
214
|
+
spread(_el$, mergeProps(()=>({
|
|
215
|
+
class: CLASSES.Indicator.icon
|
|
216
216
|
}), {
|
|
217
217
|
viewBox: "0 0 24 24",
|
|
218
218
|
fill: "none",
|
|
@@ -226,8 +226,8 @@ const InfoIcon = ()=>(()=>{
|
|
|
226
226
|
})();
|
|
227
227
|
const SuccessIcon = ()=>(()=>{
|
|
228
228
|
var _el$2 = _tmpl$2();
|
|
229
|
-
|
|
230
|
-
class:
|
|
229
|
+
spread(_el$2, mergeProps(()=>({
|
|
230
|
+
class: CLASSES.Indicator.icon
|
|
231
231
|
}), {
|
|
232
232
|
viewBox: "0 0 24 24",
|
|
233
233
|
fill: "none",
|
|
@@ -241,8 +241,8 @@ const SuccessIcon = ()=>(()=>{
|
|
|
241
241
|
})();
|
|
242
242
|
const WarningIcon = ()=>(()=>{
|
|
243
243
|
var _el$3 = _tmpl$3();
|
|
244
|
-
|
|
245
|
-
class:
|
|
244
|
+
spread(_el$3, mergeProps(()=>({
|
|
245
|
+
class: CLASSES.Indicator.icon
|
|
246
246
|
}), {
|
|
247
247
|
viewBox: "0 0 24 24",
|
|
248
248
|
fill: "none",
|
|
@@ -256,8 +256,8 @@ const WarningIcon = ()=>(()=>{
|
|
|
256
256
|
})();
|
|
257
257
|
const DangerIcon = ()=>(()=>{
|
|
258
258
|
var _el$4 = _tmpl$4();
|
|
259
|
-
|
|
260
|
-
class:
|
|
259
|
+
spread(_el$4, mergeProps(()=>({
|
|
260
|
+
class: CLASSES.Indicator.icon
|
|
261
261
|
}), {
|
|
262
262
|
viewBox: "0 0 24 24",
|
|
263
263
|
fill: "none",
|
|
@@ -271,8 +271,8 @@ const DangerIcon = ()=>(()=>{
|
|
|
271
271
|
})();
|
|
272
272
|
const CloseIcon = ()=>(()=>{
|
|
273
273
|
var _el$5 = _tmpl$5();
|
|
274
|
-
|
|
275
|
-
class:
|
|
274
|
+
spread(_el$5, mergeProps(()=>({
|
|
275
|
+
class: CLASSES.Close.icon
|
|
276
276
|
}), {
|
|
277
277
|
viewBox: "0 0 24 24",
|
|
278
278
|
fill: "none",
|
|
@@ -287,8 +287,8 @@ const CloseIcon = ()=>(()=>{
|
|
|
287
287
|
const DefaultIndicator = (props)=>{
|
|
288
288
|
if (props.isLoading) return (()=>{
|
|
289
289
|
var _el$6 = _tmpl$6();
|
|
290
|
-
|
|
291
|
-
class:
|
|
290
|
+
spread(_el$6, mergeProps(()=>({
|
|
291
|
+
class: CLASSES.Spinner.base
|
|
292
292
|
}), {
|
|
293
293
|
"aria-hidden": "true"
|
|
294
294
|
}), false, false);
|
|
@@ -296,20 +296,20 @@ const DefaultIndicator = (props)=>{
|
|
|
296
296
|
})();
|
|
297
297
|
switch(props.variant){
|
|
298
298
|
case "success":
|
|
299
|
-
return
|
|
299
|
+
return createComponent(SuccessIcon, {});
|
|
300
300
|
case "warning":
|
|
301
|
-
return
|
|
301
|
+
return createComponent(WarningIcon, {});
|
|
302
302
|
case "danger":
|
|
303
|
-
return
|
|
303
|
+
return createComponent(DangerIcon, {});
|
|
304
304
|
case "accent":
|
|
305
|
-
return
|
|
305
|
+
return createComponent(InfoIcon, {});
|
|
306
306
|
case "default":
|
|
307
307
|
default:
|
|
308
|
-
return
|
|
308
|
+
return createComponent(InfoIcon, {});
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
const ToastContent = (props)=>{
|
|
312
|
-
const [local, others] =
|
|
312
|
+
const [local, others] = splitProps(props, [
|
|
313
313
|
"children",
|
|
314
314
|
"class",
|
|
315
315
|
"className",
|
|
@@ -318,8 +318,8 @@ const ToastContent = (props)=>{
|
|
|
318
318
|
]);
|
|
319
319
|
return (()=>{
|
|
320
320
|
var _el$7 = _tmpl$7();
|
|
321
|
-
|
|
322
|
-
class:
|
|
321
|
+
spread(_el$7, mergeProps(others, ()=>({
|
|
322
|
+
class: twMerge(CLASSES.Content.base, local.class, local.className)
|
|
323
323
|
}), {
|
|
324
324
|
"data-slot": "toast-content",
|
|
325
325
|
get ["data-theme"] () {
|
|
@@ -329,13 +329,13 @@ const ToastContent = (props)=>{
|
|
|
329
329
|
return local.style;
|
|
330
330
|
}
|
|
331
331
|
}), false, true);
|
|
332
|
-
|
|
332
|
+
insert(_el$7, ()=>local.children);
|
|
333
333
|
return _el$7;
|
|
334
334
|
})();
|
|
335
335
|
};
|
|
336
336
|
const ToastIndicator = (props)=>{
|
|
337
337
|
const ctx = useToastItemContext();
|
|
338
|
-
const [local, others] =
|
|
338
|
+
const [local, others] = splitProps(props, [
|
|
339
339
|
"children",
|
|
340
340
|
"class",
|
|
341
341
|
"className",
|
|
@@ -343,11 +343,11 @@ const ToastIndicator = (props)=>{
|
|
|
343
343
|
"style",
|
|
344
344
|
"variant"
|
|
345
345
|
]);
|
|
346
|
-
const variant =
|
|
346
|
+
const variant = createMemo(()=>normalizeVariant(local.variant ?? ctx.variant()));
|
|
347
347
|
return (()=>{
|
|
348
348
|
var _el$8 = _tmpl$7();
|
|
349
|
-
|
|
350
|
-
class:
|
|
349
|
+
spread(_el$8, mergeProps(others, ()=>({
|
|
350
|
+
class: twMerge(CLASSES.Indicator.base, local.class, local.className)
|
|
351
351
|
}), {
|
|
352
352
|
"data-slot": "toast-indicator",
|
|
353
353
|
get ["data-theme"] () {
|
|
@@ -357,12 +357,12 @@ const ToastIndicator = (props)=>{
|
|
|
357
357
|
return local.style;
|
|
358
358
|
}
|
|
359
359
|
}), false, true);
|
|
360
|
-
|
|
360
|
+
insert(_el$8, createComponent(Show, {
|
|
361
361
|
get when () {
|
|
362
362
|
return local.children;
|
|
363
363
|
},
|
|
364
364
|
get fallback () {
|
|
365
|
-
return
|
|
365
|
+
return createComponent(DefaultIndicator, {
|
|
366
366
|
get variant () {
|
|
367
367
|
return variant();
|
|
368
368
|
},
|
|
@@ -379,7 +379,7 @@ const ToastIndicator = (props)=>{
|
|
|
379
379
|
})();
|
|
380
380
|
};
|
|
381
381
|
const ToastTitle = (props)=>{
|
|
382
|
-
const [local, others] =
|
|
382
|
+
const [local, others] = splitProps(props, [
|
|
383
383
|
"children",
|
|
384
384
|
"class",
|
|
385
385
|
"className",
|
|
@@ -388,8 +388,8 @@ const ToastTitle = (props)=>{
|
|
|
388
388
|
]);
|
|
389
389
|
return (()=>{
|
|
390
390
|
var _el$9 = _tmpl$8();
|
|
391
|
-
|
|
392
|
-
class:
|
|
391
|
+
spread(_el$9, mergeProps(others, ()=>({
|
|
392
|
+
class: twMerge(CLASSES.Title.base, local.class, local.className)
|
|
393
393
|
}), {
|
|
394
394
|
"data-slot": "toast-title",
|
|
395
395
|
get ["data-theme"] () {
|
|
@@ -399,12 +399,12 @@ const ToastTitle = (props)=>{
|
|
|
399
399
|
return local.style;
|
|
400
400
|
}
|
|
401
401
|
}), false, true);
|
|
402
|
-
|
|
402
|
+
insert(_el$9, ()=>local.children);
|
|
403
403
|
return _el$9;
|
|
404
404
|
})();
|
|
405
405
|
};
|
|
406
406
|
const ToastDescription = (props)=>{
|
|
407
|
-
const [local, others] =
|
|
407
|
+
const [local, others] = splitProps(props, [
|
|
408
408
|
"children",
|
|
409
409
|
"class",
|
|
410
410
|
"className",
|
|
@@ -413,8 +413,8 @@ const ToastDescription = (props)=>{
|
|
|
413
413
|
]);
|
|
414
414
|
return (()=>{
|
|
415
415
|
var _el$0 = _tmpl$8();
|
|
416
|
-
|
|
417
|
-
class:
|
|
416
|
+
spread(_el$0, mergeProps(others, ()=>({
|
|
417
|
+
class: twMerge(CLASSES.Description.base, local.class, local.className)
|
|
418
418
|
}), {
|
|
419
419
|
"data-slot": "toast-description",
|
|
420
420
|
get ["data-theme"] () {
|
|
@@ -424,20 +424,20 @@ const ToastDescription = (props)=>{
|
|
|
424
424
|
return local.style;
|
|
425
425
|
}
|
|
426
426
|
}), false, true);
|
|
427
|
-
|
|
427
|
+
insert(_el$0, ()=>local.children);
|
|
428
428
|
return _el$0;
|
|
429
429
|
})();
|
|
430
430
|
};
|
|
431
431
|
const ToastActionButton = (props)=>{
|
|
432
|
-
const [local, others] =
|
|
432
|
+
const [local, others] = splitProps(props, [
|
|
433
433
|
"class",
|
|
434
434
|
"className"
|
|
435
435
|
]);
|
|
436
|
-
return
|
|
436
|
+
return createComponent(index_js_default, mergeProps(others, {
|
|
437
437
|
variant: "outline",
|
|
438
438
|
size: "sm"
|
|
439
439
|
}, ()=>({
|
|
440
|
-
class:
|
|
440
|
+
class: twMerge(CLASSES.Action.base, local.class, local.className)
|
|
441
441
|
}), {
|
|
442
442
|
"data-slot": "toast-action",
|
|
443
443
|
get children () {
|
|
@@ -447,7 +447,7 @@ const ToastActionButton = (props)=>{
|
|
|
447
447
|
};
|
|
448
448
|
const ToastCloseButton = (props)=>{
|
|
449
449
|
const ctx = useToastItemContext();
|
|
450
|
-
const [local, others] =
|
|
450
|
+
const [local, others] = splitProps(props, [
|
|
451
451
|
"class",
|
|
452
452
|
"className",
|
|
453
453
|
"aria-label",
|
|
@@ -460,14 +460,14 @@ const ToastCloseButton = (props)=>{
|
|
|
460
460
|
if (event.defaultPrevented) return;
|
|
461
461
|
ctx.onClose?.();
|
|
462
462
|
};
|
|
463
|
-
return
|
|
464
|
-
class:
|
|
463
|
+
return createComponent(external_close_button_index_js_default, mergeProps(others, ()=>({
|
|
464
|
+
class: twMerge(CLASSES.Close.base, local.class, local.className)
|
|
465
465
|
}), {
|
|
466
466
|
get ["aria-label"] () {
|
|
467
467
|
return local["aria-label"] ?? "Dismiss notification";
|
|
468
468
|
},
|
|
469
469
|
get startIcon () {
|
|
470
|
-
return
|
|
470
|
+
return createComponent(CloseIcon, {});
|
|
471
471
|
},
|
|
472
472
|
"data-slot": "toast-close",
|
|
473
473
|
get ["data-theme"] () {
|
|
@@ -480,7 +480,7 @@ const ToastCloseButton = (props)=>{
|
|
|
480
480
|
}));
|
|
481
481
|
};
|
|
482
482
|
const ToastRoot = (props)=>{
|
|
483
|
-
const [local, others] =
|
|
483
|
+
const [local, others] = splitProps(props, [
|
|
484
484
|
"children",
|
|
485
485
|
"class",
|
|
486
486
|
"className",
|
|
@@ -498,23 +498,23 @@ const ToastRoot = (props)=>{
|
|
|
498
498
|
"isEntering",
|
|
499
499
|
"isExiting"
|
|
500
500
|
]);
|
|
501
|
-
const variant =
|
|
502
|
-
const isLoading =
|
|
503
|
-
const isFrontmost =
|
|
504
|
-
const isHidden =
|
|
501
|
+
const variant = createMemo(()=>normalizeVariant(local.variant));
|
|
502
|
+
const isLoading = createMemo(()=>Boolean(local.isLoading));
|
|
503
|
+
const isFrontmost = createMemo(()=>local.isFrontmost ?? true);
|
|
504
|
+
const isHidden = createMemo(()=>local.isHidden ?? false);
|
|
505
505
|
const contextValue = {
|
|
506
506
|
variant,
|
|
507
507
|
isLoading,
|
|
508
508
|
onClose: local.onClose
|
|
509
509
|
};
|
|
510
|
-
const role =
|
|
511
|
-
const ariaLive =
|
|
512
|
-
return
|
|
510
|
+
const role = createMemo(()=>"danger" === variant() ? "alert" : "status");
|
|
511
|
+
const ariaLive = createMemo(()=>"danger" === variant() ? "assertive" : "polite");
|
|
512
|
+
return createComponent(ToastItemContext.Provider, {
|
|
513
513
|
value: contextValue,
|
|
514
514
|
get children () {
|
|
515
515
|
var _el$1 = _tmpl$7();
|
|
516
|
-
|
|
517
|
-
class:
|
|
516
|
+
spread(_el$1, mergeProps(others, ()=>({
|
|
517
|
+
class: twMerge(CLASSES.Item.base, CLASSES.Item.variant[variant()], isFrontmost() && CLASSES.Item.state.frontmost, isHidden() && CLASSES.Item.state.hidden, local.isEntering && CLASSES.Item.state.entering, local.isExiting && CLASSES.Item.state.exiting, local.class, local.className)
|
|
518
518
|
}), {
|
|
519
519
|
get role () {
|
|
520
520
|
return role();
|
|
@@ -539,61 +539,61 @@ const ToastRoot = (props)=>{
|
|
|
539
539
|
return local.style;
|
|
540
540
|
}
|
|
541
541
|
}), false, true);
|
|
542
|
-
|
|
542
|
+
insert(_el$1, createComponent(Show, {
|
|
543
543
|
get when () {
|
|
544
544
|
return local.children;
|
|
545
545
|
},
|
|
546
546
|
get fallback () {
|
|
547
547
|
return [
|
|
548
|
-
|
|
548
|
+
createComponent(ToastIndicator, {
|
|
549
549
|
get children () {
|
|
550
550
|
return local.indicator;
|
|
551
551
|
}
|
|
552
552
|
}),
|
|
553
|
-
|
|
553
|
+
createComponent(ToastContent, {
|
|
554
554
|
get children () {
|
|
555
555
|
return [
|
|
556
|
-
|
|
556
|
+
createComponent(Show, {
|
|
557
557
|
get when () {
|
|
558
558
|
return null != local.title;
|
|
559
559
|
},
|
|
560
560
|
get children () {
|
|
561
|
-
return
|
|
561
|
+
return createComponent(ToastTitle, {
|
|
562
562
|
get children () {
|
|
563
563
|
return local.title;
|
|
564
564
|
}
|
|
565
565
|
});
|
|
566
566
|
}
|
|
567
567
|
}),
|
|
568
|
-
|
|
568
|
+
createComponent(Show, {
|
|
569
569
|
get when () {
|
|
570
570
|
return null != local.description;
|
|
571
571
|
},
|
|
572
572
|
get children () {
|
|
573
|
-
return
|
|
573
|
+
return createComponent(ToastDescription, {
|
|
574
574
|
get children () {
|
|
575
575
|
return local.description;
|
|
576
576
|
}
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
579
|
}),
|
|
580
|
-
|
|
580
|
+
createComponent(Show, {
|
|
581
581
|
get when () {
|
|
582
582
|
return local.actionProps?.children;
|
|
583
583
|
},
|
|
584
584
|
get children () {
|
|
585
|
-
return
|
|
585
|
+
return createComponent(ToastActionButton, mergeProps(()=>local.actionProps));
|
|
586
586
|
}
|
|
587
587
|
})
|
|
588
588
|
];
|
|
589
589
|
}
|
|
590
590
|
}),
|
|
591
|
-
|
|
591
|
+
createComponent(Show, {
|
|
592
592
|
get when () {
|
|
593
593
|
return local.onClose;
|
|
594
594
|
},
|
|
595
595
|
get children () {
|
|
596
|
-
return
|
|
596
|
+
return createComponent(ToastCloseButton, {});
|
|
597
597
|
}
|
|
598
598
|
})
|
|
599
599
|
];
|
|
@@ -607,7 +607,7 @@ const ToastRoot = (props)=>{
|
|
|
607
607
|
});
|
|
608
608
|
};
|
|
609
609
|
const ToastProvider = (props)=>{
|
|
610
|
-
const [local, others] =
|
|
610
|
+
const [local, others] = splitProps(props, [
|
|
611
611
|
"children",
|
|
612
612
|
"class",
|
|
613
613
|
"className",
|
|
@@ -624,19 +624,19 @@ const ToastProvider = (props)=>{
|
|
|
624
624
|
"onMouseEnter",
|
|
625
625
|
"onMouseLeave"
|
|
626
626
|
]);
|
|
627
|
-
const queue =
|
|
628
|
-
const placement =
|
|
629
|
-
const gap =
|
|
630
|
-
const scaleFactor =
|
|
631
|
-
const maxVisible =
|
|
632
|
-
const toasts =
|
|
633
|
-
const [frontHeight, setFrontHeight] =
|
|
627
|
+
const queue = createMemo(()=>void 0 === local.queue ? toastQueue : local.queue);
|
|
628
|
+
const placement = createMemo(()=>normalizePlacement(local.placement));
|
|
629
|
+
const gap = createMemo(()=>local.gap ?? DEFAULT_GAP);
|
|
630
|
+
const scaleFactor = createMemo(()=>local.scaleFactor ?? DEFAULT_SCALE_FACTOR);
|
|
631
|
+
const maxVisible = createMemo(()=>local.maxVisibleToasts ?? queue()?.maxVisibleToasts ?? DEFAULT_MAX_VISIBLE_TOAST);
|
|
632
|
+
const toasts = createMemo(()=>queue()?.toasts() ?? []);
|
|
633
|
+
const [frontHeight, setFrontHeight] = createSignal(0);
|
|
634
634
|
const itemRefs = new Map();
|
|
635
635
|
const setItemRef = (key, node)=>{
|
|
636
636
|
if (!node) return void itemRefs.delete(key);
|
|
637
637
|
itemRefs.set(key, node);
|
|
638
638
|
};
|
|
639
|
-
|
|
639
|
+
createEffect(()=>{
|
|
640
640
|
const frontmostToast = toasts()[0];
|
|
641
641
|
const frontmostNode = frontmostToast ? itemRefs.get(frontmostToast.key) : void 0;
|
|
642
642
|
if (!frontmostNode) return void setFrontHeight(0);
|
|
@@ -647,15 +647,15 @@ const ToastProvider = (props)=>{
|
|
|
647
647
|
if (entry) setFrontHeight(entry.contentRect.height);
|
|
648
648
|
});
|
|
649
649
|
resizeObserver.observe(frontmostNode);
|
|
650
|
-
|
|
650
|
+
onCleanup(()=>{
|
|
651
651
|
resizeObserver.disconnect();
|
|
652
652
|
});
|
|
653
653
|
});
|
|
654
|
-
const widthValue =
|
|
654
|
+
const widthValue = createMemo(()=>{
|
|
655
655
|
if ("number" == typeof local.width) return `${local.width}px`;
|
|
656
656
|
return local.width ?? `${DEFAULT_TOAST_WIDTH}px`;
|
|
657
657
|
});
|
|
658
|
-
const providerStyle =
|
|
658
|
+
const providerStyle = createMemo(()=>({
|
|
659
659
|
"--toast-width": widthValue(),
|
|
660
660
|
...local.style ?? {}
|
|
661
661
|
}));
|
|
@@ -670,9 +670,9 @@ const ToastProvider = (props)=>{
|
|
|
670
670
|
return (()=>{
|
|
671
671
|
var _el$10 = _tmpl$9(), _el$11 = _el$10.firstChild;
|
|
672
672
|
var _ref$ = local.ref;
|
|
673
|
-
"function" == typeof _ref$ ?
|
|
674
|
-
|
|
675
|
-
class:
|
|
673
|
+
"function" == typeof _ref$ ? use(_ref$, _el$10) : local.ref = _el$10;
|
|
674
|
+
spread(_el$10, mergeProps(others, ()=>({
|
|
675
|
+
class: twMerge(CLASSES.Provider.base, CLASSES.Provider.placement[placement()], local.class, local.className)
|
|
676
676
|
}), {
|
|
677
677
|
"data-slot": "toast-region",
|
|
678
678
|
get ["data-placement"] () {
|
|
@@ -687,13 +687,13 @@ const ToastProvider = (props)=>{
|
|
|
687
687
|
onMouseEnter: handleMouseEnter,
|
|
688
688
|
onMouseLeave: handleMouseLeave
|
|
689
689
|
}), false, true);
|
|
690
|
-
|
|
691
|
-
class:
|
|
690
|
+
spread(_el$11, mergeProps(()=>({
|
|
691
|
+
class: CLASSES.Provider.stack
|
|
692
692
|
}), {
|
|
693
693
|
"data-slot": "toast-stack"
|
|
694
694
|
}), false, true);
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
insert(_el$11, ()=>local.children, null);
|
|
696
|
+
insert(_el$11, createComponent(For, {
|
|
697
697
|
get each () {
|
|
698
698
|
return toasts();
|
|
699
699
|
},
|
|
@@ -703,7 +703,7 @@ const ToastProvider = (props)=>{
|
|
|
703
703
|
};
|
|
704
704
|
const isFrontmost = ()=>0 === index();
|
|
705
705
|
const hidden = ()=>index() >= maxVisible();
|
|
706
|
-
const itemStyle =
|
|
706
|
+
const itemStyle = createMemo(()=>{
|
|
707
707
|
const offset = index() * gap();
|
|
708
708
|
const direction = isBottomPlacement(placement()) ? -1 : 1;
|
|
709
709
|
const scale = Math.max(0.1, 1 - index() * scaleFactor());
|
|
@@ -715,9 +715,9 @@ const ToastProvider = (props)=>{
|
|
|
715
715
|
});
|
|
716
716
|
return (()=>{
|
|
717
717
|
var _el$12 = _tmpl$7();
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
class:
|
|
718
|
+
use((node)=>setItemRef(queuedToast.key, node), _el$12);
|
|
719
|
+
spread(_el$12, mergeProps(()=>({
|
|
720
|
+
class: twMerge(CLASSES.Provider.item.base, CLASSES.Provider.item.placement[placement()], hidden() && CLASSES.Provider.item.state.hidden)
|
|
721
721
|
}), {
|
|
722
722
|
"data-slot": "toast-region-item",
|
|
723
723
|
get ["data-index"] () {
|
|
@@ -733,12 +733,12 @@ const ToastProvider = (props)=>{
|
|
|
733
733
|
return itemStyle();
|
|
734
734
|
}
|
|
735
735
|
}), false, true);
|
|
736
|
-
|
|
736
|
+
insert(_el$12, createComponent(Show, {
|
|
737
737
|
get when () {
|
|
738
738
|
return local.renderToast;
|
|
739
739
|
},
|
|
740
740
|
get fallback () {
|
|
741
|
-
return
|
|
741
|
+
return createComponent(ToastRoot, {
|
|
742
742
|
get title () {
|
|
743
743
|
return queuedToast.content.title;
|
|
744
744
|
},
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var __webpack_exports__DEFAULT_MAX_VISIBLE_TOAST = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_MAX_VISIBLE_TOAST;
|
|
4
|
-
var __webpack_exports__DEFAULT_SCALE_FACTOR = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_SCALE_FACTOR;
|
|
5
|
-
var __webpack_exports__DEFAULT_TOAST_TIMEOUT = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_TOAST_TIMEOUT;
|
|
6
|
-
var __webpack_exports__DEFAULT_TOAST_WIDTH = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_TOAST_WIDTH;
|
|
7
|
-
var __webpack_exports__ToastActionButton = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastActionButton;
|
|
8
|
-
var __webpack_exports__ToastCloseButton = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastCloseButton;
|
|
9
|
-
var __webpack_exports__ToastContent = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastContent;
|
|
10
|
-
var __webpack_exports__ToastDescription = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastDescription;
|
|
11
|
-
var __webpack_exports__ToastIndicator = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastIndicator;
|
|
12
|
-
var __webpack_exports__ToastProvider = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastProvider;
|
|
13
|
-
var __webpack_exports__ToastQueue = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastQueue;
|
|
14
|
-
var __webpack_exports__ToastRoot = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastRoot;
|
|
15
|
-
var __webpack_exports__ToastTitle = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastTitle;
|
|
16
|
-
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__["default"];
|
|
17
|
-
var __webpack_exports__toast = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.toast;
|
|
18
|
-
var __webpack_exports__toastQueue = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.toastQueue;
|
|
19
|
-
export { __webpack_exports__DEFAULT_GAP as DEFAULT_GAP, __webpack_exports__DEFAULT_MAX_VISIBLE_TOAST as DEFAULT_MAX_VISIBLE_TOAST, __webpack_exports__DEFAULT_SCALE_FACTOR as DEFAULT_SCALE_FACTOR, __webpack_exports__DEFAULT_TOAST_TIMEOUT as DEFAULT_TOAST_TIMEOUT, __webpack_exports__DEFAULT_TOAST_WIDTH as DEFAULT_TOAST_WIDTH, __webpack_exports__ToastActionButton as ToastActionButton, __webpack_exports__ToastCloseButton as ToastCloseButton, __webpack_exports__ToastContent as ToastContent, __webpack_exports__ToastDescription as ToastDescription, __webpack_exports__ToastIndicator as ToastIndicator, __webpack_exports__ToastProvider as ToastProvider, __webpack_exports__ToastQueue as ToastQueue, __webpack_exports__ToastRoot as ToastRoot, __webpack_exports__ToastTitle as ToastTitle, __webpack_exports__default as default, __webpack_exports__toast as toast, __webpack_exports__toastQueue as toastQueue };
|
|
1
|
+
import external_Toast_js_default, { DEFAULT_GAP, DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_SCALE_FACTOR, DEFAULT_TOAST_TIMEOUT, DEFAULT_TOAST_WIDTH, ToastActionButton, ToastCloseButton, ToastContent, ToastDescription, ToastIndicator, ToastProvider, ToastQueue, ToastRoot, ToastTitle, toast, toastQueue } from "./Toast.js";
|
|
2
|
+
export { DEFAULT_GAP, DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_SCALE_FACTOR, DEFAULT_TOAST_TIMEOUT, DEFAULT_TOAST_WIDTH, ToastActionButton, ToastCloseButton, ToastContent, ToastDescription, ToastIndicator, ToastProvider, ToastQueue, ToastRoot, ToastTitle, external_Toast_js_default as default, toast, toastQueue };
|