Skip to content

Commit 482a3e9

Browse files
committed
chore: address review feedback
1 parent 33e8ff1 commit 482a3e9

5 files changed

Lines changed: 47 additions & 33 deletions

File tree

.dumirc.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ const publicPath = process.env.GH_PAGES ? '/trigger/' : '/';
66

77
export default defineConfig({
88
alias: {
9-
'@rc-component/trigger$': path.resolve('src'),
10-
'@rc-component/trigger/es': path.resolve('src'),
11-
'@rc-component/trigger/es/*': path.resolve('src'),
12-
'@rc-component/trigger/assets': path.resolve('assets'),
13-
'@rc-component/trigger/assets/*': path.resolve('assets'),
9+
'@rc-component/trigger$': path.resolve(__dirname, 'src'),
10+
'@rc-component/trigger/es': path.resolve(__dirname, 'src'),
11+
'@rc-component/trigger/assets': path.resolve(__dirname, 'assets'),
1412
},
1513
mfsu: false,
1614
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],

.github/workflows/react-component-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ permissions:
1111

1212
jobs:
1313
test:
14-
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
14+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@b8ebddc81ef706b50faff0242ab34ad8ecdd9a59
1515
secrets: inherit

.github/workflows/surge-preview.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
2121
with:
2222
persist-credentials: false
23+
- name: Install dependencies
24+
run: npm install --ignore-scripts --no-audit --loglevel=warn
2325
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
2426
with:
2527
build: npm run build

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,5 @@ bun.lockb
3838
.dumi/tmp
3939
.dumi/tmp-production
4040
dist/
41-
.dumi
4241
docs-dist
4342
.vercel

README.md

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,44 +63,59 @@ npm start
6363

6464
### Trigger
6565

66-
| Prop | Description | Type | Default |
67-
| -------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------- | ----------- |
68-
| action | Actions that control popup visibility. | `Array<'hover' \| 'click' \| 'focus' \| 'contextMenu'>` | `['hover']` |
69-
| alignPoint | Align popup to mouse position for click, hover, and context menu actions. | `boolean` | `false` |
70-
| autoDestroy | Destroy popup DOM when it is hidden. | `boolean` | `false` |
71-
| builtinPlacements | Named placement presets. | `BuildInPlacements` | - |
72-
| defaultPopupVisible | Initial uncontrolled visibility. | `boolean` | `false` |
73-
| destroyPopupOnHide | Destroy popup when it hides. | `boolean` | `false` |
74-
| forceRender | Render popup before it is first shown. | `boolean` | `false` |
75-
| getPopupContainer | Return the element that should contain the popup. | `() => HTMLElement` | - |
76-
| mask | Render a mask behind the popup. | `boolean` | `false` |
77-
| maskClosable | Close when clicking the mask. | `boolean` | `true` |
78-
| popup | Popup content. | `ReactNode` \| `() => ReactNode` | - |
79-
| popupAlign | Alignment config compatible with dom-align. | `AlignType` | - |
80-
| popupClassName | Class name added to popup. | `string` | - |
81-
| popupPlacement | Placement key from `builtinPlacements`. | `string` | - |
82-
| popupRender | Customize popup node before render. | `(node) => ReactNode` | - |
83-
| popupStyle | Inline popup style. | `React.CSSProperties` | - |
84-
| popupVisible | Controlled popup visibility. | `boolean` | - |
85-
| stretch | Stretch popup width and/or height from target. | `'width'` \| `'minWidth'` \| `'height'` \| `'minHeight'` | - |
86-
| zIndex | Popup z-index. | `number` | - |
87-
| onPopupAlign | Called when the popup is aligned. | `(element, align) => void` | - |
88-
| onPopupVisibleChange | Called when visibility changes. | `(visible) => void` | - |
66+
| Prop | Description | Type | Default |
67+
| -------------------------- | ------------------------------------------------------------------------- | ----------------------------------------- | ------------------ |
68+
| action | Actions that control popup visibility. | `ActionType` \| `ActionType[]` | `hover` |
69+
| afterOpenChange | Called after popup visibility changes. | `(visible) => void` | - |
70+
| afterPopupVisibleChange | Deprecated. Use `afterOpenChange` instead. | `(visible) => void` | - |
71+
| alignPoint | Align popup to mouse position for click, hover, and context menu actions. | `boolean` | `false` |
72+
| arrow | Render popup arrow. | `boolean` \| `ArrowType` | - |
73+
| autoDestroy | Destroy popup DOM when it is hidden. | `boolean` | `false` |
74+
| blurDelay | Delay before hiding on blur, in seconds. | `number` | - |
75+
| builtinPlacements | Named placement presets. | `BuildInPlacements` | `{}` |
76+
| defaultPopupVisible | Initial uncontrolled visibility. | `boolean` | `false` |
77+
| focusDelay | Delay before showing on focus, in seconds. | `number` | - |
78+
| forceRender | Render popup before it is first shown. | `boolean` | `false` |
79+
| fresh | Keep popup content updated while closed. | `boolean` | - |
80+
| getPopupClassNameFromAlign | Return a popup class name from the current alignment. | `(align) => string` | - |
81+
| getPopupContainer | Return the element that should contain the popup. | `(node) => HTMLElement` | - |
82+
| hideAction | Actions that hide popup visibility. | `ActionType[]` | - |
83+
| mask | Render a mask behind the popup. | `boolean` | `false` |
84+
| maskClosable | Close when clicking the mask. | `boolean` | `true` |
85+
| maskMotion | Motion config for the mask. | `CSSMotionProps` | - |
86+
| mouseEnterDelay | Delay before showing on mouse enter, in seconds. | `number` | - |
87+
| mouseLeaveDelay | Delay before hiding on mouse leave, in seconds. | `number` | `0.1` |
88+
| popup | Popup content. | `ReactNode` \| `() => ReactNode` | - |
89+
| popupAlign | Alignment config compatible with dom-align. | `AlignType` | - |
90+
| popupClassName | Class name added to popup. | `string` | - |
91+
| popupMotion | Motion config for the popup. | `CSSMotionProps` | - |
92+
| popupPlacement | Placement key from `builtinPlacements`. | `string` | - |
93+
| popupStyle | Inline popup style. | `React.CSSProperties` | - |
94+
| popupVisible | Controlled popup visibility. | `boolean` | - |
95+
| prefixCls | Popup class name prefix. | `string` | `rc-trigger-popup` |
96+
| showAction | Actions that show popup visibility. | `ActionType[]` | - |
97+
| stretch | Stretch popup width and/or height from target. | `string` | - |
98+
| unique | Share popup container through `UniqueProvider`. | `boolean` | - |
99+
| uniqueContainerClassName | Class name passed to `UniqueProvider` container. | `string` | - |
100+
| uniqueContainerStyle | Style passed to `UniqueProvider` container. | `React.CSSProperties` | - |
101+
| zIndex | Popup z-index. | `number` | - |
102+
| onOpenChange | Called when visibility changes. | `(visible) => void` | - |
103+
| onPopupAlign | Called when the popup is aligned. | `(element, align) => void` | - |
104+
| onPopupClick | Called when popup is clicked. | `React.MouseEventHandler<HTMLDivElement>` | - |
105+
| onPopupVisibleChange | Deprecated. Use `onOpenChange` instead. | `(visible) => void` | - |
89106

90107
## Development
91108

92109
```bash
93110
npm install
94111
npm start
95112
npm test
96-
npm run tsc
97-
npm run compile
98113
npm run build
99114
```
100115

101116
## Release
102117

103-
The release flow is handled by `@rc-component/np` from the `prepublishOnly` script:
118+
The `prepublishOnly` script runs `npm run compile` and then `rc-np` from `@rc-component/np`:
104119

105120
```bash
106121
npm publish

0 commit comments

Comments
 (0)