Skip to content

Commit

Permalink
feat(omiu): tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
dntzhang committed Nov 23, 2023
1 parent 0556af0 commit 1488d79
Show file tree
Hide file tree
Showing 29 changed files with 878 additions and 316 deletions.
43 changes: 21 additions & 22 deletions packages/omiu/src/components/chip/api.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
## Chip Props

| Name | Type | Default | Description |
| --------- | ------- | --------- | ------------------------------------------------- |
| outline | string | '' | The outline type: primary, secondary, success, danger, warning, info, light, dark |
| size | string | 'small' | The size of the chip: small, medium, large |
| img | string | '' | The image source for the chip |
| closable | boolean | false | Whether the chip can be closed |
| tag | string | '' | The tag for the chip |
| className | string | '' | The custom class name for the chip |
| Name | Type | Default | Description |
| --------- | ------- | ------- | --------------------------------------------------------------------------------- |
| outline | string | '' | The outline type: primary, secondary, success, danger, warning, info, light, dark |
| size | string | 'small' | The size of the chip: small, medium, large |
| img | string | '' | The image source for the chip |
| closable | boolean | false | Whether the chip can be closed |
| tag | string | '' | The tag for the chip |
| className | string | '' | The custom class name for the chip |

## Chip Events

| Event | Description |
| ----- | ------------------- |
| Event | Description |
| ----- | ----------------------------- |
| close | Fired when the chip is closed |


## Chip 属性

| 属性名 | 类型 | 默认值 | 说明 |
| -------- | -------- | -------- | ------------------------------------------------ |
| outline | 字符串 | '' | 描述轮廓类型:primary、secondary、success、danger、warning、info、light、dark |
| size | 字符串 | 'small' | Chip 的尺寸:small、medium、large |
| img | 字符串 | '' | Chip 的图片来源 |
| closable | 布尔值 | false | Chip 是否可以关闭 |
| tag | 字符串 | '' | Chip 的标签 |
| className| 字符串 | '' | Chip 的自定义类名 |
| 属性名 | 类型 | 默认值 | 说明 |
| --------- | ------ | ------- | ----------------------------------------------------------------------------- |
| outline | 字符串 | '' | 描述轮廓类型:primary、secondary、success、danger、warning、info、light、dark |
| size | 字符串 | 'small' | Chip 的尺寸:small、medium、large |
| img | 字符串 | '' | Chip 的图片来源 |
| closable | 布尔值 | false | Chip 是否可以关闭 |
| tag | 字符串 | '' | Chip 的标签 |
| className | 字符串 | '' | Chip 的自定义类名 |

## Chip 事件

| 事件名 | 说明 |
| ------ | ---------------- |
| close | 当 Chip 被关闭时触发 |
| 事件名 | 说明 |
| ------ | -------------------- |
| close | 当 Chip 被关闭时触发 |
10 changes: 8 additions & 2 deletions packages/omiu/src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export class Chip extends Component {
: 'rgba(128,128,128,.7)'

return (
<div o-ripple={{ color: rippleColor }} class={classNames(theme.root, theme[props.size], theme[props.outline], props.className)}>
<div
o-ripple={{ color: rippleColor }}
class={classNames(theme.root, theme[props.size], theme[props.outline], props.className)}
>
{props.img && (
<img
class="my-0 -ml-[12px] mr-[8px] h-[inherit] w-[inherit] rounded-[100%]"
Expand All @@ -58,7 +61,10 @@ export class Chip extends Component {
)}
{props.tag}
{props.closable && (
<span onClick={this.onClose} class="float-right w-4 cursor-pointer pl-[8px] text-[16px] text-[#afafaf] opacity-[.53] transition-all duration-200 ease-in-out hover:text-[#8b8b8b] dark:text-neutral-400 dark:hover:text-neutral-100">
<span
onClick={this.onClose}
class="float-right w-4 cursor-pointer pl-[8px] text-[16px] text-[#afafaf] opacity-[.53] transition-all duration-200 ease-in-out hover:text-[#8b8b8b] dark:text-neutral-400 dark:hover:text-neutral-100"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
Expand Down
212 changes: 0 additions & 212 deletions packages/omiu/src/lib/components/input/index.tsx

This file was deleted.

48 changes: 0 additions & 48 deletions packages/omiu/src/lib/components/input/inputTheme.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/omiu/src/lib/index.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions packages/omiu/src/navigation/tabs/TabsAPI.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import content from './api.md?raw'
import { tag, Component } from 'omi'
import '../../common/markdown-renderer'

@tag('tabs-api')
export class API extends Component {
render() {
return <markdown-renderer content={content}></markdown-renderer>
}
}
Loading

0 comments on commit 1488d79

Please sign in to comment.