pixelize-native-library 1.0.7 → 1.2.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/lib/module/core/MODULE.md +130 -36
- package/lib/module/core/a11y/MODULE.md +127 -4
- package/lib/module/core/a11y/announce.js +30 -0
- package/lib/module/core/a11y/announce.web.js +134 -0
- package/lib/module/core/a11y/index.js +81 -15
- package/lib/module/core/a11y/keyboard.js +42 -0
- package/lib/module/core/a11y/keyboard.web.js +229 -0
- package/lib/module/core/a11y/labels.js +24 -0
- package/lib/module/core/device/MODULE.md +47 -0
- package/lib/module/core/device/index.js +91 -0
- package/lib/module/core/gradient/AccentGradientFill.js +80 -0
- package/lib/module/core/gradient/darkenHex.js +13 -0
- package/lib/module/core/gradient/gradientStops.js +27 -0
- package/lib/module/core/gradient/index.js +7 -0
- package/lib/module/core/gradient/withAlpha.js +19 -0
- package/lib/module/core/haptics/MODULE.md +4 -0
- package/lib/module/core/haptics/context.js +7 -0
- package/lib/module/core/haptics/haptics.js +17 -0
- package/lib/module/core/haptics/index.js +6 -0
- package/lib/module/core/haptics/useHaptics.js +73 -0
- package/lib/module/core/heading/MODULE.md +38 -0
- package/lib/module/core/heading/index.js +45 -0
- package/lib/module/core/icon/Icon.js +37 -0
- package/lib/module/core/icon/MODULE.md +53 -12
- package/lib/module/core/icon/icons/arrow-down.js +10 -0
- package/lib/module/core/icon/icons/arrow-left.js +10 -0
- package/lib/module/core/icon/icons/arrow-right.js +10 -0
- package/lib/module/core/icon/icons/arrow-up.js +10 -0
- package/lib/module/core/icon/icons/at-sign.js +10 -0
- package/lib/module/core/icon/icons/bell.js +10 -0
- package/lib/module/core/icon/icons/bold.js +10 -0
- package/lib/module/core/icon/icons/building-2.js +10 -0
- package/lib/module/core/icon/icons/calendar.js +10 -0
- package/lib/module/core/icon/icons/chart-column.js +10 -0
- package/lib/module/core/icon/icons/check.js +10 -0
- package/lib/module/core/icon/icons/chevron-down.js +10 -0
- package/lib/module/core/icon/icons/chevron-left.js +10 -0
- package/lib/module/core/icon/icons/chevron-right.js +10 -0
- package/lib/module/core/icon/icons/chevron-up.js +10 -0
- package/lib/module/core/icon/icons/chevrons-left.js +10 -0
- package/lib/module/core/icon/icons/chevrons-right.js +10 -0
- package/lib/module/core/icon/icons/chevrons-up-down.js +10 -0
- package/lib/module/core/icon/icons/circle-alert.js +10 -0
- package/lib/module/core/icon/icons/circle-check.js +10 -0
- package/lib/module/core/icon/icons/clock.js +10 -0
- package/lib/module/core/icon/icons/code.js +10 -0
- package/lib/module/core/icon/icons/download.js +10 -0
- package/lib/module/core/icon/icons/external-link.js +10 -0
- package/lib/module/core/icon/icons/eye.js +10 -0
- package/lib/module/core/icon/icons/file-text.js +10 -0
- package/lib/module/core/icon/icons/filter.js +10 -0
- package/lib/module/core/icon/icons/flag.js +10 -0
- package/lib/module/core/icon/icons/folder.js +10 -0
- package/lib/module/core/icon/icons/heading-1.js +10 -0
- package/lib/module/core/icon/icons/heading-2.js +10 -0
- package/lib/module/core/icon/icons/heading-3.js +10 -0
- package/lib/module/core/icon/icons/image.js +10 -0
- package/lib/module/core/icon/icons/inbox.js +10 -0
- package/lib/module/core/icon/icons/info.js +10 -0
- package/lib/module/core/icon/icons/italic.js +10 -0
- package/lib/module/core/icon/icons/kanban.js +10 -0
- package/lib/module/core/icon/icons/layers.js +10 -0
- package/lib/module/core/icon/icons/layout-dashboard.js +10 -0
- package/lib/module/core/icon/icons/layout-template.js +10 -0
- package/lib/module/core/icon/icons/life-buoy.js +10 -0
- package/lib/module/core/icon/icons/link.js +10 -0
- package/lib/module/core/icon/icons/list-checks.js +10 -0
- package/lib/module/core/icon/icons/list-ordered.js +10 -0
- package/lib/module/core/icon/icons/list-todo.js +10 -0
- package/lib/module/core/icon/icons/list.js +10 -0
- package/lib/module/core/icon/icons/log-out.js +10 -0
- package/lib/module/core/icon/icons/map.js +10 -0
- package/lib/module/core/icon/icons/message-square.js +10 -0
- package/lib/module/core/icon/icons/milestone.js +10 -0
- package/lib/module/core/icon/icons/minus.js +10 -0
- package/lib/module/core/icon/icons/more-horizontal.js +10 -0
- package/lib/module/core/icon/icons/paperclip.js +10 -0
- package/lib/module/core/icon/icons/pencil.js +10 -0
- package/lib/module/core/icon/icons/plus.js +10 -0
- package/lib/module/core/icon/icons/quote.js +10 -0
- package/lib/module/core/icon/icons/refresh-cw.js +10 -0
- package/lib/module/core/icon/icons/save.js +10 -0
- package/lib/module/core/icon/icons/search.js +10 -0
- package/lib/module/core/icon/icons/send.js +10 -0
- package/lib/module/core/icon/icons/settings.js +10 -0
- package/lib/module/core/icon/icons/share.js +10 -0
- package/lib/module/core/icon/icons/square-code.js +10 -0
- package/lib/module/core/icon/icons/star.js +10 -0
- package/lib/module/core/icon/icons/strikethrough.js +10 -0
- package/lib/module/core/icon/icons/tag.js +10 -0
- package/lib/module/core/icon/icons/trash.js +10 -0
- package/lib/module/core/icon/icons/trending-up.js +10 -0
- package/lib/module/core/icon/icons/triangle-alert.js +10 -0
- package/lib/module/core/icon/icons/underline.js +10 -0
- package/lib/module/core/icon/icons/upload.js +10 -0
- package/lib/module/core/icon/icons/user.js +10 -0
- package/lib/module/core/icon/icons/users.js +10 -0
- package/lib/module/core/icon/icons/x.js +10 -0
- package/lib/module/core/icon/index.js +4 -153
- package/lib/module/core/icon/names.js +2 -0
- package/lib/module/core/icon/resolve.js +160 -0
- package/lib/module/core/icon/types.js +4 -0
- package/lib/module/core/list/VirtualList.js +226 -0
- package/lib/module/core/list/index.js +4 -0
- package/lib/module/core/media/MediaImage.js +51 -0
- package/lib/module/core/media/expoImage.js +26 -0
- package/lib/module/core/media/index.js +6 -0
- package/lib/module/core/media/pickers.js +23 -0
- package/lib/module/core/motion/MODULE.md +101 -0
- package/lib/module/core/motion/config.js +115 -0
- package/lib/module/core/motion/index.js +8 -0
- package/lib/module/core/motion/presets.js +192 -0
- package/lib/module/core/motion/useAnimatedValue.js +19 -0
- package/lib/module/core/motion/useMotion.js +46 -0
- package/lib/module/core/motion/usePressState.js +145 -0
- package/lib/module/core/style/index.js +3 -0
- package/lib/module/core/style/radius.js +4 -0
- package/lib/module/core/style/sx.js +76 -0
- package/lib/module/core/style/useThemedStyles.js +8 -0
- package/lib/module/index.js +71 -2
- package/lib/module/modules/accordion/Accordion.js +286 -97
- package/lib/module/modules/accordion/Accordion.variants.js +6 -7
- package/lib/module/modules/accordion/MODULE.md +36 -11
- package/lib/module/modules/alert-dialog/AlertDialog.js +7 -6
- package/lib/module/modules/alert-dialog/AlertDialog.variants.js +4 -0
- package/lib/module/modules/alert-dialog/MODULE.md +11 -2
- package/lib/module/modules/app-bar/AppBar.js +181 -0
- package/lib/module/modules/app-bar/AppBar.variants.js +71 -0
- package/lib/module/modules/app-bar/MODULE.md +68 -0
- package/lib/module/modules/app-bar/index.js +10 -0
- package/lib/module/modules/avatar/Avatar.js +45 -19
- package/lib/module/modules/avatar/Avatar.variants.js +44 -3
- package/lib/module/modules/avatar/MODULE.md +37 -15
- package/lib/module/modules/avatar-group/AvatarGroup.js +81 -0
- package/lib/module/modules/avatar-group/AvatarGroup.variants.js +132 -0
- package/lib/module/modules/avatar-group/MODULE.md +44 -0
- package/lib/module/modules/avatar-group/index.js +10 -0
- package/lib/module/modules/badge/Badge.js +14 -7
- package/lib/module/modules/badge/Badge.variants.js +14 -3
- package/lib/module/modules/badge/MODULE.md +11 -5
- package/lib/module/modules/banner/Banner.js +181 -0
- package/lib/module/modules/banner/Banner.variants.js +118 -0
- package/lib/module/modules/banner/MODULE.md +118 -0
- package/lib/module/modules/banner/index.js +4 -0
- package/lib/module/modules/bottom-nav/BottomNav.js +43 -129
- package/lib/module/modules/bottom-nav/BottomNav.variants.js +36 -18
- package/lib/module/modules/bottom-nav/BottomNavIconWithBadge.js +56 -8
- package/lib/module/modules/bottom-nav/BottomNavOverflowSheet.js +160 -117
- package/lib/module/modules/bottom-nav/BottomNavTab.js +162 -0
- package/lib/module/modules/bottom-nav/MODULE.md +30 -6
- package/lib/module/modules/bottom-sheet/BottomSheet.js +202 -0
- package/lib/module/modules/bottom-sheet/BottomSheet.variants.js +59 -0
- package/lib/module/modules/bottom-sheet/MODULE.md +64 -0
- package/lib/module/modules/bottom-sheet/index.js +4 -0
- package/lib/module/modules/button/Button.js +128 -91
- package/lib/module/modules/button/Button.variants.js +20 -14
- package/lib/module/modules/button/MODULE.md +31 -3
- package/lib/module/modules/button-group/ButtonGroup.js +176 -69
- package/lib/module/modules/button-group/ButtonGroup.variants.js +51 -50
- package/lib/module/modules/button-group/MODULE.md +58 -37
- package/lib/module/modules/card/Card.js +122 -21
- package/lib/module/modules/card/Card.variants.js +1 -0
- package/lib/module/modules/card/MODULE.md +19 -10
- package/lib/module/modules/charts/BarChart.js +257 -0
- package/lib/module/modules/charts/BarList.js +112 -49
- package/lib/module/modules/charts/ChartLegend.js +154 -0
- package/lib/module/modules/charts/Charts.variants.js +589 -2
- package/lib/module/modules/charts/DonutChart.js +105 -65
- package/lib/module/modules/charts/LineChart.js +181 -0
- package/lib/module/modules/charts/MODULE.md +161 -22
- package/lib/module/modules/charts/PieChart.js +149 -0
- package/lib/module/modules/charts/Sparkline.js +7 -4
- package/lib/module/modules/charts/index.js +3 -0
- package/lib/module/modules/checkbox/Checkbox.js +122 -44
- package/lib/module/modules/checkbox/Checkbox.variants.js +13 -8
- package/lib/module/modules/checkbox/MODULE.md +40 -8
- package/lib/module/modules/chip/Chip.js +200 -0
- package/lib/module/modules/chip/Chip.variants.js +290 -0
- package/lib/module/modules/chip/ChipGroup.js +48 -0
- package/lib/module/modules/chip/MODULE.md +158 -0
- package/lib/module/modules/chip/index.js +13 -0
- package/lib/module/modules/combobox/Combobox.js +623 -0
- package/lib/module/modules/combobox/Combobox.variants.js +295 -0
- package/lib/module/modules/combobox/MODULE.md +193 -0
- package/lib/module/modules/combobox/comboboxKeys.js +19 -0
- package/lib/module/modules/combobox/comboboxKeys.web.js +76 -0
- package/lib/module/modules/combobox/index.js +13 -0
- package/lib/module/modules/composer/Composer.js +163 -0
- package/lib/module/modules/composer/Composer.variants.js +44 -0
- package/lib/module/modules/composer/MODULE.md +75 -0
- package/lib/module/modules/composer/index.js +4 -0
- package/lib/module/modules/copy-button/CopyButton.js +174 -0
- package/lib/module/modules/copy-button/CopyButton.variants.js +88 -0
- package/lib/module/modules/copy-button/MODULE.md +78 -0
- package/lib/module/modules/copy-button/index.js +4 -0
- package/lib/module/modules/data-table/DataTable.js +532 -0
- package/lib/module/modules/data-table/DataTable.variants.js +189 -0
- package/lib/module/modules/data-table/MODULE.md +146 -0
- package/lib/module/modules/data-table/index.js +10 -0
- package/lib/module/modules/date-picker/Calendar.js +414 -0
- package/lib/module/modules/date-picker/Calendar.keys.js +23 -0
- package/lib/module/modules/date-picker/Calendar.keys.web.js +83 -0
- package/lib/module/modules/date-picker/DatePicker.js +162 -0
- package/lib/module/modules/date-picker/DatePicker.variants.js +701 -0
- package/lib/module/modules/date-picker/DateRangePicker.js +87 -0
- package/lib/module/modules/date-picker/MODULE.md +190 -0
- package/lib/module/modules/date-picker/PickerField.js +151 -0
- package/lib/module/modules/date-picker/PickerShell.js +134 -0
- package/lib/module/modules/date-picker/TimePicker.js +179 -0
- package/lib/module/modules/date-picker/index.js +14 -0
- package/lib/module/modules/divider/Divider.js +8 -7
- package/lib/module/modules/divider/Divider.variants.js +6 -5
- package/lib/module/modules/divider/MODULE.md +8 -0
- package/lib/module/modules/drawer/Drawer.js +156 -62
- package/lib/module/modules/drawer/Drawer.variants.js +7 -20
- package/lib/module/modules/drawer/MODULE.md +93 -118
- package/lib/module/modules/empty-state/EmptyState.js +34 -31
- package/lib/module/modules/empty-state/EmptyState.variants.js +16 -0
- package/lib/module/modules/empty-state/MODULE.md +26 -7
- package/lib/module/modules/fab/Fab.js +192 -0
- package/lib/module/modules/fab/Fab.variants.js +360 -0
- package/lib/module/modules/fab/FabGroup.js +361 -0
- package/lib/module/modules/fab/MODULE.md +194 -0
- package/lib/module/modules/fab/index.js +13 -0
- package/lib/module/modules/file-grid/FileGrid.js +163 -0
- package/lib/module/modules/file-grid/FileGrid.variants.js +51 -0
- package/lib/module/modules/file-grid/MODULE.md +14 -0
- package/lib/module/modules/file-grid/index.js +4 -0
- package/lib/module/modules/file-upload/FileUpload.js +124 -34
- package/lib/module/modules/file-upload/FileUpload.variants.js +53 -8
- package/lib/module/modules/file-upload/MODULE.md +24 -4
- package/lib/module/modules/filter-sheet/FilterChip.js +32 -18
- package/lib/module/modules/filter-sheet/FilterSheet.js +17 -11
- package/lib/module/modules/filter-sheet/FilterSheet.variants.js +24 -5
- package/lib/module/modules/filter-sheet/FilterSheetBody.js +180 -82
- package/lib/module/modules/filter-sheet/MODULE.md +31 -1
- package/lib/module/modules/folder-row/FolderRow.js +144 -0
- package/lib/module/modules/folder-row/FolderRow.variants.js +51 -0
- package/lib/module/modules/folder-row/MODULE.md +72 -0
- package/lib/module/modules/folder-row/index.js +4 -0
- package/lib/module/modules/form-field/FormField.js +104 -0
- package/lib/module/modules/form-field/FormField.variants.js +88 -0
- package/lib/module/modules/form-field/MODULE.md +103 -0
- package/lib/module/modules/form-field/index.js +4 -0
- package/lib/module/modules/gantt/Gantt.js +239 -0
- package/lib/module/modules/gantt/Gantt.variants.js +177 -0
- package/lib/module/modules/gantt/MODULE.md +81 -0
- package/lib/module/modules/gantt/index.js +5 -0
- package/lib/module/modules/image-viewer/ImageViewer.js +265 -0
- package/lib/module/modules/image-viewer/ImageViewer.variants.js +6 -0
- package/lib/module/modules/image-viewer/MODULE.md +63 -0
- package/lib/module/modules/image-viewer/index.js +4 -0
- package/lib/module/modules/input/Input.js +119 -48
- package/lib/module/modules/input/Input.variants.js +26 -11
- package/lib/module/modules/input/MODULE.md +38 -6
- package/lib/module/modules/limit-reached-modal/LimitReachedModal.js +90 -0
- package/lib/module/modules/limit-reached-modal/LimitReachedModal.variants.js +108 -0
- package/lib/module/modules/limit-reached-modal/MODULE.md +94 -0
- package/lib/module/modules/limit-reached-modal/index.js +11 -0
- package/lib/module/modules/list-item/ListItem.js +70 -31
- package/lib/module/modules/list-item/ListItem.variants.js +11 -2
- package/lib/module/modules/list-item/MODULE.md +8 -3
- package/lib/module/modules/markdown/MODULE.md +39 -5
- package/lib/module/modules/markdown/Markdown.js +107 -38
- package/lib/module/modules/markdown/Markdown.variants.js +8 -2
- package/lib/module/modules/markdown/parseMarkdown.js +3 -3
- package/lib/module/modules/menu/MODULE.md +56 -14
- package/lib/module/modules/menu/Menu.js +236 -68
- package/lib/module/modules/menu/Menu.variants.js +13 -3
- package/lib/module/modules/message-bubble/MODULE.md +41 -0
- package/lib/module/modules/message-bubble/MessageBubble.js +54 -0
- package/lib/module/modules/message-bubble/MessageBubble.variants.js +57 -0
- package/lib/module/modules/message-bubble/index.js +4 -0
- package/lib/module/modules/modal/MODULE.md +40 -3
- package/lib/module/modules/modal/Modal.js +135 -33
- package/lib/module/modules/modal/Modal.variants.js +2 -2
- package/lib/module/modules/more-items/MODULE.md +77 -0
- package/lib/module/modules/more-items/MoreItems.js +168 -0
- package/lib/module/modules/more-items/MoreItems.variants.js +83 -0
- package/lib/module/modules/more-items/index.js +4 -0
- package/lib/module/modules/multi-select/MODULE.md +89 -18
- package/lib/module/modules/multi-select/MultiSelect.js +239 -105
- package/lib/module/modules/multi-select/MultiSelect.variants.js +32 -7
- package/lib/module/modules/number-input/MODULE.md +41 -6
- package/lib/module/modules/number-input/NumberInput.js +124 -81
- package/lib/module/modules/number-input/NumberInput.variants.js +48 -11
- package/lib/module/modules/org-switcher/MODULE.md +133 -0
- package/lib/module/modules/org-switcher/OrgSwitcher.js +295 -0
- package/lib/module/modules/org-switcher/OrgSwitcher.variants.js +188 -0
- package/lib/module/modules/org-switcher/index.js +9 -0
- package/lib/module/modules/pagination/MODULE.md +163 -0
- package/lib/module/modules/pagination/Pagination.js +236 -0
- package/lib/module/modules/pagination/Pagination.variants.js +309 -0
- package/lib/module/modules/pagination/PaginationControls.js +213 -0
- package/lib/module/modules/pagination/index.js +15 -0
- package/lib/module/modules/pin-input/MODULE.md +34 -15
- package/lib/module/modules/pin-input/PinInput.js +119 -81
- package/lib/module/modules/pin-input/PinInput.variants.js +15 -6
- package/lib/module/modules/progress-bar/MODULE.md +17 -7
- package/lib/module/modules/progress-bar/ProgressBar.js +97 -56
- package/lib/module/modules/progress-bar/ProgressBar.variants.js +16 -18
- package/lib/module/modules/radio-group/MODULE.md +42 -16
- package/lib/module/modules/radio-group/RadioGroup.js +172 -49
- package/lib/module/modules/radio-group/RadioGroup.variants.js +48 -11
- package/lib/module/modules/reorder/MODULE.md +106 -97
- package/lib/module/modules/reorder/Reorder.js +234 -197
- package/lib/module/modules/reorder/Reorder.variants.js +39 -15
- package/lib/module/modules/rich-text/MODULE.md +54 -0
- package/lib/module/modules/rich-text/RichText.js +382 -0
- package/lib/module/modules/rich-text/RichText.variants.js +17 -0
- package/lib/module/modules/rich-text/index.js +5 -0
- package/lib/module/modules/rich-text/parseRichText.js +133 -0
- package/lib/module/modules/rich-text-editor/MODULE.md +228 -0
- package/lib/module/modules/rich-text-editor/RichTextEditor.js +420 -0
- package/lib/module/modules/rich-text-editor/RichTextEditor.variants.js +319 -0
- package/lib/module/modules/rich-text-editor/index.js +10 -0
- package/lib/module/modules/screen/MODULE.md +64 -0
- package/lib/module/modules/screen/Screen.js +139 -0
- package/lib/module/modules/screen/Screen.variants.js +61 -0
- package/lib/module/modules/screen/index.js +10 -0
- package/lib/module/modules/search-bar/MODULE.md +115 -0
- package/lib/module/modules/search-bar/SearchBar.js +276 -0
- package/lib/module/modules/search-bar/SearchBar.variants.js +208 -0
- package/lib/module/modules/search-bar/index.js +12 -0
- package/lib/module/modules/section/MODULE.md +41 -0
- package/lib/module/modules/section/Section.js +35 -0
- package/lib/module/modules/section/Section.variants.js +24 -0
- package/lib/module/modules/section/index.js +10 -0
- package/lib/module/modules/section-list/MODULE.md +18 -0
- package/lib/module/modules/section-list/SectionList.js +64 -0
- package/lib/module/modules/section-list/SectionList.variants.js +11 -0
- package/lib/module/modules/section-list/index.js +4 -0
- package/lib/module/modules/segmented-control/MODULE.md +126 -0
- package/lib/module/modules/segmented-control/SegmentedControl.js +222 -0
- package/lib/module/modules/segmented-control/SegmentedControl.variants.js +168 -0
- package/lib/module/modules/segmented-control/index.js +13 -0
- package/lib/module/modules/select/MODULE.md +103 -15
- package/lib/module/modules/select/Select.js +223 -94
- package/lib/module/modules/select/Select.variants.js +64 -17
- package/lib/module/modules/skeleton/MODULE.md +37 -21
- package/lib/module/modules/skeleton/Skeleton.js +55 -46
- package/lib/module/modules/skeleton/Skeleton.variants.js +19 -76
- package/lib/module/modules/slider/MODULE.md +33 -5
- package/lib/module/modules/slider/Slider.js +68 -10
- package/lib/module/modules/slider/Slider.variants.js +60 -13
- package/lib/module/modules/spinner/MODULE.md +16 -6
- package/lib/module/modules/spinner/Spinner.js +20 -16
- package/lib/module/modules/spinner/Spinner.variants.js +5 -3
- package/lib/module/modules/stage-progress/MODULE.md +68 -0
- package/lib/module/modules/stage-progress/StageProgress.js +221 -0
- package/lib/module/modules/stage-progress/StageProgress.variants.js +169 -0
- package/lib/module/modules/stage-progress/index.js +4 -0
- package/lib/module/modules/stat-tile/MODULE.md +11 -2
- package/lib/module/modules/stat-tile/StatTile.js +76 -34
- package/lib/module/modules/stat-tile/StatTile.variants.js +8 -4
- package/lib/module/modules/state-block/MODULE.md +55 -0
- package/lib/module/modules/state-block/StateBlock.js +136 -0
- package/lib/module/modules/state-block/StateBlock.variants.js +62 -0
- package/lib/module/modules/state-block/index.js +10 -0
- package/lib/module/modules/stepper/MODULE.md +33 -6
- package/lib/module/modules/stepper/Stepper.js +108 -39
- package/lib/module/modules/stepper/Stepper.variants.js +6 -6
- package/lib/module/modules/surface/MODULE.md +59 -0
- package/lib/module/modules/surface/Surface.js +42 -0
- package/lib/module/modules/surface/Surface.variants.js +33 -0
- package/lib/module/modules/surface/index.js +4 -0
- package/lib/module/modules/swipeable-row/MODULE.md +129 -0
- package/lib/module/modules/swipeable-row/SwipeableRow.js +265 -0
- package/lib/module/modules/swipeable-row/SwipeableRow.variants.js +80 -0
- package/lib/module/modules/swipeable-row/index.js +4 -0
- package/lib/module/modules/switch/MODULE.md +16 -0
- package/lib/module/modules/switch/Switch.js +9 -3
- package/lib/module/modules/switch/Switch.variants.js +8 -0
- package/lib/module/modules/tabs/MODULE.md +48 -13
- package/lib/module/modules/tabs/Tabs.js +141 -73
- package/lib/module/modules/tabs/Tabs.variants.js +33 -9
- package/lib/module/modules/text/MODULE.md +54 -0
- package/lib/module/modules/text/Text.js +59 -0
- package/lib/module/modules/text/Text.variants.js +162 -0
- package/lib/module/modules/text/index.js +4 -0
- package/lib/module/modules/textarea/MODULE.md +31 -13
- package/lib/module/modules/textarea/Textarea.js +92 -46
- package/lib/module/modules/textarea/Textarea.variants.js +16 -10
- package/lib/module/modules/timeline/MODULE.md +39 -7
- package/lib/module/modules/timeline/Timeline.js +151 -77
- package/lib/module/modules/timeline/Timeline.variants.js +13 -0
- package/lib/module/modules/toast/MODULE.md +74 -11
- package/lib/module/modules/toast/Toast.js +118 -34
- package/lib/module/modules/toast/Toast.variants.js +42 -1
- package/lib/module/modules/toast/toastScreenReader.js +69 -0
- package/lib/module/modules/tooltip/MODULE.md +82 -28
- package/lib/module/modules/tooltip/Tooltip.js +126 -44
- package/lib/module/modules/tooltip/Tooltip.variants.js +11 -5
- package/lib/module/modules/typing-indicator/MODULE.md +48 -0
- package/lib/module/modules/typing-indicator/TypingIndicator.js +98 -0
- package/lib/module/modules/typing-indicator/TypingIndicator.variants.js +55 -0
- package/lib/module/modules/typing-indicator/index.js +4 -0
- package/lib/module/modules/unread-badge/MODULE.md +20 -0
- package/lib/module/modules/unread-badge/UnreadBadge.js +45 -0
- package/lib/module/modules/unread-badge/UnreadBadge.variants.js +66 -0
- package/lib/module/modules/unread-badge/index.js +4 -0
- package/lib/module/test/mocks/flashList.js +5 -0
- package/lib/module/test/perfHelpers.js +18 -0
- package/lib/module/theme/MODULE.md +9 -1
- package/lib/module/theme/hooks.js +11 -0
- package/lib/module/theme/index.js +3 -6
- package/lib/module/theme/platform/MODULE.md +20 -2
- package/lib/module/theme/platform/elevation.native.js +0 -44
- package/lib/module/theme/platform/floatingSurface.native.js +75 -0
- package/lib/module/theme/platform/highlight.native.js +59 -0
- package/lib/module/theme/platform/index.js +5 -0
- package/lib/module/theme/platform/motion.native.js +35 -0
- package/lib/module/theme/platform/stateLayer.native.js +14 -0
- package/lib/module/theme/platform/surfaces.native.js +11 -0
- package/lib/module/theme/provider/PixelizeProvider.js +18 -49
- package/lib/module/theme/provider/ThemeContext.js +6 -0
- package/lib/module/theme/provider/colorModeStorage.js +2 -2
- package/lib/module/theme/provider/index.js +1 -0
- package/lib/module/theme/provider/loadPalette.js +75 -0
- package/lib/module/theme/provider/types.js +4 -0
- package/lib/module/theme/provider/useTheme.js +1 -2
- package/lib/module/theme/provider/useThemeMode.js +1 -1
- package/lib/module/theme/tokens/MODULE.md +32 -28
- package/lib/module/theme/tokens/THEME-CONTRACT.md +137 -0
- package/lib/module/theme/tokens/assertPalette.js +29 -0
- package/lib/module/theme/tokens/brands/emerald/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/lavender/palette.light.js +3 -2
- package/lib/module/theme/tokens/brands/meadow/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/radiant/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/rosewood/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/skyline/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/slate/palette.light.js +8 -10
- package/lib/module/theme/tokens/brands/storefront/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/zinc/palette.dark.js +3 -2
- package/lib/module/theme/tokens/brands/zinc/palette.light.js +3 -2
- package/lib/module/theme/tokens/builders/buildDarkPalette.js +3 -2
- package/lib/module/theme/tokens/builders/finalizePalette.js +34 -0
- package/lib/module/theme/tokens/builders/liftToContrast.js +44 -0
- package/lib/module/theme/tokens/builders/placeholderInk.js +22 -0
- package/lib/module/theme/tokens/builders/semanticText.js +14 -0
- package/lib/module/theme/tokens/builders/surfaceRungs.js +44 -0
- package/lib/module/theme/tokens/index.js +5 -0
- package/lib/module/theme/tokens/roles/index.js +14 -3
- package/lib/typescript/core/a11y/announce.d.ts +20 -0
- package/lib/typescript/core/a11y/announce.web.d.ts +27 -0
- package/lib/typescript/core/a11y/index.d.ts +21 -2
- package/lib/typescript/core/a11y/keyboard.d.ts +45 -0
- package/lib/typescript/core/a11y/keyboard.web.d.ts +69 -0
- package/lib/typescript/core/a11y/labels.d.ts +19 -0
- package/lib/typescript/core/device/index.d.ts +16 -0
- package/lib/typescript/core/gradient/AccentGradientFill.d.ts +7 -0
- package/lib/typescript/core/gradient/darkenHex.d.ts +2 -0
- package/lib/typescript/core/gradient/gradientStops.d.ts +10 -0
- package/lib/typescript/core/gradient/index.d.ts +5 -0
- package/lib/typescript/core/gradient/withAlpha.d.ts +2 -0
- package/lib/typescript/core/haptics/context.d.ts +3 -0
- package/lib/typescript/core/haptics/haptics.d.ts +33 -0
- package/lib/typescript/core/haptics/index.d.ts +6 -0
- package/lib/typescript/core/haptics/useHaptics.d.ts +12 -0
- package/lib/typescript/core/heading/index.d.ts +45 -0
- package/lib/typescript/core/icon/Icon.d.ts +18 -0
- package/lib/typescript/core/icon/icons/arrow-down.d.ts +3 -0
- package/lib/typescript/core/icon/icons/arrow-left.d.ts +3 -0
- package/lib/typescript/core/icon/icons/arrow-right.d.ts +3 -0
- package/lib/typescript/core/icon/icons/arrow-up.d.ts +3 -0
- package/lib/typescript/core/icon/icons/at-sign.d.ts +3 -0
- package/lib/typescript/core/icon/icons/bell.d.ts +3 -0
- package/lib/typescript/core/icon/icons/bold.d.ts +3 -0
- package/lib/typescript/core/icon/icons/building-2.d.ts +3 -0
- package/lib/typescript/core/icon/icons/calendar.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chart-column.d.ts +3 -0
- package/lib/typescript/core/icon/icons/check.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chevron-down.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chevron-left.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chevron-right.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chevron-up.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chevrons-left.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chevrons-right.d.ts +3 -0
- package/lib/typescript/core/icon/icons/chevrons-up-down.d.ts +3 -0
- package/lib/typescript/core/icon/icons/circle-alert.d.ts +3 -0
- package/lib/typescript/core/icon/icons/circle-check.d.ts +3 -0
- package/lib/typescript/core/icon/icons/clock.d.ts +3 -0
- package/lib/typescript/core/icon/icons/code.d.ts +3 -0
- package/lib/typescript/core/icon/icons/download.d.ts +3 -0
- package/lib/typescript/core/icon/icons/external-link.d.ts +3 -0
- package/lib/typescript/core/icon/icons/eye.d.ts +3 -0
- package/lib/typescript/core/icon/icons/file-text.d.ts +3 -0
- package/lib/typescript/core/icon/icons/filter.d.ts +3 -0
- package/lib/typescript/core/icon/icons/flag.d.ts +3 -0
- package/lib/typescript/core/icon/icons/folder.d.ts +3 -0
- package/lib/typescript/core/icon/icons/heading-1.d.ts +3 -0
- package/lib/typescript/core/icon/icons/heading-2.d.ts +3 -0
- package/lib/typescript/core/icon/icons/heading-3.d.ts +3 -0
- package/lib/typescript/core/icon/icons/image.d.ts +3 -0
- package/lib/typescript/core/icon/icons/inbox.d.ts +3 -0
- package/lib/typescript/core/icon/icons/info.d.ts +3 -0
- package/lib/typescript/core/icon/icons/italic.d.ts +3 -0
- package/lib/typescript/core/icon/icons/kanban.d.ts +3 -0
- package/lib/typescript/core/icon/icons/layers.d.ts +3 -0
- package/lib/typescript/core/icon/icons/layout-dashboard.d.ts +3 -0
- package/lib/typescript/core/icon/icons/layout-template.d.ts +3 -0
- package/lib/typescript/core/icon/icons/life-buoy.d.ts +3 -0
- package/lib/typescript/core/icon/icons/link.d.ts +3 -0
- package/lib/typescript/core/icon/icons/list-checks.d.ts +3 -0
- package/lib/typescript/core/icon/icons/list-ordered.d.ts +3 -0
- package/lib/typescript/core/icon/icons/list-todo.d.ts +3 -0
- package/lib/typescript/core/icon/icons/list.d.ts +3 -0
- package/lib/typescript/core/icon/icons/log-out.d.ts +3 -0
- package/lib/typescript/core/icon/icons/map.d.ts +3 -0
- package/lib/typescript/core/icon/icons/message-square.d.ts +3 -0
- package/lib/typescript/core/icon/icons/milestone.d.ts +3 -0
- package/lib/typescript/core/icon/icons/minus.d.ts +3 -0
- package/lib/typescript/core/icon/icons/more-horizontal.d.ts +3 -0
- package/lib/typescript/core/icon/icons/paperclip.d.ts +3 -0
- package/lib/typescript/core/icon/icons/pencil.d.ts +3 -0
- package/lib/typescript/core/icon/icons/plus.d.ts +3 -0
- package/lib/typescript/core/icon/icons/quote.d.ts +3 -0
- package/lib/typescript/core/icon/icons/refresh-cw.d.ts +3 -0
- package/lib/typescript/core/icon/icons/save.d.ts +3 -0
- package/lib/typescript/core/icon/icons/search.d.ts +3 -0
- package/lib/typescript/core/icon/icons/send.d.ts +3 -0
- package/lib/typescript/core/icon/icons/settings.d.ts +3 -0
- package/lib/typescript/core/icon/icons/share.d.ts +3 -0
- package/lib/typescript/core/icon/icons/square-code.d.ts +3 -0
- package/lib/typescript/core/icon/icons/star.d.ts +3 -0
- package/lib/typescript/core/icon/icons/strikethrough.d.ts +3 -0
- package/lib/typescript/core/icon/icons/tag.d.ts +3 -0
- package/lib/typescript/core/icon/icons/trash.d.ts +3 -0
- package/lib/typescript/core/icon/icons/trending-up.d.ts +3 -0
- package/lib/typescript/core/icon/icons/triangle-alert.d.ts +3 -0
- package/lib/typescript/core/icon/icons/underline.d.ts +3 -0
- package/lib/typescript/core/icon/icons/upload.d.ts +3 -0
- package/lib/typescript/core/icon/icons/user.d.ts +3 -0
- package/lib/typescript/core/icon/icons/users.d.ts +3 -0
- package/lib/typescript/core/icon/icons/x.d.ts +3 -0
- package/lib/typescript/core/icon/index.d.ts +6 -94
- package/lib/typescript/core/icon/names.d.ts +2 -0
- package/lib/typescript/core/icon/resolve.d.ts +4 -0
- package/lib/typescript/core/icon/types.d.ts +13 -0
- package/lib/typescript/core/list/VirtualList.d.ts +55 -0
- package/lib/typescript/core/list/index.d.ts +3 -0
- package/lib/typescript/core/media/MediaImage.d.ts +28 -0
- package/lib/typescript/core/media/expoImage.d.ts +23 -0
- package/lib/typescript/core/media/index.d.ts +7 -0
- package/lib/typescript/core/media/pickers.d.ts +27 -0
- package/lib/typescript/core/motion/config.d.ts +57 -0
- package/lib/typescript/core/motion/index.d.ts +10 -0
- package/lib/typescript/core/motion/presets.d.ts +49 -0
- package/lib/typescript/core/motion/useAnimatedValue.d.ts +11 -0
- package/lib/typescript/core/motion/useMotion.d.ts +34 -0
- package/lib/typescript/core/motion/usePressState.d.ts +21 -0
- package/lib/typescript/core/style/index.d.ts +4 -0
- package/lib/typescript/core/style/radius.d.ts +2 -0
- package/lib/typescript/core/style/sx.d.ts +86 -0
- package/lib/typescript/core/style/useThemedStyles.d.ts +5 -0
- package/lib/typescript/index.d.ts +136 -2
- package/lib/typescript/modules/accordion/Accordion.d.ts +12 -23
- package/lib/typescript/modules/accordion/Accordion.variants.d.ts +7 -7
- package/lib/typescript/modules/alert-dialog/AlertDialog.variants.d.ts +2 -1
- package/lib/typescript/modules/app-bar/AppBar.d.ts +37 -0
- package/lib/typescript/modules/app-bar/AppBar.variants.d.ts +35 -0
- package/lib/typescript/modules/app-bar/index.d.ts +9 -0
- package/lib/typescript/modules/avatar/Avatar.d.ts +23 -3
- package/lib/typescript/modules/avatar/Avatar.variants.d.ts +32 -1
- package/lib/typescript/modules/avatar/index.d.ts +1 -1
- package/lib/typescript/modules/avatar-group/AvatarGroup.d.ts +30 -0
- package/lib/typescript/modules/avatar-group/AvatarGroup.variants.d.ts +94 -0
- package/lib/typescript/modules/avatar-group/index.d.ts +9 -0
- package/lib/typescript/modules/badge/Badge.d.ts +3 -1
- package/lib/typescript/modules/badge/Badge.variants.d.ts +8 -4
- package/lib/typescript/modules/banner/Banner.d.ts +37 -0
- package/lib/typescript/modules/banner/Banner.variants.d.ts +49 -0
- package/lib/typescript/modules/banner/index.d.ts +5 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.d.ts +9 -8
- package/lib/typescript/modules/bottom-nav/BottomNav.variants.d.ts +23 -12
- package/lib/typescript/modules/bottom-nav/BottomNavTab.d.ts +34 -0
- package/lib/typescript/modules/bottom-sheet/BottomSheet.d.ts +29 -0
- package/lib/typescript/modules/bottom-sheet/BottomSheet.variants.d.ts +15 -0
- package/lib/typescript/modules/bottom-sheet/index.d.ts +3 -0
- package/lib/typescript/modules/button/Button.d.ts +9 -13
- package/lib/typescript/modules/button/Button.variants.d.ts +28 -15
- package/lib/typescript/modules/button-group/ButtonGroup.d.ts +0 -17
- package/lib/typescript/modules/button-group/ButtonGroup.variants.d.ts +40 -61
- package/lib/typescript/modules/card/Card.d.ts +7 -5
- package/lib/typescript/modules/card/Card.variants.d.ts +2 -2
- package/lib/typescript/modules/charts/BarChart.d.ts +26 -0
- package/lib/typescript/modules/charts/ChartLegend.d.ts +16 -0
- package/lib/typescript/modules/charts/Charts.variants.d.ts +229 -2
- package/lib/typescript/modules/charts/DonutChart.d.ts +3 -0
- package/lib/typescript/modules/charts/LineChart.d.ts +30 -0
- package/lib/typescript/modules/charts/PieChart.d.ts +18 -0
- package/lib/typescript/modules/charts/index.d.ts +6 -0
- package/lib/typescript/modules/checkbox/Checkbox.d.ts +4 -1
- package/lib/typescript/modules/checkbox/Checkbox.variants.d.ts +14 -9
- package/lib/typescript/modules/chip/Chip.d.ts +40 -0
- package/lib/typescript/modules/chip/Chip.variants.d.ts +202 -0
- package/lib/typescript/modules/chip/ChipGroup.d.ts +22 -0
- package/lib/typescript/modules/chip/index.d.ts +12 -0
- package/lib/typescript/modules/combobox/Combobox.d.ts +81 -0
- package/lib/typescript/modules/combobox/Combobox.variants.d.ts +225 -0
- package/lib/typescript/modules/combobox/comboboxKeys.d.ts +25 -0
- package/lib/typescript/modules/combobox/comboboxKeys.web.d.ts +23 -0
- package/lib/typescript/modules/combobox/index.d.ts +11 -0
- package/lib/typescript/modules/composer/Composer.d.ts +28 -0
- package/lib/typescript/modules/composer/Composer.variants.d.ts +7 -0
- package/lib/typescript/modules/composer/index.d.ts +3 -0
- package/lib/typescript/modules/copy-button/CopyButton.d.ts +21 -0
- package/lib/typescript/modules/copy-button/CopyButton.variants.d.ts +42 -0
- package/lib/typescript/modules/copy-button/index.d.ts +4 -0
- package/lib/typescript/modules/data-table/DataTable.d.ts +44 -0
- package/lib/typescript/modules/data-table/DataTable.variants.d.ts +118 -0
- package/lib/typescript/modules/data-table/index.d.ts +9 -0
- package/lib/typescript/modules/date-picker/Calendar.d.ts +42 -0
- package/lib/typescript/modules/date-picker/Calendar.keys.d.ts +19 -0
- package/lib/typescript/modules/date-picker/Calendar.keys.web.d.ts +35 -0
- package/lib/typescript/modules/date-picker/DatePicker.d.ts +40 -0
- package/lib/typescript/modules/date-picker/DatePicker.variants.d.ts +334 -0
- package/lib/typescript/modules/date-picker/DateRangePicker.d.ts +32 -0
- package/lib/typescript/modules/date-picker/PickerField.d.ts +26 -0
- package/lib/typescript/modules/date-picker/PickerShell.d.ts +29 -0
- package/lib/typescript/modules/date-picker/TimePicker.d.ts +14 -0
- package/lib/typescript/modules/date-picker/index.d.ts +16 -0
- package/lib/typescript/modules/divider/Divider.variants.d.ts +6 -6
- package/lib/typescript/modules/drawer/Drawer.d.ts +2 -1
- package/lib/typescript/modules/drawer/Drawer.variants.d.ts +4 -13
- package/lib/typescript/modules/empty-state/EmptyState.d.ts +9 -4
- package/lib/typescript/modules/empty-state/EmptyState.variants.d.ts +8 -1
- package/lib/typescript/modules/fab/Fab.d.ts +74 -0
- package/lib/typescript/modules/fab/Fab.variants.d.ts +231 -0
- package/lib/typescript/modules/fab/FabGroup.d.ts +66 -0
- package/lib/typescript/modules/fab/index.d.ts +12 -0
- package/lib/typescript/modules/file-grid/FileGrid.d.ts +26 -0
- package/lib/typescript/modules/file-grid/FileGrid.variants.d.ts +26 -0
- package/lib/typescript/modules/file-grid/index.d.ts +4 -0
- package/lib/typescript/modules/file-upload/FileUpload.d.ts +3 -0
- package/lib/typescript/modules/file-upload/FileUpload.variants.d.ts +22 -5
- package/lib/typescript/modules/filter-sheet/FilterSheet.variants.d.ts +30 -5
- package/lib/typescript/modules/filter-sheet/FilterSheetBody.d.ts +13 -8
- package/lib/typescript/modules/folder-row/FolderRow.d.ts +16 -0
- package/lib/typescript/modules/folder-row/FolderRow.variants.d.ts +29 -0
- package/lib/typescript/modules/folder-row/index.d.ts +3 -0
- package/lib/typescript/modules/form-field/FormField.d.ts +29 -0
- package/lib/typescript/modules/form-field/FormField.variants.d.ts +93 -0
- package/lib/typescript/modules/form-field/index.d.ts +4 -0
- package/lib/typescript/modules/gantt/Gantt.d.ts +19 -0
- package/lib/typescript/modules/gantt/Gantt.variants.d.ts +103 -0
- package/lib/typescript/modules/gantt/index.d.ts +5 -0
- package/lib/typescript/modules/image-viewer/ImageViewer.d.ts +27 -0
- package/lib/typescript/modules/image-viewer/ImageViewer.variants.d.ts +3 -0
- package/lib/typescript/modules/image-viewer/index.d.ts +3 -0
- package/lib/typescript/modules/input/Input.d.ts +9 -1
- package/lib/typescript/modules/input/Input.variants.d.ts +32 -12
- package/lib/typescript/modules/limit-reached-modal/LimitReachedModal.d.ts +34 -0
- package/lib/typescript/modules/limit-reached-modal/LimitReachedModal.variants.d.ts +46 -0
- package/lib/typescript/modules/limit-reached-modal/index.d.ts +10 -0
- package/lib/typescript/modules/list-item/ListItem.d.ts +3 -1
- package/lib/typescript/modules/list-item/ListItem.variants.d.ts +138 -2
- package/lib/typescript/modules/markdown/Markdown.d.ts +13 -0
- package/lib/typescript/modules/markdown/Markdown.variants.d.ts +8 -2
- package/lib/typescript/modules/markdown/parseMarkdown.d.ts +3 -2
- package/lib/typescript/modules/menu/Menu.d.ts +8 -18
- package/lib/typescript/modules/menu/Menu.variants.d.ts +8 -1
- package/lib/typescript/modules/message-bubble/MessageBubble.d.ts +25 -0
- package/lib/typescript/modules/message-bubble/MessageBubble.variants.d.ts +30 -0
- package/lib/typescript/modules/message-bubble/index.d.ts +4 -0
- package/lib/typescript/modules/modal/Modal.d.ts +12 -0
- package/lib/typescript/modules/modal/Modal.variants.d.ts +1 -1
- package/lib/typescript/modules/more-items/MoreItems.d.ts +15 -0
- package/lib/typescript/modules/more-items/MoreItems.variants.d.ts +30 -0
- package/lib/typescript/modules/more-items/index.d.ts +4 -0
- package/lib/typescript/modules/multi-select/MultiSelect.d.ts +1 -16
- package/lib/typescript/modules/multi-select/MultiSelect.variants.d.ts +24 -5
- package/lib/typescript/modules/number-input/NumberInput.d.ts +6 -0
- package/lib/typescript/modules/number-input/NumberInput.variants.d.ts +64 -12
- package/lib/typescript/modules/org-switcher/OrgSwitcher.d.ts +44 -0
- package/lib/typescript/modules/org-switcher/OrgSwitcher.variants.d.ts +139 -0
- package/lib/typescript/modules/org-switcher/index.d.ts +8 -0
- package/lib/typescript/modules/pagination/Pagination.d.ts +45 -0
- package/lib/typescript/modules/pagination/Pagination.variants.d.ts +240 -0
- package/lib/typescript/modules/pagination/PaginationControls.d.ts +47 -0
- package/lib/typescript/modules/pagination/index.d.ts +14 -0
- package/lib/typescript/modules/pin-input/PinInput.d.ts +6 -0
- package/lib/typescript/modules/pin-input/PinInput.variants.d.ts +22 -5
- package/lib/typescript/modules/progress-bar/ProgressBar.d.ts +8 -4
- package/lib/typescript/modules/progress-bar/ProgressBar.variants.d.ts +13 -15
- package/lib/typescript/modules/radio-group/RadioGroup.d.ts +6 -0
- package/lib/typescript/modules/radio-group/RadioGroup.variants.d.ts +32 -11
- package/lib/typescript/modules/reorder/Reorder.d.ts +28 -23
- package/lib/typescript/modules/reorder/Reorder.variants.d.ts +25 -9
- package/lib/typescript/modules/rich-text/RichText.d.ts +15 -0
- package/lib/typescript/modules/rich-text/RichText.variants.d.ts +15 -0
- package/lib/typescript/modules/rich-text/index.d.ts +5 -0
- package/lib/typescript/modules/rich-text/parseRichText.d.ts +30 -0
- package/lib/typescript/modules/rich-text-editor/RichTextEditor.d.ts +62 -0
- package/lib/typescript/modules/rich-text-editor/RichTextEditor.variants.d.ts +139 -0
- package/lib/typescript/modules/rich-text-editor/index.d.ts +9 -0
- package/lib/typescript/modules/screen/Screen.d.ts +30 -0
- package/lib/typescript/modules/screen/Screen.variants.d.ts +25 -0
- package/lib/typescript/modules/screen/index.d.ts +9 -0
- package/lib/typescript/modules/search-bar/SearchBar.d.ts +47 -0
- package/lib/typescript/modules/search-bar/SearchBar.variants.d.ts +179 -0
- package/lib/typescript/modules/search-bar/index.d.ts +11 -0
- package/lib/typescript/modules/section/Section.d.ts +17 -0
- package/lib/typescript/modules/section/Section.variants.d.ts +9 -0
- package/lib/typescript/modules/section/index.d.ts +8 -0
- package/lib/typescript/modules/section-list/SectionList.d.ts +26 -0
- package/lib/typescript/modules/section-list/SectionList.variants.d.ts +3 -0
- package/lib/typescript/modules/section-list/index.d.ts +3 -0
- package/lib/typescript/modules/segmented-control/SegmentedControl.d.ts +45 -0
- package/lib/typescript/modules/segmented-control/SegmentedControl.variants.d.ts +143 -0
- package/lib/typescript/modules/segmented-control/index.d.ts +11 -0
- package/lib/typescript/modules/select/Select.d.ts +5 -15
- package/lib/typescript/modules/select/Select.variants.d.ts +45 -12
- package/lib/typescript/modules/select/index.d.ts +1 -1
- package/lib/typescript/modules/skeleton/Skeleton.d.ts +3 -13
- package/lib/typescript/modules/skeleton/Skeleton.variants.d.ts +14 -69
- package/lib/typescript/modules/slider/Slider.variants.d.ts +35 -14
- package/lib/typescript/modules/spinner/Spinner.variants.d.ts +6 -4
- package/lib/typescript/modules/stage-progress/StageProgress.d.ts +18 -0
- package/lib/typescript/modules/stage-progress/StageProgress.variants.d.ts +107 -0
- package/lib/typescript/modules/stage-progress/index.d.ts +4 -0
- package/lib/typescript/modules/stat-tile/StatTile.d.ts +4 -0
- package/lib/typescript/modules/stat-tile/StatTile.variants.d.ts +7 -5
- package/lib/typescript/modules/state-block/StateBlock.d.ts +55 -0
- package/lib/typescript/modules/state-block/StateBlock.variants.d.ts +31 -0
- package/lib/typescript/modules/state-block/index.d.ts +10 -0
- package/lib/typescript/modules/stepper/Stepper.d.ts +4 -0
- package/lib/typescript/modules/stepper/Stepper.variants.d.ts +7 -7
- package/lib/typescript/modules/surface/Surface.d.ts +19 -0
- package/lib/typescript/modules/surface/Surface.variants.d.ts +15 -0
- package/lib/typescript/modules/surface/index.d.ts +4 -0
- package/lib/typescript/modules/swipeable-row/SwipeableRow.d.ts +35 -0
- package/lib/typescript/modules/swipeable-row/SwipeableRow.variants.d.ts +27 -0
- package/lib/typescript/modules/swipeable-row/index.d.ts +4 -0
- package/lib/typescript/modules/switch/Switch.variants.d.ts +9 -1
- package/lib/typescript/modules/tabs/Tabs.d.ts +8 -6
- package/lib/typescript/modules/tabs/Tabs.variants.d.ts +20 -7
- package/lib/typescript/modules/text/Text.d.ts +27 -0
- package/lib/typescript/modules/text/Text.variants.d.ts +21 -0
- package/lib/typescript/modules/text/index.d.ts +4 -0
- package/lib/typescript/modules/textarea/Textarea.d.ts +5 -0
- package/lib/typescript/modules/textarea/Textarea.variants.d.ts +15 -8
- package/lib/typescript/modules/timeline/Timeline.d.ts +9 -13
- package/lib/typescript/modules/timeline/Timeline.variants.d.ts +17 -1
- package/lib/typescript/modules/toast/Toast.d.ts +13 -3
- package/lib/typescript/modules/toast/Toast.variants.d.ts +33 -3
- package/lib/typescript/modules/toast/index.d.ts +1 -1
- package/lib/typescript/modules/toast/toastScreenReader.d.ts +22 -0
- package/lib/typescript/modules/tooltip/Tooltip.d.ts +34 -11
- package/lib/typescript/modules/tooltip/Tooltip.variants.d.ts +11 -5
- package/lib/typescript/modules/typing-indicator/TypingIndicator.d.ts +28 -0
- package/lib/typescript/modules/typing-indicator/TypingIndicator.variants.d.ts +32 -0
- package/lib/typescript/modules/typing-indicator/index.d.ts +4 -0
- package/lib/typescript/modules/unread-badge/UnreadBadge.d.ts +15 -0
- package/lib/typescript/modules/unread-badge/UnreadBadge.variants.d.ts +56 -0
- package/lib/typescript/modules/unread-badge/index.d.ts +4 -0
- package/lib/typescript/test/mocks/flashList.d.ts +3 -0
- package/lib/typescript/test/perfHelpers.d.ts +9 -0
- package/lib/typescript/theme/hooks.d.ts +11 -0
- package/lib/typescript/theme/index.d.ts +4 -3
- package/lib/typescript/theme/platform/elevation.native.d.ts +0 -30
- package/lib/typescript/theme/platform/floatingSurface.native.d.ts +10 -0
- package/lib/typescript/theme/platform/highlight.native.d.ts +17 -0
- package/lib/typescript/theme/platform/index.d.ts +9 -0
- package/lib/typescript/theme/platform/motion.native.d.ts +35 -0
- package/lib/typescript/theme/platform/stateLayer.native.d.ts +11 -0
- package/lib/typescript/theme/platform/surfaces.native.d.ts +8 -0
- package/lib/typescript/theme/provider/PixelizeProvider.d.ts +3 -80
- package/lib/typescript/theme/provider/ThemeContext.d.ts +4 -0
- package/lib/typescript/theme/provider/index.d.ts +2 -1
- package/lib/typescript/theme/provider/loadPalette.d.ts +9 -0
- package/lib/typescript/theme/provider/types.d.ts +49 -0
- package/lib/typescript/theme/provider/useTheme.d.ts +1 -2
- package/lib/typescript/theme/provider/useThemeMode.d.ts +1 -1
- package/lib/typescript/theme/tokens/assertPalette.d.ts +10 -0
- package/lib/typescript/theme/tokens/brands/emerald/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/lavender/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/meadow/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/radiant/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/rosewood/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/skyline/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/slate/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/storefront/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/zinc/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/builders/finalizePalette.d.ts +4 -0
- package/lib/typescript/theme/tokens/builders/liftToContrast.d.ts +9 -0
- package/lib/typescript/theme/tokens/builders/placeholderInk.d.ts +13 -0
- package/lib/typescript/theme/tokens/builders/semanticText.d.ts +4 -0
- package/lib/typescript/theme/tokens/builders/surfaceRungs.d.ts +12 -0
- package/lib/typescript/theme/tokens/index.d.ts +5 -0
- package/lib/typescript/theme/tokens/roles/index.d.ts +8 -0
- package/lib/typescript/theme/tokens/types.d.ts +8 -7
- package/package.json +201 -19
- package/registry.json +177 -2
- package/lib/module/core/a11y/index.js.map +0 -1
- package/lib/module/core/icon/index.js.map +0 -1
- package/lib/module/core/style/index.js.map +0 -1
- package/lib/module/core/style/layoutStyle.js.map +0 -1
- package/lib/module/core/style/variants.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/modules/accordion/Accordion.js.map +0 -1
- package/lib/module/modules/accordion/Accordion.variants.js.map +0 -1
- package/lib/module/modules/accordion/index.js.map +0 -1
- package/lib/module/modules/alert-dialog/AlertDialog.js.map +0 -1
- package/lib/module/modules/alert-dialog/AlertDialog.variants.js.map +0 -1
- package/lib/module/modules/alert-dialog/index.js.map +0 -1
- package/lib/module/modules/avatar/Avatar.js.map +0 -1
- package/lib/module/modules/avatar/Avatar.variants.js.map +0 -1
- package/lib/module/modules/avatar/index.js.map +0 -1
- package/lib/module/modules/badge/Badge.js.map +0 -1
- package/lib/module/modules/badge/Badge.variants.js.map +0 -1
- package/lib/module/modules/badge/index.js.map +0 -1
- package/lib/module/modules/bottom-nav/BottomNav.js.map +0 -1
- package/lib/module/modules/bottom-nav/BottomNav.search.js.map +0 -1
- package/lib/module/modules/bottom-nav/BottomNav.variants.js.map +0 -1
- package/lib/module/modules/bottom-nav/BottomNavIconWithBadge.js.map +0 -1
- package/lib/module/modules/bottom-nav/BottomNavOverflowSheet.js.map +0 -1
- package/lib/module/modules/bottom-nav/index.js.map +0 -1
- package/lib/module/modules/button/Button.js.map +0 -1
- package/lib/module/modules/button/Button.variants.js.map +0 -1
- package/lib/module/modules/button/index.js.map +0 -1
- package/lib/module/modules/button-group/ButtonGroup.js.map +0 -1
- package/lib/module/modules/button-group/ButtonGroup.variants.js.map +0 -1
- package/lib/module/modules/button-group/index.js.map +0 -1
- package/lib/module/modules/card/Card.js.map +0 -1
- package/lib/module/modules/card/Card.variants.js.map +0 -1
- package/lib/module/modules/card/index.js.map +0 -1
- package/lib/module/modules/charts/BarList.js.map +0 -1
- package/lib/module/modules/charts/Charts.variants.js.map +0 -1
- package/lib/module/modules/charts/DonutChart.js.map +0 -1
- package/lib/module/modules/charts/Sparkline.js.map +0 -1
- package/lib/module/modules/charts/index.js.map +0 -1
- package/lib/module/modules/checkbox/Checkbox.js.map +0 -1
- package/lib/module/modules/checkbox/Checkbox.variants.js.map +0 -1
- package/lib/module/modules/checkbox/index.js.map +0 -1
- package/lib/module/modules/divider/Divider.js.map +0 -1
- package/lib/module/modules/divider/Divider.variants.js.map +0 -1
- package/lib/module/modules/divider/index.js.map +0 -1
- package/lib/module/modules/drawer/Drawer.js.map +0 -1
- package/lib/module/modules/drawer/Drawer.variants.js.map +0 -1
- package/lib/module/modules/drawer/index.js.map +0 -1
- package/lib/module/modules/empty-state/EmptyState.js.map +0 -1
- package/lib/module/modules/empty-state/EmptyState.variants.js.map +0 -1
- package/lib/module/modules/empty-state/index.js.map +0 -1
- package/lib/module/modules/file-upload/FileUpload.js.map +0 -1
- package/lib/module/modules/file-upload/FileUpload.variants.js.map +0 -1
- package/lib/module/modules/file-upload/index.js.map +0 -1
- package/lib/module/modules/filter-sheet/FilterChip.js.map +0 -1
- package/lib/module/modules/filter-sheet/FilterSheet.js.map +0 -1
- package/lib/module/modules/filter-sheet/FilterSheet.variants.js.map +0 -1
- package/lib/module/modules/filter-sheet/FilterSheetBody.js.map +0 -1
- package/lib/module/modules/filter-sheet/filterSheet.helpers.js.map +0 -1
- package/lib/module/modules/filter-sheet/index.js.map +0 -1
- package/lib/module/modules/input/Input.js.map +0 -1
- package/lib/module/modules/input/Input.variants.js.map +0 -1
- package/lib/module/modules/input/index.js.map +0 -1
- package/lib/module/modules/list-item/ListItem.js.map +0 -1
- package/lib/module/modules/list-item/ListItem.variants.js.map +0 -1
- package/lib/module/modules/list-item/index.js.map +0 -1
- package/lib/module/modules/markdown/Markdown.js.map +0 -1
- package/lib/module/modules/markdown/Markdown.variants.js.map +0 -1
- package/lib/module/modules/markdown/index.js.map +0 -1
- package/lib/module/modules/markdown/parseMarkdown.js.map +0 -1
- package/lib/module/modules/menu/Menu.js.map +0 -1
- package/lib/module/modules/menu/Menu.variants.js.map +0 -1
- package/lib/module/modules/menu/index.js.map +0 -1
- package/lib/module/modules/modal/Modal.js.map +0 -1
- package/lib/module/modules/modal/Modal.variants.js.map +0 -1
- package/lib/module/modules/modal/ModalPortalContext.js.map +0 -1
- package/lib/module/modules/modal/ModalPortalProvider.js.map +0 -1
- package/lib/module/modules/modal/index.js.map +0 -1
- package/lib/module/modules/modal/renderWebPortal.js.map +0 -1
- package/lib/module/modules/modal/renderWebPortal.web.js.map +0 -1
- package/lib/module/modules/multi-select/MultiSelect.js.map +0 -1
- package/lib/module/modules/multi-select/MultiSelect.variants.js.map +0 -1
- package/lib/module/modules/multi-select/index.js.map +0 -1
- package/lib/module/modules/number-input/NumberInput.js.map +0 -1
- package/lib/module/modules/number-input/NumberInput.variants.js.map +0 -1
- package/lib/module/modules/number-input/index.js.map +0 -1
- package/lib/module/modules/pin-input/PinInput.js.map +0 -1
- package/lib/module/modules/pin-input/PinInput.variants.js.map +0 -1
- package/lib/module/modules/pin-input/index.js.map +0 -1
- package/lib/module/modules/progress-bar/ProgressBar.js.map +0 -1
- package/lib/module/modules/progress-bar/ProgressBar.variants.js.map +0 -1
- package/lib/module/modules/progress-bar/index.js.map +0 -1
- package/lib/module/modules/radio-group/RadioGroup.js.map +0 -1
- package/lib/module/modules/radio-group/RadioGroup.variants.js.map +0 -1
- package/lib/module/modules/radio-group/index.js.map +0 -1
- package/lib/module/modules/reorder/Reorder.js.map +0 -1
- package/lib/module/modules/reorder/Reorder.variants.js.map +0 -1
- package/lib/module/modules/reorder/index.js.map +0 -1
- package/lib/module/modules/select/Select.js.map +0 -1
- package/lib/module/modules/select/Select.variants.js.map +0 -1
- package/lib/module/modules/select/index.js.map +0 -1
- package/lib/module/modules/skeleton/Skeleton.js.map +0 -1
- package/lib/module/modules/skeleton/Skeleton.variants.js.map +0 -1
- package/lib/module/modules/skeleton/index.js.map +0 -1
- package/lib/module/modules/slider/Slider.js.map +0 -1
- package/lib/module/modules/slider/Slider.variants.js.map +0 -1
- package/lib/module/modules/slider/index.js.map +0 -1
- package/lib/module/modules/spinner/Spinner.js.map +0 -1
- package/lib/module/modules/spinner/Spinner.variants.js.map +0 -1
- package/lib/module/modules/spinner/index.js.map +0 -1
- package/lib/module/modules/stat-tile/StatTile.js.map +0 -1
- package/lib/module/modules/stat-tile/StatTile.variants.js.map +0 -1
- package/lib/module/modules/stat-tile/index.js.map +0 -1
- package/lib/module/modules/stepper/Stepper.js.map +0 -1
- package/lib/module/modules/stepper/Stepper.variants.js.map +0 -1
- package/lib/module/modules/stepper/index.js.map +0 -1
- package/lib/module/modules/switch/Switch.js.map +0 -1
- package/lib/module/modules/switch/Switch.variants.js.map +0 -1
- package/lib/module/modules/switch/index.js.map +0 -1
- package/lib/module/modules/tabs/Tabs.js.map +0 -1
- package/lib/module/modules/tabs/Tabs.variants.js.map +0 -1
- package/lib/module/modules/tabs/index.js.map +0 -1
- package/lib/module/modules/textarea/Textarea.js.map +0 -1
- package/lib/module/modules/textarea/Textarea.variants.js.map +0 -1
- package/lib/module/modules/textarea/index.js.map +0 -1
- package/lib/module/modules/timeline/Timeline.js.map +0 -1
- package/lib/module/modules/timeline/Timeline.variants.js.map +0 -1
- package/lib/module/modules/timeline/index.js.map +0 -1
- package/lib/module/modules/toast/Toast.js.map +0 -1
- package/lib/module/modules/toast/Toast.variants.js.map +0 -1
- package/lib/module/modules/toast/index.js.map +0 -1
- package/lib/module/modules/tooltip/Tooltip.js.map +0 -1
- package/lib/module/modules/tooltip/Tooltip.variants.js.map +0 -1
- package/lib/module/modules/tooltip/index.js.map +0 -1
- package/lib/module/theme/index.js.map +0 -1
- package/lib/module/theme/platform/colorScheme.native.js.map +0 -1
- package/lib/module/theme/platform/elevation.native.js.map +0 -1
- package/lib/module/theme/platform/fonts.native.js.map +0 -1
- package/lib/module/theme/platform/index.js.map +0 -1
- package/lib/module/theme/platform/units.native.js.map +0 -1
- package/lib/module/theme/provider/PixelizeProvider.js.map +0 -1
- package/lib/module/theme/provider/colorModeStorage.js.map +0 -1
- package/lib/module/theme/provider/index.js.map +0 -1
- package/lib/module/theme/provider/useTheme.js.map +0 -1
- package/lib/module/theme/provider/useThemeColors.js.map +0 -1
- package/lib/module/theme/provider/useThemeMode.js.map +0 -1
- package/lib/module/theme/tokens/brands/emerald/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/emerald/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/index.js.map +0 -1
- package/lib/module/theme/tokens/brands/lavender/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/lavender/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/meadow/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/meadow/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/radiant/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/radiant/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/rosewood/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/rosewood/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/skyline/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/skyline/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/slate/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/slate/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/storefront/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/storefront/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/brands/zinc/palette.dark.js.map +0 -1
- package/lib/module/theme/tokens/brands/zinc/palette.light.js.map +0 -1
- package/lib/module/theme/tokens/builders/accentText.js.map +0 -1
- package/lib/module/theme/tokens/builders/buildBrandTokens.js.map +0 -1
- package/lib/module/theme/tokens/builders/buildDarkPalette.js.map +0 -1
- package/lib/module/theme/tokens/builders/color.js.map +0 -1
- package/lib/module/theme/tokens/index.js.map +0 -1
- package/lib/module/theme/tokens/primitives/borderWidths.js.map +0 -1
- package/lib/module/theme/tokens/primitives/breakpoints.js.map +0 -1
- package/lib/module/theme/tokens/primitives/elevation.js.map +0 -1
- package/lib/module/theme/tokens/primitives/fontSizes.js.map +0 -1
- package/lib/module/theme/tokens/primitives/fontWeights.js.map +0 -1
- package/lib/module/theme/tokens/primitives/index.js.map +0 -1
- package/lib/module/theme/tokens/primitives/letterSpacings.js.map +0 -1
- package/lib/module/theme/tokens/primitives/lineHeights.js.map +0 -1
- package/lib/module/theme/tokens/primitives/radii.js.map +0 -1
- package/lib/module/theme/tokens/primitives/sizes.js.map +0 -1
- package/lib/module/theme/tokens/primitives/space.js.map +0 -1
- package/lib/module/theme/tokens/primitives/zIndices.js.map +0 -1
- package/lib/module/theme/tokens/roles/index.js.map +0 -1
- package/lib/module/theme/tokens/types.js.map +0 -1
- package/lib/typescript/core/a11y/index.d.ts.map +0 -1
- package/lib/typescript/core/icon/index.d.ts.map +0 -1
- package/lib/typescript/core/style/index.d.ts.map +0 -1
- package/lib/typescript/core/style/layoutStyle.d.ts.map +0 -1
- package/lib/typescript/core/style/variants.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/modules/accordion/Accordion.d.ts.map +0 -1
- package/lib/typescript/modules/accordion/Accordion.variants.d.ts.map +0 -1
- package/lib/typescript/modules/accordion/index.d.ts.map +0 -1
- package/lib/typescript/modules/alert-dialog/AlertDialog.d.ts.map +0 -1
- package/lib/typescript/modules/alert-dialog/AlertDialog.variants.d.ts.map +0 -1
- package/lib/typescript/modules/alert-dialog/index.d.ts.map +0 -1
- package/lib/typescript/modules/avatar/Avatar.d.ts.map +0 -1
- package/lib/typescript/modules/avatar/Avatar.variants.d.ts.map +0 -1
- package/lib/typescript/modules/avatar/index.d.ts.map +0 -1
- package/lib/typescript/modules/badge/Badge.d.ts.map +0 -1
- package/lib/typescript/modules/badge/Badge.variants.d.ts.map +0 -1
- package/lib/typescript/modules/badge/index.d.ts.map +0 -1
- package/lib/typescript/modules/bottom-nav/BottomNav.d.ts.map +0 -1
- package/lib/typescript/modules/bottom-nav/BottomNav.search.d.ts.map +0 -1
- package/lib/typescript/modules/bottom-nav/BottomNav.variants.d.ts.map +0 -1
- package/lib/typescript/modules/bottom-nav/BottomNavIconWithBadge.d.ts.map +0 -1
- package/lib/typescript/modules/bottom-nav/BottomNavOverflowSheet.d.ts.map +0 -1
- package/lib/typescript/modules/bottom-nav/index.d.ts.map +0 -1
- package/lib/typescript/modules/button/Button.d.ts.map +0 -1
- package/lib/typescript/modules/button/Button.variants.d.ts.map +0 -1
- package/lib/typescript/modules/button/index.d.ts.map +0 -1
- package/lib/typescript/modules/button-group/ButtonGroup.d.ts.map +0 -1
- package/lib/typescript/modules/button-group/ButtonGroup.variants.d.ts.map +0 -1
- package/lib/typescript/modules/button-group/index.d.ts.map +0 -1
- package/lib/typescript/modules/card/Card.d.ts.map +0 -1
- package/lib/typescript/modules/card/Card.variants.d.ts.map +0 -1
- package/lib/typescript/modules/card/index.d.ts.map +0 -1
- package/lib/typescript/modules/charts/BarList.d.ts.map +0 -1
- package/lib/typescript/modules/charts/Charts.variants.d.ts.map +0 -1
- package/lib/typescript/modules/charts/DonutChart.d.ts.map +0 -1
- package/lib/typescript/modules/charts/Sparkline.d.ts.map +0 -1
- package/lib/typescript/modules/charts/index.d.ts.map +0 -1
- package/lib/typescript/modules/checkbox/Checkbox.d.ts.map +0 -1
- package/lib/typescript/modules/checkbox/Checkbox.variants.d.ts.map +0 -1
- package/lib/typescript/modules/checkbox/index.d.ts.map +0 -1
- package/lib/typescript/modules/divider/Divider.d.ts.map +0 -1
- package/lib/typescript/modules/divider/Divider.variants.d.ts.map +0 -1
- package/lib/typescript/modules/divider/index.d.ts.map +0 -1
- package/lib/typescript/modules/drawer/Drawer.d.ts.map +0 -1
- package/lib/typescript/modules/drawer/Drawer.variants.d.ts.map +0 -1
- package/lib/typescript/modules/drawer/index.d.ts.map +0 -1
- package/lib/typescript/modules/empty-state/EmptyState.d.ts.map +0 -1
- package/lib/typescript/modules/empty-state/EmptyState.variants.d.ts.map +0 -1
- package/lib/typescript/modules/empty-state/index.d.ts.map +0 -1
- package/lib/typescript/modules/file-upload/FileUpload.d.ts.map +0 -1
- package/lib/typescript/modules/file-upload/FileUpload.variants.d.ts.map +0 -1
- package/lib/typescript/modules/file-upload/index.d.ts.map +0 -1
- package/lib/typescript/modules/filter-sheet/FilterChip.d.ts.map +0 -1
- package/lib/typescript/modules/filter-sheet/FilterSheet.d.ts.map +0 -1
- package/lib/typescript/modules/filter-sheet/FilterSheet.variants.d.ts.map +0 -1
- package/lib/typescript/modules/filter-sheet/FilterSheetBody.d.ts.map +0 -1
- package/lib/typescript/modules/filter-sheet/filterSheet.helpers.d.ts.map +0 -1
- package/lib/typescript/modules/filter-sheet/index.d.ts.map +0 -1
- package/lib/typescript/modules/input/Input.d.ts.map +0 -1
- package/lib/typescript/modules/input/Input.variants.d.ts.map +0 -1
- package/lib/typescript/modules/input/index.d.ts.map +0 -1
- package/lib/typescript/modules/list-item/ListItem.d.ts.map +0 -1
- package/lib/typescript/modules/list-item/ListItem.variants.d.ts.map +0 -1
- package/lib/typescript/modules/list-item/index.d.ts.map +0 -1
- package/lib/typescript/modules/markdown/Markdown.d.ts.map +0 -1
- package/lib/typescript/modules/markdown/Markdown.variants.d.ts.map +0 -1
- package/lib/typescript/modules/markdown/index.d.ts.map +0 -1
- package/lib/typescript/modules/markdown/parseMarkdown.d.ts.map +0 -1
- package/lib/typescript/modules/menu/Menu.d.ts.map +0 -1
- package/lib/typescript/modules/menu/Menu.variants.d.ts.map +0 -1
- package/lib/typescript/modules/menu/index.d.ts.map +0 -1
- package/lib/typescript/modules/modal/Modal.d.ts.map +0 -1
- package/lib/typescript/modules/modal/Modal.variants.d.ts.map +0 -1
- package/lib/typescript/modules/modal/ModalPortalContext.d.ts.map +0 -1
- package/lib/typescript/modules/modal/ModalPortalProvider.d.ts.map +0 -1
- package/lib/typescript/modules/modal/index.d.ts.map +0 -1
- package/lib/typescript/modules/modal/renderWebPortal.d.ts.map +0 -1
- package/lib/typescript/modules/modal/renderWebPortal.web.d.ts.map +0 -1
- package/lib/typescript/modules/multi-select/MultiSelect.d.ts.map +0 -1
- package/lib/typescript/modules/multi-select/MultiSelect.variants.d.ts.map +0 -1
- package/lib/typescript/modules/multi-select/index.d.ts.map +0 -1
- package/lib/typescript/modules/number-input/NumberInput.d.ts.map +0 -1
- package/lib/typescript/modules/number-input/NumberInput.variants.d.ts.map +0 -1
- package/lib/typescript/modules/number-input/index.d.ts.map +0 -1
- package/lib/typescript/modules/pin-input/PinInput.d.ts.map +0 -1
- package/lib/typescript/modules/pin-input/PinInput.variants.d.ts.map +0 -1
- package/lib/typescript/modules/pin-input/index.d.ts.map +0 -1
- package/lib/typescript/modules/progress-bar/ProgressBar.d.ts.map +0 -1
- package/lib/typescript/modules/progress-bar/ProgressBar.variants.d.ts.map +0 -1
- package/lib/typescript/modules/progress-bar/index.d.ts.map +0 -1
- package/lib/typescript/modules/radio-group/RadioGroup.d.ts.map +0 -1
- package/lib/typescript/modules/radio-group/RadioGroup.variants.d.ts.map +0 -1
- package/lib/typescript/modules/radio-group/index.d.ts.map +0 -1
- package/lib/typescript/modules/reorder/Reorder.d.ts.map +0 -1
- package/lib/typescript/modules/reorder/Reorder.variants.d.ts.map +0 -1
- package/lib/typescript/modules/reorder/index.d.ts.map +0 -1
- package/lib/typescript/modules/select/Select.d.ts.map +0 -1
- package/lib/typescript/modules/select/Select.variants.d.ts.map +0 -1
- package/lib/typescript/modules/select/index.d.ts.map +0 -1
- package/lib/typescript/modules/skeleton/Skeleton.d.ts.map +0 -1
- package/lib/typescript/modules/skeleton/Skeleton.variants.d.ts.map +0 -1
- package/lib/typescript/modules/skeleton/index.d.ts.map +0 -1
- package/lib/typescript/modules/slider/Slider.d.ts.map +0 -1
- package/lib/typescript/modules/slider/Slider.variants.d.ts.map +0 -1
- package/lib/typescript/modules/slider/index.d.ts.map +0 -1
- package/lib/typescript/modules/spinner/Spinner.d.ts.map +0 -1
- package/lib/typescript/modules/spinner/Spinner.variants.d.ts.map +0 -1
- package/lib/typescript/modules/spinner/index.d.ts.map +0 -1
- package/lib/typescript/modules/stat-tile/StatTile.d.ts.map +0 -1
- package/lib/typescript/modules/stat-tile/StatTile.variants.d.ts.map +0 -1
- package/lib/typescript/modules/stat-tile/index.d.ts.map +0 -1
- package/lib/typescript/modules/stepper/Stepper.d.ts.map +0 -1
- package/lib/typescript/modules/stepper/Stepper.variants.d.ts.map +0 -1
- package/lib/typescript/modules/stepper/index.d.ts.map +0 -1
- package/lib/typescript/modules/switch/Switch.d.ts.map +0 -1
- package/lib/typescript/modules/switch/Switch.variants.d.ts.map +0 -1
- package/lib/typescript/modules/switch/index.d.ts.map +0 -1
- package/lib/typescript/modules/tabs/Tabs.d.ts.map +0 -1
- package/lib/typescript/modules/tabs/Tabs.variants.d.ts.map +0 -1
- package/lib/typescript/modules/tabs/index.d.ts.map +0 -1
- package/lib/typescript/modules/textarea/Textarea.d.ts.map +0 -1
- package/lib/typescript/modules/textarea/Textarea.variants.d.ts.map +0 -1
- package/lib/typescript/modules/textarea/index.d.ts.map +0 -1
- package/lib/typescript/modules/timeline/Timeline.d.ts.map +0 -1
- package/lib/typescript/modules/timeline/Timeline.variants.d.ts.map +0 -1
- package/lib/typescript/modules/timeline/index.d.ts.map +0 -1
- package/lib/typescript/modules/toast/Toast.d.ts.map +0 -1
- package/lib/typescript/modules/toast/Toast.variants.d.ts.map +0 -1
- package/lib/typescript/modules/toast/index.d.ts.map +0 -1
- package/lib/typescript/modules/tooltip/Tooltip.d.ts.map +0 -1
- package/lib/typescript/modules/tooltip/Tooltip.variants.d.ts.map +0 -1
- package/lib/typescript/modules/tooltip/index.d.ts.map +0 -1
- package/lib/typescript/theme/index.d.ts.map +0 -1
- package/lib/typescript/theme/platform/colorScheme.native.d.ts.map +0 -1
- package/lib/typescript/theme/platform/elevation.native.d.ts.map +0 -1
- package/lib/typescript/theme/platform/fonts.native.d.ts.map +0 -1
- package/lib/typescript/theme/platform/index.d.ts.map +0 -1
- package/lib/typescript/theme/platform/units.native.d.ts.map +0 -1
- package/lib/typescript/theme/provider/PixelizeProvider.d.ts.map +0 -1
- package/lib/typescript/theme/provider/colorModeStorage.d.ts.map +0 -1
- package/lib/typescript/theme/provider/index.d.ts.map +0 -1
- package/lib/typescript/theme/provider/useTheme.d.ts.map +0 -1
- package/lib/typescript/theme/provider/useThemeColors.d.ts.map +0 -1
- package/lib/typescript/theme/provider/useThemeMode.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/emerald/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/emerald/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/index.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/lavender/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/lavender/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/meadow/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/meadow/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/radiant/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/radiant/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/rosewood/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/rosewood/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/skyline/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/skyline/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/slate/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/slate/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/storefront/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/storefront/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/zinc/palette.dark.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/brands/zinc/palette.light.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/builders/accentText.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/builders/buildBrandTokens.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/builders/buildDarkPalette.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/builders/color.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/index.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/borderWidths.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/breakpoints.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/elevation.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/fontSizes.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/fontWeights.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/index.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/letterSpacings.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/lineHeights.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/radii.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/sizes.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/space.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/primitives/zIndices.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/roles/index.d.ts.map +0 -1
- package/lib/typescript/theme/tokens/types.d.ts.map +0 -1
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calendar — the inline month grid every other export in this module composes. All of its date
|
|
5
|
+
* arithmetic lives in `DatePicker.variants.ts` (pure, unit-tested); this file is layout, state and
|
|
6
|
+
* accessibility only.
|
|
7
|
+
*
|
|
8
|
+
* The header doubles as a quick-jump toggle: while it is open the grid shows the twelve months of
|
|
9
|
+
* the cursor's year and the ‹ › controls page YEARS instead of months — one panel covering both
|
|
10
|
+
* dimensions, instead of a separate year grid and month grid to navigate between. The ‹ › controls
|
|
11
|
+
* themselves are the library's own `Button` (icon-only, ghost/neutral) — composed, not
|
|
12
|
+
* reimplemented; only the toggle needs a custom `Pressable`, for the `aria-expanded` (WCAG 4.1.2)
|
|
13
|
+
* `Button`'s closed a11y contract can't express (see `resolveCalendarChromeColors`).
|
|
14
|
+
*
|
|
15
|
+
* Keyboard (web only, WCAG 2.1.1): the 42 day cells are ONE tab stop, not 42 — exactly one carries
|
|
16
|
+
* `tabIndex={0}` and the arrows/Home/End/PageUp/PageDown move which. The DOM half lives in
|
|
17
|
+
* `Calendar.keys.web.ts`, the date arithmetic in `resolveCalendarFocusMove`; Enter/Space are left
|
|
18
|
+
* to `react-native-web`'s own `role="button"` press handling.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
22
|
+
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
23
|
+
import Animated from "react-native-reanimated";
|
|
24
|
+
import { Icon } from "../../core/icon/index.js";
|
|
25
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
26
|
+
import { concentric } from "../../core/style/index.js";
|
|
27
|
+
import { stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
28
|
+
import { useTheme } from "../../theme/hooks.js";
|
|
29
|
+
import { Button } from "../button/index.js";
|
|
30
|
+
import { useCalendarGridFocus, useCalendarGridKeys } from "./Calendar.keys";
|
|
31
|
+
import { addMonths, atNoon, buildMonthGrid, calendarDayCellStructure, calendarGridStructure, calendarHeaderButtonStructure, calendarHeaderStructure, calendarStructure, calendarWeekRowStructure, calendarWeekdayCellStructure, canShowMonth, canShowYear, chunkIntoWeeks, clampToRange, DEFAULT_FIRST_DAY_OF_WEEK, DEFAULT_LOCALE, EMPTY_RANGE, dayOrdinal, formatMonthYear, formatYear, isDateDisabled, isSameDay, isWithinRange, monthCursorOf, monthShortNames, nextRangeSelection, quickJumpCellStructure, quickJumpGridStructure, resolveCalendarChromeColors, resolveCalendarDayAccessibility, resolveCalendarDayColors, resolveCalendarFocusMove, resolvePressedAccessibilityState, toDayKey, weekdayLabels } from "./DatePicker.variants.js";
|
|
32
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
33
|
+
const ICON_STROKE = 2;
|
|
34
|
+
const HEADER_ICON_SIZE = 18;
|
|
35
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
36
|
+
const CalendarDayCell = /*#__PURE__*/memo(function CalendarDayCell({
|
|
37
|
+
date,
|
|
38
|
+
dayOfMonth,
|
|
39
|
+
adjacent,
|
|
40
|
+
selected,
|
|
41
|
+
inRange,
|
|
42
|
+
disabled,
|
|
43
|
+
today,
|
|
44
|
+
tabIndex,
|
|
45
|
+
locale,
|
|
46
|
+
theme,
|
|
47
|
+
onPress,
|
|
48
|
+
testID
|
|
49
|
+
}) {
|
|
50
|
+
const press = usePressState(disabled);
|
|
51
|
+
const a11y = useMemo(() => resolveCalendarDayAccessibility({
|
|
52
|
+
date,
|
|
53
|
+
selected,
|
|
54
|
+
disabled,
|
|
55
|
+
inRange,
|
|
56
|
+
today,
|
|
57
|
+
locale
|
|
58
|
+
}), [date, selected, disabled, inRange, today, locale]);
|
|
59
|
+
const resting = useMemo(() => resolveCalendarDayColors(theme.colors, {
|
|
60
|
+
selected,
|
|
61
|
+
inRange,
|
|
62
|
+
adjacent,
|
|
63
|
+
disabled,
|
|
64
|
+
today,
|
|
65
|
+
pressed: false
|
|
66
|
+
}), [theme.colors, selected, inRange, adjacent, disabled, today]);
|
|
67
|
+
const pressedBackground = useMemo(() => resolveCalendarDayColors(theme.colors, {
|
|
68
|
+
selected,
|
|
69
|
+
inRange,
|
|
70
|
+
adjacent,
|
|
71
|
+
disabled,
|
|
72
|
+
today,
|
|
73
|
+
pressed: true
|
|
74
|
+
}).background, [theme.colors, selected, inRange, adjacent, disabled, today]);
|
|
75
|
+
const cellStructure = useMemo(() => calendarDayCellStructure(theme), [theme]);
|
|
76
|
+
const labelStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.regular), {
|
|
77
|
+
fontSize: theme.fontSizes.sm,
|
|
78
|
+
color: resting.label
|
|
79
|
+
}], [theme, resting.label]);
|
|
80
|
+
const handlePress = useCallback(() => {
|
|
81
|
+
if (!disabled) onPress(date);
|
|
82
|
+
}, [disabled, onPress, date]);
|
|
83
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
84
|
+
backgroundColor: stateLayerScrim(theme.mode),
|
|
85
|
+
borderRadius: concentric(theme.radii.md, theme.space[1]),
|
|
86
|
+
borderCurve: "continuous"
|
|
87
|
+
}), [theme.mode, theme.radii.md]);
|
|
88
|
+
const cellStyle = useMemo(() => [cellStructure, {
|
|
89
|
+
backgroundColor: resting.background,
|
|
90
|
+
borderColor: resting.ring,
|
|
91
|
+
overflow: "hidden"
|
|
92
|
+
}, press.pressed && !disabled && {
|
|
93
|
+
backgroundColor: pressedBackground
|
|
94
|
+
}, press.animatedStyle], [cellStructure, resting, pressedBackground, press.pressed, press.animatedStyle, disabled]);
|
|
95
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
96
|
+
testID: testID,
|
|
97
|
+
accessibilityRole: a11y.accessibilityRole,
|
|
98
|
+
accessibilityLabel: a11y.accessibilityLabel,
|
|
99
|
+
"aria-pressed": a11y["aria-pressed"],
|
|
100
|
+
accessibilityState: a11y.accessibilityState,
|
|
101
|
+
"aria-disabled": a11y["aria-disabled"],
|
|
102
|
+
disabled: disabled,
|
|
103
|
+
tabIndex: tabIndex,
|
|
104
|
+
onPress: handlePress,
|
|
105
|
+
onPressIn: press.handlers.onPressIn,
|
|
106
|
+
onPressOut: press.handlers.onPressOut,
|
|
107
|
+
onLayout: press.onLayout,
|
|
108
|
+
style: cellStyle,
|
|
109
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
110
|
+
pointerEvents: "none",
|
|
111
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle]
|
|
112
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
113
|
+
style: labelStyle,
|
|
114
|
+
children: dayOfMonth
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
const QuickJumpCell = /*#__PURE__*/memo(function QuickJumpCell({
|
|
119
|
+
month,
|
|
120
|
+
name,
|
|
121
|
+
selected,
|
|
122
|
+
disabled,
|
|
123
|
+
theme,
|
|
124
|
+
onPress,
|
|
125
|
+
testID
|
|
126
|
+
}) {
|
|
127
|
+
const press = usePressState(disabled);
|
|
128
|
+
const resting = useMemo(() => resolveCalendarDayColors(theme.colors, {
|
|
129
|
+
selected,
|
|
130
|
+
inRange: false,
|
|
131
|
+
adjacent: false,
|
|
132
|
+
disabled,
|
|
133
|
+
today: false,
|
|
134
|
+
pressed: false
|
|
135
|
+
}), [theme.colors, selected, disabled]);
|
|
136
|
+
const pressedBackground = useMemo(() => resolveCalendarDayColors(theme.colors, {
|
|
137
|
+
selected,
|
|
138
|
+
inRange: false,
|
|
139
|
+
adjacent: false,
|
|
140
|
+
disabled,
|
|
141
|
+
today: false,
|
|
142
|
+
pressed: true
|
|
143
|
+
}).background, [theme.colors, selected, disabled]);
|
|
144
|
+
const cellStructure = useMemo(() => quickJumpCellStructure(theme), [theme]);
|
|
145
|
+
const labelStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.medium), {
|
|
146
|
+
fontSize: theme.fontSizes.sm,
|
|
147
|
+
color: resting.label
|
|
148
|
+
}], [theme, resting.label]);
|
|
149
|
+
const handlePress = useCallback(() => {
|
|
150
|
+
if (!disabled) onPress(month);
|
|
151
|
+
}, [disabled, onPress, month]);
|
|
152
|
+
const pressedState = useMemo(() => resolvePressedAccessibilityState(selected), [selected]);
|
|
153
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
154
|
+
backgroundColor: stateLayerScrim(theme.mode),
|
|
155
|
+
borderRadius: concentric(theme.radii.md, theme.space[1]),
|
|
156
|
+
borderCurve: "continuous"
|
|
157
|
+
}), [theme.mode, theme.radii.md]);
|
|
158
|
+
const cellStyle = useMemo(() => [cellStructure, {
|
|
159
|
+
backgroundColor: resting.background,
|
|
160
|
+
overflow: "hidden"
|
|
161
|
+
}, press.pressed && !disabled && {
|
|
162
|
+
backgroundColor: pressedBackground
|
|
163
|
+
}, press.animatedStyle], [cellStructure, resting.background, pressedBackground, press.pressed, press.animatedStyle, disabled]);
|
|
164
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
165
|
+
testID: testID,
|
|
166
|
+
accessibilityRole: "button",
|
|
167
|
+
accessibilityLabel: name,
|
|
168
|
+
"aria-pressed": pressedState["aria-pressed"],
|
|
169
|
+
accessibilityState: pressedState.accessibilityState,
|
|
170
|
+
"aria-disabled": disabled,
|
|
171
|
+
disabled: disabled,
|
|
172
|
+
onPress: handlePress,
|
|
173
|
+
onPressIn: press.handlers.onPressIn,
|
|
174
|
+
onPressOut: press.handlers.onPressOut,
|
|
175
|
+
onLayout: press.onLayout,
|
|
176
|
+
style: cellStyle,
|
|
177
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
178
|
+
pointerEvents: "none",
|
|
179
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle]
|
|
180
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
181
|
+
style: labelStyle,
|
|
182
|
+
children: name
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
export const Calendar = /*#__PURE__*/memo(function Calendar({
|
|
187
|
+
value,
|
|
188
|
+
onChange,
|
|
189
|
+
onSelect,
|
|
190
|
+
mode = "single",
|
|
191
|
+
rangeValue,
|
|
192
|
+
onRangeChange,
|
|
193
|
+
minDate,
|
|
194
|
+
maxDate,
|
|
195
|
+
disabledDates,
|
|
196
|
+
firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK,
|
|
197
|
+
locale = DEFAULT_LOCALE,
|
|
198
|
+
style,
|
|
199
|
+
testID
|
|
200
|
+
}) {
|
|
201
|
+
const theme = useTheme();
|
|
202
|
+
const headerPress = usePressState(false);
|
|
203
|
+
const chrome = useMemo(() => resolveCalendarChromeColors(theme.colors), [theme.colors]);
|
|
204
|
+
const range = rangeValue ?? EMPTY_RANGE;
|
|
205
|
+
const anchor = mode === "range" ? range.start : value ?? null;
|
|
206
|
+
const [cursor, setCursor] = useState(() => monthCursorOf(clampToRange(anchor ?? new Date(), minDate, maxDate)));
|
|
207
|
+
const [lastAnchorOrdinal, setLastAnchorOrdinal] = useState(anchor === null ? null : dayOrdinal(anchor));
|
|
208
|
+
const [quickJumpOpen, setQuickJumpOpen] = useState(false);
|
|
209
|
+
const [focusedDate, setFocusedDate] = useState(() => clampToRange(anchor ?? new Date(), minDate, maxDate));
|
|
210
|
+
const gridRef = useRef(null);
|
|
211
|
+
|
|
212
|
+
// React's "adjust state while rendering" pattern — a new selection from the caller pulls the grid
|
|
213
|
+
// to its month without an effect (and without the extra committed frame one would cost).
|
|
214
|
+
if (anchor !== null && dayOrdinal(anchor) !== lastAnchorOrdinal) {
|
|
215
|
+
setLastAnchorOrdinal(dayOrdinal(anchor));
|
|
216
|
+
setCursor(monthCursorOf(anchor));
|
|
217
|
+
}
|
|
218
|
+
const today = useMemo(() => atNoon(new Date()), []);
|
|
219
|
+
const weeks = useMemo(() => chunkIntoWeeks(buildMonthGrid(cursor.year, cursor.month, firstDayOfWeek)), [cursor.year, cursor.month, firstDayOfWeek]);
|
|
220
|
+
const weekdays = useMemo(() => weekdayLabels(firstDayOfWeek, locale), [firstDayOfWeek, locale]);
|
|
221
|
+
const months = useMemo(() => monthShortNames(locale), [locale]);
|
|
222
|
+
const selectDay = onSelect ?? onChange;
|
|
223
|
+
const handleDayPress = useCallback(date => {
|
|
224
|
+
setFocusedDate(atNoon(date));
|
|
225
|
+
if (mode === "range") {
|
|
226
|
+
onRangeChange?.(nextRangeSelection(range, date));
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
selectDay?.(atNoon(date));
|
|
230
|
+
}, [mode, selectDay, onRangeChange, range]);
|
|
231
|
+
const step = quickJumpOpen ? 12 : 1;
|
|
232
|
+
const previousCursor = addMonths(cursor, -step);
|
|
233
|
+
const nextCursor = addMonths(cursor, step);
|
|
234
|
+
const canGoBack = quickJumpOpen ? canShowYear(previousCursor.year, minDate, maxDate) : canShowMonth(previousCursor, minDate, maxDate);
|
|
235
|
+
const canGoForward = quickJumpOpen ? canShowYear(nextCursor.year, minDate, maxDate) : canShowMonth(nextCursor, minDate, maxDate);
|
|
236
|
+
const goBack = useCallback(() => setCursor(current => addMonths(current, -step)), [step]);
|
|
237
|
+
const goForward = useCallback(() => setCursor(current => addMonths(current, step)), [step]);
|
|
238
|
+
const toggleQuickJump = useCallback(() => setQuickJumpOpen(open => !open), []);
|
|
239
|
+
const selectMonth = useCallback(month => {
|
|
240
|
+
setCursor(current => ({
|
|
241
|
+
year: current.year,
|
|
242
|
+
month
|
|
243
|
+
}));
|
|
244
|
+
setQuickJumpOpen(false);
|
|
245
|
+
}, []);
|
|
246
|
+
const rootStyle = useMemo(() => [calendarStructure(theme), {
|
|
247
|
+
backgroundColor: chrome.surface
|
|
248
|
+
}, style], [theme, chrome.surface, style]);
|
|
249
|
+
const headerStructure = useMemo(() => calendarHeaderStructure(theme), [theme]);
|
|
250
|
+
const quickJumpGrid = useMemo(() => quickJumpGridStructure(theme), [theme]);
|
|
251
|
+
const gridStructure = useMemo(() => calendarGridStructure(theme), [theme]);
|
|
252
|
+
const weekRowStructure = useMemo(() => calendarWeekRowStructure(theme), [theme]);
|
|
253
|
+
const weekdayCellStructure = useMemo(() => calendarWeekdayCellStructure(theme), [theme]);
|
|
254
|
+
const weekdayLabelStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.medium), {
|
|
255
|
+
fontSize: theme.fontSizes.xs,
|
|
256
|
+
color: chrome.weekdayLabel
|
|
257
|
+
}], [theme, chrome.weekdayLabel]);
|
|
258
|
+
const headerLabelStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.medium), {
|
|
259
|
+
fontSize: theme.fontSizes.md,
|
|
260
|
+
color: chrome.headerLabel
|
|
261
|
+
}], [theme, chrome.headerLabel]);
|
|
262
|
+
const headerButtonBase = useMemo(() => calendarHeaderButtonStructure(theme), [theme]);
|
|
263
|
+
const headerButtonStyle = useMemo(() => [headerButtonBase, {
|
|
264
|
+
overflow: "hidden"
|
|
265
|
+
}, headerPress.animatedStyle], [headerButtonBase, headerPress.animatedStyle]);
|
|
266
|
+
const headerOverlayStyle = useMemo(() => ({
|
|
267
|
+
backgroundColor: stateLayerScrim(theme.mode),
|
|
268
|
+
borderRadius: theme.radii.md,
|
|
269
|
+
borderCurve: "continuous"
|
|
270
|
+
}), [theme.mode, theme.radii.md]);
|
|
271
|
+
const weekDescriptors = useMemo(() => weeks.map(week => week.map(day => {
|
|
272
|
+
const disabled = isDateDisabled(day.date, {
|
|
273
|
+
minDate,
|
|
274
|
+
maxDate,
|
|
275
|
+
disabledDates
|
|
276
|
+
});
|
|
277
|
+
const selected = mode === "range" ? isSameDay(day.date, range.start) || isSameDay(day.date, range.end) : isSameDay(day.date, value);
|
|
278
|
+
return {
|
|
279
|
+
key: toDayKey(day.date),
|
|
280
|
+
date: day.date,
|
|
281
|
+
dayOfMonth: day.dayOfMonth,
|
|
282
|
+
adjacent: !day.inCurrentMonth,
|
|
283
|
+
selected,
|
|
284
|
+
inRange: mode === "range" && isWithinRange(day.date, range.start, range.end),
|
|
285
|
+
disabled,
|
|
286
|
+
today: isSameDay(day.date, today)
|
|
287
|
+
};
|
|
288
|
+
})), [weeks, minDate, maxDate, disabledDates, mode, range.start, range.end, value, today]);
|
|
289
|
+
|
|
290
|
+
// The roving tab stop. Falling back to the first day of the displayed month matters: paging with
|
|
291
|
+
// ‹ › can leave `focusedDate` outside the six weeks on screen, and a grid with no `tabIndex={0}`
|
|
292
|
+
// cell would have no tab stop at all — strictly worse than the 42 it replaces.
|
|
293
|
+
const focusedKey = toDayKey(focusedDate);
|
|
294
|
+
const activeDay = useMemo(() => {
|
|
295
|
+
const flat = weekDescriptors.flat();
|
|
296
|
+
return flat.find(day => day.key === focusedKey) ?? flat.find(day => !day.adjacent) ?? flat[0];
|
|
297
|
+
}, [weekDescriptors, focusedKey]);
|
|
298
|
+
const activeKey = activeDay?.key;
|
|
299
|
+
const handleGridMove = useCallback(move => {
|
|
300
|
+
const from = activeDay?.date;
|
|
301
|
+
if (from === undefined) return;
|
|
302
|
+
const next = clampToRange(resolveCalendarFocusMove(move, from, firstDayOfWeek), minDate, maxDate);
|
|
303
|
+
setFocusedDate(next);
|
|
304
|
+
setCursor(current => current.year === next.getFullYear() && current.month === next.getMonth() ? current : monthCursorOf(next));
|
|
305
|
+
}, [activeDay, firstDayOfWeek, minDate, maxDate]);
|
|
306
|
+
useCalendarGridKeys(gridRef, !quickJumpOpen, handleGridMove);
|
|
307
|
+
useCalendarGridFocus(gridRef, activeKey ?? "", !quickJumpOpen);
|
|
308
|
+
const quickJumpDescriptors = useMemo(() => months.map((name, month) => ({
|
|
309
|
+
name,
|
|
310
|
+
month,
|
|
311
|
+
selected: month === cursor.month,
|
|
312
|
+
disabled: !canShowMonth({
|
|
313
|
+
year: cursor.year,
|
|
314
|
+
month
|
|
315
|
+
}, minDate, maxDate)
|
|
316
|
+
})), [months, cursor.month, cursor.year, minDate, maxDate]);
|
|
317
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
318
|
+
testID: testID,
|
|
319
|
+
style: rootStyle,
|
|
320
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
321
|
+
style: headerStructure,
|
|
322
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
323
|
+
icon: "chevron-left",
|
|
324
|
+
accessibilityLabel: `Previous ${quickJumpOpen ? "year" : "month"}`,
|
|
325
|
+
variant: "ghost",
|
|
326
|
+
tone: "neutral",
|
|
327
|
+
size: "sm",
|
|
328
|
+
disabled: !canGoBack,
|
|
329
|
+
onPress: goBack,
|
|
330
|
+
testID: testID ? `${testID}-previous` : undefined
|
|
331
|
+
}), /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
332
|
+
testID: testID ? `${testID}-header` : undefined,
|
|
333
|
+
accessibilityRole: "button",
|
|
334
|
+
accessibilityLabel: quickJumpOpen ? formatYear(cursor.year, locale) : formatMonthYear(cursor, locale),
|
|
335
|
+
"aria-expanded": quickJumpOpen,
|
|
336
|
+
onPress: toggleQuickJump,
|
|
337
|
+
onPressIn: headerPress.handlers.onPressIn,
|
|
338
|
+
onPressOut: headerPress.handlers.onPressOut,
|
|
339
|
+
onLayout: headerPress.onLayout,
|
|
340
|
+
style: [headerButtonStyle, headerPress.pressed && {
|
|
341
|
+
backgroundColor: chrome.headerPressed
|
|
342
|
+
}],
|
|
343
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
344
|
+
pointerEvents: "none",
|
|
345
|
+
style: [StyleSheet.absoluteFill, headerOverlayStyle, headerPress.overlayStyle]
|
|
346
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
347
|
+
numberOfLines: 1,
|
|
348
|
+
style: headerLabelStyle,
|
|
349
|
+
children: quickJumpOpen ? formatYear(cursor.year, locale) : formatMonthYear(cursor, locale)
|
|
350
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
351
|
+
name: quickJumpOpen ? "chevron-up" : "chevron-down",
|
|
352
|
+
size: HEADER_ICON_SIZE,
|
|
353
|
+
color: chrome.headerIcon,
|
|
354
|
+
strokeWidth: ICON_STROKE
|
|
355
|
+
})]
|
|
356
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
357
|
+
icon: "chevron-right",
|
|
358
|
+
accessibilityLabel: `Next ${quickJumpOpen ? "year" : "month"}`,
|
|
359
|
+
variant: "ghost",
|
|
360
|
+
tone: "neutral",
|
|
361
|
+
size: "sm",
|
|
362
|
+
disabled: !canGoForward,
|
|
363
|
+
onPress: goForward,
|
|
364
|
+
testID: testID ? `${testID}-next` : undefined
|
|
365
|
+
})]
|
|
366
|
+
}), quickJumpOpen ? /*#__PURE__*/_jsx(View, {
|
|
367
|
+
style: quickJumpGrid,
|
|
368
|
+
children: quickJumpDescriptors.map(month => /*#__PURE__*/_jsx(QuickJumpCell, {
|
|
369
|
+
month: month.month,
|
|
370
|
+
name: month.name,
|
|
371
|
+
selected: month.selected,
|
|
372
|
+
disabled: month.disabled,
|
|
373
|
+
theme: theme,
|
|
374
|
+
onPress: selectMonth,
|
|
375
|
+
testID: testID ? `${testID}-month-${month.month}` : undefined
|
|
376
|
+
}, month.name))
|
|
377
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
378
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
379
|
+
style: weekRowStructure,
|
|
380
|
+
children: weekdays.map((weekday, index) => /*#__PURE__*/_jsx(View
|
|
381
|
+
// Two weekdays can share an abbreviation in some locales, so the slot index is the key.
|
|
382
|
+
, {
|
|
383
|
+
"aria-hidden": true,
|
|
384
|
+
style: weekdayCellStructure,
|
|
385
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
386
|
+
style: weekdayLabelStyle,
|
|
387
|
+
children: weekday
|
|
388
|
+
})
|
|
389
|
+
}, `weekday-${index}`))
|
|
390
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
391
|
+
ref: gridRef,
|
|
392
|
+
style: gridStructure,
|
|
393
|
+
children: weekDescriptors.map(week => /*#__PURE__*/_jsx(View, {
|
|
394
|
+
style: weekRowStructure,
|
|
395
|
+
children: week.map(day => /*#__PURE__*/_jsx(CalendarDayCell, {
|
|
396
|
+
date: day.date,
|
|
397
|
+
dayOfMonth: day.dayOfMonth,
|
|
398
|
+
adjacent: day.adjacent,
|
|
399
|
+
selected: day.selected,
|
|
400
|
+
inRange: day.inRange,
|
|
401
|
+
disabled: day.disabled,
|
|
402
|
+
today: day.today,
|
|
403
|
+
tabIndex: day.key === activeKey ? 0 : -1,
|
|
404
|
+
locale: locale,
|
|
405
|
+
theme: theme,
|
|
406
|
+
onPress: handleDayPress,
|
|
407
|
+
testID: testID ? `${testID}-day-${day.key}` : undefined
|
|
408
|
+
}, day.key))
|
|
409
|
+
}, week[0]?.key ?? "week"))
|
|
410
|
+
})]
|
|
411
|
+
})]
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
//# sourceMappingURL=Calendar.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native/default counterpart of `Calendar.keys.web.ts`. A physical keyboard driving a month grid is
|
|
5
|
+
* a web concern, so both hooks are no-ops here with identical signatures.
|
|
6
|
+
*
|
|
7
|
+
* Same `.ts` / `.web.ts` pair `core/a11y/keyboard.ts` and `../modal/renderWebPortal.ts` use: Metro
|
|
8
|
+
* resolves the `.web.ts` only for a web bundle, so no DOM code enters the native graph, and Jest
|
|
9
|
+
* (whose `react-native` preset has no `web` platform) always resolves THIS file — the web half is
|
|
10
|
+
* tested by importing it explicitly.
|
|
11
|
+
*
|
|
12
|
+
* These live in the module rather than in `core/a11y` on purpose: `useRovingKeys` models one flat
|
|
13
|
+
* list on one axis, and a month grid is 2-D over Dates (week wrapping, month paging). Forcing it
|
|
14
|
+
* into that helper would distort both.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export function useCalendarGridKeys(_ref, _active, _onMove) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
export function useCalendarGridFocus(_ref, _focusedKey, _active) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=Calendar.keys.js.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Web implementation of the Calendar day-grid's keyboard navigation. Metro only resolves this file
|
|
5
|
+
* for a web bundle (see `Calendar.keys.ts`), so it is the one place here that may assume a DOM.
|
|
6
|
+
*
|
|
7
|
+
* The DOM types are hand-written for the same reason `core/a11y/keyboard.web.ts` writes its own:
|
|
8
|
+
* `tsconfig.json` sets `"lib": ["ESNext"]`, `any` is lint-banned, and augmenting `react-native`'s
|
|
9
|
+
* types would ship through `lib/typescript/**`. A module-local structural surface plus
|
|
10
|
+
* `declare const document` erases entirely at emit.
|
|
11
|
+
*
|
|
12
|
+
* This file owns ONLY the DOM half — which key means which move, and moving real focus. Every date
|
|
13
|
+
* calculation lives in `resolveCalendarFocusMove` (`DatePicker.variants.ts`), pure and unit-tested.
|
|
14
|
+
*
|
|
15
|
+
* Enter and Space are deliberately unhandled: the day cells are `role="button"`, which
|
|
16
|
+
* `react-native-web`'s `PressResponder.isValidKeyPress` already presses on both keys. Handling them
|
|
17
|
+
* here too would select the day twice.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { useEffect, useRef } from "react";
|
|
21
|
+
/** `typeof` rather than a null check: a bare `document` reference throws outside a browser. */
|
|
22
|
+
function getDocument() {
|
|
23
|
+
return typeof document === "undefined" ? undefined : document;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** `react-native-web` forwards a component's ref to the host element it renders — the same
|
|
27
|
+
* "assume a DOM in the `.web` file only" cast `renderWebPortal.web.ts` established. */
|
|
28
|
+
function domNode(ref) {
|
|
29
|
+
return ref.current ?? null;
|
|
30
|
+
}
|
|
31
|
+
const MOVE_BY_KEY = {
|
|
32
|
+
ArrowLeft: "prevDay",
|
|
33
|
+
ArrowRight: "nextDay",
|
|
34
|
+
ArrowUp: "prevWeek",
|
|
35
|
+
ArrowDown: "nextWeek",
|
|
36
|
+
Home: "weekStart",
|
|
37
|
+
End: "weekEnd",
|
|
38
|
+
PageUp: "prevMonth",
|
|
39
|
+
PageDown: "nextMonth"
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Arrow/Home/End/PageUp/PageDown on the grid container. Listens on the CONTAINER (capture phase),
|
|
44
|
+
* never on `document`, so two calendars on one page never fight over the same arrow key, and so an
|
|
45
|
+
* arrow pressed on the ‹ › header buttons is left alone.
|
|
46
|
+
*/
|
|
47
|
+
export function useCalendarGridKeys(ref, active, onMove) {
|
|
48
|
+
const onMoveRef = useRef(onMove);
|
|
49
|
+
onMoveRef.current = onMove;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!active) return;
|
|
52
|
+
const node = domNode(ref);
|
|
53
|
+
if (node === null) return;
|
|
54
|
+
const handleKeyDown = event => {
|
|
55
|
+
const move = MOVE_BY_KEY[event.key];
|
|
56
|
+
if (move === undefined) return;
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
onMoveRef.current(move);
|
|
59
|
+
};
|
|
60
|
+
node.addEventListener("keydown", handleKeyDown, true);
|
|
61
|
+
return () => node.removeEventListener("keydown", handleKeyDown, true);
|
|
62
|
+
}, [ref, active]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Moves real DOM focus onto whichever day cell currently owns `tabIndex={0}`, after `focusedKey`
|
|
67
|
+
* changed the roving index.
|
|
68
|
+
*
|
|
69
|
+
* The `contains` guard is the whole safety of this hook: it only ever moves focus that is ALREADY
|
|
70
|
+
* inside the grid. Without it, a caller's own selection (or the first mount) would rip focus out of
|
|
71
|
+
* the field that opened the picker.
|
|
72
|
+
*/
|
|
73
|
+
export function useCalendarGridFocus(ref, focusedKey, active) {
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!active) return;
|
|
76
|
+
const doc = getDocument();
|
|
77
|
+
const node = domNode(ref);
|
|
78
|
+
if (doc === undefined || node === null) return;
|
|
79
|
+
if (!node.contains(doc.activeElement)) return;
|
|
80
|
+
node.querySelector('[tabindex="0"]')?.focus();
|
|
81
|
+
}, [ref, focusedKey, active]);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=Calendar.keys.web.js.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DatePicker — a field styled like `Input`'s box (`PickerField`) that opens `Calendar` and/or
|
|
5
|
+
* `TimePicker` in `PickerShell` (React Native's OWN `Modal` — see `PickerShell.tsx`). In
|
|
6
|
+
* `"datetime"` mode the sheet shows a Date | Time `Tabs` strip above the active panel — the
|
|
7
|
+
* library's own `Tabs` component, composed rather than reimplemented.
|
|
8
|
+
*
|
|
9
|
+
* The sheet edits a local DRAFT, never `value` directly: `Calendar`/`TimePicker` inside the modal
|
|
10
|
+
* report into `draft`, and only Confirm commits it via `onChange`. Cancel — and the backdrop, which
|
|
11
|
+
* is the same dismissal — discards the draft, so "Cancel restores the prior value" holds by
|
|
12
|
+
* construction (the prior value was never touched).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { memo, useCallback, useState } from "react";
|
|
16
|
+
import { View } from "react-native";
|
|
17
|
+
import { Tabs } from "../tabs/index.js";
|
|
18
|
+
import { Calendar } from "./Calendar.js";
|
|
19
|
+
import { PickerField } from "./PickerField.js";
|
|
20
|
+
import { PickerShell } from "./PickerShell.js";
|
|
21
|
+
import { TimePicker } from "./TimePicker.js";
|
|
22
|
+
import { useTheme } from "../../theme/hooks.js";
|
|
23
|
+
import { DEFAULT_FIRST_DAY_OF_WEEK, DEFAULT_LOCALE, DEFAULT_PLACEHOLDER, clampToRange, formatFieldValue, withDay } from "./DatePicker.variants.js";
|
|
24
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
const SHEET_LABELS = {
|
|
26
|
+
date: "Date picker",
|
|
27
|
+
datetime: "Date and time picker",
|
|
28
|
+
time: "Time picker"
|
|
29
|
+
};
|
|
30
|
+
const DATE_TIME_TABS = [{
|
|
31
|
+
label: "Date",
|
|
32
|
+
value: "date"
|
|
33
|
+
}, {
|
|
34
|
+
label: "Time",
|
|
35
|
+
value: "time"
|
|
36
|
+
}];
|
|
37
|
+
export const DatePicker = /*#__PURE__*/memo(function DatePicker({
|
|
38
|
+
value = null,
|
|
39
|
+
onChange,
|
|
40
|
+
mode = "date",
|
|
41
|
+
confirmOnSelect = false,
|
|
42
|
+
label,
|
|
43
|
+
placeholder = DEFAULT_PLACEHOLDER,
|
|
44
|
+
minDate,
|
|
45
|
+
maxDate,
|
|
46
|
+
disabled = false,
|
|
47
|
+
error,
|
|
48
|
+
clearable = true,
|
|
49
|
+
format,
|
|
50
|
+
use24Hour = false,
|
|
51
|
+
firstDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK,
|
|
52
|
+
locale = DEFAULT_LOCALE,
|
|
53
|
+
containerStyle,
|
|
54
|
+
testID
|
|
55
|
+
}) {
|
|
56
|
+
const theme = useTheme();
|
|
57
|
+
const [open, setOpen] = useState(false);
|
|
58
|
+
const [draft, setDraft] = useState(value);
|
|
59
|
+
const [activeTab, setActiveTab] = useState("date");
|
|
60
|
+
const displayText = formatFieldValue(value, mode, {
|
|
61
|
+
locale,
|
|
62
|
+
use24Hour,
|
|
63
|
+
format
|
|
64
|
+
});
|
|
65
|
+
const openPicker = useCallback(() => {
|
|
66
|
+
if (disabled) return;
|
|
67
|
+
setDraft(value);
|
|
68
|
+
setActiveTab("date");
|
|
69
|
+
setOpen(true);
|
|
70
|
+
}, [disabled, value]);
|
|
71
|
+
const closePicker = useCallback(() => setOpen(false), []);
|
|
72
|
+
const confirm = useCallback(() => {
|
|
73
|
+
onChange(draft === null ? null : clampToRange(draft, minDate, maxDate));
|
|
74
|
+
setOpen(false);
|
|
75
|
+
}, [draft, onChange, minDate, maxDate]);
|
|
76
|
+
const clearValue = useCallback(() => onChange(null), [onChange]);
|
|
77
|
+
|
|
78
|
+
// Preserves any time already chosen on the Time tab: Calendar's own `onChange` only ever reports
|
|
79
|
+
// a day (at noon — it has no concept of time-of-day), so switching the day must re-apply the
|
|
80
|
+
// draft's existing time-of-day rather than resetting it to noon.
|
|
81
|
+
const handleDateChange = useCallback(date => {
|
|
82
|
+
setDraft(prev => withDay(prev, date));
|
|
83
|
+
}, []);
|
|
84
|
+
const handleDateSelect = useCallback(date => {
|
|
85
|
+
const next = withDay(draft, date);
|
|
86
|
+
if (confirmOnSelect && mode === "date") {
|
|
87
|
+
onChange(clampToRange(next, minDate, maxDate));
|
|
88
|
+
setOpen(false);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
handleDateChange(date);
|
|
92
|
+
}, [draft, confirmOnSelect, mode, onChange, minDate, maxDate, handleDateChange]);
|
|
93
|
+
|
|
94
|
+
// TimePicker's `onChange` already merges against the draft it was given as `value`, so its output
|
|
95
|
+
// is the new committed draft directly.
|
|
96
|
+
const handleTimeChange = useCallback(date => setDraft(date), []);
|
|
97
|
+
const handleTabChange = useCallback(tab => setActiveTab(tab), []);
|
|
98
|
+
const trailingIcon = mode === "time" ? "clock" : "calendar";
|
|
99
|
+
const body = mode === "time" ? /*#__PURE__*/_jsx(TimePicker, {
|
|
100
|
+
value: draft,
|
|
101
|
+
onChange: handleTimeChange,
|
|
102
|
+
use24Hour: use24Hour,
|
|
103
|
+
testID: testID ? `${testID}-time` : undefined
|
|
104
|
+
}) : mode === "datetime" ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/_jsx(Tabs, {
|
|
106
|
+
items: DATE_TIME_TABS,
|
|
107
|
+
value: activeTab,
|
|
108
|
+
onValueChange: handleTabChange,
|
|
109
|
+
size: "sm",
|
|
110
|
+
style: {
|
|
111
|
+
marginBottom: theme.space[1]
|
|
112
|
+
},
|
|
113
|
+
testID: testID ? `${testID}-tabs` : undefined
|
|
114
|
+
}), activeTab === "date" ? /*#__PURE__*/_jsx(Calendar, {
|
|
115
|
+
value: draft,
|
|
116
|
+
onSelect: handleDateSelect,
|
|
117
|
+
minDate: minDate,
|
|
118
|
+
maxDate: maxDate,
|
|
119
|
+
firstDayOfWeek: firstDayOfWeek,
|
|
120
|
+
locale: locale,
|
|
121
|
+
testID: testID ? `${testID}-calendar` : undefined
|
|
122
|
+
}) : /*#__PURE__*/_jsx(TimePicker, {
|
|
123
|
+
value: draft,
|
|
124
|
+
onChange: handleTimeChange,
|
|
125
|
+
use24Hour: use24Hour,
|
|
126
|
+
testID: testID ? `${testID}-time` : undefined
|
|
127
|
+
})]
|
|
128
|
+
}) : /*#__PURE__*/_jsx(Calendar, {
|
|
129
|
+
value: draft,
|
|
130
|
+
onSelect: handleDateSelect,
|
|
131
|
+
minDate: minDate,
|
|
132
|
+
maxDate: maxDate,
|
|
133
|
+
firstDayOfWeek: firstDayOfWeek,
|
|
134
|
+
locale: locale,
|
|
135
|
+
testID: testID ? `${testID}-calendar` : undefined
|
|
136
|
+
});
|
|
137
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
138
|
+
style: containerStyle,
|
|
139
|
+
children: [/*#__PURE__*/_jsx(PickerField, {
|
|
140
|
+
label: label,
|
|
141
|
+
placeholder: placeholder,
|
|
142
|
+
displayText: displayText,
|
|
143
|
+
error: error,
|
|
144
|
+
disabled: disabled,
|
|
145
|
+
open: open,
|
|
146
|
+
clearable: clearable,
|
|
147
|
+
clearAccessibilityLabel: "Clear date",
|
|
148
|
+
trailingIcon: trailingIcon,
|
|
149
|
+
onPress: openPicker,
|
|
150
|
+
onClear: clearValue,
|
|
151
|
+
testID: testID
|
|
152
|
+
}), /*#__PURE__*/_jsx(PickerShell, {
|
|
153
|
+
open: open,
|
|
154
|
+
accessibilityLabel: SHEET_LABELS[mode],
|
|
155
|
+
onCancel: closePicker,
|
|
156
|
+
onConfirm: confirm,
|
|
157
|
+
testID: testID,
|
|
158
|
+
children: body
|
|
159
|
+
})]
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
//# sourceMappingURL=DatePicker.js.map
|