;
15 | };
16 |
--------------------------------------------------------------------------------
/components/Tag/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/svelte/tsconfig.json",
3 |
4 | "compilerOptions": {
5 | "noImplicitAny": true,
6 | "strict": true,
7 | "declaration": true,
8 | "sourceMap": false
9 | },
10 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.svelte"],
11 | "exclude": ["node_modules/*", "**/*.spec.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/basic.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/children.mode.alternate.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/children.mode.left.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/children.mode.right.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/color.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/label.mode.alternate.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/label.mode.left.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/label.mode.right.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/pending.string.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/pending.true.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/position.mode.alternate.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/position.mode.left.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/position.mode.right.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/position.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/reverse.pending.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/reverse.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/slots.children.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | 🍒 {children}
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/slots.dot.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | ⭕
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/__test__/fixture/slots.pending.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | pending
16 |
17 |
--------------------------------------------------------------------------------
/components/Timeline/src/index.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import Timeline from './index.svelte';
3 | export { Timeline as KTimeline };
4 |
5 | export default Timeline;
6 |
7 | export type { KTimelineItem, KTimelineProps } from './types';
8 |
--------------------------------------------------------------------------------
/components/Timeline/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/svelte/tsconfig.json",
3 |
4 | "compilerOptions": {
5 | "noImplicitAny": true,
6 | "strict": true,
7 | "declaration": true
8 | },
9 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.svelte"],
10 | "exclude": ["node_modules/*", "**/*.spec.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/components/Tooltip/__test__/fixture/tooltip.placement.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | top
7 |
8 |
--------------------------------------------------------------------------------
/components/Tooltip/__test__/fixture/tooltip.slots.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | triggerEl
7 |
8 |
--------------------------------------------------------------------------------
/components/Tooltip/__test__/fixture/tooltip.trigger.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | top
7 |
8 |
--------------------------------------------------------------------------------
/components/Tooltip/src/index.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import Tooltip from './index.svelte';
3 |
4 | export default Tooltip;
5 |
6 | export { Tooltip as KTooltip };
7 |
8 | export type { KTooltipProps } from './types';
9 |
--------------------------------------------------------------------------------
/components/Tooltip/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/svelte/tsconfig.json",
3 |
4 | "compilerOptions": {
5 | "noImplicitAny": true,
6 | "strict": true,
7 | "declaration": true,
8 | "sourceMap": false
9 | },
10 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.svelte"],
11 | "exclude": ["node_modules/*", "**/*.spec.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/components/Tour/src/index.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import Tour from './index.svelte';
3 | export { Tour as KTour };
4 |
5 | export default Tour;
6 |
7 | export type { KTourProps, KTourStepsOption } from './types';
8 |
--------------------------------------------------------------------------------
/components/Tour/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/svelte/tsconfig.json",
3 |
4 | "compilerOptions": {
5 | "noImplicitAny": true,
6 | "strict": true,
7 | "declaration": true
8 | },
9 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.svelte"],
10 | "exclude": ["node_modules/*", "**/*.spec.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/components/VirtualList/src/index.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import VirtualList from './index.svelte';
3 | export { VirtualList as KVirtualList };
4 |
5 | export default VirtualList;
6 |
7 | export type { KVirtualListProps } from './types';
8 |
--------------------------------------------------------------------------------
/components/VirtualList/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/svelte/tsconfig.json",
3 |
4 | "compilerOptions": {
5 | "noImplicitAny": true,
6 | "strict": true,
7 | "declaration": true,
8 | "sourceMap": false
9 | },
10 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.svelte"],
11 | "exclude": ["node_modules/*", "**/*.spec.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/components/Watermark/__test__/__snapshots__/watermark.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2 |
3 | exports[`Test: KWatermark > props: cls 1`] = `"
"`;
4 |
5 | exports[`Test: KWatermark > slot: default 1`] = `" "`;
6 |
--------------------------------------------------------------------------------
/components/Watermark/__test__/fixture/watermark.slot.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/components/Watermark/src/index.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import Watermark from './index.svelte';
3 | export { Watermark as KWatermark };
4 |
5 | export default Watermark;
6 |
7 | export type { KWatermarkFont, KWatermarkProps } from './types';
8 |
9 | export * from './utils';
10 | export * from './useClips';
11 |
--------------------------------------------------------------------------------
/components/Watermark/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/svelte/tsconfig.json",
3 |
4 | "compilerOptions": {
5 | "noImplicitAny": true,
6 | "strict": true,
7 | "declaration": true
8 | },
9 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.svelte"],
10 | "exclude": ["node_modules/*", "**/*.spec.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/components/types.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/components/demo-block/index.ts:
--------------------------------------------------------------------------------
1 | import DemoBlock from './src/index.vue';
2 |
3 | export default DemoBlock;
4 |
--------------------------------------------------------------------------------
/docs/.vitepress/components/logo-animate/index.ts:
--------------------------------------------------------------------------------
1 | import logoAnimate from './src/index.vue';
2 |
3 | export default logoAnimate;
4 |
--------------------------------------------------------------------------------
/docs/.vitepress/components/theme-color/index.ts:
--------------------------------------------------------------------------------
1 | import ThemeColor from './src/index.vue';
2 |
3 | export default ThemeColor;
4 |
--------------------------------------------------------------------------------
/docs/.vitepress/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import type { DefineComponent } from 'vue';
5 |
6 | const component: DefineComponent<{}, {}, any>;
7 | export default component;
8 | }
9 |
--------------------------------------------------------------------------------
/docs/.vitepress/plugins/code/index.ts:
--------------------------------------------------------------------------------
1 | import { demoBlockPlugin } from './plugin-demo-block';
2 |
3 | export function applyPlugins(md: any) {
4 | md.use(demoBlockPlugin);
5 | }
6 |
--------------------------------------------------------------------------------
/docs/example/alert/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | success alert
7 | error alert
8 | warning alert
9 | info alert
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/alert/description.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
13 | This is the description
16 |
17 |
--------------------------------------------------------------------------------
/docs/example/alert/icon.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | success alert
7 | error alert
8 | warning alert
9 | info alert
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/avatar/basic.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/avatar/fallback.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/example/avatar/fit-container.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 | {#each fits as fit}
10 |
14 | {/each}
15 |
16 |
--------------------------------------------------------------------------------
/docs/example/avatar/types.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 | User
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/backtop/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 | attention to the right _(:з」∠)_
6 |
7 |
--------------------------------------------------------------------------------
/docs/example/backtop/custom.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 | attention to the right _(:з」∠)_
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/badge/customizations.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | Can't Eat Pancakes
8 |
9 |
10 |
11 | Consumption Pills
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/badge/dot-mark.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | 🎤&💃
8 |
9 |
10 |
11 | 🤟&🏀
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/badge/max-value.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 | count++}>Lychee
10 |
11 |
12 |
13 | Little Sunspot
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/breadcrumb/basic.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | IKun UI
8 | Breadcrumb
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/breadcrumb/separator-icon.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | IKun UI
8 | Breadcrumb
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/calendar/basic.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/calendar/card.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/card/shadow.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | Always
7 | Hover
8 | Never
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/card/simple-card.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | IKun UI is a component library based on svelte.
9 | {#each components as component}
10 | {component}
11 | {/each}
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/color-picker/alpha.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 |
--------------------------------------------------------------------------------
/docs/example/color-picker/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
--------------------------------------------------------------------------------
/docs/example/color-picker/clear.svelte:
--------------------------------------------------------------------------------
1 |
10 |
11 |
19 |
--------------------------------------------------------------------------------
/docs/example/color-picker/disabled.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 |
--------------------------------------------------------------------------------
/docs/example/color-picker/text.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 | ikun ui 🎤 🤟 🏀 {value}
18 |
19 |
20 |
--------------------------------------------------------------------------------
/docs/example/color-picker/trigger.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 | ikun ui 🐔 {value}
18 |
19 |
20 |
--------------------------------------------------------------------------------
/docs/example/contextmenu/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | right click on me 🏀
7 |
8 | We were both young
9 | When I first saw you
10 | I closed my eyes
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/contextmenu/disabled.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | right click on me 🏀
7 |
8 | We were both young
9 | When I first saw you
10 | I closed my eyes
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/divider/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | The worst way to miss someone is to be sitting right beside them knowing you can’t have them.
8 |
9 |
10 | Life is like a box of chocolates, you never know what you are going to get.
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/divider/vertical-divider.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | apple
7 |
8 | banana
9 |
10 | orange
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/ellipsis/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
9 |
--------------------------------------------------------------------------------
/docs/example/ellipsis/line-clamp.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/ellipsis/num.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/docs/example/empty/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/example/empty/bottom.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | KButton
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/empty/image.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/example/empty/size.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/flex/wrap.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | {#each arrs as item}
9 | button
10 | {/each}
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/grid/gutter.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/icon/multi-color.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/example/input-number/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {num}
11 |
--------------------------------------------------------------------------------
/docs/example/input-number/disabled.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/input-number/limit.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {num}
11 |
--------------------------------------------------------------------------------
/docs/example/input-number/precision.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {num}
11 |
--------------------------------------------------------------------------------
/docs/example/input-number/step.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {num}
11 |
--------------------------------------------------------------------------------
/docs/example/input-number/strictly.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {num}
11 |
--------------------------------------------------------------------------------
/docs/example/input/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {value}
11 |
--------------------------------------------------------------------------------
/docs/example/input/clearable.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
18 | {value}
19 |
--------------------------------------------------------------------------------
/docs/example/input/disabled.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {value}
11 |
--------------------------------------------------------------------------------
/docs/example/input/password.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
11 | {value}
12 |
--------------------------------------------------------------------------------
/docs/example/input/prefix.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 | {value}
18 |
--------------------------------------------------------------------------------
/docs/example/layout/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | 风带来故事的种子,时间使之发芽(header)
8 |
9 |
10 | 你我同为异世界之旅人,在此相遇皆为命运之意志(main)
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/layout/basic3.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | 飞翔吧,飞翔吧
8 | 就像飞鸟那样
9 | (aside)
10 |
11 |
12 | 若你困于无风之地,我将奏响高天之歌
13 | 我将奏响高天之歌
14 | (main)
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/example/mask/basic.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | (show = true)}>open mask
9 |
10 | (show = false)} cls="fixed z-1001 top-1/2 left-1/2">
11 | close mask
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/message-box/custom-content.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | foo
11 | bar
12 | head
13 |
14 |
--------------------------------------------------------------------------------
/docs/example/message-box/custom-title.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | title
7 |
8 |
--------------------------------------------------------------------------------
/docs/example/message/basic.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | renderMessage('哇,真的是你啊~')}>
14 | render message
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/example/message/custom-content.svelte:
--------------------------------------------------------------------------------
1 | 荔枝?你要我怎么荔枝!? 🏀
2 |
--------------------------------------------------------------------------------
/docs/example/message/custom.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | renderMessage()}>custom render
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/message/offset.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | renderMessage('哇,真的是你啊~', 120)}>offset
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/modal/basic.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | (show = true)}>open modal
8 |
9 | (show = false)} {show}>
10 | 🥵 Sadness makes people more acute.
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/modal/layout.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | (show = true)}>open modal(layout)
8 |
9 | (show = false)} {show}>
10 | 🍞 Bread! Bread! We want to bread!
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/notification/custom-content.svelte:
--------------------------------------------------------------------------------
1 | 荔枝?你要我怎么荔枝!? 🏀
2 |
--------------------------------------------------------------------------------
/docs/example/notification/custom-title.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | custom-title
8 |
9 |
--------------------------------------------------------------------------------
/docs/example/page-header/basic.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | Title
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/page-header/icon.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | Title
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/page-header/no-icon.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | Title
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/pagination/background.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/pagination/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/pagination/infinite.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/popconfirm/basic.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | delete
8 |
9 |
--------------------------------------------------------------------------------
/docs/example/popconfirm/btn.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
15 | delete
16 |
17 |
--------------------------------------------------------------------------------
/docs/example/popconfirm/icon.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 | delete
14 |
15 |
--------------------------------------------------------------------------------
/docs/example/popover/basic.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | trigger KPopover
8 |
9 |
亲手点燃黑暗森林的火星
10 |
前进四
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/progress/color.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/example/radio/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | You like playing
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/rate/allow-half.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/rate/clearable.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/rate/more-icon.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/rate/score-template.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/rate/sizes.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/example/rate/with-text.svelte:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/select/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
11 | {value}
12 |
--------------------------------------------------------------------------------
/docs/example/select/clearable.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 | {value}
16 |
--------------------------------------------------------------------------------
/docs/example/select/disabled.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 | {value}
16 |
--------------------------------------------------------------------------------
/docs/example/select/prefix.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 | {value}
17 |
--------------------------------------------------------------------------------
/docs/example/skeleton/active.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/example/skeleton/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/example/skeleton/complex.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/example/slider/disabled.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 | value: {value}
12 |
--------------------------------------------------------------------------------
/docs/example/slider/range.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | value: {value}
14 | min: {min}
15 | max: {max}
16 |
--------------------------------------------------------------------------------
/docs/example/slider/render.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 | 🏀
12 |
13 | value: {value}
14 |
--------------------------------------------------------------------------------
/docs/example/slider/sizes.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/example/switch/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 | {value}
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/switch/color.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
16 | {value}
17 |
18 |
--------------------------------------------------------------------------------
/docs/example/switch/disabled.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/switch/loading.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/switch/value.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
16 | {value}
17 |
18 |
--------------------------------------------------------------------------------
/docs/example/tag/basic.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | info
7 | error
8 | success
9 | primary
10 | warning
11 | customize
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/tag/icon.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | Error
8 | Settings
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/tag/removable.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | info
7 | success
8 | primary
9 |
10 |
--------------------------------------------------------------------------------
/docs/example/tooltip/basic.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 | trigger KTooltip
11 |
12 |
--------------------------------------------------------------------------------
/docs/example/virtual-list/basic.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 | {data.label}
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/example/watermark/basic.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/watermark/content.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/example/watermark/image.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/public/WX20230805-132525@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ikun-svelte/ikun-ui/e1b1edbc9ac066d997d3069fa9488a4b369cbac0/docs/public/WX20230805-132525@2x.png
--------------------------------------------------------------------------------
/docs/public/WX20230805-132646@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ikun-svelte/ikun-ui/e1b1edbc9ac066d997d3069fa9488a4b369cbac0/docs/public/WX20230805-132646@2x.png
--------------------------------------------------------------------------------
/docs/public/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ikun-svelte/ikun-ui/e1b1edbc9ac066d997d3069fa9488a4b369cbac0/docs/public/logo.psd
--------------------------------------------------------------------------------
/docs/public/xhz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ikun-svelte/ikun-ui/e1b1edbc9ac066d997d3069fa9488a4b369cbac0/docs/public/xhz.jpg
--------------------------------------------------------------------------------
/docs/svelte.config.js:
--------------------------------------------------------------------------------
1 | import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
2 |
3 | export default {
4 | // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5 | // for more information about preprocessors
6 | preprocess: vitePreprocess()
7 | };
8 |
--------------------------------------------------------------------------------
/e2e/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /build
4 | /dist
5 | /.svelte-kit
6 | /package
7 | .env
8 | .env.*
9 | !.env.example
10 | vite.config.js.timestamp-*
11 | vite.config.ts.timestamp-*
12 |
--------------------------------------------------------------------------------
/e2e/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | %sveltekit.head%
8 |
9 |
10 | %sveltekit.body%
11 |
12 |
13 |
--------------------------------------------------------------------------------
/e2e/src/component/KVirtualList/offset.test.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 | {data.label}
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/e2e/src/component/KVirtualList/slot-default.test.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 | {data.label}
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/e2e/src/component/KVirtualList/start.test.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 | {data.label}
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/e2e/src/routes/+page.svelte:
--------------------------------------------------------------------------------
1 | ikun-ui e2e test
2 |
--------------------------------------------------------------------------------
/e2e/src/routes/+page.ts:
--------------------------------------------------------------------------------
1 | import 'virtual:uno.css';
2 |
--------------------------------------------------------------------------------
/e2e/src/routes/select/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/e2e/src/routes/select/+page.ts:
--------------------------------------------------------------------------------
1 | import 'virtual:uno.css';
2 |
--------------------------------------------------------------------------------
/e2e/src/routes/virtual-list/+page.ts:
--------------------------------------------------------------------------------
1 | import 'virtual:uno.css';
2 |
--------------------------------------------------------------------------------
/e2e/static/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ikun-svelte/ikun-ui/e1b1edbc9ac066d997d3069fa9488a4b369cbac0/e2e/static/favicon.png
--------------------------------------------------------------------------------
/e2e/vite.config.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore
2 | import { sveltekit } from '@sveltejs/kit/vite';
3 | import { defineConfig } from 'vitest/config';
4 | import Unocss from 'unocss/vite';
5 | export default defineConfig({
6 | plugins: [sveltekit(), Unocss()]
7 | /* test: {
8 | include: ['components/!**!/!*.{test,spec}.{js,ts}']
9 | }*/
10 | });
11 |
--------------------------------------------------------------------------------
/e2e/vitest.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vitest/config';
2 |
3 | const timeout = process.env.CI ? 100000 : 50000;
4 | export default defineConfig({
5 | test: {
6 | include: ['./src/**/*.test.[tj]s'],
7 | testTimeout: timeout,
8 | hookTimeout: timeout,
9 | reporters: 'dot',
10 | onConsoleLog(log) {
11 | if (log.match(/experimental|jit engine|emitted file|tailwind/i)) return false;
12 | }
13 | },
14 | esbuild: {
15 | target: 'node14'
16 | }
17 | });
18 |
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build.environment]
2 | NODE_VERSION = "18"
3 |
4 | [build]
5 | base = "docs"
6 | publish = "/.vitepress/dist"
7 | command = "pnpm run docs:build"
8 |
--------------------------------------------------------------------------------
/play/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /build
4 | /dist
5 | /.svelte-kit
6 | /package
7 | .env
8 | .env.*
9 | !.env.example
10 | vite.config.js.timestamp-*
11 | vite.config.ts.timestamp-*
12 | src/routes/+page.svelte
13 |
--------------------------------------------------------------------------------
/play/src/app.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | --at-apply: p0 m0 min-h-100vh bg-ikun-white;
4 | }
5 | html.dark,
6 | .dark body {
7 | --at-apply: bg-ikun-black;
8 | }
9 |
--------------------------------------------------------------------------------
/play/src/app.d.ts:
--------------------------------------------------------------------------------
1 | // See https://kit.svelte.dev/docs/types#app
2 | // for information about these interfaces
3 | declare global {
4 | namespace App {
5 | // interface Error {}
6 | // interface Locals {}
7 | // interface PageData {}
8 | // interface Platform {}
9 | }
10 | }
11 |
12 | export {};
13 |
--------------------------------------------------------------------------------
/play/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | %sveltekit.head%
8 |
9 |
10 | %sveltekit.body%
11 |
12 |
13 |
--------------------------------------------------------------------------------
/play/src/lib/index.js:
--------------------------------------------------------------------------------
1 | // Reexport your entry components here
2 |
--------------------------------------------------------------------------------
/play/src/routes/+page.ts:
--------------------------------------------------------------------------------
1 | import 'virtual:uno.css';
2 | import '../app.css'
3 |
--------------------------------------------------------------------------------
/play/static/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ikun-svelte/ikun-ui/e1b1edbc9ac066d997d3069fa9488a4b369cbac0/play/static/favicon.png
--------------------------------------------------------------------------------
/play/vite.config.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore
2 | import { sveltekit } from '@sveltejs/kit/vite';
3 | import Inspect from 'vite-plugin-inspect';
4 | import { defineConfig } from 'vitest/config';
5 | import Unocss from 'unocss/vite';
6 | export default defineConfig({
7 | plugins: [sveltekit(), Unocss(), Inspect()],
8 | test: {
9 | include: ['components/**/*.{test,spec}.{js,ts}']
10 | },
11 | server: {
12 | port: 8001
13 | },
14 | optimizeDeps: {
15 | // exclude: ['svelte']
16 | }
17 | });
18 |
--------------------------------------------------------------------------------
/playground/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@ikun-ui/playground",
3 | "version": "0.0.2"
4 | }
5 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - playground
3 | - docs
4 | - play
5 | - preset
6 | - utils
7 | - e2e
8 | - components/*
9 |
--------------------------------------------------------------------------------
/preset/src/index.ts:
--------------------------------------------------------------------------------
1 | export { presetIkun } from './preset';
2 | export * from './shortcuts/index';
3 | // custom theme: colors + theme + rules
4 | export { defaultColors as ikunColors, getCSSPreflights } from './colors';
5 | export { defaultTheme as ikunTheme } from './theme';
6 | export { defaultRules as ikunRules } from './rules';
7 | export { defaultShortcuts as ikunShortcuts } from './shortcuts';
8 |
--------------------------------------------------------------------------------
/preset/src/rules/src/card.ts:
--------------------------------------------------------------------------------
1 | export const cardRules = {
2 | 'k-card-shadow': { 'box-shadow': '0 0 12px rgba(0, 0, 0, 0.12)' },
3 | // 'k-card-shadow__dark': { 'box-shadow': '0 0 12px rgba(0, 0, 0, 0.72)' },
4 | 'k-card-transition-timer': { transition: 'all 0.3s linear' }
5 | };
6 |
--------------------------------------------------------------------------------
/preset/src/rules/src/carousel.ts:
--------------------------------------------------------------------------------
1 | export const carouselRules = {
2 | 'k-carousel-center': { top: 'calc(50% - 16px)' },
3 | 'k-carousel-item': { transition: 'all .3s cubic-bezier(0.645, 0.045, 0.355, 1)' }
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/rules/src/descriptions-item.ts:
--------------------------------------------------------------------------------
1 | export function getDescriptionsItemGridColStartCls(colNum: number = 24) {
2 | const cls: Record> = {};
3 | for (let i = 1; i < colNum + 1; i++) {
4 | cls[`k-descriptions-item--col-${i}`] = {
5 | 'grid-column-start': `${i}`,
6 | 'grid-column-end': '-1'
7 | };
8 | cls[`ikun-last:k-descriptions-item--col-${i}`] = {
9 | '--at-apply': `last:k-descriptions-item--col-${i}`
10 | };
11 | }
12 | return cls;
13 | }
14 |
--------------------------------------------------------------------------------
/preset/src/rules/src/descriptions.ts:
--------------------------------------------------------------------------------
1 | export function getDescriptionsGridColCls(colNum: number = 24) {
2 | const cls: Record> = {};
3 | for (let i = 1; i < colNum + 1; i++) {
4 | cls[`k-descriptions--cols-${i}`] = {
5 | grid: `auto-flow / repeat(${i}, auto)`
6 | };
7 | }
8 | return cls;
9 | }
10 |
--------------------------------------------------------------------------------
/preset/src/rules/src/icon.ts:
--------------------------------------------------------------------------------
1 | export const iconRules = {
2 | 'k-icon-transition': { transition: 'all 0.3s linear' }
3 | };
4 |
--------------------------------------------------------------------------------
/preset/src/rules/src/indicators.ts:
--------------------------------------------------------------------------------
1 | export const indicatorsRules = {
2 | 'k-indicators-tanslate-y-half': { transform: 'translateY(-50%)' }
3 | };
4 |
--------------------------------------------------------------------------------
/preset/src/rules/src/input.ts:
--------------------------------------------------------------------------------
1 | export const inputRules = {
2 | 'k-input-shadow': { 'box-shadow': '0 0 0 2px #ff787542' },
3 | 'k-input-shadow--error': { 'box-shadow': '0 0 0 2px rgba(251,113,133,0.5)' }
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/rules/src/notify.ts:
--------------------------------------------------------------------------------
1 | export const notifyRules = {
2 | 'k-notify-transition': { transition: 'top 0.3s linear' }
3 | };
4 |
--------------------------------------------------------------------------------
/preset/src/rules/src/popover.ts:
--------------------------------------------------------------------------------
1 | export const popoverRules = {
2 | 'k-popover-shadow__left': { 'box-shadow': '0 0 10px rgb(0 0 0 / 0.25)' },
3 | 'k-popover-shadow__top': { 'box-shadow': '0 0 10px rgb(0 0 0 / 0.25)' },
4 | 'k-popover-shadow__bottom': { 'box-shadow': '0 0 10px rgb(0 0 0 / 0.25)' },
5 | 'k-popover-shadow__right': { 'box-shadow': '0 0 10px rgb(0 0 0 / 0.25)' }
6 | };
7 |
--------------------------------------------------------------------------------
/preset/src/rules/src/progress.ts:
--------------------------------------------------------------------------------
1 | export const progressRules = {
2 | 'k-progress-transition__cd': { transition: 'stroke-dasharray 0.28s linear' },
3 | 'k-progress-transition': { transition: 'width 0.28s linear' }
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/rules/src/skeleton.ts:
--------------------------------------------------------------------------------
1 | export const skeletonRules = {
2 | 'k-skeleton-bg': {
3 | background:
4 | 'linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.15) 37%, rgba(0, 0, 0, 0.06) 63%)',
5 | 'background-size': '400% 100%'
6 | },
7 | 'k-skeleton-bg__dark': {
8 | background:
9 | 'linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.15) 37%, rgba(255, 255, 255, 0.06) 63%)',
10 | 'background-size': '400% 100%'
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/preset/src/rules/src/switch.ts:
--------------------------------------------------------------------------------
1 | export const switchRules = {
2 | 'k-switch-transition': { transition: 'right .1s linear' }
3 | };
4 |
--------------------------------------------------------------------------------
/preset/src/rules/src/tab.ts:
--------------------------------------------------------------------------------
1 | export const tabRules = {
2 | 'k-tab-transition': { transition: 'transform .3s linear' },
3 | 'k-tab-transition-all': { transition: 'all .3s cubic-bezier(0.645, 0.045, 0.355, 1)' },
4 | 'k-tab__nav-transition': { transition: 'padding .3s cubic-bezier(0.645, 0.045, 0.355, 1)' }
5 | };
6 |
--------------------------------------------------------------------------------
/preset/src/rules/src/timeline.ts:
--------------------------------------------------------------------------------
1 | export const timelineRules = {
2 | 'k-timeline-tx-cr': { 'inset-inline-start': 'calc(50% - 12px)', width: 'calc(50% - 12px)' },
3 | 'k-timeline-tx-cl': { width: 'calc(50% - 12px)' }
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/affix.ts:
--------------------------------------------------------------------------------
1 | export const affixShortcuts: Record = {
2 | // affix
3 | 'k-affix': '[&.k-affix--affixed]:pf [&.k-affix--affixed.k-affix--absolute-positioned]:pa'
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/avatar.ts:
--------------------------------------------------------------------------------
1 | export const avatarShortcuts: Record = {
2 | // avatar
3 | 'k-avatar':
4 | 'infcc v-mid box-border text-ikun-tx-base text-14px text-center bg-ikun-light-700 overflow-hidden [&>img]:(block b-none max-w-full w-full h-full)',
5 |
6 | // dark
7 | 'k-avatar__dark': 'dark:bg-ikun-light-700'
8 | };
9 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/backtop.ts:
--------------------------------------------------------------------------------
1 | export const backtopShortcuts: Record = {
2 | // backtop
3 | 'k-backtop--base':
4 | 'fcc shadow-lg shadow-ikun-main pf cursor-pointer bg-ikun-white z-100 rounded-full w-12 h-12',
5 |
6 | // dark
7 | 'k-backtop__dark': 'dark:bg-ikun-dark-300'
8 | };
9 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/base.ts:
--------------------------------------------------------------------------------
1 | export const baseShortcuts: Record = {
2 | 'k-cur-disabled': '!cursor-not-allowed',
3 | 'k-cur-loading': 'cursor-wait ',
4 | 'k-border': 'border border-solid',
5 | 'k-bg-disabled': 'bg-ikun-disabled',
6 | 'k-reset-btn': 'p-0 text-[inherit] bg-transparent border-0 leading-[inherit]'
7 | };
8 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/breadcrumb.ts:
--------------------------------------------------------------------------------
1 | export const breadcrumbShortcuts: Record = {
2 | // breadcrumb
3 | 'k-breadcrumb': 'flex text-14px before:table after:(table clear-both)'
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/drawer.ts:
--------------------------------------------------------------------------------
1 | export const drawerShortcuts: Record = {
2 | // drawer
3 | 'k-drawer--base': 'bg-ikun-white fixed z-1000 top-0 min-w-1/3 h-full p2',
4 | 'k-drawer--op': 'w-full fi',
5 | 'k-drawer--content': 'overflow-y-auto mt-2',
6 | 'k-drawer--header--icon__hover': 'hover:text-ikun-main',
7 | 'k-drawer--footer': 'p2 fi',
8 | 'k-drawer--footer--btn': 'mx-2',
9 | // dark
10 | 'k-drawer--base__dark': 'dark:bg-ikun-dark-300'
11 | };
12 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/ellipsis.ts:
--------------------------------------------------------------------------------
1 | export const ellipsisShortcuts: Record = {
2 | // ellipsis
3 | 'k-ellipsis': 'k-reset-btn !cursor-text',
4 | 'k-ellipsis--line-clamp': 'k-reset-btn cursor-pointer'
5 | };
6 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/eye-dropper.ts:
--------------------------------------------------------------------------------
1 | export const eyeDropperShortcuts: Record = {
2 | // eyeDropper
3 | 'k-eyedropper--base': 'w-full h-full'
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/icon.ts:
--------------------------------------------------------------------------------
1 | export const iconShortcuts: Record = {
2 | // icon
3 | 'k-icon--base': 'f-c',
4 | 'k-icon--role-button': 'cursor-pointer',
5 | // dark
6 | 'k-icon--base__dark': 'dark:text-ikun-white'
7 | };
8 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/mask.ts:
--------------------------------------------------------------------------------
1 | export const maskShortcuts: Record = {
2 | // mask
3 | 'k-mask--base': 'ikun:50:bg-ikun-black z-999 absolute'
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/scrollbar.ts:
--------------------------------------------------------------------------------
1 | export const scrollbarShortcuts: Record = {
2 | // avatar
3 | 'k-scrollbar': 'overflow-auto'
4 | };
5 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/spin.ts:
--------------------------------------------------------------------------------
1 | export const spinShortcuts: Record = {
2 | 'k-spin--spinner':
3 | 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center text-ikun-main',
4 | 'k-spin--text': 'text-4 my-4 animate-bounce',
5 | 'k-spin--spinner__rotating': 'animate-spin animate-duration-3000 fcc'
6 | };
7 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/statistic.ts:
--------------------------------------------------------------------------------
1 | export const statisticShortcuts: Record = {
2 | // statistic
3 | 'k-statistic__head': 'text-base text-ikun-tx-gr mb-4px leading-20px text-12px',
4 | 'k-statistic__content': 'text-base text-ikun-tx-base',
5 | 'k-statistic__value': 'inline-block',
6 | 'k-statistic__prefix': 'inline-block mr-4px align-middle',
7 | 'k-statistic__suffix': 'inline-block ml-4px align-middle'
8 | };
9 |
--------------------------------------------------------------------------------
/preset/src/shortcuts/src/virtual-list.ts:
--------------------------------------------------------------------------------
1 | export const virtualListShortcuts: Record = {
2 | // virtualList
3 | 'k-virtual-list--base': 'flex flex-row',
4 | 'k-virtual-list--wrapper': 'flex flex-row'
5 | };
6 |
--------------------------------------------------------------------------------
/preset/tsup.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'tsup';
2 |
3 | export default defineConfig({
4 | entry: ['src/index.ts'],
5 | clean: true,
6 | format: ['cjs', 'esm'],
7 | external: ['unocss'],
8 | dts: true,
9 | minify: false
10 | });
11 |
--------------------------------------------------------------------------------
/scripts/build.js:
--------------------------------------------------------------------------------
1 | import { runTask } from './utils.js';
2 |
3 | runTask('pnpm run build', 'components', 'build');
4 |
--------------------------------------------------------------------------------
/scripts/clean-root-deps.js:
--------------------------------------------------------------------------------
1 | import { rm } from 'fs';
2 |
3 | const ROOT_NODE_MODULES = 'node_modules';
4 | async function doCleanRootDeps() {
5 | rm(ROOT_NODE_MODULES, { recursive: true }, (e) => {
6 | if (e) {
7 | console.error(e);
8 | } else {
9 | console.log('[ikun-ui]: Finished cleaning root deps.');
10 | }
11 | });
12 | }
13 |
14 | doCleanRootDeps();
15 |
--------------------------------------------------------------------------------
/scripts/publish.js:
--------------------------------------------------------------------------------
1 | import { runTask } from './utils.js';
2 | async function doPublish() {
3 | try {
4 | await runTask('pnpm run publish:npm', 'components', 'publish');
5 | await runTask('pnpm run publish:npm', 'preset', 'publish');
6 | await runTask('pnpm run publish:npm', 'utils', 'publish');
7 | } catch (e) {
8 | console.error(e);
9 | }
10 | }
11 |
12 | doPublish();
13 |
--------------------------------------------------------------------------------
/tsup.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'tsup';
2 |
3 | export default defineConfig({
4 | entry: ['components/index.ts'],
5 | clean: true,
6 | format: ['cjs', 'esm'],
7 | external: ['unocss'],
8 | dts: true,
9 | minify: false
10 | });
11 |
--------------------------------------------------------------------------------
/utils/src/class-names.ts:
--------------------------------------------------------------------------------
1 | export const getPrefixCls = (cls: string) => `k-${cls}`;
2 |
--------------------------------------------------------------------------------
/utils/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './types';
2 |
3 | export { getPrefixCls } from './class-names';
4 |
5 | export {
6 | breadcrumbKey,
7 | buttonGroupKey,
8 | collapseWrapperKey,
9 | checkboxGroupKey,
10 | radioGroupKey,
11 | rowKey,
12 | contextmenuKey,
13 | formKey,
14 | formItemKey,
15 | tabsKey,
16 | dropDownKey,
17 | descriptionsKey,
18 | segmentedKey,
19 | menuKey
20 | } from './symbol-key';
21 | export * from './dom';
22 |
--------------------------------------------------------------------------------
/utils/src/types.ts:
--------------------------------------------------------------------------------
1 | export declare type IKunTypeBase = 'success' | 'error' | 'warning' | 'info';
2 | export declare type IKunTypePro = IKunTypeBase | 'primary';
3 | export type IKunUncertainFunction = (...arg: any[]) => T | void;
4 | export type IKunSize = 'sm' | 'md' | 'lg';
5 | export type IKunPlacement = 'top' | 'left' | 'right' | 'bottom';
6 | export type IKunTrigger = 'manual' | 'click' | 'hover';
7 |
--------------------------------------------------------------------------------
/utils/tsup.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'tsup';
2 |
3 | export default defineConfig({
4 | entry: ['src/index.ts'],
5 | clean: true,
6 | format: ['cjs', 'esm'],
7 | external: ['unocss'],
8 | dts: true,
9 | minify: false
10 | });
11 |
--------------------------------------------------------------------------------