@indielayer/ui 0.0.0-dev-20240129122517 → 0.0.0-dev-20240202140555
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/App.vue +25 -0
- package/docs/assets/css/hljs.css +302 -0
- package/docs/assets/css/tailwind.css +46 -0
- package/docs/assets/images/error.svg +1 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/assets/images/logo_mini.svg +10 -0
- package/docs/assets/images/logo_white.png +0 -0
- package/docs/assets/images/logo_word.svg +12 -0
- package/docs/assets/images/logo_word_dark.svg +12 -0
- package/docs/assets/images/photo1.jpeg +0 -0
- package/docs/assets/images/photo2.jpeg +0 -0
- package/docs/components/Cookies.vue +42 -0
- package/docs/components/common/CodePreview.vue +80 -0
- package/docs/components/common/CodeSnippet.vue +49 -0
- package/docs/components/common/CopyButton.vue +50 -0
- package/docs/components/common/DocumentPage.vue +289 -0
- package/docs/components/common/Indielayer-theme.json +702 -0
- package/docs/components/common/MultiSnippet.vue +26 -0
- package/docs/components/menu/DocsMenu.vue +143 -0
- package/docs/components/toolbar/PreToolbar.vue +18 -0
- package/docs/components/toolbar/Toolbar.vue +63 -0
- package/docs/components/toolbar/ToolbarColorToggle.vue +49 -0
- package/docs/icons.ts +61 -0
- package/docs/layouts/default.vue +29 -0
- package/docs/layouts/simple.vue +3 -0
- package/docs/main.ts +33 -0
- package/docs/pages/colors.vue +125 -0
- package/docs/pages/component/accordion/index.vue +29 -0
- package/docs/pages/component/accordion/usage.vue +30 -0
- package/docs/pages/component/alert/index.vue +29 -0
- package/docs/pages/component/alert/usage.vue +18 -0
- package/docs/pages/component/avatar/index.vue +43 -0
- package/docs/pages/component/avatar/size.vue +9 -0
- package/docs/pages/component/avatar/usage.vue +9 -0
- package/docs/pages/component/avatar/variants.vue +8 -0
- package/docs/pages/component/badge/index.vue +29 -0
- package/docs/pages/component/badge/usage.vue +50 -0
- package/docs/pages/component/breadcrumbs/index.vue +29 -0
- package/docs/pages/component/breadcrumbs/usage.vue +19 -0
- package/docs/pages/component/button/button-group.vue +18 -0
- package/docs/pages/component/button/icons.vue +9 -0
- package/docs/pages/component/button/index.vue +64 -0
- package/docs/pages/component/button/size.vue +9 -0
- package/docs/pages/component/button/states.vue +6 -0
- package/docs/pages/component/button/usage.vue +12 -0
- package/docs/pages/component/button/variants.vue +7 -0
- package/docs/pages/component/card/index.vue +29 -0
- package/docs/pages/component/card/usage.vue +6 -0
- package/docs/pages/component/carousel/index.vue +29 -0
- package/docs/pages/component/carousel/usage.vue +10 -0
- package/docs/pages/component/checkbox/index.vue +50 -0
- package/docs/pages/component/checkbox/size.vue +9 -0
- package/docs/pages/component/checkbox/states.vue +9 -0
- package/docs/pages/component/checkbox/usage.vue +15 -0
- package/docs/pages/component/checkbox/variants.vue +8 -0
- package/docs/pages/component/container/index.vue +29 -0
- package/docs/pages/component/container/usage.vue +3 -0
- package/docs/pages/component/divider/index.vue +43 -0
- package/docs/pages/component/divider/label.vue +12 -0
- package/docs/pages/component/divider/usage.vue +7 -0
- package/docs/pages/component/divider/vertical.vue +7 -0
- package/docs/pages/component/drawer/index.vue +29 -0
- package/docs/pages/component/drawer/usage.vue +56 -0
- package/docs/pages/component/form/index.vue +29 -0
- package/docs/pages/component/form/usage.vue +96 -0
- package/docs/pages/component/formGroup/index.vue +29 -0
- package/docs/pages/component/formGroup/usage.vue +46 -0
- package/docs/pages/component/icon/index.vue +36 -0
- package/docs/pages/component/icon/usage.vue +6 -0
- package/docs/pages/component/icon/variants.vue +14 -0
- package/docs/pages/component/image/index.vue +29 -0
- package/docs/pages/component/image/usage.vue +8 -0
- package/docs/pages/component/input/index.vue +50 -0
- package/docs/pages/component/input/size.vue +13 -0
- package/docs/pages/component/input/states.vue +12 -0
- package/docs/pages/component/input/usage.vue +15 -0
- package/docs/pages/component/input/variants.vue +18 -0
- package/docs/pages/component/link/index.vue +29 -0
- package/docs/pages/component/link/usage.vue +12 -0
- package/docs/pages/component/loader/index.vue +29 -0
- package/docs/pages/component/loader/usage.vue +7 -0
- package/docs/pages/component/menu/index.vue +29 -0
- package/docs/pages/component/menu/usage.vue +69 -0
- package/docs/pages/component/modal/composed.vue +70 -0
- package/docs/pages/component/modal/index.vue +36 -0
- package/docs/pages/component/modal/usage.vue +61 -0
- package/docs/pages/component/notifications/index.vue +29 -0
- package/docs/pages/component/notifications/usage.vue +56 -0
- package/docs/pages/component/pagination/index.vue +29 -0
- package/docs/pages/component/pagination/usage.vue +17 -0
- package/docs/pages/component/popover/index.vue +29 -0
- package/docs/pages/component/popover/usage.vue +21 -0
- package/docs/pages/component/progress/index.vue +36 -0
- package/docs/pages/component/progress/usage.vue +7 -0
- package/docs/pages/component/progress/variants.vue +18 -0
- package/docs/pages/component/radio/index.vue +50 -0
- package/docs/pages/component/radio/size.vue +15 -0
- package/docs/pages/component/radio/states.vue +13 -0
- package/docs/pages/component/radio/usage.vue +14 -0
- package/docs/pages/component/radio/variants.vue +39 -0
- package/docs/pages/component/scroll/horizontal.vue +14 -0
- package/docs/pages/component/scroll/index.vue +36 -0
- package/docs/pages/component/scroll/usage.vue +5 -0
- package/docs/pages/component/select/index.vue +43 -0
- package/docs/pages/component/select/states.vue +22 -0
- package/docs/pages/component/select/usage.vue +45 -0
- package/docs/pages/component/select/variants.vue +23 -0
- package/docs/pages/component/skeleton/index.vue +29 -0
- package/docs/pages/component/skeleton/usage.vue +10 -0
- package/docs/pages/component/slider/index.vue +29 -0
- package/docs/pages/component/slider/usage.vue +15 -0
- package/docs/pages/component/spacer/index.vue +29 -0
- package/docs/pages/component/spacer/usage.vue +8 -0
- package/docs/pages/component/spinner/index.vue +36 -0
- package/docs/pages/component/spinner/usage.vue +3 -0
- package/docs/pages/component/spinner/variants.vue +9 -0
- package/docs/pages/component/stepper/index.vue +29 -0
- package/docs/pages/component/stepper/usage.vue +21 -0
- package/docs/pages/component/table/index.vue +36 -0
- package/docs/pages/component/table/states.vue +28 -0
- package/docs/pages/component/table/usage.vue +107 -0
- package/docs/pages/component/tabs/index.vue +29 -0
- package/docs/pages/component/tabs/usage.vue +137 -0
- package/docs/pages/component/tag/index.vue +29 -0
- package/docs/pages/component/tag/usage.vue +27 -0
- package/docs/pages/component/textarea/index.vue +43 -0
- package/docs/pages/component/textarea/states.vue +13 -0
- package/docs/pages/component/textarea/usage.vue +22 -0
- package/docs/pages/component/textarea/variants.vue +15 -0
- package/docs/pages/component/toggle/index.vue +43 -0
- package/docs/pages/component/toggle/states.vue +13 -0
- package/docs/pages/component/toggle/usage.vue +14 -0
- package/docs/pages/component/toggle/variants.vue +15 -0
- package/docs/pages/component/tooltip/index.vue +29 -0
- package/docs/pages/component/tooltip/usage.vue +16 -0
- package/docs/pages/error.vue +6 -0
- package/docs/pages/icons.vue +105 -0
- package/docs/pages/index.vue +157 -0
- package/docs/pages/play.vue +19 -0
- package/docs/pages/typography.vue +95 -0
- package/docs/router/index.ts +77 -0
- package/lib/components/accordion/Accordion.vue.d.ts +3 -0
- package/lib/components/accordion/Accordion.vue.js +7 -7
- package/lib/components/accordion/AccordionItem.vue.d.ts +1 -0
- package/lib/components/accordion/AccordionItem.vue.js +49 -47
- package/lib/components/accordion/index.d.ts +1 -1
- package/lib/components/accordion/theme/Accordion.carbon.theme.js +3 -6
- package/lib/components/accordion/theme/AccordionItem.base.theme.js +9 -9
- package/lib/components/accordion/theme/AccordionItem.carbon.theme.js +3 -14
- package/lib/components/carousel/CarouselSlide.vue.d.ts +19 -8
- package/lib/components/carousel/CarouselSlide.vue.js +2 -2
- package/lib/components/carousel/CarouselSlide.vue2.js +25 -18
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +4 -4
- package/lib/components/container/Container.vue.d.ts +13 -0
- package/lib/components/container/Container.vue.js +15 -11
- package/lib/components/container/theme/Container.base.theme.js +7 -4
- package/lib/components/form/theme/Form.base.theme.js +1 -1
- package/lib/components/menu/Menu.vue.js +10 -10
- package/lib/components/menu/theme/MenuItem.base.theme.js +1 -1
- package/lib/components/modal/Modal.vue.d.ts +1 -1
- package/lib/components/radio/theme/Radio.base.theme.js +6 -6
- package/lib/components/select/Select.vue.js +47 -50
- package/lib/components/slider/theme/Slider.carbon.theme.js +4 -4
- package/lib/components/tab/Tab.vue.js +54 -53
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +3 -3
- package/lib/composables/keys.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/index.umd.js +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -2
- package/src/components/accordion/Accordion.vue +5 -1
- package/src/components/accordion/AccordionItem.vue +5 -2
- package/src/components/accordion/index.ts +1 -1
- package/src/components/accordion/theme/Accordion.carbon.theme.ts +3 -5
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +10 -7
- package/src/components/accordion/theme/AccordionItem.carbon.theme.ts +2 -30
- package/src/components/carousel/CarouselSlide.vue +9 -4
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +1 -1
- package/src/components/container/Container.vue +4 -0
- package/src/components/container/theme/Container.base.theme.ts +7 -1
- package/src/components/form/theme/Form.base.theme.ts +1 -1
- package/src/components/label/theme/Label.carbon.theme.ts +0 -2
- package/src/components/menu/Menu.vue +1 -1
- package/src/components/menu/theme/MenuItem.base.theme.ts +1 -1
- package/src/components/radio/theme/Radio.base.theme.ts +1 -1
- package/src/components/select/Select.vue +0 -3
- package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
- package/src/components/tab/Tab.vue +1 -1
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +1 -1
- package/src/composables/keys.ts +2 -2
- package/src/version.ts +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex items-center justify-center h-28">
|
|
3
|
+
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Optio, nulla.</p>
|
|
4
|
+
<x-divider class="mx-4" vertical />
|
|
5
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ad, impedit?</p>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XDrawer } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'Drawer'
|
|
7
|
+
const description = 'Drawers are used to display content in a side panel.'
|
|
8
|
+
const components = [XDrawer]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'divider'
|
|
16
|
+
const next = 'icon'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/drawer"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const el = ref(null)
|
|
5
|
+
const top = ref(false)
|
|
6
|
+
const left = ref(false)
|
|
7
|
+
const right = ref(false)
|
|
8
|
+
const bottom = ref(false)
|
|
9
|
+
const contained = ref(false)
|
|
10
|
+
const breakpoint = ref(false)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div>
|
|
15
|
+
<div class="space-x-4">
|
|
16
|
+
<x-button @click="left = !left">Toggle left</x-button>
|
|
17
|
+
<x-button @click="right = !right">Toggle right</x-button>
|
|
18
|
+
<x-button @click="bottom = !bottom">Toggle bottom</x-button>
|
|
19
|
+
<x-button @click="top = !top">Toggle top</x-button>
|
|
20
|
+
</div>
|
|
21
|
+
<x-drawer v-model="left">
|
|
22
|
+
<template #header>
|
|
23
|
+
<div class="border-b p-4 text-lg font-semibold">Header</div>
|
|
24
|
+
</template>
|
|
25
|
+
menu
|
|
26
|
+
<template #footer>
|
|
27
|
+
<div class="border-t p-4">
|
|
28
|
+
<x-button color="pink" block light>Sign out</x-button>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
</x-drawer>
|
|
32
|
+
<x-drawer v-model="right" position="right" width="100">
|
|
33
|
+
content
|
|
34
|
+
</x-drawer>
|
|
35
|
+
<x-drawer v-model="bottom" position="bottom">
|
|
36
|
+
content
|
|
37
|
+
</x-drawer>
|
|
38
|
+
<x-drawer v-model="top" position="top">
|
|
39
|
+
content
|
|
40
|
+
</x-drawer>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<x-button class="mt-10" @click="breakpoint = !breakpoint">Toggle drawer with breakpoint</x-button>
|
|
44
|
+
<x-drawer v-model="breakpoint" position="left" breakpoint="md">
|
|
45
|
+
<div class="border p-4 my-2">
|
|
46
|
+
I'm only a drawer on mobile
|
|
47
|
+
</div>
|
|
48
|
+
</x-drawer>
|
|
49
|
+
|
|
50
|
+
<x-button class="mt-10" @click="contained = !contained">Toggle contained</x-button>
|
|
51
|
+
<div id="container" ref="el" class="relative h-96 overflow-hidden bg-slate-50 dark:bg-slate-800 border rounded-md my-2">
|
|
52
|
+
<x-drawer v-model="contained" position="left" teleport-to="#container">
|
|
53
|
+
drawer inside #container
|
|
54
|
+
</x-drawer>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XForm } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'Form'
|
|
7
|
+
const description = 'Forms are used to collect user input.'
|
|
8
|
+
const components = [XForm]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'checkbox'
|
|
16
|
+
const next = 'formGroup'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/form"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useNotifications, type SelectOption } from '@indielayer/ui'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
|
|
5
|
+
const notifications = useNotifications('notifica')
|
|
6
|
+
|
|
7
|
+
const email = ref('')
|
|
8
|
+
const password = ref('')
|
|
9
|
+
const description = ref('')
|
|
10
|
+
const checked = ref()
|
|
11
|
+
const selected = ref()
|
|
12
|
+
const country = ref('')
|
|
13
|
+
const countries: SelectOption[] = [
|
|
14
|
+
{ label: 'United States', value: 'us' },
|
|
15
|
+
{ label: 'Canada', value: 'ca' },
|
|
16
|
+
{ label: 'Mexico', value: 'mx' },
|
|
17
|
+
]
|
|
18
|
+
const agree = ref(false)
|
|
19
|
+
const rules = {
|
|
20
|
+
isEmail: (v: string) => /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || 'E-mail must be valid',
|
|
21
|
+
isRequired: (v: string) => {
|
|
22
|
+
if (Array.isArray(v)) return !!v.length || 'Field is required'
|
|
23
|
+
|
|
24
|
+
return !!v || 'Field is required'
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function onSubmit(isValid: string) {
|
|
29
|
+
if (isValid) notifications?.success('Valid! Sumitted.')
|
|
30
|
+
else notifications?.error('Invalid! Form has errors')
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<x-form title="Edit user information" description="Almost all fields are required" @submit="onSubmit">
|
|
36
|
+
<div class="grid grid-cols-2 gap-4">
|
|
37
|
+
<x-input
|
|
38
|
+
v-model="email"
|
|
39
|
+
:rules="[rules.isRequired, rules.isEmail]"
|
|
40
|
+
name="email"
|
|
41
|
+
label="Email"
|
|
42
|
+
placeholder="Enter your email"
|
|
43
|
+
/>
|
|
44
|
+
<x-input
|
|
45
|
+
v-model="password"
|
|
46
|
+
type="password"
|
|
47
|
+
:rules="[rules.isRequired]"
|
|
48
|
+
name="password"
|
|
49
|
+
label="Password"
|
|
50
|
+
placeholder="Enter your password"
|
|
51
|
+
helper="Must be between 8 and 10 characters"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<x-textarea
|
|
56
|
+
v-model="description"
|
|
57
|
+
name="description"
|
|
58
|
+
label="Description"
|
|
59
|
+
placeholder="Description"
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
<x-form-group v-model="selected" label="Group of checkboxes" helper="Helper text" :rules="[rules.isRequired]">
|
|
63
|
+
<x-checkbox value="a" label="Lorem ipsum dolor" />
|
|
64
|
+
<x-checkbox value="b" label="Second option" />
|
|
65
|
+
</x-form-group>
|
|
66
|
+
|
|
67
|
+
<x-form-group v-model="checked" label="Group of radio buttons" helper="Helper text" :rules="[rules.isRequired]">
|
|
68
|
+
<x-radio name="inputName" value="a" label="Option A" />
|
|
69
|
+
<x-radio name="inputName" value="b" label="Option B" />
|
|
70
|
+
</x-form-group>
|
|
71
|
+
|
|
72
|
+
<x-select
|
|
73
|
+
v-model="country"
|
|
74
|
+
:rules="[rules.isRequired]"
|
|
75
|
+
:options="countries"
|
|
76
|
+
name="country"
|
|
77
|
+
placeholder="Select another country"
|
|
78
|
+
label="Country"
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
<x-checkbox
|
|
82
|
+
v-model="agree"
|
|
83
|
+
:rules="[rules.isRequired]"
|
|
84
|
+
name="agree"
|
|
85
|
+
label="Agree with all the terms"
|
|
86
|
+
helper="Have you read them?"
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
<template #secondary-action>
|
|
90
|
+
<x-button color="gray">Cancel</x-button>
|
|
91
|
+
</template>
|
|
92
|
+
<template #primary-action>
|
|
93
|
+
<x-button color="primary" type="submit">Submit</x-button>
|
|
94
|
+
</template>
|
|
95
|
+
</x-form>
|
|
96
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XFormGroup } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'FormGroup'
|
|
7
|
+
const description = 'A form group is a wrapper for form elements.'
|
|
8
|
+
const components = [XFormGroup]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'form'
|
|
16
|
+
const next = 'input'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/checkbox"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useNotifications } from '@indielayer/ui'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
|
|
5
|
+
const notifications = useNotifications('notifica')
|
|
6
|
+
|
|
7
|
+
const selected = ref(['a'])
|
|
8
|
+
const checked = ref()
|
|
9
|
+
|
|
10
|
+
const rules = {
|
|
11
|
+
isRequired: (v: string) => {
|
|
12
|
+
if (Array.isArray(v)) return !!v.length || 'Field is required'
|
|
13
|
+
|
|
14
|
+
return !!v || 'Field is required'
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function onSubmit(isValid: string) {
|
|
19
|
+
if (isValid) notifications?.success('Valid! Sumitted.')
|
|
20
|
+
else notifications?.error('Invalid! Form has errors')
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<x-form title="Form with form groups" @submit="onSubmit">
|
|
26
|
+
<x-form-group
|
|
27
|
+
v-model="selected"
|
|
28
|
+
label="Group of checkboxes"
|
|
29
|
+
helper="Helper text"
|
|
30
|
+
:rules="[rules.isRequired]"
|
|
31
|
+
vertical
|
|
32
|
+
>
|
|
33
|
+
<x-checkbox name="selectgroup" value="a" label="Lorem ipsum dolor" />
|
|
34
|
+
<x-checkbox name="selectgroup" value="b" label="Second option" />
|
|
35
|
+
</x-form-group>
|
|
36
|
+
|
|
37
|
+
<x-form-group v-model="checked" label="Group of radio buttons" helper="Helper text" :rules="[rules.isRequired]">
|
|
38
|
+
<x-radio name="radiogroup" value="a" label="Option A" />
|
|
39
|
+
<x-radio name="radiogroup" value="b" label="Option B" />
|
|
40
|
+
</x-form-group>
|
|
41
|
+
|
|
42
|
+
<template #primary-action>
|
|
43
|
+
<x-button color="primary" type="submit">Submit</x-button>
|
|
44
|
+
</template>
|
|
45
|
+
</x-form>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XIcon } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
import VariantsDemoCode from './variants.vue?raw'
|
|
6
|
+
import VariantsDemo from './variants.vue'
|
|
7
|
+
|
|
8
|
+
const title = 'Icon'
|
|
9
|
+
const description = 'Icons are used to represent an action or an object.'
|
|
10
|
+
const components = [XIcon]
|
|
11
|
+
const demos = [{
|
|
12
|
+
name: 'Usage',
|
|
13
|
+
description: '',
|
|
14
|
+
code: UsageDemoCode,
|
|
15
|
+
component: UsageDemo,
|
|
16
|
+
}, {
|
|
17
|
+
name: 'Variants',
|
|
18
|
+
description: '',
|
|
19
|
+
code: VariantsDemoCode,
|
|
20
|
+
component: VariantsDemo,
|
|
21
|
+
}]
|
|
22
|
+
const back = 'drawer'
|
|
23
|
+
const next = 'image'
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<document-page
|
|
28
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/icon"
|
|
29
|
+
:title="title"
|
|
30
|
+
:description="description"
|
|
31
|
+
:components="components"
|
|
32
|
+
:demos="demos"
|
|
33
|
+
:back="back"
|
|
34
|
+
:next="next"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<x-icon icon="smile" class="text-primary-500" />
|
|
3
|
+
<x-icon icon="smile" class="text-amber-500" />
|
|
4
|
+
|
|
5
|
+
<x-divider class="my-4"/>
|
|
6
|
+
|
|
7
|
+
<div class="space-x-4">
|
|
8
|
+
<x-icon icon="smile" size="xs"/>
|
|
9
|
+
<x-icon icon="smile" size="sm"/>
|
|
10
|
+
<x-icon icon="smile"/>
|
|
11
|
+
<x-icon icon="smile" size="lg"/>
|
|
12
|
+
<x-icon icon="smile" size="xl"/>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XImage } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'Image'
|
|
7
|
+
const description = 'Image is used to load an image file with a skeleton as placeholder and on load display the image.'
|
|
8
|
+
const components = [XImage]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'icon'
|
|
16
|
+
const next = 'link'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/image"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XInput } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
import VariantsDemoCode from './variants.vue?raw'
|
|
6
|
+
import VariantsDemo from './variants.vue'
|
|
7
|
+
import StatesDemoCode from './states.vue?raw'
|
|
8
|
+
import StatesDemo from './states.vue'
|
|
9
|
+
import SizeDemoCode from './size.vue?raw'
|
|
10
|
+
import SizeDemo from './size.vue'
|
|
11
|
+
|
|
12
|
+
const title = 'Input'
|
|
13
|
+
const description = 'This is a text input component that allows users to enter and edit text.'
|
|
14
|
+
const components = [XInput]
|
|
15
|
+
const demos = [{
|
|
16
|
+
name: 'Usage',
|
|
17
|
+
description: '',
|
|
18
|
+
code: UsageDemoCode,
|
|
19
|
+
component: UsageDemo,
|
|
20
|
+
}, {
|
|
21
|
+
name: 'Variants',
|
|
22
|
+
description: '',
|
|
23
|
+
code: VariantsDemoCode,
|
|
24
|
+
component: VariantsDemo,
|
|
25
|
+
}, {
|
|
26
|
+
name: 'Size',
|
|
27
|
+
description: '',
|
|
28
|
+
code: SizeDemoCode,
|
|
29
|
+
component: SizeDemo,
|
|
30
|
+
}, {
|
|
31
|
+
name: 'States',
|
|
32
|
+
description: '',
|
|
33
|
+
code: StatesDemoCode,
|
|
34
|
+
component: StatesDemo,
|
|
35
|
+
}]
|
|
36
|
+
const back = 'form'
|
|
37
|
+
const next = 'radio'
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<document-page
|
|
42
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/input"
|
|
43
|
+
:title="title"
|
|
44
|
+
:description="description"
|
|
45
|
+
:components="components"
|
|
46
|
+
:demos="demos"
|
|
47
|
+
:back="back"
|
|
48
|
+
:next="next"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
const other = ref('Sample text')
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div class="grid grid-cols-4 gap-2">
|
|
8
|
+
<x-input v-model="other" size="sm"/>
|
|
9
|
+
<x-input v-model="other" size="md"/>
|
|
10
|
+
<x-input v-model="other" size="lg"/>
|
|
11
|
+
<x-input v-model="other" size="xl"/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
const name = ref('not a valid input')
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div class="grid grid-cols-4 gap-4">
|
|
8
|
+
<x-input value="disabled" disabled label="Disabled"/>
|
|
9
|
+
<x-input value="readonly" readonly label="Read only"/>
|
|
10
|
+
<x-input v-model="name" label="Error" error="Invalid input" />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
const name = ref('')
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div class="flex">
|
|
8
|
+
<x-input
|
|
9
|
+
v-model="name"
|
|
10
|
+
label="Label here"
|
|
11
|
+
placeholder="Placeholder"
|
|
12
|
+
helper="Helper text here"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
const password = ref('secret')
|
|
4
|
+
const other = ref('I have an icon')
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="grid grid-cols-3 gap-4">
|
|
9
|
+
<x-input
|
|
10
|
+
v-model="password"
|
|
11
|
+
label="Password input"
|
|
12
|
+
type="password"
|
|
13
|
+
show-password-toggle
|
|
14
|
+
/>
|
|
15
|
+
<x-input v-model="other" label="Input with icon" icon-left="smile"/>
|
|
16
|
+
<x-input v-model="other" label="Icon on the right" icon-right="smile" />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XLink } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'Link'
|
|
7
|
+
const description = 'Links are used to navigate to a different page.'
|
|
8
|
+
const components = [XLink]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'image'
|
|
16
|
+
const next = 'loader'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/link"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
If you don't have an account yet, you can <x-link color="primary">contact our customer success team</x-link> to get started with Indielayer UI, get a <x-link shadow color="pink" external>product demo</x-link>, or request a specific sales inquiry.
|
|
4
|
+
</div>
|
|
5
|
+
<div class="mt-4 space-x-2">
|
|
6
|
+
<x-link to="/component/link">Simple link</x-link>
|
|
7
|
+
<x-link to="link" underline>Underline</x-link>
|
|
8
|
+
<x-link to="link" color="orange">Colorfull</x-link>
|
|
9
|
+
<x-link to="link" shadow color="primary">Shadow</x-link>
|
|
10
|
+
<x-link href="https://github.com/indielayer/ui" target="_blank" external>External link</x-link>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XLoader } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'Loader'
|
|
7
|
+
const description = 'Loader component is used to show a loading state.'
|
|
8
|
+
const components = [XLoader]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'link'
|
|
16
|
+
const next = 'menu'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/loader"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XMenu, XMenuItem } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'Menu'
|
|
7
|
+
const description = 'Menus are used to display a list of options.'
|
|
8
|
+
const components = [XMenu, XMenuItem]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'link'
|
|
16
|
+
const next = 'modal'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/menu"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|