frappe-ui 0.1.80 → 0.1.83
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/package.json +1 -1
- package/src/components/Alert.vue +2 -2
- package/src/components/Autocomplete.vue +20 -17
- package/src/components/Avatar.vue +2 -2
- package/src/components/Billing/TrialBanner.vue +2 -2
- package/src/components/Breadcrumbs.vue +6 -6
- package/src/components/Button/Button.story.vue +3 -1
- package/src/components/Button/Button.vue +43 -37
- package/src/components/Checkbox.vue +5 -5
- package/src/components/CommandPalette/CommandPalette.vue +2 -2
- package/src/components/CommandPalette/CommandPaletteItem.vue +4 -4
- package/src/components/Dialog.story.vue +4 -0
- package/src/components/Dialog.vue +17 -16
- package/src/components/Divider.vue +1 -1
- package/src/components/Dropdown.vue +24 -10
- package/src/components/ErrorMessage.vue +1 -1
- package/src/components/FormControl.vue +3 -3
- package/src/components/ListFilter/ListFilter.vue +8 -6
- package/src/components/ListView/ListEmptyState.vue +1 -1
- package/src/components/ListView/ListFooter.vue +1 -1
- package/src/components/ListView/ListGroupHeader.vue +3 -3
- package/src/components/ListView/ListHeader.vue +1 -1
- package/src/components/ListView/ListHeaderItem.vue +1 -1
- package/src/components/ListView/ListRow.vue +8 -5
- package/src/components/ListView/ListSelectBanner.vue +4 -4
- package/src/components/ListView.story.vue +4 -4
- package/src/components/LoadingText.vue +1 -1
- package/src/components/Popover.story.vue +2 -2
- package/src/components/Popover.vue +1 -1
- package/src/components/Progress.vue +11 -7
- package/src/components/Select.vue +9 -7
- package/src/components/Switch.vue +10 -10
- package/src/components/TabButtons.story.vue +22 -0
- package/src/components/TabButtons.vue +5 -3
- package/src/components/Tabs.vue +3 -3
- package/src/components/TextEditor/FontColor.vue +6 -4
- package/src/components/TextEditor/InsertImage.vue +1 -1
- package/src/components/TextEditor/MentionList.vue +3 -3
- package/src/components/TextEditor/Menu.vue +7 -7
- package/src/components/TextEditor/TextEditor.vue +5 -5
- package/src/components/TextEditor/TextEditorFloatingMenu.vue +6 -2
- package/src/components/TextEditor/video-extension.js +1 -1
- package/src/components/TextInput.vue +21 -8
- package/src/components/Textarea.story.vue +3 -1
- package/src/components/Textarea.vue +8 -6
- package/src/components/Toast.vue +5 -5
- package/src/components/Tooltip/Tooltip.story.vue +2 -2
- package/src/components/Tooltip/Tooltip.vue +2 -2
- package/src/tailwind/colorPalette.js +115 -0
- package/src/tailwind/colors.json +499 -0
- package/src/tailwind/figma-variables-to-colors.js +150 -0
- package/src/tailwind/plugin.js +24 -6
- package/src/tailwind/update-tailwind-classes.js +102 -0
package/package.json
CHANGED
package/src/components/Alert.vue
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</svg>
|
|
22
22
|
<div class="ml-2 w-full">
|
|
23
23
|
<div class="flex flex-col md:flex-row md:items-baseline">
|
|
24
|
-
<h3 class="text-lg font-medium text-gray-
|
|
24
|
+
<h3 class="text-lg font-medium text-ink-gray-9" v-if="title">
|
|
25
25
|
{{ title }}
|
|
26
26
|
</h3>
|
|
27
27
|
<div class="mt-1 md:ml-2 md:mt-0">
|
|
@@ -50,7 +50,7 @@ const props = withDefaults(defineProps<AlertProps>(), {
|
|
|
50
50
|
|
|
51
51
|
const classes = computed(() => {
|
|
52
52
|
return {
|
|
53
|
-
warning: 'text-gray-
|
|
53
|
+
warning: 'text-ink-gray-7 bg-surface-blue-1',
|
|
54
54
|
}[props.type]
|
|
55
55
|
})
|
|
56
56
|
</script>
|
|
@@ -10,22 +10,25 @@
|
|
|
10
10
|
<slot name="target" v-bind="{ open: openPopover, togglePopover }">
|
|
11
11
|
<div class="w-full">
|
|
12
12
|
<button
|
|
13
|
-
class="flex h-7 w-full items-center justify-between gap-2 rounded bg-gray-
|
|
14
|
-
:class="{ 'bg-gray-
|
|
13
|
+
class="flex h-7 w-full items-center justify-between gap-2 rounded bg-surface-gray-2 px-2 py-1 transition-colors hover:bg-surface-gray-3 border border-transparent focus:border-outline-gray-4 focus:outline-none focus:ring-2 focus:ring-outline-gray-3"
|
|
14
|
+
:class="{ 'bg-surface-gray-3': isComboboxOpen }"
|
|
15
15
|
@click="() => togglePopover()"
|
|
16
16
|
>
|
|
17
17
|
<div class="flex items-center overflow-hidden">
|
|
18
18
|
<slot name="prefix" />
|
|
19
|
-
<span
|
|
19
|
+
<span
|
|
20
|
+
class="truncate text-base leading-5 text-ink-gray-8"
|
|
21
|
+
v-if="selectedValue"
|
|
22
|
+
>
|
|
20
23
|
{{ displayValue(selectedValue) }}
|
|
21
24
|
</span>
|
|
22
|
-
<span class="text-base leading-5 text-gray-
|
|
25
|
+
<span class="text-base leading-5 text-ink-gray-4" v-else>
|
|
23
26
|
{{ placeholder || '' }}
|
|
24
27
|
</span>
|
|
25
28
|
</div>
|
|
26
29
|
<FeatherIcon
|
|
27
30
|
name="chevron-down"
|
|
28
|
-
class="h-4 w-4 text-gray-
|
|
31
|
+
class="h-4 w-4 text-ink-gray-5"
|
|
29
32
|
aria-hidden="true"
|
|
30
33
|
/>
|
|
31
34
|
</button>
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
<template #body="{ isOpen, togglePopover }">
|
|
36
39
|
<div v-show="isOpen">
|
|
37
40
|
<div
|
|
38
|
-
class="relative mt-1 rounded-lg bg-
|
|
41
|
+
class="relative mt-1 rounded-lg bg-surface-modal text-base shadow-2xl"
|
|
39
42
|
:class="bodyClasses"
|
|
40
43
|
>
|
|
41
44
|
<ComboboxOptions
|
|
@@ -45,12 +48,12 @@
|
|
|
45
48
|
>
|
|
46
49
|
<div
|
|
47
50
|
v-if="!hideSearch"
|
|
48
|
-
class="sticky top-0 z-10 flex items-stretch space-x-1.5 bg-
|
|
51
|
+
class="sticky top-0 z-10 flex items-stretch space-x-1.5 bg-surface-modal py-1.5"
|
|
49
52
|
>
|
|
50
53
|
<div class="relative w-full">
|
|
51
54
|
<ComboboxInput
|
|
52
55
|
ref="searchInput"
|
|
53
|
-
class="form-input w-full"
|
|
56
|
+
class="form-input w-full bg-surface-gray-2 focus:bg-surface-gray-3 hover:bg-surface-gray-4 text-ink-gray-8"
|
|
54
57
|
type="text"
|
|
55
58
|
@change="
|
|
56
59
|
(e) => {
|
|
@@ -65,7 +68,7 @@
|
|
|
65
68
|
class="absolute right-0 inline-flex h-7 w-7 items-center justify-center"
|
|
66
69
|
@click="selectedValue = null"
|
|
67
70
|
>
|
|
68
|
-
<FeatherIcon name="x" class="w-4" />
|
|
71
|
+
<FeatherIcon name="x" class="w-4 text-ink-gray-8" />
|
|
69
72
|
</button>
|
|
70
73
|
</div>
|
|
71
74
|
</div>
|
|
@@ -76,7 +79,7 @@
|
|
|
76
79
|
>
|
|
77
80
|
<div
|
|
78
81
|
v-if="group.group && !group.hideLabel"
|
|
79
|
-
class="sticky top-10 truncate bg-
|
|
82
|
+
class="sticky top-10 truncate bg-surface-modal px-2.5 py-1.5 text-sm font-medium text-ink-gray-5"
|
|
80
83
|
>
|
|
81
84
|
{{ group.group }}
|
|
82
85
|
</div>
|
|
@@ -90,13 +93,13 @@
|
|
|
90
93
|
<li
|
|
91
94
|
:class="[
|
|
92
95
|
'flex cursor-pointer items-center justify-between rounded px-2.5 py-1.5 text-base',
|
|
93
|
-
{ 'bg-gray-
|
|
96
|
+
{ 'bg-surface-gray-3': active },
|
|
94
97
|
]"
|
|
95
98
|
>
|
|
96
|
-
<div class="flex flex-1 gap-2 overflow-hidden">
|
|
99
|
+
<div class="flex flex-1 gap-2 overflow-hidden items-center">
|
|
97
100
|
<div
|
|
98
101
|
v-if="$slots['item-prefix'] || $props.multiple"
|
|
99
|
-
class="flex-shrink-0"
|
|
102
|
+
class="flex flex-shrink-0"
|
|
100
103
|
>
|
|
101
104
|
<slot
|
|
102
105
|
name="item-prefix"
|
|
@@ -105,12 +108,12 @@
|
|
|
105
108
|
<FeatherIcon
|
|
106
109
|
name="check"
|
|
107
110
|
v-if="isOptionSelected(option)"
|
|
108
|
-
class="h-4 w-4 text-gray-
|
|
111
|
+
class="h-4 w-4 text-ink-gray-7"
|
|
109
112
|
/>
|
|
110
113
|
<div v-else class="h-4 w-4" />
|
|
111
114
|
</slot>
|
|
112
115
|
</div>
|
|
113
|
-
<span class="flex-1 truncate">
|
|
116
|
+
<span class="flex-1 truncate text-ink-gray-7">
|
|
114
117
|
{{ getLabel(option) }}
|
|
115
118
|
</span>
|
|
116
119
|
</div>
|
|
@@ -125,7 +128,7 @@
|
|
|
125
128
|
>
|
|
126
129
|
<div
|
|
127
130
|
v-if="option?.description"
|
|
128
|
-
class="text-sm text-gray-
|
|
131
|
+
class="text-sm text-ink-gray-5"
|
|
129
132
|
>
|
|
130
133
|
{{ option.description }}
|
|
131
134
|
</div>
|
|
@@ -136,7 +139,7 @@
|
|
|
136
139
|
</div>
|
|
137
140
|
<li
|
|
138
141
|
v-if="groups.length == 0"
|
|
139
|
-
class="rounded-md px-2.5 py-1.5 text-base text-gray-
|
|
142
|
+
class="rounded-md px-2.5 py-1.5 text-base text-ink-gray-5"
|
|
140
143
|
>
|
|
141
144
|
No results found
|
|
142
145
|
</li>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
/>
|
|
13
13
|
<div
|
|
14
14
|
v-else
|
|
15
|
-
class="flex h-full w-full items-center justify-center bg-gray-
|
|
15
|
+
class="flex h-full w-full items-center justify-center bg-surface-gray-2 uppercase text-ink-gray-5"
|
|
16
16
|
:class="[labelClasses, shapeClasses]"
|
|
17
17
|
>
|
|
18
18
|
<div :class="iconClasses" v-if="$slots.default">
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div
|
|
26
26
|
v-if="$slots.indicator"
|
|
27
27
|
:class="[
|
|
28
|
-
'absolute bottom-0 right-0 grid place-items-center rounded-full bg-white',
|
|
28
|
+
'absolute bottom-0 right-0 grid place-items-center rounded-full bg-surface-white',
|
|
29
29
|
indicatorContainerClasses,
|
|
30
30
|
]"
|
|
31
31
|
>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="!isSidebarCollapsed && showBanner"
|
|
4
|
-
class="m-2 flex flex-col gap-3 shadow-sm rounded-lg py-2.5 px-3 bg-white text-base"
|
|
4
|
+
class="m-2 flex flex-col gap-3 shadow-sm rounded-lg py-2.5 px-3 bg-surface-white text-base"
|
|
5
5
|
>
|
|
6
6
|
<div class="flex flex-col gap-1">
|
|
7
7
|
<div class="inline-flex gap-2 items-center font-medium">
|
|
8
8
|
<FeatherIcon class="h-4" name="info" />
|
|
9
9
|
{{ trialTitle }}
|
|
10
10
|
</div>
|
|
11
|
-
<div class="text-gray-
|
|
11
|
+
<div class="text-ink-gray-7 text-sm font-normal leading-5">
|
|
12
12
|
{{ trialMessage }}
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<Button variant="ghost">
|
|
6
6
|
<template #icon>
|
|
7
7
|
<svg
|
|
8
|
-
class="w-4 text-gray-
|
|
8
|
+
class="w-4 text-ink-gray-5"
|
|
9
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
10
10
|
width="24"
|
|
11
11
|
height="24"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</template>
|
|
24
24
|
</Button>
|
|
25
25
|
</Dropdown>
|
|
26
|
-
<span class="ml-1 mr-0.5 text-base text-gray-
|
|
26
|
+
<span class="ml-1 mr-0.5 text-base text-ink-gray-4" aria-hidden="true">
|
|
27
27
|
/
|
|
28
28
|
</span>
|
|
29
29
|
</template>
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
<template v-for="(item, i) in crumbs" :key="item.label">
|
|
34
34
|
<component
|
|
35
35
|
:is="item.route ? 'router-link' : 'button'"
|
|
36
|
-
class="flex items-center rounded px-0.5 py-1 text-lg font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-
|
|
36
|
+
class="flex items-center rounded px-0.5 py-1 text-lg font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-outline-gray-3"
|
|
37
37
|
:class="[
|
|
38
38
|
i == crumbs.length - 1
|
|
39
|
-
? 'text-gray-
|
|
40
|
-
: 'text-gray-
|
|
39
|
+
? 'text-ink-gray-9'
|
|
40
|
+
: 'text-ink-gray-5 hover:text-ink-gray-7',
|
|
41
41
|
]"
|
|
42
42
|
v-bind="item.route ? { to: item.route } : { onClick: item.onClick }"
|
|
43
43
|
>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
</component>
|
|
50
50
|
<span
|
|
51
51
|
v-if="i != crumbs.length - 1"
|
|
52
|
-
class="mx-0.5 text-base text-gray-
|
|
52
|
+
class="mx-0.5 text-base text-ink-gray-4"
|
|
53
53
|
aria-hidden="true"
|
|
54
54
|
>
|
|
55
55
|
/
|
|
@@ -18,7 +18,9 @@ const sizes = ['sm', 'md', 'lg', 'xl', '2xl']
|
|
|
18
18
|
<template>
|
|
19
19
|
<Story :layout="{ type: 'grid', width: 300 }">
|
|
20
20
|
<Variant v-for="variant in variants" :key="variant" :title="variant">
|
|
21
|
-
<
|
|
21
|
+
<div class="p-1">
|
|
22
|
+
<Button :variant="variant" v-bind="state">{{ state.label }}</Button>
|
|
23
|
+
</div>
|
|
22
24
|
</Variant>
|
|
23
25
|
|
|
24
26
|
<template #controls>
|
|
@@ -89,40 +89,42 @@ const router = useRouter()
|
|
|
89
89
|
|
|
90
90
|
const buttonClasses = computed(() => {
|
|
91
91
|
let solidClasses = {
|
|
92
|
-
gray: 'text-white bg-gray-
|
|
93
|
-
blue: 'text-white bg-blue-500 hover:bg-blue-
|
|
94
|
-
green:
|
|
95
|
-
|
|
92
|
+
gray: 'text-ink-white bg-surface-gray-7 hover:bg-surface-gray-6 active:bg-surface-gray-5',
|
|
93
|
+
blue: 'text-ink-white bg-blue-500 hover:bg-surface-blue-3 active:bg-blue-700',
|
|
94
|
+
green:
|
|
95
|
+
'text-ink-white bg-surface-green-3 hover:bg-green-700 active:bg-green-800',
|
|
96
|
+
red: 'text-ink-white bg-surface-red-5 hover:bg-surface-red-6 active:bg-surface-red-7',
|
|
96
97
|
}[props.theme]
|
|
97
98
|
|
|
98
99
|
let subtleClasses = {
|
|
99
|
-
gray: 'text-gray-
|
|
100
|
-
blue: 'text-blue-
|
|
101
|
-
green:
|
|
102
|
-
|
|
100
|
+
gray: 'text-ink-gray-8 bg-surface-gray-2 hover:bg-surface-gray-3 active:bg-surface-gray-4',
|
|
101
|
+
blue: 'text-ink-blue-3 bg-surface-blue-2 hover:bg-blue-200 active:bg-blue-300',
|
|
102
|
+
green:
|
|
103
|
+
'text-green-800 bg-surface-green-2 hover:bg-green-200 active:bg-green-300',
|
|
104
|
+
red: 'text-red-700 bg-surface-red-2 hover:bg-surface-red-3 active:bg-surface-red-4',
|
|
103
105
|
}[props.theme]
|
|
104
106
|
|
|
105
107
|
let outlineClasses = {
|
|
106
|
-
gray: 'text-gray-
|
|
107
|
-
blue: 'text-blue-
|
|
108
|
+
gray: 'text-ink-gray-8 bg-surface-white bg-surface-white border border-outline-gray-2 hover:border-outline-gray-3 active:border-outline-gray-3 active:bg-surface-gray-4',
|
|
109
|
+
blue: 'text-ink-blue-3 bg-surface-white border border-outline-blue-1 hover:border-blue-400 active:border-blue-400 active:bg-blue-300',
|
|
108
110
|
green:
|
|
109
|
-
'text-green-800 bg-white border border-green-
|
|
110
|
-
red: 'text-red-700 bg-white border border-red-
|
|
111
|
+
'text-green-800 bg-surface-white border border-outline-green-2 hover:border-green-500 active:border-green-500 active:bg-green-300',
|
|
112
|
+
red: 'text-red-700 bg-surface-white border border-outline-red-1 hover:border-outline-red-2 active:border-outline-red-2 active:bg-surface-red-3',
|
|
111
113
|
}[props.theme]
|
|
112
114
|
|
|
113
115
|
let ghostClasses = {
|
|
114
|
-
gray: 'text-gray-
|
|
115
|
-
blue: 'text-blue-
|
|
116
|
+
gray: 'text-ink-gray-8 bg-transparent hover:bg-surface-gray-3 active:bg-surface-gray-4',
|
|
117
|
+
blue: 'text-ink-blue-3 bg-transparent hover:bg-blue-200 active:bg-blue-300',
|
|
116
118
|
green:
|
|
117
119
|
'text-green-800 bg-transparent hover:bg-green-200 active:bg-green-300',
|
|
118
|
-
red: 'text-red-700 bg-transparent hover:bg-red-
|
|
120
|
+
red: 'text-red-700 bg-transparent hover:bg-surface-red-3 active:bg-surface-red-4',
|
|
119
121
|
}[props.theme]
|
|
120
122
|
|
|
121
123
|
let focusClasses = {
|
|
122
|
-
gray: 'focus-visible:ring focus-visible:ring-gray-
|
|
124
|
+
gray: 'focus-visible:ring focus-visible:ring-outline-gray-3',
|
|
123
125
|
blue: 'focus-visible:ring focus-visible:ring-blue-400',
|
|
124
|
-
green: 'focus-visible:ring focus-visible:ring-green-
|
|
125
|
-
red: 'focus-visible:ring focus-visible:ring-red-
|
|
126
|
+
green: 'focus-visible:ring focus-visible:ring-outline-green-2',
|
|
127
|
+
red: 'focus-visible:ring focus-visible:ring-outline-red-2',
|
|
126
128
|
}[props.theme]
|
|
127
129
|
|
|
128
130
|
let variantClasses = {
|
|
@@ -136,25 +138,29 @@ const buttonClasses = computed(() => {
|
|
|
136
138
|
let themeVariant: ThemeVariant = `${props.theme}-${props.variant}`
|
|
137
139
|
|
|
138
140
|
let disabledClassesMap: Record<ThemeVariant, string> = {
|
|
139
|
-
'gray-solid': 'bg-gray-
|
|
140
|
-
'gray-subtle': 'bg-gray-
|
|
141
|
-
'gray-outline':
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
'blue-
|
|
146
|
-
'blue-
|
|
147
|
-
'blue-
|
|
148
|
-
|
|
149
|
-
'
|
|
150
|
-
|
|
151
|
-
'green-
|
|
152
|
-
'green-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
'
|
|
156
|
-
|
|
157
|
-
'red-
|
|
141
|
+
'gray-solid': 'bg-surface-gray-2 text-ink-gray-4',
|
|
142
|
+
'gray-subtle': 'bg-surface-gray-2 text-ink-gray-4',
|
|
143
|
+
'gray-outline':
|
|
144
|
+
'bg-surface-gray-2 text-ink-gray-4 border border-outline-gray-2',
|
|
145
|
+
'gray-ghost': 'text-ink-gray-4',
|
|
146
|
+
|
|
147
|
+
'blue-solid': 'bg-blue-300 text-ink-white',
|
|
148
|
+
'blue-subtle': 'bg-surface-blue-2 text-ink-blue-link',
|
|
149
|
+
'blue-outline':
|
|
150
|
+
'bg-surface-blue-2 text-ink-blue-link border border-outline-blue-1',
|
|
151
|
+
'blue-ghost': 'text-ink-blue-link',
|
|
152
|
+
|
|
153
|
+
'green-solid': 'bg-surface-green-2 text-ink-green-2',
|
|
154
|
+
'green-subtle': 'bg-surface-green-2 text-ink-green-2',
|
|
155
|
+
'green-outline':
|
|
156
|
+
'bg-surface-green-2 text-ink-green-2 border border-outline-green-2',
|
|
157
|
+
'green-ghost': 'text-ink-green-2',
|
|
158
|
+
|
|
159
|
+
'red-solid': 'bg-surface-red-2 text-ink-red-2',
|
|
160
|
+
'red-subtle': 'bg-surface-red-2 text-ink-red-2',
|
|
161
|
+
'red-outline':
|
|
162
|
+
'bg-surface-red-2 text-ink-red-2 border border-outline-red-1',
|
|
163
|
+
'red-ghost': 'text-ink-red-2',
|
|
158
164
|
}
|
|
159
165
|
let disabledClasses = disabledClassesMap[themeVariant]
|
|
160
166
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:class="{
|
|
5
5
|
'px-2.5 py-1.5': padding && size === 'sm',
|
|
6
6
|
'px-3 py-2': padding && size === 'md',
|
|
7
|
-
'focus-within:bg-gray-
|
|
7
|
+
'focus-within:bg-surface-gray-2 focus-within:ring-2 focus-within:ring-outline-gray-3 hover:bg-surface-gray-3 active:bg-surface-gray-4':
|
|
8
8
|
padding && !disabled,
|
|
9
9
|
}"
|
|
10
10
|
>
|
|
@@ -54,21 +54,21 @@ const labelClasses = computed(() => {
|
|
|
54
54
|
sm: 'text-base font-medium',
|
|
55
55
|
md: 'text-lg font-medium',
|
|
56
56
|
}[props.size],
|
|
57
|
-
props.disabled ? 'text-gray-
|
|
57
|
+
props.disabled ? 'text-ink-gray-4' : 'text-ink-gray-8',
|
|
58
58
|
'select-none',
|
|
59
59
|
]
|
|
60
60
|
})
|
|
61
61
|
|
|
62
62
|
const inputClasses = computed(() => {
|
|
63
63
|
let baseClasses = props.disabled
|
|
64
|
-
? 'border-gray-
|
|
65
|
-
: 'border-gray-
|
|
64
|
+
? 'border-outline-gray-2 bg-surface-menu-bar text-ink-gray-3'
|
|
65
|
+
: 'border-outline-gray-4 text-ink-gray-9 hover:border-gray-600 focus:ring-offset-0 focus:border-gray-900 active:border-gray-700 transition'
|
|
66
66
|
|
|
67
67
|
let interactionClasses = props.disabled
|
|
68
68
|
? ''
|
|
69
69
|
: props.padding
|
|
70
70
|
? 'focus:ring-0'
|
|
71
|
-
: 'hover:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-
|
|
71
|
+
: 'hover:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3 active:bg-surface-gray-2'
|
|
72
72
|
|
|
73
73
|
let sizeClasses = {
|
|
74
74
|
sm: 'w-3.5 h-3.5',
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
<ComboboxInput
|
|
16
16
|
placeholder="Search"
|
|
17
|
-
class="w-full border-none bg-transparent py-3 pl-11.5 pr-4.5 text-base text-gray-
|
|
17
|
+
class="w-full border-none bg-transparent py-3 pl-11.5 pr-4.5 text-base text-ink-gray-8 placeholder-ink-gray-4 focus:ring-0"
|
|
18
18
|
v-model="searchQuery"
|
|
19
19
|
autocomplete="off"
|
|
20
20
|
/>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
:key="group.title"
|
|
31
31
|
>
|
|
32
32
|
<div
|
|
33
|
-
class="mb-2.5 px-4.5 text-base text-gray-
|
|
33
|
+
class="mb-2.5 px-4.5 text-base text-ink-gray-5"
|
|
34
34
|
v-if="!group.hideTitle"
|
|
35
35
|
>
|
|
36
36
|
{{ group.title }}
|
|
@@ -7,20 +7,20 @@ defineProps({
|
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
9
|
<div
|
|
10
|
-
class="flex w-full min-w-0 items-center rounded px-2 py-2 text-base font-medium text-gray-
|
|
11
|
-
:class="{ 'bg-gray-
|
|
10
|
+
class="flex w-full min-w-0 items-center rounded px-2 py-2 text-base font-medium text-ink-gray-8"
|
|
11
|
+
:class="{ 'bg-surface-gray-3': active }"
|
|
12
12
|
>
|
|
13
13
|
<component
|
|
14
14
|
:is="item.icon"
|
|
15
15
|
v-if="item.icon"
|
|
16
|
-
class="mr-3 h-4 w-4 text-gray-
|
|
16
|
+
class="mr-3 h-4 w-4 text-ink-gray-7"
|
|
17
17
|
/>
|
|
18
18
|
<span class="overflow-hidden text-ellipsis whitespace-nowrap">
|
|
19
19
|
{{ item.title }}
|
|
20
20
|
</span>
|
|
21
21
|
<span
|
|
22
22
|
v-if="item.description"
|
|
23
|
-
class="ml-auto whitespace-nowrap pl-2 text-gray-
|
|
23
|
+
class="ml-auto whitespace-nowrap pl-2 text-ink-gray-5"
|
|
24
24
|
>
|
|
25
25
|
{{ item.description }}
|
|
26
26
|
</span>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
leave-to="opacity-0"
|
|
24
24
|
>
|
|
25
25
|
<div
|
|
26
|
-
class="fixed inset-0 bg-black-overlay-200 transition-opacity"
|
|
26
|
+
class="fixed inset-0 bg-black-overlay-200 transition-opacity dark:backdrop-filter dark:backdrop-blur-[1px]"
|
|
27
27
|
:data-dialog="options.title"
|
|
28
28
|
/>
|
|
29
29
|
</TransitionChild>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
leave-to="opacity-50 translate-y-4 translate-y-4 scale-95"
|
|
39
39
|
>
|
|
40
40
|
<DialogPanel
|
|
41
|
-
class="my-8 inline-block w-full transform overflow-hidden rounded-xl bg-
|
|
41
|
+
class="my-8 inline-block w-full transform overflow-hidden rounded-xl bg-surface-modal text-left align-middle shadow-xl transition-all"
|
|
42
42
|
:class="{
|
|
43
43
|
'max-w-7xl': options.size === '7xl',
|
|
44
44
|
'max-w-6xl': options.size === '6xl',
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
>
|
|
56
56
|
<slot name="body">
|
|
57
57
|
<slot name="body-main">
|
|
58
|
-
<div class="bg-
|
|
58
|
+
<div class="bg-surface-modal px-4 pb-6 pt-5 sm:px-6">
|
|
59
59
|
<div class="flex">
|
|
60
60
|
<div class="w-full flex-1">
|
|
61
61
|
<div class="mb-6 flex items-center justify-between">
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
<DialogTitle as="header">
|
|
76
76
|
<slot name="body-title">
|
|
77
77
|
<h3
|
|
78
|
-
class="text-2xl font-semibold leading-6 text-gray-
|
|
78
|
+
class="text-2xl font-semibold leading-6 text-ink-gray-9"
|
|
79
79
|
>
|
|
80
80
|
{{ options.title || 'Untitled' }}
|
|
81
81
|
</h3>
|
|
@@ -90,12 +90,13 @@
|
|
|
90
90
|
viewBox="0 0 16 16"
|
|
91
91
|
fill="none"
|
|
92
92
|
xmlns="http://www.w3.org/2000/svg"
|
|
93
|
+
class="text-ink-gray-9"
|
|
93
94
|
>
|
|
94
95
|
<path
|
|
95
96
|
fill-rule="evenodd"
|
|
96
97
|
clip-rule="evenodd"
|
|
97
98
|
d="M12.8567 3.85355C13.052 3.65829 13.052 3.34171 12.8567 3.14645C12.6615 2.95118 12.3449 2.95118 12.1496 3.14645L8.00201 7.29405L3.85441 3.14645C3.65914 2.95118 3.34256 2.95118 3.1473 3.14645C2.95204 3.34171 2.95204 3.65829 3.1473 3.85355L7.29491 8.00116L3.14645 12.1496C2.95118 12.3449 2.95118 12.6615 3.14645 12.8567C3.34171 13.052 3.65829 13.052 3.85355 12.8567L8.00201 8.70827L12.1505 12.8567C12.3457 13.052 12.6623 13.052 12.8576 12.8567C13.0528 12.6615 13.0528 12.3449 12.8576 12.1496L8.70912 8.00116L12.8567 3.85355Z"
|
|
98
|
-
fill="
|
|
99
|
+
fill="currentColor"
|
|
99
100
|
/>
|
|
100
101
|
</svg>
|
|
101
102
|
</template>
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
|
|
105
106
|
<slot name="body-content">
|
|
106
107
|
<p
|
|
107
|
-
class="text-p-base text-gray-
|
|
108
|
+
class="text-p-base text-ink-gray-7"
|
|
108
109
|
v-if="options.message"
|
|
109
110
|
>
|
|
110
111
|
{{ options.message }}
|
|
@@ -272,23 +273,23 @@ const dialogPositionClasses = computed(() => {
|
|
|
272
273
|
|
|
273
274
|
const dialogIconBgClasses = computed(() => {
|
|
274
275
|
const appearance = icon.value?.appearance
|
|
275
|
-
if (!appearance) return 'bg-gray-
|
|
276
|
+
if (!appearance) return 'bg-surface-gray-2'
|
|
276
277
|
return {
|
|
277
|
-
warning: 'bg-
|
|
278
|
-
info: 'bg-blue-
|
|
279
|
-
danger: 'bg-red-
|
|
280
|
-
success: 'bg-green-
|
|
278
|
+
warning: 'bg-surface-amber-2',
|
|
279
|
+
info: 'bg-surface-blue-2',
|
|
280
|
+
danger: 'bg-surface-red-2',
|
|
281
|
+
success: 'bg-surface-green-2',
|
|
281
282
|
}[appearance]
|
|
282
283
|
})
|
|
283
284
|
|
|
284
285
|
const dialogIconClasses = computed(() => {
|
|
285
286
|
const appearance = icon.value?.appearance
|
|
286
|
-
if (!appearance) return 'text-gray-
|
|
287
|
+
if (!appearance) return 'text-ink-gray-5'
|
|
287
288
|
return {
|
|
288
|
-
warning: 'text-
|
|
289
|
-
info: 'text-blue-
|
|
290
|
-
danger: 'text-red-
|
|
291
|
-
success: 'text-green-
|
|
289
|
+
warning: 'text-ink-amber-3',
|
|
290
|
+
info: 'text-ink-blue-3',
|
|
291
|
+
danger: 'text-ink-red-4',
|
|
292
|
+
success: 'text-ink-green-3',
|
|
292
293
|
}[appearance]
|
|
293
294
|
})
|
|
294
295
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
3
|
:is="props.action ? 'div' : 'hr'"
|
|
4
|
-
class="relative whitespace-nowrap border-0 border-gray-
|
|
4
|
+
class="relative whitespace-nowrap border-0 border-outline-gray-2"
|
|
5
5
|
:class="alignmentClasses"
|
|
6
6
|
>
|
|
7
7
|
<span class="absolute" v-if="props.action" :class="actionAlignmentClasses">
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<template #body>
|
|
18
18
|
<MenuItems
|
|
19
|
-
class="mt-2 min-w-40 divide-y divide-gray-
|
|
19
|
+
class="mt-2 min-w-40 divide-y divide-outline-gray-1 rounded-lg bg-surface-modal shadow-2xl ring-1 ring-black ring-opacity-5 focus:outline-none"
|
|
20
20
|
:class="{
|
|
21
21
|
'left-0 origin-top-left': placement == 'left',
|
|
22
22
|
'right-0 origin-top-right': placement == 'right',
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button
|
|
44
44
|
v-else
|
|
45
45
|
:class="[
|
|
46
|
-
active ? 'bg-gray-
|
|
46
|
+
active ? 'bg-surface-gray-3' : 'text-ink-gray-6',
|
|
47
47
|
'group flex h-7 w-full items-center rounded px-2 text-base',
|
|
48
48
|
]"
|
|
49
49
|
@click="item.onClick"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
v-else-if="item.icon"
|
|
60
60
|
:is="item.icon"
|
|
61
61
|
/>
|
|
62
|
-
<span class="whitespace-nowrap">
|
|
62
|
+
<span class="whitespace-nowrap text-ink-gray-7">
|
|
63
63
|
{{ item.label }}
|
|
64
64
|
</span>
|
|
65
65
|
</button>
|
|
@@ -136,12 +136,19 @@ const filterOptions = (options: DropdownOption[]) => {
|
|
|
136
136
|
|
|
137
137
|
const groups = computed(() => {
|
|
138
138
|
let groups: DropdownGroupOption[] = []
|
|
139
|
+
let currentGroup: DropdownGroupOption | null = null
|
|
139
140
|
let i = 0
|
|
141
|
+
|
|
140
142
|
for (let option of props.options) {
|
|
141
143
|
if (option == null) {
|
|
142
144
|
continue
|
|
143
145
|
}
|
|
146
|
+
|
|
144
147
|
if ('group' in option) {
|
|
148
|
+
if (currentGroup) {
|
|
149
|
+
groups.push(currentGroup)
|
|
150
|
+
currentGroup = null
|
|
151
|
+
}
|
|
145
152
|
let groupOption = {
|
|
146
153
|
key: i,
|
|
147
154
|
...option,
|
|
@@ -149,16 +156,23 @@ const groups = computed(() => {
|
|
|
149
156
|
} as DropdownGroupOption
|
|
150
157
|
groups.push(groupOption)
|
|
151
158
|
} else {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
+
if (!currentGroup) {
|
|
160
|
+
currentGroup = {
|
|
161
|
+
key: i,
|
|
162
|
+
group: '',
|
|
163
|
+
hideLabel: true,
|
|
164
|
+
items: [],
|
|
165
|
+
} as DropdownGroupOption
|
|
166
|
+
}
|
|
167
|
+
currentGroup.items.push(...filterOptions([option]))
|
|
159
168
|
}
|
|
160
169
|
i++
|
|
161
170
|
}
|
|
171
|
+
|
|
172
|
+
if (currentGroup) {
|
|
173
|
+
groups.push(currentGroup)
|
|
174
|
+
}
|
|
175
|
+
|
|
162
176
|
return groups
|
|
163
177
|
})
|
|
164
178
|
|