@atmos.build/ui 0.1.0
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/README.md +45 -0
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.js +40 -0
- package/dist/components/at-search.d.ts +35 -0
- package/dist/components/at-search.js +57 -0
- package/dist/components/attachment-thumbnail-stack.d.ts +13 -0
- package/dist/components/attachment-thumbnail-stack.js +23 -0
- package/dist/components/audio-preview.d.ts +33 -0
- package/dist/components/audio-preview.js +176 -0
- package/dist/components/avatar-uploader.d.ts +29 -0
- package/dist/components/avatar-uploader.js +67 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.js +38 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +25 -0
- package/dist/components/button-group.d.ts +12 -0
- package/dist/components/button-group.js +29 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +42 -0
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.js +154 -0
- package/dist/components/channel-list.d.ts +33 -0
- package/dist/components/channel-list.js +40 -0
- package/dist/components/charts/area-chart.d.ts +2 -0
- package/dist/components/charts/area-chart.js +5 -0
- package/dist/components/charts/bar-chart.d.ts +2 -0
- package/dist/components/charts/bar-chart.js +58 -0
- package/dist/components/charts/colors.d.ts +2 -0
- package/dist/components/charts/colors.js +42 -0
- package/dist/components/charts/hover.d.ts +20 -0
- package/dist/components/charts/hover.js +31 -0
- package/dist/components/charts/index.d.ts +10 -0
- package/dist/components/charts/index.js +9 -0
- package/dist/components/charts/layout.d.ts +35 -0
- package/dist/components/charts/layout.js +101 -0
- package/dist/components/charts/legend.d.ts +6 -0
- package/dist/components/charts/legend.js +7 -0
- package/dist/components/charts/line-area-chart.d.ts +4 -0
- package/dist/components/charts/line-area-chart.js +86 -0
- package/dist/components/charts/line-chart.d.ts +2 -0
- package/dist/components/charts/line-chart.js +5 -0
- package/dist/components/charts/pie-chart.d.ts +2 -0
- package/dist/components/charts/pie-chart.js +22 -0
- package/dist/components/charts/radar-chart.d.ts +2 -0
- package/dist/components/charts/radar-chart.js +29 -0
- package/dist/components/charts/radial-chart.d.ts +2 -0
- package/dist/components/charts/radial-chart.js +19 -0
- package/dist/components/charts/scatter-chart.d.ts +2 -0
- package/dist/components/charts/scatter-chart.js +16 -0
- package/dist/components/charts/story-data.d.ts +24 -0
- package/dist/components/charts/story-data.js +48 -0
- package/dist/components/charts/types.d.ts +43 -0
- package/dist/components/charts/types.js +1 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +10 -0
- package/dist/components/chip.d.ts +25 -0
- package/dist/components/chip.js +36 -0
- package/dist/components/code-editor-theme.d.ts +19 -0
- package/dist/components/code-editor-theme.js +100 -0
- package/dist/components/collapsible-section-header.d.ts +82 -0
- package/dist/components/collapsible-section-header.js +82 -0
- package/dist/components/collection-view/collection-view-group-settings.d.ts +73 -0
- package/dist/components/collection-view/collection-view-group-settings.js +55 -0
- package/dist/components/collection-view/collection-view-settings.d.ts +115 -0
- package/dist/components/collection-view/collection-view-settings.js +146 -0
- package/dist/components/collection-view/collection-view.d.ts +87 -0
- package/dist/components/collection-view/collection-view.js +95 -0
- package/dist/components/collection-view/index.d.ts +6 -0
- package/dist/components/collection-view/index.js +6 -0
- package/dist/components/collection-view/use-collection-detail-navigation.d.ts +11 -0
- package/dist/components/collection-view/use-collection-detail-navigation.js +12 -0
- package/dist/components/collection-view/use-collection-escape.d.ts +9 -0
- package/dist/components/collection-view/use-collection-escape.js +20 -0
- package/dist/components/collection-view/use-collection-selection.d.ts +42 -0
- package/dist/components/collection-view/use-collection-selection.js +203 -0
- package/dist/components/color-picker.d.ts +18 -0
- package/dist/components/color-picker.js +77 -0
- package/dist/components/color-swatch-list.d.ts +16 -0
- package/dist/components/color-swatch-list.js +60 -0
- package/dist/components/combobox/combobox.d.ts +4 -0
- package/dist/components/combobox/combobox.js +70 -0
- package/dist/components/combobox/compound.d.ts +68 -0
- package/dist/components/combobox/compound.js +151 -0
- package/dist/components/combobox/context.d.ts +34 -0
- package/dist/components/combobox/context.js +123 -0
- package/dist/components/combobox/create-step.d.ts +12 -0
- package/dist/components/combobox/create-step.js +8 -0
- package/dist/components/combobox/index.d.ts +10 -0
- package/dist/components/combobox/index.js +5 -0
- package/dist/components/combobox/inline-create-form.d.ts +24 -0
- package/dist/components/combobox/inline-create-form.js +43 -0
- package/dist/components/combobox/types.d.ts +57 -0
- package/dist/components/combobox/types.js +10 -0
- package/dist/components/command.d.ts +35 -0
- package/dist/components/command.js +76 -0
- package/dist/components/comment-pin.d.ts +13 -0
- package/dist/components/comment-pin.js +33 -0
- package/dist/components/confidence-meter.d.ts +11 -0
- package/dist/components/confidence-meter.js +24 -0
- package/dist/components/context-menu.d.ts +31 -0
- package/dist/components/context-menu.js +54 -0
- package/dist/components/copy-button.d.ts +12 -0
- package/dist/components/copy-button.js +32 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +86 -0
- package/dist/components/date-tile.d.ts +11 -0
- package/dist/components/date-tile.js +16 -0
- package/dist/components/date-time-picker.d.ts +25 -0
- package/dist/components/date-time-picker.js +153 -0
- package/dist/components/detail-breadcrumb-utils.d.ts +2 -0
- package/dist/components/detail-breadcrumb-utils.js +18 -0
- package/dist/components/detail-nav-bar.d.ts +28 -0
- package/dist/components/detail-nav-bar.js +28 -0
- package/dist/components/detail-top-bar.d.ts +49 -0
- package/dist/components/detail-top-bar.js +41 -0
- package/dist/components/dialog.d.ts +22 -0
- package/dist/components/dialog.js +51 -0
- package/dist/components/dropdown-menu.d.ts +29 -0
- package/dist/components/dropdown-menu.js +52 -0
- package/dist/components/editable-doc-title.d.ts +17 -0
- package/dist/components/editable-doc-title.js +147 -0
- package/dist/components/empty-state.d.ts +12 -0
- package/dist/components/empty-state.js +6 -0
- package/dist/components/filter-condition-editor.d.ts +18 -0
- package/dist/components/filter-condition-editor.js +102 -0
- package/dist/components/form-dialog.d.ts +30 -0
- package/dist/components/form-dialog.js +52 -0
- package/dist/components/formula-editor.d.ts +18 -0
- package/dist/components/formula-editor.js +154 -0
- package/dist/components/hover-card.d.ts +52 -0
- package/dist/components/hover-card.js +51 -0
- package/dist/components/icon-button.d.ts +15 -0
- package/dist/components/icon-button.js +18 -0
- package/dist/components/inline-alert.d.ts +11 -0
- package/dist/components/inline-alert.js +17 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +7 -0
- package/dist/components/kanban-board.d.ts +27 -0
- package/dist/components/kanban-board.js +145 -0
- package/dist/components/kbd.d.ts +3 -0
- package/dist/components/kbd.js +8 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +9 -0
- package/dist/components/markdown-editor/index.d.ts +4 -0
- package/dist/components/markdown-editor/index.js +2 -0
- package/dist/components/markdown-editor/markdown-editor.d.ts +16 -0
- package/dist/components/markdown-editor/markdown-editor.js +53 -0
- package/dist/components/markdown-editor/serialize.d.ts +12 -0
- package/dist/components/markdown-editor/serialize.js +122 -0
- package/dist/components/markdown-editor/vim.d.ts +8 -0
- package/dist/components/markdown-editor/vim.js +394 -0
- package/dist/components/metric-grid.d.ts +41 -0
- package/dist/components/metric-grid.js +39 -0
- package/dist/components/microphone-priority.d.ts +29 -0
- package/dist/components/microphone-priority.js +15 -0
- package/dist/components/middle-truncate.d.ts +6 -0
- package/dist/components/middle-truncate.js +15 -0
- package/dist/components/multi-combobox.d.ts +48 -0
- package/dist/components/multi-combobox.js +221 -0
- package/dist/components/naut-avatar-engine.d.ts +83 -0
- package/dist/components/naut-avatar-engine.js +803 -0
- package/dist/components/naut-avatar.d.ts +31 -0
- package/dist/components/naut-avatar.js +108 -0
- package/dist/components/navigable-list.d.ts +4 -0
- package/dist/components/navigable-list.js +20 -0
- package/dist/components/note-icon-picker.d.ts +20 -0
- package/dist/components/note-icon-picker.js +84 -0
- package/dist/components/note-icon.d.ts +690 -0
- package/dist/components/note-icon.js +353 -0
- package/dist/components/note-row.d.ts +33 -0
- package/dist/components/note-row.js +29 -0
- package/dist/components/overlapping-dots.d.ts +10 -0
- package/dist/components/overlapping-dots.js +13 -0
- package/dist/components/overview-card.d.ts +12 -0
- package/dist/components/overview-card.js +9 -0
- package/dist/components/panel-header.d.ts +8 -0
- package/dist/components/panel-header.js +6 -0
- package/dist/components/panel-section-states.d.ts +9 -0
- package/dist/components/panel-section-states.js +10 -0
- package/dist/components/person-avatar.d.ts +10 -0
- package/dist/components/person-avatar.js +23 -0
- package/dist/components/photo-avatar.d.ts +11 -0
- package/dist/components/photo-avatar.js +24 -0
- package/dist/components/picker-field.d.ts +23 -0
- package/dist/components/picker-field.js +24 -0
- package/dist/components/popover-stack.d.ts +26 -0
- package/dist/components/popover-stack.js +89 -0
- package/dist/components/popover.d.ts +12 -0
- package/dist/components/popover.js +31 -0
- package/dist/components/portal-login-barrier.d.ts +12 -0
- package/dist/components/portal-login-barrier.js +41 -0
- package/dist/components/presence-dot.d.ts +8 -0
- package/dist/components/presence-dot.js +15 -0
- package/dist/components/presence-overlay.d.ts +27 -0
- package/dist/components/presence-overlay.js +34 -0
- package/dist/components/property-list.d.ts +64 -0
- package/dist/components/property-list.js +313 -0
- package/dist/components/property-panel.d.ts +54 -0
- package/dist/components/property-panel.js +87 -0
- package/dist/components/property-selector.d.ts +36 -0
- package/dist/components/property-selector.js +141 -0
- package/dist/components/provenance-chip.d.ts +12 -0
- package/dist/components/provenance-chip.js +17 -0
- package/dist/components/qr-code.d.ts +13 -0
- package/dist/components/qr-code.js +42 -0
- package/dist/components/qr-encode.d.ts +2 -0
- package/dist/components/qr-encode.js +469 -0
- package/dist/components/quantity-stepper.d.ts +25 -0
- package/dist/components/quantity-stepper.js +43 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +13 -0
- package/dist/components/rename-dialog.d.ts +19 -0
- package/dist/components/rename-dialog.js +35 -0
- package/dist/components/row-surface.d.ts +1 -0
- package/dist/components/row-surface.js +5 -0
- package/dist/components/row-trailing.d.ts +30 -0
- package/dist/components/row-trailing.js +59 -0
- package/dist/components/run-status-badge.d.ts +16 -0
- package/dist/components/run-status-badge.js +43 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +12 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +39 -0
- package/dist/components/selectable-card.d.ts +33 -0
- package/dist/components/selectable-card.js +66 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +8 -0
- package/dist/components/settings-dialog-shell.d.ts +46 -0
- package/dist/components/settings-dialog-shell.js +48 -0
- package/dist/components/shimmer-text.d.ts +8 -0
- package/dist/components/shimmer-text.js +26 -0
- package/dist/components/side-panel-tokens.d.ts +27 -0
- package/dist/components/side-panel-tokens.js +26 -0
- package/dist/components/side-panel.d.ts +94 -0
- package/dist/components/side-panel.js +106 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/sortable.d.ts +65 -0
- package/dist/components/sortable.js +110 -0
- package/dist/components/spec-strip.d.ts +18 -0
- package/dist/components/spec-strip.js +15 -0
- package/dist/components/speech-playback.d.ts +25 -0
- package/dist/components/speech-playback.js +35 -0
- package/dist/components/sql-editor.d.ts +13 -0
- package/dist/components/sql-editor.js +228 -0
- package/dist/components/stat-tile.d.ts +7 -0
- package/dist/components/stat-tile.js +6 -0
- package/dist/components/status-badge.d.ts +17 -0
- package/dist/components/status-badge.js +8 -0
- package/dist/components/status-tone.d.ts +9 -0
- package/dist/components/status-tone.js +10 -0
- package/dist/components/sticky-header-fade.d.ts +8 -0
- package/dist/components/sticky-header-fade.js +11 -0
- package/dist/components/swatch-button.d.ts +14 -0
- package/dist/components/swatch-button.js +25 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +9 -0
- package/dist/components/system-load/index.d.ts +6 -0
- package/dist/components/system-load/index.js +6 -0
- package/dist/components/system-load/load-block.d.ts +20 -0
- package/dist/components/system-load/load-block.js +23 -0
- package/dist/components/system-load/load-grid.d.ts +16 -0
- package/dist/components/system-load/load-grid.js +23 -0
- package/dist/components/system-load/load-meter.d.ts +25 -0
- package/dist/components/system-load/load-meter.js +29 -0
- package/dist/components/system-load/load-tone.d.ts +21 -0
- package/dist/components/system-load/load-tone.js +29 -0
- package/dist/components/system-load/meter-row.d.ts +31 -0
- package/dist/components/system-load/meter-row.js +29 -0
- package/dist/components/system-load/resource-meter.d.ts +19 -0
- package/dist/components/system-load/resource-meter.js +15 -0
- package/dist/components/tab-title-bar.d.ts +12 -0
- package/dist/components/tab-title-bar.js +9 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +29 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +97 -0
- package/dist/components/template-chip-input.d.ts +36 -0
- package/dist/components/template-chip-input.js +271 -0
- package/dist/components/template-input.d.ts +24 -0
- package/dist/components/template-input.js +57 -0
- package/dist/components/terminal-spinner.d.ts +11 -0
- package/dist/components/terminal-spinner.js +48 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +7 -0
- package/dist/components/time-column.d.ts +24 -0
- package/dist/components/time-column.js +60 -0
- package/dist/components/timestamped-transcript.d.ts +38 -0
- package/dist/components/timestamped-transcript.js +29 -0
- package/dist/components/timezone-picker.d.ts +22 -0
- package/dist/components/timezone-picker.js +60 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +29 -0
- package/dist/components/transcription-overlay.d.ts +47 -0
- package/dist/components/transcription-overlay.js +30 -0
- package/dist/components/usage-bar.d.ts +17 -0
- package/dist/components/usage-bar.js +26 -0
- package/dist/components/view-query-bar.d.ts +13 -0
- package/dist/components/view-query-bar.js +13 -0
- package/dist/components/view-query-controls.d.ts +159 -0
- package/dist/components/view-query-controls.js +109 -0
- package/dist/components/view-save-menu.d.ts +20 -0
- package/dist/components/view-save-menu.js +13 -0
- package/dist/components/view-sort-editor.d.ts +40 -0
- package/dist/components/view-sort-editor.js +47 -0
- package/dist/components/voice-line.d.ts +37 -0
- package/dist/components/voice-line.js +293 -0
- package/dist/components/weekly-schedule-editor.d.ts +15 -0
- package/dist/components/weekly-schedule-editor.js +28 -0
- package/dist/flow/canvas/canvas-frame.d.ts +160 -0
- package/dist/flow/canvas/canvas-frame.js +521 -0
- package/dist/flow/canvas/collaborator-layer.d.ts +12 -0
- package/dist/flow/canvas/collaborator-layer.js +43 -0
- package/dist/flow/canvas/connector-edge.d.ts +22 -0
- package/dist/flow/canvas/connector-edge.js +61 -0
- package/dist/flow/canvas/editor-context.d.ts +23 -0
- package/dist/flow/canvas/editor-context.js +6 -0
- package/dist/flow/canvas/graph-core.d.ts +60 -0
- package/dist/flow/canvas/graph-core.js +296 -0
- package/dist/flow/canvas/minimap-sticky-overlay.d.ts +4 -0
- package/dist/flow/canvas/minimap-sticky-overlay.js +45 -0
- package/dist/flow/canvas/node-card.d.ts +46 -0
- package/dist/flow/canvas/node-card.js +56 -0
- package/dist/flow/canvas/node-library.d.ts +40 -0
- package/dist/flow/canvas/node-library.js +54 -0
- package/dist/flow/canvas/sticky-notes.d.ts +25 -0
- package/dist/flow/canvas/sticky-notes.js +101 -0
- package/dist/flow/collaborative-graph-presence.d.ts +28 -0
- package/dist/flow/collaborative-graph-presence.js +55 -0
- package/dist/flow/collaborative-graph-sync.d.ts +40 -0
- package/dist/flow/collaborative-graph-sync.js +127 -0
- package/dist/flow/editor/adapter.d.ts +64 -0
- package/dist/flow/editor/adapter.js +1 -0
- package/dist/flow/editor/command-registry.d.ts +10 -0
- package/dist/flow/editor/command-registry.js +35 -0
- package/dist/flow/editor/dag-canvas.d.ts +18 -0
- package/dist/flow/editor/dag-canvas.js +33 -0
- package/dist/flow/editor/flow-editor.d.ts +54 -0
- package/dist/flow/editor/flow-editor.js +199 -0
- package/dist/flow/editor/issues-popover.d.ts +11 -0
- package/dist/flow/editor/issues-popover.js +70 -0
- package/dist/flow/editor/library-rail.d.ts +19 -0
- package/dist/flow/editor/library-rail.js +25 -0
- package/dist/flow/editor/make-controller.d.ts +18 -0
- package/dist/flow/editor/make-controller.js +44 -0
- package/dist/flow/editor/node-chip.d.ts +2 -0
- package/dist/flow/editor/node-chip.js +16 -0
- package/dist/flow/editor/save-publish-bar.d.ts +27 -0
- package/dist/flow/editor/save-publish-bar.js +14 -0
- package/dist/flow/editor/settings-dialog.d.ts +11 -0
- package/dist/flow/editor/settings-dialog.js +11 -0
- package/dist/flow/editor/settings-shell.d.ts +21 -0
- package/dist/flow/editor/settings-shell.js +20 -0
- package/dist/flow/editor/side-rail.d.ts +22 -0
- package/dist/flow/editor/side-rail.js +15 -0
- package/dist/flow/editor/use-dag-editor.d.ts +94 -0
- package/dist/flow/editor/use-dag-editor.js +502 -0
- package/dist/flow/index.d.ts +25 -0
- package/dist/flow/index.js +25 -0
- package/dist/flow/presence-motion.d.ts +10 -0
- package/dist/flow/presence-motion.js +88 -0
- package/dist/flow/styles.css +1 -0
- package/dist/flow/use-collaborative-graph.d.ts +61 -0
- package/dist/flow/use-collaborative-graph.js +396 -0
- package/dist/flow/use-debounced-value.d.ts +1 -0
- package/dist/flow/use-debounced-value.js +10 -0
- package/dist/hooks/use-detail-nav.d.ts +11 -0
- package/dist/hooks/use-detail-nav.js +49 -0
- package/dist/hooks/use-flush-on-hide.d.ts +1 -0
- package/dist/hooks/use-flush-on-hide.js +21 -0
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-media-query.js +20 -0
- package/dist/hooks/use-virtualizer.d.ts +1 -0
- package/dist/hooks/use-virtualizer.js +1 -0
- package/dist/index.d.ts +139 -0
- package/dist/index.js +139 -0
- package/dist/lib/brand-style.d.ts +6 -0
- package/dist/lib/brand-style.js +16 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +5 -0
- package/dist/lib/composited-glint.d.ts +7 -0
- package/dist/lib/composited-glint.js +98 -0
- package/dist/lib/date-time-format.d.ts +2 -0
- package/dist/lib/date-time-format.js +21 -0
- package/dist/lib/disclosure-state.d.ts +11 -0
- package/dist/lib/disclosure-state.js +22 -0
- package/dist/lib/label-swatches.d.ts +10 -0
- package/dist/lib/label-swatches.js +24 -0
- package/dist/lib/local-ui-state.d.ts +10 -0
- package/dist/lib/local-ui-state.js +95 -0
- package/dist/lib/parse-loose-datetime.d.ts +1 -0
- package/dist/lib/parse-loose-datetime.js +180 -0
- package/dist/lib/parse-loose-time.d.ts +6 -0
- package/dist/lib/parse-loose-time.js +53 -0
- package/dist/lib/parse-loose.d.ts +1 -0
- package/dist/lib/parse-loose.js +170 -0
- package/dist/lib/react-19-jsx.d.ts +8 -0
- package/dist/lib/react-19-jsx.js +1 -0
- package/dist/lib/view-chrome.d.ts +5 -0
- package/dist/lib/view-chrome.js +5 -0
- package/dist/lib/view-query/config.d.ts +26 -0
- package/dist/lib/view-query/config.js +162 -0
- package/dist/lib/view-query/evaluate.d.ts +11 -0
- package/dist/lib/view-query/evaluate.js +196 -0
- package/dist/lib/view-query/group-order.d.ts +25 -0
- package/dist/lib/view-query/group-order.js +49 -0
- package/dist/lib/view-query/index.d.ts +6 -0
- package/dist/lib/view-query/index.js +6 -0
- package/dist/lib/view-query/model.d.ts +34 -0
- package/dist/lib/view-query/model.js +88 -0
- package/dist/lib/view-query/sort.d.ts +7 -0
- package/dist/lib/view-query/sort.js +30 -0
- package/dist/lib/view-query/types.d.ts +70 -0
- package/dist/lib/view-query/types.js +12 -0
- package/dist/lib/weekly-schedule.d.ts +8 -0
- package/dist/lib/weekly-schedule.js +10 -0
- package/dist/mcp-app/index.d.ts +4 -0
- package/dist/mcp-app/index.js +3 -0
- package/dist/mcp-app/shadcn.css +629 -0
- package/dist/mcp-app/styles.css +72 -0
- package/dist/mcp-app/theme.d.ts +2 -0
- package/dist/mcp-app/theme.js +62 -0
- package/dist/mcp-app/use-atmos-mcp-app.d.ts +109 -0
- package/dist/mcp-app/use-atmos-mcp-app.js +30 -0
- package/dist/mcp-app/vite.d.ts +7 -0
- package/dist/mcp-app/vite.js +30 -0
- package/dist/tokens/index.d.ts +7 -0
- package/dist/tokens/index.js +7 -0
- package/dist/tokens/semantic.css +110 -0
- package/dist/tokens/tokens.css +195 -0
- package/package.json +98 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Parsed values are held here because useSyncExternalStore compares snapshots by identity:
|
|
5
|
+
* re-parsing localStorage on every read would hand it a new object each render.
|
|
6
|
+
*/
|
|
7
|
+
const snapshots = new Map();
|
|
8
|
+
const subscribers = new Map();
|
|
9
|
+
let crossTabSyncStarted = false;
|
|
10
|
+
function localUiStorage() {
|
|
11
|
+
try {
|
|
12
|
+
return typeof window === 'undefined' ? null : window.localStorage;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function notify(key) {
|
|
19
|
+
for (const subscriber of subscribers.get(key) ?? [])
|
|
20
|
+
subscriber();
|
|
21
|
+
}
|
|
22
|
+
function startCrossTabSync() {
|
|
23
|
+
if (crossTabSyncStarted || typeof window === 'undefined')
|
|
24
|
+
return;
|
|
25
|
+
crossTabSyncStarted = true;
|
|
26
|
+
window.addEventListener('storage', (event) => {
|
|
27
|
+
if (!event.key || !subscribers.has(event.key))
|
|
28
|
+
return;
|
|
29
|
+
snapshots.delete(event.key);
|
|
30
|
+
notify(event.key);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function readLocalUiState(key, fallback) {
|
|
34
|
+
if (snapshots.has(key))
|
|
35
|
+
return snapshots.get(key);
|
|
36
|
+
const raw = localUiStorage()?.getItem(key);
|
|
37
|
+
let value = fallback;
|
|
38
|
+
if (raw != null) {
|
|
39
|
+
try {
|
|
40
|
+
value = JSON.parse(raw);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
value = fallback;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
snapshots.set(key, value);
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
export function writeLocalUiState(key, value) {
|
|
50
|
+
if (snapshots.has(key) && Object.is(snapshots.get(key), value))
|
|
51
|
+
return;
|
|
52
|
+
snapshots.set(key, value);
|
|
53
|
+
try {
|
|
54
|
+
localUiStorage()?.setItem(key, JSON.stringify(value));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
void 0;
|
|
58
|
+
}
|
|
59
|
+
notify(key);
|
|
60
|
+
}
|
|
61
|
+
export function subscribeLocalUiState(key, onChange) {
|
|
62
|
+
startCrossTabSync();
|
|
63
|
+
const forKey = subscribers.get(key) ?? new Set();
|
|
64
|
+
subscribers.set(key, forKey);
|
|
65
|
+
forKey.add(onChange);
|
|
66
|
+
return () => {
|
|
67
|
+
forKey.delete(onChange);
|
|
68
|
+
if (forKey.size === 0)
|
|
69
|
+
subscribers.delete(key);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Drops every value this facility holds, so one test's layout cannot reach the next. */
|
|
73
|
+
export function clearLocalUiState() {
|
|
74
|
+
const keys = [...snapshots.keys()];
|
|
75
|
+
snapshots.clear();
|
|
76
|
+
const storage = localUiStorage();
|
|
77
|
+
for (const key of keys) {
|
|
78
|
+
try {
|
|
79
|
+
storage?.removeItem(key);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
void 0;
|
|
83
|
+
}
|
|
84
|
+
notify(key);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A piece of this browser's own view of the app — a width, a collapsed section, a chosen
|
|
89
|
+
* tab. Everything a teammate should see instead belongs in a shape, not here.
|
|
90
|
+
*/
|
|
91
|
+
export function useLocalUiState(key, fallback) {
|
|
92
|
+
const value = useSyncExternalStore(useCallback((onChange) => subscribeLocalUiState(key, onChange), [key]), () => readLocalUiState(key, fallback), () => fallback);
|
|
93
|
+
const setValue = useCallback((next) => writeLocalUiState(key, next), [key]);
|
|
94
|
+
return [value, setValue];
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseLooseDateTime(input: string, now?: Date): Date | null;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { parseLooseDate } from './parse-loose.js';
|
|
2
|
+
const DAY_PARTS = {
|
|
3
|
+
morning: [9, 0],
|
|
4
|
+
noon: [12, 0],
|
|
5
|
+
midday: [12, 0],
|
|
6
|
+
afternoon: [15, 0],
|
|
7
|
+
evening: [18, 0],
|
|
8
|
+
night: [20, 0],
|
|
9
|
+
midnight: [0, 0],
|
|
10
|
+
};
|
|
11
|
+
const DEFAULT_HOUR = 9;
|
|
12
|
+
const DEFAULT_MINUTE = 0;
|
|
13
|
+
const MS = {
|
|
14
|
+
second: 1000,
|
|
15
|
+
minute: 60 * 1000,
|
|
16
|
+
hour: 60 * 60 * 1000,
|
|
17
|
+
day: 24 * 60 * 60 * 1000,
|
|
18
|
+
week: 7 * 24 * 60 * 60 * 1000,
|
|
19
|
+
};
|
|
20
|
+
function unitOf(token) {
|
|
21
|
+
if (!token)
|
|
22
|
+
return null;
|
|
23
|
+
if (/^(seconds?|secs?|s)$/.test(token))
|
|
24
|
+
return 'second';
|
|
25
|
+
if (/^(minutes?|mins?|m)$/.test(token))
|
|
26
|
+
return 'minute';
|
|
27
|
+
if (/^(hours?|hrs?|h)$/.test(token))
|
|
28
|
+
return 'hour';
|
|
29
|
+
if (/^(days?|d)$/.test(token))
|
|
30
|
+
return 'day';
|
|
31
|
+
if (/^(weeks?|w)$/.test(token))
|
|
32
|
+
return 'week';
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function parseDuration(input, now) {
|
|
36
|
+
const s = input
|
|
37
|
+
.replace(/^in\s+/, '')
|
|
38
|
+
.replace(/\bhalf\s+(?:an?\s+)?hour\b/g, '30 minutes')
|
|
39
|
+
.replace(/\b(?:an?)\s+(?=(seconds?|secs?|minutes?|mins?|hours?|hrs?|days?|weeks?)\b)/g, '1 ')
|
|
40
|
+
.trim();
|
|
41
|
+
if (!s)
|
|
42
|
+
return null;
|
|
43
|
+
const re = /(\d+)\s*(seconds?|secs?|minutes?|mins?|hours?|hrs?|days?|weeks?|h|m|s|d|w)\b/g;
|
|
44
|
+
let totalMs = 0;
|
|
45
|
+
let matched = 0;
|
|
46
|
+
let m;
|
|
47
|
+
while ((m = re.exec(s)) !== null) {
|
|
48
|
+
const unit = unitOf(m[2]);
|
|
49
|
+
if (!unit)
|
|
50
|
+
return null;
|
|
51
|
+
totalMs += Number(m[1]) * MS[unit];
|
|
52
|
+
matched++;
|
|
53
|
+
}
|
|
54
|
+
if (matched === 0)
|
|
55
|
+
return null;
|
|
56
|
+
const leftover = s.replace(re, '').replace(/\b(and)\b/g, '').replace(/[,\s]+/g, '');
|
|
57
|
+
if (leftover)
|
|
58
|
+
return null;
|
|
59
|
+
return new Date(now.getTime() + totalMs);
|
|
60
|
+
}
|
|
61
|
+
function extractTime(input) {
|
|
62
|
+
const word = /\b(noon|midday|midnight)\b/.exec(input);
|
|
63
|
+
const wordPart = word?.[1] ? DAY_PARTS[word[1]] : undefined;
|
|
64
|
+
if (word && wordPart) {
|
|
65
|
+
return { hour: wordPart[0], minute: wordPart[1], rest: cut(input, word.index, word[0].length) };
|
|
66
|
+
}
|
|
67
|
+
const re = /\bat\s+(\d{1,2})(?::(\d{2}))?\s*(am|pm)?\b|\b(\d{1,2}):(\d{2})\s*(am|pm)?\b|\b(\d{1,2})\s*(am|pm)\b/gi;
|
|
68
|
+
let m;
|
|
69
|
+
while ((m = re.exec(input)) !== null) {
|
|
70
|
+
let hour;
|
|
71
|
+
let minute = 0;
|
|
72
|
+
let meridiem;
|
|
73
|
+
if (m[1] !== undefined) {
|
|
74
|
+
hour = Number(m[1]);
|
|
75
|
+
minute = m[2] !== undefined ? Number(m[2]) : 0;
|
|
76
|
+
meridiem = m[3];
|
|
77
|
+
}
|
|
78
|
+
else if (m[4] !== undefined) {
|
|
79
|
+
hour = Number(m[4]);
|
|
80
|
+
minute = Number(m[5]);
|
|
81
|
+
meridiem = m[6];
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
hour = Number(m[7]);
|
|
85
|
+
meridiem = m[8];
|
|
86
|
+
}
|
|
87
|
+
if (minute > 59)
|
|
88
|
+
continue;
|
|
89
|
+
if (meridiem) {
|
|
90
|
+
if (hour < 1 || hour > 12)
|
|
91
|
+
continue;
|
|
92
|
+
const pm = meridiem.toLowerCase() === 'pm';
|
|
93
|
+
if (hour === 12)
|
|
94
|
+
hour = pm ? 12 : 0;
|
|
95
|
+
else if (pm)
|
|
96
|
+
hour += 12;
|
|
97
|
+
}
|
|
98
|
+
else if (hour > 23) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
return { hour, minute, rest: cut(input, m.index, m[0].length) };
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
function cut(s, start, len) {
|
|
106
|
+
return (s.slice(0, start) + s.slice(start + len)).replace(/\s+/g, ' ').trim();
|
|
107
|
+
}
|
|
108
|
+
function extractDayPart(input) {
|
|
109
|
+
const re = /\b(morning|afternoon|evening|night|midday|noon|midnight)\b/;
|
|
110
|
+
const m = re.exec(input);
|
|
111
|
+
const part = m?.[1] ? DAY_PARTS[m[1]] : undefined;
|
|
112
|
+
if (!m || !part)
|
|
113
|
+
return null;
|
|
114
|
+
const rest = cut(input, m.index, m[0].length).replace(/^this\b\s*/, '').trim();
|
|
115
|
+
return { hour: part[0], minute: part[1], rest };
|
|
116
|
+
}
|
|
117
|
+
function atTime(day, hour, minute) {
|
|
118
|
+
return new Date(day.getFullYear(), day.getMonth(), day.getDate(), hour, minute, 0, 0);
|
|
119
|
+
}
|
|
120
|
+
function resolveDatePhrase(phrase, now) {
|
|
121
|
+
const direct = parseLooseDate(phrase, now);
|
|
122
|
+
if (direct)
|
|
123
|
+
return direct;
|
|
124
|
+
const normalized = phrase
|
|
125
|
+
.replace(/,/g, ' ')
|
|
126
|
+
.replace(/(\d)\.(?=\s|$)/g, '$1')
|
|
127
|
+
.replace(/\s+/g, ' ')
|
|
128
|
+
.trim();
|
|
129
|
+
if (normalized !== phrase) {
|
|
130
|
+
const viaNormalized = parseLooseDate(normalized, now);
|
|
131
|
+
if (viaNormalized)
|
|
132
|
+
return viaNormalized;
|
|
133
|
+
}
|
|
134
|
+
const tokens = normalized.split(' ');
|
|
135
|
+
if (tokens.length >= 2 && /^[\p{L}]{2,12}\.?$/u.test(tokens[0] ?? '')) {
|
|
136
|
+
return parseLooseDate(tokens.slice(1).join(' '), now);
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
export function parseLooseDateTime(input, now = new Date()) {
|
|
141
|
+
const trimmed = input.trim().toLowerCase();
|
|
142
|
+
if (!trimmed)
|
|
143
|
+
return null;
|
|
144
|
+
const dur = parseDuration(trimmed, now);
|
|
145
|
+
if (dur)
|
|
146
|
+
return dur;
|
|
147
|
+
const normalized = trimmed.replace(/\btonight\b/g, 'today night');
|
|
148
|
+
const time = extractTime(normalized);
|
|
149
|
+
const afterTime = time ? time.rest : normalized;
|
|
150
|
+
const part = extractDayPart(afterTime);
|
|
151
|
+
const datePhrase = (part ? part.rest : afterTime).trim();
|
|
152
|
+
const day = datePhrase ? resolveDatePhrase(datePhrase, now) : new Date(now);
|
|
153
|
+
if (!day)
|
|
154
|
+
return null;
|
|
155
|
+
let hour;
|
|
156
|
+
let minute;
|
|
157
|
+
let hadTimeSignal = false;
|
|
158
|
+
if (time) {
|
|
159
|
+
hour = time.hour;
|
|
160
|
+
minute = time.minute;
|
|
161
|
+
hadTimeSignal = true;
|
|
162
|
+
}
|
|
163
|
+
else if (part) {
|
|
164
|
+
hour = part.hour;
|
|
165
|
+
minute = part.minute;
|
|
166
|
+
hadTimeSignal = true;
|
|
167
|
+
}
|
|
168
|
+
else if (datePhrase) {
|
|
169
|
+
hour = DEFAULT_HOUR;
|
|
170
|
+
minute = DEFAULT_MINUTE;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
const result = atTime(day, hour, minute);
|
|
176
|
+
if (hadTimeSignal && !datePhrase && result.getTime() <= now.getTime()) {
|
|
177
|
+
return atTime(new Date(now.getTime() + MS.day), hour, minute);
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export function parseLooseTime(input) {
|
|
2
|
+
const s = input.trim().toLowerCase();
|
|
3
|
+
if (!s)
|
|
4
|
+
return null;
|
|
5
|
+
if (s === 'noon' || s === 'midday')
|
|
6
|
+
return { hour: 12, minute: 0 };
|
|
7
|
+
if (s === 'midnight')
|
|
8
|
+
return { hour: 0, minute: 0 };
|
|
9
|
+
let hour;
|
|
10
|
+
let minute;
|
|
11
|
+
let meridiem;
|
|
12
|
+
const colon = /^(\d{1,2})[:.](\d{2})\s*(am|pm)?$/.exec(s);
|
|
13
|
+
const bare = /^(\d{1,2})\s*(am|pm)?$/.exec(s);
|
|
14
|
+
const compact = /^(\d{3,4})\s*(am|pm)?$/.exec(s);
|
|
15
|
+
if (colon && colon[1] && colon[2]) {
|
|
16
|
+
hour = Number(colon[1]);
|
|
17
|
+
minute = Number(colon[2]);
|
|
18
|
+
meridiem = colon[3];
|
|
19
|
+
}
|
|
20
|
+
else if (compact && compact[1]) {
|
|
21
|
+
const digits = compact[1];
|
|
22
|
+
hour = Number(digits.slice(0, digits.length - 2));
|
|
23
|
+
minute = Number(digits.slice(-2));
|
|
24
|
+
meridiem = compact[2];
|
|
25
|
+
}
|
|
26
|
+
else if (bare && bare[1]) {
|
|
27
|
+
hour = Number(bare[1]);
|
|
28
|
+
minute = 0;
|
|
29
|
+
meridiem = bare[2];
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
if (Number.isNaN(hour) || Number.isNaN(minute) || minute > 59)
|
|
35
|
+
return null;
|
|
36
|
+
if (meridiem) {
|
|
37
|
+
if (hour < 1 || hour > 12)
|
|
38
|
+
return null;
|
|
39
|
+
const pm = meridiem === 'pm';
|
|
40
|
+
if (hour === 12)
|
|
41
|
+
hour = pm ? 12 : 0;
|
|
42
|
+
else if (pm)
|
|
43
|
+
hour += 12;
|
|
44
|
+
}
|
|
45
|
+
else if (hour > 23) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return { hour, minute };
|
|
49
|
+
}
|
|
50
|
+
export function parseLooseTimeMinutes(input) {
|
|
51
|
+
const parsed = parseLooseTime(input);
|
|
52
|
+
return parsed ? parsed.hour * 60 + parsed.minute : null;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseLooseDate(input: string, today?: Date): Date | null;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
const WEEKDAYS = {
|
|
2
|
+
sun: 0,
|
|
3
|
+
sunday: 0,
|
|
4
|
+
mon: 1,
|
|
5
|
+
monday: 1,
|
|
6
|
+
tue: 2,
|
|
7
|
+
tues: 2,
|
|
8
|
+
tuesday: 2,
|
|
9
|
+
wed: 3,
|
|
10
|
+
weds: 3,
|
|
11
|
+
wednesday: 3,
|
|
12
|
+
thu: 4,
|
|
13
|
+
thur: 4,
|
|
14
|
+
thurs: 4,
|
|
15
|
+
thursday: 4,
|
|
16
|
+
fri: 5,
|
|
17
|
+
friday: 5,
|
|
18
|
+
sat: 6,
|
|
19
|
+
saturday: 6,
|
|
20
|
+
};
|
|
21
|
+
const MONTHS = {
|
|
22
|
+
jan: 0,
|
|
23
|
+
january: 0,
|
|
24
|
+
januar: 0,
|
|
25
|
+
feb: 1,
|
|
26
|
+
february: 1,
|
|
27
|
+
februar: 1,
|
|
28
|
+
mar: 2,
|
|
29
|
+
march: 2,
|
|
30
|
+
märz: 2,
|
|
31
|
+
maerz: 2,
|
|
32
|
+
mrz: 2,
|
|
33
|
+
apr: 3,
|
|
34
|
+
april: 3,
|
|
35
|
+
may: 4,
|
|
36
|
+
mai: 4,
|
|
37
|
+
jun: 5,
|
|
38
|
+
june: 5,
|
|
39
|
+
juni: 5,
|
|
40
|
+
jul: 6,
|
|
41
|
+
july: 6,
|
|
42
|
+
juli: 6,
|
|
43
|
+
aug: 7,
|
|
44
|
+
august: 7,
|
|
45
|
+
sep: 8,
|
|
46
|
+
sept: 8,
|
|
47
|
+
september: 8,
|
|
48
|
+
oct: 9,
|
|
49
|
+
october: 9,
|
|
50
|
+
okt: 9,
|
|
51
|
+
oktober: 9,
|
|
52
|
+
nov: 10,
|
|
53
|
+
november: 10,
|
|
54
|
+
dec: 11,
|
|
55
|
+
december: 11,
|
|
56
|
+
dez: 11,
|
|
57
|
+
dezember: 11,
|
|
58
|
+
};
|
|
59
|
+
function startOfDay(d) {
|
|
60
|
+
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
61
|
+
}
|
|
62
|
+
function addDays(d, n) {
|
|
63
|
+
const out = startOfDay(d);
|
|
64
|
+
out.setDate(out.getDate() + n);
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
function addWeeks(d, n) {
|
|
68
|
+
return addDays(d, n * 7);
|
|
69
|
+
}
|
|
70
|
+
function addMonths(d, n) {
|
|
71
|
+
const out = startOfDay(d);
|
|
72
|
+
out.setMonth(out.getMonth() + n);
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
function daysUntilWeekday(today, target) {
|
|
76
|
+
const cur = today.getDay();
|
|
77
|
+
const delta = (target - cur + 7) % 7;
|
|
78
|
+
return delta === 0 ? 7 : delta;
|
|
79
|
+
}
|
|
80
|
+
function makeDate(y, m, d) {
|
|
81
|
+
if (m < 0 || m > 11)
|
|
82
|
+
return null;
|
|
83
|
+
if (d < 1 || d > 31)
|
|
84
|
+
return null;
|
|
85
|
+
const out = new Date(y, m, d);
|
|
86
|
+
if (out.getFullYear() !== y || out.getMonth() !== m || out.getDate() !== d)
|
|
87
|
+
return null;
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
function expandYear(yy) {
|
|
91
|
+
if (yy >= 100)
|
|
92
|
+
return yy;
|
|
93
|
+
return yy < 70 ? 2000 + yy : 1900 + yy;
|
|
94
|
+
}
|
|
95
|
+
export function parseLooseDate(input, today = new Date()) {
|
|
96
|
+
const trimmed = input.trim().toLowerCase();
|
|
97
|
+
if (!trimmed)
|
|
98
|
+
return null;
|
|
99
|
+
const t = startOfDay(today);
|
|
100
|
+
if (trimmed === 'today' || trimmed === 'now')
|
|
101
|
+
return t;
|
|
102
|
+
if (trimmed === 'tomorrow' || trimmed === 'tom')
|
|
103
|
+
return addDays(t, 1);
|
|
104
|
+
if (trimmed === 'yesterday')
|
|
105
|
+
return addDays(t, -1);
|
|
106
|
+
const next = /^next\s+(.+)$/.exec(trimmed);
|
|
107
|
+
if (next && next[1]) {
|
|
108
|
+
const what = next[1];
|
|
109
|
+
if (what === 'week')
|
|
110
|
+
return addWeeks(t, 1);
|
|
111
|
+
if (what === 'month')
|
|
112
|
+
return addMonths(t, 1);
|
|
113
|
+
const dow = WEEKDAYS[what];
|
|
114
|
+
if (dow !== undefined)
|
|
115
|
+
return addDays(t, daysUntilWeekday(t, dow));
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const bareDow = WEEKDAYS[trimmed];
|
|
119
|
+
if (bareDow !== undefined) {
|
|
120
|
+
return addDays(t, daysUntilWeekday(t, bareDow));
|
|
121
|
+
}
|
|
122
|
+
const inN = /^in\s+(\d+)\s+(day|days|week|weeks|month|months)$/.exec(trimmed);
|
|
123
|
+
if (inN && inN[1] && inN[2]) {
|
|
124
|
+
const n = Number(inN[1]);
|
|
125
|
+
const unit = inN[2];
|
|
126
|
+
if (unit.startsWith('day'))
|
|
127
|
+
return addDays(t, n);
|
|
128
|
+
if (unit.startsWith('week'))
|
|
129
|
+
return addWeeks(t, n);
|
|
130
|
+
if (unit.startsWith('month'))
|
|
131
|
+
return addMonths(t, n);
|
|
132
|
+
}
|
|
133
|
+
const iso = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(trimmed);
|
|
134
|
+
if (iso && iso[1] && iso[2] && iso[3]) {
|
|
135
|
+
return makeDate(+iso[1], +iso[2] - 1, +iso[3]);
|
|
136
|
+
}
|
|
137
|
+
const slash = /^(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?$/.exec(trimmed);
|
|
138
|
+
if (slash && slash[1] && slash[2]) {
|
|
139
|
+
const m = +slash[1] - 1;
|
|
140
|
+
const d = +slash[2];
|
|
141
|
+
const y = slash[3] ? expandYear(+slash[3]) : t.getFullYear();
|
|
142
|
+
return makeDate(y, m, d);
|
|
143
|
+
}
|
|
144
|
+
const dot = /^(\d{1,2})\.(\d{1,2})(?:\.(\d{2,4}))?$/.exec(trimmed);
|
|
145
|
+
if (dot && dot[1] && dot[2]) {
|
|
146
|
+
const d = +dot[1];
|
|
147
|
+
const m = +dot[2] - 1;
|
|
148
|
+
const y = dot[3] ? expandYear(+dot[3]) : t.getFullYear();
|
|
149
|
+
return makeDate(y, m, d);
|
|
150
|
+
}
|
|
151
|
+
const monthFirst = /^([a-z]+)\s+(\d{1,2})(?:[,\s]+(\d{2,4}))?$/.exec(trimmed);
|
|
152
|
+
if (monthFirst && monthFirst[1] && monthFirst[2]) {
|
|
153
|
+
const m = MONTHS[monthFirst[1]];
|
|
154
|
+
if (m !== undefined) {
|
|
155
|
+
const d = +monthFirst[2];
|
|
156
|
+
const y = monthFirst[3] ? expandYear(+monthFirst[3]) : t.getFullYear();
|
|
157
|
+
return makeDate(y, m, d);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const dayFirst = /^(\d{1,2})\s+([a-z]+)(?:[,\s]+(\d{2,4}))?$/.exec(trimmed);
|
|
161
|
+
if (dayFirst && dayFirst[1] && dayFirst[2]) {
|
|
162
|
+
const m = MONTHS[dayFirst[2]];
|
|
163
|
+
if (m !== undefined) {
|
|
164
|
+
const d = +dayFirst[1];
|
|
165
|
+
const y = dayFirst[3] ? expandYear(+dayFirst[3]) : t.getFullYear();
|
|
166
|
+
return makeDate(y, m, d);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const viewControlClass = "h-7 gap-1.5 rounded-lg px-2 text-[12px] font-medium leading-none text-foreground";
|
|
2
|
+
export declare const viewPrimaryControlClass = "h-7 gap-1.5 rounded-lg px-2 text-[12px] font-normal leading-none";
|
|
3
|
+
export declare const viewSegmentControlClass = "h-7 gap-1 rounded-lg px-2 text-[12px] font-normal leading-none";
|
|
4
|
+
export declare const viewPopoverContentClass = "rounded-lg border-border/70 bg-popover shadow-lg";
|
|
5
|
+
export declare const viewListRowClass = "min-h-7 rounded-md px-1.5 text-[12px] leading-none";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const viewControlClass = 'h-7 gap-1.5 rounded-lg px-2 text-[12px] font-medium leading-none text-foreground';
|
|
2
|
+
export const viewPrimaryControlClass = 'h-7 gap-1.5 rounded-lg px-2 text-[12px] font-normal leading-none';
|
|
3
|
+
export const viewSegmentControlClass = 'h-7 gap-1 rounded-lg px-2 text-[12px] font-normal leading-none';
|
|
4
|
+
export const viewPopoverContentClass = 'rounded-lg border-border/70 bg-popover shadow-lg';
|
|
5
|
+
export const viewListRowClass = 'min-h-7 rounded-md px-1.5 text-[12px] leading-none';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FieldRegistry, ViewQueryFieldMeta } from './model.js';
|
|
2
|
+
import type { ViewQueryConfig } from './types.js';
|
|
3
|
+
export interface ViewConfigShape<TDisplay> {
|
|
4
|
+
query: ViewQueryConfig;
|
|
5
|
+
display: TDisplay;
|
|
6
|
+
}
|
|
7
|
+
export interface DisplaySchema<TDisplay> {
|
|
8
|
+
read: (raw: Record<string, unknown>) => TDisplay;
|
|
9
|
+
write: (display: TDisplay) => Record<string, unknown>;
|
|
10
|
+
/** Keys this schema owns at the blob root, so writeViewConfig can strip stale copies. */
|
|
11
|
+
keys: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
/** The budget a consumer whose table carries an octet_length CHECK should pass to writeViewConfig. */
|
|
14
|
+
export declare const MAX_VIEW_CONFIG_BYTES: number;
|
|
15
|
+
export interface WriteViewConfigOptions {
|
|
16
|
+
/** Reject a blob over this many bytes. Omit where no database constraint backs a limit. */
|
|
17
|
+
maxBytes?: number;
|
|
18
|
+
}
|
|
19
|
+
export { GROUP_ORDER_ALIASES, toInMemoryGroupOrder, toStoredGroupOrder } from './group-order.js';
|
|
20
|
+
export declare function readViewConfig<TDisplay, TMeta extends ViewQueryFieldMeta = ViewQueryFieldMeta>(raw: unknown, registry: FieldRegistry<TMeta>, sortFields: ReadonlySet<string>, display: DisplaySchema<TDisplay>): ViewConfigShape<TDisplay>;
|
|
21
|
+
export declare function writeViewConfig<TDisplay>(blob: unknown, next: ViewConfigShape<TDisplay>, display: DisplaySchema<TDisplay>, options?: WriteViewConfigOptions): Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* The size Postgres will measure: `octet_length(config::text)` on a jsonb column, which
|
|
24
|
+
* re-serializes with a space after every `:` and `,` and counts UTF-8 bytes, not UTF-16 units.
|
|
25
|
+
*/
|
|
26
|
+
export declare function viewConfigByteLength(blob: unknown): number;
|