forked from IQSS/dataverse-frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IQSS#433 from IQSS/feature/319-new-collection-page
Feature/319 new collection page
- Loading branch information
Showing
54 changed files
with
2,042 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline | |
- **Select Multiple:** add is-invalid classname if isInvalid prop is true. | ||
- **Card:** NEW card element to show header and body. | ||
- **ProgressBar:** NEW progress bar element to show progress. | ||
- **NavbarDropdownItem:** Now accepts `as` prop and takes `as` Element props. | ||
- **FormInputGroup:** extend Props Interface to accept `hasValidation` prop to properly show rounded corners in an <InputGroup> with validation | ||
- **Button:** extend Props Interface to accept `size` prop. | ||
- **FormInput:** extend Props Interface to accept `autoFocus` prop. | ||
- **FormTextArea:** extend Props Interface to accept `autoFocus` prop. | ||
- **FormSelect:** extend Props Interface to accept `autoFocus` prop. | ||
- **Stack:** NEW Stack element to manage layouts. | ||
|
||
# [1.1.0](https://github.com/IQSS/dataverse-frontend/compare/@iqss/[email protected]...@iqss/[email protected]) (2024-03-12) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 14 additions & 8 deletions
22
packages/design-system/src/lib/components/navbar/navbar-dropdown/NavbarDropdownItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { ComponentPropsWithoutRef, ElementType } from 'react' | ||
import { Stack as StackBS } from 'react-bootstrap' | ||
|
||
type StackProps<T extends ElementType> = { | ||
direction?: 'horizontal' | 'vertical' | ||
gap?: 0 | 1 | 2 | 3 | 4 | 5 | ||
as?: T | ||
children: React.ReactNode | ||
} & (T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : ComponentPropsWithoutRef<T>) | ||
|
||
export function Stack<T extends ElementType = 'div'>({ | ||
direction = 'vertical', | ||
gap = 3, | ||
as, | ||
children, | ||
...rest | ||
}: StackProps<T>) { | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
const Component: ElementType<any> = as || 'div' | ||
|
||
return ( | ||
<StackBS direction={direction} gap={gap} as={Component} {...rest}> | ||
{children} | ||
</StackBS> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
packages/design-system/src/lib/stories/stack/Stack.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import { CSSProperties } from 'react' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { Stack } from '../../components/stack/Stack' | ||
import { Col } from '../../components/grid/Col' | ||
|
||
/** | ||
* ## Description | ||
* Stacks are vertical by default and stacked items are full-width by default. Use the gap prop to add space between items. | ||
* | ||
* Use direction="horizontal" for horizontal layouts. Stacked items are vertically centered by default and only take up their necessary width. | ||
* | ||
* Use the gap prop to add space between items. | ||
*/ | ||
const meta: Meta<typeof Stack> = { | ||
tags: ['autodocs'], | ||
title: 'Stack', | ||
component: Stack | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof Stack> | ||
|
||
const inlineStyles: CSSProperties = { | ||
backgroundColor: '#337AB7', | ||
color: 'white', | ||
padding: '0.5rem' | ||
} | ||
|
||
export const VerticalStack: Story = { | ||
render: () => ( | ||
<Stack> | ||
<div style={inlineStyles}>Item 1</div> | ||
<div style={inlineStyles}>Item 2</div> | ||
<div style={inlineStyles}>Item 3</div> | ||
</Stack> | ||
) | ||
} | ||
|
||
/** | ||
* Use direction="horizontal" for horizontal layouts. | ||
* Stacked items are vertically centered by default and only take up their necessary width. | ||
*/ | ||
export const HorizontalStack: Story = { | ||
render: () => ( | ||
<Stack direction="horizontal"> | ||
<div style={inlineStyles}>Item 1</div> | ||
<div style={inlineStyles}>Item 2</div> | ||
<div style={inlineStyles}>Item 3</div> | ||
</Stack> | ||
) | ||
} | ||
/** | ||
* By using Columns as childrens of the Stack, you can create a layout with columns that are full-width by default. | ||
*/ | ||
export const HorizontalStackWithColumns: Story = { | ||
render: () => ( | ||
<Stack direction="horizontal"> | ||
<Col style={inlineStyles}>Item 1</Col> | ||
<Col style={inlineStyles}>Item 2</Col> | ||
<Col style={inlineStyles}>Item 3</Col> | ||
</Stack> | ||
) | ||
} | ||
/** | ||
* Gap 0 = 0 | ||
* | ||
* Gap 1 = 0.25rem (4px) | ||
* | ||
* Gap 2 = 0.5rem (8px) | ||
* | ||
* Gap 3 = 1rem (16px) | ||
* | ||
* Gap 4 = 1.5rem (24px) | ||
* | ||
* Gap 5 = 3rem (48px) | ||
*/ | ||
export const AllGaps: Story = { | ||
render: () => ( | ||
<Stack gap={4}> | ||
<Stack direction="horizontal" gap={0}> | ||
<Col style={inlineStyles}>Item 1</Col> | ||
<Col style={inlineStyles}>Item 2</Col> | ||
</Stack> | ||
<Stack direction="horizontal" gap={1}> | ||
<Col style={inlineStyles}>Item 1</Col> | ||
<Col style={inlineStyles}>Item 2</Col> | ||
</Stack> | ||
<Stack direction="horizontal" gap={2}> | ||
<Col style={inlineStyles}>Item 1</Col> | ||
<Col style={inlineStyles}>Item 2</Col> | ||
</Stack> | ||
<Stack direction="horizontal" gap={3}> | ||
<Col style={inlineStyles}>Item 1</Col> | ||
<Col style={inlineStyles}>Item 2</Col> | ||
</Stack> | ||
<Stack direction="horizontal" gap={4}> | ||
<Col style={inlineStyles}>Item 1</Col> | ||
<Col style={inlineStyles}>Item 2</Col> | ||
</Stack> | ||
<Stack direction="horizontal" gap={5}> | ||
<Col style={inlineStyles}>Item 1</Col> | ||
<Col style={inlineStyles}>Item 2</Col> | ||
</Stack> | ||
</Stack> | ||
) | ||
} | ||
|
||
/** | ||
* Use `as` prop to render the Stack as a different element. | ||
* If you inspect the rendered HTML, you will see that the Stack is rendered as a section element. | ||
*/ | ||
export const StackAsSection: Story = { | ||
render: () => ( | ||
<Stack as="section"> | ||
<div style={inlineStyles}>Item 1</div> | ||
<div style={inlineStyles}>Item 2</div> | ||
<div style={inlineStyles}>Item 3</div> | ||
</Stack> | ||
) | ||
} |
Oops, something went wrong.