@ethlete/components 0.1.0-next.9 → 1.0.0-next.100
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 +3480 -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 +145 -0
- package/design/button.ts +118 -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 +216 -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 +147 -0
- package/design/notification.ts +133 -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 +129 -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 +59 -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 +29 -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 +57 -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 +25 -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 +33 -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 +55 -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 +52 -0
- package/design/sdk/components/slider/slider.ts +133 -0
- package/design/sdk/components/standings/standings.css +33 -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 +48 -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 +99 -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 +660 -0
- package/design/sdk/foundations/colors/colors.ts +216 -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 +101 -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 +593 -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/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 +115320 -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 +116 -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-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-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 +193 -0
- package/package.json +47 -17
- package/src/lib/accordion/accordion-group.component.css +12 -0
- package/src/lib/accordion/accordion.component.css +237 -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 +114 -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-styles.component.css +10 -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 +127 -0
- package/src/lib/button/button-properties-styles.component.css +195 -0
- package/src/lib/button/button.component.css +242 -0
- package/src/lib/button/button.types.ts +33 -0
- package/src/lib/button/fab.component.css +260 -0
- package/src/lib/button/icon-button.component.css +156 -0
- package/src/lib/button/split-button.component.css +106 -0
- package/src/lib/button/text-button.component.css +142 -0
- package/src/lib/button/window-control-button.component.css +225 -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 +376 -0
- package/src/lib/card/card.component.css +43 -0
- package/src/lib/carousel/carousel-autoplay-styles.component.css +177 -0
- package/src/lib/carousel/carousel-transition-styles.component.css +179 -0
- package/src/lib/carousel/carousel.component.css +232 -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 +163 -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 +387 -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 +291 -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 +110 -0
- package/src/lib/forms/color-input/color-picker-panel.component.css +353 -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 +115 -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 +293 -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 +176 -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 +409 -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 +382 -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 +104 -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 +104 -0
- package/src/lib/forms/otp-input/otp-input.component.css +222 -0
- package/src/lib/forms/phone-input/phone-input.component.css +127 -0
- package/src/lib/forms/rating/rating.component.css +198 -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 +92 -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 +203 -0
- package/src/lib/forms/rich-text-editor/rich-text-editor.component.css +177 -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 +149 -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 +119 -0
- package/src/lib/forms/select/select.component.css +247 -0
- package/src/lib/forms/selection-card-styles.component.css +148 -0
- package/src/lib/forms/selection-list/checkbox-group/checkbox-group-select-all.component.css +108 -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 +172 -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 +154 -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 +199 -0
- package/src/lib/forms/slider/range-slider.component.css +440 -0
- package/src/lib/forms/slider/slider.component.css +434 -0
- package/src/lib/forms/switch/switch.component.css +217 -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 +177 -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 +556 -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 +307 -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 +170 -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 +186 -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 +56 -0
- package/src/lib/scheduler/scheduler-appointment-styles.component.css +127 -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 +145 -0
- package/src/lib/scheduler/scheduler-time-grid-view.component.css +271 -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 +138 -0
- package/src/lib/standings/standings-pick.component.css +216 -0
- package/src/lib/standings/standings.component.css +353 -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 +96 -0
- package/src/lib/stream/pip/pip-window.component.css +222 -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 +66 -0
- package/src/lib/table/table-row-box-styles.component.css +272 -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 +865 -0
- package/src/lib/tabs/nav-tabs/nav-tab-link-styles.component.css +37 -0
- package/src/lib/tabs/tab-bar-styles.component.css +230 -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 +221 -0
- package/src/lib/timeline/timeline-item.component.css +142 -0
- package/src/lib/timeline/timeline.component.css +7 -0
- package/src/lib/toggletip/toggletip.component.css +83 -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 +37454 -3814
package/design/dialog.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import iconButtonBase from '../src/lib/button/icon-button.component.css?inline';
|
|
2
|
+
import { TIMES_ICON } from '../src/lib/icon/headless/times-icon';
|
|
3
|
+
import iconBase from '../src/lib/icon/headless/icon-styles.component.css?inline';
|
|
4
|
+
import alertDialogBase from '../src/lib/overlay/alert-dialog/alert-dialog.component.css?inline';
|
|
5
|
+
import overlayContainer from '../src/lib/overlay/overlay-container.component.css?inline';
|
|
6
|
+
import overlayMain from '../src/lib/overlay/overlay-main-styles.component.css?inline';
|
|
7
|
+
import dialogStrategy from '../src/lib/overlay/strategies/dialog-styles.component.css?inline';
|
|
8
|
+
import { button, buttonStyles } from './button';
|
|
9
|
+
import { iconMarkup } from './icon';
|
|
10
|
+
|
|
11
|
+
export type DialogMockButton = {
|
|
12
|
+
label: string;
|
|
13
|
+
variant?: 'filled' | 'outline' | 'tonal' | 'transparent';
|
|
14
|
+
/** A color theme name the app registers. Left out, the button takes the dialog's color theme. */
|
|
15
|
+
color?: string;
|
|
16
|
+
/** Extra attributes on the button, e.g. design markers. */
|
|
17
|
+
attributes?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type DialogMockOptions = {
|
|
21
|
+
/** The title, as HTML. */
|
|
22
|
+
title: string;
|
|
23
|
+
/** The body content, as HTML. */
|
|
24
|
+
body: string;
|
|
25
|
+
/** The footer buttons, in order. Leave it out for a dialog without a footer. */
|
|
26
|
+
actions?: DialogMockButton[];
|
|
27
|
+
/** Draws an `et-icon-button` with `etOverlayClose` in the header; the string adds attributes to it. */
|
|
28
|
+
close?: boolean | string;
|
|
29
|
+
/** As the body's `dividers` input. `dynamic` draws the body scrolled to its start. */
|
|
30
|
+
dividers?: false | 'static' | 'dynamic';
|
|
31
|
+
/** A surface theme name the app registers, for the pane. Left out, the pane takes the surface one elevation above its parent. */
|
|
32
|
+
surface?: string;
|
|
33
|
+
/** Extra attributes on the pane, e.g. design markers. */
|
|
34
|
+
attributes?: string;
|
|
35
|
+
/** Unique per frame: the title id derives from it. */
|
|
36
|
+
id?: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type AlertDialogMockOptions = {
|
|
40
|
+
kind: 'alert' | 'confirm';
|
|
41
|
+
title: string;
|
|
42
|
+
message?: string;
|
|
43
|
+
/** The confirm button's color theme name, as `confirmColor` sets it. */
|
|
44
|
+
confirmColor?: string;
|
|
45
|
+
confirmLabel?: string;
|
|
46
|
+
cancelLabel?: string;
|
|
47
|
+
acknowledgeLabel?: string;
|
|
48
|
+
/** Extra attributes on the confirm (or acknowledge) button. */
|
|
49
|
+
confirmAttributes?: string;
|
|
50
|
+
/** Extra attributes on the cancel button. */
|
|
51
|
+
cancelAttributes?: string;
|
|
52
|
+
/** A surface theme name the app registers, for the pane. Left out, the pane takes the surface one elevation above its parent. */
|
|
53
|
+
surface?: string;
|
|
54
|
+
attributes?: string;
|
|
55
|
+
id?: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** The stylesheets `dialog()` and `alertDialog()` draw with: the real overlay pane, dialog, button and icon button CSS. */
|
|
59
|
+
export const dialogStyles = /* @__PURE__ */ [
|
|
60
|
+
buttonStyles,
|
|
61
|
+
iconBase,
|
|
62
|
+
iconButtonBase,
|
|
63
|
+
overlayContainer,
|
|
64
|
+
overlayMain,
|
|
65
|
+
dialogStrategy,
|
|
66
|
+
alertDialogBase,
|
|
67
|
+
`@layer components.sdk {
|
|
68
|
+
.et-dialog-mock-header {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
gap: 1.2rem;
|
|
73
|
+
}
|
|
74
|
+
.et-dialog-mock-title {
|
|
75
|
+
margin: 0;
|
|
76
|
+
font-size: 1.8rem;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
}
|
|
79
|
+
.et-dialog-mock-actions {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-wrap: wrap;
|
|
82
|
+
justify-content: flex-end;
|
|
83
|
+
gap: 0.8rem;
|
|
84
|
+
}
|
|
85
|
+
.et-dialog-mock-scene {
|
|
86
|
+
position: relative;
|
|
87
|
+
display: grid;
|
|
88
|
+
place-items: center;
|
|
89
|
+
padding: 4rem 2.4rem;
|
|
90
|
+
}
|
|
91
|
+
.et-dialog-mock-scene > .et-overlay-runtime-backdrop {
|
|
92
|
+
position: absolute;
|
|
93
|
+
inset: 0;
|
|
94
|
+
}
|
|
95
|
+
}`,
|
|
96
|
+
].join('\n');
|
|
97
|
+
|
|
98
|
+
const footerButton = (action: DialogMockButton) => {
|
|
99
|
+
const markup = button({ label: action.label, variant: action.variant ?? 'filled', color: action.color, size: 'md' });
|
|
100
|
+
|
|
101
|
+
return action.attributes ? markup.replace(/^<button /, `<button ${action.attributes} `) : markup;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const closeButton = (attributes?: string) => {
|
|
105
|
+
const classes = [
|
|
106
|
+
'et-surface-interactive',
|
|
107
|
+
'et-color-interactive',
|
|
108
|
+
'et-icon-button',
|
|
109
|
+
'et-focus-ring',
|
|
110
|
+
'et-color--inherited',
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
return `<button ${attributes ?? ''} etOverlayClose type="button" aria-label="Close" class="${classes.join(' ')}" data-variant="transparent" data-size="sm"><div class="et-icon-button-icon">${iconMarkup(TIMES_ICON)}</div></button>`;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const pane = (
|
|
117
|
+
options: { surface?: string; attributes?: string; role: string; labelledBy: string; describedBy?: string },
|
|
118
|
+
content: string,
|
|
119
|
+
) => {
|
|
120
|
+
const classes = [
|
|
121
|
+
'et-overlay',
|
|
122
|
+
'et-overlay-runtime-pane',
|
|
123
|
+
'et-overlay--dialog',
|
|
124
|
+
'et-color--inherited',
|
|
125
|
+
options.surface && `et-surface--${options.surface}`,
|
|
126
|
+
'et-with-default-animation',
|
|
127
|
+
'et-animation-enter-done',
|
|
128
|
+
].filter(Boolean);
|
|
129
|
+
const attributes = [
|
|
130
|
+
options.attributes,
|
|
131
|
+
!options.surface && 'data-et-auto-surface',
|
|
132
|
+
`role="${options.role}"`,
|
|
133
|
+
'aria-modal="true"',
|
|
134
|
+
'tabindex="-1"',
|
|
135
|
+
`aria-labelledby="${options.labelledBy}"`,
|
|
136
|
+
options.describedBy && `aria-describedby="${options.describedBy}"`,
|
|
137
|
+
`class="${classes.join(' ')}"`,
|
|
138
|
+
].filter(Boolean);
|
|
139
|
+
|
|
140
|
+
return `<et-overlay-container ${attributes.join(' ')}>${content}</et-overlay-container>`;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const body = (content: string, dividers: DialogMockOptions['dividers'] = false) => {
|
|
144
|
+
const classes = [
|
|
145
|
+
'et-overlay-body',
|
|
146
|
+
dividers && 'et-overlay-body--render-dividers',
|
|
147
|
+
dividers === 'dynamic' && 'et-overlay-body--dynamic-dividers',
|
|
148
|
+
dividers === 'dynamic' && 'et-scrollable-body--can-scroll',
|
|
149
|
+
dividers === 'dynamic' && 'et-scrollable-body--is-at-start',
|
|
150
|
+
].filter(Boolean);
|
|
151
|
+
|
|
152
|
+
return `<div class="${classes.join(' ')}"><div class="et-overlay-body-container"><div class="et-overlay-body-start-element"></div>${content}<div class="et-overlay-body-end-element"></div></div></div>`;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Draws an open dialog pane (`dialogOverlayStrategy`) with an `et-overlay-main` of header, body and
|
|
157
|
+
* footer, as HTML. The pane sits in flow; wrap it in `overlayBackdrop()` to draw the scrim.
|
|
158
|
+
*/
|
|
159
|
+
export const dialog = (options: DialogMockOptions) => {
|
|
160
|
+
const titleId = `et-overlay-title-${options.id ?? 'dialog'}`;
|
|
161
|
+
const close = options.close ? closeButton(typeof options.close === 'string' ? options.close : undefined) : '';
|
|
162
|
+
const header = `<div class="et-overlay-header et-dialog-mock-header"><h2 class="et-dialog-mock-title" id="${titleId}" et-overlay-title>${options.title}</h2>${close}</div>`;
|
|
163
|
+
const footer = options.actions
|
|
164
|
+
? `<div class="et-overlay-footer et-dialog-mock-actions">${options.actions.map(footerButton).join('')}</div>`
|
|
165
|
+
: '';
|
|
166
|
+
|
|
167
|
+
return pane(
|
|
168
|
+
{ surface: options.surface, attributes: options.attributes, role: 'dialog', labelledBy: titleId },
|
|
169
|
+
`<et-overlay-main class="et-overlay-main">${header}${body(options.body, options.dividers)}${footer}</et-overlay-main>`,
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/** Draws the open `et-alert-dialog` from `injectAlertDialog()` in its dialog pane, as HTML. */
|
|
174
|
+
export const alertDialog = (options: AlertDialogMockOptions) => {
|
|
175
|
+
const id = options.id ?? 'alert';
|
|
176
|
+
const titleId = `et-overlay-title-${id}`;
|
|
177
|
+
const messageId = `et-alert-dialog-message-${id}`;
|
|
178
|
+
const actions =
|
|
179
|
+
options.kind === 'confirm'
|
|
180
|
+
? [
|
|
181
|
+
footerButton({
|
|
182
|
+
label: options.cancelLabel ?? 'Cancel',
|
|
183
|
+
variant: 'outline',
|
|
184
|
+
attributes: ['data-et-alert-dialog-initial-focus', options.cancelAttributes].filter(Boolean).join(' '),
|
|
185
|
+
}),
|
|
186
|
+
footerButton({
|
|
187
|
+
label: options.confirmLabel ?? 'Confirm',
|
|
188
|
+
color: options.confirmColor,
|
|
189
|
+
attributes: options.confirmAttributes,
|
|
190
|
+
}),
|
|
191
|
+
]
|
|
192
|
+
: [
|
|
193
|
+
footerButton({
|
|
194
|
+
label: options.acknowledgeLabel ?? 'OK',
|
|
195
|
+
attributes: ['data-et-alert-dialog-initial-focus', options.confirmAttributes].filter(Boolean).join(' '),
|
|
196
|
+
}),
|
|
197
|
+
];
|
|
198
|
+
const message = options.message
|
|
199
|
+
? body(`<p id="${messageId}" class="et-alert-dialog-message">${options.message}</p>`)
|
|
200
|
+
: '';
|
|
201
|
+
|
|
202
|
+
return pane(
|
|
203
|
+
{
|
|
204
|
+
surface: options.surface,
|
|
205
|
+
attributes: options.attributes,
|
|
206
|
+
role: 'alertdialog',
|
|
207
|
+
labelledBy: titleId,
|
|
208
|
+
describedBy: options.message ? messageId : undefined,
|
|
209
|
+
},
|
|
210
|
+
`<et-alert-dialog class="et-alert-dialog et-overlay-main" data-kind="${options.kind}"><div class="et-overlay-header"><h2 class="et-alert-dialog-title" id="${titleId}" et-overlay-title>${options.title}</h2></div>${message}<div class="et-alert-dialog-actions et-overlay-footer">${actions.join('')}</div></et-alert-dialog>`,
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/** Draws the visible `et-overlay-runtime-backdrop` behind `content`, both in flow. */
|
|
215
|
+
export const overlayBackdrop = (content: string) =>
|
|
216
|
+
`<div class="et-dialog-mock-scene"><div class="et-overlay-runtime-backdrop et-overlay-backdrop--visible"></div>${content}</div>`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import dividerBase from '../src/lib/divider/divider.component.css?inline';
|
|
2
|
+
|
|
3
|
+
export type DividerMockOptions = {
|
|
4
|
+
orientation?: 'horizontal' | 'vertical';
|
|
5
|
+
/** Draws the divider as `decorative`: no separator role, hidden from assistive tech. */
|
|
6
|
+
decorative?: boolean;
|
|
7
|
+
/** Extra attributes on the divider, e.g. design markers. */
|
|
8
|
+
attributes?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** The stylesheets `divider()` draws with: the real divider CSS. */
|
|
12
|
+
export const dividerStyles = /* @__PURE__ */ [dividerBase].join('\n');
|
|
13
|
+
|
|
14
|
+
/** Draws an `et-divider` as the component renders it, as HTML. */
|
|
15
|
+
export const divider = (options: DividerMockOptions = {}) => {
|
|
16
|
+
const orientation = options.orientation ?? 'horizontal';
|
|
17
|
+
const attributes = [
|
|
18
|
+
options.attributes,
|
|
19
|
+
'class="et-divider"',
|
|
20
|
+
`data-orientation="${orientation}"`,
|
|
21
|
+
options.decorative ? 'role="presentation"' : 'role="separator"',
|
|
22
|
+
!options.decorative && `aria-orientation="${orientation}"`,
|
|
23
|
+
options.decorative && 'aria-hidden="true"',
|
|
24
|
+
].filter(Boolean);
|
|
25
|
+
|
|
26
|
+
return `<et-divider ${attributes.join(' ')}></et-divider>`;
|
|
27
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import emptyStateBase from '../src/lib/empty-state/empty-state.component.css?inline';
|
|
2
|
+
import { FILE_ICON } from '../src/lib/icon/headless/file-icon';
|
|
3
|
+
import iconBase from '../src/lib/icon/headless/icon-styles.component.css?inline';
|
|
4
|
+
import { TRIANGLE_EXCLAMATION_ICON } from '../src/lib/icon/headless/triangle-exclamation-icon';
|
|
5
|
+
import { button, ButtonMockOptions, buttonStyles } from './button';
|
|
6
|
+
import { iconMarkup } from './icon';
|
|
7
|
+
|
|
8
|
+
export type EmptyStateMockOptions = {
|
|
9
|
+
heading?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
/** The projected `[etIcon]`. Left out, the file icon; `false` draws none. */
|
|
12
|
+
icon?: 'file' | 'triangle' | false;
|
|
13
|
+
/** The label of a projected `et-button etEmptyStateAction`. Left out, no action. */
|
|
14
|
+
action?: string;
|
|
15
|
+
/** The action's button variant. Left out, `filled`, as `et-button` defaults to. */
|
|
16
|
+
actionVariant?: ButtonMockOptions['variant'];
|
|
17
|
+
/** Extra attributes on the action button, e.g. design markers. */
|
|
18
|
+
actionAttributes?: string;
|
|
19
|
+
/** Extra attributes on the empty state, e.g. design markers. */
|
|
20
|
+
attributes?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const ICONS = {
|
|
24
|
+
file: FILE_ICON,
|
|
25
|
+
triangle: TRIANGLE_EXCLAMATION_ICON,
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
/** The stylesheets `emptyState()` draws with: the real empty-state, button and icon CSS. */
|
|
29
|
+
export const emptyStateStyles = /* @__PURE__ */ [buttonStyles, iconBase, emptyStateBase].join('\n');
|
|
30
|
+
|
|
31
|
+
/** Draws an `et-empty-state` with its projected icon and action as the component renders it, as HTML. */
|
|
32
|
+
export const emptyState = (options: EmptyStateMockOptions) => {
|
|
33
|
+
const icon = options.icon === false ? '' : iconMarkup(ICONS[options.icon ?? 'file']);
|
|
34
|
+
const heading = options.heading ? `<p class="et-empty-state-title">${options.heading}</p>` : '';
|
|
35
|
+
const description = options.description ? `<p class="et-empty-state-description">${options.description}</p>` : '';
|
|
36
|
+
const action = options.action
|
|
37
|
+
? button({ label: options.action, variant: options.actionVariant }).replace(
|
|
38
|
+
/^<button /,
|
|
39
|
+
`<button ${options.actionAttributes ?? ''} etEmptyStateAction `,
|
|
40
|
+
)
|
|
41
|
+
: '';
|
|
42
|
+
const attributes = [options.attributes, 'class="et-empty-state"'].filter(Boolean);
|
|
43
|
+
|
|
44
|
+
return `<et-empty-state ${attributes.join(' ')}>${icon}${heading}${description}${action}</et-empty-state>`;
|
|
45
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import floatingActionBase from '../src/lib/floating-action/floating-action-styles.component.css?inline';
|
|
2
|
+
import { FILTER_ICON } from '../src/lib/icon/headless/filter-icon';
|
|
3
|
+
import iconBase from '../src/lib/icon/headless/icon-styles.component.css?inline';
|
|
4
|
+
import { button, buttonStyles, ButtonMockOptions } from './button';
|
|
5
|
+
import { iconMarkup } from './icon';
|
|
6
|
+
|
|
7
|
+
export type FloatingActionMockOptions = {
|
|
8
|
+
/** The trigger, drawn as an `et-button`. */
|
|
9
|
+
trigger: ButtonMockOptions;
|
|
10
|
+
/** Draws the filter icon in the trigger, as the story's Filter button could carry. */
|
|
11
|
+
filterIcon?: boolean;
|
|
12
|
+
/** Where the trigger is. Left out, `inline`. */
|
|
13
|
+
state?: 'inline' | 'floating' | 'hidden';
|
|
14
|
+
/** The in-flow size the anchor holds while the trigger is out of the flow, in px. */
|
|
15
|
+
heldSize?: { inlineSize: number; blockSize: number };
|
|
16
|
+
/** Extra attributes on the trigger, e.g. design markers. */
|
|
17
|
+
triggerAttributes?: string;
|
|
18
|
+
/** Content before the anchor, as HTML. */
|
|
19
|
+
before?: string;
|
|
20
|
+
/** The region the trigger acts on (`etFloatingActionScope`), as HTML. Left out, no scope. */
|
|
21
|
+
scope?: string;
|
|
22
|
+
/** Content after the scope, as HTML. */
|
|
23
|
+
after?: string;
|
|
24
|
+
/** Extra attributes on the host, e.g. a style or design markers. */
|
|
25
|
+
attributes?: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** The stylesheets `floatingAction()` draws with: the real floating-action, button and icon CSS. */
|
|
29
|
+
export const floatingActionStyles = /* @__PURE__ */ [buttonStyles, iconBase, floatingActionBase].join('\n');
|
|
30
|
+
|
|
31
|
+
/** Draws `[etFloatingAction]` with its anchor, trigger and scope as a static snapshot of one state. */
|
|
32
|
+
export const floatingAction = (options: FloatingActionMockOptions) => {
|
|
33
|
+
const { state = 'inline', heldSize } = options;
|
|
34
|
+
const trigger = button({
|
|
35
|
+
...options.trigger,
|
|
36
|
+
icon: options.filterIcon ? iconMarkup(FILTER_ICON) : options.trigger.icon,
|
|
37
|
+
class: ['et-floating-action-trigger', options.trigger.class].filter(Boolean).join(' '),
|
|
38
|
+
style: [state !== 'inline' && 'animation: none; transition: none', options.trigger.style]
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join('; '),
|
|
41
|
+
}).replace(
|
|
42
|
+
/^<(button|a) /,
|
|
43
|
+
`<$1 ${[options.triggerAttributes, `data-floating-action-state="${state}"`].filter(Boolean).join(' ')} `,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const held =
|
|
47
|
+
state !== 'inline' && heldSize
|
|
48
|
+
? ` style="min-inline-size: ${heldSize.inlineSize}px; min-block-size: ${heldSize.blockSize}px"`
|
|
49
|
+
: '';
|
|
50
|
+
const anchor = `<div class="et-floating-action-anchor"${held}>${trigger}</div>`;
|
|
51
|
+
const scope = options.scope === undefined ? '' : `<div class="et-floating-action-scope">${options.scope}</div>`;
|
|
52
|
+
const host = [options.attributes, 'class="et-floating-action"', `data-state="${state}"`].filter(Boolean);
|
|
53
|
+
|
|
54
|
+
return `<div ${host.join(' ')}>${options.before ?? ''}${anchor}${scope}${options.after ?? ''}</div>`;
|
|
55
|
+
};
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { interactiveStyles } from '@ethlete/core/design/interactive-styles';
|
|
2
|
+
import formFieldBase from '../src/lib/forms/form-field/form-field.component.css?inline';
|
|
3
|
+
import textShell from '../src/lib/forms/form-field/form-field-text-shell-styles.component.css?inline';
|
|
4
|
+
import suffixOverlap from '../src/lib/forms/form-field/form-field-suffix-overlap-styles.component.css?inline';
|
|
5
|
+
import label from '../src/lib/forms/form-field/headless/label.directive.css?inline';
|
|
6
|
+
import hint from '../src/lib/forms/form-field/hint.component.css?inline';
|
|
7
|
+
import inputBase from '../src/lib/forms/input/input.component.css?inline';
|
|
8
|
+
import textareaBase from '../src/lib/forms/textarea/textarea.component.css?inline';
|
|
9
|
+
import textareaAutosize from '../src/lib/forms/textarea/textarea-autosize-styles.component.css?inline';
|
|
10
|
+
import iconStyles from '../src/lib/icon/headless/icon-styles.component.css?inline';
|
|
11
|
+
|
|
12
|
+
/** The field state a control draws itself from. */
|
|
13
|
+
export type FormFieldMockState = {
|
|
14
|
+
id: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
readonly: boolean;
|
|
17
|
+
required: boolean;
|
|
18
|
+
invalid: boolean;
|
|
19
|
+
focused: boolean;
|
|
20
|
+
open: boolean;
|
|
21
|
+
labelId: string | null;
|
|
22
|
+
describedBy: string | null;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** A control drawn inside `formField()`, for example `input()` or `select()`. */
|
|
26
|
+
export type FormFieldControlMock = {
|
|
27
|
+
controlType: string;
|
|
28
|
+
hasValue: boolean;
|
|
29
|
+
/** Can be opened, like a select: `open` then draws the field expanded. */
|
|
30
|
+
expandable?: boolean;
|
|
31
|
+
html: (state: FormFieldMockState) => string;
|
|
32
|
+
/** The control's own affordances, drawn first in the suffix area. */
|
|
33
|
+
suffix?: (state: FormFieldMockState) => string;
|
|
34
|
+
/** Drawn below the field, where the overlay would open. */
|
|
35
|
+
panel?: (state: FormFieldMockState) => string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type FormFieldMockOptions = {
|
|
39
|
+
/** The control, from `input()` or `select()`, or plain HTML for a text input. */
|
|
40
|
+
control: FormFieldControlMock | string;
|
|
41
|
+
/** The label, as HTML. */
|
|
42
|
+
label?: string;
|
|
43
|
+
/** Unique per frame: the ids that link the label, the control and the messages derive from it. */
|
|
44
|
+
id?: string;
|
|
45
|
+
/** The hint, as HTML. */
|
|
46
|
+
hint?: string;
|
|
47
|
+
/** The error message, as HTML. Draws the field in its error state. */
|
|
48
|
+
error?: string;
|
|
49
|
+
/** The color theme name the app registers for errors. */
|
|
50
|
+
errorColor?: string;
|
|
51
|
+
/** Prefix content, as HTML, for example an icon. */
|
|
52
|
+
prefix?: string;
|
|
53
|
+
/** Suffix content, as HTML. */
|
|
54
|
+
suffix?: string;
|
|
55
|
+
appearance?: 'box' | 'underline';
|
|
56
|
+
fill?: 'transparent' | 'filled';
|
|
57
|
+
labelMode?: 'static' | 'inline' | 'floating-inside' | 'floating-outside';
|
|
58
|
+
size?: 'sm' | 'md' | 'lg';
|
|
59
|
+
/** `'ghost'` draws no resting border, as the real form field does for a text-field control. */
|
|
60
|
+
variant?: 'default' | 'ghost';
|
|
61
|
+
/** A color theme name the app registers. */
|
|
62
|
+
color?: string;
|
|
63
|
+
/** A surface theme name the app registers. */
|
|
64
|
+
surface?: string;
|
|
65
|
+
required?: boolean;
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
readonly?: boolean;
|
|
68
|
+
focused?: boolean;
|
|
69
|
+
/** Opens an expandable control, like a select. */
|
|
70
|
+
open?: boolean;
|
|
71
|
+
class?: string;
|
|
72
|
+
style?: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type InputMockOptions = {
|
|
76
|
+
value?: string;
|
|
77
|
+
placeholder?: string;
|
|
78
|
+
type?: string;
|
|
79
|
+
textAlign?: 'start' | 'center' | 'end';
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type TextareaMockOptions = {
|
|
83
|
+
value?: string;
|
|
84
|
+
placeholder?: string;
|
|
85
|
+
rows?: number;
|
|
86
|
+
/** Grows with its content, from `minRows` (default `rows`). On by default, like the real textarea. */
|
|
87
|
+
autosize?: boolean;
|
|
88
|
+
minRows?: number;
|
|
89
|
+
/** The native textarea's `aria-label`, for a field without a visible label. */
|
|
90
|
+
ariaLabel?: string;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** The stylesheets `formField()`, `input()` and `textarea()` draw with: the real `et-form-field` CSS. */
|
|
94
|
+
export const formFieldStyles = /* @__PURE__ */ [
|
|
95
|
+
interactiveStyles,
|
|
96
|
+
iconStyles,
|
|
97
|
+
formFieldBase,
|
|
98
|
+
textShell,
|
|
99
|
+
suffixOverlap,
|
|
100
|
+
label,
|
|
101
|
+
hint,
|
|
102
|
+
inputBase,
|
|
103
|
+
textareaBase,
|
|
104
|
+
textareaAutosize,
|
|
105
|
+
`.et-design-panel-anchor { position: relative; }
|
|
106
|
+
.et-design-panel { position: absolute; inset-inline: 0; inset-block-start: calc(100% + 0.3rem); z-index: 1; }`,
|
|
107
|
+
].join('\n');
|
|
108
|
+
|
|
109
|
+
const attributesOf = (entries: (string | false | null | undefined)[]) => entries.filter(Boolean).join(' ');
|
|
110
|
+
|
|
111
|
+
/** Draws `<et-input>` as a control for `formField()`. */
|
|
112
|
+
export const input = (options: InputMockOptions = {}): FormFieldControlMock => ({
|
|
113
|
+
controlType: 'text-input',
|
|
114
|
+
hasValue: !!options.value,
|
|
115
|
+
html: (state) => {
|
|
116
|
+
const attributes = attributesOf([
|
|
117
|
+
'class="et-input-native"',
|
|
118
|
+
`type="${options.type ?? 'text'}"`,
|
|
119
|
+
options.value && `value="${options.value}"`,
|
|
120
|
+
state.disabled && 'disabled',
|
|
121
|
+
state.readonly && 'readonly',
|
|
122
|
+
state.required && 'required',
|
|
123
|
+
options.placeholder && `placeholder="${options.placeholder}"`,
|
|
124
|
+
state.invalid && 'aria-invalid="true"',
|
|
125
|
+
state.describedBy && `aria-describedby="${state.describedBy}"`,
|
|
126
|
+
state.labelId && `aria-labelledby="${state.labelId}"`,
|
|
127
|
+
`data-text-align="${options.textAlign ?? 'start'}"`,
|
|
128
|
+
]);
|
|
129
|
+
|
|
130
|
+
return `<et-input class="et-color-interactive et-input"><input ${attributes}></et-input>`;
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
/** Draws `<et-textarea>` as a control for `formField()`. */
|
|
135
|
+
export const textarea = (options: TextareaMockOptions = {}): FormFieldControlMock => ({
|
|
136
|
+
controlType: 'textarea',
|
|
137
|
+
hasValue: !!options.value,
|
|
138
|
+
html: (state) => {
|
|
139
|
+
const rows = options.rows ?? 3;
|
|
140
|
+
const autosize = options.autosize ?? true;
|
|
141
|
+
const attributes = attributesOf([
|
|
142
|
+
'class="et-textarea-native"',
|
|
143
|
+
`rows="${rows}"`,
|
|
144
|
+
state.disabled && 'disabled',
|
|
145
|
+
state.readonly && 'readonly',
|
|
146
|
+
state.required && 'required',
|
|
147
|
+
options.placeholder && `placeholder="${options.placeholder}"`,
|
|
148
|
+
state.invalid && 'aria-invalid="true"',
|
|
149
|
+
state.describedBy && `aria-describedby="${state.describedBy}"`,
|
|
150
|
+
state.labelId && `aria-labelledby="${state.labelId}"`,
|
|
151
|
+
options.ariaLabel && `aria-label="${options.ariaLabel}"`,
|
|
152
|
+
`data-resize="${autosize ? 'none' : 'vertical'}"`,
|
|
153
|
+
autosize && 'data-et-textarea-autosize=""',
|
|
154
|
+
autosize && `style="--et-textarea-min-rows: ${options.minRows ?? rows}"`,
|
|
155
|
+
]);
|
|
156
|
+
|
|
157
|
+
return `<et-textarea class="et-color-interactive et-textarea"><textarea ${attributes}>${options.value ?? ''}</textarea></et-textarea>`;
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
/** Draws `<et-form-field>` with a control, its label, affixes and messages, as the component renders them. */
|
|
162
|
+
export const formField = (options: FormFieldMockOptions) => {
|
|
163
|
+
const control: FormFieldControlMock =
|
|
164
|
+
typeof options.control === 'string'
|
|
165
|
+
? { controlType: 'text-input', hasValue: false, html: () => options.control as string }
|
|
166
|
+
: options.control;
|
|
167
|
+
|
|
168
|
+
const {
|
|
169
|
+
id = 'field',
|
|
170
|
+
appearance = 'box',
|
|
171
|
+
fill = 'transparent',
|
|
172
|
+
labelMode = 'static',
|
|
173
|
+
size = 'md',
|
|
174
|
+
error,
|
|
175
|
+
hint,
|
|
176
|
+
} = options;
|
|
177
|
+
const open = !!control.expandable && !!options.open;
|
|
178
|
+
const focused = !!options.focused || open;
|
|
179
|
+
const labelId = options.label ? `et-label-${id}` : null;
|
|
180
|
+
const errorId = `et-form-field-error-${id}`;
|
|
181
|
+
const hintId = `et-form-field-hint-${id}`;
|
|
182
|
+
|
|
183
|
+
const state: FormFieldMockState = {
|
|
184
|
+
id,
|
|
185
|
+
disabled: !!options.disabled,
|
|
186
|
+
readonly: !!options.readonly,
|
|
187
|
+
required: !!options.required,
|
|
188
|
+
invalid: error !== undefined,
|
|
189
|
+
focused,
|
|
190
|
+
open,
|
|
191
|
+
labelId,
|
|
192
|
+
describedBy: error !== undefined ? errorId : hint !== undefined ? hintId : null,
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const errorColor = error !== undefined && options.errorColor;
|
|
196
|
+
const floating = labelMode === 'floating-inside' || labelMode === 'floating-outside';
|
|
197
|
+
|
|
198
|
+
const classes = [
|
|
199
|
+
'et-color-interactive--has-focus',
|
|
200
|
+
'et-form-field',
|
|
201
|
+
errorColor ? `et-color--${errorColor}` : `et-color--${options.color ?? 'inherited'}`,
|
|
202
|
+
`et-surface--${options.surface ?? 'inherited'}`,
|
|
203
|
+
options.class,
|
|
204
|
+
].filter(Boolean);
|
|
205
|
+
|
|
206
|
+
const attributes = attributesOf([
|
|
207
|
+
`class="${classes.join(' ')}"`,
|
|
208
|
+
`data-control-type="${control.controlType}"`,
|
|
209
|
+
error !== undefined && 'data-error="true"',
|
|
210
|
+
open && 'data-expanded=""',
|
|
211
|
+
focused && 'data-focused=""',
|
|
212
|
+
state.readonly && 'data-readonly=""',
|
|
213
|
+
state.disabled && 'data-disabled=""',
|
|
214
|
+
`data-appearance="${appearance}"`,
|
|
215
|
+
`data-fill="${fill}"`,
|
|
216
|
+
fill === 'filled' && 'data-et-surface-fill=""',
|
|
217
|
+
floating && (focused || control.hasValue) && 'data-label-floated=""',
|
|
218
|
+
options.label && 'data-has-label=""',
|
|
219
|
+
`data-label-mode="${labelMode}"`,
|
|
220
|
+
`data-size="${size}"`,
|
|
221
|
+
options.variant === 'ghost' && 'data-variant="ghost"',
|
|
222
|
+
'data-text-shell="true"',
|
|
223
|
+
options.style && `style="${options.style}"`,
|
|
224
|
+
]);
|
|
225
|
+
|
|
226
|
+
const labelAreaClasses = [
|
|
227
|
+
'et-form-field-label-area',
|
|
228
|
+
floating && 'et-form-field-label-area--floating',
|
|
229
|
+
labelMode === 'inline' && 'et-form-field-label-area--inline',
|
|
230
|
+
].filter(Boolean);
|
|
231
|
+
|
|
232
|
+
const labelHtml = options.label
|
|
233
|
+
? `<et-label id="${labelId}"${state.disabled ? ' data-disabled="true"' : ''}><span class="et-label-content">${options.label}</span>${state.required ? '<span class="et-label-required-marker" aria-hidden="true">*</span>' : ''}</et-label>`
|
|
234
|
+
: '';
|
|
235
|
+
|
|
236
|
+
const errorHtml =
|
|
237
|
+
error !== undefined
|
|
238
|
+
? `<div class="et-form-field-support-content et-form-field-errors${errorColor ? ` et-color--${errorColor}` : ''}" id="${errorId}" aria-atomic="true" aria-live="polite" data-active="true" data-direction="from-below" data-state="active"><et-form-error class="et-form-error">${error}</et-form-error></div>`
|
|
239
|
+
: '';
|
|
240
|
+
|
|
241
|
+
const hintHtml =
|
|
242
|
+
hint !== undefined && error === undefined
|
|
243
|
+
? `<div class="et-form-field-support-content et-form-field-hint" id="${hintId}" data-active="true" data-direction="from-above" data-state="active"><et-hint>${hint}</et-hint></div>`
|
|
244
|
+
: '';
|
|
245
|
+
|
|
246
|
+
const support =
|
|
247
|
+
error !== undefined || hint !== undefined
|
|
248
|
+
? `<div class="et-color-interactive-exclude et-form-field-support"><div class="et-form-field-support-row"><div class="et-form-field-support-stack">${errorHtml}${hintHtml}</div><div class="et-form-field-support-counter${options.errorColor ? ` et-color--${options.errorColor}` : ''}" hidden></div></div></div>`
|
|
249
|
+
: '';
|
|
250
|
+
|
|
251
|
+
const field = `<et-form-field ${attributes}><div class="et-form-field-shell"><div class="et-form-field-control-frame"><div class="et-form-field-affix et-form-field-prefix">${options.prefix ?? ''}</div><div class="et-form-field-control-area"><div class="${labelAreaClasses.join(' ')}">${labelHtml}</div><div class="et-form-field-control-slot">${control.html(state)}</div></div><div class="et-form-field-affix et-form-field-suffix">${control.suffix?.(state) ?? ''}${options.suffix ?? ''}</div></div></div>${support}</et-form-field>`;
|
|
252
|
+
|
|
253
|
+
if (!open || !control.panel) return field;
|
|
254
|
+
|
|
255
|
+
return `<div class="et-design-panel-anchor">${field}<div class="et-design-panel">${control.panel(state)}</div></div>`;
|
|
256
|
+
};
|