@ankhorage/zora 27.5.3 → 27.6.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/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +13 -1
- package/dist/capabilities/index.js.map +5 -4
- package/dist/features/calendar/adapters/inbound/Calendar.d.ts +5 -0
- package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -0
- package/dist/features/calendar/adapters/inbound/Calendar.js +126 -0
- package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -0
- package/dist/features/calendar/application/createCalendarMonth.d.ts +9 -0
- package/dist/features/calendar/application/createCalendarMonth.d.ts.map +1 -0
- package/dist/features/calendar/application/createCalendarMonth.js +25 -0
- package/dist/features/calendar/application/createCalendarMonth.js.map +1 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.d.ts +10 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.d.ts.map +1 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.js +23 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.js.map +1 -0
- package/dist/features/calendar/calendarMeta.d.ts +10 -0
- package/dist/features/calendar/calendarMeta.d.ts.map +1 -0
- package/dist/features/calendar/calendarMeta.js +10 -0
- package/dist/features/calendar/calendarMeta.js.map +1 -0
- package/dist/features/calendar/public.d.ts +2 -0
- package/dist/features/calendar/public.d.ts.map +1 -1
- package/dist/features/calendar/public.js +1 -1
- package/dist/features/calendar/public.js.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +82 -23
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/features/date-picker/composition/DatePickerContent.d.ts +1 -1
- package/dist/features/date-picker/composition/DatePickerContent.d.ts.map +1 -1
- package/dist/features/date-picker/composition/DatePickerContent.js +5 -104
- package/dist/features/date-picker/composition/DatePickerContent.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js +7 -2
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +27 -4
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/placeAddedGraphNodes.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/placeAddedGraphNodes.js +18 -6
- package/dist/features/graph-view/adapters/inbound/web-artifact/placeAddedGraphNodes.js.map +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.js +6 -5
- package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -1
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +2 -0
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/registry/componentMeta.d.ts.map +1 -1
- package/dist/features/registry/componentMeta.js +2 -0
- package/dist/features/registry/componentMeta.js.map +1 -1
- package/dist/features/timeline/adapters/inbound/Timeline.d.ts.map +1 -1
- package/dist/features/timeline/adapters/inbound/Timeline.js +17 -11
- package/dist/features/timeline/adapters/inbound/Timeline.js.map +1 -1
- package/dist/readerFree.d.ts +1 -0
- package/dist/readerFree.d.ts.map +1 -1
- package/dist/readerFree.js +1 -0
- package/dist/readerFree.js.map +1 -1
- package/dist/types/calendar.d.ts +24 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +2 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/data-table.d.ts +4 -0
- package/dist/types/data-table.d.ts.map +1 -1
- package/dist/types/data-table.js.map +1 -1
- package/dist/types/grid-view.d.ts +2 -0
- package/dist/types/grid-view.d.ts.map +1 -1
- package/dist/types/grid-view.js.map +1 -1
- package/dist/types/timeline.d.ts +3 -0
- package/dist/types/timeline.d.ts.map +1 -1
- package/dist/types/timeline.js.map +1 -1
- package/package.json +2 -2
- package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +115 -0
- package/src/features/calendar/adapters/inbound/Calendar.tsx +219 -0
- package/src/features/calendar/application/createCalendarMonth.test.ts +23 -0
- package/src/features/calendar/application/createCalendarMonth.ts +38 -0
- package/src/features/calendar/application/isCalendarDateDisabled.test.ts +49 -0
- package/src/features/calendar/application/isCalendarDateDisabled.ts +41 -0
- package/src/features/calendar/calendarMeta.ts +11 -0
- package/src/features/calendar/public.test.ts +14 -0
- package/src/features/calendar/public.ts +7 -0
- package/src/features/data-table/adapters/inbound/DataTable.test.tsx +242 -0
- package/src/features/data-table/adapters/inbound/DataTable.tsx +162 -38
- package/src/features/date-picker/composition/DatePickerContent.tsx +8 -192
- package/src/features/date-picker/public.test.ts +2 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts +9 -2
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +210 -4
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +36 -3
- package/src/features/graph-view/adapters/inbound/web-artifact/placeAddedGraphNodes.test.ts +33 -0
- package/src/features/graph-view/adapters/inbound/web-artifact/placeAddedGraphNodes.ts +19 -5
- package/src/features/grid-view/adapters/inbound/GridView.tsx +6 -4
- package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +2 -0
- package/src/features/registry/componentMeta.ts +2 -0
- package/src/features/timeline/adapters/inbound/Timeline.test.tsx +175 -0
- package/src/features/timeline/adapters/inbound/Timeline.tsx +47 -26
- package/src/readerFree.ts +7 -0
- package/src/types/calendar.ts +25 -0
- package/src/types/data-table.ts +4 -0
- package/src/types/grid-view.ts +2 -0
- package/src/types/timeline.ts +3 -0
- package/web-dist/chunks/{Accordion-k81eyekh.js → Accordion-0j4xzcwz.js} +2 -2
- package/web-dist/chunks/{Accordion-5f9e10c6.js → Accordion-252dr90x.js} +1 -1
- package/web-dist/chunks/{Accordion-0pryvztw.js → Accordion-260pyaxy.js} +1 -1
- package/web-dist/chunks/{Accordion-g9hn7fht.js → Accordion-4c7hqeg3.js} +1 -1
- package/web-dist/chunks/{Accordion-0z8nry94.js → Accordion-4kmh6s2k.js} +1 -1
- package/web-dist/chunks/{Accordion-g758dqfc.js → Accordion-5pbvgvqc.js} +1 -1
- package/web-dist/chunks/{Accordion-jp5xt2kz.js → Accordion-5z8pbn4z.js} +1 -1
- package/web-dist/chunks/{Accordion-qzx53csd.js → Accordion-6jsea4e0.js} +4 -4
- package/web-dist/chunks/{Accordion-yd025qec.js → Accordion-7788ybcs.js} +2 -2
- package/web-dist/chunks/{Accordion-ppksc4jh.js → Accordion-7mnan4q4.js} +4 -4
- package/web-dist/chunks/{Accordion-0pm8dvcy.js → Accordion-8j7t77tf.js} +2 -2
- package/web-dist/chunks/{Accordion-6tesp7jr.js → Accordion-c44m1q0m.js} +1 -1
- package/web-dist/chunks/{Accordion-a6h4ff7g.js → Accordion-f2n2zz1x.js} +2 -2
- package/web-dist/chunks/{Accordion-ep9xpmbw.js → Accordion-fbehwpr1.js} +3 -3
- package/web-dist/chunks/{Accordion-j09h3pg1.js → Accordion-hf4nfkn0.js} +7 -7
- package/web-dist/chunks/{Accordion-xr81ntxh.js → Accordion-hh48jjhk.js} +4 -4
- package/web-dist/chunks/{Accordion-3qz6s2z9.js → Accordion-j6bs1yfn.js} +1 -1
- package/web-dist/chunks/{Accordion-dnpfe329.js → Accordion-jh94mg56.js} +3 -3
- package/web-dist/chunks/{Accordion-6c2ykyad.js → Accordion-jx9tc6p1.js} +2 -2
- package/web-dist/chunks/{Accordion-8xgdw6ry.js → Accordion-kcca65d8.js} +1 -1
- package/web-dist/chunks/{Accordion-g009pehq.js → Accordion-m3xb7z7j.js} +3 -3
- package/web-dist/chunks/{Accordion-eqkmzs33.js → Accordion-mpebzjby.js} +1 -1
- package/web-dist/chunks/{Accordion-n29svm40.js → Accordion-ms1y70gq.js} +1 -1
- package/web-dist/chunks/{Accordion-t0k1cjca.js → Accordion-neg1cgeh.js} +7 -5
- package/web-dist/chunks/{Accordion-wfrt39d2.js → Accordion-nnhznqgf.js} +1 -1
- package/web-dist/chunks/{Accordion-cqdfhyr9.js → Accordion-np16p9mh.js} +1 -1
- package/web-dist/chunks/{Accordion-zjygy6n2.js → Accordion-p2f0e4pn.js} +3 -3
- package/web-dist/chunks/{Accordion-q1vqpaw6.js → Accordion-p7mxkxhs.js} +4 -4
- package/web-dist/chunks/{Accordion-d6f4vr6s.js → Accordion-r6zvzrkd.js} +1 -1
- package/web-dist/chunks/Accordion-r86ce0wj.js +237 -0
- package/web-dist/chunks/{Accordion-b8659jt9.js → Accordion-rwc34cn2.js} +1 -1
- package/web-dist/chunks/{Accordion-rcff84ws.js → Accordion-s9nbkzky.js} +1 -1
- package/web-dist/chunks/{Accordion-01s50nga.js → Accordion-sxzts6bj.js} +1 -1
- package/web-dist/chunks/{Accordion-36nt5xmp.js → Accordion-t2cvrn0r.js} +4 -4
- package/web-dist/chunks/{Accordion-y5kdx80m.js → Accordion-tnt1txfq.js} +3 -3
- package/web-dist/chunks/{Accordion-bj7hv2dq.js → Accordion-vq8zrnwh.js} +1 -1
- package/web-dist/chunks/{Accordion-hh6jrz1e.js → Accordion-w0prbwy0.js} +4 -4
- package/web-dist/chunks/{Accordion-zqzqg9yc.js → Accordion-wvghkwxx.js} +6 -6
- package/web-dist/chunks/{Accordion-cp82h5jx.js → Accordion-wx0jp5cn.js} +4 -4
- package/web-dist/chunks/{Accordion-bwp6m0zd.js → Accordion-yb4as6wc.js} +2 -2
- package/web-dist/chunks/{Accordion-e9c80kn7.js → Accordion-yrzm02g2.js} +2 -2
- package/web-dist/components/accordion/Accordion.js +3 -3
- package/web-dist/components/accordion-item/AccordionItem.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +8 -8
- package/web-dist/components/app-header/AppHeader.js +8 -8
- package/web-dist/components/app-shell/AppShell.js +2 -2
- package/web-dist/components/auth-screen/AuthScreen.js +12 -12
- package/web-dist/components/avatar/Avatar.js +3 -3
- package/web-dist/components/avatar-group/AvatarGroup.js +3 -3
- package/web-dist/components/badge/Badge.js +2 -2
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -11
- package/web-dist/components/bottom-sheet/BottomSheet.js +3 -3
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +3 -3
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +3 -3
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +3 -3
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +3 -3
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +3 -3
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +5 -5
- package/web-dist/components/button/Button.js +5 -5
- package/web-dist/components/button-group/ButtonGroup.js +5 -5
- package/web-dist/components/calendar/Calendar.d.ts +8 -0
- package/web-dist/components/calendar/Calendar.dependency-0.d.ts +27 -0
- package/web-dist/components/calendar/Calendar.dependency-1.d.ts +3 -0
- package/web-dist/components/calendar/Calendar.js +25 -0
- package/web-dist/components/calendar/Calendar.types-0.d.ts +27 -0
- package/web-dist/components/calendar/Calendar.types-1.d.ts +146 -0
- package/web-dist/components/calendar/index.d.ts +2 -0
- package/web-dist/components/calendar/index.js +2 -0
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -11
- package/web-dist/components/card/Card.js +10 -10
- package/web-dist/components/chat-list-item/ChatListItem.js +6 -6
- package/web-dist/components/checkbox/Checkbox.js +4 -4
- package/web-dist/components/checkbox-group/CheckboxGroup.js +4 -4
- package/web-dist/components/chess-board/ChessBoard.js +2 -2
- package/web-dist/components/chip/Chip.js +4 -4
- package/web-dist/components/chip-group/ChipGroup.js +4 -4
- package/web-dist/components/collection-editor/CollectionEditor.js +10 -10
- package/web-dist/components/color-hue-scale/ColorHueScale.js +6 -6
- package/web-dist/components/color-picker/ColorPicker.js +6 -6
- package/web-dist/components/color-tone/ColorTone.js +6 -6
- package/web-dist/components/color-wheel/ColorWheel.js +6 -6
- package/web-dist/components/content-rail/ContentRail.js +5 -5
- package/web-dist/components/data-table/DataTable.d.ts +1 -1
- package/web-dist/components/data-table/DataTable.js +149 -64
- package/web-dist/components/data-table/DataTable.types-0.d.ts +4 -0
- package/web-dist/components/date-picker/DatePicker.js +19 -160
- package/web-dist/components/dialog/Dialog.js +4 -4
- package/web-dist/components/divider/Divider.js +2 -2
- package/web-dist/components/empty-state/EmptyState.js +11 -11
- package/web-dist/components/explorer/Explorer.js +5 -5
- package/web-dist/components/field/Field.js +4 -4
- package/web-dist/components/file-explorer/FileExplorer.js +5 -5
- package/web-dist/components/flat-list/FlatList.js +5 -5
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +12 -12
- package/web-dist/components/form/Form.js +8 -8
- package/web-dist/components/form-actions/FormActions.js +8 -8
- package/web-dist/components/form-error/FormError.js +8 -8
- package/web-dist/components/game/Game.js +3 -3
- package/web-dist/components/game-entity/GameEntity.js +3 -3
- package/web-dist/components/game-field/GameField.js +3 -3
- package/web-dist/components/game-input-zone/GameInputZone.js +3 -3
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +3 -3
- package/web-dist/components/game-overlay/GameOverlay.js +3 -3
- package/web-dist/components/gradient/Gradient.js +3 -3
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +3 -3
- package/web-dist/components/graph-view/GraphView.js +34 -11
- package/web-dist/components/grid/Grid.js +2 -2
- package/web-dist/components/grid-view/GridView.d.ts +1 -1
- package/web-dist/components/grid-view/GridView.js +1 -1
- package/web-dist/components/grid-view/GridView.types-0.d.ts +2 -0
- package/web-dist/components/hero/Hero.js +10 -10
- package/web-dist/components/icon-button/IconButton.js +5 -5
- package/web-dist/components/image/Image.js +3 -3
- package/web-dist/components/list/List.js +5 -5
- package/web-dist/components/list-item/ListItem.js +5 -5
- package/web-dist/components/list-section/ListSection.js +5 -5
- package/web-dist/components/matrix-grid/MatrixGrid.js +1 -1
- package/web-dist/components/media-card/MediaCard.js +10 -10
- package/web-dist/components/media-explorer/MediaExplorer.js +5 -5
- package/web-dist/components/message-bubble/MessageBubble.js +6 -6
- package/web-dist/components/metric-card/MetricCard.js +10 -10
- package/web-dist/components/missing-element/MissingElement.js +3 -3
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +12 -12
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +12 -12
- package/web-dist/components/opening-book/OpeningBook.js +2 -2
- package/web-dist/components/otp-form/OtpForm.js +12 -12
- package/web-dist/components/pagination/Pagination.js +5 -5
- package/web-dist/components/palette-item/PaletteItem.js +10 -10
- package/web-dist/components/popover-menu/PopoverMenu.js +4 -4
- package/web-dist/components/post-card/PostCard.js +10 -10
- package/web-dist/components/product-card/ProductCard.js +10 -10
- package/web-dist/components/progress/Progress.js +3 -3
- package/web-dist/components/progress-ring/ProgressRing.js +3 -3
- package/web-dist/components/radio/Radio.js +4 -4
- package/web-dist/components/radio-group/RadioGroup.js +4 -4
- package/web-dist/components/rating/Rating.js +2 -2
- package/web-dist/components/reader/Reader.js +11 -11
- package/web-dist/components/scan-overlay/ScanOverlay.js +11 -11
- package/web-dist/components/screen/Screen.js +2 -2
- package/web-dist/components/screen-section/ScreenSection.js +3 -3
- package/web-dist/components/scroll-view/ScrollView.js +2 -2
- package/web-dist/components/search-input/SearchInput.js +6 -6
- package/web-dist/components/section-header/SectionHeader.js +3 -3
- package/web-dist/components/section-list/SectionList.js +5 -5
- package/web-dist/components/select/Select.js +8 -8
- package/web-dist/components/sign-in-form/SignInForm.js +12 -12
- package/web-dist/components/sign-up-form/SignUpForm.js +12 -12
- package/web-dist/components/skeleton/Skeleton.js +13 -13
- package/web-dist/components/skeleton-card/SkeletonCard.js +13 -13
- package/web-dist/components/skeleton-list/SkeletonList.js +13 -13
- package/web-dist/components/skeleton-text/SkeletonText.js +13 -13
- package/web-dist/components/spatial-grid/SpatialGrid.js +1 -1
- package/web-dist/components/surface/Surface.js +3 -3
- package/web-dist/components/switch/Switch.js +2 -2
- package/web-dist/components/tab/Tab.js +2 -2
- package/web-dist/components/tab-list/TabList.js +2 -2
- package/web-dist/components/tab-panel/TabPanel.js +2 -2
- package/web-dist/components/tabs/Tabs.js +2 -2
- package/web-dist/components/text-input/TextInput.js +6 -6
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +5 -5
- package/web-dist/components/tile-grid/TileGrid.js +1 -1
- package/web-dist/components/time-grid/TimeGrid.js +1 -1
- package/web-dist/components/time-picker/TimePicker.js +9 -9
- package/web-dist/components/timeline/Timeline.dependency-2.d.ts +8 -2
- package/web-dist/components/timeline/Timeline.dependency-3.d.ts +23 -0
- package/web-dist/components/timeline/Timeline.dependency-4.d.ts +3 -0
- package/web-dist/components/timeline/Timeline.js +30 -11
- package/web-dist/components/timeline/Timeline.types-0.d.ts +5 -1
- package/web-dist/components/toast/Toast.js +4 -4
- package/web-dist/components/toast-provider/ToastProvider.js +4 -4
- package/web-dist/components/toolbar/Toolbar.js +10 -10
- package/web-dist/components/tree-item/TreeItem.js +7 -7
- package/web-dist/components/uploader/Uploader.js +14 -14
- package/web-dist/components/view/View.js +2 -2
- package/web-dist/manifest.json +720 -673
- package/web-dist/runtime/ZoraProvider.js +3 -3
- /package/web-dist/chunks/{Accordion-kpk964z0.js → Accordion-a8k3cvj0.js} +0 -0
|
@@ -5,47 +5,50 @@ import {
|
|
|
5
5
|
} from "../../chunks/Accordion-zj4wnm3e.js";
|
|
6
6
|
import"../../chunks/Accordion-vzgpdtr2.js";
|
|
7
7
|
import"../../chunks/Accordion-tpd1vvy9.js";
|
|
8
|
-
import"../../chunks/Accordion-
|
|
9
|
-
import"../../chunks/Accordion-
|
|
8
|
+
import"../../chunks/Accordion-a8k3cvj0.js";
|
|
9
|
+
import"../../chunks/Accordion-c44m1q0m.js";
|
|
10
10
|
import"../../chunks/Accordion-8vcs6nz6.js";
|
|
11
|
-
import"../../chunks/Accordion-
|
|
11
|
+
import"../../chunks/Accordion-8j7t77tf.js";
|
|
12
12
|
import {
|
|
13
13
|
withZoraThemeScope
|
|
14
14
|
} from "../../chunks/Accordion-mrhkw8n6.js";
|
|
15
15
|
import {
|
|
16
16
|
Button2,
|
|
17
17
|
IconButton2
|
|
18
|
-
} from "../../chunks/Accordion-
|
|
18
|
+
} from "../../chunks/Accordion-6jsea4e0.js";
|
|
19
19
|
import {
|
|
20
20
|
View2
|
|
21
|
-
} from "../../chunks/Accordion-
|
|
22
|
-
import"../../chunks/Accordion-
|
|
21
|
+
} from "../../chunks/Accordion-r6zvzrkd.js";
|
|
22
|
+
import"../../chunks/Accordion-s9nbkzky.js";
|
|
23
23
|
import {
|
|
24
24
|
Card2
|
|
25
|
-
} from "../../chunks/Accordion-
|
|
25
|
+
} from "../../chunks/Accordion-hf4nfkn0.js";
|
|
26
26
|
import {
|
|
27
27
|
Text3
|
|
28
28
|
} from "../../chunks/Accordion-ew2cebyd.js";
|
|
29
|
-
import"../../chunks/Accordion-
|
|
29
|
+
import"../../chunks/Accordion-ms1y70gq.js";
|
|
30
30
|
import"../../chunks/Accordion-9hcbf56f.js";
|
|
31
|
-
import"../../chunks/Accordion-
|
|
32
|
-
import"../../chunks/Accordion-
|
|
31
|
+
import"../../chunks/Accordion-260pyaxy.js";
|
|
32
|
+
import"../../chunks/Accordion-kcca65d8.js";
|
|
33
33
|
import {
|
|
34
34
|
EmptyState2
|
|
35
|
-
} from "../../chunks/Accordion-
|
|
35
|
+
} from "../../chunks/Accordion-tnt1txfq.js";
|
|
36
|
+
import"../../chunks/Accordion-mnac2z83.js";
|
|
37
|
+
import {
|
|
38
|
+
Checkbox2
|
|
39
|
+
} from "../../chunks/Accordion-fbehwpr1.js";
|
|
36
40
|
import"../../chunks/Accordion-6zb9d92y.js";
|
|
37
41
|
import"../../chunks/Accordion-be2yhfqz.js";
|
|
38
|
-
import"../../chunks/Accordion-mnac2z83.js";
|
|
39
42
|
import"../../chunks/Accordion-dtt4qkrb.js";
|
|
40
43
|
import"../../chunks/Accordion-waxb6x73.js";
|
|
41
44
|
import {
|
|
42
45
|
PopoverMenu2
|
|
43
|
-
} from "../../chunks/Accordion-
|
|
46
|
+
} from "../../chunks/Accordion-m3xb7z7j.js";
|
|
44
47
|
import {
|
|
45
48
|
SkeletonList2
|
|
46
|
-
} from "../../chunks/Accordion-
|
|
47
|
-
import"../../chunks/Accordion-
|
|
48
|
-
import"../../chunks/Accordion-
|
|
49
|
+
} from "../../chunks/Accordion-7mnan4q4.js";
|
|
50
|
+
import"../../chunks/Accordion-p7mxkxhs.js";
|
|
51
|
+
import"../../chunks/Accordion-5z8pbn4z.js";
|
|
49
52
|
import"../../chunks/Accordion-eqvdv7tt.js";
|
|
50
53
|
import"../../chunks/Accordion-61e19g3e.js";
|
|
51
54
|
import"../../chunks/Accordion-c6edgxay.js";
|
|
@@ -111,11 +114,14 @@ function resolveCellStyle(column) {
|
|
|
111
114
|
return {
|
|
112
115
|
alignItems: resolveCellJustify(column.align),
|
|
113
116
|
flexGrow: column.width === undefined ? 1 : 0,
|
|
114
|
-
flexShrink: 0,
|
|
115
|
-
minWidth: column.minWidth
|
|
117
|
+
flexShrink: column.width === undefined && column.minWidth === undefined ? 1 : 0,
|
|
118
|
+
minWidth: column.minWidth,
|
|
116
119
|
width: column.width
|
|
117
120
|
};
|
|
118
121
|
}
|
|
122
|
+
function resolveSelectionColumnStyle() {
|
|
123
|
+
return { alignItems: "center", flexShrink: 0, width: 40 };
|
|
124
|
+
}
|
|
119
125
|
function resolveRowPadding(density) {
|
|
120
126
|
return density === "compact" ? { px: "m", py: "s" } : { px: "m", py: "m" };
|
|
121
127
|
}
|
|
@@ -165,6 +171,13 @@ function renderTableCell(column, row, rowIndex) {
|
|
|
165
171
|
function resolveNextSortDirection(current) {
|
|
166
172
|
return current === "asc" ? "desc" : "asc";
|
|
167
173
|
}
|
|
174
|
+
function resolveNextSelectedRowIds(selectedRowIds, rowId, selected) {
|
|
175
|
+
return selected ? [...new Set([...selectedRowIds, rowId])] : selectedRowIds.filter((selectedRowId) => selectedRowId !== rowId);
|
|
176
|
+
}
|
|
177
|
+
function resolveNextVisibleSelection(selectedRowIds, visibleRowIds, selected) {
|
|
178
|
+
const visibleRowIdSet = new Set(visibleRowIds);
|
|
179
|
+
return selected ? [...new Set([...selectedRowIds, ...visibleRowIds])] : selectedRowIds.filter((selectedRowId) => !visibleRowIdSet.has(selectedRowId));
|
|
180
|
+
}
|
|
168
181
|
function mapRowActions(row, actions) {
|
|
169
182
|
return actions.map((action) => ({
|
|
170
183
|
description: action.description,
|
|
@@ -206,7 +219,9 @@ function DataTableHeader({
|
|
|
206
219
|
sort,
|
|
207
220
|
onSortChange,
|
|
208
221
|
density,
|
|
209
|
-
interactionPolicy
|
|
222
|
+
interactionPolicy,
|
|
223
|
+
selection,
|
|
224
|
+
hasRowActions
|
|
210
225
|
}) {
|
|
211
226
|
const padding = resolveRowPadding(density ?? "comfortable");
|
|
212
227
|
const passive = interactionPolicy === "passive";
|
|
@@ -219,6 +234,18 @@ function DataTableHeader({
|
|
|
219
234
|
direction: "row",
|
|
220
235
|
align: "center",
|
|
221
236
|
children: [
|
|
237
|
+
selection ? /* @__PURE__ */ jsx2(View2, {
|
|
238
|
+
px: padding.px,
|
|
239
|
+
py: padding.py,
|
|
240
|
+
style: resolveSelectionColumnStyle(),
|
|
241
|
+
children: /* @__PURE__ */ jsx2(Checkbox2, {
|
|
242
|
+
accessibilityLabel: "Select all visible rows",
|
|
243
|
+
checked: selection.allVisibleSelected,
|
|
244
|
+
disabled: selection.disabled,
|
|
245
|
+
interactionPolicy,
|
|
246
|
+
onCheckedChange: selection.onAllVisibleSelectedChange
|
|
247
|
+
})
|
|
248
|
+
}) : null,
|
|
222
249
|
columns.map((column) => {
|
|
223
250
|
const currentDirection = sort?.columnId === column.id ? sort.direction : undefined;
|
|
224
251
|
const sortable = Boolean(column.sortable && onSortChange);
|
|
@@ -253,7 +280,7 @@ function DataTableHeader({
|
|
|
253
280
|
})
|
|
254
281
|
}, column.id);
|
|
255
282
|
}),
|
|
256
|
-
/* @__PURE__ */ jsx2(View2, {
|
|
283
|
+
hasRowActions ? /* @__PURE__ */ jsx2(View2, {
|
|
257
284
|
px: padding.px,
|
|
258
285
|
py: padding.py,
|
|
259
286
|
style: { minWidth: 56, width: 56 },
|
|
@@ -264,7 +291,7 @@ function DataTableHeader({
|
|
|
264
291
|
weight: "semiBold",
|
|
265
292
|
children: "Actions"
|
|
266
293
|
})
|
|
267
|
-
})
|
|
294
|
+
}) : null
|
|
268
295
|
]
|
|
269
296
|
})
|
|
270
297
|
});
|
|
@@ -275,6 +302,8 @@ function DataTableDesktop({
|
|
|
275
302
|
rowActions,
|
|
276
303
|
rowId,
|
|
277
304
|
rowKey,
|
|
305
|
+
selectedRowIds,
|
|
306
|
+
onSelectedRowIdsChange,
|
|
278
307
|
sort,
|
|
279
308
|
onSortChange,
|
|
280
309
|
density,
|
|
@@ -282,11 +311,25 @@ function DataTableDesktop({
|
|
|
282
311
|
interactionPolicy
|
|
283
312
|
}) {
|
|
284
313
|
const padding = resolveRowPadding(density ?? "comfortable");
|
|
314
|
+
const rowIds = rows.map((row, rowIndex) => resolveDataTableRowKey(row, rowIndex, rowKey, rowId));
|
|
315
|
+
const controlledSelectedRowIds = selectedRowIds ?? [];
|
|
316
|
+
const selectedRowIdSet = new Set(controlledSelectedRowIds);
|
|
317
|
+
const selectionEnabled = selectedRowIds !== undefined;
|
|
318
|
+
const selectionDisabled = interactionPolicy === "passive" || onSelectedRowIdsChange === undefined;
|
|
319
|
+
const hasRowActions = rows.some((row, rowIndex) => (rowActions?.(row, rowIndex).length ?? 0) > 0);
|
|
320
|
+
const selection = selectionEnabled ? {
|
|
321
|
+
allVisibleSelected: rowIds.every((currentRowId) => selectedRowIdSet.has(currentRowId)),
|
|
322
|
+
disabled: selectionDisabled,
|
|
323
|
+
onAllVisibleSelectedChange: (selected) => {
|
|
324
|
+
if (selectionDisabled)
|
|
325
|
+
return;
|
|
326
|
+
onSelectedRowIdsChange(resolveNextVisibleSelection(controlledSelectedRowIds, rowIds, selected));
|
|
327
|
+
}
|
|
328
|
+
} : undefined;
|
|
285
329
|
return /* @__PURE__ */ jsx2(import_react_native.ScrollView, {
|
|
286
330
|
horizontal: true,
|
|
287
331
|
showsHorizontalScrollIndicator: false,
|
|
288
332
|
children: /* @__PURE__ */ jsx2(View2, {
|
|
289
|
-
minWidth: 720,
|
|
290
333
|
style: { width: "100%" },
|
|
291
334
|
children: /* @__PURE__ */ jsxs(View2, {
|
|
292
335
|
gap: "xs",
|
|
@@ -294,37 +337,59 @@ function DataTableDesktop({
|
|
|
294
337
|
/* @__PURE__ */ jsx2(DataTableHeader, {
|
|
295
338
|
columns,
|
|
296
339
|
density,
|
|
340
|
+
hasRowActions,
|
|
297
341
|
interactionPolicy,
|
|
298
342
|
onSortChange,
|
|
343
|
+
selection,
|
|
299
344
|
sort
|
|
300
345
|
}),
|
|
301
346
|
/* @__PURE__ */ jsx2(View2, {
|
|
302
347
|
gap: "xs",
|
|
303
|
-
children: rows.map((row, rowIndex) =>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
children:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
348
|
+
children: rows.map((row, rowIndex) => {
|
|
349
|
+
const currentRowId = resolveDataTableRowKey(row, rowIndex, rowKey, rowId);
|
|
350
|
+
const selected = selectedRowIdSet.has(currentRowId);
|
|
351
|
+
return /* @__PURE__ */ jsx2(View2, {
|
|
352
|
+
bg: "surface",
|
|
353
|
+
borderColor: "border",
|
|
354
|
+
borderWidth: 1,
|
|
355
|
+
radius: "m",
|
|
356
|
+
testID: testID ? `${testID}-row-${rowIndex}` : undefined,
|
|
357
|
+
children: /* @__PURE__ */ jsxs(View2, {
|
|
358
|
+
direction: "row",
|
|
359
|
+
align: "center",
|
|
360
|
+
children: [
|
|
361
|
+
selectionEnabled ? /* @__PURE__ */ jsx2(View2, {
|
|
362
|
+
px: padding.px,
|
|
363
|
+
py: padding.py,
|
|
364
|
+
style: resolveSelectionColumnStyle(),
|
|
365
|
+
children: /* @__PURE__ */ jsx2(Checkbox2, {
|
|
366
|
+
accessibilityLabel: `Select row ${currentRowId}`,
|
|
367
|
+
checked: selected,
|
|
368
|
+
disabled: selectionDisabled,
|
|
369
|
+
interactionPolicy,
|
|
370
|
+
onCheckedChange: (nextSelected) => {
|
|
371
|
+
if (selectionDisabled)
|
|
372
|
+
return;
|
|
373
|
+
onSelectedRowIdsChange(resolveNextSelectedRowIds(controlledSelectedRowIds, currentRowId, nextSelected));
|
|
374
|
+
}
|
|
375
|
+
})
|
|
376
|
+
}) : null,
|
|
377
|
+
columns.map((column) => /* @__PURE__ */ jsx2(View2, {
|
|
378
|
+
px: padding.px,
|
|
379
|
+
py: padding.py,
|
|
380
|
+
style: resolveCellStyle(column),
|
|
381
|
+
children: renderTableCell(column, row, rowIndex)
|
|
382
|
+
}, column.id)),
|
|
383
|
+
hasRowActions ? /* @__PURE__ */ jsx2(View2, {
|
|
384
|
+
px: padding.px,
|
|
385
|
+
py: padding.py,
|
|
386
|
+
style: { alignItems: "flex-end", minWidth: 56, width: 56 },
|
|
387
|
+
children: renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy })
|
|
388
|
+
}) : null
|
|
389
|
+
]
|
|
390
|
+
})
|
|
391
|
+
}, currentRowId);
|
|
392
|
+
})
|
|
328
393
|
})
|
|
329
394
|
]
|
|
330
395
|
})
|
|
@@ -337,13 +402,20 @@ function DataTableMobile({
|
|
|
337
402
|
rowActions,
|
|
338
403
|
rowId,
|
|
339
404
|
rowKey,
|
|
405
|
+
selectedRowIds,
|
|
406
|
+
onSelectedRowIdsChange,
|
|
340
407
|
testID,
|
|
341
408
|
interactionPolicy
|
|
342
409
|
}) {
|
|
343
410
|
const [primaryColumn, ...detailColumns] = columns;
|
|
411
|
+
const controlledSelectedRowIds = selectedRowIds ?? [];
|
|
412
|
+
const selectedRowIdSet = new Set(controlledSelectedRowIds);
|
|
413
|
+
const selectionEnabled = selectedRowIds !== undefined;
|
|
414
|
+
const selectionDisabled = interactionPolicy === "passive" || onSelectedRowIdsChange === undefined;
|
|
344
415
|
return /* @__PURE__ */ jsx2(View2, {
|
|
345
416
|
gap: "s",
|
|
346
417
|
children: rows.map((row, rowIndex) => {
|
|
418
|
+
const currentRowId = resolveDataTableRowKey(row, rowIndex, rowKey, rowId);
|
|
347
419
|
const title = primaryColumn ? renderCell(primaryColumn, row, rowIndex) : `Row ${rowIndex + 1}`;
|
|
348
420
|
const actions = renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy });
|
|
349
421
|
return /* @__PURE__ */ jsx2(Card2, {
|
|
@@ -352,25 +424,38 @@ function DataTableMobile({
|
|
|
352
424
|
interactionPolicy,
|
|
353
425
|
testID: testID ? `${testID}-card-${rowIndex}` : undefined,
|
|
354
426
|
title,
|
|
355
|
-
children: /* @__PURE__ */
|
|
427
|
+
children: /* @__PURE__ */ jsxs(View2, {
|
|
356
428
|
gap: "s",
|
|
357
|
-
children:
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
429
|
+
children: [
|
|
430
|
+
selectionEnabled ? /* @__PURE__ */ jsx2(Checkbox2, {
|
|
431
|
+
accessibilityLabel: `Select row ${currentRowId}`,
|
|
432
|
+
checked: selectedRowIdSet.has(currentRowId),
|
|
433
|
+
disabled: selectionDisabled,
|
|
434
|
+
interactionPolicy,
|
|
435
|
+
onCheckedChange: (nextSelected) => {
|
|
436
|
+
if (selectionDisabled)
|
|
437
|
+
return;
|
|
438
|
+
onSelectedRowIdsChange(resolveNextSelectedRowIds(controlledSelectedRowIds, currentRowId, nextSelected));
|
|
439
|
+
}
|
|
440
|
+
}) : null,
|
|
441
|
+
detailColumns.map((column) => /* @__PURE__ */ jsxs(View2, {
|
|
442
|
+
gap: "xxs",
|
|
443
|
+
children: [
|
|
444
|
+
/* @__PURE__ */ jsx2(Text3, {
|
|
445
|
+
emphasis: "muted",
|
|
446
|
+
variant: "caption",
|
|
447
|
+
weight: "semiBold",
|
|
448
|
+
children: column.header
|
|
449
|
+
}),
|
|
450
|
+
column.renderCell ? renderCell(column, row, rowIndex) : /* @__PURE__ */ jsx2(Text3, {
|
|
451
|
+
variant: "bodySmall",
|
|
452
|
+
children: renderDefaultCell(resolveAccessorValue(row, column))
|
|
453
|
+
})
|
|
454
|
+
]
|
|
455
|
+
}, column.id))
|
|
456
|
+
]
|
|
372
457
|
})
|
|
373
|
-
},
|
|
458
|
+
}, currentRowId);
|
|
374
459
|
})
|
|
375
460
|
});
|
|
376
461
|
}
|
|
@@ -50,6 +50,10 @@ export interface DataTableProps<TRow extends object> extends ZoraBaseProps {
|
|
|
50
50
|
rows: readonly TRow[];
|
|
51
51
|
rowId?: (row: TRow, index: number) => string;
|
|
52
52
|
rowKey?: keyof TRow;
|
|
53
|
+
/** Controlled identifiers for rows selected with the optional checkbox column. */
|
|
54
|
+
selectedRowIds?: readonly string[];
|
|
55
|
+
/** Receives the next controlled selection after a row or visible-row toggle. */
|
|
56
|
+
onSelectedRowIdsChange?: (selectedRowIds: readonly string[]) => void;
|
|
53
57
|
rowActions?: (row: TRow, index: number) => readonly DataTableRowAction<TRow>[];
|
|
54
58
|
sort?: DataTableSortState;
|
|
55
59
|
onSortChange?: (sort: DataTableSortState) => void;
|
|
@@ -5,33 +5,35 @@ import {
|
|
|
5
5
|
Popover
|
|
6
6
|
} from "../../chunks/Accordion-waxb6x73.js";
|
|
7
7
|
import"../../chunks/Accordion-zj4wnm3e.js";
|
|
8
|
-
import"../../chunks/Accordion-
|
|
8
|
+
import"../../chunks/Accordion-a8k3cvj0.js";
|
|
9
9
|
import"../../chunks/Accordion-tpd1vvy9.js";
|
|
10
|
-
import"../../chunks/Accordion-
|
|
10
|
+
import"../../chunks/Accordion-s9nbkzky.js";
|
|
11
11
|
import {
|
|
12
12
|
withZoraThemeScope
|
|
13
13
|
} from "../../chunks/Accordion-mrhkw8n6.js";
|
|
14
14
|
import {
|
|
15
15
|
Surface2
|
|
16
|
-
} from "../../chunks/Accordion-
|
|
16
|
+
} from "../../chunks/Accordion-4kmh6s2k.js";
|
|
17
17
|
import"../../chunks/Accordion-vzgpdtr2.js";
|
|
18
|
-
import"../../chunks/Accordion-
|
|
18
|
+
import"../../chunks/Accordion-c44m1q0m.js";
|
|
19
19
|
import"../../chunks/Accordion-8vcs6nz6.js";
|
|
20
|
-
import"../../chunks/Accordion-
|
|
20
|
+
import"../../chunks/Accordion-8j7t77tf.js";
|
|
21
21
|
import {
|
|
22
22
|
Button2
|
|
23
|
-
} from "../../chunks/Accordion-
|
|
23
|
+
} from "../../chunks/Accordion-6jsea4e0.js";
|
|
24
24
|
import {
|
|
25
25
|
View2
|
|
26
|
-
} from "../../chunks/Accordion-
|
|
26
|
+
} from "../../chunks/Accordion-r6zvzrkd.js";
|
|
27
|
+
import"../../chunks/Accordion-neg1cgeh.js";
|
|
28
|
+
import"../../chunks/Accordion-ew2cebyd.js";
|
|
27
29
|
import {
|
|
28
|
-
|
|
29
|
-
} from "../../chunks/Accordion-
|
|
30
|
+
Calendar2
|
|
31
|
+
} from "../../chunks/Accordion-r86ce0wj.js";
|
|
30
32
|
import {
|
|
31
33
|
PickerHeader,
|
|
32
34
|
PickerField
|
|
33
|
-
} from "../../chunks/Accordion-
|
|
34
|
-
import"../../chunks/Accordion-
|
|
35
|
+
} from "../../chunks/Accordion-0j4xzcwz.js";
|
|
36
|
+
import"../../chunks/Accordion-nnhznqgf.js";
|
|
35
37
|
import"../../chunks/Accordion-61e19g3e.js";
|
|
36
38
|
import"../../chunks/Accordion-c6edgxay.js";
|
|
37
39
|
import"../../chunks/Accordion-9d3rd7ne.js";
|
|
@@ -69,8 +71,6 @@ function formatLocalDate(value) {
|
|
|
69
71
|
|
|
70
72
|
// src/features/date-picker/composition/DatePickerContent.tsx
|
|
71
73
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
72
|
-
var WEEKDAY_LABELS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
73
|
-
var DAY_CELL_WIDTH = 42;
|
|
74
74
|
function DatePickerContent({
|
|
75
75
|
description,
|
|
76
76
|
interactionPolicy,
|
|
@@ -82,10 +82,9 @@ function DatePickerContent({
|
|
|
82
82
|
testID,
|
|
83
83
|
value
|
|
84
84
|
}) {
|
|
85
|
-
const [displayMonth, setDisplayMonth] = React.useState(() => resolveInitialMonth(value, minDate));
|
|
86
|
-
const monthDays = React.useMemo(() => createMonthDays(displayMonth), [displayMonth]);
|
|
87
85
|
const resolvedMaxDate = React.useMemo(() => parseLocalDate(maxDate), [maxDate]);
|
|
88
86
|
const resolvedMinDate = React.useMemo(() => parseLocalDate(minDate), [minDate]);
|
|
87
|
+
const selectedDate = React.useMemo(() => parseLocalDate(value), [value]);
|
|
89
88
|
return /* @__PURE__ */ jsxs(View2, {
|
|
90
89
|
gap: "m",
|
|
91
90
|
p: "m",
|
|
@@ -95,22 +94,14 @@ function DatePickerContent({
|
|
|
95
94
|
description,
|
|
96
95
|
title: label ?? "Choose date"
|
|
97
96
|
}),
|
|
98
|
-
/* @__PURE__ */ jsx(
|
|
99
|
-
|
|
97
|
+
/* @__PURE__ */ jsx(Calendar2, {
|
|
98
|
+
density: "compact",
|
|
100
99
|
interactionPolicy,
|
|
101
100
|
maxDate: resolvedMaxDate,
|
|
102
101
|
minDate: resolvedMinDate,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */ jsx(DatePickerCalendar, {
|
|
107
|
-
interactionPolicy,
|
|
108
|
-
maxDate: resolvedMaxDate,
|
|
109
|
-
minDate: resolvedMinDate,
|
|
110
|
-
monthDays,
|
|
111
|
-
onSelect,
|
|
112
|
-
testID,
|
|
113
|
-
value
|
|
102
|
+
onSelectedDateChange: onSelect,
|
|
103
|
+
selectedDate: selectedDate ?? null,
|
|
104
|
+
testID
|
|
114
105
|
}),
|
|
115
106
|
/* @__PURE__ */ jsx(Button2, {
|
|
116
107
|
fullWidth: true,
|
|
@@ -122,138 +113,6 @@ function DatePickerContent({
|
|
|
122
113
|
]
|
|
123
114
|
});
|
|
124
115
|
}
|
|
125
|
-
function DatePickerMonthNavigation({
|
|
126
|
-
displayMonth,
|
|
127
|
-
interactionPolicy,
|
|
128
|
-
maxDate,
|
|
129
|
-
minDate,
|
|
130
|
-
onMonthChange
|
|
131
|
-
}) {
|
|
132
|
-
const previousMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() - 1, 1);
|
|
133
|
-
const nextMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() + 1, 1);
|
|
134
|
-
return /* @__PURE__ */ jsxs(View2, {
|
|
135
|
-
align: "center",
|
|
136
|
-
direction: "row",
|
|
137
|
-
justify: "space-between",
|
|
138
|
-
children: [
|
|
139
|
-
/* @__PURE__ */ jsx(Button2, {
|
|
140
|
-
disabled: !canNavigateToMonth(previousMonth, minDate, maxDate),
|
|
141
|
-
interactionPolicy,
|
|
142
|
-
onPress: () => onMonthChange(previousMonth),
|
|
143
|
-
size: "s",
|
|
144
|
-
variant: "ghost",
|
|
145
|
-
children: "Previous"
|
|
146
|
-
}),
|
|
147
|
-
/* @__PURE__ */ jsx(Text3, {
|
|
148
|
-
align: "center",
|
|
149
|
-
variant: "label",
|
|
150
|
-
weight: "semiBold",
|
|
151
|
-
children: formatMonthLabel(displayMonth)
|
|
152
|
-
}),
|
|
153
|
-
/* @__PURE__ */ jsx(Button2, {
|
|
154
|
-
disabled: !canNavigateToMonth(nextMonth, minDate, maxDate),
|
|
155
|
-
interactionPolicy,
|
|
156
|
-
onPress: () => onMonthChange(nextMonth),
|
|
157
|
-
size: "s",
|
|
158
|
-
variant: "ghost",
|
|
159
|
-
children: "Next"
|
|
160
|
-
})
|
|
161
|
-
]
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
function DatePickerWeekdays() {
|
|
165
|
-
return /* @__PURE__ */ jsx(View2, {
|
|
166
|
-
direction: "row",
|
|
167
|
-
justify: "space-between",
|
|
168
|
-
children: WEEKDAY_LABELS.map((weekday) => /* @__PURE__ */ jsx(View2, {
|
|
169
|
-
width: DAY_CELL_WIDTH,
|
|
170
|
-
children: /* @__PURE__ */ jsx(Text3, {
|
|
171
|
-
align: "center",
|
|
172
|
-
emphasis: "muted",
|
|
173
|
-
variant: "caption",
|
|
174
|
-
weight: "semiBold",
|
|
175
|
-
children: weekday
|
|
176
|
-
})
|
|
177
|
-
}, weekday))
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
function DatePickerCalendar({
|
|
181
|
-
interactionPolicy,
|
|
182
|
-
maxDate,
|
|
183
|
-
minDate,
|
|
184
|
-
monthDays,
|
|
185
|
-
onSelect,
|
|
186
|
-
testID,
|
|
187
|
-
value
|
|
188
|
-
}) {
|
|
189
|
-
return /* @__PURE__ */ jsx(View2, {
|
|
190
|
-
direction: "row",
|
|
191
|
-
gap: "xs",
|
|
192
|
-
wrap: "wrap",
|
|
193
|
-
children: monthDays.map((day, index) => {
|
|
194
|
-
if (!day)
|
|
195
|
-
return /* @__PURE__ */ jsx(View2, {
|
|
196
|
-
width: DAY_CELL_WIDTH
|
|
197
|
-
}, `empty-${index}`);
|
|
198
|
-
const selected = isSameLocalDay(value, day);
|
|
199
|
-
return /* @__PURE__ */ jsx(View2, {
|
|
200
|
-
width: DAY_CELL_WIDTH,
|
|
201
|
-
children: /* @__PURE__ */ jsx(Button2, {
|
|
202
|
-
color: selected ? "primary" : "neutral",
|
|
203
|
-
disabled: isDateDisabled(day, minDate, maxDate),
|
|
204
|
-
interactionPolicy,
|
|
205
|
-
onPress: () => onSelect(day),
|
|
206
|
-
size: "s",
|
|
207
|
-
testID: testID ? `${testID}-day-${day.getDate()}` : undefined,
|
|
208
|
-
variant: selected ? "solid" : "ghost",
|
|
209
|
-
children: day.getDate()
|
|
210
|
-
})
|
|
211
|
-
}, day.toISOString());
|
|
212
|
-
})
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
function isSameLocalDay(left, right) {
|
|
216
|
-
return left === formatLocalDate(right);
|
|
217
|
-
}
|
|
218
|
-
function startOfLocalDay(value) {
|
|
219
|
-
return new Date(value.getFullYear(), value.getMonth(), value.getDate());
|
|
220
|
-
}
|
|
221
|
-
function isBeforeLocalDay(left, right) {
|
|
222
|
-
return startOfLocalDay(left).getTime() < startOfLocalDay(right).getTime();
|
|
223
|
-
}
|
|
224
|
-
function isAfterLocalDay(left, right) {
|
|
225
|
-
return startOfLocalDay(left).getTime() > startOfLocalDay(right).getTime();
|
|
226
|
-
}
|
|
227
|
-
function isDateDisabled(value, minDate, maxDate) {
|
|
228
|
-
if (minDate && isBeforeLocalDay(value, minDate))
|
|
229
|
-
return true;
|
|
230
|
-
if (maxDate && isAfterLocalDay(value, maxDate))
|
|
231
|
-
return true;
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
function formatMonthLabel(value) {
|
|
235
|
-
return value.toLocaleDateString(undefined, { month: "long", year: "numeric" });
|
|
236
|
-
}
|
|
237
|
-
function createMonthDays(month) {
|
|
238
|
-
const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
239
|
-
const dayCount = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();
|
|
240
|
-
const populatedLength = firstDay.getDay() + dayCount;
|
|
241
|
-
const paddedLength = Math.ceil(populatedLength / 7) * 7;
|
|
242
|
-
return Array.from({ length: paddedLength }, (_, index) => index < firstDay.getDay() ? null : new Date(month.getFullYear(), month.getMonth(), index - firstDay.getDay() + 1));
|
|
243
|
-
}
|
|
244
|
-
function resolveInitialMonth(value, minDate) {
|
|
245
|
-
const base = parseLocalDate(value) ?? parseLocalDate(minDate) ?? new Date;
|
|
246
|
-
return new Date(base.getFullYear(), base.getMonth(), 1);
|
|
247
|
-
}
|
|
248
|
-
function canNavigateToMonth(month, minDate, maxDate) {
|
|
249
|
-
const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
250
|
-
const lastDay = new Date(month.getFullYear(), month.getMonth() + 1, 0);
|
|
251
|
-
if (maxDate && isAfterLocalDay(firstDay, maxDate))
|
|
252
|
-
return false;
|
|
253
|
-
if (minDate && isBeforeLocalDay(lastDay, minDate))
|
|
254
|
-
return false;
|
|
255
|
-
return true;
|
|
256
|
-
}
|
|
257
116
|
|
|
258
117
|
// src/features/date-picker/composition/DatePickerField.tsx
|
|
259
118
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import"../../chunks/Accordion-6zb9d92y.js";
|
|
3
3
|
import"../../chunks/Accordion-be2yhfqz.js";
|
|
4
4
|
import"../../chunks/Accordion-dtt4qkrb.js";
|
|
5
|
-
import"../../chunks/Accordion-
|
|
5
|
+
import"../../chunks/Accordion-a8k3cvj0.js";
|
|
6
6
|
import"../../chunks/Accordion-zj4wnm3e.js";
|
|
7
7
|
import"../../chunks/Accordion-tpd1vvy9.js";
|
|
8
|
-
import"../../chunks/Accordion-
|
|
8
|
+
import"../../chunks/Accordion-s9nbkzky.js";
|
|
9
9
|
import {
|
|
10
10
|
Dialog2
|
|
11
|
-
} from "../../chunks/Accordion-
|
|
11
|
+
} from "../../chunks/Accordion-p2f0e4pn.js";
|
|
12
12
|
import"../../chunks/Accordion-mrhkw8n6.js";
|
|
13
|
-
import"../../chunks/Accordion-
|
|
13
|
+
import"../../chunks/Accordion-r6zvzrkd.js";
|
|
14
14
|
import"../../chunks/Accordion-ew2cebyd.js";
|
|
15
15
|
import"../../chunks/Accordion-eqvdv7tt.js";
|
|
16
16
|
import"../../chunks/Accordion-c6edgxay.js";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import"../../chunks/Accordion-tpd1vvy9.js";
|
|
3
3
|
import"../../chunks/Accordion-mrhkw8n6.js";
|
|
4
4
|
import"../../chunks/Accordion-zj4wnm3e.js";
|
|
5
|
-
import"../../chunks/Accordion-
|
|
5
|
+
import"../../chunks/Accordion-a8k3cvj0.js";
|
|
6
6
|
import {
|
|
7
7
|
Divider2
|
|
8
|
-
} from "../../chunks/Accordion-
|
|
8
|
+
} from "../../chunks/Accordion-r6zvzrkd.js";
|
|
9
9
|
import"../../chunks/Accordion-fre84yaq.js";
|
|
10
10
|
import"../../chunks/Accordion-xgpzh4wq.js";
|
|
11
11
|
export {
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
import"../../chunks/Accordion-vzgpdtr2.js";
|
|
3
3
|
import"../../chunks/Accordion-tpd1vvy9.js";
|
|
4
4
|
import"../../chunks/Accordion-zj4wnm3e.js";
|
|
5
|
-
import"../../chunks/Accordion-
|
|
6
|
-
import"../../chunks/Accordion-
|
|
5
|
+
import"../../chunks/Accordion-a8k3cvj0.js";
|
|
6
|
+
import"../../chunks/Accordion-c44m1q0m.js";
|
|
7
7
|
import"../../chunks/Accordion-8vcs6nz6.js";
|
|
8
|
-
import"../../chunks/Accordion-
|
|
8
|
+
import"../../chunks/Accordion-8j7t77tf.js";
|
|
9
9
|
import"../../chunks/Accordion-mrhkw8n6.js";
|
|
10
|
-
import"../../chunks/Accordion-
|
|
11
|
-
import"../../chunks/Accordion-
|
|
12
|
-
import"../../chunks/Accordion-
|
|
13
|
-
import"../../chunks/Accordion-
|
|
10
|
+
import"../../chunks/Accordion-6jsea4e0.js";
|
|
11
|
+
import"../../chunks/Accordion-r6zvzrkd.js";
|
|
12
|
+
import"../../chunks/Accordion-s9nbkzky.js";
|
|
13
|
+
import"../../chunks/Accordion-hf4nfkn0.js";
|
|
14
14
|
import"../../chunks/Accordion-ew2cebyd.js";
|
|
15
|
-
import"../../chunks/Accordion-
|
|
15
|
+
import"../../chunks/Accordion-ms1y70gq.js";
|
|
16
16
|
import"../../chunks/Accordion-9hcbf56f.js";
|
|
17
|
-
import"../../chunks/Accordion-
|
|
18
|
-
import"../../chunks/Accordion-
|
|
17
|
+
import"../../chunks/Accordion-260pyaxy.js";
|
|
18
|
+
import"../../chunks/Accordion-kcca65d8.js";
|
|
19
19
|
import {
|
|
20
20
|
EmptyState2
|
|
21
|
-
} from "../../chunks/Accordion-
|
|
21
|
+
} from "../../chunks/Accordion-tnt1txfq.js";
|
|
22
22
|
import"../../chunks/Accordion-eqvdv7tt.js";
|
|
23
23
|
import"../../chunks/Accordion-61e19g3e.js";
|
|
24
24
|
import"../../chunks/Accordion-c6edgxay.js";
|