sprintify-ui 0.6.47 → 0.6.50

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.
@@ -70,9 +70,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
70
70
  }, {
71
71
  size: "xs" | "sm" | "md";
72
72
  options: NormalizedOption[];
73
+ loading: boolean;
73
74
  selected: NormalizedOption | NormalizedOption[] | null | undefined;
74
75
  keywords: string;
75
- loading: boolean;
76
76
  loadingBottom: boolean;
77
77
  twDrawer: string;
78
78
  }, {}>, {
@@ -1,5 +1,6 @@
1
1
  import { ClassNameValue } from 'tailwind-merge';
2
2
  import { RouteLocationRaw } from 'vue-router';
3
+ declare function focus(): void;
3
4
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
5
  class: {
5
6
  type: import("vue").PropType<string | false | 0 | ClassNameValue[] | null>;
@@ -29,19 +30,21 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
29
30
  type: import("vue").PropType<boolean>;
30
31
  default: boolean;
31
32
  };
32
- loading: {
33
- type: import("vue").PropType<boolean>;
34
- default: boolean;
35
- };
36
33
  as: {
37
34
  type: import("vue").PropType<string>;
38
35
  default: string;
39
36
  };
37
+ loading: {
38
+ type: import("vue").PropType<boolean>;
39
+ default: boolean;
40
+ };
40
41
  iconPosition: {
41
42
  type: import("vue").PropType<"start" | "end">;
42
43
  default: string;
43
44
  };
44
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
+ }, {
46
+ focus: typeof focus;
47
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
48
  click: (...args: any[]) => void;
46
49
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
47
50
  class: {
@@ -72,14 +75,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
72
75
  type: import("vue").PropType<boolean>;
73
76
  default: boolean;
74
77
  };
75
- loading: {
76
- type: import("vue").PropType<boolean>;
77
- default: boolean;
78
- };
79
78
  as: {
80
79
  type: import("vue").PropType<string>;
81
80
  default: string;
82
81
  };
82
+ loading: {
83
+ type: import("vue").PropType<boolean>;
84
+ default: boolean;
85
+ };
83
86
  iconPosition: {
84
87
  type: import("vue").PropType<"start" | "end">;
85
88
  default: string;
@@ -94,8 +97,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
94
97
  icon: string;
95
98
  size: "xs" | "sm" | "md" | "lg" | "xl";
96
99
  disabled: boolean;
97
- loading: boolean;
98
100
  as: string;
101
+ loading: boolean;
99
102
  iconPosition: "start" | "end";
100
103
  }, {}>, {
101
104
  default?(_: {}): any;
@@ -33,8 +33,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
33
33
  type: StringConstructor;
34
34
  };
35
35
  }>>, {
36
- tooltip: boolean;
37
36
  as: string;
37
+ tooltip: boolean;
38
38
  timeZone: string;
39
39
  }, {}>, {
40
40
  default?(_: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.6.47",
3
+ "version": "0.6.50",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -75,7 +75,8 @@ const classes = computed(() => {
75
75
  md: 'px-1.5 py-0.5 text-xs',
76
76
  lg: 'px-1.5 py-0.5 text-sm',
77
77
  }[sizeInternal.value];
78
- const wrap = props.wrap ? 'whitespace-nowrap' : '';
78
+
79
+ const wrap = props.wrap ? '' : 'whitespace-nowrap';
79
80
 
80
81
  return twMerge(base, wrap, size, props.class);
81
82
  })
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <component
3
3
  :is="as"
4
- ref="button"
4
+ ref="buttonRef"
5
5
  :class="classes"
6
6
  :style="styles"
7
7
  :to="to"
@@ -205,4 +205,16 @@ const iconClass = computed(() => {
205
205
  return classes;
206
206
  });
207
207
 
208
+ const buttonRef = ref<HTMLElement | undefined>(undefined);
209
+
210
+ function focus() {
211
+ if (buttonRef.value) {
212
+ buttonRef.value.focus();
213
+ }
214
+ }
215
+
216
+ defineExpose({
217
+ focus,
218
+ });
219
+
208
220
  </script>
@@ -27,7 +27,7 @@ const Template = (args) => ({
27
27
 
28
28
  export const Demo = Template.bind({});
29
29
  Demo.args = {
30
- count: 355,
30
+ count: 0.01,
31
31
  maxDigit: 2,
32
32
  };
33
33
 
@@ -34,12 +34,13 @@ const props = defineProps({
34
34
  const countLabel = computed((): string => {
35
35
  const realMaxDigit = Math.max(1, props.maxDigit);
36
36
 
37
- const countString = props.count + '';
37
+ // Should work with 0.01
38
+ const countString = Math.round(props.count) + '';
38
39
  const numberOfDigit = countString.length;
39
40
  if (numberOfDigit > realMaxDigit) {
40
41
  return padStart('+', realMaxDigit + 1, '9');
41
42
  }
42
- return countString;
43
+ return props.count + '';
43
44
  });
44
45
 
45
46
  const sizeClass = computed((): string => {
@@ -1,5 +1,7 @@
1
1
  import BaseDialog from './BaseDialog.vue';
2
2
 
3
+ const colors = ['info', 'success', 'warning', 'danger'];
4
+
3
5
  export default {
4
6
  title: 'Components/BaseDialog',
5
7
  component: BaseDialog,
@@ -10,6 +12,7 @@ export default {
10
12
  },
11
13
  },
12
14
  args: {
15
+ color: 'info',
13
16
  message:
14
17
  'Nisi Lorem sunt amet aliqua dolor ullamco deserunt enim irure non ad. Excepteur culpa consectetur dolore culpa sunt aliquip proident quis.',
15
18
  },
@@ -29,23 +32,23 @@ const Template = (args) => ({
29
32
  export const Demo = Template.bind({});
30
33
  Demo.args = {
31
34
  title: 'Be careful',
32
- color: 'warning',
33
- };
34
-
35
- export const Success = Template.bind({});
36
- Success.args = {
37
- title: 'Success',
38
- color: 'success',
39
35
  };
40
36
 
41
- export const Danger = Template.bind({});
42
- Danger.args = {
43
- title: 'Error',
44
- color: 'danger',
45
- };
37
+ const ColorsTemplate = (args) => ({
38
+ components: { BaseDialog },
39
+ setup() {
40
+ return { args, colors };
41
+ },
42
+ template: `
43
+ <div v-for="color in colors" :key="color" class="mb-1">
44
+ <p class="text-xs text-slate-600 leading-tight">{{ color }}</p>
45
+ <BaseDialog v-bind="args" :color="color">
46
+ </BaseDialog>
47
+ </div>
48
+ `,
49
+ });
46
50
 
47
- export const Info = Template.bind({});
48
- Info.args = {
49
- title: 'Information',
50
- color: 'info',
51
+ export const Colors = ColorsTemplate.bind({});
52
+ Colors.args = {
53
+ title: 'Be careful',
51
54
  };
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div
3
- class="relative transform overflow-hidden rounded-lg bg-white ring-1 ring-black ring-opacity-10 p-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"
3
+ class="relative transform overflow-hidden rounded-lg bg-white ring-1 ring-black ring-opacity-10 p-4 text-left shadow-xl transition-all || sm:my-8 sm:w-full sm:max-w-lg"
4
4
  >
5
- <div class="sm:flex sm:items-start">
5
+ <div class="sm:flex sm:items-start || sm:gap-4">
6
6
  <div
7
7
  class="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full sm:mx-0 sm:h-10 sm:w-10"
8
8
  :class="{
@@ -33,7 +33,7 @@
33
33
  icon="heroicons:information-circle-20-solid"
34
34
  />
35
35
  </div>
36
- <div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
36
+ <div class="mt-3 text-center || sm:mt-0 sm:text-left">
37
37
  <slot>
38
38
  <h3
39
39
  id="modal-title"
@@ -49,28 +49,25 @@
49
49
  </slot>
50
50
  </div>
51
51
  </div>
52
- <div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
53
- <button
52
+ <div class="mt-5 || sm:mt-4 sm:flex sm:flex-row-reverse">
53
+ <BaseButton
54
54
  ref="confirm"
55
55
  type="button"
56
- class="btn btn-sm mb-2 w-full sm:mb-0 sm:w-auto"
57
- :class="{
58
- 'btn-primary': color == 'info',
59
- 'btn-danger': color == 'danger',
60
- 'btn-warning': color == 'warning',
61
- 'btn-success': color == 'success',
62
- }"
56
+ size="sm"
57
+ class="mb-2 w-full sm:mb-0 sm:w-auto"
58
+ :color="color"
63
59
  @click="$emit('confirm')"
64
60
  >
65
61
  {{ confirmText ?? t('sui.confirm') }}
66
- </button>
67
- <button
62
+ </BaseButton>
63
+ <BaseButton
68
64
  type="button"
69
- class="btn btn-sm w-full sm:mr-2 sm:w-auto"
65
+ size="sm"
66
+ class="w-full sm:mr-2 sm:w-auto"
70
67
  @click="$emit('cancel')"
71
68
  >
72
69
  {{ cancelText ?? t('sui.cancel') }}
73
- </button>
70
+ </BaseButton>
74
71
  </div>
75
72
  </div>
76
73
  </template>
@@ -79,6 +76,7 @@
79
76
  import { PropType } from 'vue';
80
77
  import { Icon as BaseIcon } from '@iconify/vue';
81
78
  import { t } from '@/i18n';
79
+ import BaseButton from './BaseButton.vue';
82
80
 
83
81
  defineProps({
84
82
  color: {