@invopop/popui 0.0.103 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog.svelte +84 -59
- package/dist/AlertDialog.svelte.d.ts +5 -29
- package/dist/BaseButton.svelte +106 -101
- package/dist/BaseButton.svelte.d.ts +4 -34
- package/dist/BaseCard.svelte +20 -12
- package/dist/BaseCard.svelte.d.ts +4 -26
- package/dist/BaseCounter.svelte +13 -9
- package/dist/BaseCounter.svelte.d.ts +4 -17
- package/dist/BaseDropdown.svelte +54 -38
- package/dist/BaseDropdown.svelte.d.ts +6 -26
- package/dist/BaseFlag.svelte +6 -4
- package/dist/BaseFlag.svelte.d.ts +4 -17
- package/dist/BaseTable.svelte +226 -188
- package/dist/BaseTable.svelte.d.ts +4 -39
- package/dist/BaseTableActions.svelte +43 -33
- package/dist/BaseTableActions.svelte.d.ts +6 -21
- package/dist/BaseTableCellContent.svelte +19 -13
- package/dist/BaseTableCellContent.svelte.d.ts +4 -24
- package/dist/BaseTableCheckbox.svelte +19 -12
- package/dist/BaseTableCheckbox.svelte.d.ts +4 -21
- package/dist/BaseTableHeaderContent.svelte +30 -22
- package/dist/BaseTableHeaderContent.svelte.d.ts +4 -21
- package/dist/BaseTableHeaderOrderBy.svelte +24 -0
- package/dist/BaseTableHeaderOrderBy.svelte.d.ts +4 -0
- package/dist/BaseTableRow.svelte +78 -60
- package/dist/BaseTableRow.svelte.d.ts +4 -32
- package/dist/Breadcrumbs.svelte +14 -10
- package/dist/Breadcrumbs.svelte.d.ts +4 -19
- package/dist/ButtonFile.svelte +40 -29
- package/dist/ButtonFile.svelte.d.ts +4 -26
- package/dist/ButtonUuidCopy.svelte +27 -20
- package/dist/ButtonUuidCopy.svelte.d.ts +4 -22
- package/dist/CardCheckbox.svelte +28 -19
- package/dist/CardCheckbox.svelte.d.ts +4 -28
- package/dist/CardRelation.svelte +9 -8
- package/dist/CardRelation.svelte.d.ts +4 -22
- package/dist/CompanySelector.svelte +49 -43
- package/dist/CompanySelector.svelte.d.ts +4 -22
- package/dist/CounterWorkflow.svelte +12 -8
- package/dist/CounterWorkflow.svelte.d.ts +4 -17
- package/dist/DataListItem.svelte +24 -14
- package/dist/DataListItem.svelte.d.ts +4 -22
- package/dist/DatePicker.svelte +186 -386
- package/dist/DatePicker.svelte.d.ts +4 -22
- package/dist/DrawerContext.svelte +33 -22
- package/dist/DrawerContext.svelte.d.ts +4 -24
- package/dist/DrawerContextItem.svelte +67 -54
- package/dist/DrawerContextItem.svelte.d.ts +4 -23
- package/dist/DrawerContextSeparator.svelte +1 -1
- package/dist/DrawerContextSeparator.svelte.d.ts +22 -19
- package/dist/DrawerContextWorkspace.svelte +31 -32
- package/dist/DrawerContextWorkspace.svelte.d.ts +4 -20
- package/dist/DropdownSelect.svelte +93 -81
- package/dist/DropdownSelect.svelte.d.ts +4 -27
- package/dist/EmptyStateIcon.svelte +13 -7
- package/dist/EmptyStateIcon.svelte.d.ts +4 -22
- package/dist/EmptyStateIllustration.svelte +41 -33
- package/dist/EmptyStateIllustration.svelte.d.ts +4 -21
- package/dist/FeedEvents.svelte +5 -2
- package/dist/FeedEvents.svelte.d.ts +4 -17
- package/dist/FeedIconEvent.svelte +5 -3
- package/dist/FeedIconEvent.svelte.d.ts +4 -19
- package/dist/FeedIconStatus.svelte +23 -18
- package/dist/FeedIconStatus.svelte.d.ts +4 -17
- package/dist/FeedItem.svelte +33 -28
- package/dist/FeedItem.svelte.d.ts +4 -30
- package/dist/FeedItemDetail.svelte +21 -13
- package/dist/FeedItemDetail.svelte.d.ts +4 -23
- package/dist/FeedViewer.svelte +6 -13
- package/dist/FeedViewer.svelte.d.ts +4 -21
- package/dist/FormLayoutModal.svelte +9 -3
- package/dist/FormLayoutModal.svelte.d.ts +4 -29
- package/dist/GlobalSearch.svelte +38 -31
- package/dist/GlobalSearch.svelte.d.ts +4 -18
- package/dist/InputCheckbox.svelte +23 -14
- package/dist/InputCheckbox.svelte.d.ts +4 -23
- package/dist/InputError.svelte +4 -1
- package/dist/InputError.svelte.d.ts +4 -16
- package/dist/InputLabel.svelte +5 -3
- package/dist/InputLabel.svelte.d.ts +4 -18
- package/dist/InputRadio.svelte +25 -19
- package/dist/InputRadio.svelte.d.ts +4 -21
- package/dist/InputSearch.svelte +66 -46
- package/dist/InputSearch.svelte.d.ts +9 -33
- package/dist/InputSelect.svelte +36 -33
- package/dist/InputSelect.svelte.d.ts +4 -31
- package/dist/InputText.svelte +64 -48
- package/dist/InputText.svelte.d.ts +4 -28
- package/dist/InputTextarea.svelte +38 -29
- package/dist/InputTextarea.svelte.d.ts +4 -25
- package/dist/InputToggle.svelte +29 -22
- package/dist/InputToggle.svelte.d.ts +4 -20
- package/dist/MenuItem.svelte +99 -87
- package/dist/MenuItem.svelte.d.ts +5 -29
- package/dist/MenuItemCollapsible.svelte +26 -18
- package/dist/MenuItemCollapsible.svelte.d.ts +4 -24
- package/dist/Notification.svelte +35 -31
- package/dist/Notification.svelte.d.ts +4 -20
- package/dist/ProfileAvatar.svelte +26 -19
- package/dist/ProfileAvatar.svelte.d.ts +4 -21
- package/dist/ProfileSelector.svelte +25 -17
- package/dist/ProfileSelector.svelte.d.ts +4 -22
- package/dist/SectionLayout.svelte +6 -3
- package/dist/SectionLayout.svelte.d.ts +4 -18
- package/dist/SeparatorHorizontal.svelte +1 -1
- package/dist/SeparatorHorizontal.svelte.d.ts +22 -19
- package/dist/ShortcutWrapper.svelte +7 -1
- package/dist/ShortcutWrapper.svelte.d.ts +4 -27
- package/dist/StatusLabel.svelte +16 -12
- package/dist/StatusLabel.svelte.d.ts +4 -18
- package/dist/StepIconList.svelte +44 -41
- package/dist/StepIconList.svelte.d.ts +4 -17
- package/dist/TagBeta.svelte.d.ts +22 -19
- package/dist/TagSearch.svelte +19 -20
- package/dist/TagSearch.svelte.d.ts +4 -22
- package/dist/TagStatus.svelte +42 -37
- package/dist/TagStatus.svelte.d.ts +4 -19
- package/dist/TitleMain.svelte +9 -2
- package/dist/TitleMain.svelte.d.ts +4 -18
- package/dist/TitleSection.svelte +9 -2
- package/dist/TitleSection.svelte.d.ts +4 -18
- package/dist/UuidCopy.svelte +61 -48
- package/dist/UuidCopy.svelte.d.ts +4 -26
- package/dist/alert-dialog/alert-dialog-action.svelte +15 -15
- package/dist/alert-dialog/alert-dialog-action.svelte.d.ts +5 -26
- package/dist/alert-dialog/alert-dialog-cancel.svelte +13 -10
- package/dist/alert-dialog/alert-dialog-cancel.svelte.d.ts +3 -22
- package/dist/alert-dialog/alert-dialog-content.svelte +19 -15
- package/dist/alert-dialog/alert-dialog-content.svelte.d.ts +6 -15
- package/dist/alert-dialog/alert-dialog-description.svelte +11 -6
- package/dist/alert-dialog/alert-dialog-description.svelte.d.ts +3 -16
- package/dist/alert-dialog/alert-dialog-footer.svelte +11 -5
- package/dist/alert-dialog/alert-dialog-footer.svelte.d.ts +4 -16
- package/dist/alert-dialog/alert-dialog-header.svelte +14 -5
- package/dist/alert-dialog/alert-dialog-header.svelte.d.ts +4 -16
- package/dist/alert-dialog/alert-dialog-overlay.svelte +10 -13
- package/dist/alert-dialog/alert-dialog-overlay.svelte.d.ts +3 -14
- package/dist/alert-dialog/alert-dialog-title.svelte +11 -8
- package/dist/alert-dialog/alert-dialog-title.svelte.d.ts +3 -16
- package/dist/alert-dialog/alert-dialog-trigger.svelte +6 -0
- package/dist/alert-dialog/alert-dialog-trigger.svelte.d.ts +4 -0
- package/dist/alert-dialog/index.d.ts +3 -4
- package/dist/alert-dialog/index.js +2 -2
- package/dist/button/button.svelte +76 -18
- package/dist/button/button.svelte.d.ts +62 -14
- package/dist/button/index.d.ts +2 -60
- package/dist/button/index.js +1 -26
- package/dist/helpers.d.ts +4 -1
- package/dist/helpers.js +35 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +0 -4
- package/dist/range-calendar/index.d.ts +20 -0
- package/dist/range-calendar/index.js +22 -0
- package/dist/range-calendar/range-calendar-caption.svelte +71 -0
- package/dist/range-calendar/range-calendar-caption.svelte.d.ts +19 -0
- package/dist/range-calendar/range-calendar-cell.svelte +18 -0
- package/dist/range-calendar/range-calendar-cell.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-day.svelte +41 -0
- package/dist/range-calendar/range-calendar-day.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-grid-row.svelte +11 -0
- package/dist/range-calendar/range-calendar-grid-row.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-grid.svelte +15 -0
- package/dist/range-calendar/range-calendar-grid.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-head-cell.svelte +18 -0
- package/dist/range-calendar/range-calendar-head-cell.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-header.svelte +18 -0
- package/dist/range-calendar/range-calendar-header.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-heading.svelte +15 -0
- package/dist/range-calendar/range-calendar-heading.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-month-select.svelte +44 -0
- package/dist/range-calendar/range-calendar-month-select.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-month.svelte +14 -0
- package/dist/range-calendar/range-calendar-month.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-months.svelte +18 -0
- package/dist/range-calendar/range-calendar-months.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-nav.svelte +18 -0
- package/dist/range-calendar/range-calendar-nav.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-next-button.svelte +30 -0
- package/dist/range-calendar/range-calendar-next-button.svelte.d.ts +8 -0
- package/dist/range-calendar/range-calendar-prev-button.svelte +30 -0
- package/dist/range-calendar/range-calendar-prev-button.svelte.d.ts +8 -0
- package/dist/range-calendar/range-calendar-year-select.svelte +43 -0
- package/dist/range-calendar/range-calendar-year-select.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar.svelte +109 -0
- package/dist/range-calendar/range-calendar.svelte.d.ts +21 -0
- package/dist/svg/BgPattern.svelte.d.ts +22 -19
- package/dist/svg/IconContact.svelte +6 -1
- package/dist/svg/IconContact.svelte.d.ts +5 -15
- package/dist/svg/IconEmpty.svelte.d.ts +22 -19
- package/dist/svg/IconFile.svelte +6 -1
- package/dist/svg/IconFile.svelte.d.ts +5 -15
- package/dist/svg/IconInvoice.svelte +6 -1
- package/dist/svg/IconInvoice.svelte.d.ts +5 -15
- package/dist/svg/IconNoResults.svelte +6 -1
- package/dist/svg/IconNoResults.svelte.d.ts +5 -15
- package/dist/svg/IconPdf.svelte +6 -1
- package/dist/svg/IconPdf.svelte.d.ts +5 -15
- package/dist/svg/IconProduct.svelte +6 -1
- package/dist/svg/IconProduct.svelte.d.ts +5 -15
- package/dist/table/table-body.svelte +10 -5
- package/dist/table/table-body.svelte.d.ts +4 -16
- package/dist/table/table-caption.svelte +14 -5
- package/dist/table/table-caption.svelte.d.ts +4 -16
- package/dist/table/table-cell.svelte +16 -7
- package/dist/table/table-cell.svelte.d.ts +4 -19
- package/dist/table/table-footer.svelte +14 -5
- package/dist/table/table-footer.svelte.d.ts +4 -16
- package/dist/table/table-head.svelte +11 -5
- package/dist/table/table-head.svelte.d.ts +4 -16
- package/dist/table/table-header.svelte +17 -8
- package/dist/table/table-header.svelte.d.ts +4 -19
- package/dist/table/table-row.svelte +22 -8
- package/dist/table/table-row.svelte.d.ts +4 -22
- package/dist/table/table.svelte +11 -6
- package/dist/table/table.svelte.d.ts +4 -16
- package/dist/tabs/tabs-content.svelte +13 -8
- package/dist/tabs/tabs-content.svelte.d.ts +3 -16
- package/dist/tabs/tabs-list.svelte +7 -6
- package/dist/tabs/tabs-list.svelte.d.ts +3 -16
- package/dist/tabs/tabs-trigger.svelte +13 -9
- package/dist/tabs/tabs-trigger.svelte.d.ts +3 -14
- package/dist/tabs/tabs.svelte +12 -7
- package/dist/tabs/tabs.svelte.d.ts +3 -16
- package/dist/tooltip/index.d.ts +5 -3
- package/dist/tooltip/index.js +5 -3
- package/dist/tooltip/tooltip-content.svelte +42 -23
- package/dist/tooltip/tooltip-content.svelte.d.ts +5 -15
- package/dist/tooltip/tooltip-trigger.svelte +8 -0
- package/dist/tooltip/tooltip-trigger.svelte.d.ts +4 -0
- package/dist/tw.theme.d.ts +2 -9
- package/dist/tw.theme.js +0 -5
- package/dist/types.d.ts +484 -25
- package/dist/utils.d.ts +10 -1
- package/package.json +30 -39
- package/README.md +0 -234
- package/dist/BaseTableHeaderSortBy.svelte +0 -22
- package/dist/BaseTableHeaderSortBy.svelte.d.ts +0 -20
- package/dist/ComboBox.svelte +0 -12
- package/dist/ComboBox.svelte.d.ts +0 -21
- package/dist/ComboBoxContent.svelte +0 -33
- package/dist/ComboBoxContent.svelte.d.ts +0 -20
- package/dist/ProgressBar.svelte +0 -6
- package/dist/ProgressBar.svelte.d.ts +0 -16
- package/dist/alert-dialog/alert-dialog-portal.svelte +0 -6
- package/dist/alert-dialog/alert-dialog-portal.svelte.d.ts +0 -17
- package/dist/popui.css +0 -1
- package/dist/wcdispatch.d.ts +0 -1
- package/dist/wcdispatch.js +0 -9
package/dist/helpers.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CalendarDate } from '@internationalized/date';
|
|
2
|
+
import { startOfWeek, endOfWeek, subWeeks, endOfMonth, startOfMonth, subMonths, startOfQuarter, endOfQuarter, subQuarters } from 'date-fns';
|
|
1
3
|
export function toPascalCase(text) {
|
|
2
4
|
return text.replace(/(^\w|-\w)/g, (text) => text.replace(/-/, '').toUpperCase());
|
|
3
5
|
}
|
|
@@ -82,3 +84,36 @@ export function isInputFocused() {
|
|
|
82
84
|
const isTextArea = activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable;
|
|
83
85
|
return isInputText || isTextArea;
|
|
84
86
|
}
|
|
87
|
+
export function toCalendarDate(date) {
|
|
88
|
+
return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
89
|
+
}
|
|
90
|
+
export function datesFromToday() {
|
|
91
|
+
const today = new Date();
|
|
92
|
+
const startOfThisWeek = startOfWeek(today, { weekStartsOn: 1 });
|
|
93
|
+
const endOfThisWeek = endOfWeek(today, { weekStartsOn: 1 });
|
|
94
|
+
const startOfLastWeek = subWeeks(startOfThisWeek, 1);
|
|
95
|
+
const endOfLastWeek = endOfWeek(startOfLastWeek, { weekStartsOn: 1 });
|
|
96
|
+
const startOfThisMonth = startOfMonth(today);
|
|
97
|
+
const endOfThisMonth = endOfMonth(today);
|
|
98
|
+
const startOfLastMonth = subMonths(startOfThisMonth, 1);
|
|
99
|
+
const endOfLastMonth = endOfMonth(startOfLastMonth);
|
|
100
|
+
const startOfThisQuarter = startOfQuarter(today);
|
|
101
|
+
const endOfThisQuarter = endOfQuarter(today);
|
|
102
|
+
const startOfLastQuarter = subQuarters(startOfThisQuarter, 1);
|
|
103
|
+
const endOfLastQuarter = endOfQuarter(startOfLastQuarter);
|
|
104
|
+
return {
|
|
105
|
+
today,
|
|
106
|
+
startOfThisWeek,
|
|
107
|
+
endOfThisWeek,
|
|
108
|
+
startOfLastWeek,
|
|
109
|
+
endOfLastWeek,
|
|
110
|
+
startOfThisMonth,
|
|
111
|
+
endOfThisMonth,
|
|
112
|
+
startOfLastMonth,
|
|
113
|
+
endOfLastMonth,
|
|
114
|
+
startOfThisQuarter,
|
|
115
|
+
endOfThisQuarter,
|
|
116
|
+
startOfLastQuarter,
|
|
117
|
+
endOfLastQuarter
|
|
118
|
+
};
|
|
119
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import ButtonFile from './ButtonFile.svelte';
|
|
|
12
12
|
import ButtonUuidCopy from './ButtonUuidCopy.svelte';
|
|
13
13
|
import CardCheckbox from './CardCheckbox.svelte';
|
|
14
14
|
import CardRelation from './CardRelation.svelte';
|
|
15
|
-
import ComboBox from './ComboBox.svelte';
|
|
16
15
|
import CompanySelector from './CompanySelector.svelte';
|
|
17
16
|
import CounterWorkflow from './CounterWorkflow.svelte';
|
|
18
17
|
import DataListItem from './DataListItem.svelte';
|
|
@@ -44,7 +43,6 @@ import MenuItemCollapsible from './MenuItemCollapsible.svelte';
|
|
|
44
43
|
import Notification from './Notification.svelte';
|
|
45
44
|
import ProfileAvatar from './ProfileAvatar.svelte';
|
|
46
45
|
import ProfileSelector from './ProfileSelector.svelte';
|
|
47
|
-
import ProgressBar from './ProgressBar.svelte';
|
|
48
46
|
import SectionLayout from './SectionLayout.svelte';
|
|
49
47
|
import SeparatorHorizontal from './SeparatorHorizontal.svelte';
|
|
50
48
|
import ShortcutWrapper from './ShortcutWrapper.svelte';
|
|
@@ -75,4 +73,4 @@ import twTheme from './tw.theme.js';
|
|
|
75
73
|
import { resolveIcon } from './helpers.js';
|
|
76
74
|
import { getCountryName } from './helpers.js';
|
|
77
75
|
import { getStatusType } from './helpers.js';
|
|
78
|
-
export { AlertDialog, BaseButton, BaseCard, BaseCounter, BaseDropdown, BaseFlag, BaseTable, BaseTableActions, BaseTableHeaderContent, Breadcrumbs, ButtonFile, ButtonUuidCopy, CardCheckbox, CardRelation,
|
|
76
|
+
export { AlertDialog, BaseButton, BaseCard, BaseCounter, BaseDropdown, BaseFlag, BaseTable, BaseTableActions, BaseTableHeaderContent, Breadcrumbs, ButtonFile, ButtonUuidCopy, CardCheckbox, CardRelation, CompanySelector, CounterWorkflow, DataListItem, DatePicker, DrawerContext, DrawerContextItem, DrawerContextSeparator, DropdownSelect, EmptyStateIcon, EmptyStateIllustration, FeedEvents, FeedIconEvent, FeedIconStatus, FeedItem, FeedItemDetail, FeedViewer, GlobalSearch, InputCheckbox, InputError, InputLabel, InputRadio, InputSearch, InputSelect, InputText, InputTextarea, InputToggle, MenuItem, MenuItemCollapsible, Notification, ProfileAvatar, ProfileSelector, SectionLayout, SeparatorHorizontal, ShortcutWrapper, StatusLabel, StepIconList, Table, TableBody, TableCaption, TableFooter, TableHeader, TableRow, TableHead, TableCell, Tabs, TabsContent, TabsList, TabsTrigger, TagBeta, TagSearch, TagStatus, TitleMain, TitleSection, Tooltip, TooltipContent, TooltipTrigger, UuidCopy, twTheme, resolveIcon, getCountryName, getStatusType };
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import ButtonFile from './ButtonFile.svelte'
|
|
|
12
12
|
import ButtonUuidCopy from './ButtonUuidCopy.svelte'
|
|
13
13
|
import CardCheckbox from './CardCheckbox.svelte'
|
|
14
14
|
import CardRelation from './CardRelation.svelte'
|
|
15
|
-
import ComboBox from './ComboBox.svelte'
|
|
16
15
|
import CompanySelector from './CompanySelector.svelte'
|
|
17
16
|
import CounterWorkflow from './CounterWorkflow.svelte'
|
|
18
17
|
import DataListItem from './DataListItem.svelte'
|
|
@@ -44,7 +43,6 @@ import MenuItemCollapsible from './MenuItemCollapsible.svelte'
|
|
|
44
43
|
import Notification from './Notification.svelte'
|
|
45
44
|
import ProfileAvatar from './ProfileAvatar.svelte'
|
|
46
45
|
import ProfileSelector from './ProfileSelector.svelte'
|
|
47
|
-
import ProgressBar from './ProgressBar.svelte'
|
|
48
46
|
import SectionLayout from './SectionLayout.svelte'
|
|
49
47
|
import SeparatorHorizontal from './SeparatorHorizontal.svelte'
|
|
50
48
|
import ShortcutWrapper from './ShortcutWrapper.svelte'
|
|
@@ -87,7 +85,6 @@ export {
|
|
|
87
85
|
ButtonUuidCopy,
|
|
88
86
|
CardCheckbox,
|
|
89
87
|
CardRelation,
|
|
90
|
-
ComboBox,
|
|
91
88
|
CompanySelector,
|
|
92
89
|
CounterWorkflow,
|
|
93
90
|
DataListItem,
|
|
@@ -119,7 +116,6 @@ export {
|
|
|
119
116
|
Notification,
|
|
120
117
|
ProfileAvatar,
|
|
121
118
|
ProfileSelector,
|
|
122
|
-
ProgressBar,
|
|
123
119
|
SectionLayout,
|
|
124
120
|
SeparatorHorizontal,
|
|
125
121
|
ShortcutWrapper,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
2
|
+
import Root from "./range-calendar.svelte";
|
|
3
|
+
import Cell from "./range-calendar-cell.svelte";
|
|
4
|
+
import Day from "./range-calendar-day.svelte";
|
|
5
|
+
import Grid from "./range-calendar-grid.svelte";
|
|
6
|
+
import Header from "./range-calendar-header.svelte";
|
|
7
|
+
import Months from "./range-calendar-months.svelte";
|
|
8
|
+
import GridRow from "./range-calendar-grid-row.svelte";
|
|
9
|
+
import Heading from "./range-calendar-heading.svelte";
|
|
10
|
+
import HeadCell from "./range-calendar-head-cell.svelte";
|
|
11
|
+
import NextButton from "./range-calendar-next-button.svelte";
|
|
12
|
+
import PrevButton from "./range-calendar-prev-button.svelte";
|
|
13
|
+
import MonthSelect from "./range-calendar-month-select.svelte";
|
|
14
|
+
import YearSelect from "./range-calendar-year-select.svelte";
|
|
15
|
+
import Caption from "./range-calendar-caption.svelte";
|
|
16
|
+
import Nav from "./range-calendar-nav.svelte";
|
|
17
|
+
import Month from "./range-calendar-month.svelte";
|
|
18
|
+
declare const GridHead: import("svelte").Component<RangeCalendarPrimitive.GridHeadProps, {}, "ref">;
|
|
19
|
+
declare const GridBody: import("svelte").Component<RangeCalendarPrimitive.GridBodyProps, {}, "ref">;
|
|
20
|
+
export { Day, Cell, Grid, Header, Months, GridRow, Heading, GridBody, GridHead, HeadCell, NextButton, PrevButton, MonthSelect, YearSelect, Caption, Nav, Month, Root as RangeCalendar, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
2
|
+
import Root from "./range-calendar.svelte";
|
|
3
|
+
import Cell from "./range-calendar-cell.svelte";
|
|
4
|
+
import Day from "./range-calendar-day.svelte";
|
|
5
|
+
import Grid from "./range-calendar-grid.svelte";
|
|
6
|
+
import Header from "./range-calendar-header.svelte";
|
|
7
|
+
import Months from "./range-calendar-months.svelte";
|
|
8
|
+
import GridRow from "./range-calendar-grid-row.svelte";
|
|
9
|
+
import Heading from "./range-calendar-heading.svelte";
|
|
10
|
+
import HeadCell from "./range-calendar-head-cell.svelte";
|
|
11
|
+
import NextButton from "./range-calendar-next-button.svelte";
|
|
12
|
+
import PrevButton from "./range-calendar-prev-button.svelte";
|
|
13
|
+
import MonthSelect from "./range-calendar-month-select.svelte";
|
|
14
|
+
import YearSelect from "./range-calendar-year-select.svelte";
|
|
15
|
+
import Caption from "./range-calendar-caption.svelte";
|
|
16
|
+
import Nav from "./range-calendar-nav.svelte";
|
|
17
|
+
import Month from "./range-calendar-month.svelte";
|
|
18
|
+
const GridHead = RangeCalendarPrimitive.GridHead;
|
|
19
|
+
const GridBody = RangeCalendarPrimitive.GridBody;
|
|
20
|
+
export { Day, Cell, Grid, Header, Months, GridRow, Heading, GridBody, GridHead, HeadCell, NextButton, PrevButton, MonthSelect, YearSelect, Caption, Nav, Month,
|
|
21
|
+
//
|
|
22
|
+
Root as RangeCalendar, };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ComponentProps } from 'svelte'
|
|
3
|
+
import type RangeCalendar from './range-calendar.svelte'
|
|
4
|
+
import RangeCalendarMonthSelect from './range-calendar-month-select.svelte'
|
|
5
|
+
import RangeCalendarYearSelect from './range-calendar-year-select.svelte'
|
|
6
|
+
import { DateFormatter, getLocalTimeZone, type DateValue } from '@internationalized/date'
|
|
7
|
+
let {
|
|
8
|
+
captionLayout,
|
|
9
|
+
months,
|
|
10
|
+
monthFormat,
|
|
11
|
+
years,
|
|
12
|
+
yearFormat,
|
|
13
|
+
month,
|
|
14
|
+
locale,
|
|
15
|
+
placeholder = $bindable(),
|
|
16
|
+
monthIndex = 0
|
|
17
|
+
}: {
|
|
18
|
+
captionLayout: ComponentProps<typeof RangeCalendar>['captionLayout']
|
|
19
|
+
months: ComponentProps<typeof RangeCalendarMonthSelect>['months']
|
|
20
|
+
monthFormat: ComponentProps<typeof RangeCalendarMonthSelect>['monthFormat']
|
|
21
|
+
years: ComponentProps<typeof RangeCalendarYearSelect>['years']
|
|
22
|
+
yearFormat: ComponentProps<typeof RangeCalendarYearSelect>['yearFormat']
|
|
23
|
+
month: DateValue
|
|
24
|
+
placeholder: DateValue | undefined
|
|
25
|
+
locale: string
|
|
26
|
+
monthIndex: number
|
|
27
|
+
} = $props()
|
|
28
|
+
function formatYear(date: DateValue) {
|
|
29
|
+
const dateObj = date.toDate(getLocalTimeZone())
|
|
30
|
+
if (typeof yearFormat === 'function') return yearFormat(dateObj.getFullYear())
|
|
31
|
+
return new DateFormatter(locale, { year: yearFormat }).format(dateObj)
|
|
32
|
+
}
|
|
33
|
+
function formatMonth(date: DateValue) {
|
|
34
|
+
const dateObj = date.toDate(getLocalTimeZone())
|
|
35
|
+
if (typeof monthFormat === 'function') return monthFormat(dateObj.getMonth() + 1)
|
|
36
|
+
return new DateFormatter(locale, { month: monthFormat }).format(dateObj)
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
{#snippet MonthSelect()}
|
|
41
|
+
<RangeCalendarMonthSelect
|
|
42
|
+
{months}
|
|
43
|
+
{monthFormat}
|
|
44
|
+
value={month.month}
|
|
45
|
+
onchange={(e) => {
|
|
46
|
+
if (!placeholder) return
|
|
47
|
+
const v = Number.parseInt(e.currentTarget.value)
|
|
48
|
+
const newPlaceholder = placeholder.set({ month: v })
|
|
49
|
+
placeholder = newPlaceholder.subtract({ months: monthIndex })
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
{/snippet}
|
|
53
|
+
{#snippet YearSelect()}
|
|
54
|
+
<RangeCalendarYearSelect {years} {yearFormat} value={month.year} />
|
|
55
|
+
{/snippet}
|
|
56
|
+
{#if captionLayout === 'dropdown'}
|
|
57
|
+
{@render MonthSelect()}
|
|
58
|
+
{@render YearSelect()}
|
|
59
|
+
{:else if captionLayout === 'dropdown-months'}
|
|
60
|
+
{@render MonthSelect()}
|
|
61
|
+
{#if placeholder}
|
|
62
|
+
{formatYear(placeholder)}
|
|
63
|
+
{/if}
|
|
64
|
+
{:else if captionLayout === 'dropdown-years'}
|
|
65
|
+
{#if placeholder}
|
|
66
|
+
{formatMonth(placeholder)}
|
|
67
|
+
{/if}
|
|
68
|
+
{@render YearSelect()}
|
|
69
|
+
{:else}
|
|
70
|
+
{formatMonth(month)} {formatYear(month)}
|
|
71
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps } from 'svelte';
|
|
2
|
+
import type RangeCalendar from './range-calendar.svelte';
|
|
3
|
+
import RangeCalendarMonthSelect from './range-calendar-month-select.svelte';
|
|
4
|
+
import RangeCalendarYearSelect from './range-calendar-year-select.svelte';
|
|
5
|
+
import { type DateValue } from '@internationalized/date';
|
|
6
|
+
type $$ComponentProps = {
|
|
7
|
+
captionLayout: ComponentProps<typeof RangeCalendar>['captionLayout'];
|
|
8
|
+
months: ComponentProps<typeof RangeCalendarMonthSelect>['months'];
|
|
9
|
+
monthFormat: ComponentProps<typeof RangeCalendarMonthSelect>['monthFormat'];
|
|
10
|
+
years: ComponentProps<typeof RangeCalendarYearSelect>['years'];
|
|
11
|
+
yearFormat: ComponentProps<typeof RangeCalendarYearSelect>['yearFormat'];
|
|
12
|
+
month: DateValue;
|
|
13
|
+
placeholder: DateValue | undefined;
|
|
14
|
+
locale: string;
|
|
15
|
+
monthIndex: number;
|
|
16
|
+
};
|
|
17
|
+
declare const RangeCalendarCaption: import("svelte").Component<$$ComponentProps, {}, "placeholder">;
|
|
18
|
+
type RangeCalendarCaption = ReturnType<typeof RangeCalendarCaption>;
|
|
19
|
+
export default RangeCalendarCaption;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { cn } from '../utils.js'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
...restProps
|
|
8
|
+
}: RangeCalendarPrimitive.CellProps = $props()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<RangeCalendarPrimitive.Cell
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn(
|
|
14
|
+
'size-(--cell-size) dark:[&:has([data-range-start])]:hover:bg-accent dark:[&:has([data-range-end])]:hover:bg-accent [&:has([data-range-middle])]:bg-accent dark:[&:has([data-range-middle])]:hover:bg-accent/50 [&:has([data-selected])]:bg-accent relative p-0 text-center text-sm focus-within:z-20 data-[range-middle]:rounded-r-md [&:first-child[data-selected]_[data-bits-day]]:rounded-l-md [&:has([data-range-end])]:rounded-r-md [&:has([data-range-middle])]:rounded-none first:[&:has([data-range-middle])]:rounded-l-md last:[&:has([data-range-middle])]:rounded-r-md [&:has([data-range-start])]:rounded-l-md [&:last-child[data-selected]_[data-bits-day]]:rounded-r-md',
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const RangeCalendarCell: import("svelte").Component<RangeCalendarPrimitive.CellProps, {}, "ref">;
|
|
3
|
+
type RangeCalendarCell = ReturnType<typeof RangeCalendarCell>;
|
|
4
|
+
export default RangeCalendarCell;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { buttonVariants } from '../button/index.js'
|
|
4
|
+
import { cn } from '../utils.js'
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.DayProps = $props()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.Day
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn(
|
|
15
|
+
buttonVariants({ variant: 'ghost' }),
|
|
16
|
+
'size-(--cell-size) flex select-none flex-col items-center justify-center gap-1 whitespace-nowrap p-0 font-normal leading-none',
|
|
17
|
+
// today
|
|
18
|
+
'[&[data-today]:not([data-selected])]:border-b [&[data-today]:not([data-selected])]:border-workspace-accent [&[data-today]:not([data-selected])]:rounded-none',
|
|
19
|
+
// range Start
|
|
20
|
+
'data-[range-start]:bg-workspace-accent data-[range-start]:text-white data-[range-start]:font-semibold data-[range-start]:shadow-active',
|
|
21
|
+
// range middle
|
|
22
|
+
'data-[range-middle]:rounded-none data-[range-middle]:bg-neutral-100',
|
|
23
|
+
// range End
|
|
24
|
+
'data-[range-end]:bg-workspace-accent data-[range-end]:text-white data-[range-end]:font-semibold data-[range-end]:shadow-active',
|
|
25
|
+
// Outside months
|
|
26
|
+
'[&[data-outside-month]]:text-transparent [&[data-outside-month]]:bg-transparent [&[data-outside-month]]:shadow-none [&[data-outside-month]:not([data-selected])]:pointer-events-none',
|
|
27
|
+
// Disabled
|
|
28
|
+
'data-[disabled]:text-muted-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
29
|
+
// Unavailable
|
|
30
|
+
'data-[unavailable]:line-through',
|
|
31
|
+
'dark:data-[range-middle]:hover:bg-accent/0',
|
|
32
|
+
// hover
|
|
33
|
+
'dark:hover:text-accent-foreground',
|
|
34
|
+
// focus
|
|
35
|
+
'focus:border-ring focus:ring-ring/50 focus:relative',
|
|
36
|
+
// inner spans
|
|
37
|
+
'[&>span]:text-xs [&>span]:opacity-70',
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
{...restProps}
|
|
41
|
+
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { cn } from '../utils.js'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
...restProps
|
|
8
|
+
}: RangeCalendarPrimitive.GridRowProps = $props()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<RangeCalendarPrimitive.GridRow bind:ref class={cn('flex', className)} {...restProps} />
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const RangeCalendarGridRow: import("svelte").Component<RangeCalendarPrimitive.GridRowProps, {}, "ref">;
|
|
3
|
+
type RangeCalendarGridRow = ReturnType<typeof RangeCalendarGridRow>;
|
|
4
|
+
export default RangeCalendarGridRow;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { cn } from '../utils.js'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
...restProps
|
|
8
|
+
}: RangeCalendarPrimitive.GridProps = $props()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<RangeCalendarPrimitive.Grid
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn('mt-4 flex w-full border-collapse flex-col gap-1', className)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const RangeCalendarGrid: import("svelte").Component<RangeCalendarPrimitive.GridProps, {}, "ref">;
|
|
3
|
+
type RangeCalendarGrid = ReturnType<typeof RangeCalendarGrid>;
|
|
4
|
+
export default RangeCalendarGrid;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { cn } from '../utils.js'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
...restProps
|
|
8
|
+
}: RangeCalendarPrimitive.HeadCellProps = $props()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<RangeCalendarPrimitive.HeadCell
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn(
|
|
14
|
+
'text-[#989AA4] w-(--cell-size) h-(--cell-size) text-sm font-normal border-b border-neutral-100 flex items-center justify-center',
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const RangeCalendarHeadCell: import("svelte").Component<RangeCalendarPrimitive.HeadCellProps, {}, "ref">;
|
|
3
|
+
type RangeCalendarHeadCell = ReturnType<typeof RangeCalendarHeadCell>;
|
|
4
|
+
export default RangeCalendarHeadCell;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { cn } from '../utils.js'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
...restProps
|
|
8
|
+
}: RangeCalendarPrimitive.HeaderProps = $props()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<RangeCalendarPrimitive.Header
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn(
|
|
14
|
+
'h-11 flex w-full items-center justify-center gap-1.5 text-base font-medium pt-2 pb-3',
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const RangeCalendarHeader: import("svelte").Component<RangeCalendarPrimitive.HeaderProps, {}, "ref">;
|
|
3
|
+
type RangeCalendarHeader = ReturnType<typeof RangeCalendarHeader>;
|
|
4
|
+
export default RangeCalendarHeader;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { cn } from '../utils.js'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
...restProps
|
|
8
|
+
}: RangeCalendarPrimitive.HeadingProps = $props()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<RangeCalendarPrimitive.Heading
|
|
12
|
+
bind:ref
|
|
13
|
+
class={cn('px-(--cell-size) text-sm font-medium', className)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const RangeCalendarHeading: import("svelte").Component<RangeCalendarPrimitive.HeadingProps, {}, "ref">;
|
|
3
|
+
type RangeCalendarHeading = ReturnType<typeof RangeCalendarHeading>;
|
|
4
|
+
export default RangeCalendarHeading;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { cn, type WithoutChildrenOrChild } from '../utils.js'
|
|
4
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
5
|
+
import { ChevronDown } from '@invopop/ui-icons'
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
value,
|
|
10
|
+
onchange,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChildrenOrChild<RangeCalendarPrimitive.MonthSelectProps> = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<span
|
|
16
|
+
class={cn(
|
|
17
|
+
'has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative flex rounded-md border',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
>
|
|
21
|
+
<RangeCalendarPrimitive.MonthSelect bind:ref class="absolute inset-0 opacity-0" {...restProps}>
|
|
22
|
+
{#snippet child({ props, monthItems, selectedMonthItem })}
|
|
23
|
+
<select {...props} {value} {onchange}>
|
|
24
|
+
{#each monthItems as monthItem (monthItem.value)}
|
|
25
|
+
<option
|
|
26
|
+
value={monthItem.value}
|
|
27
|
+
selected={value !== undefined
|
|
28
|
+
? monthItem.value === value
|
|
29
|
+
: monthItem.value === selectedMonthItem.value}
|
|
30
|
+
>
|
|
31
|
+
{monthItem.label}
|
|
32
|
+
</option>
|
|
33
|
+
{/each}
|
|
34
|
+
</select>
|
|
35
|
+
<span
|
|
36
|
+
class="[&>svg]:text-muted-foreground flex h-8 select-none items-center gap-1 rounded-md pl-2 pr-1 text-sm font-medium [&>svg]:size-3.5"
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
>
|
|
39
|
+
{monthItems.find((item) => item.value === value)?.label || selectedMonthItem.label}
|
|
40
|
+
<Icon src={ChevronDown} class="size-4" />
|
|
41
|
+
</span>
|
|
42
|
+
{/snippet}
|
|
43
|
+
</RangeCalendarPrimitive.MonthSelect>
|
|
44
|
+
</span>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
declare const RangeCalendarMonthSelect: import("svelte").Component<Omit<Omit<RangeCalendarPrimitive.MonthSelectProps, "child">, "children">, {}, "ref">;
|
|
3
|
+
type RangeCalendarMonthSelect = ReturnType<typeof RangeCalendarMonthSelect>;
|
|
4
|
+
export default RangeCalendarMonthSelect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type WithElementRef, cn } from '../utils.js'
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div {...restProps} bind:this={ref} class={cn('flex flex-col', className)}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from '../utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
declare const RangeCalendarMonth: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type RangeCalendarMonth = ReturnType<typeof RangeCalendarMonth>;
|
|
5
|
+
export default RangeCalendarMonth;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
3
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
class={cn('relative flex flex-col gap-4 md:flex-row', className)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../utils.js';
|
|
3
|
+
declare const RangeCalendarMonths: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type RangeCalendarMonths = ReturnType<typeof RangeCalendarMonths>;
|
|
5
|
+
export default RangeCalendarMonths;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from '../utils.js'
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<nav
|
|
13
|
+
{...restProps}
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
class={cn('absolute inset-x-0 top-2 flex w-full items-center justify-between gap-1', className)}
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</nav>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from '../utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
declare const RangeCalendarNav: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLElement>>, {}, "ref">;
|
|
4
|
+
type RangeCalendarNav = ReturnType<typeof RangeCalendarNav>;
|
|
5
|
+
export default RangeCalendarNav;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { buttonVariants, type ButtonVariant } from '../button/index.js'
|
|
4
|
+
import { cn } from '../utils.js'
|
|
5
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
6
|
+
import { ChevronRight } from '@invopop/ui-icons'
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
variant = 'outline',
|
|
12
|
+
...restProps
|
|
13
|
+
}: RangeCalendarPrimitive.NextButtonProps & {
|
|
14
|
+
variant?: ButtonVariant
|
|
15
|
+
} = $props()
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#snippet Fallback()}
|
|
19
|
+
<Icon src={ChevronRight} class="size-4" />
|
|
20
|
+
{/snippet}
|
|
21
|
+
<RangeCalendarPrimitive.NextButton
|
|
22
|
+
bind:ref
|
|
23
|
+
class={cn(
|
|
24
|
+
buttonVariants({ variant, size: 'icon-sm' }),
|
|
25
|
+
'select-none disabled:opacity-50 rtl:rotate-180',
|
|
26
|
+
className
|
|
27
|
+
)}
|
|
28
|
+
children={children || Fallback}
|
|
29
|
+
{...restProps}
|
|
30
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
import { type ButtonVariant } from '../button/index.js';
|
|
3
|
+
type $$ComponentProps = RangeCalendarPrimitive.NextButtonProps & {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
};
|
|
6
|
+
declare const RangeCalendarNextButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type RangeCalendarNextButton = ReturnType<typeof RangeCalendarNextButton>;
|
|
8
|
+
export default RangeCalendarNextButton;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui'
|
|
3
|
+
import { buttonVariants, type ButtonVariant } from '../button/index.js'
|
|
4
|
+
import { cn } from '../utils.js'
|
|
5
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
6
|
+
import { ChevronLeft } from '@invopop/ui-icons'
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
variant = 'outline',
|
|
12
|
+
...restProps
|
|
13
|
+
}: RangeCalendarPrimitive.PrevButtonProps & {
|
|
14
|
+
variant?: ButtonVariant
|
|
15
|
+
} = $props()
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#snippet Fallback()}
|
|
19
|
+
<Icon src={ChevronLeft} class="size-4" />
|
|
20
|
+
{/snippet}
|
|
21
|
+
<RangeCalendarPrimitive.PrevButton
|
|
22
|
+
bind:ref
|
|
23
|
+
class={cn(
|
|
24
|
+
buttonVariants({ variant, size: 'icon-sm' }),
|
|
25
|
+
'select-none disabled:opacity-50 rtl:rotate-180',
|
|
26
|
+
className
|
|
27
|
+
)}
|
|
28
|
+
children={children || Fallback}
|
|
29
|
+
{...restProps}
|
|
30
|
+
/>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from 'bits-ui';
|
|
2
|
+
import { type ButtonVariant } from '../button/index.js';
|
|
3
|
+
type $$ComponentProps = RangeCalendarPrimitive.PrevButtonProps & {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
};
|
|
6
|
+
declare const RangeCalendarPrevButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
7
|
+
type RangeCalendarPrevButton = ReturnType<typeof RangeCalendarPrevButton>;
|
|
8
|
+
export default RangeCalendarPrevButton;
|