@pathscale/ui 1.1.43 → 1.1.45
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 +51 -0
- package/dist/components/drawer/Drawer.d.ts +7 -0
- package/dist/components/drawer/Drawer.js +105 -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,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
2
2
|
import "./Toggle.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/
|
|
3
|
+
import { Show, createSignal, splitProps } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { CLASSES } from "./Toggle.classes.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template("<span>"), _tmpl$2 = /*#__PURE__*/ template("<span data-slot=label>"), _tmpl$3 = /*#__PURE__*/ template("<label><input><span><span>");
|
|
7
7
|
const invokeEventHandler = (handler, event)=>{
|
|
8
8
|
if ("function" == typeof handler) return void handler(event);
|
|
9
9
|
if (Array.isArray(handler) && "function" == typeof handler[0]) handler[0](handler[1], event);
|
|
10
10
|
};
|
|
11
|
-
const
|
|
12
|
-
const [local, others] =
|
|
11
|
+
const Toggle = (props)=>{
|
|
12
|
+
const [local, others] = splitProps(props, [
|
|
13
13
|
"class",
|
|
14
14
|
"className",
|
|
15
15
|
"children",
|
|
@@ -24,7 +24,7 @@ const Toggle_Toggle = (props)=>{
|
|
|
24
24
|
"onChange",
|
|
25
25
|
"dataTheme"
|
|
26
26
|
]);
|
|
27
|
-
const [internalSelected, setInternalSelected] =
|
|
27
|
+
const [internalSelected, setInternalSelected] = createSignal(Boolean(local.defaultChecked));
|
|
28
28
|
const isControlled = ()=>void 0 !== local.checked;
|
|
29
29
|
const isSelected = ()=>isControlled() ? Boolean(local.checked) : internalSelected();
|
|
30
30
|
const isDisabled = ()=>Boolean(local.isDisabled) || Boolean(local.disabled);
|
|
@@ -39,8 +39,8 @@ const Toggle_Toggle = (props)=>{
|
|
|
39
39
|
};
|
|
40
40
|
return (()=>{
|
|
41
41
|
var _el$ = _tmpl$3(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
|
|
42
|
-
|
|
43
|
-
class:
|
|
42
|
+
spread(_el$, mergeProps(()=>({
|
|
43
|
+
class: twMerge(CLASSES.base, CLASSES.size[size()], CLASSES.color[color()], isDisabled() && CLASSES.flag.disabled, local.class, local.className)
|
|
44
44
|
}), {
|
|
45
45
|
get ["data-theme"] () {
|
|
46
46
|
return local.dataTheme;
|
|
@@ -56,11 +56,11 @@ const Toggle_Toggle = (props)=>{
|
|
|
56
56
|
return isDisabled() ? "true" : "false";
|
|
57
57
|
}
|
|
58
58
|
}), false, true);
|
|
59
|
-
|
|
59
|
+
spread(_el$2, mergeProps(others, {
|
|
60
60
|
type: "checkbox",
|
|
61
61
|
role: "switch"
|
|
62
62
|
}, ()=>({
|
|
63
|
-
class:
|
|
63
|
+
class: CLASSES.slot.input
|
|
64
64
|
}), {
|
|
65
65
|
"data-slot": "toggle-input",
|
|
66
66
|
get checked () {
|
|
@@ -71,65 +71,65 @@ const Toggle_Toggle = (props)=>{
|
|
|
71
71
|
},
|
|
72
72
|
onChange: handleChange
|
|
73
73
|
}), false, false);
|
|
74
|
-
|
|
75
|
-
class:
|
|
74
|
+
spread(_el$3, mergeProps(()=>({
|
|
75
|
+
class: CLASSES.slot.control
|
|
76
76
|
}), {
|
|
77
77
|
"data-slot": "toggle-control",
|
|
78
78
|
"aria-hidden": "true"
|
|
79
79
|
}), false, true);
|
|
80
|
-
|
|
81
|
-
class:
|
|
80
|
+
spread(_el$4, mergeProps(()=>({
|
|
81
|
+
class: CLASSES.slot.thumb
|
|
82
82
|
}), {
|
|
83
83
|
"data-slot": "toggle-thumb"
|
|
84
84
|
}), false, true);
|
|
85
|
-
|
|
85
|
+
insert(_el$4, createComponent(Show, {
|
|
86
86
|
get when () {
|
|
87
87
|
return local.icon;
|
|
88
88
|
},
|
|
89
89
|
get children () {
|
|
90
90
|
var _el$5 = _tmpl$();
|
|
91
|
-
|
|
92
|
-
class:
|
|
91
|
+
spread(_el$5, mergeProps(()=>({
|
|
92
|
+
class: CLASSES.slot.icon
|
|
93
93
|
}), {
|
|
94
94
|
"data-slot": "toggle-icon"
|
|
95
95
|
}), false, true);
|
|
96
|
-
|
|
96
|
+
insert(_el$5, ()=>local.icon);
|
|
97
97
|
return _el$5;
|
|
98
98
|
}
|
|
99
99
|
}));
|
|
100
|
-
|
|
100
|
+
insert(_el$, createComponent(Show, {
|
|
101
101
|
get when () {
|
|
102
102
|
return hasContent();
|
|
103
103
|
},
|
|
104
104
|
get children () {
|
|
105
105
|
var _el$6 = _tmpl$();
|
|
106
|
-
|
|
107
|
-
class:
|
|
106
|
+
spread(_el$6, mergeProps(()=>({
|
|
107
|
+
class: CLASSES.slot.content
|
|
108
108
|
}), {
|
|
109
109
|
"data-slot": "toggle-content"
|
|
110
110
|
}), false, true);
|
|
111
|
-
|
|
111
|
+
insert(_el$6, createComponent(Show, {
|
|
112
112
|
get when () {
|
|
113
113
|
return local.children;
|
|
114
114
|
},
|
|
115
115
|
get children () {
|
|
116
116
|
var _el$7 = _tmpl$2();
|
|
117
|
-
|
|
117
|
+
insert(_el$7, ()=>local.children);
|
|
118
118
|
return _el$7;
|
|
119
119
|
}
|
|
120
120
|
}), null);
|
|
121
|
-
|
|
121
|
+
insert(_el$6, createComponent(Show, {
|
|
122
122
|
get when () {
|
|
123
123
|
return local.description;
|
|
124
124
|
},
|
|
125
125
|
get children () {
|
|
126
126
|
var _el$8 = _tmpl$();
|
|
127
|
-
|
|
128
|
-
class:
|
|
127
|
+
spread(_el$8, mergeProps(()=>({
|
|
128
|
+
class: CLASSES.slot.description
|
|
129
129
|
}), {
|
|
130
130
|
"data-slot": "description"
|
|
131
131
|
}), false, true);
|
|
132
|
-
|
|
132
|
+
insert(_el$8, ()=>local.description);
|
|
133
133
|
return _el$8;
|
|
134
134
|
}
|
|
135
135
|
}), null);
|
|
@@ -139,5 +139,5 @@ const Toggle_Toggle = (props)=>{
|
|
|
139
139
|
return _el$;
|
|
140
140
|
})();
|
|
141
141
|
};
|
|
142
|
-
const
|
|
143
|
-
export {
|
|
142
|
+
const toggle_Toggle = Toggle;
|
|
143
|
+
export { toggle_Toggle as default };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { __webpack_exports__default as default };
|
|
1
|
+
import external_Toggle_js_default from "./Toggle.js";
|
|
2
|
+
export { external_Toggle_js_default as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { insert, mergeProps, spread, template, use } from "solid-js/web";
|
|
2
2
|
import "./Toolbar.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { CLASSES } from "./Toolbar.classes.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template("<div>");
|
|
7
7
|
const FOCUSABLE_SELECTOR = 'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
|
|
8
8
|
const isFocusableElement = (element)=>{
|
|
9
9
|
if ("true" === element.getAttribute("aria-disabled")) return false;
|
|
@@ -17,7 +17,7 @@ const isTypingContext = (target)=>{
|
|
|
17
17
|
};
|
|
18
18
|
const getFocusableElements = (root)=>Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR)).filter(isFocusableElement);
|
|
19
19
|
const ToolbarRoot = (props)=>{
|
|
20
|
-
const [local, others] =
|
|
20
|
+
const [local, others] = splitProps(props, [
|
|
21
21
|
"children",
|
|
22
22
|
"class",
|
|
23
23
|
"className",
|
|
@@ -60,11 +60,11 @@ const ToolbarRoot = (props)=>{
|
|
|
60
60
|
};
|
|
61
61
|
return (()=>{
|
|
62
62
|
var _el$ = _tmpl$();
|
|
63
|
-
|
|
63
|
+
use((el)=>{
|
|
64
64
|
rootRef = el;
|
|
65
65
|
if ("function" == typeof local.ref) local.ref(el);
|
|
66
66
|
}, _el$);
|
|
67
|
-
|
|
67
|
+
spread(_el$, mergeProps(others, {
|
|
68
68
|
get role () {
|
|
69
69
|
return local.role ?? "toolbar";
|
|
70
70
|
},
|
|
@@ -83,9 +83,9 @@ const ToolbarRoot = (props)=>{
|
|
|
83
83
|
},
|
|
84
84
|
onKeyDown: handleKeyDown
|
|
85
85
|
}, ()=>({
|
|
86
|
-
class:
|
|
86
|
+
class: twMerge(CLASSES.base, CLASSES.orientation[orientation()], local.isAttached && CLASSES.flag.attached, local.class, local.className)
|
|
87
87
|
})), false, true);
|
|
88
|
-
|
|
88
|
+
insert(_el$, ()=>local.children);
|
|
89
89
|
return _el$;
|
|
90
90
|
})();
|
|
91
91
|
};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var __webpack_exports__ToolbarRoot = __WEBPACK_EXTERNAL_MODULE__Toolbar_js_4fa4486a__.ToolbarRoot;
|
|
4
|
-
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Toolbar_js_4fa4486a__["default"];
|
|
5
|
-
export { __webpack_exports__Toolbar as Toolbar, __webpack_exports__ToolbarRoot as ToolbarRoot, __webpack_exports__default as default };
|
|
1
|
+
import external_Toolbar_js_default, { Toolbar, ToolbarRoot } from "./Toolbar.js";
|
|
2
|
+
export { Toolbar, ToolbarRoot, external_Toolbar_js_default as default };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createComponent, insert, mergeProps, spread, template, use } from "solid-js/web";
|
|
2
2
|
import "./Tooltip.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/
|
|
7
|
-
const TooltipContext =
|
|
3
|
+
import { Show, createContext, createSignal, onCleanup, splitProps, useContext } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { CLASSES } from "./Tooltip.classes.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template("<span>"), _tmpl$2 = /*#__PURE__*/ template("<div>"), _tmpl$3 = /*#__PURE__*/ template('<svg aria-hidden=true data-slot=tooltip-arrow-svg height=12 viewBox="0 0 12 12"width=12 xmlns=http://www.w3.org/2000/svg><path d="M0 0C5.48483 8 6.5 8 12 0Z"fill=currentColor>');
|
|
7
|
+
const TooltipContext = createContext();
|
|
8
8
|
const useTooltipContext = ()=>{
|
|
9
|
-
const ctx =
|
|
9
|
+
const ctx = useContext(TooltipContext);
|
|
10
10
|
if (!ctx) throw new Error("Tooltip compound components must be used within <Tooltip>");
|
|
11
11
|
return ctx;
|
|
12
12
|
};
|
|
13
13
|
const TooltipRoot = (props)=>{
|
|
14
|
-
const [local, _others] =
|
|
14
|
+
const [local, _others] = splitProps(props, [
|
|
15
15
|
"children",
|
|
16
16
|
"placement",
|
|
17
17
|
"showArrow",
|
|
@@ -25,8 +25,8 @@ const TooltipRoot = (props)=>{
|
|
|
25
25
|
"className",
|
|
26
26
|
"style"
|
|
27
27
|
]);
|
|
28
|
-
const [internalOpen, setInternalOpen] =
|
|
29
|
-
const [triggerRef, setTriggerRef] =
|
|
28
|
+
const [internalOpen, setInternalOpen] = createSignal(Boolean(local.defaultOpen));
|
|
29
|
+
const [triggerRef, setTriggerRef] = createSignal();
|
|
30
30
|
const isControlled = ()=>void 0 !== local.isOpen;
|
|
31
31
|
const isOpen = ()=>isControlled() ? Boolean(local.isOpen) : internalOpen();
|
|
32
32
|
const setIsOpen = (v)=>{
|
|
@@ -41,12 +41,12 @@ const TooltipRoot = (props)=>{
|
|
|
41
41
|
triggerRef,
|
|
42
42
|
setTriggerRef
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return createComponent(TooltipContext.Provider, {
|
|
45
45
|
value: ctx,
|
|
46
46
|
get children () {
|
|
47
47
|
var _el$ = _tmpl$();
|
|
48
|
-
|
|
49
|
-
class:
|
|
48
|
+
spread(_el$, mergeProps(()=>({
|
|
49
|
+
class: twMerge(CLASSES.base, local.class, local.className)
|
|
50
50
|
}), {
|
|
51
51
|
"data-slot": "tooltip-root",
|
|
52
52
|
get ["data-theme"] () {
|
|
@@ -56,13 +56,13 @@ const TooltipRoot = (props)=>{
|
|
|
56
56
|
return local.style;
|
|
57
57
|
}
|
|
58
58
|
}), false, true);
|
|
59
|
-
|
|
59
|
+
insert(_el$, ()=>local.children);
|
|
60
60
|
return _el$;
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
const TooltipTrigger = (props)=>{
|
|
65
|
-
const [local, others] =
|
|
65
|
+
const [local, others] = splitProps(props, [
|
|
66
66
|
"children",
|
|
67
67
|
"class",
|
|
68
68
|
"className",
|
|
@@ -76,7 +76,7 @@ const TooltipTrigger = (props)=>{
|
|
|
76
76
|
const ctx = useTooltipContext();
|
|
77
77
|
let delayTimer;
|
|
78
78
|
let closeTimer;
|
|
79
|
-
|
|
79
|
+
onCleanup(()=>{
|
|
80
80
|
clearTimeout(delayTimer);
|
|
81
81
|
clearTimeout(closeTimer);
|
|
82
82
|
});
|
|
@@ -100,9 +100,9 @@ const TooltipTrigger = (props)=>{
|
|
|
100
100
|
};
|
|
101
101
|
return (()=>{
|
|
102
102
|
var _el$2 = _tmpl$2();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class:
|
|
103
|
+
use((el)=>ctx.setTriggerRef(el), _el$2);
|
|
104
|
+
spread(_el$2, mergeProps(others, ()=>({
|
|
105
|
+
class: twMerge(CLASSES.slot.trigger, local.class, local.className)
|
|
106
106
|
}), {
|
|
107
107
|
"data-slot": "tooltip-trigger",
|
|
108
108
|
get ["data-theme"] () {
|
|
@@ -116,12 +116,12 @@ const TooltipTrigger = (props)=>{
|
|
|
116
116
|
onFocusIn: handleFocusIn,
|
|
117
117
|
onFocusOut: handleFocusOut
|
|
118
118
|
}), false, true);
|
|
119
|
-
|
|
119
|
+
insert(_el$2, ()=>local.children);
|
|
120
120
|
return _el$2;
|
|
121
121
|
})();
|
|
122
122
|
};
|
|
123
123
|
const TooltipContent = (props)=>{
|
|
124
|
-
const [local, others] =
|
|
124
|
+
const [local, others] = splitProps(props, [
|
|
125
125
|
"children",
|
|
126
126
|
"class",
|
|
127
127
|
"className",
|
|
@@ -131,10 +131,10 @@ const TooltipContent = (props)=>{
|
|
|
131
131
|
const ctx = useTooltipContext();
|
|
132
132
|
return (()=>{
|
|
133
133
|
var _el$3 = _tmpl$2();
|
|
134
|
-
|
|
134
|
+
spread(_el$3, mergeProps(others, {
|
|
135
135
|
role: "tooltip"
|
|
136
136
|
}, ()=>({
|
|
137
|
-
class:
|
|
137
|
+
class: twMerge(CLASSES.slot.content, local.class, local.className)
|
|
138
138
|
}), {
|
|
139
139
|
"data-slot": "tooltip-content",
|
|
140
140
|
get ["data-placement"] () {
|
|
@@ -150,12 +150,12 @@ const TooltipContent = (props)=>{
|
|
|
150
150
|
return local.style;
|
|
151
151
|
}
|
|
152
152
|
}), false, true);
|
|
153
|
-
|
|
153
|
+
insert(_el$3, ()=>local.children);
|
|
154
154
|
return _el$3;
|
|
155
155
|
})();
|
|
156
156
|
};
|
|
157
157
|
const TooltipArrow = (props)=>{
|
|
158
|
-
const [local, others] =
|
|
158
|
+
const [local, others] = splitProps(props, [
|
|
159
159
|
"children",
|
|
160
160
|
"class",
|
|
161
161
|
"className",
|
|
@@ -166,8 +166,8 @@ const TooltipArrow = (props)=>{
|
|
|
166
166
|
const defaultArrow = _tmpl$3();
|
|
167
167
|
return (()=>{
|
|
168
168
|
var _el$5 = _tmpl$();
|
|
169
|
-
|
|
170
|
-
class:
|
|
169
|
+
spread(_el$5, mergeProps(others, ()=>({
|
|
170
|
+
class: twMerge(CLASSES.slot.arrow, local.class, local.className)
|
|
171
171
|
}), {
|
|
172
172
|
"data-slot": "tooltip-arrow",
|
|
173
173
|
get ["data-placement"] () {
|
|
@@ -181,7 +181,7 @@ const TooltipArrow = (props)=>{
|
|
|
181
181
|
},
|
|
182
182
|
"aria-hidden": "true"
|
|
183
183
|
}), false, true);
|
|
184
|
-
|
|
184
|
+
insert(_el$5, createComponent(Show, {
|
|
185
185
|
get when () {
|
|
186
186
|
return local.children;
|
|
187
187
|
},
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var __webpack_exports__TooltipContent = __WEBPACK_EXTERNAL_MODULE__Tooltip_js_5e198f9c__.TooltipContent;
|
|
4
|
-
var __webpack_exports__TooltipRoot = __WEBPACK_EXTERNAL_MODULE__Tooltip_js_5e198f9c__.TooltipRoot;
|
|
5
|
-
var __webpack_exports__TooltipTrigger = __WEBPACK_EXTERNAL_MODULE__Tooltip_js_5e198f9c__.TooltipTrigger;
|
|
6
|
-
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Tooltip_js_5e198f9c__["default"];
|
|
7
|
-
export { __webpack_exports__TooltipArrow as TooltipArrow, __webpack_exports__TooltipContent as TooltipContent, __webpack_exports__TooltipRoot as TooltipRoot, __webpack_exports__TooltipTrigger as TooltipTrigger, __webpack_exports__default as default };
|
|
1
|
+
import external_Tooltip_js_default, { TooltipArrow, TooltipContent, TooltipRoot, TooltipTrigger } from "./Tooltip.js";
|
|
2
|
+
export { TooltipArrow, TooltipContent, TooltipRoot, TooltipTrigger, external_Tooltip_js_default as default };
|
package/dist/components/utils.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Dynamic, createComponent, mergeProps } from "solid-js/web";
|
|
2
|
+
import { breakpoints } from "./types.js";
|
|
3
|
+
import { useDesktop } from "../hooks/layout/index.js";
|
|
4
4
|
function isJSXElement(node) {
|
|
5
5
|
return "object" == typeof node && null !== node;
|
|
6
6
|
}
|
|
7
7
|
function wrapWithElementIfInvalid({ node, wrapper = "div", className = "" }) {
|
|
8
8
|
null == node || "string" == typeof node || "number" == typeof node || isJSXElement(node);
|
|
9
|
-
return
|
|
9
|
+
return createComponent(Dynamic, mergeProps({
|
|
10
10
|
component: wrapper
|
|
11
11
|
}, {
|
|
12
12
|
class: className
|
|
@@ -19,7 +19,7 @@ function mapResponsiveProp(prop, classMap) {
|
|
|
19
19
|
if ("string" == typeof prop || "boolean" == typeof prop) return [
|
|
20
20
|
classMap[String(prop)]
|
|
21
21
|
];
|
|
22
|
-
return
|
|
22
|
+
return breakpoints.flatMap((bp)=>{
|
|
23
23
|
const value = prop[bp];
|
|
24
24
|
if (void 0 === value) return [];
|
|
25
25
|
const className = classMap[String(value)];
|
|
@@ -30,5 +30,4 @@ function mapResponsiveProp(prop, classMap) {
|
|
|
30
30
|
];
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
export { mapResponsiveProp, wrapWithElementIfInvalid, __webpack_exports__useDesktop as useDesktop };
|
|
33
|
+
export { mapResponsiveProp, useDesktop, wrapWithElementIfInvalid };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
var _tmpl$ = /*#__PURE__*/
|
|
6
|
-
const
|
|
7
|
-
const [local, others] =
|
|
1
|
+
import { createComponent, mergeProps, spread, template, use } from "solid-js/web";
|
|
2
|
+
import { Show, createEffect, onCleanup, splitProps } from "solid-js";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { CLASSES } from "./VideoPreview.classes.js";
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ template("<video>");
|
|
6
|
+
const VideoPreview_VideoPreview = (props)=>{
|
|
7
|
+
const [local, others] = splitProps(props, [
|
|
8
8
|
"stream",
|
|
9
9
|
"muted",
|
|
10
10
|
"mirror",
|
|
@@ -15,23 +15,23 @@ const VideoPreview = (props)=>{
|
|
|
15
15
|
]);
|
|
16
16
|
const muted = ()=>local.muted ?? true;
|
|
17
17
|
const mirror = ()=>local.mirror ?? false;
|
|
18
|
-
return
|
|
18
|
+
return createComponent(Show, {
|
|
19
19
|
get when () {
|
|
20
20
|
return local.stream();
|
|
21
21
|
},
|
|
22
22
|
children: (stream)=>{
|
|
23
23
|
let videoRef;
|
|
24
|
-
|
|
24
|
+
createEffect(()=>{
|
|
25
25
|
videoRef.srcObject = stream();
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
onCleanup(()=>{
|
|
28
28
|
videoRef.srcObject = null;
|
|
29
29
|
});
|
|
30
30
|
return (()=>{
|
|
31
31
|
var _el$ = _tmpl$();
|
|
32
32
|
var _ref$ = videoRef;
|
|
33
|
-
"function" == typeof _ref$ ?
|
|
34
|
-
|
|
33
|
+
"function" == typeof _ref$ ? use(_ref$, _el$) : videoRef = _el$;
|
|
34
|
+
spread(_el$, mergeProps(others, {
|
|
35
35
|
autoplay: true,
|
|
36
36
|
playsinline: true,
|
|
37
37
|
get muted () {
|
|
@@ -41,7 +41,7 @@ const VideoPreview = (props)=>{
|
|
|
41
41
|
return local.dataTheme;
|
|
42
42
|
}
|
|
43
43
|
}, ()=>({
|
|
44
|
-
class:
|
|
44
|
+
class: twMerge(mirror() && CLASSES.mirror, local.class, local.className)
|
|
45
45
|
}), {
|
|
46
46
|
get style () {
|
|
47
47
|
return local.style;
|
|
@@ -52,5 +52,5 @@ const VideoPreview = (props)=>{
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
const
|
|
56
|
-
export { VideoPreview,
|
|
55
|
+
const VideoPreview = VideoPreview_VideoPreview;
|
|
56
|
+
export { VideoPreview_VideoPreview as VideoPreview, VideoPreview as default };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { __webpack_exports__VideoPreview as VideoPreview };
|
|
1
|
+
import external_VideoPreview_js_default from "./VideoPreview.js";
|
|
2
|
+
export { external_VideoPreview_js_default as VideoPreview };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { createMemo, createSignal } from "solid-js";
|
|
2
|
+
import { addDays, addMonths, compareMonths, isSameMonth, shiftDateByMonths, startOfMonth } from "./date.utils.js";
|
|
3
3
|
const useCalendarNavigation = (options)=>{
|
|
4
|
-
const [visibleMonth, setVisibleMonth] =
|
|
5
|
-
const [focusedDate, setFocusedDate] =
|
|
4
|
+
const [visibleMonth, setVisibleMonth] = createSignal(startOfMonth(options.initialFocusedDate()));
|
|
5
|
+
const [focusedDate, setFocusedDate] = createSignal(options.initialFocusedDate());
|
|
6
6
|
const clampVisibleMonth = (nextVisibleMonth)=>{
|
|
7
7
|
const min = options.minDate();
|
|
8
8
|
const max = options.maxDate();
|
|
9
|
-
if (min &&
|
|
10
|
-
if (max &&
|
|
9
|
+
if (min && compareMonths(nextVisibleMonth, startOfMonth(min)) < 0) return startOfMonth(min);
|
|
10
|
+
if (max && compareMonths(nextVisibleMonth, startOfMonth(max)) > 0) return startOfMonth(max);
|
|
11
11
|
return nextVisibleMonth;
|
|
12
12
|
};
|
|
13
13
|
const setVisibleMonthFromDate = (date)=>{
|
|
14
|
-
const nextMonth =
|
|
15
|
-
if (!
|
|
14
|
+
const nextMonth = startOfMonth(date);
|
|
15
|
+
if (!isSameMonth(nextMonth, visibleMonth())) setVisibleMonth(clampVisibleMonth(nextMonth));
|
|
16
16
|
};
|
|
17
17
|
const findNearestEnabledDate = (startDate, direction)=>{
|
|
18
18
|
let current = startDate;
|
|
19
19
|
for(let index = 0; index < 400; index += 1){
|
|
20
20
|
if (!options.isDateDisabled(current)) return current;
|
|
21
|
-
current =
|
|
21
|
+
current = addDays(current, direction);
|
|
22
22
|
}
|
|
23
23
|
return startDate;
|
|
24
24
|
};
|
|
@@ -29,24 +29,24 @@ const useCalendarNavigation = (options)=>{
|
|
|
29
29
|
return nextFocus;
|
|
30
30
|
};
|
|
31
31
|
const navigateMonth = (direction)=>{
|
|
32
|
-
const nextMonth = clampVisibleMonth(
|
|
33
|
-
if (
|
|
32
|
+
const nextMonth = clampVisibleMonth(addMonths(visibleMonth(), direction));
|
|
33
|
+
if (isSameMonth(nextMonth, visibleMonth())) return null;
|
|
34
34
|
setVisibleMonth(nextMonth);
|
|
35
|
-
const nextFocus = findNearestEnabledDate(
|
|
35
|
+
const nextFocus = findNearestEnabledDate(shiftDateByMonths(focusedDate(), direction), direction);
|
|
36
36
|
setFocusedDate(nextFocus);
|
|
37
37
|
return nextFocus;
|
|
38
38
|
};
|
|
39
|
-
const canNavigatePrevious =
|
|
40
|
-
const previousMonth =
|
|
39
|
+
const canNavigatePrevious = createMemo(()=>{
|
|
40
|
+
const previousMonth = addMonths(visibleMonth(), -1);
|
|
41
41
|
const min = options.minDate();
|
|
42
42
|
if (!min) return true;
|
|
43
|
-
return
|
|
43
|
+
return compareMonths(previousMonth, startOfMonth(min)) >= 0;
|
|
44
44
|
});
|
|
45
|
-
const canNavigateNext =
|
|
46
|
-
const nextMonth =
|
|
45
|
+
const canNavigateNext = createMemo(()=>{
|
|
46
|
+
const nextMonth = addMonths(visibleMonth(), 1);
|
|
47
47
|
const max = options.maxDate();
|
|
48
48
|
if (!max) return true;
|
|
49
|
-
return
|
|
49
|
+
return compareMonths(nextMonth, startOfMonth(max)) <= 0;
|
|
50
50
|
});
|
|
51
51
|
const syncFocusedDate = (value)=>{
|
|
52
52
|
if (!value) return;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { createMemo } from "solid-js";
|
|
2
|
+
import { addDays, buildCalendarGrid, compareDates, createPreviewRange, getToday, isSameDay, isSameMonth, normalizeRange, splitWeeks } from "./date.utils.js";
|
|
3
3
|
const useCalendarState = (options)=>{
|
|
4
|
-
const monthFormatter =
|
|
4
|
+
const monthFormatter = createMemo(()=>new Intl.DateTimeFormat(options.locale(), {
|
|
5
5
|
month: "long",
|
|
6
6
|
year: "numeric"
|
|
7
7
|
}));
|
|
8
|
-
const dayLabelFormatter =
|
|
8
|
+
const dayLabelFormatter = createMemo(()=>new Intl.DateTimeFormat(options.locale(), {
|
|
9
9
|
dateStyle: "full"
|
|
10
10
|
}));
|
|
11
|
-
const weekdayFormatter =
|
|
11
|
+
const weekdayFormatter = createMemo(()=>new Intl.DateTimeFormat(options.locale(), {
|
|
12
12
|
weekday: options.weekdayFormat()
|
|
13
13
|
}));
|
|
14
|
-
const weekdayLabels =
|
|
14
|
+
const weekdayLabels = createMemo(()=>{
|
|
15
15
|
const firstSunday = new Date(2024, 0, 7, 12, 0, 0, 0);
|
|
16
16
|
return Array.from({
|
|
17
17
|
length: 7
|
|
18
|
-
}, (_, index)=>weekdayFormatter().format(
|
|
18
|
+
}, (_, index)=>weekdayFormatter().format(addDays(firstSunday, index)));
|
|
19
19
|
});
|
|
20
|
-
const calendarWeeks =
|
|
21
|
-
const normalizedRange =
|
|
22
|
-
const previewRange =
|
|
23
|
-
const todayDate =
|
|
20
|
+
const calendarWeeks = createMemo(()=>splitWeeks(buildCalendarGrid(options.visibleMonth(), 0)));
|
|
21
|
+
const normalizedRange = createMemo(()=>normalizeRange(options.rangeStart(), options.rangeEnd()));
|
|
22
|
+
const previewRange = createMemo(()=>createPreviewRange(normalizedRange().start, normalizedRange().end, options.rangePreview()));
|
|
23
|
+
const todayDate = createMemo(()=>getToday());
|
|
24
24
|
const getCellState = (date)=>{
|
|
25
25
|
const mode = options.selectionMode();
|
|
26
26
|
const selectedDate = options.selectedDate();
|
|
27
27
|
const normalized = normalizedRange();
|
|
28
28
|
const preview = previewRange();
|
|
29
|
-
const isOutsideMonth = !
|
|
30
|
-
const isSelected = "single" === mode && null !== selectedDate &&
|
|
31
|
-
const isRangeStart = "range" === mode && null !== normalized.start &&
|
|
32
|
-
const isRangeEnd = "range" === mode && null !== normalized.end &&
|
|
33
|
-
const isInCommittedRange = "range" === mode && null !== normalized.start && null !== normalized.end &&
|
|
34
|
-
const isInPreviewRange = "range" === mode && null !== preview.start && null !== preview.end &&
|
|
29
|
+
const isOutsideMonth = !isSameMonth(date, options.visibleMonth());
|
|
30
|
+
const isSelected = "single" === mode && null !== selectedDate && isSameDay(date, selectedDate);
|
|
31
|
+
const isRangeStart = "range" === mode && null !== normalized.start && isSameDay(date, normalized.start);
|
|
32
|
+
const isRangeEnd = "range" === mode && null !== normalized.end && isSameDay(date, normalized.end);
|
|
33
|
+
const isInCommittedRange = "range" === mode && null !== normalized.start && null !== normalized.end && compareDates(date, normalized.start) >= 0 && compareDates(date, normalized.end) <= 0;
|
|
34
|
+
const isInPreviewRange = "range" === mode && null !== preview.start && null !== preview.end && compareDates(date, preview.start) >= 0 && compareDates(date, preview.end) <= 0;
|
|
35
35
|
const isInRange = isInCommittedRange || isInPreviewRange;
|
|
36
|
-
const isToday =
|
|
36
|
+
const isToday = isSameDay(date, todayDate());
|
|
37
37
|
const isUnavailable = options.isDateUnavailable(date);
|
|
38
38
|
const isDisabled = options.isDateDisabled(date);
|
|
39
|
-
const isFocused =
|
|
39
|
+
const isFocused = isSameDay(date, options.focusedDate());
|
|
40
40
|
const isAriaSelected = "range" === mode ? isRangeStart || isRangeEnd || isInRange : isSelected;
|
|
41
41
|
return {
|
|
42
42
|
isOutsideMonth,
|