@indielayer/ui 1.4.0 → 1.5.1
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/components/common/CodePreview.vue +1 -1
- package/docs/components/common/CodeSnippet.vue +5 -7
- package/docs/components/common/DocumentPage.vue +89 -93
- package/docs/components/menu/DocsMenu.vue +75 -122
- package/docs/components/toolbar/PreToolbar.vue +10 -12
- package/docs/components/toolbar/Toolbar.vue +21 -8
- package/docs/layouts/default.vue +7 -3
- package/docs/pages/colors.vue +49 -54
- package/docs/pages/component/button/button-group.vue +6 -2
- package/docs/pages/component/button/size.vue +1 -1
- package/docs/pages/component/carousel/usage.vue +2 -2
- package/docs/pages/component/form/usage.vue +3 -3
- package/docs/pages/component/formGroup/usage.vue +1 -0
- package/docs/pages/component/input/usage.vue +8 -9
- package/docs/pages/component/modal/composed.vue +10 -2
- package/docs/pages/component/modal/usage.vue +11 -6
- package/docs/pages/component/popover/usage.vue +3 -3
- package/docs/pages/component/select/usage.vue +1 -0
- package/docs/pages/component/tabs/usage.vue +6 -1
- package/docs/pages/component/textarea/usage.vue +10 -13
- package/docs/pages/component/toggle/usage.vue +9 -11
- package/docs/pages/component/tooltip/index.vue +2 -2
- package/docs/pages/component/tooltip/usage.vue +4 -8
- package/docs/pages/icons.vue +54 -58
- package/docs/pages/index.vue +73 -77
- package/docs/pages/play.vue +2 -14
- package/docs/pages/typography.vue +26 -30
- package/docs/router/index.ts +2 -0
- package/exports/tailwind.preset.js +0 -1
- package/lib/components/accordion/theme/AccordionItem.base.theme.js +7 -7
- package/lib/components/badge/Badge.vue.js +7 -7
- package/lib/components/breadcrumbs/theme/Breadcrumbs.base.theme.js +1 -1
- package/lib/components/button/Button.vue.js +2 -2
- package/lib/components/button/Button.vue2.js +26 -26
- package/lib/components/button/theme/Button.base.theme.js +7 -7
- package/lib/components/card/theme/Card.base.theme.js +1 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +3 -0
- package/lib/components/checkbox/Checkbox.vue2.js +23 -23
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +6 -6
- package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +2 -2
- package/lib/components/container/theme/Container.base.theme.js +2 -2
- package/lib/components/divider/Divider.vue.js +14 -14
- package/lib/components/divider/theme/Divider.base.theme.js +2 -2
- package/lib/components/drawer/Drawer.vue.js +2 -2
- package/lib/components/drawer/theme/Drawer.base.theme.js +1 -1
- package/lib/components/form/Form.vue.js +1 -1
- package/lib/components/form/theme/Form.base.theme.js +4 -4
- package/lib/components/form/theme/Form.carbon.theme.js +4 -4
- package/lib/components/formGroup/FormGroup.vue.d.ts +3 -0
- package/lib/components/formGroup/FormGroup.vue.js +16 -15
- package/lib/components/formGroup/theme/FormGroup.base.theme.js +1 -1
- package/lib/components/icon/theme/Icon.base.theme.js +1 -1
- package/lib/components/index.js +108 -107
- package/lib/components/input/Input.vue.d.ts +3 -0
- package/lib/components/input/Input.vue.js +4 -3
- package/lib/components/input/theme/Input.base.theme.js +10 -10
- package/lib/components/input/theme/Input.carbon.theme.js +10 -10
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +3 -3
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +2 -2
- package/lib/components/label/Label.vue.d.ts +3 -0
- package/lib/components/label/Label.vue.js +26 -20
- package/lib/components/label/theme/Label.base.theme.js +1 -1
- package/lib/components/label/theme/Label.carbon.theme.js +3 -3
- package/lib/components/link/Link.vue.js +2 -2
- package/lib/components/link/Link.vue2.js +4 -4
- package/lib/components/loader/theme/Loader.base.theme.js +1 -1
- package/lib/components/loader/theme/Loader.carbon.theme.js +1 -1
- package/lib/components/menu/Menu.vue.js +19 -19
- package/lib/components/menu/theme/MenuItem.base.theme.js +21 -31
- package/lib/components/modal/Modal.vue.d.ts +4 -0
- package/lib/components/modal/Modal.vue.js +80 -74
- package/lib/components/modal/theme/Modal.base.theme.js +10 -10
- package/lib/components/modal/theme/Modal.carbon.theme.js +3 -3
- package/lib/components/notifications/Notifications.vue.js +1 -1
- package/lib/components/notifications/theme/Notifications.base.theme.js +1 -1
- package/lib/components/notifications/theme/Notifications.carbon.theme.js +3 -3
- package/lib/components/pagination/Pagination.vue.js +27 -27
- package/lib/components/popover/Popover.vue.d.ts +13 -0
- package/lib/components/popover/Popover.vue.js +13 -8
- package/lib/components/popover/Popover.vue2.js +3 -2
- package/lib/components/popover/Popover.vue3.js +2 -3
- package/lib/components/popover/theme/PopoverContainer.base.theme.js +4 -4
- package/lib/components/popover/theme/PopoverContainer.carbon.theme.js +4 -4
- package/lib/components/progress/Progress.vue.js +11 -11
- package/lib/components/progress/theme/Progress.base.theme.js +10 -10
- package/lib/components/radio/Radio.vue.d.ts +3 -0
- package/lib/components/radio/theme/Radio.base.theme.js +28 -28
- package/lib/components/radio/theme/Radio.carbon.theme.js +8 -8
- package/lib/components/select/Select.vue.d.ts +16 -0
- package/lib/components/select/Select.vue.js +95 -92
- package/lib/components/select/theme/Select.base.theme.js +11 -11
- package/lib/components/select/theme/Select.carbon.theme.js +10 -10
- package/lib/components/skeleton/theme/Skeleton.base.theme.js +1 -1
- package/lib/components/slider/Slider.vue.d.ts +3 -0
- package/lib/components/slider/Slider.vue.js +1 -1
- package/lib/components/slider/theme/Slider.carbon.theme.js +6 -6
- package/lib/components/stepper/Stepper.vue.js +14 -14
- package/lib/components/tab/Tab.vue.js +55 -54
- package/lib/components/tab/theme/TabGroup.base.theme.js +15 -15
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +8 -8
- package/lib/components/table/Table.vue.js +192 -194
- package/lib/components/table/theme/Table.base.theme.js +3 -3
- package/lib/components/table/theme/Table.carbon.theme.js +7 -7
- package/lib/components/table/theme/TableHead.base.theme.js +1 -1
- package/lib/components/table/theme/TableHead.carbon.theme.js +1 -1
- package/lib/components/table/theme/TableHeader.base.theme.js +1 -1
- package/lib/components/table/theme/TableHeader.carbon.theme.js +2 -2
- package/lib/components/table/theme/TableRow.base.theme.js +3 -3
- package/lib/components/table/theme/TableRow.carbon.theme.js +3 -3
- package/lib/components/tag/Tag.vue.js +4 -4
- package/lib/components/textarea/Textarea.vue.d.ts +7 -0
- package/lib/components/textarea/Textarea.vue.js +23 -21
- package/lib/components/textarea/theme/Textarea.base.theme.js +6 -6
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +6 -6
- package/lib/components/toggle/Toggle.vue.d.ts +3 -0
- package/lib/components/toggle/Toggle.vue.js +26 -26
- package/lib/components/toggle/theme/Toggle.base.theme.js +1 -1
- package/lib/components/tooltip/ToggleTip.vue.d.ts +14 -0
- package/lib/components/tooltip/ToggleTip.vue.js +29 -0
- package/lib/components/tooltip/ToggleTip.vue2.js +4 -0
- package/lib/components/tooltip/Tooltip.vue.d.ts +22 -3
- package/lib/components/tooltip/Tooltip.vue.js +26 -17
- package/lib/components/tooltip/__tests__/ToggleTip.spec.d.ts +1 -0
- package/lib/components/tooltip/index.d.ts +2 -0
- package/lib/composables/useColors.js +9 -9
- package/lib/composables/useInputtable.d.ts +1 -0
- package/lib/composables/useInputtable.js +20 -19
- package/lib/index.js +37 -35
- package/lib/index.umd.js +7 -3
- package/lib/tailwind.preset.js +0 -1
- package/lib/themes/base/index.js +3 -6
- package/lib/themes/base/styles.css.js +4 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -1
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +2 -2
- package/src/components/badge/Badge.vue +1 -1
- package/src/components/breadcrumbs/theme/Breadcrumbs.base.theme.ts +1 -1
- package/src/components/button/Button.vue +1 -1
- package/src/components/button/theme/Button.base.theme.ts +2 -2
- package/src/components/card/theme/Card.base.theme.ts +1 -1
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +8 -8
- package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +2 -2
- package/src/components/container/theme/Container.base.theme.ts +2 -2
- package/src/components/divider/Divider.vue +1 -1
- package/src/components/divider/theme/Divider.base.theme.ts +2 -2
- package/src/components/drawer/Drawer.vue +2 -2
- package/src/components/drawer/theme/Drawer.base.theme.ts +1 -1
- package/src/components/form/Form.vue +1 -1
- package/src/components/form/theme/Form.base.theme.ts +1 -1
- package/src/components/form/theme/Form.carbon.theme.ts +1 -1
- package/src/components/formGroup/FormGroup.vue +1 -0
- package/src/components/formGroup/theme/FormGroup.base.theme.ts +1 -1
- package/src/components/icon/theme/Icon.base.theme.ts +2 -2
- package/src/components/input/Input.vue +2 -1
- package/src/components/input/theme/Input.base.theme.ts +5 -5
- package/src/components/input/theme/Input.carbon.theme.ts +6 -6
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +3 -3
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +2 -2
- package/src/components/label/Label.vue +4 -1
- package/src/components/label/theme/Label.base.theme.ts +1 -1
- package/src/components/label/theme/Label.carbon.theme.ts +1 -1
- package/src/components/link/Link.vue +1 -1
- package/src/components/loader/theme/Loader.base.theme.ts +1 -1
- package/src/components/loader/theme/Loader.carbon.theme.ts +1 -1
- package/src/components/menu/Menu.vue +3 -3
- package/src/components/menu/theme/MenuItem.base.theme.ts +30 -34
- package/src/components/modal/Modal.vue +11 -4
- package/src/components/modal/theme/Modal.base.theme.ts +9 -6
- package/src/components/modal/theme/Modal.carbon.theme.ts +3 -3
- package/src/components/notifications/Notifications.vue +1 -1
- package/src/components/notifications/theme/Notifications.base.theme.ts +1 -1
- package/src/components/notifications/theme/Notifications.carbon.theme.ts +1 -1
- package/src/components/pagination/Pagination.vue +3 -3
- package/src/components/popover/Popover.vue +77 -2
- package/src/components/popover/theme/PopoverContainer.base.theme.ts +1 -1
- package/src/components/popover/theme/PopoverContainer.carbon.theme.ts +1 -1
- package/src/components/progress/Progress.vue +1 -1
- package/src/components/progress/theme/Progress.base.theme.ts +2 -2
- package/src/components/radio/theme/Radio.base.theme.ts +8 -8
- package/src/components/radio/theme/Radio.carbon.theme.ts +1 -1
- package/src/components/select/Select.vue +7 -4
- package/src/components/select/theme/Select.base.theme.ts +8 -8
- package/src/components/select/theme/Select.carbon.theme.ts +8 -8
- package/src/components/skeleton/theme/Skeleton.base.theme.ts +1 -1
- package/src/components/slider/Slider.vue +1 -1
- package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
- package/src/components/stepper/Stepper.vue +3 -3
- package/src/components/tab/Tab.vue +3 -3
- package/src/components/tab/theme/TabGroup.base.theme.ts +4 -4
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +3 -3
- package/src/components/table/Table.vue +2 -0
- package/src/components/table/theme/Table.base.theme.ts +1 -1
- package/src/components/table/theme/Table.carbon.theme.ts +2 -2
- package/src/components/table/theme/TableHead.base.theme.ts +1 -1
- package/src/components/table/theme/TableHead.carbon.theme.ts +1 -1
- package/src/components/table/theme/TableHeader.base.theme.ts +1 -1
- package/src/components/table/theme/TableHeader.carbon.theme.ts +2 -2
- package/src/components/table/theme/TableRow.base.theme.ts +3 -3
- package/src/components/table/theme/TableRow.carbon.theme.ts +3 -3
- package/src/components/tag/Tag.vue +1 -1
- package/src/components/textarea/Textarea.vue +3 -1
- package/src/components/textarea/theme/Textarea.base.theme.ts +5 -4
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +5 -5
- package/src/components/toggle/Toggle.vue +3 -3
- package/src/components/toggle/theme/Toggle.base.theme.ts +1 -1
- package/src/components/tooltip/ToggleTip.vue +31 -0
- package/src/components/tooltip/Tooltip.vue +14 -4
- package/src/components/tooltip/__tests__/ToggleTip.spec.ts +11 -0
- package/src/components/tooltip/index.ts +3 -0
- package/src/composables/useColors.ts +1 -1
- package/src/composables/useInputtable.ts +1 -0
- package/src/themes/base/index.ts +0 -3
- package/src/themes/base/styles.css +4 -0
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -0
|
@@ -211,6 +211,6 @@ defineExpose({ focus, blur, reset, validate, setError })
|
|
|
211
211
|
<slot name="suffix" :value="value"></slot>
|
|
212
212
|
</div>
|
|
213
213
|
|
|
214
|
-
<p v-if="errorInternal" class="text-sm text-
|
|
214
|
+
<p v-if="errorInternal" class="text-sm text-error-500 mt-1" v-text="errorInternal"></p>
|
|
215
215
|
</x-label>
|
|
216
216
|
</template>
|
|
@@ -4,7 +4,7 @@ const theme: SliderTheme = {
|
|
|
4
4
|
classes: {
|
|
5
5
|
wrapper: '',
|
|
6
6
|
|
|
7
|
-
drag: 'w-[16px] h-[16px] -mt-[11px] -ml-[8px] rounded-full bg-
|
|
7
|
+
drag: 'w-[16px] h-[16px] -mt-[11px] -ml-[8px] rounded-full bg-secondary-900 dark:bg-secondary-100',
|
|
8
8
|
},
|
|
9
9
|
|
|
10
10
|
styles: ({ props, colors, css }) => {
|
|
@@ -116,7 +116,7 @@ const { styles, classes, className } = useTheme('Stepper', {}, props)
|
|
|
116
116
|
:key="index"
|
|
117
117
|
:class="[classes.step, {
|
|
118
118
|
'cursor-pointer': interactive && !step.disabled,
|
|
119
|
-
'text-
|
|
119
|
+
'text-secondary-400 dark:text-secondary-600': step.disabled,
|
|
120
120
|
'flex-1': grow,
|
|
121
121
|
}]"
|
|
122
122
|
:disabled="step.disabled || !interactive"
|
|
@@ -125,7 +125,7 @@ const { styles, classes, className } = useTheme('Stepper', {}, props)
|
|
|
125
125
|
<div class="overflow-hidden">
|
|
126
126
|
<div
|
|
127
127
|
class="h-0.5 w-full mb-2"
|
|
128
|
-
:class="[step.status === 'complete' || step.status === 'incomplete' ? 'bg-primary-500' : 'bg-
|
|
128
|
+
:class="[step.status === 'complete' || step.status === 'incomplete' ? 'bg-primary-500' : 'bg-secondary-200 dark:bg-secondary-700']"
|
|
129
129
|
></div>
|
|
130
130
|
<div class="flex items-start pr-4">
|
|
131
131
|
<x-icon
|
|
@@ -138,7 +138,7 @@ const { styles, classes, className } = useTheme('Stepper', {}, props)
|
|
|
138
138
|
/>
|
|
139
139
|
<div class="grid text-left">
|
|
140
140
|
<div class="text-sm truncate">{{ step.label }}</div>
|
|
141
|
-
<div v-if="step.description" class="text-xs text-
|
|
141
|
+
<div v-if="step.description" class="text-xs text-secondary-500">{{ step.description }}</div>
|
|
142
142
|
</div>
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
@@ -139,7 +139,7 @@ const { styles, classes, className } = useTheme('Tab', {}, ref({
|
|
|
139
139
|
'text-[color:var(--x-tab-group-text)] dark:text-[color:var(--x-tab-group-dark-text)]': selected,
|
|
140
140
|
'cursor-pointer': !disabled,
|
|
141
141
|
'cursor-not-allowed': disabled,
|
|
142
|
-
'cursor-not-allowed text-
|
|
142
|
+
'cursor-not-allowed text-secondary-500': disabled && !selected,
|
|
143
143
|
},
|
|
144
144
|
]"
|
|
145
145
|
:aria-disabled="disabled ? 'true' : undefined"
|
|
@@ -165,13 +165,13 @@ const { styles, classes, className } = useTheme('Tab', {}, ref({
|
|
|
165
165
|
v-if="removable"
|
|
166
166
|
size="sm"
|
|
167
167
|
:icon="closeIcon"
|
|
168
|
-
class="ml-2 cursor-pointer hover:text-
|
|
168
|
+
class="ml-2 cursor-pointer hover:text-secondary-700 dark:hover:text-secondary-500 transition-colors duration-150"
|
|
169
169
|
@click="(e: Event) => $emit('remove', e)"
|
|
170
170
|
/>
|
|
171
171
|
</div>
|
|
172
172
|
</slot>
|
|
173
173
|
<teleport v-if="selected && teleportTo" :to="teleportTo">
|
|
174
|
-
<div role="tabpanel" :class="classes.tabpanel">
|
|
174
|
+
<div v-if="$slots.default" role="tabpanel" :class="classes.tabpanel">
|
|
175
175
|
<slot></slot>
|
|
176
176
|
</div>
|
|
177
177
|
</teleport>
|
|
@@ -9,7 +9,7 @@ const theme: TabGroupTheme = {
|
|
|
9
9
|
|
|
10
10
|
if (!props.fullWidth) c.push('!w-fit')
|
|
11
11
|
if (props.variant === 'block') c.push('rounded-md')
|
|
12
|
-
if (props.variant === 'block' && !props.ghost) c.push('bg-
|
|
12
|
+
if (props.variant === 'block' && !props.ghost) c.push('bg-secondary-100 dark:bg-secondary-800 p-1')
|
|
13
13
|
|
|
14
14
|
return c
|
|
15
15
|
},
|
|
@@ -17,7 +17,7 @@ const theme: TabGroupTheme = {
|
|
|
17
17
|
list: ({ props }) => {
|
|
18
18
|
const c = ['flex min-w-full w-fit']
|
|
19
19
|
|
|
20
|
-
if (props.variant === 'line') c.push('border-b border-
|
|
20
|
+
if (props.variant === 'line') c.push('border-b border-secondary-200 dark:border-secondary-700')
|
|
21
21
|
if (props.variant === 'line' && !props.grow) c.push('space-x-8')
|
|
22
22
|
if (props.variant === 'block') c.push('z-[1]')
|
|
23
23
|
if (props.align === 'center') c.push('justify-center')
|
|
@@ -38,7 +38,7 @@ const theme: TabGroupTheme = {
|
|
|
38
38
|
},
|
|
39
39
|
|
|
40
40
|
styles: ({ props, colors, css }) => {
|
|
41
|
-
const
|
|
41
|
+
const secondary = colors.getPalette('secondary')
|
|
42
42
|
const color = colors.getPalette(props.color)
|
|
43
43
|
|
|
44
44
|
return css.variables({
|
|
@@ -46,7 +46,7 @@ const theme: TabGroupTheme = {
|
|
|
46
46
|
bg: props.ghost ? color[50] : '#fff',
|
|
47
47
|
dark: {
|
|
48
48
|
text: color[400],
|
|
49
|
-
bg: props.ghost ? color[900] :
|
|
49
|
+
bg: props.ghost ? color[900] : secondary[700],
|
|
50
50
|
},
|
|
51
51
|
})
|
|
52
52
|
},
|
|
@@ -9,7 +9,7 @@ const theme: TabGroupTheme = {
|
|
|
9
9
|
|
|
10
10
|
if (!props.fullWidth) c.push('!w-fit')
|
|
11
11
|
if (props.variant === 'block') c.push('')
|
|
12
|
-
if (props.variant === 'block' && !props.ghost) c.push('bg-
|
|
12
|
+
if (props.variant === 'block' && !props.ghost) c.push('bg-secondary-200 dark:bg-secondary-800')
|
|
13
13
|
|
|
14
14
|
return c
|
|
15
15
|
},
|
|
@@ -17,7 +17,7 @@ const theme: TabGroupTheme = {
|
|
|
17
17
|
list: ({ props }) => {
|
|
18
18
|
const c = ['flex min-w-full w-fit']
|
|
19
19
|
|
|
20
|
-
if (props.variant === 'line') c.push('border-b border-
|
|
20
|
+
if (props.variant === 'line') c.push('border-b border-secondary-200 dark:border-secondary-700')
|
|
21
21
|
if (props.variant === 'line' && !props.grow) c.push('')
|
|
22
22
|
if (props.variant === 'block') c.push('z-[1] py-1.5')
|
|
23
23
|
if (props.align === 'center') c.push('justify-center')
|
|
@@ -31,7 +31,7 @@ const theme: TabGroupTheme = {
|
|
|
31
31
|
|
|
32
32
|
if (props.variant === 'line') c.push('h-[2px] -mt-[2px] bg-[color:var(--x-tab-group-text)] dark:bg-[color:var(--x-tab-group-dark-text)]')
|
|
33
33
|
|
|
34
|
-
if (props.variant === 'block') c.push('border-t-2 border-solid border-[color:var(--x-tab-group-text)] dark:border-[color:var(--x-tab-group-dark-text)] h-full top-0 bg-
|
|
34
|
+
if (props.variant === 'block') c.push('border-t-2 border-solid border-[color:var(--x-tab-group-text)] dark:border-[color:var(--x-tab-group-dark-text)] h-full top-0 bg-secondary-100 dark:bg-secondary-700')
|
|
35
35
|
|
|
36
36
|
return c
|
|
37
37
|
},
|
|
@@ -66,6 +66,8 @@ import XSpinner from '../spinner/Spinner.vue'
|
|
|
66
66
|
import XSkeleton from '../skeleton/Skeleton.vue'
|
|
67
67
|
import type { SkeletonShape } from '../skeleton/Skeleton.vue'
|
|
68
68
|
|
|
69
|
+
import XIcon from '../icon/Icon.vue'
|
|
70
|
+
|
|
69
71
|
import { chevronDownIcon } from '../../common/icons'
|
|
70
72
|
|
|
71
73
|
const props = defineProps({
|
|
@@ -16,7 +16,7 @@ const theme: TableTheme = {
|
|
|
16
16
|
return classes
|
|
17
17
|
},
|
|
18
18
|
|
|
19
|
-
loadingWrapper: 'absolute inset-0 flex items-center justify-center z-40 bg-
|
|
19
|
+
loadingWrapper: 'absolute inset-0 flex items-center justify-center z-40 bg-secondary-300 dark:bg-secondary-600 rounded opacity-30',
|
|
20
20
|
},
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -2,7 +2,7 @@ import type { TableTheme } from '../Table.vue'
|
|
|
2
2
|
|
|
3
3
|
const theme: TableTheme = {
|
|
4
4
|
classes: {
|
|
5
|
-
wrapper: 'w-full h-full shadow-sm overflow-x-auto text-sm bg-white dark:bg-
|
|
5
|
+
wrapper: 'w-full h-full shadow-sm overflow-x-auto text-sm bg-white dark:bg-secondary-800',
|
|
6
6
|
|
|
7
7
|
table: ({ props }) => {
|
|
8
8
|
const classes = ['w-full relative']
|
|
@@ -16,7 +16,7 @@ const theme: TableTheme = {
|
|
|
16
16
|
return classes
|
|
17
17
|
},
|
|
18
18
|
|
|
19
|
-
loadingWrapper: 'absolute inset-0 flex items-center justify-center z-40 bg-
|
|
19
|
+
loadingWrapper: 'absolute inset-0 flex items-center justify-center z-40 bg-secondary-300 dark:bg-secondary-600 rounded opacity-30',
|
|
20
20
|
},
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -5,7 +5,7 @@ const theme: TableHeaderTheme = {
|
|
|
5
5
|
th: ({ props }) => {
|
|
6
6
|
const classes = ['relative py-2 font-semibold tracking-widest uppercase text-xs px-3']
|
|
7
7
|
|
|
8
|
-
if (props.sortable) classes.push('cursor-pointer hover:text-
|
|
8
|
+
if (props.sortable) classes.push('cursor-pointer hover:text-secondary-800 dark:hover:text-secondary-300 transition-colors duration-150 ease-in-out')
|
|
9
9
|
|
|
10
10
|
if (props.stickyHeader) classes.push('sticky top-0')
|
|
11
11
|
|
|
@@ -3,9 +3,9 @@ import type { TableHeaderTheme } from '../TableHeader.vue'
|
|
|
3
3
|
const theme: TableHeaderTheme = {
|
|
4
4
|
classes: {
|
|
5
5
|
th: ({ props }) => {
|
|
6
|
-
const classes = ['relative py-3.5 font-semibold text-sm px-3 bg-
|
|
6
|
+
const classes = ['relative py-3.5 font-semibold text-sm px-3 bg-secondary-200 dark:bg-secondary-700 select-none']
|
|
7
7
|
|
|
8
|
-
if (props.sortable) classes.push('cursor-pointer hover:bg-
|
|
8
|
+
if (props.sortable) classes.push('cursor-pointer hover:bg-secondary-300 dark:hover:bg-secondary-600 transition-colors duration-150 ease-in-out pr-5')
|
|
9
9
|
|
|
10
10
|
if (props.stickyHeader) classes.push('sticky top-0')
|
|
11
11
|
|
|
@@ -6,12 +6,12 @@ const theme: TableRowTheme = {
|
|
|
6
6
|
const classes = []
|
|
7
7
|
|
|
8
8
|
if (props.striped) {
|
|
9
|
-
classes.push('odd:bg-
|
|
9
|
+
classes.push('odd:bg-secondary-50 dark:odd:bg-secondary-800')
|
|
10
10
|
} else {
|
|
11
|
-
classes.push('border-b border-
|
|
11
|
+
classes.push('border-b border-secondary-200 dark:border-secondary-700')
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (props.pointer) classes.push('hover:bg-
|
|
14
|
+
if (props.pointer) classes.push('hover:bg-secondary-50 dark:hover:bg-secondary-700 cursor-pointer')
|
|
15
15
|
|
|
16
16
|
return classes
|
|
17
17
|
},
|
|
@@ -6,12 +6,12 @@ const theme: TableRowTheme = {
|
|
|
6
6
|
const classes = []
|
|
7
7
|
|
|
8
8
|
if (props.striped) {
|
|
9
|
-
classes.push('odd:bg-
|
|
9
|
+
classes.push('odd:bg-secondary-50 dark:odd:bg-secondary-800')
|
|
10
10
|
} else {
|
|
11
|
-
classes.push('border-b border-
|
|
11
|
+
classes.push('border-b border-secondary-200 dark:border-secondary-700')
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (props.pointer) classes.push('hover:bg-
|
|
14
|
+
if (props.pointer) classes.push('hover:bg-secondary-50 dark:hover:bg-secondary-600 cursor-pointer')
|
|
15
15
|
|
|
16
16
|
return classes
|
|
17
17
|
},
|
|
@@ -70,7 +70,7 @@ const { styles, classes, className } = useTheme('Tag', {}, props)
|
|
|
70
70
|
<x-icon
|
|
71
71
|
:size="closeIconSize"
|
|
72
72
|
:icon="closeIcon"
|
|
73
|
-
class="ml-1.5 cursor-pointer hover:text-
|
|
73
|
+
class="ml-1.5 cursor-pointer hover:text-secondary-700 transition-colors duration-150"
|
|
74
74
|
@click="(e: Event) => $emit('remove', e)"
|
|
75
75
|
/>
|
|
76
76
|
</span>
|
|
@@ -19,6 +19,7 @@ const textareaProps = {
|
|
|
19
19
|
adjustToText: Boolean,
|
|
20
20
|
preventEnter: Boolean,
|
|
21
21
|
block: Boolean,
|
|
22
|
+
resizable: Boolean,
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export type TextareaProps = ExtractPublicPropTypes<typeof textareaProps>
|
|
@@ -114,6 +115,7 @@ defineExpose({ focus, blur, reset, validate, setError })
|
|
|
114
115
|
className,
|
|
115
116
|
classes.wrapper,
|
|
116
117
|
]"
|
|
118
|
+
:tooltip="tooltip"
|
|
117
119
|
>
|
|
118
120
|
<textarea
|
|
119
121
|
:id="id"
|
|
@@ -123,7 +125,7 @@ defineExpose({ focus, blur, reset, validate, setError })
|
|
|
123
125
|
:class="[
|
|
124
126
|
classes.input,
|
|
125
127
|
errorInternal
|
|
126
|
-
? 'border-
|
|
128
|
+
? 'border-error-500 dark:border-error-400 focus:outline-error-500'
|
|
127
129
|
: 'focus:outline-[color:var(--x-textarea-border)]',
|
|
128
130
|
]"
|
|
129
131
|
:disabled="disabled"
|
|
@@ -5,9 +5,10 @@ const theme: TextareaTheme = {
|
|
|
5
5
|
wrapper: '',
|
|
6
6
|
|
|
7
7
|
input: ({ props, data }) => {
|
|
8
|
-
const classes = ['
|
|
8
|
+
const classes = ['appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border shadow-sm rounded-md']
|
|
9
9
|
|
|
10
|
-
if (!
|
|
10
|
+
if (!props.resizable) classes.push('resize-none')
|
|
11
|
+
if (!data.errorInternal && !props.disabled) classes.push('hover:border-secondary-400 dark:hover:border-secondary-500')
|
|
11
12
|
|
|
12
13
|
if (props.size === 'xs') classes.push('px-2 py-1 text-xs')
|
|
13
14
|
else if (props.size === 'sm') classes.push('px-2 py-2 text-sm')
|
|
@@ -16,8 +17,8 @@ const theme: TextareaTheme = {
|
|
|
16
17
|
else classes.push('px-3 py-2')
|
|
17
18
|
|
|
18
19
|
classes.push(props.disabled
|
|
19
|
-
? 'bg-
|
|
20
|
-
: 'bg-white dark:bg-
|
|
20
|
+
? 'bg-secondary-100 dark:bg-secondary-700 text-secondary-400 dark:text-secondary-600 cursor-not-allowed'
|
|
21
|
+
: 'bg-white dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200')
|
|
21
22
|
|
|
22
23
|
return classes
|
|
23
24
|
},
|
|
@@ -5,20 +5,20 @@ const theme: TextareaTheme = {
|
|
|
5
5
|
wrapper: '',
|
|
6
6
|
|
|
7
7
|
input: ({ props, data }) => {
|
|
8
|
-
const classes = ['resize-none appearance-none block w-full placeholder-
|
|
8
|
+
const classes = ['resize-none appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border-b text-sm px-4']
|
|
9
9
|
|
|
10
|
-
if (!data.errorInternal && !props.disabled) classes.push('hover:border-
|
|
10
|
+
if (!data.errorInternal && !props.disabled) classes.push('hover:border-secondary-400 dark:hover:border-secondary-500')
|
|
11
11
|
|
|
12
12
|
if (props.size === 'xs' || props.size === 'sm') classes.push('py-1.5')
|
|
13
13
|
else if (props.size === 'lg' || props.size === 'xl') classes.push('py-3.5')
|
|
14
14
|
else classes.push('py-2.5')
|
|
15
15
|
|
|
16
16
|
if (props.disabled) {
|
|
17
|
-
classes.push('bg-
|
|
17
|
+
classes.push('bg-secondary-100 dark:bg-secondary-900 text-secondary-300 cursor-not-allowed')
|
|
18
18
|
} else if (props.readonly) {
|
|
19
|
-
classes.push('bg-white dark:bg-
|
|
19
|
+
classes.push('bg-white dark:bg-secondary-900 text-secondary-700')
|
|
20
20
|
} else {
|
|
21
|
-
classes.push('bg-
|
|
21
|
+
classes.push('bg-secondary-50 dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200')
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
return classes
|
|
@@ -76,8 +76,8 @@ defineExpose({ focus, blur, reset, validate, setError })
|
|
|
76
76
|
:style="styles"
|
|
77
77
|
:class="{
|
|
78
78
|
[`shadow-lg shadow-${color}-500/50`]: glow && modelValue,
|
|
79
|
-
'bg-
|
|
80
|
-
'bg-
|
|
79
|
+
'bg-secondary-300 dark:bg-secondary-500': !disabled && !checked && !loading,
|
|
80
|
+
'bg-secondary-100 dark:bg-secondary-700': disabled || loading,
|
|
81
81
|
'bg-[color:var(--x-toggle-bg)] dark:bg-[color:var(--x-toggle-dark-bg)]': !disabled && checked,
|
|
82
82
|
}"
|
|
83
83
|
>
|
|
@@ -102,7 +102,7 @@ defineExpose({ focus, blur, reset, validate, setError })
|
|
|
102
102
|
'translate-x-full': checked,
|
|
103
103
|
'shadow': !disabled
|
|
104
104
|
},
|
|
105
|
-
disabled ? 'bg-
|
|
105
|
+
disabled ? 'bg-secondary-50 dark:bg-secondary-800' : 'bg-white dark:bg-secondary-800'
|
|
106
106
|
]"
|
|
107
107
|
></div>
|
|
108
108
|
</div>
|
|
@@ -5,7 +5,7 @@ const theme: ToggleTheme = {
|
|
|
5
5
|
wrapper: '',
|
|
6
6
|
|
|
7
7
|
label: ({ props }) => {
|
|
8
|
-
const c = 'font-medium text-
|
|
8
|
+
const c = 'font-medium text-secondary-800 dark:text-secondary-200'
|
|
9
9
|
|
|
10
10
|
if (props.size === 'xs') return c + ' text-xs'
|
|
11
11
|
else if (props.size === 'sm') return c + ' text-sm'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const toggleTipProps = {
|
|
3
|
+
content: String,
|
|
4
|
+
icon: String,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type ToggleTipProps = ExtractPublicPropTypes<typeof toggleTipProps>
|
|
8
|
+
|
|
9
|
+
export default { name: 'XToggleTip' }
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { computed, type ExtractPublicPropTypes } from 'vue'
|
|
14
|
+
import XTooltip from './Tooltip.vue'
|
|
15
|
+
import XIcon from '../icon/Icon.vue'
|
|
16
|
+
|
|
17
|
+
import { infoIcon } from '../../common/icons'
|
|
18
|
+
|
|
19
|
+
const props = defineProps(toggleTipProps)
|
|
20
|
+
|
|
21
|
+
const computedIcon = computed(() => props.icon || infoIcon)
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<x-tooltip placement="auto">
|
|
26
|
+
<x-icon :icon="computedIcon" class="text-secondary-500 dark:text-secondary-300 cursor-pointer" />
|
|
27
|
+
<template #tooltip>
|
|
28
|
+
<div v-html="content"></div>
|
|
29
|
+
</template>
|
|
30
|
+
</x-tooltip>
|
|
31
|
+
</template>
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
const tooltipProps = {
|
|
2
|
+
const tooltipProps = {
|
|
3
|
+
placement: {
|
|
4
|
+
type: String as PropType<PopoverPlacement>,
|
|
5
|
+
default: 'bottom',
|
|
6
|
+
},
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type PopoverPlacement = Placement
|
|
3
10
|
|
|
4
11
|
export type TooltipProps = ExtractPublicPropTypes<typeof tooltipProps>
|
|
5
12
|
|
|
@@ -7,17 +14,20 @@ export default { name: 'XTooltip' }
|
|
|
7
14
|
</script>
|
|
8
15
|
|
|
9
16
|
<script setup lang="ts">
|
|
10
|
-
import type { ExtractPublicPropTypes } from 'vue'
|
|
17
|
+
import type { ExtractPublicPropTypes, PropType } from 'vue'
|
|
11
18
|
import XPopover from '../../components/popover/Popover.vue'
|
|
12
19
|
import XPopoverContainer from '../../components/popover/PopoverContainer.vue'
|
|
20
|
+
import { type Placement } from 'floating-vue'
|
|
21
|
+
|
|
22
|
+
const props = defineProps(tooltipProps)
|
|
13
23
|
</script>
|
|
14
24
|
|
|
15
25
|
<template>
|
|
16
|
-
<x-popover :triggers="['hover']" class="inline-block">
|
|
26
|
+
<x-popover :triggers="['hover', 'click']" class="inline-block" :hide-arrow="false" :placement="placement">
|
|
17
27
|
<slot></slot>
|
|
18
28
|
<template #content>
|
|
19
29
|
<div class="dark">
|
|
20
|
-
<x-popover-container class="p-2 text-white text-
|
|
30
|
+
<x-popover-container class="p-2 text-white text-xs w-max max-w-xs">
|
|
21
31
|
<slot name="tooltip"></slot>
|
|
22
32
|
</x-popover-container>
|
|
23
33
|
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import ToggleTip from '../ToggleTip.vue'
|
|
4
|
+
|
|
5
|
+
describe('ToggleTip', () => {
|
|
6
|
+
it('renders without errors', () => {
|
|
7
|
+
const wrapper = mount(ToggleTip)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.vm).toBeTruthy()
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -33,7 +33,7 @@ export interface ColorComposition {
|
|
|
33
33
|
const colorCache: ColorLibrary = {}
|
|
34
34
|
|
|
35
35
|
const defaultColors = {
|
|
36
|
-
primary: tailwindColors.
|
|
36
|
+
primary: tailwindColors.emerald,
|
|
37
37
|
secondary: tailwindColors.slate,
|
|
38
38
|
success: tailwindColors.green,
|
|
39
39
|
warning: tailwindColors.yellow,
|
package/src/themes/base/index.ts
CHANGED
|
@@ -4,9 +4,6 @@ import rawStyles from './styles.css?raw'
|
|
|
4
4
|
|
|
5
5
|
const theme: UITheme = {
|
|
6
6
|
name: 'Base',
|
|
7
|
-
colors: {
|
|
8
|
-
primary: { '50': '#ecfdf5', '100': '#d1fae5', '200': '#a7f3d0', '300': '#6ee7b7', '400': '#34d399', '500': '#10b981', '600': '#059669', '700': '#047857', '800': '#065f46', '900': '#064e3b', '950': '#022c22' },
|
|
9
|
-
},
|
|
10
7
|
styles: `${rawStyles}`,
|
|
11
8
|
classPrefix: 'x-',
|
|
12
9
|
components,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.
|
|
1
|
+
export default '1.5.1'
|
package/volar.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ declare module 'vue' {
|
|
|
53
53
|
XTextarea: typeof import('@indielayer/ui')['XTextarea']
|
|
54
54
|
XThemeProvider: typeof import('@indielayer/ui')['XThemeProvider']
|
|
55
55
|
XToggle: typeof import('@indielayer/ui')['XToggle']
|
|
56
|
+
XToggleTip: typeof import('@indielayer/ui')['XToggleTip']
|
|
56
57
|
XTooltip: typeof import('@indielayer/ui')['XTooltip']
|
|
57
58
|
}
|
|
58
59
|
}
|