@globalbrain/sefirot 2.1.0 → 2.1.2

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.
@@ -17,15 +17,14 @@
17
17
  <script setup lang="ts">
18
18
  import { computed, PropType } from 'vue'
19
19
 
20
- interface ButtonGroupItem {
20
+ export interface ButtonGroupItem {
21
21
  label: string
22
22
  value: string
23
- mode: Mode
23
+ mode?: Mode
24
24
  }
25
25
 
26
- type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
27
- type Size = 'mini' | 'small' | 'medium' | 'large' | 'jumbo'
28
-
26
+ export type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
27
+ export type Size = 'mini' | 'small' | 'medium' | 'large' | 'jumbo'
29
28
 
30
29
  const props = defineProps({
31
30
  items: { type: Array as PropType<ButtonGroupItem[]>, required: true },
@@ -122,30 +122,39 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
122
122
 
123
123
  <style lang="postcss" scoped>
124
124
  .SInputText.mini {
125
- .input,
126
- .input-area {
125
+ .box {
126
+ padding: 0 8px;
127
127
  min-height: 32px;
128
- padding: 3px 12px;
129
- font-size: 14px;
128
+ }
130
129
 
131
- &.has-icon {
132
- padding-left: 30px;
133
- }
130
+ .value,
131
+ .input,
132
+ .display {
133
+ min-height: 30px;
134
+ }
135
+
136
+ .input,
137
+ .display {
138
+ padding: 3px 0;
139
+ letter-spacing: 0;
140
+ line-height: 24px;
141
+ font-size: 14px;
134
142
  }
135
143
 
136
144
  .icon {
137
- top: 9px;
138
- left: 10px;
145
+ width: 22px;
146
+ height: 30px;
139
147
  }
140
148
 
141
149
  .icon-svg {
142
- width: 14px;
143
- height: 14px;
150
+ width: 16px;
151
+ height: 16px;
144
152
  }
145
153
  }
146
154
 
147
155
  .SInputText.small {
148
156
  .box {
157
+ padding: 0 12px;
149
158
  min-height: 40px;
150
159
  }
151
160
 
@@ -155,10 +164,6 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
155
164
  min-height: 38px;
156
165
  }
157
166
 
158
- .box {
159
- padding: 0 12px;
160
- }
161
-
162
167
  .input,
163
168
  .display {
164
169
  padding: 5px 0;
@@ -179,25 +184,33 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
179
184
  }
180
185
 
181
186
  .SInputText.medium {
182
- .input,
183
- .input-area {
187
+ .box {
188
+ padding: 0 12px;
184
189
  min-height: 48px;
185
- padding: 11px 16px;
186
- font-size: 16px;
190
+ }
187
191
 
188
- &.has-icon {
189
- padding-left: 36px;
190
- }
192
+ .value,
193
+ .input,
194
+ .display {
195
+ min-height: 46px;
196
+ }
197
+
198
+ .input,
199
+ .display {
200
+ padding: 11px 0;
201
+ letter-spacing: 0;
202
+ line-height: 24px;
203
+ font-size: 16px;
191
204
  }
192
205
 
193
206
  .icon {
194
- top: 16px;
195
- left: 12px;
207
+ width: 28px;
208
+ height: 46px;
196
209
  }
197
210
 
198
211
  .icon-svg {
199
- width: 16px;
200
- height: 16px;
212
+ width: 18px;
213
+ height: 18px;
201
214
  }
202
215
  }
203
216
 
@@ -16,12 +16,12 @@ const emit = defineEmits<{
16
16
 
17
17
  const el = ref<any>(null)
18
18
 
19
- function onClick(e: any) {
19
+ function onClick(e: MouseEvent) {
20
20
  if (!props.closable) {
21
21
  return
22
22
  }
23
23
 
24
- if (e.target === el.value) {
24
+ if (e.button === 0 && e.target === el.value) {
25
25
  emit('close')
26
26
  }
27
27
  }
@@ -30,7 +30,7 @@ function onClick(e: any) {
30
30
  <template>
31
31
  <Teleport to="#sefirot-modals">
32
32
  <transition name="fade">
33
- <div v-if="open" class="SModal" ref="el" @click="onClick">
33
+ <div v-if="open" class="SModal" ref="el" @mousedown="onClick">
34
34
  <slot />
35
35
  </div>
36
36
  </transition>
@@ -13,7 +13,7 @@ withDefaults(defineProps<Props>(), {
13
13
  closable: true
14
14
  })
15
15
 
16
- const emit = defineEmits<{
16
+ defineEmits<{
17
17
  (e: 'close'): void
18
18
  }>()
19
19
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Vue Components for Global Brain Design System.",
5
5
  "files": [
6
6
  "lib"
@@ -23,6 +23,7 @@
23
23
  "@iconify-icons/ph": "^1.2.2",
24
24
  "@iconify/vue": "^4.0.0",
25
25
  "@types/body-scroll-lock": "^3.1.0",
26
+ "@types/markdown-it": "^12.2.3",
26
27
  "@types/lodash-es": "^4.17.6",
27
28
  "@vuelidate/core": "^2.0.0-alpha.38",
28
29
  "@vuelidate/validators": "^2.0.0-alpha.28",
@@ -31,6 +32,7 @@
31
32
  "dayjs": "^1.11.0",
32
33
  "fuse.js": "^6.5.3",
33
34
  "lodash-es": "^4.17.21",
35
+ "markdown-it": "^13.0.1",
34
36
  "normalize.css": "^8.0.1",
35
37
  "pinia": "^2.0.22",
36
38
  "postcss": "^8.4.12",
@@ -1,3 +0,0 @@
1
- export type SyntheticEvent<E extends Event, T extends Element> = E & { target: T }
2
- export type SyntheticInputEvent<T extends Element = HTMLInputElement> = SyntheticEvent<InputEvent, T>
3
- export type SyntheticMouseEvent<T extends Element = HTMLElement> = SyntheticEvent<MouseEvent, T>