@apexhub/apex-ui-react-source 0.0.0-stage → 1.2.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/LICENSE +21 -0
- package/README.md +97 -2
- package/bin/apex-ui-react-source.mjs +717 -0
- package/dist/files/AGENTS.md +89 -0
- package/dist/files/LICENSE +21 -0
- package/dist/files/_assets/adapt-to-page.raw.ts +3 -0
- package/dist/files/_assets/adapt-to-page.url.ts +3 -0
- package/dist/files/_assets/calendar.raw.ts +3 -0
- package/dist/files/_assets/doc-format.raw.ts +3 -0
- package/dist/files/_assets/docx-format.raw.ts +3 -0
- package/dist/files/_assets/full-screen.raw.ts +3 -0
- package/dist/files/_assets/full-screen.url.ts +3 -0
- package/dist/files/_assets/gif-format.raw.ts +3 -0
- package/dist/files/_assets/jpeg-format.raw.ts +3 -0
- package/dist/files/_assets/jpg-format.raw.ts +3 -0
- package/dist/files/_assets/ofd-format.raw.ts +3 -0
- package/dist/files/_assets/one-to-one.raw.ts +3 -0
- package/dist/files/_assets/one-to-one.url.ts +3 -0
- package/dist/files/_assets/pdf-format.raw.ts +3 -0
- package/dist/files/_assets/png-format.raw.ts +3 -0
- package/dist/files/_assets/rotate-left.raw.ts +3 -0
- package/dist/files/_assets/rotate-left.url.ts +3 -0
- package/dist/files/_assets/rotate-right.raw.ts +3 -0
- package/dist/files/_assets/rotate-right.url.ts +3 -0
- package/dist/files/_assets/table-empty.url.ts +3 -0
- package/dist/files/_assets/txt-format.raw.ts +3 -0
- package/dist/files/_assets/upload-file-doc-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-docx-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-gif-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-jpeg-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-jpg-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-ofd-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-pdf-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-png-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-txt-20.raw.ts +3 -0
- package/dist/files/_assets/upload-file-xlsx-20.raw.ts +3 -0
- package/dist/files/_assets/xlsx-format.raw.ts +3 -0
- package/dist/files/_assets/zoom-in.raw.ts +3 -0
- package/dist/files/_assets/zoom-in.url.ts +3 -0
- package/dist/files/_assets/zoom-out.raw.ts +3 -0
- package/dist/files/_assets/zoom-out.url.ts +3 -0
- package/dist/files/_headless/dismiss-intent.ts +1 -0
- package/dist/files/_headless/placement.ts +1 -0
- package/dist/files/_headless/use-embedded-scroll-lock-guard.ts +47 -0
- package/dist/files/_headless/use-floating-overlay.tsx +3 -0
- package/dist/files/_namespace/constants.ts +23 -0
- package/dist/files/_namespace/index.ts +1 -0
- package/dist/files/_overlay/auto-update-anchored-overlay.ts +11 -0
- package/dist/files/_overlay/collision-boundary.ts +78 -0
- package/dist/files/_overlay/dismiss-intent.ts +107 -0
- package/dist/files/_overlay/get-overlay-root.ts +157 -0
- package/dist/files/_overlay/index.ts +57 -0
- package/dist/files/_overlay/observe-anchor-lifecycle.ts +72 -0
- package/dist/files/_overlay/overlay-theme.ts +91 -0
- package/dist/files/_overlay/overlay-trigger.ts +100 -0
- package/dist/files/_overlay/overlay.css +29 -0
- package/dist/files/_overlay/placement.ts +18 -0
- package/dist/files/_overlay/resolve-portal-container.ts +13 -0
- package/dist/files/_overlay/use-anchored-overlay.tsx +493 -0
- package/dist/files/_overlay/zIndex.ts +17 -0
- package/dist/files/_tags/MaxTagList.tsx +336 -0
- package/dist/files/_tags/OverflowTagPopover.tsx +315 -0
- package/dist/files/_tags/get-max-tag-display.ts +26 -0
- package/dist/files/_tags/index.ts +15 -0
- package/dist/files/_tags/resolve-max-tag-popover.ts +28 -0
- package/dist/files/_tags/tags.css +126 -0
- package/dist/files/_tags/types.ts +46 -0
- package/dist/files/_tags/use-responsive-max-tag-count.ts +165 -0
- package/dist/files/alert/Alert.tsx +100 -0
- package/dist/files/alert/alert.css +85 -0
- package/dist/files/alert/index.ts +2 -0
- package/dist/files/alert/interface.ts +59 -0
- package/dist/files/alert/llm.txt +160 -0
- package/dist/files/alert/tokens.txt +44 -0
- package/dist/files/alert/variants.ts +17 -0
- package/dist/files/apex-env.d.ts +2 -0
- package/dist/files/apex-provider/ApexProvider.tsx +53 -0
- package/dist/files/apex-provider/apex-provider.css +0 -0
- package/dist/files/apex-provider/context.ts +17 -0
- package/dist/files/apex-provider/index.ts +18 -0
- package/dist/files/apex-provider/interface.ts +181 -0
- package/dist/files/apex-provider/llm.txt +367 -0
- package/dist/files/apex-provider/localeKind.ts +20 -0
- package/dist/files/auto-complete/AutoComplete.tsx +419 -0
- package/dist/files/auto-complete/auto-complete.css +108 -0
- package/dist/files/auto-complete/auto-complete.stories.css +17 -0
- package/dist/files/auto-complete/index.ts +8 -0
- package/dist/files/auto-complete/interface.ts +77 -0
- package/dist/files/auto-complete/llm.txt +374 -0
- package/dist/files/auto-complete/tokens.txt +77 -0
- package/dist/files/auto-complete/variants.ts +19 -0
- package/dist/files/avatar/Avatar.tsx +277 -0
- package/dist/files/avatar/avatar.css +159 -0
- package/dist/files/avatar/index.ts +2 -0
- package/dist/files/avatar/interface.ts +147 -0
- package/dist/files/avatar/llm.txt +195 -0
- package/dist/files/avatar/tokens.txt +38 -0
- package/dist/files/avatar/use-responsive-size.ts +66 -0
- package/dist/files/avatar/variants.ts +41 -0
- package/dist/files/breadcrumb/Breadcrumb.stories.css +5 -0
- package/dist/files/breadcrumb/Breadcrumb.tsx +238 -0
- package/dist/files/breadcrumb/BreadcrumbLink.tsx +63 -0
- package/dist/files/breadcrumb/BreadcrumbSeparatorIcon.tsx +30 -0
- package/dist/files/breadcrumb/breadcrumb.css +113 -0
- package/dist/files/breadcrumb/index.ts +12 -0
- package/dist/files/breadcrumb/interface.ts +81 -0
- package/dist/files/breadcrumb/llm.txt +249 -0
- package/dist/files/breadcrumb/tokens.txt +193 -0
- package/dist/files/breadcrumb/variants.ts +8 -0
- package/dist/files/button/Button.tsx +235 -0
- package/dist/files/button/button.css +261 -0
- package/dist/files/button/index.ts +2 -0
- package/dist/files/button/interface.ts +145 -0
- package/dist/files/button/llm.txt +254 -0
- package/dist/files/button/tokens.txt +470 -0
- package/dist/files/button/variants.ts +89 -0
- package/dist/files/card/Card.tsx +63 -0
- package/dist/files/card/card.css +66 -0
- package/dist/files/card/index.ts +2 -0
- package/dist/files/card/interface.ts +25 -0
- package/dist/files/card/llm.txt +93 -0
- package/dist/files/card/tokens.txt +27 -0
- package/dist/files/cascader/Cascader.tsx +955 -0
- package/dist/files/cascader/_adapter/locale.ts +4 -0
- package/dist/files/cascader/cascader-data.ts +354 -0
- package/dist/files/cascader/cascader.css +382 -0
- package/dist/files/cascader/index.ts +16 -0
- package/dist/files/cascader/interface.ts +358 -0
- package/dist/files/cascader/llm.txt +897 -0
- package/dist/files/cascader/tokens.txt +253 -0
- package/dist/files/cascader/variants.ts +35 -0
- package/dist/files/checkbox/Checkbox.tsx +477 -0
- package/dist/files/checkbox/checkbox.css +196 -0
- package/dist/files/checkbox/index.ts +9 -0
- package/dist/files/checkbox/interface.ts +162 -0
- package/dist/files/checkbox/llm.txt +326 -0
- package/dist/files/checkbox/tokens.txt +28 -0
- package/dist/files/checkbox/variants.ts +29 -0
- package/dist/files/clear/Clear.tsx +49 -0
- package/dist/files/clear/clear.css +60 -0
- package/dist/files/clear/index.ts +2 -0
- package/dist/files/clear/interface.ts +8 -0
- package/dist/files/collapse/Collapse.tsx +163 -0
- package/dist/files/collapse/collapse.css +174 -0
- package/dist/files/collapse/index.ts +2 -0
- package/dist/files/collapse/interface.ts +132 -0
- package/dist/files/collapse/llm.txt +328 -0
- package/dist/files/collapse/tokens.txt +84 -0
- package/dist/files/core/date-picker/index.ts +191 -0
- package/dist/files/core/form/index.ts +212 -0
- package/dist/files/core/index.ts +11 -0
- package/dist/files/core/input-number/index.ts +112 -0
- package/dist/files/core/namespace/index.ts +14 -0
- package/dist/files/core/overlay/index.ts +40 -0
- package/dist/files/core/pagination/index.ts +128 -0
- package/dist/files/core/table/access.ts +37 -0
- package/dist/files/core/table/columns.ts +4 -0
- package/dist/files/core/table/data-model.ts +58 -0
- package/dist/files/core/table/fixed-offset.ts +29 -0
- package/dist/files/core/table/grouped-header.ts +24 -0
- package/dist/files/core/table/index.ts +11 -0
- package/dist/files/core/table/merge.ts +132 -0
- package/dist/files/core/table/pagination.ts +51 -0
- package/dist/files/core/table/rowModel.ts +4 -0
- package/dist/files/core/table/types.ts +14 -0
- package/dist/files/core/typography/index.ts +125 -0
- package/dist/files/core/upload/file-type.ts +160 -0
- package/dist/files/core/upload/format-size.ts +17 -0
- package/dist/files/core/upload/index.ts +19 -0
- package/dist/files/core/upload/limits.ts +76 -0
- package/dist/files/core/utils/cn.ts +6 -0
- package/dist/files/core/utils/index.ts +2 -0
- package/dist/files/core/utils/svg.ts +101 -0
- package/dist/files/date-picker/DatePicker.tsx +601 -0
- package/dist/files/date-picker/RangePicker.tsx +1047 -0
- package/dist/files/date-picker/Trigger.tsx +115 -0
- package/dist/files/date-picker/_adapter/calendar.ts +136 -0
- package/dist/files/date-picker/_adapter/disable.ts +89 -0
- package/dist/files/date-picker/_adapter/format.ts +54 -0
- package/dist/files/date-picker/_adapter/keymap.ts +17 -0
- package/dist/files/date-picker/_adapter/locale.ts +4 -0
- package/dist/files/date-picker/_adapter/presets.ts +30 -0
- package/dist/files/date-picker/_adapter/range.ts +44 -0
- package/dist/files/date-picker/_adapter/types.ts +29 -0
- package/dist/files/date-picker/context.ts +60 -0
- package/dist/files/date-picker/date-picker.css +1093 -0
- package/dist/files/date-picker/index.ts +26 -0
- package/dist/files/date-picker/interface.ts +135 -0
- package/dist/files/date-picker/llm.txt +422 -0
- package/dist/files/date-picker/panels/DatePanel.tsx +110 -0
- package/dist/files/date-picker/panels/DecadePanel.tsx +49 -0
- package/dist/files/date-picker/panels/Footer.tsx +109 -0
- package/dist/files/date-picker/panels/Header.tsx +228 -0
- package/dist/files/date-picker/panels/MonthPanel.tsx +83 -0
- package/dist/files/date-picker/panels/Panel.tsx +339 -0
- package/dist/files/date-picker/panels/QuarterPanel.tsx +70 -0
- package/dist/files/date-picker/panels/TimePanel.tsx +171 -0
- package/dist/files/date-picker/panels/WeekPanel.tsx +145 -0
- package/dist/files/date-picker/panels/YearPanel.tsx +89 -0
- package/dist/files/date-picker/panels/time-panel-utils.ts +33 -0
- package/dist/files/date-picker/tokens.txt +171 -0
- package/dist/files/date-picker/variants.ts +20 -0
- package/dist/files/divider/Divider.tsx +80 -0
- package/dist/files/divider/divider.css +66 -0
- package/dist/files/divider/index.ts +7 -0
- package/dist/files/divider/interface.ts +58 -0
- package/dist/files/divider/llm.txt +158 -0
- package/dist/files/divider/tokens.txt +22 -0
- package/dist/files/drawer/Drawer.tsx +491 -0
- package/dist/files/drawer/drawer.css +201 -0
- package/dist/files/drawer/index.ts +13 -0
- package/dist/files/drawer/interface.ts +172 -0
- package/dist/files/drawer/llm.txt +374 -0
- package/dist/files/drawer/tokens.txt +71 -0
- package/dist/files/drawer/variants.ts +14 -0
- package/dist/files/dropdown/Dropdown.tsx +629 -0
- package/dist/files/dropdown/dropdown.css +243 -0
- package/dist/files/dropdown/index.ts +12 -0
- package/dist/files/dropdown/interface.ts +91 -0
- package/dist/files/dropdown/lib.ts +78 -0
- package/dist/files/dropdown/llm.txt +427 -0
- package/dist/files/dropdown/tokens.txt +59 -0
- package/dist/files/form/Form.tsx +229 -0
- package/dist/files/form/FormItem.tsx +526 -0
- package/dist/files/form/_adapter/bindField.ts +189 -0
- package/dist/files/form/_adapter/compileRules.ts +185 -0
- package/dist/files/form/_adapter/controlStatus.ts +23 -0
- package/dist/files/form/_adapter/deriveStatus.ts +42 -0
- package/dist/files/form/_adapter/instance.ts +281 -0
- package/dist/files/form/_adapter/messages.ts +15 -0
- package/dist/files/form/_adapter/types.ts +82 -0
- package/dist/files/form/_adapter/validationMeta.ts +29 -0
- package/dist/files/form/_adapter/validationTransaction.ts +69 -0
- package/dist/files/form/context.ts +38 -0
- package/dist/files/form/form.css +268 -0
- package/dist/files/form/index.ts +13 -0
- package/dist/files/form/interface.ts +99 -0
- package/dist/files/form/llm.txt +346 -0
- package/dist/files/form/tokens.txt +26 -0
- package/dist/files/form/useForm.ts +150 -0
- package/dist/files/form/utils.ts +28 -0
- package/dist/files/form/variants.ts +30 -0
- package/dist/files/global.css +8 -0
- package/dist/files/grid/Col.tsx +104 -0
- package/dist/files/grid/Grid.tsx +18 -0
- package/dist/files/grid/Row.tsx +129 -0
- package/dist/files/grid/grid.css +990 -0
- package/dist/files/grid/index.ts +12 -0
- package/dist/files/grid/interface.ts +109 -0
- package/dist/files/grid/llm.txt +419 -0
- package/dist/files/grid/useBreakpoint.ts +67 -0
- package/dist/files/icon/Icon.tsx +16 -0
- package/dist/files/icon/icon.css +26 -0
- package/dist/files/icon/icons-map.ts +1 -0
- package/dist/files/icon/index.ts +2 -0
- package/dist/files/icon/interface.ts +9 -0
- package/dist/files/icons/ActionIcons.tsx +105 -0
- package/dist/files/icons/AlertCloseIcon.tsx +21 -0
- package/dist/files/icons/CalendarIcon.tsx +6 -0
- package/dist/files/icons/CaretIcons.tsx +43 -0
- package/dist/files/icons/FileFormatIcons.tsx +27 -0
- package/dist/files/icons/Icons.tsx +10 -0
- package/dist/files/icons/MagnifyingGlassIcon.tsx +26 -0
- package/dist/files/icons/MessageIcons.tsx +111 -0
- package/dist/files/icons/NavigationIcons.tsx +126 -0
- package/dist/files/icons/PreviewIcons.tsx +18 -0
- package/dist/files/icons/StarIcons.tsx +71 -0
- package/dist/files/icons/UploadIcons.tsx +167 -0
- package/dist/files/icons/XCloseIcon.tsx +26 -0
- package/dist/files/icons/createAssetIcon.tsx +64 -0
- package/dist/files/icons/icons.css +4 -0
- package/dist/files/icons/index.ts +36 -0
- package/dist/files/icons/interface.ts +9 -0
- package/dist/files/icons/registry.ts +94 -0
- package/dist/files/image/Image.tsx +328 -0
- package/dist/files/image/ImageActionIcons.tsx +60 -0
- package/dist/files/image/ImagePreview.tsx +684 -0
- package/dist/files/image/_adapter/locale.ts +4 -0
- package/dist/files/image/image.css +451 -0
- package/dist/files/image/index.ts +7 -0
- package/dist/files/image/interface.ts +139 -0
- package/dist/files/image/llm.txt +429 -0
- package/dist/files/image/tokens.txt +28 -0
- package/dist/files/input/Input.tsx +261 -0
- package/dist/files/input/icons.tsx +3 -0
- package/dist/files/input/index.ts +12 -0
- package/dist/files/input/input-clear.stories.css +12 -0
- package/dist/files/input/input-size.ts +36 -0
- package/dist/files/input/input.css +366 -0
- package/dist/files/input/interface.ts +204 -0
- package/dist/files/input/lib.ts +51 -0
- package/dist/files/input/llm.txt +419 -0
- package/dist/files/input/tokens.txt +136 -0
- package/dist/files/input/variants.ts +17 -0
- package/dist/files/input-number/InputNumber.tsx +510 -0
- package/dist/files/input-number/icons.tsx +28 -0
- package/dist/files/input-number/index.ts +15 -0
- package/dist/files/input-number/input-number.css +440 -0
- package/dist/files/input-number/interface.ts +269 -0
- package/dist/files/input-number/lib.ts +128 -0
- package/dist/files/input-number/llm.txt +484 -0
- package/dist/files/input-number/tokens.txt +159 -0
- package/dist/files/input-number/variants.ts +27 -0
- package/dist/files/layout/Layout.tsx +360 -0
- package/dist/files/layout/index.ts +21 -0
- package/dist/files/layout/interface.ts +106 -0
- package/dist/files/layout/layout.css +278 -0
- package/dist/files/layout/llm.txt +296 -0
- package/dist/files/layout/tokens.txt +29 -0
- package/dist/files/llms-theme.txt +32 -0
- package/dist/files/llms.txt +895 -0
- package/dist/files/locale/en_US.ts +167 -0
- package/dist/files/locale/zh_CN.ts +166 -0
- package/dist/files/menu/Menu.stories.shared.tsx +85 -0
- package/dist/files/menu/Menu.tsx +713 -0
- package/dist/files/menu/demo/menu-sliding-panel.css +71 -0
- package/dist/files/menu/demo/use-sliding-panel.ts +35 -0
- package/dist/files/menu/icons.tsx +92 -0
- package/dist/files/menu/index.ts +17 -0
- package/dist/files/menu/interface.ts +229 -0
- package/dist/files/menu/lib.ts +160 -0
- package/dist/files/menu/llm.txt +686 -0
- package/dist/files/menu/menu.css +455 -0
- package/dist/files/menu/tokens.txt +87 -0
- package/dist/files/message/Message.tsx +217 -0
- package/dist/files/message/index.ts +2 -0
- package/dist/files/message/interface.ts +149 -0
- package/dist/files/message/lib/constants.ts +18 -0
- package/dist/files/message/lib/helpers.ts +26 -0
- package/dist/files/message/lib/motion.ts +117 -0
- package/dist/files/message/lib/store.ts +72 -0
- package/dist/files/message/llm.txt +301 -0
- package/dist/files/message/message.css +178 -0
- package/dist/files/message/tokens.txt +25 -0
- package/dist/files/modal/Modal.tsx +547 -0
- package/dist/files/modal/_adapter/locale.ts +4 -0
- package/dist/files/modal/index.ts +16 -0
- package/dist/files/modal/interface.ts +368 -0
- package/dist/files/modal/lib/ConfirmDialog.tsx +229 -0
- package/dist/files/modal/lib/confirm.tsx +112 -0
- package/dist/files/modal/lib/confirmIcons.tsx +21 -0
- package/dist/files/modal/lib/useModal.tsx +130 -0
- package/dist/files/modal/llm.txt +586 -0
- package/dist/files/modal/modal-padding.stories.css +22 -0
- package/dist/files/modal/modal.css +322 -0
- package/dist/files/modal/tokens.txt +96 -0
- package/dist/files/modal/variants.ts +41 -0
- package/dist/files/notification/Notification.tsx +354 -0
- package/dist/files/notification/index.ts +8 -0
- package/dist/files/notification/interface.ts +140 -0
- package/dist/files/notification/lib/constants.ts +40 -0
- package/dist/files/notification/lib/helpers.ts +31 -0
- package/dist/files/notification/lib/motion.ts +148 -0
- package/dist/files/notification/lib/store.ts +149 -0
- package/dist/files/notification/llm.txt +386 -0
- package/dist/files/notification/notification.css +416 -0
- package/dist/files/notification/tokens.txt +79 -0
- package/dist/files/pagination/PageButton.tsx +48 -0
- package/dist/files/pagination/PageSizeChanger.tsx +42 -0
- package/dist/files/pagination/Pagination.tsx +308 -0
- package/dist/files/pagination/QuickJumper.tsx +52 -0
- package/dist/files/pagination/TotalText.tsx +28 -0
- package/dist/files/pagination/_adapter/calculate.ts +33 -0
- package/dist/files/pagination/_adapter/locale.ts +4 -0
- package/dist/files/pagination/_adapter/responsive.ts +22 -0
- package/dist/files/pagination/_adapter/types.ts +27 -0
- package/dist/files/pagination/context.ts +15 -0
- package/dist/files/pagination/index.ts +3 -0
- package/dist/files/pagination/interface.ts +55 -0
- package/dist/files/pagination/llm.txt +204 -0
- package/dist/files/pagination/pagination.css +241 -0
- package/dist/files/pagination/tokens.txt +33 -0
- package/dist/files/pagination/useResizeObserver.ts +40 -0
- package/dist/files/pagination/variants.ts +3 -0
- package/dist/files/popover/Popover.tsx +353 -0
- package/dist/files/popover/index.ts +2 -0
- package/dist/files/popover/interface.ts +124 -0
- package/dist/files/popover/llm.txt +235 -0
- package/dist/files/popover/placement.ts +39 -0
- package/dist/files/popover/popover.css +65 -0
- package/dist/files/popover/popover.stories.css +42 -0
- package/dist/files/popover/tokens.txt +28 -0
- package/dist/files/progress/Progress.tsx +213 -0
- package/dist/files/progress/index.ts +4 -0
- package/dist/files/progress/interface.ts +89 -0
- package/dist/files/progress/llm.txt +277 -0
- package/dist/files/progress/progress.css +192 -0
- package/dist/files/progress/tokens.txt +83 -0
- package/dist/files/radio/Radio.tsx +315 -0
- package/dist/files/radio/context.tsx +16 -0
- package/dist/files/radio/helpers.ts +163 -0
- package/dist/files/radio/index.ts +13 -0
- package/dist/files/radio/interface.ts +207 -0
- package/dist/files/radio/llm.txt +344 -0
- package/dist/files/radio/radio.css +137 -0
- package/dist/files/radio/tokens.txt +21 -0
- package/dist/files/radio/variants.ts +20 -0
- package/dist/files/rate/Rate.tsx +199 -0
- package/dist/files/rate/RateItem.tsx +113 -0
- package/dist/files/rate/StarFilled.tsx +19 -0
- package/dist/files/rate/index.ts +11 -0
- package/dist/files/rate/interface.ts +116 -0
- package/dist/files/rate/lib.ts +72 -0
- package/dist/files/rate/llm.txt +237 -0
- package/dist/files/rate/rate.css +126 -0
- package/dist/files/rate/tokens.txt +20 -0
- package/dist/files/rate/variants.ts +19 -0
- package/dist/files/scrollbar.css +148 -0
- package/dist/files/select/Select.tsx +1366 -0
- package/dist/files/select/_adapter/locale.ts +4 -0
- package/dist/files/select/index.ts +17 -0
- package/dist/files/select/interface.ts +494 -0
- package/dist/files/select/llm.txt +828 -0
- package/dist/files/select/select-overflow.stories.css +3 -0
- package/dist/files/select/select.css +443 -0
- package/dist/files/select/tokens.txt +160 -0
- package/dist/files/select/variants.ts +63 -0
- package/dist/files/skeleton/Skeleton.tsx +345 -0
- package/dist/files/skeleton/index.ts +19 -0
- package/dist/files/skeleton/interface.ts +101 -0
- package/dist/files/skeleton/llm.txt +274 -0
- package/dist/files/skeleton/skeleton.css +171 -0
- package/dist/files/skeleton/tokens.txt +15 -0
- package/dist/files/skeleton/variants.ts +40 -0
- package/dist/files/spin/Spin.tsx +197 -0
- package/dist/files/spin/index.ts +2 -0
- package/dist/files/spin/interface.ts +69 -0
- package/dist/files/spin/llm.txt +294 -0
- package/dist/files/spin/spin.css +111 -0
- package/dist/files/spin/tokens.txt +21 -0
- package/dist/files/spin/variants.ts +19 -0
- package/dist/files/steps/Steps.tsx +211 -0
- package/dist/files/steps/index.ts +11 -0
- package/dist/files/steps/interface.ts +155 -0
- package/dist/files/steps/lib.ts +46 -0
- package/dist/files/steps/llm.txt +296 -0
- package/dist/files/steps/steps.css +268 -0
- package/dist/files/steps/tokens.txt +30 -0
- package/dist/files/steps/variants.ts +15 -0
- package/dist/files/switch/Switch.tsx +131 -0
- package/dist/files/switch/index.ts +2 -0
- package/dist/files/switch/interface.ts +92 -0
- package/dist/files/switch/llm.txt +212 -0
- package/dist/files/switch/switch.css +198 -0
- package/dist/files/switch/tokens.txt +38 -0
- package/dist/files/switch/variants.ts +15 -0
- package/dist/files/table/Table.stories.css +56 -0
- package/dist/files/table/Table.tsx +481 -0
- package/dist/files/table/_adapter/locale.ts +4 -0
- package/dist/files/table/constants.ts +7 -0
- package/dist/files/table/context.ts +46 -0
- package/dist/files/table/hooks/useColumnControl.ts +135 -0
- package/dist/files/table/hooks/useColumns.ts +87 -0
- package/dist/files/table/hooks/useExpandable.tsx +271 -0
- package/dist/files/table/hooks/useOverlayScrollbar.ts +304 -0
- package/dist/files/table/hooks/usePagination.ts +110 -0
- package/dist/files/table/hooks/useRowSelection.tsx +250 -0
- package/dist/files/table/hooks/useScrollShadow.ts +66 -0
- package/dist/files/table/hooks/useSkeletonRowCount.ts +78 -0
- package/dist/files/table/hooks/useTableLayoutScale.ts +38 -0
- package/dist/files/table/hooks/useTableModel.ts +91 -0
- package/dist/files/table/index.ts +24 -0
- package/dist/files/table/interface.ts +407 -0
- package/dist/files/table/llm.txt +1050 -0
- package/dist/files/table/parts/TableBody.tsx +396 -0
- package/dist/files/table/parts/TableCell.tsx +123 -0
- package/dist/files/table/parts/TableColgroup.tsx +35 -0
- package/dist/files/table/parts/TableEmpty.tsx +48 -0
- package/dist/files/table/parts/TableEmptyIllustration.tsx +27 -0
- package/dist/files/table/parts/TableHeader.tsx +102 -0
- package/dist/files/table/parts/TablePagination.tsx +46 -0
- package/dist/files/table/parts/TableRow.tsx +42 -0
- package/dist/files/table/parts/TableScrollbars.tsx +79 -0
- package/dist/files/table/parts/TableSkeleton.tsx +47 -0
- package/dist/files/table/parts/TableSummary.tsx +121 -0
- package/dist/files/table/table.css +850 -0
- package/dist/files/table/tokenScopes.ts +28 -0
- package/dist/files/table/tokens.txt +94 -0
- package/dist/files/table/utils/computeMergeGrid.ts +41 -0
- package/dist/files/table/utils/dataModel.ts +45 -0
- package/dist/files/table/utils/getCellValue.ts +7 -0
- package/dist/files/table/utils/getGroupedHeaderSpan.ts +73 -0
- package/dist/files/table/utils/getRowKey.ts +31 -0
- package/dist/files/table/utils/paginationState.ts +31 -0
- package/dist/files/table/utils/prefixSvgIds.ts +6 -0
- package/dist/files/table/utils/scaleFixedOffset.ts +19 -0
- package/dist/files/tabs/Tabs.tsx +140 -0
- package/dist/files/tabs/index.ts +2 -0
- package/dist/files/tabs/interface.ts +117 -0
- package/dist/files/tabs/llm.txt +305 -0
- package/dist/files/tabs/tabs.css +299 -0
- package/dist/files/tabs/tokens.txt +78 -0
- package/dist/files/tabs/variants.ts +51 -0
- package/dist/files/tag/Tag.tsx +180 -0
- package/dist/files/tag/index.ts +8 -0
- package/dist/files/tag/interface.ts +68 -0
- package/dist/files/tag/llm.txt +301 -0
- package/dist/files/tag/tag.css +96 -0
- package/dist/files/tag/tokens.txt +76 -0
- package/dist/files/tag/variants.ts +71 -0
- package/dist/files/theme/aliases.css +217 -0
- package/dist/files/theme/component-tokens.css +2211 -0
- package/dist/files/theme/index.css +4 -0
- package/dist/files/theme/primitives.css +182 -0
- package/dist/files/theme/static.css +13 -0
- package/dist/files/tooltip/Tooltip.tsx +362 -0
- package/dist/files/tooltip/index.ts +7 -0
- package/dist/files/tooltip/interface.ts +118 -0
- package/dist/files/tooltip/llm.txt +308 -0
- package/dist/files/tooltip/placement.ts +51 -0
- package/dist/files/tooltip/tokens.txt +22 -0
- package/dist/files/tooltip/tooltip.css +78 -0
- package/dist/files/tree/Tree.tsx +1069 -0
- package/dist/files/tree/constants.ts +2 -0
- package/dist/files/tree/index.ts +22 -0
- package/dist/files/tree/interface.ts +447 -0
- package/dist/files/tree/llm.txt +501 -0
- package/dist/files/tree/tokens.txt +36 -0
- package/dist/files/tree/tree-data.ts +260 -0
- package/dist/files/tree/tree.css +231 -0
- package/dist/files/tree/variants.ts +25 -0
- package/dist/files/tree-select/TreeSelect.tsx +864 -0
- package/dist/files/tree-select/_adapter/locale.ts +4 -0
- package/dist/files/tree-select/index.ts +23 -0
- package/dist/files/tree-select/interface.ts +415 -0
- package/dist/files/tree-select/llm.txt +754 -0
- package/dist/files/tree-select/tokens.txt +174 -0
- package/dist/files/tree-select/tree-select-data.ts +294 -0
- package/dist/files/tree-select/tree-select.css +303 -0
- package/dist/files/tree-select/variants.ts +42 -0
- package/dist/files/typography/Typography.tsx +739 -0
- package/dist/files/typography/_adapter/locale.ts +4 -0
- package/dist/files/typography/canvasTextMeasure.ts +148 -0
- package/dist/files/typography/index.ts +21 -0
- package/dist/files/typography/interface.ts +154 -0
- package/dist/files/typography/llm.txt +412 -0
- package/dist/files/typography/tokens.txt +60 -0
- package/dist/files/typography/typography.css +312 -0
- package/dist/files/typography/useEllipsisSuffix.ts +245 -0
- package/dist/files/typography/variants.ts +24 -0
- package/dist/files/upload/Upload.stories.css +54 -0
- package/dist/files/upload/Upload.stories.shared.ts +21 -0
- package/dist/files/upload/Upload.tsx +1108 -0
- package/dist/files/upload/UploadActionIcons.tsx +13 -0
- package/dist/files/upload/UploadFileIcon.tsx +52 -0
- package/dist/files/upload/_adapter/locale.ts +4 -0
- package/dist/files/upload/constants.ts +46 -0
- package/dist/files/upload/index.ts +38 -0
- package/dist/files/upload/interface.ts +302 -0
- package/dist/files/upload/lib/file-type.ts +60 -0
- package/dist/files/upload/lib/format-size.ts +6 -0
- package/dist/files/upload/lib/limits.ts +46 -0
- package/dist/files/upload/llm.txt +705 -0
- package/dist/files/upload/tokens.txt +201 -0
- package/dist/files/upload/upload.css +460 -0
- package/dist/files/utils/cn.ts +16 -0
- package/dist/files/utils/env.ts +16 -0
- package/dist/files/utils/normalizeRawSvg.ts +12 -0
- package/dist/manifest.json +580 -0
- package/package.json +41 -3
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/* Typography — 文本/标题/段落(P0 字阶 + 修饰 + 基础 ellipsis)
|
|
2
|
+
*
|
|
3
|
+
* 字阶:.apex-font + .apex-text-{cn|en}-*-font(component-tokens.css)→ --font-font*
|
|
4
|
+
* locale 由 ApexProvider `data-locale` 驱动(cn / en)。
|
|
5
|
+
* 默认样式包在 :where() 中(特异性 0),宿主组件用单层 BEM(如 .apex-tag__content)
|
|
6
|
+
* 即可覆盖 display / color / gap,无需拼接 .apex-typography-*。
|
|
7
|
+
* 语义修饰(type / disabled 等)保持正常特异性,显式 prop 仍优先。 */
|
|
8
|
+
|
|
9
|
+
.apex-typography-root {
|
|
10
|
+
color: inherit;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Body 字阶 token — Typography 与表单控件(.apex-input 等)共用;缺省 en,zh 由 ApexProvider data-locale 切换 */
|
|
14
|
+
:root,
|
|
15
|
+
[data-locale='en'] {
|
|
16
|
+
--apex-typography-body-font-size: var(--apex-fontsize-14);
|
|
17
|
+
--apex-typography-body-font-weight: var(--apex-fontweight-400);
|
|
18
|
+
--apex-typography-body-line-height: var(--apex-fontheight-20);
|
|
19
|
+
--apex-typography-body-letter-spacing: var(--apex-fontspacing-1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-locale='cn'] {
|
|
23
|
+
--apex-typography-body-font-size: var(--apex-fontsize-14);
|
|
24
|
+
--apex-typography-body-font-weight: var(--apex-fontweight-400);
|
|
25
|
+
--apex-typography-body-line-height: var(--apex-fontheight-20);
|
|
26
|
+
--apex-typography-body-letter-spacing: var(--apex-fontspacing-0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:where(.apex-typography-body-text),
|
|
30
|
+
:where(.apex-input) {
|
|
31
|
+
font-size: var(--apex-typography-body-font-size);
|
|
32
|
+
font-weight: var(--apex-typography-body-font-weight);
|
|
33
|
+
line-height: var(--apex-typography-body-line-height);
|
|
34
|
+
letter-spacing: var(--apex-typography-body-letter-spacing);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* 块级默认;Text/Paragraph 用 inherit 便于嵌入 Tag/Dropdown 等有色宿主 */
|
|
38
|
+
:where(.apex-typography-text),
|
|
39
|
+
:where(.apex-typography-title),
|
|
40
|
+
:where(.apex-typography-paragraph) {
|
|
41
|
+
margin: 0;
|
|
42
|
+
word-break: break-word;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where(.apex-typography-text),
|
|
46
|
+
:where(.apex-typography-paragraph) {
|
|
47
|
+
color: inherit;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Title 无 variant,须自带主文本色(与 index.md 字阶表一致) */
|
|
51
|
+
:where(.apex-typography-title) {
|
|
52
|
+
color: var(--apex-text-neutral-primary);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where(.apex-typography-text),
|
|
56
|
+
:where(.apex-typography-paragraph) {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
align-items: baseline;
|
|
60
|
+
gap: var(--apex-spacing-4);
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:where(.apex-typography-paragraph) {
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* 字阶:消费 component-tokens.css .apex-font.apex-text-{cn|en}-*-font */
|
|
69
|
+
:where(.apex-typography.apex-font) {
|
|
70
|
+
font-size: var(--font-fontsize);
|
|
71
|
+
font-weight: var(--font-fontweight);
|
|
72
|
+
line-height: var(--font-fontheight);
|
|
73
|
+
letter-spacing: var(--font-fontspacing);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:where(.apex-typography--variant-body) {
|
|
77
|
+
color: var(--apex-text-neutral-primary);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where(.apex-typography--variant-caption) {
|
|
81
|
+
color: var(--apex-text-neutral-secondary);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* 语义 type(显式 prop,保持可覆盖性低于 type 意图) */
|
|
85
|
+
.apex-typography--type-secondary {
|
|
86
|
+
color: var(--apex-text-neutral-secondary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.apex-typography--type-success {
|
|
90
|
+
color: var(--apex-text-success-primary);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.apex-typography--type-warning {
|
|
94
|
+
color: var(--apex-text-warning-primary);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.apex-typography--type-danger {
|
|
98
|
+
color: var(--apex-text-error-primary);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* 修饰 */
|
|
102
|
+
.apex-typography--strong {
|
|
103
|
+
font-weight: 600;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.apex-typography--italic {
|
|
107
|
+
font-style: italic;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.apex-typography--underline {
|
|
111
|
+
text-decoration: underline;
|
|
112
|
+
text-decoration-color: var(--apex-stroke-neutral-quaternary);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.apex-typography--delete {
|
|
116
|
+
text-decoration: line-through;
|
|
117
|
+
text-decoration-color: var(--apex-stroke-neutral-quaternary);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.apex-typography--mark {
|
|
121
|
+
background-color: var(--apex-fill-warning-secondary);
|
|
122
|
+
padding: 0 var(--apex-spacing-2);
|
|
123
|
+
border-radius: var(--apex-radius-4);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.apex-typography--code {
|
|
127
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
128
|
+
font-size: 0.9em;
|
|
129
|
+
padding: 0 var(--apex-spacing-4);
|
|
130
|
+
border-radius: var(--apex-radius-4);
|
|
131
|
+
background-color: var(--apex-fill-neutral-secondary);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.apex-typography--keyboard {
|
|
135
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
136
|
+
font-size: 0.85em;
|
|
137
|
+
padding: var(--apex-spacing-2) var(--apex-spacing-4);
|
|
138
|
+
border: 1px solid var(--apex-stroke-neutral-quaternary);
|
|
139
|
+
border-radius: var(--apex-radius-4);
|
|
140
|
+
box-shadow: inset 0 -1px 0 var(--apex-stroke-neutral-quaternary);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.apex-typography--disabled {
|
|
144
|
+
color: var(--apex-text-neutral-disabled);
|
|
145
|
+
cursor: not-allowed;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.apex-typography__content {
|
|
149
|
+
min-width: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.apex-typography__actions {
|
|
153
|
+
display: inline-flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: var(--apex-spacing-4);
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.apex-typography__actions--start {
|
|
160
|
+
order: -1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.apex-typography__action {
|
|
164
|
+
appearance: none;
|
|
165
|
+
border: none;
|
|
166
|
+
background: transparent;
|
|
167
|
+
color: var(--apex-text-neutral-secondary);
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
font-size: var(--apex-size-12);
|
|
170
|
+
padding: 0;
|
|
171
|
+
line-height: 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.apex-typography__action:hover {
|
|
175
|
+
color: var(--apex-text-neutral-primary);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.apex-typography__action:focus-visible {
|
|
179
|
+
outline: 2px solid var(--apex-stroke-brand-primary);
|
|
180
|
+
outline-offset: 2px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* ellipsis */
|
|
184
|
+
.apex-typography--ellipsis-single:where(.apex-typography-text),
|
|
185
|
+
.apex-typography--ellipsis-single:where(.apex-typography-paragraph) {
|
|
186
|
+
/* 允许在 flex/table 等宿主内收缩;避免 min-width:auto 顶住内容宽 */
|
|
187
|
+
min-width: 0;
|
|
188
|
+
max-width: 100%;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.apex-typography--ellipsis-single .apex-typography__content:not([data-slot='typography-ellipsis-suffix']) {
|
|
192
|
+
display: block;
|
|
193
|
+
width: 100%;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
text-overflow: ellipsis;
|
|
196
|
+
white-space: nowrap;
|
|
197
|
+
min-width: 0;
|
|
198
|
+
max-width: 100%;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.apex-typography--ellipsis-single .apex-typography__content--suffix:not([data-slot='typography-ellipsis-suffix']) {
|
|
202
|
+
display: inline-flex;
|
|
203
|
+
align-items: baseline;
|
|
204
|
+
max-width: 100%;
|
|
205
|
+
vertical-align: bottom;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.apex-typography--ellipsis-single .apex-typography__ellipsis-text {
|
|
209
|
+
width: fit-content;
|
|
210
|
+
overflow: hidden;
|
|
211
|
+
text-overflow: ellipsis;
|
|
212
|
+
white-space: nowrap;
|
|
213
|
+
min-width: 0;
|
|
214
|
+
flex: 1 1 auto;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* suffix:JS 测量截断,中间插入 ... span,不用 CSS text-overflow */
|
|
218
|
+
.apex-typography--ellipsis-suffix:where(.apex-typography-text),
|
|
219
|
+
.apex-typography--ellipsis-suffix:where(.apex-typography-paragraph) {
|
|
220
|
+
/* 宽度由宿主约束,避免 inline-flex 随内容伸缩导致测量反馈环 */
|
|
221
|
+
width: 100%;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.apex-typography--ellipsis-suffix .apex-typography__content--suffix {
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: baseline;
|
|
227
|
+
position: relative;
|
|
228
|
+
width: 100%;
|
|
229
|
+
max-width: 100%;
|
|
230
|
+
min-width: 0;
|
|
231
|
+
flex: 1 1 auto;
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.apex-typography--ellipsis-suffix .apex-typography__ellipsis-text,
|
|
237
|
+
.apex-typography--ellipsis-suffix .apex-typography__ellipsis-symbol,
|
|
238
|
+
.apex-typography--ellipsis-suffix .apex-typography__ellipsis-suffix {
|
|
239
|
+
flex: 0 0 auto;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.apex-typography__ellipsis-symbol {
|
|
243
|
+
flex-shrink: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* 多行省略:行数由 TS 在 .apex-typography__ellipsis-text 上 inline 设置 WebkitLineClamp(支持 rows>5) */
|
|
247
|
+
.apex-typography--ellipsis-multi .apex-typography__content {
|
|
248
|
+
overflow: hidden;
|
|
249
|
+
white-space: normal;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.apex-typography--ellipsis-multi .apex-typography__content--suffix {
|
|
253
|
+
display: flex;
|
|
254
|
+
align-items: flex-end;
|
|
255
|
+
gap: 0;
|
|
256
|
+
overflow: visible;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.apex-typography--ellipsis-multi .apex-typography__ellipsis-text {
|
|
260
|
+
width: fit-content;
|
|
261
|
+
|
|
262
|
+
overflow: hidden;
|
|
263
|
+
min-width: 0;
|
|
264
|
+
flex: 1 1 auto;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.apex-typography__ellipsis-suffix {
|
|
268
|
+
flex-shrink: 0;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.apex-typography--ellipsis-multi .apex-typography__ellipsis-suffix,
|
|
272
|
+
.apex-typography--ellipsis-single:not(.apex-typography--ellipsis-suffix) .apex-typography__ellipsis-suffix {
|
|
273
|
+
margin-inline-start: var(--apex-spacing-2);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.apex-typography__ellipsis-expand {
|
|
277
|
+
appearance: none;
|
|
278
|
+
border: none;
|
|
279
|
+
background: transparent;
|
|
280
|
+
color: inherit;
|
|
281
|
+
cursor: pointer;
|
|
282
|
+
font-size: inherit;
|
|
283
|
+
padding: 0;
|
|
284
|
+
margin-inline-start: var(--apex-spacing-4);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* editable — inline Input, transparent shell inherits typography */
|
|
288
|
+
.apex-typography__edit {
|
|
289
|
+
display: inline;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.apex-typography__edit-input.apex-input {
|
|
293
|
+
display: inline-flex;
|
|
294
|
+
height: auto;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.apex-typography__edit-input .apex-input__inner {
|
|
298
|
+
background-color: transparent;
|
|
299
|
+
padding: 0px 4px;
|
|
300
|
+
min-height: unset;
|
|
301
|
+
height: auto;
|
|
302
|
+
font: inherit;
|
|
303
|
+
color: inherit;
|
|
304
|
+
box-shadow: none;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.apex-typography__edit-input .apex-input__inner:hover:not([data-disabled]),
|
|
308
|
+
.apex-typography__edit-input .apex-input__inner:focus-within:not([data-disabled]) {
|
|
309
|
+
background-color: transparent;
|
|
310
|
+
color: inherit;
|
|
311
|
+
box-shadow: none;
|
|
312
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import {
|
|
5
|
+
type CanvasTextMeasurer,
|
|
6
|
+
createCanvasTextMeasurer,
|
|
7
|
+
type EllipsisMeasureResult,
|
|
8
|
+
getCanvasStyleCacheKey,
|
|
9
|
+
measureCenterCutLengthWithCanvas,
|
|
10
|
+
measureCutLengthWithCanvas,
|
|
11
|
+
measureStartCutLengthWithCanvas,
|
|
12
|
+
} from './canvasTextMeasure'
|
|
13
|
+
import type { TypographyEllipsisPosition } from './interface'
|
|
14
|
+
|
|
15
|
+
export const ELLIPSIS_SUFFIX_SYMBOL = '...'
|
|
16
|
+
|
|
17
|
+
export interface EllipsisSuffixState extends EllipsisMeasureResult {}
|
|
18
|
+
|
|
19
|
+
const NO_ELLIPSIS = (length: number): EllipsisSuffixState => ({
|
|
20
|
+
headLength: length,
|
|
21
|
+
tailLength: 0,
|
|
22
|
+
needsEllipsis: false,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// DOM fallback when canvas is unavailable (SSR) or for final overflow guard.
|
|
26
|
+
let domMeasurer: HTMLSpanElement | null = null
|
|
27
|
+
const domStyleKey = new WeakMap<HTMLElement, string>()
|
|
28
|
+
|
|
29
|
+
function getDomMeasurer(): HTMLSpanElement | null {
|
|
30
|
+
if (typeof document === 'undefined') return null
|
|
31
|
+
if (!domMeasurer) {
|
|
32
|
+
domMeasurer = document.createElement('span')
|
|
33
|
+
domMeasurer.setAttribute('aria-hidden', 'true')
|
|
34
|
+
Object.assign(domMeasurer.style, {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
visibility: 'hidden',
|
|
37
|
+
pointerEvents: 'none',
|
|
38
|
+
whiteSpace: 'nowrap',
|
|
39
|
+
left: '-9999px',
|
|
40
|
+
top: '0',
|
|
41
|
+
height: '0',
|
|
42
|
+
overflow: 'hidden',
|
|
43
|
+
})
|
|
44
|
+
document.body.appendChild(domMeasurer)
|
|
45
|
+
}
|
|
46
|
+
return domMeasurer
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function syncDomMeasurer(source: HTMLElement, measurer: HTMLElement) {
|
|
50
|
+
const { font, letterSpacing } = getComputedStyle(source)
|
|
51
|
+
const key = `${font}\0${letterSpacing}`
|
|
52
|
+
if (domStyleKey.get(source) === key) return
|
|
53
|
+
domStyleKey.set(source, key)
|
|
54
|
+
measurer.style.font = font
|
|
55
|
+
measurer.style.letterSpacing = letterSpacing
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function domTextWidth(measurer: HTMLElement, content: string): number {
|
|
59
|
+
measurer.textContent = content
|
|
60
|
+
return measurer.offsetWidth
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function buildDomContent(
|
|
64
|
+
text: string,
|
|
65
|
+
suffix: string,
|
|
66
|
+
position: TypographyEllipsisPosition,
|
|
67
|
+
state: EllipsisMeasureResult,
|
|
68
|
+
): string {
|
|
69
|
+
if (!state.needsEllipsis) return text + suffix
|
|
70
|
+
|
|
71
|
+
const head = text.slice(0, state.headLength)
|
|
72
|
+
const tail = state.tailLength > 0 ? text.slice(-state.tailLength) : ''
|
|
73
|
+
|
|
74
|
+
if (position === 'start') {
|
|
75
|
+
return `${ELLIPSIS_SUFFIX_SYMBOL}${tail}${suffix}`
|
|
76
|
+
}
|
|
77
|
+
if (position === 'center') {
|
|
78
|
+
return `${head}${ELLIPSIS_SUFFIX_SYMBOL}${tail}${suffix}`
|
|
79
|
+
}
|
|
80
|
+
return `${head}${ELLIPSIS_SUFFIX_SYMBOL}${suffix}`
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Trim cut length when canvas underestimates vs real DOM layout (rare). */
|
|
84
|
+
function clampWithDom(
|
|
85
|
+
text: string,
|
|
86
|
+
suffix: string,
|
|
87
|
+
position: TypographyEllipsisPosition,
|
|
88
|
+
availableWidth: number,
|
|
89
|
+
state: EllipsisMeasureResult,
|
|
90
|
+
source: HTMLElement,
|
|
91
|
+
): EllipsisMeasureResult {
|
|
92
|
+
const measurer = getDomMeasurer()
|
|
93
|
+
if (!measurer || !state.needsEllipsis) return state
|
|
94
|
+
|
|
95
|
+
syncDomMeasurer(source, measurer)
|
|
96
|
+
|
|
97
|
+
let { headLength, tailLength } = state
|
|
98
|
+
const fullLength = text.length
|
|
99
|
+
|
|
100
|
+
while (headLength + tailLength > 0) {
|
|
101
|
+
const content = buildDomContent(text, suffix, position, {
|
|
102
|
+
headLength,
|
|
103
|
+
tailLength,
|
|
104
|
+
needsEllipsis: true,
|
|
105
|
+
})
|
|
106
|
+
if (domTextWidth(measurer, content) <= availableWidth) break
|
|
107
|
+
|
|
108
|
+
if (position === 'start') {
|
|
109
|
+
tailLength -= 1
|
|
110
|
+
} else if (position === 'center') {
|
|
111
|
+
if (tailLength > 0) tailLength -= 1
|
|
112
|
+
else if (headLength > 0) headLength -= 1
|
|
113
|
+
} else {
|
|
114
|
+
headLength -= 1
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
headLength,
|
|
120
|
+
tailLength,
|
|
121
|
+
needsEllipsis: headLength + tailLength < fullLength,
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const canvasMeasurer = createCanvasTextMeasurer()
|
|
126
|
+
|
|
127
|
+
function measureWithCanvas(
|
|
128
|
+
text: string,
|
|
129
|
+
suffix: string,
|
|
130
|
+
position: TypographyEllipsisPosition,
|
|
131
|
+
availableWidth: number,
|
|
132
|
+
source: HTMLElement,
|
|
133
|
+
canvas: CanvasTextMeasurer,
|
|
134
|
+
): EllipsisSuffixState {
|
|
135
|
+
canvas.syncFrom(source)
|
|
136
|
+
|
|
137
|
+
const measure =
|
|
138
|
+
position === 'start'
|
|
139
|
+
? measureStartCutLengthWithCanvas
|
|
140
|
+
: position === 'center'
|
|
141
|
+
? measureCenterCutLengthWithCanvas
|
|
142
|
+
: measureCutLengthWithCanvas
|
|
143
|
+
|
|
144
|
+
const result = measure(text, suffix, ELLIPSIS_SUFFIX_SYMBOL, availableWidth, canvas)
|
|
145
|
+
if (!result.needsEllipsis) return result
|
|
146
|
+
|
|
147
|
+
return clampWithDom(text, suffix, position, availableWidth, result, source)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function statesEqual(a: EllipsisSuffixState, b: EllipsisSuffixState): boolean {
|
|
151
|
+
return (
|
|
152
|
+
a.headLength === b.headLength &&
|
|
153
|
+
a.tailLength === b.tailLength &&
|
|
154
|
+
a.needsEllipsis === b.needsEllipsis
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** 测量宽度取自父级(宿主约束宽),避免 content 容器随截断结果伸缩引发 ResizeObserver 振荡。 */
|
|
159
|
+
function getMeasureTarget(container: HTMLElement): HTMLElement {
|
|
160
|
+
return container.parentElement ?? container
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function getAvailableWidth(container: HTMLElement): number {
|
|
164
|
+
const target = getMeasureTarget(container)
|
|
165
|
+
const width = target.clientWidth
|
|
166
|
+
return width > 0 ? width : container.clientWidth
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function useEllipsisSuffix({
|
|
170
|
+
text,
|
|
171
|
+
suffix,
|
|
172
|
+
position = 'end',
|
|
173
|
+
enabled,
|
|
174
|
+
onEllipsis,
|
|
175
|
+
}: {
|
|
176
|
+
text: string
|
|
177
|
+
suffix: string
|
|
178
|
+
position?: TypographyEllipsisPosition
|
|
179
|
+
enabled: boolean
|
|
180
|
+
onEllipsis?: (ellipsis: boolean) => void
|
|
181
|
+
}) {
|
|
182
|
+
const containerRef = React.useRef<HTMLSpanElement>(null)
|
|
183
|
+
const onEllipsisRef = React.useRef(onEllipsis)
|
|
184
|
+
const stateRef = React.useRef<EllipsisSuffixState>({
|
|
185
|
+
headLength: text.length,
|
|
186
|
+
tailLength: 0,
|
|
187
|
+
needsEllipsis: false,
|
|
188
|
+
})
|
|
189
|
+
const ellipsisRef = React.useRef(false)
|
|
190
|
+
const measureCacheRef = React.useRef('')
|
|
191
|
+
|
|
192
|
+
onEllipsisRef.current = onEllipsis
|
|
193
|
+
|
|
194
|
+
const [state, setState] = React.useState<EllipsisSuffixState>(stateRef.current)
|
|
195
|
+
|
|
196
|
+
const applyState = React.useCallback((next: EllipsisSuffixState) => {
|
|
197
|
+
if (statesEqual(stateRef.current, next)) return
|
|
198
|
+
stateRef.current = next
|
|
199
|
+
setState(next)
|
|
200
|
+
if (ellipsisRef.current !== next.needsEllipsis) {
|
|
201
|
+
ellipsisRef.current = next.needsEllipsis
|
|
202
|
+
onEllipsisRef.current?.(next.needsEllipsis)
|
|
203
|
+
}
|
|
204
|
+
}, [])
|
|
205
|
+
|
|
206
|
+
React.useLayoutEffect(() => {
|
|
207
|
+
if (!enabled) {
|
|
208
|
+
measureCacheRef.current = ''
|
|
209
|
+
applyState(NO_ELLIPSIS(text.length))
|
|
210
|
+
return
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const container = containerRef.current
|
|
214
|
+
if (!container || !canvasMeasurer) return
|
|
215
|
+
|
|
216
|
+
const measureTarget = getMeasureTarget(container)
|
|
217
|
+
|
|
218
|
+
const measure = () => {
|
|
219
|
+
const availableWidth = getAvailableWidth(container)
|
|
220
|
+
if (availableWidth <= 0) return
|
|
221
|
+
|
|
222
|
+
const styleKey = getCanvasStyleCacheKey(container)
|
|
223
|
+
const cacheKey = `${availableWidth}\0${styleKey}\0${position}\0${text}\0${suffix}`
|
|
224
|
+
if (cacheKey === measureCacheRef.current) return
|
|
225
|
+
measureCacheRef.current = cacheKey
|
|
226
|
+
|
|
227
|
+
applyState(
|
|
228
|
+
measureWithCanvas(text, suffix, position, availableWidth, container, canvasMeasurer),
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// 同步测量:在 useLayoutEffect 内完成,首帧绘制前即得到正确截断
|
|
233
|
+
measure()
|
|
234
|
+
|
|
235
|
+
const observer = new ResizeObserver(measure)
|
|
236
|
+
observer.observe(measureTarget)
|
|
237
|
+
|
|
238
|
+
return () => {
|
|
239
|
+
observer.disconnect()
|
|
240
|
+
measureCacheRef.current = ''
|
|
241
|
+
}
|
|
242
|
+
}, [applyState, enabled, position, suffix, text])
|
|
243
|
+
|
|
244
|
+
return { containerRef, state }
|
|
245
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
const prefixCls = 'apex-typography'
|
|
4
|
+
|
|
5
|
+
export const typographyVariants = cva(prefixCls, {
|
|
6
|
+
variants: {
|
|
7
|
+
type: {
|
|
8
|
+
secondary: `${prefixCls}--type-secondary`,
|
|
9
|
+
success: `${prefixCls}--type-success`,
|
|
10
|
+
warning: `${prefixCls}--type-warning`,
|
|
11
|
+
danger: `${prefixCls}--type-danger`,
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
body: `${prefixCls}--variant-body`,
|
|
15
|
+
caption: `${prefixCls}--variant-caption`,
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
true: `${prefixCls}--disabled`,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export type TypographyVariants = VariantProps<typeof typographyVariants>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.apex-upload-story-container {
|
|
2
|
+
width: 80vw;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.apex-upload-story-narrow-host {
|
|
6
|
+
width: 260px;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.apex-upload-story-dragger-icon {
|
|
11
|
+
font-size: 24px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.apex-upload-story-dragger-copy {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--upload-spacing-gap-text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.apex-upload-story-dragger-title,
|
|
21
|
+
.apex-upload-story-dragger-hint {
|
|
22
|
+
margin: auto;
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.apex-upload-story-file-row-gallery {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: repeat(2, minmax(0, 351px));
|
|
29
|
+
gap: var(--apex-spacing-24);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.apex-upload-story-file-row-column {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: var(--apex-spacing-16);
|
|
36
|
+
width: 351px;
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.apex-upload-story-file-row-column > .apex-typography {
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.apex-upload-story-file-row-case {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
gap: var(--apex-spacing-4);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (max-width: 640px) {
|
|
51
|
+
.apex-upload-story-file-row-gallery {
|
|
52
|
+
grid-template-columns: minmax(0, 351px);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Inline SVG placeholders for Upload stories/tests — no external network dependency. */
|
|
2
|
+
|
|
3
|
+
export function uploadStoryImageDataUrl(
|
|
4
|
+
fill: string,
|
|
5
|
+
label: string,
|
|
6
|
+
width = 200,
|
|
7
|
+
height = 200,
|
|
8
|
+
): string {
|
|
9
|
+
const fontSize = Math.round(Math.min(width, height) * 0.2)
|
|
10
|
+
return (
|
|
11
|
+
'data:image/svg+xml;utf8,' +
|
|
12
|
+
encodeURIComponent(
|
|
13
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"><rect width="100%" height="100%" fill="${fill}"/><text x="50%" y="55%" dominant-baseline="middle" fill="white" font-family="Arial,sans-serif" font-size="${fontSize}" text-anchor="middle">${label}</text></svg>`,
|
|
14
|
+
)
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const UPLOAD_STORY_IMAGE = uploadStoryImageDataUrl('#7B61FF', 'IMG')
|
|
19
|
+
export const UPLOAD_STORY_IMAGE_BLUR = uploadStoryImageDataUrl('#5B8DEF', 'BLUR')
|
|
20
|
+
export const UPLOAD_STORY_IMAGE_GRAY = uploadStoryImageDataUrl('#888888', 'ERR')
|
|
21
|
+
export const UPLOAD_STORY_IMAGE_LARGE = uploadStoryImageDataUrl('#7B61FF', 'UP', 400, 400)
|