Skip to content

Commit

Permalink
feat: add filepicker carbon styles
Browse files Browse the repository at this point in the history
  • Loading branch information
vsgoulart committed Sep 9, 2024
1 parent e4ff280 commit e5ace5e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/form-js-carbon-styles/src/carbon-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ const RADIO_STYLES = css`

const BUTTON_STYLES = css`
.fjs-container {
.fjs-form-field.fjs-form-field-button .fjs-button {
.fjs-form-field.fjs-form-field-button .fjs-button,
.fjs-form-field.fjs-form-field-filepicker .fjs-button {
font-size: var(--cds-body-short-01-font-size);
font-weight: var(--cds-body-short-01-font-weight);
line-height: var(--cds-body-short-01-line-height);
Expand Down
3 changes: 2 additions & 1 deletion packages/form-js-carbon-styles/src/carbon-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,8 @@
// Button styles /////////////

.fjs-container {
.fjs-form-field.fjs-form-field-button .fjs-button {
.fjs-form-field.fjs-form-field-button .fjs-button,
.fjs-form-field.fjs-form-field-filepicker .fjs-button {
font-size: var(--cds-body-short-01-font-size);
font-weight: var(--cds-body-short-01-font-weight);
line-height: var(--cds-body-short-01-line-height);
Expand Down
6 changes: 6 additions & 0 deletions packages/form-js-carbon-styles/test/spec/complex.json
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,12 @@
"height": 30,
"id": "Field_1a82jjsdasd"
},
{
"type": "filepicker",
"key": "filepicker",
"accept": ".png,.jpg",
"multiple": true
},
{
"action": "reset",
"label": "reset",
Expand Down
6 changes: 6 additions & 0 deletions packages/form-js-playground/test/spec/form.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "../../../form-json-schema/resources/schema.json",
"components": [
{
"type": "filepicker",
"key": "filepicker",
"accept": ".png,.jpg",
"multiple": true
},
{
"type": "expression",
"key": "expressionResult",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function FilePicker(props) {
type="button"
disabled={isInputDisabled}
readonly={readonly}
className="fjs-button"
className="fjs-button fjs-filepicker-button"
onClick={() => {
fileInputRef.current.click();
}}>
Expand Down

0 comments on commit e5ace5e

Please sign in to comment.