-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add loading & fix button loading, glass
- Loading branch information
Showing
13 changed files
with
285 additions
and
74 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
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,103 @@ | ||
<route lang="yml"> | ||
meta: | ||
category: data-display | ||
</route> | ||
|
||
# Loading | ||
|
||
Loading shows an animation to indicate that something is loading. | ||
|
||
## Examples | ||
|
||
loading spinner | ||
|
||
```html :::demo | ||
<div class="flex items-center space-x-2"> | ||
<dv-loading size="xs" /> | ||
<dv-loading size="sm" /> | ||
<dv-loading size="md" /> | ||
<dv-loading size="lg" /> | ||
</div> | ||
``` | ||
|
||
loading dots | ||
|
||
```html :::demo | ||
<div class="flex items-center space-x-2"> | ||
<dv-loading variant="dots" size="xs" /> | ||
<dv-loading variant="dots" size="sm" /> | ||
<dv-loading variant="dots" size="md" /> | ||
<dv-loading variant="dots" size="lg" /> | ||
</div> | ||
``` | ||
|
||
loading ring | ||
|
||
```html :::demo | ||
<div class="flex items-center space-x-2"> | ||
<dv-loading variant="ring" size="xs" /> | ||
<dv-loading variant="ring" size="sm" /> | ||
<dv-loading variant="ring" size="md" /> | ||
<dv-loading variant="ring" size="lg" /> | ||
</div> | ||
``` | ||
|
||
loading ball | ||
|
||
```html :::demo | ||
<div class="flex items-center space-x-2"> | ||
<dv-loading variant="ball" size="xs" /> | ||
<dv-loading variant="ball" size="sm" /> | ||
<dv-loading variant="ball" size="md" /> | ||
<dv-loading variant="ball" size="lg" /> | ||
</div> | ||
``` | ||
|
||
loading bars | ||
|
||
```html :::demo | ||
<div class="flex items-center space-x-2"> | ||
<dv-loading variant="bars" size="xs" /> | ||
<dv-loading variant="bars" size="sm" /> | ||
<dv-loading variant="bars" size="md" /> | ||
<dv-loading variant="bars" size="lg" /> | ||
</div> | ||
``` | ||
|
||
loading infinity | ||
|
||
```html :::demo | ||
<div class="flex items-center space-x-2"> | ||
<dv-loading variant="infinity" size="xs" /> | ||
<dv-loading variant="infinity" size="sm" /> | ||
<dv-loading variant="infinity" size="md" /> | ||
<dv-loading variant="infinity" size="lg" /> | ||
</div> | ||
``` | ||
|
||
loading with colors | ||
|
||
```html :::demo | ||
<div class="flex items-center space-x-2"> | ||
<dv-loading color="neutral" /> | ||
<dv-loading color="primary" /> | ||
<dv-loading color="secondary" /> | ||
<dv-loading color="accent" /> | ||
<dv-loading color="info" /> | ||
<dv-loading color="success" /> | ||
<dv-loading color="warning" /> | ||
<dv-loading color="error" /> | ||
<dv-loading color="red" /> | ||
<dv-loading color="#6cf" /> | ||
</div> | ||
``` | ||
|
||
## Loading | ||
|
||
### Attributes | ||
|
||
| name | description | type | default | | ||
| ------- | ------------- | ----------------------------------------- | ------- | | ||
| variant | loading style | spinner, dots, ring, ball, bars, infinity | spinner | | ||
| size | loading size | ISize | md | | ||
| color | IColor,string | - | |
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
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,33 @@ | ||
import { sizeProps } from 'daisyui-vue/shared/constants'; | ||
import { componentV2 } from 'daisyui-vue/shared/styled'; | ||
import { ExtractFromProps } from 'daisyui-vue/shared/types/common'; | ||
import { HTMLAttributes, PropType, computed } from 'vue'; | ||
import style from './style'; | ||
import { Raw, rawProps } from '../_widgets/raw'; | ||
|
||
export const loadingProps = { | ||
variant: { | ||
type: String as PropType< | ||
'spinner' | 'dots' | 'ring' | 'ball' | 'bars' | 'infinity' | ||
>, | ||
default: 'spinner', | ||
}, | ||
...sizeProps, | ||
color: rawProps.color, | ||
}; | ||
|
||
export type ILoadingProps = ExtractFromProps<typeof loadingProps>; | ||
|
||
export const Loading = componentV2<ILoadingProps, HTMLAttributes>( | ||
{ | ||
name: 'Loading', | ||
props: loadingProps, | ||
setup(props, ctx) { | ||
const cls = computed(() => | ||
__c('loading', `loading-${props.variant}`, `loading-${props.size}`), | ||
); | ||
return () => <Raw tag="span" class={cls.value} color={props.color} />; | ||
}, | ||
}, | ||
style, | ||
); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,2 @@ | ||
import s1 from './c-s.css'; | ||
export default [s1]; |
Oops, something went wrong.