@ethlete/components 0.1.0-next.9 → 1.0.0-next.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3519 -0
- package/README.md +1 -1
- package/design/accordion.ts +73 -0
- package/design/anchored-dialog.ts +102 -0
- package/design/avatar.ts +90 -0
- package/design/badge.ts +48 -0
- package/design/banner.ts +77 -0
- package/design/bracket.ts +457 -0
- package/design/breadcrumb.ts +144 -0
- package/design/button.ts +116 -0
- package/design/calendar.ts +306 -0
- package/design/card.ts +92 -0
- package/design/carousel.ts +240 -0
- package/design/chart.ts +512 -0
- package/design/checkbox.ts +275 -0
- package/design/chip.ts +64 -0
- package/design/config.json +26 -0
- package/design/control.ts +19 -0
- package/design/copy-button.ts +59 -0
- package/design/description-list.ts +41 -0
- package/design/dialog.ts +210 -0
- package/design/divider.ts +27 -0
- package/design/empty-state.ts +45 -0
- package/design/floating-action.ts +55 -0
- package/design/form-field.ts +256 -0
- package/design/grid.ts +148 -0
- package/design/icon-set.ts +19 -0
- package/design/icon.ts +9 -0
- package/design/input.ts +86 -0
- package/design/kbd.ts +19 -0
- package/design/loader.ts +156 -0
- package/design/masonry.ts +115 -0
- package/design/match.ts +131 -0
- package/design/menu.ts +149 -0
- package/design/notification.ts +132 -0
- package/design/otp-input.ts +107 -0
- package/design/pagination.ts +120 -0
- package/design/picture.ts +80 -0
- package/design/progress-steps.ts +79 -0
- package/design/query-error.ts +60 -0
- package/design/radio-group.ts +132 -0
- package/design/scheduler.ts +369 -0
- package/design/scrollable.ts +219 -0
- package/design/scrollbar.ts +47 -0
- package/design/sdk/assets/fallback.svg +1 -0
- package/design/sdk/assets/fonts/et-kbd-arrows-400-normal.woff2 +0 -0
- package/design/sdk/assets/fonts/et-kbd-control-400-normal.woff2 +0 -0
- package/design/sdk/assets/fonts/et-kbd-keys-400-normal.woff2 +0 -0
- package/design/sdk/assets/fonts/source-code-pro-latin-wght-normal.woff2 +0 -0
- package/design/sdk/assets/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
- package/design/sdk/assets/tall.svg +1 -0
- package/design/sdk/assets/wide.svg +1 -0
- package/design/sdk/components/accent-on-light/accent-on-light.css +35 -0
- package/design/sdk/components/accent-on-light/accent-on-light.ts +15 -0
- package/design/sdk/components/accent-on-light/shared/controls.ts +46 -0
- package/design/sdk/components/accordion/accordion.css +17 -0
- package/design/sdk/components/accordion/accordion.ts +79 -0
- package/design/sdk/components/action-sheet/action-sheet.css +124 -0
- package/design/sdk/components/action-sheet/action-sheet.ts +131 -0
- package/design/sdk/components/anchored-dialog/anchored-dialog.css +60 -0
- package/design/sdk/components/anchored-dialog/anchored-dialog.ts +89 -0
- package/design/sdk/components/avatar/avatar.css +14 -0
- package/design/sdk/components/avatar/avatar.ts +95 -0
- package/design/sdk/components/badge/badge.css +31 -0
- package/design/sdk/components/badge/badge.ts +89 -0
- package/design/sdk/components/banner/banner.css +18 -0
- package/design/sdk/components/banner/banner.ts +160 -0
- package/design/sdk/components/bracket/bracket.css +56 -0
- package/design/sdk/components/bracket/bracket.ts +183 -0
- package/design/sdk/components/breadcrumb/breadcrumb.css +25 -0
- package/design/sdk/components/breadcrumb/breadcrumb.ts +96 -0
- package/design/sdk/components/button/button.css +19 -0
- package/design/sdk/components/button/button.ts +201 -0
- package/design/sdk/components/calendar/calendar.css +33 -0
- package/design/sdk/components/calendar/calendar.ts +183 -0
- package/design/sdk/components/card/card.css +19 -0
- package/design/sdk/components/card/card.ts +111 -0
- package/design/sdk/components/carousel/carousel.css +44 -0
- package/design/sdk/components/carousel/carousel.ts +162 -0
- package/design/sdk/components/chart/chart.css +56 -0
- package/design/sdk/components/chart/chart.ts +146 -0
- package/design/sdk/components/checkbox/checkbox.css +10 -0
- package/design/sdk/components/checkbox/checkbox.ts +223 -0
- package/design/sdk/components/chip/chip.css +18 -0
- package/design/sdk/components/chip/chip.ts +99 -0
- package/design/sdk/components/copy-button/copy-button.css +14 -0
- package/design/sdk/components/copy-button/copy-button.ts +77 -0
- package/design/sdk/components/description-list/description-list.css +7 -0
- package/design/sdk/components/description-list/description-list.ts +64 -0
- package/design/sdk/components/dialog/dialog.css +29 -0
- package/design/sdk/components/dialog/dialog.ts +173 -0
- package/design/sdk/components/divider/divider.css +26 -0
- package/design/sdk/components/divider/divider.ts +49 -0
- package/design/sdk/components/empty-state/empty-state.css +39 -0
- package/design/sdk/components/empty-state/empty-state.ts +67 -0
- package/design/sdk/components/floating-action/floating-action.css +51 -0
- package/design/sdk/components/floating-action/floating-action.ts +78 -0
- package/design/sdk/components/form-field/form-field.ts +204 -0
- package/design/sdk/components/grid/grid.css +17 -0
- package/design/sdk/components/grid/grid.ts +96 -0
- package/design/sdk/components/input/input.css +48 -0
- package/design/sdk/components/input/input.ts +156 -0
- package/design/sdk/components/kbd/kbd.css +25 -0
- package/design/sdk/components/kbd/kbd.ts +70 -0
- package/design/sdk/components/loader/loader.css +37 -0
- package/design/sdk/components/loader/loader.ts +79 -0
- package/design/sdk/components/masonry/masonry.css +7 -0
- package/design/sdk/components/masonry/masonry.ts +50 -0
- package/design/sdk/components/match/match.css +22 -0
- package/design/sdk/components/match/match.ts +95 -0
- package/design/sdk/components/menu/menu.css +22 -0
- package/design/sdk/components/menu/menu.ts +120 -0
- package/design/sdk/components/notification/notification.css +32 -0
- package/design/sdk/components/notification/notification.ts +117 -0
- package/design/sdk/components/otp-input/otp-input.css +35 -0
- package/design/sdk/components/otp-input/otp-input.ts +94 -0
- package/design/sdk/components/pagination/pagination.css +14 -0
- package/design/sdk/components/pagination/pagination.ts +97 -0
- package/design/sdk/components/picture/picture.css +37 -0
- package/design/sdk/components/picture/picture.ts +112 -0
- package/design/sdk/components/progress-steps/progress-steps.css +37 -0
- package/design/sdk/components/progress-steps/progress-steps.ts +109 -0
- package/design/sdk/components/query-error/query-error.css +27 -0
- package/design/sdk/components/query-error/query-error.ts +167 -0
- package/design/sdk/components/radio-group/radio-group.css +10 -0
- package/design/sdk/components/radio-group/radio-group.ts +209 -0
- package/design/sdk/components/scheduler/scheduler.css +49 -0
- package/design/sdk/components/scheduler/scheduler.ts +267 -0
- package/design/sdk/components/scrollable/scrollable.css +58 -0
- package/design/sdk/components/scrollable/scrollable.ts +198 -0
- package/design/sdk/components/scrollbar/scrollbar.css +78 -0
- package/design/sdk/components/scrollbar/scrollbar.ts +152 -0
- package/design/sdk/components/select/select.css +5 -0
- package/design/sdk/components/select/select.ts +42 -0
- package/design/sdk/components/select/shared/select-part.ts +80 -0
- package/design/sdk/components/select-panel/select-panel.css +3 -0
- package/design/sdk/components/select-panel/select-panel.ts +144 -0
- package/design/sdk/components/skeleton/skeleton.css +22 -0
- package/design/sdk/components/skeleton/skeleton.ts +58 -0
- package/design/sdk/components/slider/slider.css +47 -0
- package/design/sdk/components/slider/slider.ts +133 -0
- package/design/sdk/components/standings/standings.css +32 -0
- package/design/sdk/components/standings/standings.ts +146 -0
- package/design/sdk/components/stat-tile/stat-tile.css +15 -0
- package/design/sdk/components/stat-tile/stat-tile.ts +97 -0
- package/design/sdk/components/stream/stream.css +42 -0
- package/design/sdk/components/stream/stream.ts +63 -0
- package/design/sdk/components/switch/switch.ts +94 -0
- package/design/sdk/components/table/table.css +67 -0
- package/design/sdk/components/table/table.ts +320 -0
- package/design/sdk/components/tabs/tabs.css +13 -0
- package/design/sdk/components/tabs/tabs.ts +95 -0
- package/design/sdk/components/textarea/textarea.css +90 -0
- package/design/sdk/components/textarea/textarea.ts +154 -0
- package/design/sdk/components/timeline/timeline.css +30 -0
- package/design/sdk/components/timeline/timeline.ts +98 -0
- package/design/sdk/components/toolbar/toolbar.css +24 -0
- package/design/sdk/components/toolbar/toolbar.ts +104 -0
- package/design/sdk/components/tooltip/tooltip.css +15 -0
- package/design/sdk/components/tooltip/tooltip.ts +39 -0
- package/design/sdk/components/tree/selected-tint.css +15 -0
- package/design/sdk/components/tree/tree.ts +89 -0
- package/design/sdk/fixtures.ts +0 -0
- package/design/sdk/foundations/colors/colors.css +602 -0
- package/design/sdk/foundations/colors/colors.ts +218 -0
- package/design/sdk/foundations/colors/faces.css +75 -0
- package/design/sdk/foundations/colors/overrides.json +19 -0
- package/design/sdk/foundations/colors/shared/contrast.ts +105 -0
- package/design/sdk/foundations/elevation/elevation.css +6 -0
- package/design/sdk/foundations/elevation/elevation.ts +18 -0
- package/design/sdk/foundations/elevation/shared/elevation/scene.css +106 -0
- package/design/sdk/foundations/elevation/shared/elevation/scene.ts +74 -0
- package/design/sdk/foundations/icons/icons.ts +125 -0
- package/design/sdk/lint-baseline.json +6 -0
- package/design/sdk/ready.json +488 -0
- package/design/sdk/rule-baseline.json +48 -0
- package/design/select.ts +199 -0
- package/design/skeleton.ts +67 -0
- package/design/slider.ts +155 -0
- package/design/standings.ts +166 -0
- package/design/stat-tile.ts +109 -0
- package/design/stream.ts +92 -0
- package/design/switch.ts +83 -0
- package/design/table.ts +309 -0
- package/design/tabs.ts +75 -0
- package/design/textarea.ts +94 -0
- package/design/timeline.ts +52 -0
- package/design/toggletip.ts +85 -0
- package/design/toolbar.ts +95 -0
- package/design/tooltip.ts +95 -0
- package/design/tree.ts +106 -0
- package/fesm2022/ethlete-components-testing.mjs +440 -0
- package/fesm2022/ethlete-components-testing.mjs.map +1 -0
- package/fesm2022/ethlete-components.mjs +115628 -12455
- package/fesm2022/ethlete-components.mjs.map +1 -1
- package/generators/component/component-names.js +42 -0
- package/generators/component/component-templates.js +211 -0
- package/generators/component/generator.js +144 -0
- package/generators/component/schema.json +109 -0
- package/generators/component/workspace-edits.js +92 -0
- package/generators/generators.json +126 -0
- package/generators/icons/generator.js +231 -0
- package/generators/icons/schema.json +35 -0
- package/generators/migrate-bracket-default-cards/bracket-default-cards.js +67 -0
- package/generators/migrate-bracket-default-cards/migration.js +63 -0
- package/generators/migrate-bracket-default-cards/schema.json +26 -0
- package/generators/migrate-bracket-ethlete-renames/bracket-ethlete-renames.js +15 -0
- package/generators/migrate-bracket-ethlete-renames/migration.js +31 -0
- package/generators/migrate-bracket-ethlete-renames/schema.json +26 -0
- package/generators/migrate-cascader-tree-internals/cascader-tree-internals.js +6 -0
- package/generators/migrate-cascader-tree-internals/migration.js +11 -0
- package/generators/migrate-cascader-tree-internals/schema.json +26 -0
- package/generators/migrate-chart-baseline-y/chart-baseline-y.js +10 -0
- package/generators/migrate-chart-baseline-y/migration.js +41 -0
- package/generators/migrate-chart-baseline-y/schema.json +26 -0
- package/generators/migrate-duration-format-internals/duration-format-internals.js +6 -0
- package/generators/migrate-duration-format-internals/migration.js +11 -0
- package/generators/migrate-duration-format-internals/schema.json +26 -0
- package/generators/migrate-error-color-theme-signal/error-color-theme-signal.js +37 -0
- package/generators/migrate-error-color-theme-signal/migration.js +55 -0
- package/generators/migrate-error-color-theme-signal/schema.json +26 -0
- package/generators/migrate-grid-engine-internals/grid-engine-internals.js +43 -0
- package/generators/migrate-grid-engine-internals/migration.js +11 -0
- package/generators/migrate-grid-engine-internals/schema.json +26 -0
- package/generators/migrate-line-chart-stacked-area-mix/line-chart-stacked-area-mix.js +48 -0
- package/generators/migrate-line-chart-stacked-area-mix/migration.js +35 -0
- package/generators/migrate-line-chart-stacked-area-mix/schema.json +26 -0
- package/generators/migrate-loader-determinate/loader-determinate.js +87 -0
- package/generators/migrate-loader-determinate/migration.js +49 -0
- package/generators/migrate-loader-determinate/schema.json +26 -0
- package/generators/migrate-overlay-and-column-api/column-visibility-host.js +102 -0
- package/generators/migrate-overlay-and-column-api/migration.js +39 -0
- package/generators/migrate-overlay-and-column-api/overlay-and-column-api.js +18 -0
- package/generators/migrate-overlay-and-column-api/overlay-result.js +399 -0
- package/generators/migrate-overlay-and-column-api/schema.json +26 -0
- package/generators/migrate-overlay-and-column-api/source-scan.js +171 -0
- package/generators/migrate-overlay-fullscreen-animation/migration.js +11 -0
- package/generators/migrate-overlay-fullscreen-animation/overlay-fullscreen-animation.js +16 -0
- package/generators/migrate-overlay-fullscreen-animation/schema.json +26 -0
- package/generators/migrate-overlay-nav-tab-imports/migration.js +35 -0
- package/generators/migrate-overlay-nav-tab-imports/overlay-nav-tab-imports.js +25 -0
- package/generators/migrate-overlay-nav-tab-imports/schema.json +26 -0
- package/generators/migrate-pip-window-z-index/migration.js +85 -0
- package/generators/migrate-pip-window-z-index/pip-window-z-index.js +60 -0
- package/generators/migrate-pip-window-z-index/schema.json +26 -0
- package/generators/migrate-query-error-labels/migration-scope.js +30 -0
- package/generators/migrate-query-error-labels/migration.js +58 -0
- package/generators/migrate-query-error-labels/query-error-labels.js +30 -0
- package/generators/migrate-query-error-labels/schema.json +26 -0
- package/generators/migrate-rich-text-editor-floating-toolbar/migration.js +57 -0
- package/generators/migrate-rich-text-editor-floating-toolbar/rich-text-editor-floating-toolbar.js +28 -0
- package/generators/migrate-rich-text-editor-floating-toolbar/schema.json +26 -0
- package/generators/migrate-rich-text-editor-link-editor/migration.js +57 -0
- package/generators/migrate-rich-text-editor-link-editor/rich-text-editor-link-editor.js +28 -0
- package/generators/migrate-rich-text-editor-link-editor/schema.json +26 -0
- package/generators/migrate-rich-text-editor-tools/migration.js +64 -0
- package/generators/migrate-rich-text-editor-tools/rich-text-editor-tools.js +36 -0
- package/generators/migrate-rich-text-editor-tools/schema.json +26 -0
- package/generators/migrate-select-input-renames/migration.js +41 -0
- package/generators/migrate-select-input-renames/schema.json +26 -0
- package/generators/migrate-select-input-renames/select-input-renames.js +37 -0
- package/generators/migrate-stream-default-components/migration.js +86 -0
- package/generators/migrate-stream-default-components/schema.json +26 -0
- package/generators/migrate-stream-default-components/stream-default-components.js +111 -0
- package/generators/migrate-tabs-active-underline/migration.js +31 -0
- package/generators/migrate-tabs-active-underline/schema.json +26 -0
- package/generators/migrate-tabs-active-underline/tabs-active-underline.js +46 -0
- package/generators/migrate-time-picker-ring/migration.js +17 -0
- package/generators/migrate-time-picker-ring/schema.json +26 -0
- package/generators/migrate-time-picker-ring/time-picker-ring.js +25 -0
- package/generators/migrate-youtube-player-slot-directive/migration.js +11 -0
- package/generators/migrate-youtube-player-slot-directive/schema.json +26 -0
- package/generators/migrate-youtube-player-slot-directive/youtube-player-slot-directive.js +12 -0
- package/generators/removed-exports/removed-exports.js +154 -0
- package/generators/removed-exports/run-removed-exports-migration.js +48 -0
- package/migrations/components-sdk-layer.md +55 -0
- package/migrations.json +211 -0
- package/package.json +47 -17
- package/src/lib/accordion/accordion-group.component.css +12 -0
- package/src/lib/accordion/accordion.component.css +236 -0
- package/src/lib/avatar/avatar-group.component.css +31 -0
- package/src/lib/avatar/avatar.component.css +90 -0
- package/src/lib/badge/badge.component.css +118 -0
- package/src/lib/banner/banner.component.css +102 -0
- package/src/lib/bracket/bracket-default-continue.component.css +29 -0
- package/src/lib/bracket/bracket-default-final-match.component.css +76 -0
- package/src/lib/bracket/bracket-default-match.component.css +21 -0
- package/src/lib/bracket/bracket-default-round-header.component.css +36 -0
- package/src/lib/bracket/bracket-default-section-title.component.css +14 -0
- package/src/lib/bracket/bracket-participants.component.css +13 -0
- package/src/lib/bracket/bracket-pick-card.component.css +232 -0
- package/src/lib/bracket/bracket-rounds-list.component.css +75 -0
- package/src/lib/bracket/bracket-skeleton.component.css +55 -0
- package/src/lib/bracket/bracket.component.css +123 -0
- package/src/lib/bracket/layouts/swiss/bracket-swiss-round-header.component.css +65 -0
- package/src/lib/bracket/layouts/swiss/bracket-swiss-styles.component.css +14 -0
- package/src/lib/breadcrumb/breadcrumb-outlet.component.css +5 -0
- package/src/lib/breadcrumb/breadcrumb-overflow.component.css +38 -0
- package/src/lib/breadcrumb/breadcrumb.component.css +126 -0
- package/src/lib/button/button-properties-styles.component.css +195 -0
- package/src/lib/button/button.component.css +259 -0
- package/src/lib/button/button.types.ts +33 -0
- package/src/lib/button/fab.component.css +257 -0
- package/src/lib/button/icon-button.component.css +152 -0
- package/src/lib/button/split-button.component.css +103 -0
- package/src/lib/button/text-button.component.css +142 -0
- package/src/lib/button/window-control-button.component.css +214 -0
- package/src/lib/calendar/calendar-coarse-grid-styles.component.css +29 -0
- package/src/lib/calendar/calendar-comparison-band-styles.component.css +36 -0
- package/src/lib/calendar/calendar-week-numbers-styles.component.css +32 -0
- package/src/lib/calendar/calendar.component.css +374 -0
- package/src/lib/card/card.component.css +43 -0
- package/src/lib/carousel/carousel-autoplay-styles.component.css +171 -0
- package/src/lib/carousel/carousel-transition-styles.component.css +179 -0
- package/src/lib/carousel/carousel.component.css +220 -0
- package/src/lib/chart/bar-chart.component.css +176 -0
- package/src/lib/chart/chart-axis.component.css +40 -0
- package/src/lib/chart/chart-grid.component.css +6 -0
- package/src/lib/chart/chart-legend.component.css +46 -0
- package/src/lib/chart/chart-tooltip.component.css +34 -0
- package/src/lib/chart/line-chart-tooltip.component.css +51 -0
- package/src/lib/chart/line-chart.component.css +234 -0
- package/src/lib/chart/pie-chart.component.css +176 -0
- package/src/lib/chart/sankey-chart.component.css +221 -0
- package/src/lib/chip/chip.component.css +161 -0
- package/src/lib/collapse/collapse.component.css +43 -0
- package/src/lib/command-palette/command-palette-item.component.css +98 -0
- package/src/lib/command-palette/command-palette.component.css +148 -0
- package/src/lib/description-list/description-list.component.css +78 -0
- package/src/lib/divider/divider.component.css +40 -0
- package/src/lib/empty-state/empty-state.component.css +79 -0
- package/src/lib/floating-action/floating-action-styles.component.css +105 -0
- package/src/lib/focus-ring/focus-ring-styles.component.css +31 -0
- package/src/lib/forms/cascader/cascader-breadcrumb-styles.component.css +98 -0
- package/src/lib/forms/cascader/cascader-panel.component.css +390 -0
- package/src/lib/forms/cascader/cascader-sheet-styles.component.css +241 -0
- package/src/lib/forms/cascader/cascader.component.css +52 -0
- package/src/lib/forms/checkbox/checkbox.component.css +278 -0
- package/src/lib/forms/choice-field/choice-field-card-styles.component.css +66 -0
- package/src/lib/forms/choice-field/choice-field.component.css +227 -0
- package/src/lib/forms/color-input/color-input.component.css +109 -0
- package/src/lib/forms/color-input/color-picker-panel.component.css +354 -0
- package/src/lib/forms/date-time/date-input/date-input.component.css +35 -0
- package/src/lib/forms/date-time/date-picker-panel.component.css +118 -0
- package/src/lib/forms/date-time/date-range-input/date-range-input.component.css +16 -0
- package/src/lib/forms/date-time/date-range-presets.component.css +60 -0
- package/src/lib/forms/date-time/date-time-input/date-time-input.component.css +151 -0
- package/src/lib/forms/date-time/date-time-range-input/date-time-range-input.component.css +121 -0
- package/src/lib/forms/date-time/duration-input/duration-input.component.css +88 -0
- package/src/lib/forms/date-time/range-input-shell-styles.component.css +55 -0
- package/src/lib/forms/date-time/time-input/time-input.component.css +35 -0
- package/src/lib/forms/date-time/time-range-input/time-range-input.component.css +16 -0
- package/src/lib/forms/description/description.component.css +7 -0
- package/src/lib/forms/dropzone/dropzone-crop.component.css +139 -0
- package/src/lib/forms/dropzone/dropzone-item.component.css +67 -0
- package/src/lib/forms/dropzone/dropzone-preview-styles.component.css +83 -0
- package/src/lib/forms/dropzone/dropzone-readonly-styles.component.css +34 -0
- package/src/lib/forms/dropzone/dropzone-row-styles.component.css +85 -0
- package/src/lib/forms/dropzone/dropzone.component.css +291 -0
- package/src/lib/forms/form-field/counter.component.css +25 -0
- package/src/lib/forms/form-field/form-field-control-suffix-styles.component.css +174 -0
- package/src/lib/forms/form-field/form-field-rich-text-styles.component.css +31 -0
- package/src/lib/forms/form-field/form-field-suffix-overlap-styles.component.css +93 -0
- package/src/lib/forms/form-field/form-field-text-shell-styles.component.css +396 -0
- package/src/lib/forms/form-field/form-field-textarea-styles.component.css +94 -0
- package/src/lib/forms/form-field/form-field.component.css +381 -0
- package/src/lib/forms/form-field/form-support-styles.component.css +102 -0
- package/src/lib/forms/form-field/headless/label.directive.css +25 -0
- package/src/lib/forms/form-field/hint.component.css +18 -0
- package/src/lib/forms/input/input.component.css +53 -0
- package/src/lib/forms/input/number-input.component.css +128 -0
- package/src/lib/forms/input/password-input.component.css +103 -0
- package/src/lib/forms/multi-language-rich-text-editor/multi-language-rich-text-editor.component.css +8 -0
- package/src/lib/forms/multi-language-rich-text-editor/tools/multi-language-rich-text-editor-language-tool.component.css +101 -0
- package/src/lib/forms/otp-input/otp-input.component.css +218 -0
- package/src/lib/forms/phone-input/phone-input.component.css +126 -0
- package/src/lib/forms/rating/rating.component.css +197 -0
- package/src/lib/forms/rich-text-editor/rich-text-content-styles.component.css +234 -0
- package/src/lib/forms/rich-text-editor/rich-text-editor-floating-toolbar.component.css +95 -0
- package/src/lib/forms/rich-text-editor/rich-text-editor-image-editor.component.css +172 -0
- package/src/lib/forms/rich-text-editor/rich-text-editor-link-editor.component.css +149 -0
- package/src/lib/forms/rich-text-editor/rich-text-editor-token-palette.component.css +18 -0
- package/src/lib/forms/rich-text-editor/rich-text-editor-token-popup.component.css +206 -0
- package/src/lib/forms/rich-text-editor/rich-text-editor.component.css +175 -0
- package/src/lib/forms/rich-text-editor/rich-text-viewer.component.css +6 -0
- package/src/lib/forms/rich-text-editor/tools/rich-text-editor-align-tool.component.css +5 -0
- package/src/lib/forms/rich-text-editor/tools/rich-text-editor-heading-tool.component.css +5 -0
- package/src/lib/forms/rich-text-editor/tools/rich-text-editor-image-styles.component.css +109 -0
- package/src/lib/forms/rich-text-editor/tools/rich-text-editor-table-styles.component.css +21 -0
- package/src/lib/forms/rich-text-editor/tools/rich-text-editor-table-tool.component.css +44 -0
- package/src/lib/forms/select/select-all-option.component.css +14 -0
- package/src/lib/forms/select/select-extras-styles.component.css +146 -0
- package/src/lib/forms/select/select-option-group.component.css +36 -0
- package/src/lib/forms/select/select-option-styles.component.css +167 -0
- package/src/lib/forms/select/select-panel.component.css +122 -0
- package/src/lib/forms/select/select.component.css +247 -0
- package/src/lib/forms/selection-card-styles.component.css +144 -0
- package/src/lib/forms/selection-list/checkbox-group/checkbox-group-select-all.component.css +98 -0
- package/src/lib/forms/selection-list/checkbox-group/checkbox-group.component.css +142 -0
- package/src/lib/forms/selection-list/checkbox-group/checkbox-option.component.css +162 -0
- package/src/lib/forms/selection-list/radio-group/radio-group.component.css +134 -0
- package/src/lib/forms/selection-list/radio-group/radio.component.css +144 -0
- package/src/lib/forms/selection-list/segmented-button-group/segmented-button-group.component.css +213 -0
- package/src/lib/forms/selection-list/segmented-button-group/segmented-button.component.css +200 -0
- package/src/lib/forms/slider/range-slider.component.css +434 -0
- package/src/lib/forms/slider/slider.component.css +428 -0
- package/src/lib/forms/switch/switch.component.css +214 -0
- package/src/lib/forms/tag-input/tag-input.component.css +54 -0
- package/src/lib/forms/textarea/textarea-autosize-styles.component.css +16 -0
- package/src/lib/forms/textarea/textarea.component.css +45 -0
- package/src/lib/grid/grid-debug.component.css +130 -0
- package/src/lib/grid/grid-item-default-actions.component.css +11 -0
- package/src/lib/grid/grid-item-toolbar.component.css +10 -0
- package/src/lib/grid/grid-item.component.css +176 -0
- package/src/lib/grid/grid.component.css +56 -0
- package/src/lib/icon/headless/align-icons.ts +30 -0
- package/src/lib/icon/headless/arrow-out-up-right-icon.ts +17 -0
- package/src/lib/icon/headless/arrow-right-icon.ts +23 -0
- package/src/lib/icon/headless/arrow-up-icon.ts +30 -0
- package/src/lib/icon/headless/arrows-left-right-icon.ts +31 -0
- package/src/lib/icon/headless/bold-icon.ts +11 -0
- package/src/lib/icon/headless/calendar-icon.ts +21 -0
- package/src/lib/icon/headless/check-icon.ts +14 -0
- package/src/lib/icon/headless/chevron-icon.ts +14 -0
- package/src/lib/icon/headless/circle-check-icon.ts +14 -0
- package/src/lib/icon/headless/circle-info-icon.ts +14 -0
- package/src/lib/icon/headless/clipboard-check-icon.ts +28 -0
- package/src/lib/icon/headless/clock-icon.ts +21 -0
- package/src/lib/icon/headless/code-block-icon.ts +15 -0
- package/src/lib/icon/headless/code-icon.ts +14 -0
- package/src/lib/icon/headless/ellipsis-icon.ts +13 -0
- package/src/lib/icon/headless/ellipsis-vertical-icon.ts +13 -0
- package/src/lib/icon/headless/eye-icons.ts +27 -0
- package/src/lib/icon/headless/eyedropper-icon.ts +22 -0
- package/src/lib/icon/headless/file-icon.ts +16 -0
- package/src/lib/icon/headless/filter-icon.ts +11 -0
- package/src/lib/icon/headless/floppy-disk-icon.ts +27 -0
- package/src/lib/icon/headless/focus-frame-icon.ts +16 -0
- package/src/lib/icon/headless/grid-2x2-icon.ts +17 -0
- package/src/lib/icon/headless/heading-1-icon.ts +11 -0
- package/src/lib/icon/headless/heading-2-icon.ts +11 -0
- package/src/lib/icon/headless/heading-3-icon.ts +11 -0
- package/src/lib/icon/headless/icon-definition.ts +14 -0
- package/src/lib/icon/headless/icon-styles.component.css +7 -0
- package/src/lib/icon/headless/image-icon.ts +14 -0
- package/src/lib/icon/headless/italic-icon.ts +19 -0
- package/src/lib/icon/headless/link-icon.ts +17 -0
- package/src/lib/icon/headless/list-bulleted-icon.ts +14 -0
- package/src/lib/icon/headless/list-numbered-icon.ts +14 -0
- package/src/lib/icon/headless/location-icon.ts +21 -0
- package/src/lib/icon/headless/lock-icon.ts +14 -0
- package/src/lib/icon/headless/minus-icon.ts +14 -0
- package/src/lib/icon/headless/paragraph-icon.ts +11 -0
- package/src/lib/icon/headless/pause-icon.ts +11 -0
- package/src/lib/icon/headless/pencil-icon.ts +21 -0
- package/src/lib/icon/headless/play-icon.ts +10 -0
- package/src/lib/icon/headless/plus-icon.ts +21 -0
- package/src/lib/icon/headless/quote-icon.ts +15 -0
- package/src/lib/icon/headless/rotate-right-icon.ts +16 -0
- package/src/lib/icon/headless/star-icon.ts +14 -0
- package/src/lib/icon/headless/strikethrough-icon.ts +18 -0
- package/src/lib/icon/headless/table-icon.ts +15 -0
- package/src/lib/icon/headless/thumbtack-icon.ts +18 -0
- package/src/lib/icon/headless/times-icon.ts +14 -0
- package/src/lib/icon/headless/trash-icon.ts +24 -0
- package/src/lib/icon/headless/triangle-exclamation-icon.ts +14 -0
- package/src/lib/icon/headless/trophy-icon.ts +24 -0
- package/src/lib/icon/headless/underline-icon.ts +12 -0
- package/src/lib/icon/headless/undo-redo-icons.ts +24 -0
- package/src/lib/icon/headless/upload-icon.ts +16 -0
- package/src/lib/kbd/kbd.component.css +62 -0
- package/src/lib/loader/brand-loader/brand-loader.component.css +133 -0
- package/src/lib/loader/progress-bar/progress-bar.component.css +186 -0
- package/src/lib/loader/spinner/spinner-styles.component.css +225 -0
- package/src/lib/loader/spinner/spinner-sweep-dashes.ts +19 -0
- package/src/lib/masonry/masonry-styles.component.css +84 -0
- package/src/lib/match/match-card.component.css +545 -0
- package/src/lib/match/match-participant.component.css +236 -0
- package/src/lib/match/match-score.component.css +77 -0
- package/src/lib/match/match-scoreline.component.css +53 -0
- package/src/lib/match/match-time.component.css +5 -0
- package/src/lib/menu/menu-group-label.component.css +12 -0
- package/src/lib/menu/menu-item-shortcut.component.css +26 -0
- package/src/lib/menu/menu-item-submenu-icon.component.css +18 -0
- package/src/lib/menu/menu-item.component.css +36 -0
- package/src/lib/menu/menu-search-styles.component.css +83 -0
- package/src/lib/menu/menu-selection-item.component.css +92 -0
- package/src/lib/menu/menu-separator.component.css +9 -0
- package/src/lib/menu/menu.component.css +310 -0
- package/src/lib/notification/notification-stack.component.css +114 -0
- package/src/lib/notification/notification.component.css +275 -0
- package/src/lib/overlay/alert-dialog/alert-dialog.component.css +55 -0
- package/src/lib/overlay/floating-panel-styles.component.css +71 -0
- package/src/lib/overlay/floating-tip-styles.component.css +84 -0
- package/src/lib/overlay/overlay-container.component.css +173 -0
- package/src/lib/overlay/overlay-main-styles.component.css +105 -0
- package/src/lib/overlay/overlay-template-host.component.css +7 -0
- package/src/lib/overlay/routing/overlay-route-header-template-outlet.component.css +36 -0
- package/src/lib/overlay/routing/overlay-router-outlet.component.css +215 -0
- package/src/lib/overlay/routing/overlay-shared-route-template-outlet.component.css +5 -0
- package/src/lib/overlay/sidebar/overlay-sidebar.component.css +23 -0
- package/src/lib/overlay/strategies/anchored-dialog-styles.component.css +78 -0
- package/src/lib/overlay/strategies/dialog-styles.component.css +77 -0
- package/src/lib/overlay/strategies/full-screen-dialog-styles.component.css +141 -0
- package/src/lib/overlay/strategies/overlay-arrow-styles.component.css +112 -0
- package/src/lib/overlay/strategies/overlay-origin-clone.component.css +92 -0
- package/src/lib/overlay/strategies/sheet-styles.component.css +170 -0
- package/src/lib/pagination/page-size-select.component.css +6 -0
- package/src/lib/pagination/pagination.component.css +185 -0
- package/src/lib/picture/picture.component.css +82 -0
- package/src/lib/progress-steps/progress-step.component.css +269 -0
- package/src/lib/progress-steps/progress-steps.component.css +26 -0
- package/src/lib/query-error/query-error.component.css +27 -0
- package/src/lib/scheduler/scheduler-agenda-view.component.css +106 -0
- package/src/lib/scheduler/scheduler-appointment-drag-styles.component.css +59 -0
- package/src/lib/scheduler/scheduler-appointment-styles.component.css +129 -0
- package/src/lib/scheduler/scheduler-edit-color.component.css +16 -0
- package/src/lib/scheduler/scheduler-edit-surface-actions.component.css +14 -0
- package/src/lib/scheduler/scheduler-edit-surface-breadcrumb.component.css +26 -0
- package/src/lib/scheduler/scheduler-edit-surface-children.component.css +57 -0
- package/src/lib/scheduler/scheduler-edit-surface-fields.component.css +11 -0
- package/src/lib/scheduler/scheduler-edit-surface-footer.component.css +7 -0
- package/src/lib/scheduler/scheduler-edit-surface-header.component.css +15 -0
- package/src/lib/scheduler/scheduler-edit-time-range.component.css +11 -0
- package/src/lib/scheduler/scheduler-month-view.component.css +143 -0
- package/src/lib/scheduler/scheduler-time-grid-view.component.css +269 -0
- package/src/lib/scheduler/scheduler.component.css +87 -0
- package/src/lib/scrollable/headless/scrollable-buttons.component.css +223 -0
- package/src/lib/scrollable/headless/scrollable-footer.css +37 -0
- package/src/lib/scrollable/headless/scrollable-masks.component.css +165 -0
- package/src/lib/scrollable/headless/scrollable-navigation.component.css +94 -0
- package/src/lib/scrollable/scrollable.component.css +234 -0
- package/src/lib/scrollbar/scrollbar.component.css +116 -0
- package/src/lib/skeleton/skeleton.component.css +132 -0
- package/src/lib/standings/standings-pick.component.css +208 -0
- package/src/lib/standings/standings.component.css +347 -0
- package/src/lib/stat-tile/stat-tile-sparkline.component.css +49 -0
- package/src/lib/stat-tile/stat-tile.component.css +134 -0
- package/src/lib/stream/consent/stream-consent.component.css +100 -0
- package/src/lib/stream/error/stream-player-error.component.css +101 -0
- package/src/lib/stream/loading/stream-player-loading.component.css +16 -0
- package/src/lib/stream/pip/pip-player.component.css +40 -0
- package/src/lib/stream/pip/pip-slot-placeholder.component.css +68 -0
- package/src/lib/stream/pip/pip-stage-styles.component.css +93 -0
- package/src/lib/stream/pip/pip-window.component.css +221 -0
- package/src/lib/stream/stream-manager-styles.component.css +10 -0
- package/src/lib/stream/stream-overlay-card-styles.component.css +69 -0
- package/src/lib/stream/stream-player-slot-styles.component.css +18 -0
- package/src/lib/table/table-column-chooser.component.css +17 -0
- package/src/lib/table/table-column-menu-trigger.component.css +31 -0
- package/src/lib/table/table-detail-styles.component.css +103 -0
- package/src/lib/table/table-drag-scroll-styles.component.css +18 -0
- package/src/lib/table/table-expander-cell.component.css +64 -0
- package/src/lib/table/table-filter-trigger.component.css +44 -0
- package/src/lib/table/table-group-header-row.component.css +38 -0
- package/src/lib/table/table-inline-edit-styles.component.css +20 -0
- package/src/lib/table/table-page-sticky-header-styles.component.css +77 -0
- package/src/lib/table/table-reorder-overlay.component.css +42 -0
- package/src/lib/table/table-resize-grip.component.css +65 -0
- package/src/lib/table/table-row-box-styles.component.css +268 -0
- package/src/lib/table/table-select-cell.component.css +119 -0
- package/src/lib/table/table-skeleton-rows.component.css +19 -0
- package/src/lib/table/table-sort-priority-styles.component.css +15 -0
- package/src/lib/table/table-sticky-columns-styles.component.css +80 -0
- package/src/lib/table/table-virtual-scroll-styles.component.css +9 -0
- package/src/lib/table/table.component.css +853 -0
- package/src/lib/tabs/nav-tabs/nav-tab-link-styles.component.css +37 -0
- package/src/lib/tabs/tab-bar-styles.component.css +266 -0
- package/src/lib/tabs/tab-scale-styles.component.css +61 -0
- package/src/lib/tabs/tabs/tab-group.component.css +115 -0
- package/src/lib/time-picker/time-picker.component.css +212 -0
- package/src/lib/timeline/timeline-item.component.css +139 -0
- package/src/lib/timeline/timeline.component.css +7 -0
- package/src/lib/toggletip/toggletip.component.css +88 -0
- package/src/lib/toolbar/toolbar.component.css +44 -0
- package/src/lib/tooltip/tooltip.component.css +84 -0
- package/src/lib/tree/tree.component.css +221 -0
- package/types/ethlete-components-testing.d.ts +300 -0
- package/types/ethlete-components.d.ts +37511 -3814
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import iconButtonBase from '../src/lib/button/icon-button.component.css?inline';
|
|
2
|
+
import segmentedButtonGroupBase from '../src/lib/forms/selection-list/segmented-button-group/segmented-button-group.component.css?inline';
|
|
3
|
+
import segmentedButtonBase from '../src/lib/forms/selection-list/segmented-button-group/segmented-button.component.css?inline';
|
|
4
|
+
import { CALENDAR_ICON } from '../src/lib/icon/headless/calendar-icon';
|
|
5
|
+
import { CHEVRON_ICON } from '../src/lib/icon/headless/chevron-icon';
|
|
6
|
+
import iconBase from '../src/lib/icon/headless/icon-styles.component.css?inline';
|
|
7
|
+
import { LOCATION_ICON } from '../src/lib/icon/headless/location-icon';
|
|
8
|
+
import { PLUS_ICON } from '../src/lib/icon/headless/plus-icon';
|
|
9
|
+
import agendaViewBase from '../src/lib/scheduler/scheduler-agenda-view.component.css?inline';
|
|
10
|
+
import appointmentDragBase from '../src/lib/scheduler/scheduler-appointment-drag-styles.component.css?inline';
|
|
11
|
+
import appointmentBase from '../src/lib/scheduler/scheduler-appointment-styles.component.css?inline';
|
|
12
|
+
import monthViewBase from '../src/lib/scheduler/scheduler-month-view.component.css?inline';
|
|
13
|
+
import timeGridViewBase from '../src/lib/scheduler/scheduler-time-grid-view.component.css?inline';
|
|
14
|
+
import schedulerBase from '../src/lib/scheduler/scheduler.component.css?inline';
|
|
15
|
+
import tabScale from '../src/lib/tabs/tab-scale-styles.component.css?inline';
|
|
16
|
+
import { buttonStyles } from './button';
|
|
17
|
+
import { iconMarkup } from './icon';
|
|
18
|
+
|
|
19
|
+
export type SchedulerMockView = 'month' | 'week' | 'day' | 'agenda';
|
|
20
|
+
|
|
21
|
+
export type SchedulerMockAppointment = {
|
|
22
|
+
title: string;
|
|
23
|
+
/** A color theme name the app registers. Left out, the appointment takes the color theme around the scheduler. */
|
|
24
|
+
color?: string;
|
|
25
|
+
/** The time range badge text. Left out, no time range badge (an all-day appointment). */
|
|
26
|
+
timeRange?: string;
|
|
27
|
+
location?: string;
|
|
28
|
+
/** The number of nested appointments, drawn by the chain count badge. */
|
|
29
|
+
chainCount?: number;
|
|
30
|
+
selected?: boolean;
|
|
31
|
+
dragging?: boolean;
|
|
32
|
+
/** A design marker on the appointment button, e.g. `hover` or `focus-visible`. */
|
|
33
|
+
force?: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type SchedulerMockDay = {
|
|
37
|
+
weekday: string;
|
|
38
|
+
date: number;
|
|
39
|
+
/** The full day label the grid cells announce, e.g. `Monday, March 2`. */
|
|
40
|
+
label: string;
|
|
41
|
+
today?: boolean;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type SchedulerMockTimeBlock = SchedulerMockAppointment & {
|
|
45
|
+
/** The column index in the view. */
|
|
46
|
+
day: number;
|
|
47
|
+
/** Start and end in hours, e.g. 9.5 for 9:30. */
|
|
48
|
+
start: number;
|
|
49
|
+
end: number;
|
|
50
|
+
/** Inline offset and size in percent of the column, for overlapping appointments. */
|
|
51
|
+
inlineOffset?: number;
|
|
52
|
+
inlineSize?: number;
|
|
53
|
+
/** The nesting depth below a parent appointment. */
|
|
54
|
+
depth?: number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type SchedulerMockAllDayEntry = SchedulerMockAppointment & {
|
|
58
|
+
day: number;
|
|
59
|
+
/** The number of days the entry spans. */
|
|
60
|
+
span: number;
|
|
61
|
+
row?: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type SchedulerMockTimeGridOptions = {
|
|
65
|
+
days: readonly SchedulerMockDay[];
|
|
66
|
+
/** The first and last hour drawn, as if the scrolling body sat on that window. */
|
|
67
|
+
fromHour: number;
|
|
68
|
+
toHour: number;
|
|
69
|
+
hourLabel: (hour: number) => string;
|
|
70
|
+
blocks?: readonly SchedulerMockTimeBlock[];
|
|
71
|
+
allDay?: readonly SchedulerMockAllDayEntry[];
|
|
72
|
+
/** The current time line: the column and the time in hours. */
|
|
73
|
+
now?: { day: number; time: number };
|
|
74
|
+
/** Non-business time per column, in hours. */
|
|
75
|
+
nonBusiness?: readonly { day: number; from: number; to: number }[];
|
|
76
|
+
/** A design marker on one slot, e.g. `focus-visible`. */
|
|
77
|
+
forcedSlot?: { day: number; hour: number; force: string };
|
|
78
|
+
ariaLabel: string;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type SchedulerMockMonthCell = {
|
|
82
|
+
date: number;
|
|
83
|
+
label: string;
|
|
84
|
+
outsideMonth?: boolean;
|
|
85
|
+
today?: boolean;
|
|
86
|
+
appointments?: readonly SchedulerMockAppointment[];
|
|
87
|
+
/** The number of appointments behind the `+n more` trigger. */
|
|
88
|
+
overflow?: number;
|
|
89
|
+
force?: string;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type SchedulerMockMonthOptions = {
|
|
93
|
+
weekdays: readonly { short: string; long: string }[];
|
|
94
|
+
weeks: readonly (readonly SchedulerMockMonthCell[])[];
|
|
95
|
+
ariaLabel: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type SchedulerMockAgendaRow = SchedulerMockAppointment & {
|
|
99
|
+
/** The tree guides in front of a nested appointment. */
|
|
100
|
+
guides?: readonly ('trunk' | 'branch' | 'last-branch' | 'blank')[];
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type SchedulerMockAgendaOptions = {
|
|
104
|
+
days: readonly (SchedulerMockDay & { month?: string; rows: readonly SchedulerMockAgendaRow[] })[];
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export type SchedulerMockLabels = {
|
|
108
|
+
today: string;
|
|
109
|
+
previous: string;
|
|
110
|
+
next: string;
|
|
111
|
+
addAppointment: string;
|
|
112
|
+
views: Record<SchedulerMockView, string>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export type SchedulerMockOptions = {
|
|
116
|
+
view: SchedulerMockView;
|
|
117
|
+
headerLabel: string;
|
|
118
|
+
/** The rendered view, from `schedulerTimeGrid()`, `schedulerMonth()` or `schedulerAgenda()`. */
|
|
119
|
+
body: string;
|
|
120
|
+
labels?: SchedulerMockLabels;
|
|
121
|
+
/** Draws the add appointment toolbar action. */
|
|
122
|
+
addAction?: boolean;
|
|
123
|
+
/** Extra attributes on the host, e.g. a style or design markers. */
|
|
124
|
+
attributes?: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const DEFAULT_LABELS: SchedulerMockLabels = {
|
|
128
|
+
today: 'Today',
|
|
129
|
+
previous: 'Previous',
|
|
130
|
+
next: 'Next',
|
|
131
|
+
addAppointment: 'Add appointment',
|
|
132
|
+
views: { month: 'Month', week: 'Week', day: 'Day', agenda: 'Agenda' },
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/** The stylesheets the scheduler mocks draw with: the real scheduler, view, appointment, button, icon and segmented button CSS. */
|
|
136
|
+
export const schedulerStyles = /* @__PURE__ */ [
|
|
137
|
+
buttonStyles,
|
|
138
|
+
iconBase,
|
|
139
|
+
iconButtonBase,
|
|
140
|
+
tabScale,
|
|
141
|
+
segmentedButtonGroupBase,
|
|
142
|
+
segmentedButtonBase,
|
|
143
|
+
schedulerBase,
|
|
144
|
+
appointmentBase,
|
|
145
|
+
appointmentDragBase,
|
|
146
|
+
timeGridViewBase,
|
|
147
|
+
monthViewBase,
|
|
148
|
+
agendaViewBase,
|
|
149
|
+
].join('\n');
|
|
150
|
+
|
|
151
|
+
const styled = (css: string) => ` style="${css}"`;
|
|
152
|
+
|
|
153
|
+
const flag = (on: boolean | undefined, name: string) => (on ? ` ${name}=""` : '');
|
|
154
|
+
|
|
155
|
+
const forced = (force: string | undefined) => (force ? ` data-et-force="${force}"` : '');
|
|
156
|
+
|
|
157
|
+
const colored = (color: string | undefined) => (color ? ` et-color--${color}` : '');
|
|
158
|
+
|
|
159
|
+
const badges = (appointment: SchedulerMockAppointment) => {
|
|
160
|
+
const timeRange = appointment.timeRange
|
|
161
|
+
? `<span class="et-scheduler-appointment-time-range">${appointment.timeRange}</span>`
|
|
162
|
+
: '';
|
|
163
|
+
const location = appointment.location
|
|
164
|
+
? `<span class="et-scheduler-appointment-location">${iconMarkup(LOCATION_ICON, 'et-scheduler-appointment-location-icon')}<span class="et-scheduler-appointment-location-text">${appointment.location}</span></span>`
|
|
165
|
+
: '';
|
|
166
|
+
const chainCount = appointment.chainCount
|
|
167
|
+
? `<span class="et-scheduler-appointment-chain-count">${iconMarkup(CHEVRON_ICON, 'et-scheduler-appointment-chain-count-icon')}${appointment.chainCount}</span>`
|
|
168
|
+
: '';
|
|
169
|
+
|
|
170
|
+
return [
|
|
171
|
+
`<et-scheduler-badge-color-dot><span aria-hidden="true" class="et-scheduler-appointment-dot"></span></et-scheduler-badge-color-dot>`,
|
|
172
|
+
`<et-scheduler-badge-title><span class="et-scheduler-appointment-title">${appointment.title}</span></et-scheduler-badge-title>`,
|
|
173
|
+
`<et-scheduler-badge-time-range>${timeRange}</et-scheduler-badge-time-range>`,
|
|
174
|
+
`<et-scheduler-badge-location>${location}</et-scheduler-badge-location>`,
|
|
175
|
+
`<et-scheduler-badge-chain-count>${chainCount}</et-scheduler-badge-chain-count>`,
|
|
176
|
+
].join('');
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const appointmentAttributes = (appointment: SchedulerMockAppointment) =>
|
|
180
|
+
[
|
|
181
|
+
flag(appointment.selected, 'data-selected'),
|
|
182
|
+
' data-draggable=""',
|
|
183
|
+
flag(appointment.dragging, 'data-dragging'),
|
|
184
|
+
` title="${appointment.title}"`,
|
|
185
|
+
forced(appointment.force),
|
|
186
|
+
].join('');
|
|
187
|
+
|
|
188
|
+
const resizeHandles = (className: string) =>
|
|
189
|
+
`<span data-edge="start" aria-hidden="true" class="${className}"></span><span data-edge="end" aria-hidden="true" class="${className}"></span>`;
|
|
190
|
+
|
|
191
|
+
const percent = (hours: number, options: SchedulerMockTimeGridOptions) =>
|
|
192
|
+
((hours - options.fromHour) / (options.toHour - options.fromHour)) * 100;
|
|
193
|
+
|
|
194
|
+
/** Draws an `et-scheduler-time-grid-view` (the week or day grid) with its all-day lane, blocks and current time line, as HTML. */
|
|
195
|
+
export const schedulerTimeGrid = (options: SchedulerMockTimeGridOptions) => {
|
|
196
|
+
const hours = Array.from({ length: options.toHour - options.fromHour }, (_, index) => options.fromHour + index);
|
|
197
|
+
const allDay = options.allDay ?? [];
|
|
198
|
+
const allDayRows = allDay.length ? Math.max(...allDay.map((entry) => (entry.row ?? 0) + 1)) : 0;
|
|
199
|
+
|
|
200
|
+
const header = options.days
|
|
201
|
+
.map(
|
|
202
|
+
(day) =>
|
|
203
|
+
`<div role="columnheader" class="et-scheduler-time-grid-header-day"${flag(day.today, 'data-today')}><span class="et-scheduler-time-grid-header-weekday">${day.weekday}</span><span class="et-scheduler-time-grid-header-date">${day.date}</span></div>`,
|
|
204
|
+
)
|
|
205
|
+
.join('');
|
|
206
|
+
|
|
207
|
+
const allDayLane = allDayRows
|
|
208
|
+
? `<div role="row" class="et-scheduler-time-grid-row et-scheduler-time-grid-all-day"><div role="presentation" class="et-scheduler-time-grid-gutter"></div><div role="presentation" class="et-scheduler-time-grid-all-day-lane"${styled(`--_et-scheduler-time-grid-all-day-row-count: ${allDayRows}`)}>${options.days
|
|
209
|
+
.map((day, dayIndex) => {
|
|
210
|
+
const entries = allDay
|
|
211
|
+
.filter((entry) => entry.day === dayIndex)
|
|
212
|
+
.map(
|
|
213
|
+
(entry) =>
|
|
214
|
+
`<button type="button" tabindex="-1" class="et-scheduler-appointment et-scheduler-time-grid-all-day-entry${colored(entry.color)}"${appointmentAttributes(entry)}${styled(`--_et-scheduler-time-grid-all-day-offset: ${(dayIndex / options.days.length) * 100}; --_et-scheduler-time-grid-all-day-size: ${(entry.span / options.days.length) * 100}; --_et-scheduler-time-grid-all-day-row: ${entry.row ?? 0}`)}>${badges(entry)}${resizeHandles('et-scheduler-time-grid-all-day-resize')}</button>`,
|
|
215
|
+
)
|
|
216
|
+
.join('');
|
|
217
|
+
|
|
218
|
+
return `<div role="gridcell" class="et-scheduler-time-grid-all-day-cell" aria-label="${day.label}, All day" tabindex="-1">${entries}</div>`;
|
|
219
|
+
})
|
|
220
|
+
.join('')}</div></div>`
|
|
221
|
+
: '';
|
|
222
|
+
|
|
223
|
+
const gutter = hours
|
|
224
|
+
.map(
|
|
225
|
+
(hour) =>
|
|
226
|
+
`<div class="et-scheduler-time-grid-hour-row"><span class="et-scheduler-time-grid-hour-label">${options.hourLabel(hour)}</span></div>`,
|
|
227
|
+
)
|
|
228
|
+
.join('');
|
|
229
|
+
|
|
230
|
+
const columns = options.days
|
|
231
|
+
.map((day, dayIndex) => {
|
|
232
|
+
const nonBusiness = (options.nonBusiness ?? [])
|
|
233
|
+
.filter((segment) => segment.day === dayIndex)
|
|
234
|
+
.map(
|
|
235
|
+
(segment) =>
|
|
236
|
+
`<div role="presentation" class="et-scheduler-time-grid-non-business"${styled(`--_et-scheduler-time-grid-block-offset: ${percent(segment.from, options)}; --_et-scheduler-time-grid-block-span: ${percent(segment.to, options) - percent(segment.from, options)}`)}></div>`,
|
|
237
|
+
)
|
|
238
|
+
.join('');
|
|
239
|
+
const now =
|
|
240
|
+
options.now?.day === dayIndex
|
|
241
|
+
? `<div role="presentation" class="et-scheduler-time-grid-now"${styled(`--_et-scheduler-time-grid-now-offset: ${percent(options.now.time, options)}`)}></div>`
|
|
242
|
+
: '';
|
|
243
|
+
const slots = hours
|
|
244
|
+
.map((hour) => {
|
|
245
|
+
const blocks = (options.blocks ?? [])
|
|
246
|
+
.filter((block) => block.day === dayIndex && Math.floor(block.start) === hour)
|
|
247
|
+
.map((block) => {
|
|
248
|
+
const depth = block.depth ?? 0;
|
|
249
|
+
|
|
250
|
+
return `<button type="button" tabindex="-1" class="et-scheduler-time-grid-block${colored(block.color)}"${appointmentAttributes(block)}${flag(depth > 0, 'data-nested')}${styled(`--_et-scheduler-time-grid-block-offset: ${percent(block.start, options)}; --_et-scheduler-time-grid-block-span: ${percent(block.end, options) - percent(block.start, options)}; --_et-scheduler-time-grid-block-inline-offset: ${block.inlineOffset ?? 0}; --_et-scheduler-time-grid-block-inline-size: ${block.inlineSize ?? 100}; --_et-scheduler-time-grid-block-depth: ${depth}`)}>${badges(block)}${resizeHandles('et-scheduler-time-grid-block-resize')}</button>`;
|
|
251
|
+
})
|
|
252
|
+
.join('');
|
|
253
|
+
const slotForce =
|
|
254
|
+
options.forcedSlot?.day === dayIndex && options.forcedSlot.hour === hour
|
|
255
|
+
? forced(options.forcedSlot.force)
|
|
256
|
+
: '';
|
|
257
|
+
|
|
258
|
+
return `<div role="gridcell" class="et-scheduler-time-grid-hour-row et-scheduler-time-grid-slot" aria-label="${day.label}, ${options.hourLabel(hour)}" tabindex="-1"${slotForce}>${blocks}</div>`;
|
|
259
|
+
})
|
|
260
|
+
.join('');
|
|
261
|
+
|
|
262
|
+
return `<div role="presentation" class="et-scheduler-time-grid-day"${flag(day.today, 'data-today')}>${nonBusiness}${now}${slots}</div>`;
|
|
263
|
+
})
|
|
264
|
+
.join('');
|
|
265
|
+
|
|
266
|
+
return [
|
|
267
|
+
`<et-scheduler-time-grid-view role="grid" class="et-scheduler-time-grid-view" aria-label="${options.ariaLabel}">`,
|
|
268
|
+
`<div role="row" class="et-scheduler-time-grid-row et-scheduler-time-grid-header"><div role="presentation" class="et-scheduler-time-grid-gutter"></div><div role="presentation" class="et-scheduler-time-grid-days">${header}</div></div>`,
|
|
269
|
+
allDayLane,
|
|
270
|
+
`<div role="presentation" class="et-scheduler-time-grid-body-wrap"><div role="rowgroup" class="et-scheduler-time-grid-row et-scheduler-time-grid-body et-scrollbar-host">`,
|
|
271
|
+
`<div role="presentation" class="et-scheduler-time-grid-gutter">${gutter}</div>`,
|
|
272
|
+
`<div role="presentation" class="et-scheduler-time-grid-days">${columns}</div>`,
|
|
273
|
+
`</div></div></et-scheduler-time-grid-view>`,
|
|
274
|
+
].join('');
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
/** Draws an `et-scheduler-month-view` grid with its appointments and `+n more` triggers, as HTML. */
|
|
278
|
+
export const schedulerMonth = (options: SchedulerMockMonthOptions) => {
|
|
279
|
+
const weekdays = options.weekdays
|
|
280
|
+
.map(
|
|
281
|
+
(weekday) =>
|
|
282
|
+
`<span aria-label="${weekday.long}" role="columnheader" class="et-scheduler-month-view-weekday">${weekday.short}</span>`,
|
|
283
|
+
)
|
|
284
|
+
.join('');
|
|
285
|
+
|
|
286
|
+
const weeks = options.weeks
|
|
287
|
+
.map((week) => {
|
|
288
|
+
const cells = week
|
|
289
|
+
.map((cell) => {
|
|
290
|
+
const appointments = (cell.appointments ?? [])
|
|
291
|
+
.map(
|
|
292
|
+
(appointment) =>
|
|
293
|
+
`<button type="button" tabindex="-1" class="et-scheduler-appointment${colored(appointment.color)}"${appointmentAttributes(appointment)}>${badges(appointment)}</button>`,
|
|
294
|
+
)
|
|
295
|
+
.join('');
|
|
296
|
+
const overflow = cell.overflow
|
|
297
|
+
? `<div class="et-scheduler-month-view-overflow"><button aria-haspopup="menu" type="button" tabindex="-1" class="et-scheduler-month-view-overflow-trigger" aria-expanded="false">+${cell.overflow} more</button></div>`
|
|
298
|
+
: '';
|
|
299
|
+
|
|
300
|
+
return `<div role="gridcell" class="et-scheduler-month-view-cell"${flag(cell.outsideMonth, 'data-outside-month')}${flag(cell.today, 'data-today')}${cell.today ? ' aria-current="date"' : ''} aria-label="${cell.label}" tabindex="-1"${forced(cell.force)}><span aria-hidden="true" class="et-scheduler-month-view-cell-date">${cell.date}</span><div class="et-scheduler-month-view-cell-appointments">${appointments}${overflow}</div></div>`;
|
|
301
|
+
})
|
|
302
|
+
.join('');
|
|
303
|
+
|
|
304
|
+
return `<div role="row" class="et-scheduler-month-view-week">${cells}</div>`;
|
|
305
|
+
})
|
|
306
|
+
.join('');
|
|
307
|
+
|
|
308
|
+
return `<et-scheduler-month-view role="grid" class="et-scheduler-month-view" aria-label="${options.ariaLabel}"><div role="row" class="et-scheduler-month-view-weekdays">${weekdays}</div><div role="rowgroup" class="et-scheduler-month-view-weeks"><div aria-hidden="true" class="et-scheduler-month-view-draft-anchor"></div>${weeks}</div></et-scheduler-month-view>`;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/** Draws an `et-scheduler-agenda-view` list of days with their appointments and tree guides, as HTML. */
|
|
312
|
+
export const schedulerAgenda = (options: SchedulerMockAgendaOptions) => {
|
|
313
|
+
const days = options.days
|
|
314
|
+
.map((day) => {
|
|
315
|
+
const month = day.month ? `<h3 class="et-scheduler-agenda-view-month">${day.month}</h3>` : '';
|
|
316
|
+
const rows = day.rows
|
|
317
|
+
.map((row) => {
|
|
318
|
+
const guides = (row.guides ?? [])
|
|
319
|
+
.map(
|
|
320
|
+
(guide) =>
|
|
321
|
+
`<span aria-hidden="true" class="et-scheduler-agenda-view-guide" data-guide="${guide}"></span>`,
|
|
322
|
+
)
|
|
323
|
+
.join('');
|
|
324
|
+
|
|
325
|
+
return `<div class="et-scheduler-agenda-view-appointment">${guides}<button type="button" class="et-scheduler-appointment${colored(row.color)}"${flag(row.selected, 'data-selected')}${flag(guides.length > 0, 'data-nested')}${forced(row.force)}>${badges(row)}</button></div>`;
|
|
326
|
+
})
|
|
327
|
+
.join('');
|
|
328
|
+
|
|
329
|
+
return `${month}<div class="et-scheduler-agenda-view-day"><div class="et-scheduler-agenda-view-day-header"${flag(day.today, 'data-today')}><span class="et-scheduler-agenda-view-day-weekday">${day.weekday}</span><span class="et-scheduler-agenda-view-day-date">${day.date}</span></div><div class="et-scheduler-agenda-view-day-appointments">${rows}</div></div>`;
|
|
330
|
+
})
|
|
331
|
+
.join('');
|
|
332
|
+
|
|
333
|
+
return `<et-scheduler-agenda-view class="et-scheduler-agenda-view"><div class="et-scheduler-agenda-view-scroller et-scrollbar-host">${days}</div></et-scheduler-agenda-view>`;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
const BUTTON_CLASSES = 'et-color-interactive';
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Draws an `et-scheduler` with its wide header (today button, toolbar action, previous and next, the range label
|
|
340
|
+
* and the view switch) around a view, as HTML. The visually hidden view switch label and the auto-hiding
|
|
341
|
+
* scrollbar are left out.
|
|
342
|
+
*/
|
|
343
|
+
export const scheduler = (options: SchedulerMockOptions) => {
|
|
344
|
+
const labels = options.labels ?? DEFAULT_LABELS;
|
|
345
|
+
|
|
346
|
+
const today = `<button type="button" class="${BUTTON_CLASSES} et-button et-scheduler-today-button et-focus-ring et-color--inherited" aria-label="${labels.today}" data-icon-alignment="start" data-variant="outline" data-size="sm"><div class="et-button-icon">${iconMarkup(CALENDAR_ICON)}</div><div class="et-button-contents"><span class="et-scheduler-today-button-label">${labels.today}</span></div></button>`;
|
|
347
|
+
const add = options.addAction
|
|
348
|
+
? `<button type="button" class="${BUTTON_CLASSES} et-button et-scheduler-toolbar-action et-focus-ring et-color--inherited" data-icon-alignment="start" data-variant="filled" data-size="sm"><div class="et-button-icon">${iconMarkup(PLUS_ICON)}</div><div class="et-button-contents">${labels.addAppointment}</div></button>`
|
|
349
|
+
: '';
|
|
350
|
+
const navButton = (direction: 'previous' | 'next') =>
|
|
351
|
+
`<button type="button" class="${BUTTON_CLASSES} et-icon-button et-scheduler-nav-button et-scheduler-nav-button--${direction} et-focus-ring et-color--inherited" aria-label="${labels[direction]}" data-variant="transparent" data-size="sm"><div class="et-icon-button-icon">${iconMarkup(CHEVRON_ICON)}</div></button>`;
|
|
352
|
+
const views = (['month', 'week', 'day', 'agenda'] as const)
|
|
353
|
+
.map((view) => {
|
|
354
|
+
const checked = view === options.view;
|
|
355
|
+
|
|
356
|
+
return `<et-segmented-button value="${view}" class="et-color-interactive et-segmented-button" role="radio" aria-checked="${checked}" tabindex="${checked ? 0 : -1}"><div class="et-segmented-button-bg"></div><span class="et-segmented-button-label">${labels.views[view]}</span></et-segmented-button>`;
|
|
357
|
+
})
|
|
358
|
+
.join('');
|
|
359
|
+
|
|
360
|
+
return [
|
|
361
|
+
`<et-scheduler class="et-scheduler" ${options.attributes ?? ''}><div class="et-scheduler-header">`,
|
|
362
|
+
today,
|
|
363
|
+
add,
|
|
364
|
+
`<div class="et-scheduler-nav-buttons">${navButton('previous')}${navButton('next')}</div>`,
|
|
365
|
+
`<span class="et-scheduler-header-label">${options.headerLabel}</span><div class="et-scheduler-header-spacer"></div>`,
|
|
366
|
+
`<et-segmented-button-group class="et-segmented-button-group et-scheduler-view-switch et-color--inherited et-tab-scale" role="radiogroup" data-size="sm" data-variant="tabs"><div class="et-segmented-button-group-buttons">${views}</div></et-segmented-button-group>`,
|
|
367
|
+
`</div><div class="et-scheduler-body">${options.body}</div></et-scheduler>`,
|
|
368
|
+
].join('');
|
|
369
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import iconButtonBase from '../src/lib/button/icon-button.component.css?inline';
|
|
2
|
+
import { CHEVRON_ICON } from '../src/lib/icon/headless/chevron-icon';
|
|
3
|
+
import iconBase from '../src/lib/icon/headless/icon-styles.component.css?inline';
|
|
4
|
+
import buttonsBase from '../src/lib/scrollable/headless/scrollable-buttons.component.css?inline';
|
|
5
|
+
import footerBase from '../src/lib/scrollable/headless/scrollable-footer.css?inline';
|
|
6
|
+
import masksBase from '../src/lib/scrollable/headless/scrollable-masks.component.css?inline';
|
|
7
|
+
import navigationBase from '../src/lib/scrollable/headless/scrollable-navigation.component.css?inline';
|
|
8
|
+
import scrollableBase from '../src/lib/scrollable/scrollable.component.css?inline';
|
|
9
|
+
import { buttonStyles } from './button';
|
|
10
|
+
import { iconMarkup } from './icon';
|
|
11
|
+
|
|
12
|
+
export type ScrollableMockItem = {
|
|
13
|
+
/** The item's inner HTML. */
|
|
14
|
+
content: string;
|
|
15
|
+
/** Extra attributes on the item, e.g. a class, a style or design markers. */
|
|
16
|
+
attributes?: string;
|
|
17
|
+
/** The tag the consumer projects. Left out, `div`. */
|
|
18
|
+
tag?: string;
|
|
19
|
+
/** Draws `et-scrollable-item--not-intersecting`, as `etScrollableDarken` does for an item out of view. */
|
|
20
|
+
notIntersecting?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type ScrollableMockOptions = {
|
|
24
|
+
items: ScrollableMockItem[];
|
|
25
|
+
direction?: 'horizontal' | 'vertical';
|
|
26
|
+
/** Draws `et-scrollable--can-scroll`. Left out, the content overflows. */
|
|
27
|
+
canScroll?: boolean;
|
|
28
|
+
/** The scroll position the directive reads: it decides the start and end classes. Left out, `start`. */
|
|
29
|
+
position?: 'start' | 'middle' | 'end';
|
|
30
|
+
/** Draws `et-scrollable--has-partial-items`. Left out, true while the content can scroll and masks render. */
|
|
31
|
+
partialItems?: boolean;
|
|
32
|
+
/** Left out, the masks render, as `renderMasks` defaults to. */
|
|
33
|
+
renderMasks?: boolean;
|
|
34
|
+
maskVariant?: 'gradient' | 'border';
|
|
35
|
+
/** Where `etScrollableButtons` renders its buttons. Left out, no buttons. */
|
|
36
|
+
buttons?: 'inside' | 'footer';
|
|
37
|
+
stickyButtons?: boolean;
|
|
38
|
+
/** Extra attributes on the start button, e.g. design markers. */
|
|
39
|
+
startButtonAttributes?: string;
|
|
40
|
+
/** Extra attributes on the end button, e.g. design markers. */
|
|
41
|
+
endButtonAttributes?: string;
|
|
42
|
+
/** The dot index `etScrollableNavigation` marks active. Left out, no navigation. */
|
|
43
|
+
navigationActive?: number;
|
|
44
|
+
/** Draws `et-scrollable--darken-non-intersecting-items`, as `etScrollableDarken` does. */
|
|
45
|
+
darken?: boolean;
|
|
46
|
+
/** Draws the `snap` attributes `etScrollableSnap` sets. */
|
|
47
|
+
snap?: boolean;
|
|
48
|
+
/** A color theme name the app registers. Left out, the scrollable takes the color theme around it. */
|
|
49
|
+
color?: string;
|
|
50
|
+
/** The `itemSize` the scrollable lays its items out with. Left out, `auto`. */
|
|
51
|
+
itemSize?: 'auto' | 'same' | 'full' | 'half' | 'third' | 'quarter';
|
|
52
|
+
/** The gap between the items in px, as the directive reads it from the container. Left out, 0. */
|
|
53
|
+
itemGap?: number;
|
|
54
|
+
/** Extra classes on the host, e.g. the class a wrapping component puts on it. */
|
|
55
|
+
class?: string;
|
|
56
|
+
/** Extra attributes on the host, e.g. a style or design markers. */
|
|
57
|
+
attributes?: string;
|
|
58
|
+
/** Extra attributes on the scroll container, e.g. a style that offsets it to a scrolled position. */
|
|
59
|
+
containerAttributes?: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** The stylesheets `scrollable()` draws with: the real scrollable, masks, buttons, navigation and icon-button CSS. */
|
|
63
|
+
export const scrollableStyles = /* @__PURE__ */ [
|
|
64
|
+
buttonStyles,
|
|
65
|
+
iconBase,
|
|
66
|
+
iconButtonBase,
|
|
67
|
+
scrollableBase,
|
|
68
|
+
masksBase,
|
|
69
|
+
buttonsBase,
|
|
70
|
+
navigationBase,
|
|
71
|
+
footerBase,
|
|
72
|
+
].join('\n');
|
|
73
|
+
|
|
74
|
+
type ScrollButtonOptions = { edge: 'start' | 'end'; disabled: boolean; attributes?: string };
|
|
75
|
+
|
|
76
|
+
const scrollButton = ({ edge, disabled, attributes }: ScrollButtonOptions) => {
|
|
77
|
+
const classes = [
|
|
78
|
+
'et-scrollable-button',
|
|
79
|
+
`et-scrollable-button--${edge}`,
|
|
80
|
+
'et-icon-button',
|
|
81
|
+
'et-color-interactive',
|
|
82
|
+
'et-focus-ring',
|
|
83
|
+
'et-color--inherited',
|
|
84
|
+
];
|
|
85
|
+
const host = [
|
|
86
|
+
attributes,
|
|
87
|
+
disabled && 'disabled aria-disabled="true"',
|
|
88
|
+
`class="${classes.join(' ')}"`,
|
|
89
|
+
'aria-hidden="true"',
|
|
90
|
+
'type="button"',
|
|
91
|
+
'tabindex="-1"',
|
|
92
|
+
'data-variant="transparent"',
|
|
93
|
+
'data-size="xs"',
|
|
94
|
+
].filter(Boolean);
|
|
95
|
+
|
|
96
|
+
return `<button ${host.join(' ')}><div class="et-icon-button-icon">${iconMarkup(CHEVRON_ICON)}</div></button>`;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
type NavigationOptions = { count: number; active: number; horizontal: boolean };
|
|
100
|
+
|
|
101
|
+
const navigation = ({ count, active, horizontal }: NavigationOptions) => {
|
|
102
|
+
const offset = count > 5 ? (active < 3 ? 0 : active >= count - 3 ? 5 - count : -(active - 2)) * 20 : 0;
|
|
103
|
+
const dots = Array.from({ length: count }, (_, index) => {
|
|
104
|
+
const distance = Math.abs(index - active);
|
|
105
|
+
const classes = [
|
|
106
|
+
'et-scrollable-navigation-item',
|
|
107
|
+
distance === 0 && 'et-scrollable-navigation-item--active',
|
|
108
|
+
distance === 1 && 'et-scrollable-navigation-item--close',
|
|
109
|
+
distance > 1 && 'et-scrollable-navigation-item--far',
|
|
110
|
+
].filter(Boolean);
|
|
111
|
+
|
|
112
|
+
return `<button active-offset="${distance}" class="${classes.join(' ')}" type="button" tabindex="-1" aria-hidden="true"></button>`;
|
|
113
|
+
}).join('');
|
|
114
|
+
|
|
115
|
+
const container = [
|
|
116
|
+
'class="et-scrollable-dots-container"',
|
|
117
|
+
`style="transform: translate${horizontal ? 'X' : 'Y'}(${offset}px)"`,
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
`<et-scrollable-navigation class="et-scrollable-navigation" aria-hidden="true"><div class="et-scrollable-progress-bar">` +
|
|
122
|
+
`<div ${container.join(' ')}>${dots}</div>` +
|
|
123
|
+
`</div></et-scrollable-navigation>`
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Draws `<et-scrollable>` as HTML: the scroll container with its observer elements and the projected items, the
|
|
129
|
+
* edge masks, and the buttons and navigation dots its feature directives contribute. A scrolled position is
|
|
130
|
+
* drawn by offsetting the container's content statically through `containerAttributes`.
|
|
131
|
+
*/
|
|
132
|
+
export const scrollable = (options: ScrollableMockOptions) => {
|
|
133
|
+
const direction = options.direction ?? 'horizontal';
|
|
134
|
+
const canScroll = options.canScroll ?? true;
|
|
135
|
+
const position = canScroll ? (options.position ?? 'start') : 'start';
|
|
136
|
+
const renderMasks = options.renderMasks ?? true;
|
|
137
|
+
const atStart = !canScroll || position === 'start';
|
|
138
|
+
const atEnd = !canScroll || position === 'end';
|
|
139
|
+
const hasNavigation = options.navigationActive !== undefined;
|
|
140
|
+
|
|
141
|
+
const classes = [
|
|
142
|
+
'et-scrollable',
|
|
143
|
+
`et-color--${options.color ?? 'inherited'}`,
|
|
144
|
+
renderMasks && 'et-scrollable--masked',
|
|
145
|
+
canScroll && 'et-scrollable--can-scroll',
|
|
146
|
+
atStart && 'et-scrollable--is-at-start',
|
|
147
|
+
atEnd && 'et-scrollable--is-at-end',
|
|
148
|
+
(options.partialItems ?? (canScroll && renderMasks)) && 'et-scrollable--has-partial-items',
|
|
149
|
+
options.darken && 'et-scrollable--darken-non-intersecting-items',
|
|
150
|
+
options.stickyButtons && options.buttons === 'inside' && 'et-scrollable--sticky-buttons',
|
|
151
|
+
options.class,
|
|
152
|
+
].filter(Boolean);
|
|
153
|
+
|
|
154
|
+
const host = [
|
|
155
|
+
options.attributes,
|
|
156
|
+
`class="${classes.join(' ')}"`,
|
|
157
|
+
`item-size="${options.itemSize ?? 'auto'}"`,
|
|
158
|
+
`direction="${direction}"`,
|
|
159
|
+
options.snap && 'snap="" snap-origin="auto"',
|
|
160
|
+
`mask-variant="${options.maskVariant ?? 'gradient'}"`,
|
|
161
|
+
`style="--item-count: ${options.items.length}; --item-gap: ${options.itemGap ?? 0}px; --_et-scrollable-scroll-margin: 0px"`,
|
|
162
|
+
].filter(Boolean);
|
|
163
|
+
|
|
164
|
+
const itemMarkup = options.items
|
|
165
|
+
.map((item) => {
|
|
166
|
+
const tag = item.tag ?? 'div';
|
|
167
|
+
const itemClasses = ['et-scrollable-item', item.notIntersecting && 'et-scrollable-item--not-intersecting'].filter(
|
|
168
|
+
Boolean,
|
|
169
|
+
);
|
|
170
|
+
const attributes = item.attributes ?? '';
|
|
171
|
+
const merged = /\bclass="/.test(attributes)
|
|
172
|
+
? attributes.replace(/\bclass="/, `class="${itemClasses.join(' ')} `)
|
|
173
|
+
: `${attributes} class="${itemClasses.join(' ')}"`;
|
|
174
|
+
|
|
175
|
+
return `<${tag} ${merged.trim()}>${item.content}</${tag}>`;
|
|
176
|
+
})
|
|
177
|
+
.join('');
|
|
178
|
+
|
|
179
|
+
const buttons = (slot: 'overlay' | 'footer') =>
|
|
180
|
+
`<et-scrollable-buttons class="et-scrollable-buttons et-scrollable-buttons--${slot === 'footer' ? 'footer' : 'inside'}">` +
|
|
181
|
+
scrollButton({ edge: 'start', disabled: atStart, attributes: options.startButtonAttributes }) +
|
|
182
|
+
scrollButton({ edge: 'end', disabled: atEnd, attributes: options.endButtonAttributes }) +
|
|
183
|
+
`</et-scrollable-buttons>`;
|
|
184
|
+
|
|
185
|
+
const footerParts = [
|
|
186
|
+
options.buttons === 'footer' && buttons('footer'),
|
|
187
|
+
hasNavigation &&
|
|
188
|
+
navigation({
|
|
189
|
+
count: options.items.length,
|
|
190
|
+
active: options.navigationActive ?? 0,
|
|
191
|
+
horizontal: direction === 'horizontal',
|
|
192
|
+
}),
|
|
193
|
+
].filter(Boolean);
|
|
194
|
+
|
|
195
|
+
const footerClasses = [
|
|
196
|
+
'et-scrollable-footer',
|
|
197
|
+
hasNavigation && 'et-scrollable-footer--with-navigation',
|
|
198
|
+
options.buttons === 'footer' && 'et-scrollable-footer--with-buttons',
|
|
199
|
+
].filter(Boolean);
|
|
200
|
+
|
|
201
|
+
const footer =
|
|
202
|
+
footerParts.length && canScroll
|
|
203
|
+
? `<div class="${footerClasses.join(' ')}" aria-hidden="true">${footerParts.join('')}</div>`
|
|
204
|
+
: '';
|
|
205
|
+
|
|
206
|
+
return (
|
|
207
|
+
`<et-scrollable ${host.join(' ')}><div class="et-scrollable-wrapper" role="presentation">` +
|
|
208
|
+
`<div class="et-scrollable-container" ${options.containerAttributes ?? ''}>` +
|
|
209
|
+
`<div class="et-scroll-observer-first-element" etscrollableignorechild=""></div>` +
|
|
210
|
+
itemMarkup +
|
|
211
|
+
`<div class="et-scroll-observer-last-element" etscrollableignorechild=""></div>` +
|
|
212
|
+
`</div>` +
|
|
213
|
+
(renderMasks
|
|
214
|
+
? `<et-scrollable-masks class="et-scrollable-masks"><div class="et-scrollable-mask et-scrollable-mask--start"></div><div class="et-scrollable-mask et-scrollable-mask--end"></div></et-scrollable-masks>`
|
|
215
|
+
: '') +
|
|
216
|
+
(options.buttons === 'inside' ? buttons('overlay') : '') +
|
|
217
|
+
`</div>${footer}</et-scrollable>`
|
|
218
|
+
);
|
|
219
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import scrollbarBase from '../src/lib/scrollbar/scrollbar.component.css?inline';
|
|
2
|
+
|
|
3
|
+
export type ScrollbarMockOptions = {
|
|
4
|
+
orientation?: 'vertical' | 'horizontal';
|
|
5
|
+
/** The thumb length in px, as the directive computes it from the container's scroll size. */
|
|
6
|
+
thumbSize: number;
|
|
7
|
+
/** The thumb distance from the track start in px, as the directive computes it from the scroll position. */
|
|
8
|
+
thumbOffset?: number;
|
|
9
|
+
/** Draws the `et-scrollbar--visible` class. Left out, visible, as without `autoHide`. */
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
/** Draws the `et-scrollbar--dragging` class, as while the thumb is held. */
|
|
12
|
+
dragging?: boolean;
|
|
13
|
+
/** Draws the host's `data-direction="rtl"`, read off a right-to-left container. */
|
|
14
|
+
rtl?: boolean;
|
|
15
|
+
/** Extra attributes on the host, e.g. a style or design markers. */
|
|
16
|
+
attributes?: string;
|
|
17
|
+
/** Extra attributes on the thumb, e.g. design markers. */
|
|
18
|
+
thumbAttributes?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** The stylesheets `scrollbar()` draws with: the real scrollbar CSS. */
|
|
22
|
+
export const scrollbarStyles = /* @__PURE__ */ [scrollbarBase].join('\n');
|
|
23
|
+
|
|
24
|
+
/** The class the directive puts on the scroll container to hide its native scrollbar. */
|
|
25
|
+
export const scrollbarHostClass = 'et-scrollbar-host';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Draws `<et-scrollbar>` as HTML: the track over the end edge of its positioned wrapper and the thumb at the given
|
|
29
|
+
* size and offset. Place it next to a container with `scrollbarHostClass` inside a `position: relative` wrapper.
|
|
30
|
+
*/
|
|
31
|
+
export const scrollbar = (options: ScrollbarMockOptions) => {
|
|
32
|
+
const classes = [
|
|
33
|
+
'et-scrollbar',
|
|
34
|
+
(options.visible ?? true) && 'et-scrollbar--visible',
|
|
35
|
+
options.dragging && 'et-scrollbar--dragging',
|
|
36
|
+
].filter(Boolean);
|
|
37
|
+
const host = [
|
|
38
|
+
options.attributes,
|
|
39
|
+
`class="${classes.join(' ')}"`,
|
|
40
|
+
`data-orientation="${options.orientation ?? 'vertical'}"`,
|
|
41
|
+
options.rtl && 'data-direction="rtl"',
|
|
42
|
+
`style="--_et-scrollbar-thumb-size: ${options.thumbSize}px; --_et-scrollbar-thumb-offset: ${options.thumbOffset ?? 0}px"`,
|
|
43
|
+
].filter(Boolean);
|
|
44
|
+
const thumb = [options.thumbAttributes, 'class="et-scrollbar-thumb"', 'etscrollbarthumb=""'].filter(Boolean);
|
|
45
|
+
|
|
46
|
+
return `<et-scrollbar ${host.join(' ')}><div ${thumb.join(' ')}></div></et-scrollbar>`;
|
|
47
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" width="800" height="450" viewBox="0 0 800 450"><rect width="100%" height="100%" fill="#ffd000"/><text x="50%" y="50%" fill="#000" font-family="sans-serif" font-size="24" text-anchor="middle" dominant-baseline="middle">fallback</text></svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" width="450" height="600" viewBox="0 0 450 600"><rect width="100%" height="100%" fill="#00d0ff"/><text x="50%" y="50%" fill="#000" font-family="sans-serif" font-size="24" text-anchor="middle" dominant-baseline="middle">tall 3:4</text></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" width="800" height="450" viewBox="0 0 800 450"><rect width="100%" height="100%" fill="#00ffa1"/><text x="50%" y="50%" fill="#000" font-family="sans-serif" font-size="24" text-anchor="middle" dominant-baseline="middle">wide 16:9</text></svg>
|