@icen.ai/ui 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +82 -254
- package/LICENSE +21 -0
- package/README.md +60 -96
- package/dist/base.css +258 -188
- package/dist/behaviors/accordion.mjs +8 -8
- package/dist/behaviors/ai-branch.d.mts +1 -1
- package/dist/behaviors/ai-branch.mjs +1011 -94
- package/dist/behaviors/ai-chat.d.mts +9 -9
- package/dist/behaviors/ai-chat.mjs +1122 -169
- package/dist/behaviors/ai-composer.d.mts +47 -15
- package/dist/behaviors/ai-composer.mjs +2018 -534
- package/dist/behaviors/ai-core.d.mts +1 -1
- package/dist/behaviors/ai-core.mjs +1017 -107
- package/dist/behaviors/ai-diff.mjs +1020 -127
- package/dist/behaviors/ai-feedback.d.mts +1 -1
- package/dist/behaviors/ai-feedback.mjs +1036 -126
- package/dist/behaviors/ai-panel.d.mts +10 -10
- package/dist/behaviors/ai-panel.mjs +1285 -266
- package/dist/behaviors/ai-provider.d.mts +1 -1
- package/dist/behaviors/ai-provider.mjs +1004 -101
- package/dist/behaviors/ai-threads.d.mts +1 -1
- package/dist/behaviors/ai-threads.mjs +1069 -154
- package/dist/behaviors/ai-tool.d.mts +3 -3
- package/dist/behaviors/ai-tool.mjs +2087 -413
- package/dist/behaviors/ai-tools.d.mts +89 -16
- package/dist/behaviors/ai-tools.mjs +5365 -380
- package/dist/behaviors/autocomplete.d.mts +53 -0
- package/dist/behaviors/autocomplete.mjs +1601 -0
- package/dist/behaviors/back-top.d.mts +1 -1
- package/dist/behaviors/back-top.mjs +952 -14
- package/dist/behaviors/carousel.d.mts +1 -1
- package/dist/behaviors/carousel.mjs +914 -12
- package/dist/behaviors/cascader.d.mts +48 -0
- package/dist/behaviors/cascader.mjs +1867 -0
- package/dist/behaviors/charts.d.mts +72 -8
- package/dist/behaviors/charts.mjs +1953 -272
- package/dist/behaviors/code-block.d.mts +36 -0
- package/dist/behaviors/code-block.mjs +1619 -0
- package/dist/behaviors/command-palette.d.mts +9 -6
- package/dist/behaviors/command-palette.mjs +164 -62
- package/dist/behaviors/context-menu.d.mts +10 -9
- package/dist/behaviors/context-menu.mjs +1113 -44
- package/dist/behaviors/controls.d.mts +21 -21
- package/dist/behaviors/controls.mjs +1024 -134
- package/dist/behaviors/copy.d.mts +21 -2
- package/dist/behaviors/copy.mjs +1207 -42
- package/dist/behaviors/datatable.d.mts +55 -5
- package/dist/behaviors/datatable.mjs +2033 -212
- package/dist/behaviors/date-picker.d.mts +0 -1
- package/dist/behaviors/date-picker.mjs +1341 -293
- package/dist/behaviors/design.d.mts +54 -0
- package/dist/behaviors/design.mjs +109 -0
- package/dist/behaviors/dropdown.d.mts +5 -6
- package/dist/behaviors/dropdown.mjs +262 -110
- package/dist/behaviors/events.d.mts +127 -10
- package/dist/behaviors/events.mjs +58 -3
- package/dist/behaviors/feedback.d.mts +30 -0
- package/dist/behaviors/feedback.mjs +296 -0
- package/dist/behaviors/focus.d.mts +8 -0
- package/dist/behaviors/focus.mjs +24 -0
- package/dist/behaviors/form-validate.d.mts +111 -0
- package/dist/behaviors/form-validate.mjs +1746 -0
- package/dist/behaviors/i18n.d.mts +790 -0
- package/dist/behaviors/i18n.mjs +1713 -0
- package/dist/behaviors/icons.d.mts +93 -0
- package/dist/behaviors/icons.mjs +113 -0
- package/dist/behaviors/input.d.mts +9 -1
- package/dist/behaviors/input.mjs +1059 -60
- package/dist/behaviors/kb-access.d.mts +3 -3
- package/dist/behaviors/kb-access.mjs +2135 -239
- package/dist/behaviors/kb-acl.d.mts +8 -8
- package/dist/behaviors/kb-acl.mjs +1120 -179
- package/dist/behaviors/kb-answer.d.mts +2 -2
- package/dist/behaviors/kb-answer.mjs +2120 -435
- package/dist/behaviors/kb-audit.d.mts +3 -3
- package/dist/behaviors/kb-audit.mjs +1077 -154
- package/dist/behaviors/kb-canvas.d.mts +3 -3
- package/dist/behaviors/kb-canvas.mjs +1101 -177
- package/dist/behaviors/kb-chain.d.mts +2 -2
- package/dist/behaviors/kb-chain.mjs +1023 -100
- package/dist/behaviors/kb-checkpoint.d.mts +3 -3
- package/dist/behaviors/kb-checkpoint.mjs +1320 -169
- package/dist/behaviors/kb-chunks.d.mts +2 -2
- package/dist/behaviors/kb-chunks.mjs +1153 -213
- package/dist/behaviors/kb-citation.d.mts +3 -3
- package/dist/behaviors/kb-citation.mjs +1221 -185
- package/dist/behaviors/kb-clarify.d.mts +2 -2
- package/dist/behaviors/kb-clarify.mjs +1059 -130
- package/dist/behaviors/kb-conflict.d.mts +2 -2
- package/dist/behaviors/kb-conflict.mjs +1042 -119
- package/dist/behaviors/kb-connector.d.mts +2 -2
- package/dist/behaviors/kb-connector.mjs +1105 -176
- package/dist/behaviors/kb-core.d.mts +7 -2
- package/dist/behaviors/kb-core.mjs +1078 -162
- package/dist/behaviors/kb-eval.d.mts +2 -2
- package/dist/behaviors/kb-eval.mjs +1977 -144
- package/dist/behaviors/kb-explain.d.mts +3 -3
- package/dist/behaviors/kb-explain.mjs +1037 -104
- package/dist/behaviors/kb-filter.d.mts +2 -2
- package/dist/behaviors/kb-filter.mjs +2014 -178
- package/dist/behaviors/kb-gap.d.mts +3 -3
- package/dist/behaviors/kb-gap.mjs +1044 -121
- package/dist/behaviors/kb-hittest.d.mts +3 -3
- package/dist/behaviors/kb-hittest.mjs +1095 -151
- package/dist/behaviors/kb-metadata.mjs +1058 -130
- package/dist/behaviors/kb-passage.d.mts +4 -4
- package/dist/behaviors/kb-passage.mjs +1102 -161
- package/dist/behaviors/kb-pipeline.d.mts +4 -4
- package/dist/behaviors/kb-pipeline.mjs +1083 -162
- package/dist/behaviors/kb-qa.mjs +1089 -160
- package/dist/behaviors/kb-rerank.d.mts +2 -2
- package/dist/behaviors/kb-rerank.mjs +1048 -114
- package/dist/behaviors/kb-retrieval.d.mts +2 -2
- package/dist/behaviors/kb-retrieval.mjs +2079 -226
- package/dist/behaviors/kb-review.d.mts +2 -2
- package/dist/behaviors/kb-review.mjs +1996 -159
- package/dist/behaviors/kb-sandbox.d.mts +3 -3
- package/dist/behaviors/kb-sandbox.mjs +1033 -105
- package/dist/behaviors/kb-segment.d.mts +2 -2
- package/dist/behaviors/kb-segment.mjs +1112 -179
- package/dist/behaviors/kb-select.d.mts +24 -0
- package/dist/behaviors/kb-select.mjs +1995 -0
- package/dist/behaviors/kb-sources.d.mts +3 -3
- package/dist/behaviors/kb-sources.mjs +1085 -170
- package/dist/behaviors/kb-sql.d.mts +3 -3
- package/dist/behaviors/kb-sql.mjs +1144 -226
- package/dist/behaviors/kb-trace.d.mts +3 -3
- package/dist/behaviors/kb-trace.mjs +1051 -131
- package/dist/behaviors/kb-visibility.d.mts +2 -2
- package/dist/behaviors/kb-visibility.mjs +1087 -158
- package/dist/behaviors/kb-who-can.d.mts +2 -2
- package/dist/behaviors/kb-who-can.mjs +1980 -137
- package/dist/behaviors/mentions.d.mts +93 -0
- package/dist/behaviors/mentions.mjs +2153 -0
- package/dist/behaviors/modal.d.mts +4 -3
- package/dist/behaviors/modal.mjs +1056 -33
- package/dist/behaviors/nav.d.mts +1 -1
- package/dist/behaviors/nav.mjs +6 -6
- package/dist/behaviors/notification.d.mts +16 -8
- package/dist/behaviors/notification.mjs +1629 -268
- package/dist/behaviors/panel.d.mts +4 -0
- package/dist/behaviors/panel.mjs +995 -0
- package/dist/behaviors/popover.d.mts +28 -5
- package/dist/behaviors/popover.mjs +225 -24
- package/dist/behaviors/scroll-area.d.mts +17 -0
- package/dist/behaviors/scroll-area.mjs +59 -0
- package/dist/behaviors/select.d.mts +5 -2
- package/dist/behaviors/select.mjs +1416 -117
- package/dist/behaviors/sidebar.d.mts +1 -1
- package/dist/behaviors/sidebar.mjs +13 -13
- package/dist/behaviors/slider.d.mts +1 -1
- package/dist/behaviors/slider.mjs +12 -12
- package/dist/behaviors/split-pane.d.mts +1 -1
- package/dist/behaviors/split-pane.mjs +9 -7
- package/dist/behaviors/suggestions.d.mts +27 -0
- package/dist/behaviors/suggestions.mjs +1090 -0
- package/dist/behaviors/svg-parse.d.mts +14 -0
- package/dist/behaviors/svg-parse.mjs +37 -0
- package/dist/behaviors/tabs.d.mts +2 -2
- package/dist/behaviors/tabs.mjs +35 -25
- package/dist/behaviors/tag-input.d.mts +23 -5
- package/dist/behaviors/tag-input.mjs +1360 -104
- package/dist/behaviors/theme-switcher.d.mts +24 -0
- package/dist/behaviors/theme-switcher.mjs +1996 -0
- package/dist/behaviors/theme.d.mts +15 -8
- package/dist/behaviors/theme.mjs +406 -30
- package/dist/behaviors/toast.d.mts +24 -25
- package/dist/behaviors/toast.mjs +1267 -88
- package/dist/behaviors/tooltip.d.mts +4 -0
- package/dist/behaviors/tooltip.mjs +378 -0
- package/dist/behaviors/tree-select.d.mts +69 -0
- package/dist/behaviors/tree-select.mjs +1921 -0
- package/dist/behaviors/tree.d.mts +1 -1
- package/dist/behaviors/tree.mjs +18 -18
- package/dist/behaviors/upload.d.mts +3 -2
- package/dist/behaviors/upload.mjs +1077 -66
- package/dist/behaviors/url-safety.d.mts +8 -0
- package/dist/behaviors/url-safety.mjs +11 -0
- package/dist/cli.mjs +5 -6
- package/dist/components/accordion.d.mts +2 -0
- package/dist/components/ai-branch.d.mts +2 -0
- package/dist/components/ai-chat.css +682 -582
- package/dist/components/ai-chat.d.mts +2 -0
- package/dist/components/ai-composer.d.mts +2 -0
- package/dist/components/ai-context.d.mts +2 -0
- package/dist/components/ai-context.mjs +1 -0
- package/dist/components/ai-diff.css +153 -132
- package/dist/components/ai-diff.d.mts +2 -0
- package/dist/components/ai-feedback.d.mts +2 -0
- package/dist/components/ai-files.d.mts +2 -0
- package/dist/components/ai-message.d.mts +2 -0
- package/dist/components/ai-panel.css +353 -343
- package/dist/components/ai-reasoning.d.mts +2 -0
- package/dist/components/ai-subagent.d.mts +2 -0
- package/dist/components/ai-subagent.mjs +1 -0
- package/dist/components/ai-threads.d.mts +2 -0
- package/dist/components/ai-todo.d.mts +2 -0
- package/dist/components/ai-todo.mjs +1 -0
- package/dist/components/ai-tool-call.d.mts +2 -0
- package/dist/components/ai-tool-call.mjs +1 -0
- package/dist/components/ai-tool.css +397 -242
- package/dist/components/ai-usage.d.mts +2 -0
- package/dist/components/alert.d.mts +2 -0
- package/dist/components/autocomplete.css +61 -0
- package/dist/components/autocomplete.d.mts +2 -0
- package/dist/components/autocomplete.mjs +3 -0
- package/dist/components/avatar.d.mts +2 -0
- package/dist/components/back-top.css +74 -40
- package/dist/components/back-top.d.mts +2 -0
- package/dist/components/badge.css +44 -41
- package/dist/components/badge.d.mts +2 -0
- package/dist/components/breadcrumb.css +85 -46
- package/dist/components/breadcrumb.d.mts +2 -0
- package/dist/components/btn.css +105 -94
- package/dist/components/btn.d.mts +2 -0
- package/dist/components/card.css +124 -113
- package/dist/components/card.d.mts +2 -0
- package/dist/components/carousel.d.mts +2 -0
- package/dist/components/cascader.css +332 -0
- package/dist/components/cascader.d.mts +2 -0
- package/dist/components/cascader.mjs +3 -0
- package/dist/components/chart-area.css +54 -2
- package/dist/components/chart-area.d.mts +2 -0
- package/dist/components/chart-bar.css +147 -38
- package/dist/components/chart-bar.d.mts +2 -0
- package/dist/components/chart-calendar.d.mts +2 -0
- package/dist/components/chart-gauge.css +36 -13
- package/dist/components/chart-gauge.d.mts +2 -0
- package/dist/components/chart-graph.css +35 -20
- package/dist/components/chart-graph.d.mts +2 -0
- package/dist/components/chart-heatmap.css +67 -39
- package/dist/components/chart-heatmap.d.mts +2 -0
- package/dist/components/chart-line.css +62 -3
- package/dist/components/chart-line.d.mts +2 -0
- package/dist/components/chart-map.d.mts +2 -0
- package/dist/components/chart-pie.css +38 -6
- package/dist/components/chart-pie.d.mts +2 -0
- package/dist/components/chart-radar.css +57 -5
- package/dist/components/chart-radar.d.mts +2 -0
- package/dist/components/chart-scatter.css +47 -7
- package/dist/components/chart-scatter.d.mts +2 -0
- package/dist/components/chart-sparkline.css +25 -2
- package/dist/components/chart-sparkline.d.mts +2 -0
- package/dist/components/chart-stack.css +27 -13
- package/dist/components/chart-stack.d.mts +2 -0
- package/dist/components/charts.css +220 -84
- package/dist/components/charts.d.mts +2 -0
- package/dist/components/code-block.css +420 -0
- package/dist/components/code-block.d.mts +2 -0
- package/dist/components/code-block.mjs +4 -0
- package/dist/components/command-palette.css +150 -122
- package/dist/components/command-palette.d.mts +2 -0
- package/dist/components/content.css +274 -263
- package/dist/components/context-menu.d.mts +2 -0
- package/dist/components/copy.css +73 -45
- package/dist/components/copy.d.mts +2 -0
- package/dist/components/datatable.css +457 -202
- package/dist/components/datatable.d.mts +2 -0
- package/dist/components/date-picker.css +136 -105
- package/dist/components/date-picker.d.mts +2 -0
- package/dist/components/desc.d.mts +2 -0
- package/dist/components/dropdown.d.mts +2 -0
- package/dist/components/empty.css +72 -69
- package/dist/components/empty.d.mts +2 -0
- package/dist/components/feedback.css +211 -191
- package/dist/components/form-validate.css +134 -0
- package/dist/components/form-validate.d.mts +2 -0
- package/dist/components/form-validate.mjs +3 -0
- package/dist/components/form.css +157 -131
- package/dist/components/form.d.mts +2 -0
- package/dist/components/icon.css +113 -0
- package/dist/components/icon.d.mts +2 -0
- package/dist/components/icon.mjs +3 -0
- package/dist/components/input.css +163 -108
- package/dist/components/input.d.mts +2 -0
- package/dist/components/kb-access.d.mts +2 -0
- package/dist/components/kb-acl.d.mts +2 -0
- package/dist/components/kb-agent.css +300 -206
- package/dist/components/kb-answer.d.mts +2 -0
- package/dist/components/kb-audit.d.mts +2 -0
- package/dist/components/kb-canvas.d.mts +2 -0
- package/dist/components/kb-chain.d.mts +2 -0
- package/dist/components/kb-checkpoint.d.mts +2 -0
- package/dist/components/kb-chunks.d.mts +2 -0
- package/dist/components/kb-citation.d.mts +2 -0
- package/dist/components/kb-clarify.d.mts +2 -0
- package/dist/components/kb-conflict.d.mts +2 -0
- package/dist/components/kb-connector.d.mts +2 -0
- package/dist/components/kb-data.css +431 -315
- package/dist/components/kb-eval.d.mts +2 -0
- package/dist/components/kb-explain.d.mts +2 -0
- package/dist/components/kb-filter.d.mts +2 -0
- package/dist/components/kb-gap.d.mts +2 -0
- package/dist/components/kb-ground.css +333 -229
- package/dist/components/kb-hittest.d.mts +2 -0
- package/dist/components/kb-ingest.css +613 -434
- package/dist/components/kb-metadata.d.mts +2 -0
- package/dist/components/kb-ops.css +422 -302
- package/dist/components/kb-passage.d.mts +2 -0
- package/dist/components/kb-perm.css +374 -314
- package/dist/components/kb-pipeline.d.mts +2 -0
- package/dist/components/kb-qa.d.mts +2 -0
- package/dist/components/kb-rerank.d.mts +2 -0
- package/dist/components/kb-retrieval.d.mts +2 -0
- package/dist/components/kb-review.d.mts +2 -0
- package/dist/components/kb-sandbox.d.mts +2 -0
- package/dist/components/kb-search.css +653 -459
- package/dist/components/kb-segment.d.mts +2 -0
- package/dist/components/kb-sources.d.mts +2 -0
- package/dist/components/kb-sql.d.mts +2 -0
- package/dist/components/kb-trace.d.mts +2 -0
- package/dist/components/kb-visibility.d.mts +2 -0
- package/dist/components/kb-who-can.d.mts +2 -0
- package/dist/components/kb.css +170 -135
- package/dist/components/kb.d.mts +2 -0
- package/dist/components/kbd.d.mts +2 -0
- package/dist/components/layout.css +86 -83
- package/dist/components/layout.d.mts +2 -0
- package/dist/components/list.d.mts +2 -0
- package/dist/components/material-chinese.css +83 -0
- package/dist/components/material-soviet.css +86 -0
- package/dist/components/material.css +318 -0
- package/dist/components/media-card.d.mts +2 -0
- package/dist/components/media.css +225 -176
- package/dist/components/mentions.css +190 -0
- package/dist/components/mentions.d.mts +2 -0
- package/dist/components/mentions.mjs +3 -0
- package/dist/components/menu.css +121 -109
- package/dist/components/modal.css +116 -118
- package/dist/components/modal.d.mts +2 -0
- package/dist/components/nav.css +136 -129
- package/dist/components/nav.d.mts +2 -0
- package/dist/components/notification.css +247 -177
- package/dist/components/notification.d.mts +2 -0
- package/dist/components/pagination.css +62 -57
- package/dist/components/pagination.d.mts +2 -0
- package/dist/components/panel.css +70 -68
- package/dist/components/panel.d.mts +2 -0
- package/dist/components/panel.mjs +1 -0
- package/dist/components/pill.css +83 -72
- package/dist/components/pill.d.mts +2 -0
- package/dist/components/popover.css +80 -57
- package/dist/components/popover.d.mts +2 -0
- package/dist/components/progress.d.mts +2 -0
- package/dist/components/rating.d.mts +2 -0
- package/dist/components/result.d.mts +2 -0
- package/dist/components/scroll-area.css +29 -54
- package/dist/components/scroll-area.d.mts +2 -0
- package/dist/components/scroll-area.mjs +1 -0
- package/dist/components/segmented.css +167 -146
- package/dist/components/segmented.d.mts +2 -0
- package/dist/components/select.css +250 -191
- package/dist/components/select.d.mts +2 -0
- package/dist/components/sidebar.css +157 -143
- package/dist/components/sidebar.d.mts +2 -0
- package/dist/components/skeleton.d.mts +2 -0
- package/dist/components/slider.css +135 -128
- package/dist/components/slider.d.mts +2 -0
- package/dist/components/spinner.d.mts +2 -0
- package/dist/components/split-pane.css +120 -108
- package/dist/components/split-pane.d.mts +2 -0
- package/dist/components/stat.css +116 -109
- package/dist/components/stat.d.mts +2 -0
- package/dist/components/steps.css +114 -108
- package/dist/components/steps.d.mts +2 -0
- package/dist/components/switch.css +192 -149
- package/dist/components/switch.d.mts +2 -0
- package/dist/components/table.css +158 -112
- package/dist/components/table.d.mts +2 -0
- package/dist/components/tabs.css +143 -116
- package/dist/components/tabs.d.mts +2 -0
- package/dist/components/tag-input.css +52 -133
- package/dist/components/tag-input.d.mts +2 -0
- package/dist/components/tag.css +90 -72
- package/dist/components/tag.d.mts +2 -0
- package/dist/components/theme-switcher.css +105 -0
- package/dist/components/theme-switcher.d.mts +2 -0
- package/dist/components/theme-switcher.mjs +3 -0
- package/dist/components/timeline.d.mts +2 -0
- package/dist/components/toast.css +115 -97
- package/dist/components/toast.d.mts +2 -0
- package/dist/components/toolbar.css +47 -43
- package/dist/components/toolbar.d.mts +2 -0
- package/dist/components/tooltip.css +103 -43
- package/dist/components/tooltip.d.mts +2 -0
- package/dist/components/tooltip.mjs +1 -0
- package/dist/components/tree-select.css +439 -0
- package/dist/components/tree-select.d.mts +2 -0
- package/dist/components/tree-select.mjs +3 -0
- package/dist/components/tree.d.mts +2 -0
- package/dist/components/upload.css +138 -97
- package/dist/components/upload.d.mts +2 -0
- package/dist/fonts/LICENSES/ark-pixel/OFL.txt +96 -0
- package/dist/fonts/LICENSES/cubic-11/OFL.txt +108 -0
- package/dist/fonts/LICENSES/galmuri/LICENSE.txt +93 -0
- package/dist/fonts/OFL.txt +96 -0
- package/dist/fonts/README.md +14 -0
- package/dist/fonts/fusion-pixel-12px-zh-hans.woff2 +0 -0
- package/dist/index.d.mts +85 -70
- package/dist/index.mjs +17330 -5773
- package/dist/react.d.mts +91 -0
- package/dist/react.mjs +8307 -0
- package/dist/registry.json +918 -70
- package/dist/tokens/chinese.css +44 -0
- package/dist/tokens/colors.css +371 -1222
- package/dist/tokens/design.css +209 -0
- package/dist/tokens/dtcg.json +15926 -0
- package/dist/tokens/figma.variables.json +10779 -0
- package/dist/tokens/icon-masks.css +78 -0
- package/dist/tokens/pixel.css +53 -0
- package/dist/tokens/scrollbars.css +40 -0
- package/dist/tokens/soviet.css +44 -0
- package/dist/tokens/style-profiles.css +36 -547
- package/dist/tokens/themes.json +308 -0
- package/dist/tokens/tokens-studio.json +11648 -0
- package/dist/tokens/typography.css +21 -18
- package/dist/tokens.css +1783 -1806
- package/dist/ui.css +14796 -10750
- package/dist/vue.d.mts +344 -0
- package/dist/vue.mjs +7876 -0
- package/docs/spec/ai-input-experience.md +75 -0
- package/docs/spec/ai-native.md +238 -147
- package/docs/spec/design-philosophy.md +189 -0
- package/docs/spec/design-primitives.md +196 -0
- package/docs/spec/kb-family.md +147 -115
- package/docs/spec/scrollbars.md +46 -0
- package/package.json +56 -8
- package/dist/retro-effects.css +0 -255
- package/dist/tokens/retro-effects.css +0 -255
- package/docs/research/2026-10-03-ai-kb-components.md +0 -392
- package/docs/research/2026-10-03-kb-permissions.md +0 -992
|
@@ -1,256 +1,264 @@
|
|
|
1
|
+
@layer icen.components {
|
|
1
2
|
/*
|
|
2
3
|
* @icen.ai/ui — Component: select(弹层选择器)
|
|
3
4
|
* 规格源自 opengal primitives/input.tsx 的 Select;与 behaviors/select.ts 配套。
|
|
4
5
|
*
|
|
5
6
|
* 完整契约:
|
|
6
|
-
* <div class="select [data-disabled] [.is-open]" data-select
|
|
7
|
-
* [data-select-search] [data-select-multiple] [data-select-max="3"]
|
|
8
|
-
* [data-panel-width="220"] [data-panel-min="200"]
|
|
9
|
-
* [data-panel-max="360"] [data-panel-max-height="320"]>
|
|
10
|
-
* <!-- 选项 .select-option 内支持任意 HTML(色卡 / 图标 / 多行);
|
|
7
|
+
* <div class="icen-select [data-icen-disabled] [.is-open]" data-icen-select
|
|
8
|
+
* [data-icen-select-search] [data-icen-select-multiple] [data-icen-select-max="3"]
|
|
9
|
+
* [data-icen-panel-width="220"] [data-icen-panel-min="200"]
|
|
10
|
+
* [data-icen-panel-max="360"] [data-icen-panel-max-height="320"]>
|
|
11
|
+
* <!-- 选项 .icen-select-option 内支持任意 HTML(色卡 / 图标 / 多行);
|
|
11
12
|
* 面板尺寸为全库统一 PanelSizing 契约(behaviors/popover.ts) -->
|
|
12
|
-
* <button class="select-trigger pressable focus-ring [--sm|--lg]" aria-haspopup="listbox"
|
|
13
|
+
* <button class="icen-select-trigger icen-pressable icen-focus-ring [--sm|--lg]" aria-haspopup="listbox"
|
|
13
14
|
* aria-expanded="false" [disabled]>
|
|
14
|
-
* <span class="select-leading">…</span> 可选前缀
|
|
15
|
-
* <span class="select-value is-empty">占位</span> 多选有选中时 behavior 隐藏它
|
|
16
|
-
* <span class="select-chips"> ← 多选选中态由 behavior 渲染(勿手写)
|
|
17
|
-
* <span class="select-chip">标签<span class="select-chip-x" role="button" tabindex="-1">×</span></span>
|
|
18
|
-
* <span class="select-chip select-chip--more">+2</span>
|
|
15
|
+
* <span class="icen-select-leading">…</span> 可选前缀
|
|
16
|
+
* <span class="icen-select-value is-empty">占位</span> 多选有选中时 behavior 隐藏它
|
|
17
|
+
* <span class="icen-select-chips"> ← 多选选中态由 behavior 渲染(勿手写)
|
|
18
|
+
* <span class="icen-select-chip">标签<span class="icen-select-chip-x" role="button" tabindex="-1">×</span></span>
|
|
19
|
+
* <span class="icen-select-chip icen-select-chip--more">+2</span>
|
|
19
20
|
* </span>
|
|
20
|
-
* <svg class="select-chevron">…</svg>
|
|
21
|
+
* <svg class="icen-select-chevron">…</svg>
|
|
21
22
|
* </button>
|
|
22
|
-
* <button class="select-clear" aria-label="清除全部" hidden>×</button> ← 多选可选:
|
|
23
|
-
* 与 trigger 同级(不能嵌套在 button 内),绝对定位叠进 trigger
|
|
23
|
+
* <button class="icen-select-clear" aria-label="清除全部" hidden>×</button> ← 多选可选:
|
|
24
|
+
* 与 trigger 同级(不能嵌套在 button 内),绝对定位叠进 trigger 行内末端侧(RTL 镜像左侧);
|
|
24
25
|
* behavior 在有选中时自动显示
|
|
25
|
-
* <div class="select-panel" hidden role="listbox">
|
|
26
|
-
* <div class="select-search"> ← data-select-search 时 behavior 自动注入
|
|
27
|
-
* <input class="select-search-input" placeholder="搜索…" />
|
|
26
|
+
* <div class="icen-select-panel" hidden role="listbox">
|
|
27
|
+
* <div class="icen-select-search"> ← data-icen-select-search 时 behavior 自动注入
|
|
28
|
+
* <icen-input class="icen-select-search-input" placeholder="搜索…" />
|
|
28
29
|
* </div>
|
|
29
|
-
* <div class="select-group"> ← 可选分组
|
|
30
|
-
* <p class="select-group-label">组标题</p>
|
|
31
|
-
* <button class="select-option [.is-focused|.is-selected|.is-disabled]" data-value="x">…</button>
|
|
30
|
+
* <div class="icen-select-group"> ← 可选分组
|
|
31
|
+
* <p class="icen-select-group-label">组标题</p>
|
|
32
|
+
* <button class="icen-select-option [.is-focused|.is-selected|.is-disabled]" data-icen-value="x">…</button>
|
|
32
33
|
* </div>
|
|
33
|
-
* <div class="select-empty">无匹配项</div> ← 搜索无结果时 behavior 显示
|
|
34
|
+
* <div class="icen-select-empty">无匹配项</div> ← 搜索无结果时 behavior 显示
|
|
34
35
|
* </div>
|
|
35
|
-
* <input type="hidden" data-select-value /> 可选,behavior 同步 value
|
|
36
|
+
* <input type="hidden" data-icen-select-value /> 可选,behavior 同步 value
|
|
36
37
|
* </div>
|
|
37
38
|
*
|
|
38
39
|
* behavior 维护:
|
|
39
|
-
* - .select.is-open ↔ aria-expanded;panel portal 到 body(inline left/top/width/max-height,
|
|
40
|
-
* 带 data-side="top|bottom";多选时带 data-select-multiple);ESC/外部点击关闭
|
|
41
|
-
* - 选项 .is-focused 跟随键盘箭头;Enter 选中 → 写回 .select-value / .is-selected
|
|
42
|
-
* - data-select-search:面板顶部自动插入搜索框,实时过滤(含 data-keywords),空分组自动隐藏
|
|
43
|
-
* - data-select-multiple:点击切选不关面板,trigger 显示计数,hidden input 同步逗号分隔值
|
|
40
|
+
* - .icen-select.is-open ↔ aria-expanded;panel portal 到 body(inline left/top/width/max-height,
|
|
41
|
+
* 带 data-icen-side="top|bottom";多选时带 data-icen-select-multiple);ESC/外部点击关闭
|
|
42
|
+
* - 选项 .is-focused 跟随键盘箭头;Enter 选中 → 写回 .icen-select-value / .is-selected
|
|
43
|
+
* - data-icen-select-search:面板顶部自动插入搜索框,实时过滤(含 data-icen-keywords),空分组自动隐藏
|
|
44
|
+
* - data-icen-select-multiple:点击切选不关面板,trigger 显示计数,hidden input 同步逗号分隔值
|
|
44
45
|
*/
|
|
45
46
|
|
|
46
|
-
.select {
|
|
47
|
+
.icen-select {
|
|
48
|
+
--select-height: var(--icen-control-height-md);
|
|
47
49
|
position: relative;
|
|
48
|
-
|
|
50
|
+
inline-size: 100%;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
.select-trigger {
|
|
53
|
+
.icen-select-trigger {
|
|
54
|
+
position: relative;
|
|
52
55
|
display: flex;
|
|
53
56
|
align-items: center;
|
|
54
|
-
gap: var(--
|
|
55
|
-
|
|
56
|
-
height: var(--
|
|
57
|
-
padding: 0 var(--
|
|
58
|
-
font-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
gap: var(--icen-control-gap-sm);
|
|
58
|
+
inline-size: 100%;
|
|
59
|
+
height: var(--select-height);
|
|
60
|
+
padding: 0 var(--icen-field-padding-inline);
|
|
61
|
+
font-family: var(--icen-font-body);
|
|
62
|
+
font-size: var(--icen-font-size-control);
|
|
63
|
+
line-height: 1.4;
|
|
64
|
+
text-align: start;
|
|
65
|
+
background: var(--icen-token-control);
|
|
66
|
+
color: var(--icen-token-text);
|
|
67
|
+
border: var(--icen-control-border-width) solid var(--icen-token-control-border);
|
|
68
|
+
border-radius: var(--icen-control-radius);
|
|
69
|
+
box-shadow: var(--icen-token-shadow-field);
|
|
65
70
|
cursor: pointer;
|
|
66
71
|
transition:
|
|
72
|
+
background-color var(--icen-tx-fast),
|
|
67
73
|
border-color var(--icen-tx-fast),
|
|
68
74
|
box-shadow var(--icen-tx-fast);
|
|
75
|
+
padding-inline-end: calc(var(--icen-field-padding-inline) + 18px);
|
|
69
76
|
}
|
|
70
|
-
.select-trigger:hover:not(:disabled) {
|
|
71
|
-
border-color: var(--icen-
|
|
77
|
+
.icen-select-trigger:hover:not(:disabled) {
|
|
78
|
+
border-color: var(--icen-token-control-border-hover);
|
|
72
79
|
}
|
|
73
|
-
.select-trigger:focus-visible {
|
|
80
|
+
.icen-select-trigger:focus-visible {
|
|
74
81
|
outline: none;
|
|
75
82
|
border-color: var(--icen-control-focus-border);
|
|
76
83
|
box-shadow: var(--icen-control-focus-shadow);
|
|
77
84
|
}
|
|
78
|
-
.select-trigger:disabled,
|
|
79
|
-
.select[data-disabled] .select-trigger,
|
|
80
|
-
.select[aria-disabled='true'] .select-trigger {
|
|
85
|
+
.icen-select-trigger:disabled,
|
|
86
|
+
.icen-select[data-icen-disabled] .icen-select-trigger,
|
|
87
|
+
.icen-select[aria-disabled='true'] .icen-select-trigger {
|
|
81
88
|
opacity: var(--icen-disabled-opacity);
|
|
82
89
|
cursor: not-allowed;
|
|
83
90
|
pointer-events: none;
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
/* 尺寸变体(与 input-wrap 对齐) */
|
|
87
|
-
.select-trigger--sm { height: var(--
|
|
88
|
-
.select-trigger--lg { height: var(--
|
|
94
|
+
.icen-select-trigger--sm { height: var(--icen-control-height-sm); padding-inline: var(--icen-field-padding-inline-sm); font-size: var(--icen-density-font-size-sm); }
|
|
95
|
+
.icen-select-trigger--lg { height: var(--icen-control-height-lg); padding-inline: var(--icen-control-padding-inline-lg); font-size: var(--icen-density-font-size-lg); }
|
|
89
96
|
|
|
90
|
-
.select-leading {
|
|
97
|
+
.icen-select-leading {
|
|
91
98
|
display: inline-flex;
|
|
92
99
|
align-items: center;
|
|
93
100
|
flex-shrink: 0;
|
|
94
|
-
color: var(--token-text-faint);
|
|
101
|
+
color: var(--icen-token-text-faint);
|
|
95
102
|
}
|
|
96
|
-
.select-leading svg { width: 14px; height: 14px; }
|
|
103
|
+
.icen-select-leading svg { width: 14px; height: 14px; }
|
|
97
104
|
|
|
98
|
-
.select-value {
|
|
105
|
+
.icen-select-value {
|
|
99
106
|
flex: 1;
|
|
100
107
|
min-width: 0;
|
|
101
108
|
overflow: hidden;
|
|
102
109
|
text-overflow: ellipsis;
|
|
103
110
|
white-space: nowrap;
|
|
104
111
|
}
|
|
105
|
-
.select-value.is-empty {
|
|
106
|
-
color:
|
|
112
|
+
.icen-select-value.is-empty {
|
|
113
|
+
color: var(--icen-token-text-faint); /* 全量 faint:60% 混透浅色仅 ~2.4:1 低于 AA(faint 全量 ≥4.9:1) */
|
|
107
114
|
}
|
|
108
115
|
|
|
109
|
-
.select-chevron {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
.icen-select-chevron {
|
|
117
|
+
position: absolute;
|
|
118
|
+
inset-inline-end: var(--icen-field-padding-inline);
|
|
119
|
+
inset-block-start: 50%;
|
|
120
|
+
translate: 0 -50%;
|
|
121
|
+
inline-size: 12px;
|
|
122
|
+
block-size: 12px;
|
|
123
|
+
flex: none;
|
|
124
|
+
color: var(--icen-token-text-muted);
|
|
125
|
+
opacity: .82;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
transition: transform var(--icen-tx-fast), opacity var(--icen-tx-fast);
|
|
115
128
|
}
|
|
116
|
-
.select.is-open .select-chevron { transform: rotate(180deg); }
|
|
129
|
+
.icen-select.is-open .icen-select-chevron { transform: rotate(180deg); }
|
|
117
130
|
|
|
118
131
|
/* 面板由 behavior portal 到 body:left/top/width/max-height 由 JS 按 trigger rect inline 写入;
|
|
119
|
-
data-side="top|bottom" 标记翻侧方向;多选时 panel 带 data-select-multiple 属性。 */
|
|
120
|
-
.select-panel {
|
|
132
|
+
data-icen-side="top|bottom" 标记翻侧方向;多选时 panel 带 data-icen-select-multiple 属性。 */
|
|
133
|
+
.icen-select-panel {
|
|
121
134
|
position: absolute;
|
|
122
|
-
z-index: var(--z-popover);
|
|
135
|
+
z-index: var(--icen-z-popover);
|
|
123
136
|
overflow-y: auto;
|
|
124
137
|
overscroll-behavior: contain;
|
|
125
|
-
padding:
|
|
126
|
-
background: var(--token-
|
|
127
|
-
border: 1px solid var(--token-
|
|
128
|
-
border-radius: var(--radius-
|
|
129
|
-
box-shadow: var(--token-shadow-
|
|
138
|
+
padding: var(--icen-density-space-xs);
|
|
139
|
+
background: var(--icen-token-surface);
|
|
140
|
+
border: 1px solid var(--icen-token-material-edge);
|
|
141
|
+
border-radius: var(--icen-radius-lg);
|
|
142
|
+
box-shadow: var(--icen-token-material-light), var(--icen-token-shadow-elevated);
|
|
130
143
|
transform-origin: top center;
|
|
131
144
|
animation: icen-pop-in var(--icen-tx-fast);
|
|
132
145
|
}
|
|
133
|
-
.select-panel[data-side='top'] { transform-origin: bottom center; }
|
|
146
|
+
.icen-select-panel[data-icen-side='top'] { transform-origin: bottom center; }
|
|
147
|
+
.icen-select-options { min-inline-size: 0; }
|
|
134
148
|
|
|
135
149
|
/* 选项 */
|
|
136
|
-
.select-option {
|
|
150
|
+
.icen-select-option {
|
|
137
151
|
display: flex;
|
|
138
152
|
align-items: center;
|
|
139
|
-
gap: var(--
|
|
153
|
+
gap: var(--icen-control-gap-sm);
|
|
140
154
|
width: 100%;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
155
|
+
min-block-size: var(--icen-control-height-sm);
|
|
156
|
+
padding: 4px var(--icen-density-space-sm);
|
|
157
|
+
font-size: var(--icen-font-size-control);
|
|
158
|
+
text-align: start;
|
|
144
159
|
border: none;
|
|
145
160
|
background: transparent;
|
|
146
|
-
color: var(--token-text);
|
|
147
|
-
border-radius: var(--radius-
|
|
161
|
+
color: var(--icen-token-text);
|
|
162
|
+
border-radius: var(--icen-radius-xs);
|
|
148
163
|
cursor: pointer;
|
|
149
164
|
transition:
|
|
150
165
|
background-color var(--icen-tx-fast),
|
|
151
166
|
color var(--icen-tx-fast);
|
|
152
167
|
}
|
|
153
|
-
.select-option:hover:not(.is-disabled) { background: var(--token-fill-
|
|
154
|
-
.select-option.is-focused {
|
|
155
|
-
background: var(--token-fill-
|
|
156
|
-
color: var(--token-text);
|
|
168
|
+
.icen-select-option:hover:not(.is-disabled) { background: var(--icen-token-fill-hover); }
|
|
169
|
+
.icen-select-option.is-focused {
|
|
170
|
+
background: var(--icen-token-fill-selected);
|
|
171
|
+
color: var(--icen-token-text);
|
|
157
172
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
173
|
+
/* A checked popup item carries a trailing glyph, the desktop convention; color
|
|
174
|
+
* and weight remain redundant signals rather than the only distinction. */
|
|
175
|
+
.icen-select-option.is-selected {
|
|
176
|
+
color: var(--icen-token-text);
|
|
177
|
+
font-weight: var(--icen-font-weight-control);
|
|
178
|
+
background: var(--icen-token-fill-selected);
|
|
162
179
|
}
|
|
163
|
-
.select-option.is-selected::after {
|
|
164
|
-
content: '
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
180
|
+
.icen-select-option.is-selected::after {
|
|
181
|
+
content: '';
|
|
182
|
+
inline-size: 12px;
|
|
183
|
+
block-size: 12px;
|
|
184
|
+
flex: none;
|
|
185
|
+
margin-inline-start: auto;
|
|
186
|
+
background: currentColor;
|
|
187
|
+
mask: var(--icen-token-icon-check) center / contain no-repeat;
|
|
188
|
+
-webkit-mask: var(--icen-token-icon-check) center / contain no-repeat;
|
|
168
189
|
}
|
|
169
|
-
.select-option.is-
|
|
190
|
+
.icen-select-option.is-selected.is-focused,
|
|
191
|
+
.icen-select-option.is-selected:focus-visible {
|
|
192
|
+
outline: 2px solid var(--icen-token-accent);
|
|
193
|
+
outline-offset: -2px;
|
|
194
|
+
}
|
|
195
|
+
.icen-select-option.is-disabled {
|
|
170
196
|
opacity: 0.4;
|
|
171
197
|
cursor: not-allowed;
|
|
172
198
|
}
|
|
173
199
|
|
|
174
200
|
/* 分组(行为可选渲染 optgroup) */
|
|
175
|
-
.select-group {
|
|
201
|
+
.icen-select-group {
|
|
176
202
|
padding: 0 4px;
|
|
177
203
|
margin-top: 4px;
|
|
178
204
|
}
|
|
179
|
-
.select-group-label {
|
|
180
|
-
padding:
|
|
181
|
-
font-size: var(--
|
|
182
|
-
|
|
183
|
-
text-
|
|
184
|
-
letter-spacing:
|
|
205
|
+
.icen-select-group-label {
|
|
206
|
+
padding: 8px var(--icen-density-space-sm) 3px;
|
|
207
|
+
font-size: var(--icen-font-size-caption);
|
|
208
|
+
font-weight: 600;
|
|
209
|
+
color: var(--icen-token-text-muted);
|
|
210
|
+
letter-spacing: var(--icen-letter-spacing-caption);
|
|
185
211
|
}
|
|
186
212
|
|
|
187
213
|
/* 空状态(behavior 渲染 no-match) */
|
|
188
|
-
.select-empty {
|
|
189
|
-
padding: var(--density-space-md);
|
|
190
|
-
font-size: var(--density-font-size-sm);
|
|
191
|
-
color: var(--token-text-faint);
|
|
214
|
+
.icen-select-empty {
|
|
215
|
+
padding: var(--icen-density-space-md);
|
|
216
|
+
font-size: var(--icen-density-font-size-sm);
|
|
217
|
+
color: var(--icen-token-text-faint);
|
|
192
218
|
text-align: center;
|
|
193
219
|
}
|
|
194
220
|
|
|
195
|
-
/* ── 搜索框(data-select-search 时 behavior 自动注入) ── */
|
|
196
|
-
.select-search {
|
|
197
|
-
padding:
|
|
198
|
-
border-bottom: 1px solid var(--token-
|
|
199
|
-
margin-bottom:
|
|
221
|
+
/* ── 搜索框(data-icen-select-search 时 behavior 自动注入) ── */
|
|
222
|
+
.icen-select-search {
|
|
223
|
+
padding: var(--icen-density-space-xs);
|
|
224
|
+
border-bottom: 1px solid var(--icen-token-separator-soft);
|
|
225
|
+
margin-bottom: var(--icen-density-space-xs);
|
|
200
226
|
position: sticky;
|
|
201
227
|
top: 0;
|
|
202
|
-
background: var(--token-
|
|
228
|
+
background: var(--icen-token-surface);
|
|
203
229
|
z-index: 1;
|
|
204
230
|
}
|
|
205
|
-
.select-search-input {
|
|
206
|
-
width: 100%;
|
|
207
|
-
height: 30px;
|
|
208
|
-
padding: 0 var(--density-space-sm);
|
|
209
|
-
font-size: var(--density-font-size-sm);
|
|
210
|
-
color: var(--token-text);
|
|
211
|
-
background: var(--token-control);
|
|
212
|
-
border: 1px solid var(--token-outline-soft);
|
|
213
|
-
border-radius: var(--radius-sm);
|
|
214
|
-
transition: border-color var(--icen-tx-fast), box-shadow var(--icen-tx-fast);
|
|
215
|
-
}
|
|
216
|
-
.select-search-input:focus {
|
|
217
|
-
outline: none;
|
|
218
|
-
border-color: var(--icen-control-focus-border);
|
|
219
|
-
box-shadow: var(--icen-control-focus-shadow);
|
|
220
|
-
}
|
|
231
|
+
.icen-select-search-input { min-inline-size: 0; }
|
|
221
232
|
|
|
222
|
-
|
|
223
|
-
|
|
233
|
+
|
|
234
|
+
/* ── 多选清除按钮(与 trigger 同级,绝对定位叠进 trigger 行内末端侧、chevron 内侧) ── */
|
|
235
|
+
.icen-select-clear {
|
|
224
236
|
position: absolute;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
z-index: 1;
|
|
237
|
+
inset-block-start: 50%;
|
|
238
|
+
inset-inline-end: var(--icen-density-space-sm);
|
|
239
|
+
translate: 0 -50%;
|
|
229
240
|
display: inline-flex;
|
|
230
241
|
align-items: center;
|
|
231
242
|
justify-content: center;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
height: 18px;
|
|
243
|
+
inline-size: 24px;
|
|
244
|
+
block-size: 24px;
|
|
235
245
|
padding: 0;
|
|
236
246
|
border: 0;
|
|
237
|
-
border-radius: var(--radius-
|
|
247
|
+
border-radius: var(--icen-radius-sm);
|
|
238
248
|
background: transparent;
|
|
239
|
-
color: var(--token-text-
|
|
240
|
-
font-size: var(--density-font-size-lg);
|
|
241
|
-
line-height: 1;
|
|
249
|
+
color: var(--icen-token-text-muted);
|
|
242
250
|
cursor: pointer;
|
|
243
|
-
transition:
|
|
251
|
+
transition: opacity var(--icen-tx-fast), background-color var(--icen-tx-fast), color var(--icen-tx-fast);
|
|
244
252
|
}
|
|
245
|
-
.select-clear:hover {
|
|
246
|
-
color: var(--token-text);
|
|
247
|
-
background: var(--token-fill-1);
|
|
253
|
+
.icen-select-clear:hover {
|
|
254
|
+
color: var(--icen-token-text);
|
|
255
|
+
background: var(--icen-token-fill-1);
|
|
248
256
|
}
|
|
249
|
-
/* 有清除钮时 trigger
|
|
250
|
-
.select:has(.select-clear) .select-trigger { padding-
|
|
257
|
+
/* 有清除钮时 trigger 行内末端侧让位(clear 18px + chevron 14px + 间距) */
|
|
258
|
+
.icen-select:has(.icen-select-clear:not([hidden])) .icen-select-trigger { padding-inline-end: calc(var(--icen-density-space-sm) + var(--icen-density-input-height-sm) + var(--icen-density-space-xs)); }
|
|
251
259
|
|
|
252
260
|
/* ── 多选 chips(tag 式展示;× 仅 hover 对应 chip 时出现) ── */
|
|
253
|
-
.select-chips {
|
|
261
|
+
.icen-select-chips {
|
|
254
262
|
display: inline-flex;
|
|
255
263
|
flex-wrap: wrap;
|
|
256
264
|
align-items: center;
|
|
@@ -258,73 +266,124 @@
|
|
|
258
266
|
flex: 1;
|
|
259
267
|
min-width: 0;
|
|
260
268
|
}
|
|
261
|
-
.select-chip {
|
|
269
|
+
.icen-select-chip {
|
|
262
270
|
display: inline-flex;
|
|
263
271
|
align-items: center;
|
|
264
|
-
max-
|
|
265
|
-
font-size: var(--density-font-size-xs);
|
|
272
|
+
max-inline-size: 100%;
|
|
273
|
+
font-size: var(--icen-density-font-size-xs);
|
|
266
274
|
line-height: 1.6;
|
|
267
|
-
color: var(--token-text);
|
|
268
|
-
background: var(--token-fill-2);
|
|
269
|
-
border-radius: var(--radius-sm);
|
|
275
|
+
color: var(--icen-token-text);
|
|
276
|
+
background: var(--icen-token-fill-2);
|
|
277
|
+
border-radius: var(--icen-radius-sm);
|
|
270
278
|
padding: 0 7px;
|
|
271
279
|
white-space: nowrap;
|
|
272
280
|
}
|
|
273
|
-
.select-chip-x {
|
|
281
|
+
.icen-select-chip-x {
|
|
274
282
|
display: inline-flex;
|
|
275
283
|
align-items: center;
|
|
276
284
|
justify-content: center;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
margin-
|
|
281
|
-
|
|
282
|
-
border
|
|
283
|
-
|
|
284
|
-
|
|
285
|
+
flex: none;
|
|
286
|
+
inline-size: 24px; /* WCAG 2.5.8 下限:16px 的移除钮在桌面端也易误触(移除是删数据操作) */
|
|
287
|
+
block-size: 24px;
|
|
288
|
+
margin-inline-start: var(--icen-density-space-xs);
|
|
289
|
+
padding: 0;
|
|
290
|
+
border: 0;
|
|
291
|
+
border-radius: var(--icen-radius-xs);
|
|
292
|
+
background: transparent;
|
|
293
|
+
color: var(--icen-token-text-muted);
|
|
285
294
|
cursor: pointer;
|
|
286
|
-
transition:
|
|
287
|
-
width var(--icen-tx-fast),
|
|
288
|
-
opacity var(--icen-tx-fast),
|
|
289
|
-
margin-left var(--icen-tx-fast),
|
|
290
|
-
color var(--icen-tx-fast);
|
|
295
|
+
transition: opacity var(--icen-tx-fast), background-color var(--icen-tx-fast), color var(--icen-tx-fast);
|
|
291
296
|
}
|
|
292
|
-
.select-chip:
|
|
293
|
-
.select-chip-x:
|
|
294
|
-
.select-chip
|
|
295
|
-
.select-chip--more { color: var(--token-text-muted); background: var(--token-fill-1); }
|
|
297
|
+
.icen-select-chip-x:focus-visible { outline: 2px solid var(--icen-token-accent); outline-offset: 1px; }
|
|
298
|
+
.icen-select-chip-x:hover { color: var(--icen-token-error); }
|
|
299
|
+
.icen-select-chip--more { color: var(--icen-token-text-muted); background: var(--icen-token-fill-1); }
|
|
296
300
|
|
|
297
301
|
/* ── 多选 trigger 高度自适应(chips 可能换行) ── */
|
|
298
|
-
.select[data-select-multiple] .select-trigger {
|
|
299
|
-
min-height: var(--
|
|
302
|
+
.icen-select[data-icen-select-multiple] .icen-select-trigger {
|
|
303
|
+
min-height: var(--select-height);
|
|
300
304
|
height: auto;
|
|
301
305
|
padding-top: 4px;
|
|
302
306
|
padding-bottom: 4px;
|
|
303
307
|
flex-wrap: wrap;
|
|
304
308
|
}
|
|
309
|
+
/* sm 档的 chips 需要压到 24px 拇指高度内:24px chip + 2px×2 内距 = 28px 控件高。 */
|
|
310
|
+
.icen-select[data-icen-select-multiple]:has(> .icen-select-trigger--sm) .icen-select-trigger {
|
|
311
|
+
padding-block: 2px;
|
|
312
|
+
}
|
|
313
|
+
.icen-select[data-icen-select-multiple]:has(> .icen-select-trigger--sm) > .icen-select-chips {
|
|
314
|
+
padding-block: 2px;
|
|
315
|
+
}
|
|
305
316
|
|
|
306
|
-
|
|
307
|
-
.select-panel
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
flex-shrink: 0;
|
|
312
|
-
border: 1.5px solid var(--token-outline);
|
|
313
|
-
border-radius: var(--radius-xs);
|
|
314
|
-
transition: background-color var(--icen-tx-fast), border-color var(--icen-tx-fast);
|
|
317
|
+
@media (prefers-reduced-motion: reduce) {
|
|
318
|
+
.icen-select-panel { animation: none; }
|
|
319
|
+
.icen-select-search-input,
|
|
320
|
+
.icen-select-chip-x,
|
|
321
|
+
.icen-select-clear { transition: none; }
|
|
315
322
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
323
|
+
|
|
324
|
+
@media (hover: hover) and (pointer: fine) {
|
|
325
|
+
.icen-select-clear:not([hidden]) { opacity: 0; pointer-events: none; }
|
|
326
|
+
.icen-select:is(:hover,:focus-within) .icen-select-clear:not([hidden]) { opacity: 1; pointer-events: auto; }
|
|
319
327
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
328
|
+
@media (pointer: coarse) {
|
|
329
|
+
.icen-select-clear { min-inline-size: 44px; min-block-size: 44px; inset-inline-end: var(--icen-density-space-sm); }
|
|
330
|
+
.icen-select:has(.icen-select-clear:not([hidden])) .icen-select-trigger { padding-inline-end: calc(var(--icen-density-input-height-sm) + var(--icen-density-space-sm) + var(--icen-density-space-xs)); }
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.icen-select-trigger--sm, .icen-select-trigger--lg { padding-inline-end: var(--icen-density-space-sm); }
|
|
334
|
+
|
|
335
|
+
/* The chips and trigger occupy one grid cell without nesting interactive elements. */
|
|
336
|
+
.icen-select:has(> .icen-select-chips:not([hidden])) { display: grid; }
|
|
337
|
+
.icen-select:has(> .icen-select-chips:not([hidden])) > .icen-select-trigger {
|
|
338
|
+
grid-area: 1 / 1;
|
|
339
|
+
block-size: auto;
|
|
340
|
+
min-block-size: var(--select-height);
|
|
341
|
+
align-self: stretch;
|
|
342
|
+
}
|
|
343
|
+
.icen-select > .icen-select-chips {
|
|
344
|
+
position: relative;
|
|
345
|
+
grid-area: 1 / 1;
|
|
346
|
+
align-self: center;
|
|
347
|
+
min-block-size: var(--select-height);
|
|
348
|
+
padding-block: var(--icen-density-space-xs);
|
|
349
|
+
padding-inline-start: var(--icen-density-space-sm);
|
|
350
|
+
padding-inline-end: var(--icen-density-space-sm);
|
|
351
|
+
pointer-events: none;
|
|
352
|
+
}
|
|
353
|
+
.icen-select:has(.icen-select-clear:not([hidden])) > .icen-select-chips { padding-inline-end: calc(var(--icen-density-space-sm) + var(--icen-density-input-height-sm) + var(--icen-density-space-xs)); }
|
|
354
|
+
.icen-select-chip { pointer-events: auto; }
|
|
355
|
+
.icen-select-chip > span { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
356
|
+
@media (hover: hover) and (pointer: fine) {
|
|
357
|
+
.icen-select-chip-x { opacity: 0; }
|
|
358
|
+
.icen-select-chip:is(:hover,:focus-within) .icen-select-chip-x { opacity: 1; }
|
|
359
|
+
}
|
|
360
|
+
@media (pointer: coarse) {
|
|
361
|
+
.icen-select-chip-x { min-inline-size: 44px; min-block-size: 44px; }
|
|
362
|
+
.icen-select:has(.icen-select-clear:not([hidden])) > .icen-select-chips { padding-inline-end: calc(var(--icen-density-input-height-sm) + var(--icen-density-space-sm) + var(--icen-density-space-xs)); }
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.icen-select-chips[hidden], .icen-select-clear[hidden] { display: none; }
|
|
366
|
+
|
|
367
|
+
/* Optional rich-option color sample: copied markup works with select.css alone. */
|
|
368
|
+
.icen-select-swatch { display: inline-flex; flex: none; inline-size: 36px; block-size: 18px; border: 1px solid var(--icen-token-line-soft); border-radius: var(--icen-radius-xs); overflow: hidden; }
|
|
369
|
+
.icen-select-swatch > i { flex: 1; }
|
|
370
|
+
|
|
371
|
+
.icen-select:has(> .icen-select-trigger--sm) { --select-height: var(--icen-density-input-height-sm); }
|
|
372
|
+
.icen-select:has(> .icen-select-trigger--lg) { --select-height: var(--icen-density-input-height-lg); }
|
|
373
|
+
|
|
374
|
+
.icen-select-panel:has(> .icen-select-search) { scroll-padding-block-start: calc(var(--icen-density-input-height-sm) + 3 * var(--icen-density-space-xs) + var(--icen-density-space-sm) + 1px); }
|
|
375
|
+
|
|
376
|
+
/* Clear affordance replaces the popup glyph in the trailing slot; the two are
|
|
377
|
+
* never shown together, so the trigger keeps one stable optical end. */
|
|
378
|
+
.icen-select:has(.icen-select-clear:not([hidden])) .icen-select-chevron { display: none; }
|
|
379
|
+
|
|
380
|
+
/* 高对比模式:选中项用系统高亮,勾选 glyph 保留在 HighlightText 上 */
|
|
381
|
+
@media (forced-colors: active) {
|
|
382
|
+
.icen-select-option.is-selected {
|
|
383
|
+
background: Highlight;
|
|
384
|
+
color: HighlightText;
|
|
385
|
+
}
|
|
386
|
+
.icen-select-option.is-selected::after { background: HighlightText; }
|
|
323
387
|
}
|
|
324
388
|
|
|
325
|
-
@media (prefers-reduced-motion: reduce) {
|
|
326
|
-
.select-panel { animation: none; }
|
|
327
|
-
.select-search-input,
|
|
328
|
-
.select-chip-x,
|
|
329
|
-
.select-clear { transition: none; }
|
|
330
389
|
}
|