Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add additional custom properties to mux-uploader progress bar #1069

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/vanilla-ts-esm/public/mux-uploader-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
mux-uploader-progress {
display: contents;
--progress-bar-fill-color: #46a6de;
--progress-bar-background-color: #4e46de;
--progress-bar-height: 8px;
--progress-bar-border-radius: 0px;
}
</style>
</head>
Expand Down
4 changes: 4 additions & 0 deletions packages/mux-uploader-react/src/mux-uploader-progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export type MuxUploaderProgressProps = {
style?: CSSProperties & {
['--progress-bar-height']?: CSSProperties['height'];
['--progress-bar-fill-color']?: CSSProperties['fill'];
['--progress-bar-background-color']?: CSSProperties['background'];
['--progress-bar-box-shadow']?: CSSProperties['boxShadow'];
['--progress-bar-border-radius']?: CSSProperties['borderRadius'];
['--progress-radial-fill-color']?: CSSProperties['stroke'];
['--progress-percentage-display']?: CSSProperties['display'];
};
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, 'ref'>;
Expand Down
6 changes: 6 additions & 0 deletions packages/mux-uploader/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ customization:
| Name | CSS Property | Default Value | Description |
| ---- | ------------ | ------------- | ----------- |
| `--progress-bar-fill-color` | `background` | `black` | Background "fill" color for progress bar, which visually indicates progress |
| `--progress-bar-background-color` | `background` | `#e6e6e6` | The background on which the progress bar is rendered. |
| `--progress-bar-box-shadow` | `box-shadow` | `0 10px 40px -10px #fff` | Box shadow behind the progress bar. |
| `--progress-bar-height` | `height` | `4px` | Height for the progress bar. |
| `--progress-bar-border-radius` | `border-radius` | `100px` | Border radius for the progress bar. |
| `--progress-radial-fill-color` | `stroke` | `black` | Stroke color for `radial` progress `type` (_Experimental_) |
| `--progress-percentage-display` | `display` | `block` | Display value for percentage progress. Set to `none` to hide. |

Expand Down Expand Up @@ -294,7 +297,10 @@ customization:
| Name | CSS Property | Default Value | Description |
| ---- | ------------ | ------------- | ----------- |
| `--progress-bar-fill-color` | `background` | `black` | Background "fill" color for progress bar, which visually indicates progress |
| `--progress-bar-background-color` | `background` | `#e6e6e6` | The background on which the progress bar is rendered. |
| `--progress-bar-box-shadow` | `box-shadow` | `0 10px 40px -10px #fff` | Box shadow behind the progress bar. |
| `--progress-bar-height` | `height` | `4px` | Height for the progress bar. |
| `--progress-bar-border-radius` | `border-radius` | `100px` | Border radius for the progress bar. |
| `--progress-radial-fill-color` | `stroke` | `black` | Stroke color for `radial` progress `type` (_Experimental_) |
| `--progress-percentage-display` | `display` | `block` | Display value for percentage progress. Set to `none` to hide. |

Expand Down
8 changes: 4 additions & 4 deletions packages/mux-uploader/src/mux-uploader-progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ template.innerHTML = /*html*/ `
}

.bar-type {
background: #e6e6e6;
border-radius: 100px;
background: var(--progress-bar-background-color, #e6e6e6);
border-radius: var(--progress-bar-border-radius, 100px);
height: var(--progress-bar-height, 4px);
width: 100%;
}
Expand All @@ -44,8 +44,8 @@ template.innerHTML = /*html*/ `
}

.progress-bar {
box-shadow: 0 10px 40px -10px #fff;
border-radius: 100px;
box-shadow: var(--progress-bar-box-shadow, 0 10px 40px -10px #fff);
border-radius: var(--progress-bar-border-radius, 100px);
background: var(--progress-bar-fill-color, #000000);
height: var(--progress-bar-height, 4px);
width: 0%;
Expand Down
Loading