-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
18 changed files
with
205 additions
and
160 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
<component | ||
:is="tag" | ||
:class="getClass('list-item')" | ||
> | ||
<!-- @slot for list item content --> | ||
<slot /> | ||
</component> |
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,21 @@ | ||
import alpacaUIMixin from '../../../utils/helpers/alpaca-ui.js' | ||
|
||
export default { | ||
mixins: [alpacaUIMixin], | ||
props: { | ||
/** | ||
* To use another tag instead of `li` | ||
*/ | ||
tag: { | ||
type: String, | ||
default: 'li' | ||
} | ||
}, | ||
config: { | ||
base: { | ||
'list-item': [ | ||
'p-2' | ||
] | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<component | ||
:is="tag" | ||
class="a-list" | ||
:class="getClass('list')" | ||
> | ||
<!-- @slot List item --> | ||
<slot /> | ||
|
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,49 @@ | ||
import alpacaUIMixin from '../../../utils/helpers/alpaca-ui.js' | ||
|
||
export default { | ||
mixins: [alpacaUIMixin], | ||
props: { | ||
/** | ||
* To use another tag instead of `ul` | ||
*/ | ||
tag: { | ||
type: String, | ||
default: 'ul' | ||
} | ||
}, | ||
config: { | ||
base: { | ||
list: [ | ||
'list-none', | ||
'text-primary' | ||
] | ||
}, | ||
native: { | ||
list: [ | ||
'list-disc' | ||
] | ||
}, | ||
horizontal: { | ||
list: [ | ||
'flex', 'flex-row', 'flex-wrap', 'space-x-6' | ||
] | ||
}, | ||
centered: { | ||
list: [ | ||
'justify-center', | ||
'text-center' | ||
] | ||
}, | ||
divided: { | ||
list: [ | ||
'divide-y', 'divide-gray-100' | ||
] | ||
}, | ||
'divided-horizontal': { | ||
list: [ | ||
'flex', 'flex-row', 'flex-wrap', | ||
'divide-x', 'divide-gray-100' | ||
] | ||
} | ||
} | ||
} |
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,76 @@ | ||
import AList from './List.vue' | ||
import AListItem from '@atoms/list-item/ListItem.vue' | ||
import ALink from '@atoms/link/Link.vue' | ||
|
||
export default { | ||
title: 'Atoms/List', | ||
component: AList, | ||
argTypes: { | ||
tag: { | ||
control: { | ||
type: 'text' | ||
} | ||
}, | ||
variant: { | ||
control: { | ||
type: 'multi-select', | ||
options: [ | ||
'primary', | ||
'native', | ||
'horizontal', | ||
'divided', | ||
'centered', | ||
'divided-horizontal' | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
// base list | ||
const BaseTemplate = (args, { argTypes }) => ({ | ||
components: { AList, AListItem }, | ||
props: Object.keys(argTypes), | ||
template: ` | ||
<a-list | ||
:tag="tag" | ||
:variant="variant" | ||
> | ||
<a-list-item> | ||
Lorem ipsum | ||
</a-list-item> | ||
<a-list-item> | ||
Lorem ipsum | ||
</a-list-item> | ||
<a-list-item> | ||
Lorem ipsum | ||
</a-list-item> | ||
</a-list> | ||
` | ||
}) | ||
|
||
export const Default = BaseTemplate.bind({}) | ||
|
||
// with slots list | ||
const WithSlotsTemplate = (args, { argTypes }) => ({ | ||
components: { AList, AListItem, ALink }, | ||
props: Object.keys(argTypes), | ||
template: ` | ||
<a-list | ||
:tag="tag" | ||
:variant="variant" | ||
> | ||
<a-list-item> | ||
<a-link href="#">Lorem ipsum</a-link> | ||
</a-list-item> | ||
<a-list-item> | ||
<a-link href="#">Lorem ipsum</a-link> | ||
</a-list-item> | ||
<a-list-item> | ||
<a-link href="#">Lorem ipsum</a-link> | ||
</a-list-item> | ||
</a-list> | ||
` | ||
}) | ||
|
||
export const WithSlots = WithSlotsTemplate.bind({}) |
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
Oops, something went wrong.