@xy-planning-network/trees 0.13.4 → 0.13.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xy-planning-network/trees",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "repository": "github:xy-planning-network/trees",
@@ -44,6 +44,7 @@ const { aria, inputID, isRequired, errorState, onInvalid, inputValidation } =
44
44
  : 'text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500',
45
45
  ]"
46
46
  :placeholder="placeholder"
47
+ :rows="rows"
47
48
  v-bind="$attrs"
48
49
  @input="inputValidation"
49
50
  @invalid="onInvalid"
@@ -7,12 +7,38 @@ import {
7
7
  TransitionRoot,
8
8
  } from "@headlessui/vue"
9
9
  import { XIcon } from "@heroicons/vue/outline"
10
- import { watch } from "vue"
10
+ import { computed, watch } from "vue"
11
11
 
12
- defineProps<{
13
- header: string
14
- description: string
15
- }>()
12
+ const props = withDefaults(
13
+ defineProps<{
14
+ header: string
15
+ description: string
16
+ size?: "sm" | "md" | "lg"
17
+ }>(),
18
+ {
19
+ size: "sm",
20
+ }
21
+ )
22
+
23
+ const layout = computed(() => {
24
+ switch (props.size) {
25
+ case "lg":
26
+ return {
27
+ maxWidth: "max-w-6xl",
28
+ padding: "py-6 px-4 sm:px-20 sm:py-14",
29
+ }
30
+ case "md":
31
+ return {
32
+ maxWidth: "max-w-4xl",
33
+ padding: "py-6 px-4 sm:px-16 sm:py-12",
34
+ }
35
+ default: // span="sm"
36
+ return {
37
+ maxWidth: "max-w-md",
38
+ padding: "py-6 px-4 sm:px-6 sm:py-4",
39
+ }
40
+ }
41
+ })
16
42
 
17
43
  const open = defineModel<boolean>({ required: true })
18
44
 
@@ -48,11 +74,11 @@ watch(open, (isOpen) => {
48
74
  leave-from="translate-x-0"
49
75
  leave-to="translate-x-full"
50
76
  >
51
- <div class="w-screen max-w-md">
77
+ <div :class="['w-screen', layout.maxWidth]">
52
78
  <div
53
79
  class="h-full flex flex-col bg-white shadow-xl overflow-y-scroll"
54
80
  >
55
- <div class="py-6 px-4 bg-xy-blue-700 sm:px-6">
81
+ <div :class="['bg-xy-blue-700', layout.padding]">
56
82
  <div class="flex items-center justify-between">
57
83
  <DialogTitle as="h3" class="text-white">
58
84
  {{ header }}
@@ -74,7 +100,7 @@ watch(open, (isOpen) => {
74
100
  ></p>
75
101
  </div>
76
102
  </div>
77
- <div class="relative flex-1 py-6 px-4 sm:px-6">
103
+ <div :class="['relative flex-1', layout.padding]">
78
104
  <slot></slot>
79
105
  </div>
80
106
 
@@ -47,6 +47,7 @@ export interface NumericInput extends Input {
47
47
  }
48
48
  export interface TextareaInput extends Input {
49
49
  modelValue?: string | number | null;
50
+ rows?: number;
50
51
  }
51
52
  export interface OptionsInput extends Input {
52
53
  modelValue?: string | number | null;
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  header: string;
3
3
  description: string;
4
+ size?: "sm" | "md" | "lg";
4
5
  };
5
6
  type __VLS_PublicProps = {
6
7
  modelValue: boolean;
@@ -12,7 +13,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
12
13
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
14
  onClose?: (() => any) | undefined;
14
15
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
15
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
16
+ }>, {
17
+ size: "sm" | "md" | "lg";
18
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
16
19
  default?(_: {}): any;
17
20
  footer?(_: {}): any;
18
21
  }>;