sprintify-ui 0.8.28 → 0.8.29

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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.8.28",
3
+ "version": "0.8.29",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -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;