frappe-ui 0.1.218 → 0.1.222

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.
@@ -9,6 +9,7 @@
9
9
  @focus="() => loadOptions('')"
10
10
  :open-on-focus="true"
11
11
  v-bind="attrsWithoutClassStyle"
12
+ :variant="props.variant"
12
13
  >
13
14
  <template #create-new="{ searchTerm }">
14
15
  <LucidePlus class="size-4 mr-2" />
@@ -32,6 +33,7 @@ import LucidePlus from '~icons/lucide/plus'
32
33
  const props = withDefaults(defineProps<LinkProps>(), {
33
34
  label: '',
34
35
  filters: () => ({}),
36
+ variant: 'subtle',
35
37
  })
36
38
  const model = defineModel<string | null>({ default: '' })
37
39
  const emit = defineEmits<{
@@ -1,5 +1,8 @@
1
+ import { ComboboxVariant } from '../../src/components/Combobox/types'
2
+
1
3
  export interface LinkProps {
2
4
  doctype: string
5
+ variant?: ComboboxVariant
3
6
  label?: string
4
7
  placeholder?: string
5
8
  filters?: Record<string, string | [string, string]>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">
3
+ <path
4
+ fill="currentColor"
5
+ d="M8 .75a7.25 7.25 0 1 1 0 14.5A7.25 7.25 0 0 1 8 .75Zm0 1a6.25 6.25 0 1 0 0 12.5 6.25 6.25 0 0 0 0-12.5Zm2.59 3.527a.501.501 0 0 1 .758.623l-.057.085-3.848 4.666a.501.501 0 0 1-.78-.011L4.936 8.41l-.053-.086a.501.501 0 0 1 .775-.6l.07.074 1.34 1.733 3.45-4.183.072-.072Z"
6
+ />
7
+ </svg>
8
+ </template>
9
+ <script setup lang="ts"></script>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">
3
+ <path
4
+ fill="currentColor"
5
+ d="M4.293 5.28h7.413a.5.5 0 0 1 .41.787l-3.707 5.295a.5.5 0 0 1-.82 0L3.884 6.067a.5.5 0 0 1 .41-.787Z"
6
+ />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path
4
+ d="M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16z"
5
+ fill="#59B179"
6
+ />
7
+ <path
8
+ d="M9.333 17.227l1.333 1.333 2.667 2.667 5.333-5.333 2.667-2.667 1.333-1.333"
9
+ stroke="#fff"
10
+ stroke-width="2"
11
+ stroke-miterlimit="10"
12
+ stroke-linecap="round"
13
+ stroke-linejoin="round"
14
+ />
15
+ </svg>
16
+ </template>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <svg
3
+ width="16"
4
+ height="16"
5
+ viewBox="0 0 16 16"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ fill-rule="evenodd"
11
+ clip-rule="evenodd"
12
+ d="M14.25 8C14.25 11.4518 11.4518 14.25 8 14.25C4.54822 14.25 1.75 11.4518 1.75 8C1.75 4.54822 4.54822 1.75 8 1.75C11.4518 1.75 14.25 4.54822 14.25 8ZM15.25 8C15.25 12.0041 12.0041 15.25 8 15.25C3.99594 15.25 0.75 12.0041 0.75 8C0.75 3.99594 3.99594 0.75 8 0.75C12.0041 0.75 15.25 3.99594 15.25 8ZM7.37988 9.37695V9.44531H8.39062V9.37695C8.39062 9.10352 8.41992 8.88542 8.47852 8.72266C8.53711 8.55664 8.62826 8.41504 8.75195 8.29785C8.87891 8.18066 9.04329 8.06185 9.24512 7.94141C9.56087 7.74609 9.8099 7.51009 9.99219 7.2334C10.1745 6.95345 10.2656 6.61328 10.2656 6.21289C10.2656 5.82878 10.1745 5.49186 9.99219 5.20215C9.81315 4.91244 9.56087 4.6862 9.23535 4.52344C8.90983 4.36068 8.52734 4.2793 8.08789 4.2793C7.69401 4.2793 7.33268 4.35579 7.00391 4.50879C6.67513 4.65853 6.41146 4.88151 6.21289 5.17773C6.01432 5.4707 5.90853 5.82878 5.89551 6.25195H6.96973C6.986 6.0013 7.04948 5.79785 7.16016 5.6416C7.27083 5.4821 7.40755 5.36491 7.57031 5.29004C7.73633 5.21517 7.90885 5.17773 8.08789 5.17773C8.28971 5.17773 8.47363 5.22005 8.63965 5.30469C8.80892 5.38932 8.94075 5.50814 9.03516 5.66113C9.13281 5.81413 9.18164 5.99479 9.18164 6.20312C9.18164 6.47005 9.11003 6.69954 8.9668 6.8916C8.82357 7.0804 8.64453 7.23828 8.42969 7.36523C8.21159 7.50195 8.02279 7.64193 7.86328 7.78516C7.70703 7.92513 7.58659 8.11556 7.50195 8.35645C7.42057 8.59408 7.37988 8.93425 7.37988 9.37695ZM7.37988 11.5205C7.51986 11.654 7.69076 11.7207 7.89258 11.7207C8.09766 11.7207 8.26855 11.654 8.40527 11.5205C8.54525 11.3838 8.61523 11.2161 8.61523 11.0176C8.61523 10.8158 8.54525 10.6481 8.40527 10.5146C8.26855 10.3779 8.09766 10.3096 7.89258 10.3096C7.69076 10.3096 7.51986 10.3779 7.37988 10.5146C7.24316 10.6481 7.1748 10.8158 7.1748 11.0176C7.1748 11.2161 7.24316 11.3838 7.37988 11.5205Z"
13
+ fill="currentColor"
14
+ />
15
+ </svg>
16
+ </template>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <svg
3
+ width="17"
4
+ height="16"
5
+ viewBox="0 0 17 16"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ fill-rule="evenodd"
11
+ clip-rule="evenodd"
12
+ d="M6.2641 1C5.5758 1 4.97583 1.46845 4.80889 2.1362L3.57555 7.06953C3.33887 8.01625 4.05491 8.93333 5.03077 8.93333H7.50682L6.72168 14.4293C6.68838 14.6624 6.82229 14.8872 7.04319 14.9689C7.26408 15.0507 7.51204 14.9671 7.63849 14.7684L13.2161 6.00354C13.6398 5.33782 13.1616 4.46667 12.3725 4.46667H9.59038L10.3017 1.62127C10.3391 1.4719 10.3055 1.31365 10.2108 1.19229C10.116 1.07094 9.97063 1 9.81666 1H6.2641ZM5.77903 2.37873C5.83468 2.15615 6.03467 2 6.2641 2H9.17627L8.46492 4.8454C8.42758 4.99477 8.46114 5.15302 8.55589 5.27437C8.65064 5.39573 8.79602 5.46667 8.94999 5.46667H12.3725L8.0395 12.2757L8.5783 8.50404C8.5988 8.36056 8.55602 8.21523 8.46105 8.10573C8.36608 7.99623 8.22827 7.93333 8.08332 7.93333H5.03077C4.70548 7.93333 4.4668 7.62764 4.5457 7.31207L5.77903 2.37873Z"
13
+ fill="currentColor"
14
+ />
15
+ </svg>
16
+ </template>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="16"
5
+ height="16"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="1.5"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="feather feather-maximize-2"
13
+ >
14
+ <polyline points="15 3 21 3 21 9" />
15
+ <polyline points="9 21 3 21 3 15" />
16
+ <line x1="21" y1="3" x2="14" y2="10" />
17
+ <line x1="3" y1="21" x2="10" y2="14" />
18
+ </svg>
19
+ </template>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="16"
5
+ height="16"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="1.5"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="feather feather-minimize-2"
13
+ >
14
+ <polyline points="4 14 10 14 10 20" />
15
+ <polyline points="20 10 14 10 14 4" />
16
+ <line x1="14" y1="10" x2="21" y2="3" />
17
+ <line x1="3" y1="21" x2="10" y2="14" />
18
+ </svg>
19
+ </template>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <svg
3
+ width="16"
4
+ height="16"
5
+ viewBox="0 0 16 16"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ fill-rule="evenodd"
11
+ clip-rule="evenodd"
12
+ d="M8 6.5C9.10457 6.5 10 5.60457 10 4.5C10 3.39543 9.10457 2.5 8 2.5C6.89543 2.5 6 3.39543 6 4.5C6 5.60457 6.89543 6.5 8 6.5ZM8 7.5C9.65685 7.5 11 6.15685 11 4.5C11 2.84315 9.65685 1.5 8 1.5C6.34315 1.5 5 2.84315 5 4.5C5 6.15685 6.34315 7.5 8 7.5ZM12 13.5C13.1046 13.5 14 12.6046 14 11.5C14 10.3954 13.1046 9.5 12 9.5C10.8954 9.5 10 10.3954 10 11.5C10 12.6046 10.8954 13.5 12 13.5ZM12 14.5C13.6569 14.5 15 13.1569 15 11.5C15 9.84315 13.6569 8.5 12 8.5C10.3431 8.5 9 9.84315 9 11.5C9 13.1569 10.3431 14.5 12 14.5ZM6 11.5C6 12.6046 5.10457 13.5 4 13.5C2.89543 13.5 2 12.6046 2 11.5C2 10.3954 2.89543 9.5 4 9.5C5.10457 9.5 6 10.3954 6 11.5ZM7 11.5C7 13.1569 5.65685 14.5 4 14.5C2.34315 14.5 1 13.1569 1 11.5C1 9.84315 2.34315 8.5 4 8.5C5.65685 8.5 7 9.84315 7 11.5Z"
13
+ fill="currentColor"
14
+ />
15
+ </svg>
16
+ </template>
package/icons/index.ts ADDED
@@ -0,0 +1,10 @@
1
+ export { default as CircleCheckIcon } from './CircleCheckIcon.vue'
2
+ export { default as DownSolidIcon } from './DownSolidIcon.vue'
3
+ export { default as GreenCheckIcon } from './GreenCheckIcon.vue'
4
+
5
+ // Frappe Icons
6
+ export { default as HelpIcon } from './HelpIcon.vue'
7
+ export { default as LightningIcon } from './LightningIcon.vue'
8
+ export { default as MaximizeIcon } from './MaximizeIcon.vue'
9
+ export { default as MinimizeIcon } from './MinimizeIcon.vue'
10
+ export { default as StepsIcon } from './StepsIcon.vue'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frappe-ui",
3
- "version": "0.1.218",
3
+ "version": "0.1.222",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -44,7 +44,8 @@
44
44
  "frappe",
45
45
  "src",
46
46
  "scripts",
47
- "vite"
47
+ "vite",
48
+ "icons"
48
49
  ],
49
50
  "repository": {
50
51
  "type": "git",
@@ -281,9 +281,13 @@ const reset = () => {
281
281
  }
282
282
 
283
283
  const variantClasses = computed(() => {
284
+ const borderCss =
285
+ 'border focus-within:border-outline-gray-4 focus-within:ring-2 focus-within:ring-outline-gray-3'
286
+
284
287
  return {
285
- subtle: 'bg-surface-gray-2 hover:bg-surface-gray-3 border-transparent',
286
- outline: 'border-outline-gray-2',
288
+ subtle: `${borderCss} bg-surface-gray-2 hover:bg-surface-gray-3 border-transparent`,
289
+ outline: `${borderCss} border-outline-gray-2`,
290
+ ghost: '',
287
291
  }[props.variant]
288
292
  })
289
293
 
@@ -302,7 +306,7 @@ defineExpose({
302
306
  :open="isOpen"
303
307
  >
304
308
  <ComboboxAnchor
305
- class="flex h-7 w-full items-center justify-between gap-2 rounded px-2 py-1 transition-colors border focus-within:border-outline-gray-4 focus-within:ring-2 focus-within:ring-outline-gray-3"
309
+ class="flex h-7 w-full items-center justify-between gap-2 rounded px-2 py-1 transition-colors"
306
310
  :class="{
307
311
  'opacity-50 pointer-events-none': disabled,
308
312
  [variantClasses]: true,
@@ -1,5 +1,7 @@
1
1
  import type { Component, VNode } from 'vue'
2
2
 
3
+ export type ComboboxVariant = 'subtle' | 'outline' | 'ghost'
4
+
3
5
  export type SelectableOption = {
4
6
  type?: 'option'
5
7
  label: string
@@ -26,7 +28,7 @@ export type GroupedOption = { group: string; options: SimpleOption[] }
26
28
  export type ComboboxOption = SimpleOption | GroupedOption
27
29
 
28
30
  export interface ComboboxProps {
29
- variant?: 'subtle' | 'outline'
31
+ variant?: ComboboxVariant
30
32
  options: Array<ComboboxOption>
31
33
  modelValue?: string | null
32
34
  placeholder?: string
@@ -77,7 +77,7 @@ const selectClasses = computed(() => {
77
77
  const selectOptions = computed(() => {
78
78
  const str = typeof props.options?.[0] == 'string'
79
79
  const tmp = props.options?.map((x) => ({ label: x, value: x }))
80
- return (str ? tmp : props.options)?.filter(Boolean) || []
80
+ return (str ? tmp : props.options)?.filter((x) => x && x.value) || []
81
81
  })
82
82
  </script>
83
83