sprintify-ui 0.8.28 → 0.8.30

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.
@@ -1,5 +1,5 @@
1
- module.exports = function (theme) {
2
- return {
1
+ module.exports = function ({ addComponents, theme }) {
2
+ addComponents({
3
3
  // Button
4
4
  '.btn': {
5
5
  position: 'relative',
@@ -257,5 +257,5 @@ module.exports = function (theme) {
257
257
  '--tw-ring-color': theme('colors.slate.200'),
258
258
  },
259
259
  },
260
- }
260
+ });
261
261
  }
@@ -4,19 +4,18 @@ const theme = require('./theme');
4
4
  const button = require('./button');
5
5
  const overlay = require('./overlay');
6
6
  const input = require('./input');
7
+ const table = require('./table');
7
8
 
8
9
  const config = {
9
10
  theme: theme
10
11
  }
11
12
 
12
13
  module.exports = plugin(
13
- function ({ addComponents, theme }) {
14
- addComponents(
15
- Object.assign({},
16
- button(theme),
17
- overlay(theme),
18
- input(theme),
19
- ));
14
+ function (ctx) {
15
+ button(ctx);
16
+ overlay(ctx);
17
+ input(ctx);
18
+ table(ctx);
20
19
  },
21
20
  config
22
21
  );
@@ -1,11 +1,11 @@
1
1
  const { parseColor } = require("tailwindcss/lib/util/color");
2
2
 
3
- module.exports = function (theme) {
3
+ module.exports = function ({ addComponents, theme }) {
4
4
 
5
5
  const blueColor = parseColor(theme('colors.blue.600')).color.join(", ");
6
6
  const redColor = parseColor(theme('colors.red.600')).color.join(", ");
7
7
 
8
- return {
8
+ addComponents({
9
9
  '.input-focus': {
10
10
  'border-color': `rgba(${(blueColor)}, 0.6)`,
11
11
  'zIndex': 1,
@@ -19,5 +19,5 @@ module.exports = function (theme) {
19
19
  '.input-rounded': {
20
20
  'border-radius': theme('borderRadius.md'),
21
21
  }
22
- }
22
+ });
23
23
  }
@@ -1,5 +1,5 @@
1
- module.exports = function (theme) {
2
- return {
1
+ module.exports = function ({ addComponents }) {
2
+ addComponents({
3
3
  '.overlay': {
4
4
  position: 'absolute',
5
5
  top: 0,
@@ -9,5 +9,5 @@ module.exports = function (theme) {
9
9
  width: '100%',
10
10
  height: '100%',
11
11
  },
12
- }
12
+ });
13
13
  }
@@ -0,0 +1,92 @@
1
+ module.exports = function ({ addVariant, addComponents, e, theme }) {
2
+
3
+ // Variants
4
+
5
+ addVariant('tr', ({ modifySelectors, separator }) => {
6
+ modifySelectors(({ className }) => {
7
+ return `.${e(`tr${separator}${className}`)} tr`
8
+ })
9
+ });
10
+
11
+ addVariant('th', ({ modifySelectors, separator }) => {
12
+ modifySelectors(({ className }) => {
13
+ return `.${e(`th${separator}${className}`)} th`
14
+ })
15
+ });
16
+
17
+ addVariant('td', ({ modifySelectors, separator }) => {
18
+ modifySelectors(({ className }) => {
19
+ return `.${e(`td${separator}${className}`)} td`
20
+ })
21
+ });
22
+
23
+ // Components
24
+
25
+ const borderWidth = theme('borderWidth.DEFAULT');
26
+ const borderStyle = theme('borderStyle.solid');
27
+ const borderColor = theme('colors.slate.200');
28
+
29
+ addComponents({
30
+ '.tabulation': {
31
+ 'border-collapse': 'collapse',
32
+ 'border-bottom-width': borderWidth,
33
+ 'border-bottom-style': borderStyle,
34
+ 'border-bottom-color': borderColor,
35
+ 'border-radius': theme('borderRadius.md'),
36
+ 'table-layout': 'fixed',
37
+ },
38
+ '.tabulation thead': {
39
+ 'background-color': theme('colors.slate.100'),
40
+ },
41
+ '.tabulation th, .tabulation td': {
42
+ 'padding': theme('spacing.3') + ' ' + theme('spacing.2'),
43
+ 'text-align': 'left',
44
+ 'border-bottom-width': borderWidth,
45
+ 'border-bottom-style': borderStyle,
46
+ 'border-bottom-color': borderColor,
47
+ },
48
+ '.tabulation th': {
49
+ 'font-weight': theme('fontWeight.bold'),
50
+ },
51
+ '.tabulation.tabulation-nowrap td, .tabulation.tabulation-nowrap th': {
52
+ 'white-space': 'nowrap',
53
+ },
54
+ '.tabulation.tabulation-flush td:first-child, .tabulation.tabulation-flush th:first-child': {
55
+ 'padding-left': '0',
56
+ },
57
+ '.tabulation.tabulation-flush td:last-child, .tabulation.tabulation-flush th:last-child': {
58
+ 'padding-right': '0',
59
+ },
60
+ // Sizes
61
+ '.tabulation-xs th, .tabulation-xs td': {
62
+ 'padding': theme('spacing.1') + ' ' + theme('spacing.2'),
63
+ 'font-size': theme('fontSize.xs'),
64
+ },
65
+ '.tabulation-sm th, .tabulation-sm td': {
66
+ 'padding': theme('spacing.1') + ' ' + theme('spacing.2'),
67
+ 'font-size': theme('fontSize.sm'),
68
+ },
69
+ '.tabulation-md th, .tabulation-md td': {
70
+ 'padding': theme('spacing.2') + ' ' + theme('spacing.3'),
71
+ 'font-size': theme('fontSize.sm'),
72
+ },
73
+ '.tabulation-lg th, .tabulation-lg td': {
74
+ 'padding': theme('spacing.3') + ' ' + theme('spacing.4'),
75
+ 'font-size': theme('fontSize.base'),
76
+ },
77
+ '.tabulation-xl th, .tabulation-xl td': {
78
+ 'padding': theme('spacing.4') + ' ' + theme('spacing.5'),
79
+ 'font-size': theme('fontSize.lg'),
80
+ },
81
+ // Striped
82
+ '.tabulation.tabulation-striped tr:nth-child(even)': {
83
+ 'background-color': theme('colors.slate.100'),
84
+ },
85
+ // Grid
86
+ '.tabulation.tabulation-grid th, .tabulation.tabulation-grid td': {
87
+ 'border-width': borderWidth,
88
+ 'border-style': borderStyle,
89
+ 'border-color': borderColor,
90
+ },
91
+ });
92
+ };
@@ -4,6 +4,7 @@ declare const _default: import("vue").DefineComponent<{}, {
4
4
  color: "info" | "success" | "danger" | "warning";
5
5
  title: string;
6
6
  message: string;
7
+ errorMessage: string | null | undefined;
7
8
  html: boolean;
8
9
  input: false | {
9
10
  label?: string | undefined;
@@ -13,6 +13,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
13
13
  default: string;
14
14
  type: StringConstructor;
15
15
  };
16
+ errorMessage: {
17
+ default: string;
18
+ type: PropType<string | null | undefined>;
19
+ };
16
20
  html: {
17
21
  default: boolean;
18
22
  type: BooleanConstructor;
@@ -45,6 +49,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
45
49
  default: string;
46
50
  type: StringConstructor;
47
51
  };
52
+ errorMessage: {
53
+ default: string;
54
+ type: PropType<string | null | undefined>;
55
+ };
48
56
  html: {
49
57
  default: boolean;
50
58
  type: BooleanConstructor;
@@ -67,6 +75,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
67
75
  }, {
68
76
  title: string;
69
77
  message: string;
78
+ errorMessage: string | null | undefined;
70
79
  html: boolean;
71
80
  input: boolean | InputConfigProps;
72
81
  confirmText: string;
@@ -120,6 +120,7 @@ export interface DialogOptions {
120
120
  color?: 'info' | 'success' | 'danger' | 'warning';
121
121
  title: string;
122
122
  message: string;
123
+ errorMessage?: string | null | undefined;
123
124
  html?: boolean;
124
125
  input?: InputConfigProps | false;
125
126
  confirmText?: string;
@@ -133,6 +134,7 @@ export interface Dialog {
133
134
  color: 'info' | 'success' | 'danger' | 'warning';
134
135
  title: string;
135
136
  message: string;
137
+ errorMessage: string | null | undefined;
136
138
  html: boolean;
137
139
  input: InputConfigProps | false;
138
140
  confirmText: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.8.28",
3
+ "version": "0.8.30",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -46,6 +46,7 @@
46
46
  :color="dialog.color"
47
47
  :title="dialog.title"
48
48
  :message="dialog.message"
49
+ :error-message="dialog.errorMessage"
49
50
  :confirm-text="dialog.confirmText"
50
51
  :html="dialog.html"
51
52
  :input="dialog.input"
@@ -79,3 +79,17 @@ WithInput.args = {
79
79
  placeholder: 'Password',
80
80
  },
81
81
  };
82
+
83
+ export const ErrorMessage = Template.bind({});
84
+ ErrorMessage.args = {
85
+ color: 'danger',
86
+ title: 'Please confirm your password',
87
+ errorMessage: 'Invalid password',
88
+ input: {
89
+ label: 'Enter your password',
90
+ type: 'password',
91
+ size: 'sm',
92
+ required: true,
93
+ placeholder: 'Password',
94
+ },
95
+ };
@@ -83,6 +83,15 @@
83
83
  class="w-full"
84
84
  />
85
85
  </BaseField>
86
+
87
+ <BaseAlert
88
+ v-if="errorMessage"
89
+ class="mt-4"
90
+ color="danger"
91
+ bordered
92
+ >
93
+ {{ errorMessage }}
94
+ </BaseAlert>
86
95
  </slot>
87
96
  </div>
88
97
  </div>
@@ -116,6 +125,7 @@ import BaseButton from './BaseButton.vue';
116
125
  import BaseInput from './BaseInput.vue';
117
126
  import BaseField from './BaseField.vue';
118
127
  import BasePassword from './BasePassword.vue';
128
+ import BaseAlert from './BaseAlert.vue';
119
129
  import { InputConfigProps } from '@/types';
120
130
 
121
131
  const props = defineProps({
@@ -131,6 +141,10 @@ const props = defineProps({
131
141
  default: '',
132
142
  type: String,
133
143
  },
144
+ errorMessage: {
145
+ default: '',
146
+ type: [String, null, undefined] as PropType<string | null | undefined>,
147
+ },
134
148
  html: {
135
149
  default: false,
136
150
  type: Boolean,
@@ -68,6 +68,38 @@ const Template = (args) => ({
68
68
  return { args, optionsLarge };
69
69
  },
70
70
  template: `
71
+
72
+ <table class="tabulation tabulation-grid tabulation-sm tabulation-striped w-full bg-white border mb-5">
73
+ <thead>
74
+ <tr>
75
+ <th>Label</th>
76
+ <th>ID</th>
77
+ <th>Type</th>
78
+ <th>Description</th>
79
+ </tr>
80
+ </thead>
81
+ <tbody>
82
+ <tr>
83
+ <td>Label</td>
84
+ <td>ID</td>
85
+ <td>Type</td>
86
+ <td>Description</td>
87
+ </tr>
88
+ <tr>
89
+ <td>Label</td>
90
+ <td>ID</td>
91
+ <td>Type</td>
92
+ <td>Description</td>
93
+ </tr>
94
+ <tr>
95
+ <td>Label</td>
96
+ <td>ID</td>
97
+ <td>Type</td>
98
+ <td>Description</td>
99
+ </tr>
100
+ </tbody>
101
+ </table>
102
+
71
103
  <div class="border">
72
104
  <BaseTable class="w-full" v-bind="args">
73
105
  ${headTemplate}
@@ -99,6 +99,7 @@ function scrollTop() {
99
99
  }
100
100
 
101
101
  // Virtual Scrolling
102
+
102
103
  const virtualScrollingDefaultRowHeight = ref(null) as Ref<number | null | undefined>;
103
104
  function setVirtualScrollingDefaultRowHeight(height: number) {
104
105
  virtualScrollingDefaultRowHeight.value = height;
@@ -17,6 +17,7 @@ export const useDialogsStore = defineStore('dialogs', {
17
17
  color: options.color ?? 'info',
18
18
  title: options.title,
19
19
  message: options.message,
20
+ errorMessage: options.errorMessage,
20
21
  html: options.html ?? false,
21
22
  confirmText: options.confirmText ?? t('sui.confirm'),
22
23
  cancelText: options.cancelText ?? t('sui.cancel'),
@@ -152,6 +152,7 @@ export interface DialogOptions {
152
152
  color?: 'info' | 'success' | 'danger' | 'warning';
153
153
  title: string;
154
154
  message: string;
155
+ errorMessage?: string | null | undefined;
155
156
  html?: boolean;
156
157
  input?: InputConfigProps | false;
157
158
  confirmText?: string;
@@ -166,6 +167,7 @@ export interface Dialog {
166
167
  color: 'info' | 'success' | 'danger' | 'warning';
167
168
  title: string;
168
169
  message: string;
170
+ errorMessage: string | null | undefined;
169
171
  html: boolean;
170
172
  input: InputConfigProps | false;
171
173
  confirmText: string;