@katlux/preset-modern 0.1.0-beta.6 → 0.1.0-beta.61

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@katlux/preset-modern",
3
3
  "configKey": "katluxTemplateModern",
4
- "version": "0.1.0-beta.6",
4
+ "version": "0.1.0-beta.61",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { defineNuxtModule, createResolver, installModule, addComponentsDir } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, installModule, addPlugin, addComponentsDir } from '@nuxt/kit';
2
2
  import { createRequire } from 'node:module';
3
+ import { existsSync } from 'node:fs';
3
4
 
4
5
  const module$1 = defineNuxtModule({
5
6
  meta: {
@@ -10,8 +11,10 @@ const module$1 = defineNuxtModule({
10
11
  const { resolve } = createResolver(import.meta.url);
11
12
  const _require = createRequire(import.meta.url);
12
13
  await installModule("@katlux/toolkit");
14
+ addPlugin(resolve("./runtime/plugin"));
13
15
  addComponentsDir({
14
16
  path: resolve("./runtime/components"),
17
+ prefix: "PresetModern",
15
18
  pathPrefix: false,
16
19
  extensions: ["vue"],
17
20
  global: true
@@ -22,10 +25,23 @@ const module$1 = defineNuxtModule({
22
25
  const currentAdditionalData = nuxt.options.vite.css.preprocessorOptions.scss.additionalData || "";
23
26
  const toolkitPkgJson = _require.resolve("@katlux/toolkit/package.json");
24
27
  const toolkitPkgDir = toolkitPkgJson.replace(/[\\/]package\.json$/, "");
25
- const toolkitMixinsPath = `${toolkitPkgDir}/src/runtime/presets/default/assets/scss/mixins.scss`;
28
+ const toolkitRuntimeDir = nuxt.options.dev && existsSync(toolkitPkgDir + "/src/runtime") ? toolkitPkgDir + "/src/runtime" : toolkitPkgDir + "/dist/runtime";
29
+ const mixinsScssPath = toolkitRuntimeDir + "/presets/default/assets/scss/mixins.scss";
30
+ const mixinsCssPath = toolkitRuntimeDir + "/presets/default/assets/scss/mixins.css";
31
+ const toolkitMixinsPath = existsSync(mixinsScssPath) ? mixinsScssPath : mixinsCssPath;
26
32
  const toolkitScss = `@use "${toolkitMixinsPath}" as *;`;
33
+ nuxt.hook("vite:extendConfig", (config) => {
34
+ const server = config.server || (config.server = {});
35
+ const fs = server.fs || (server.fs = {});
36
+ const allow = fs.allow || (fs.allow = []);
37
+ if (!allow.includes(toolkitRuntimeDir)) {
38
+ allow.push(toolkitRuntimeDir);
39
+ }
40
+ });
27
41
  const presetScssPath = resolve("./runtime/assets/scss/index.scss");
28
- nuxt.options.css.push(presetScssPath);
42
+ const presetCssPath = resolve("./runtime/assets/scss/index.css");
43
+ const actualPresetPath = existsSync(presetScssPath) ? presetScssPath : presetCssPath;
44
+ nuxt.options.css.push(actualPresetPath);
29
45
  nuxt.options.vite.css.preprocessorOptions.scss.additionalData = `${toolkitScss}
30
46
  ${currentAdditionalData}`;
31
47
  }
@@ -113,10 +113,17 @@
113
113
  --table-border-color: var(--neutral-200);
114
114
  --table-row-hover: var(--neutral-100);
115
115
  --table-row-selected: #eff6ff;
116
+ --panel-bg-opacity: 0.4;
117
+ --panel-blur: 12px;
118
+ --panel-bg-default: var(--neutral-100);
119
+ --panel-header-bg-default: var(--neutral-200);
120
+ --panel-footer-bg-default: var(--neutral-100);
116
121
  --checkbox-bg: var(--background-color);
117
122
  --checkbox-checked-bg: var(--button-gradient-primary);
118
123
  --checkbox-border-color: var(--neutral-400);
119
- --modal-overlay-bg: rgba(15, 23, 42, 0.6);
124
+ --checkbox-border-radius: 4px;
125
+ --modal-overlay-bg: rgba(15, 23, 42, 0.4);
126
+ --modal-backdrop-blur: 4px;
120
127
  --layout-header-height: 70px;
121
128
  --layout-header-bg: var(--background-color);
122
129
  --layout-sidebar-width: 240px;
@@ -113,10 +113,17 @@
113
113
  --table-border-color: var(--neutral-200);
114
114
  --table-row-hover: var(--neutral-100);
115
115
  --table-row-selected: #eff6ff;
116
+ --panel-bg-opacity: 0.4;
117
+ --panel-blur: 12px;
118
+ --panel-bg-default: var(--neutral-100);
119
+ --panel-header-bg-default: var(--neutral-200);
120
+ --panel-footer-bg-default: var(--neutral-100);
116
121
  --checkbox-bg: var(--background-color);
117
122
  --checkbox-checked-bg: var(--button-gradient-primary);
118
123
  --checkbox-border-color: var(--neutral-400);
119
- --modal-overlay-bg: rgba(15, 23, 42, 0.6);
124
+ --checkbox-border-radius: 4px;
125
+ --modal-overlay-bg: rgba(15, 23, 42, 0.4);
126
+ --modal-backdrop-blur: 4px;
120
127
  --layout-header-height: 70px;
121
128
  --layout-header-bg: var(--background-color);
122
129
  --layout-sidebar-width: 240px;
@@ -2,6 +2,9 @@ type __VLS_Props = {
2
2
  model: any;
3
3
  checkboxValue: any;
4
4
  isDisabled: boolean;
5
+ label?: string;
6
+ validation?: 'success' | 'warning' | 'error' | null;
7
+ validationText?: string;
5
8
  };
6
9
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
10
  "update:model": (value: any) => any;
@@ -1,18 +1,26 @@
1
1
  <template lang="pug">
2
- label.KCheckbox.modern-checkbox
3
- input(type="checkbox" v-model="formattedModel" :value="checkboxValue" :disabled="isDisabled")
4
- .checkbox-box
5
- .checkbox-checkmark
6
- KIcon.icon(iconname="check")
7
- .checkbox-label
8
- slot
2
+ .KCheckbox-wrapper
3
+ label.KCheckbox.modern-checkbox
4
+ input(type="checkbox" v-model="formattedModel" :value="checkboxValue" :disabled="isDisabled")
5
+ .checkbox-box(:class="validation ? `is-${validation}` : ''")
6
+ .checkbox-checkmark
7
+ KIcon.icon(iconname="check")
8
+ .checkbox-label(v-if="$slots.label || $slots.default || label")
9
+ slot(name="label")
10
+ slot
11
+ | {{ label }}
12
+ span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
9
13
  </template>
10
14
 
11
15
  <script setup>
16
+ import { computed } from "vue";
12
17
  const props = defineProps({
13
18
  model: { type: null, required: true },
14
19
  checkboxValue: { type: null, required: true },
15
- isDisabled: { type: Boolean, required: true }
20
+ isDisabled: { type: Boolean, required: true },
21
+ label: { type: String, required: false },
22
+ validation: { type: [String, null], required: false },
23
+ validationText: { type: String, required: false }
16
24
  });
17
25
  const emit = defineEmits(["update:model"]);
18
26
  const formattedModel = computed({
@@ -42,7 +50,7 @@ const formattedModel = computed({
42
50
  width: 22px;
43
51
  height: 22px;
44
52
  border: 2px solid var(--neutral-400);
45
- border-radius: var(--border-radius-sm);
53
+ border-radius: var(--checkbox-border-radius, 4px);
46
54
  background: var(--background-color);
47
55
  transition: all var(--transition-bounce);
48
56
  display: flex;
@@ -2,6 +2,9 @@ type __VLS_Props = {
2
2
  model: any;
3
3
  checkboxValue: any;
4
4
  isDisabled: boolean;
5
+ label?: string;
6
+ validation?: 'success' | 'warning' | 'error' | null;
7
+ validationText?: string;
5
8
  };
6
9
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
10
  "update:model": (value: any) => any;
@@ -9,6 +9,8 @@ type __VLS_Props = {
9
9
  headerSlots?: Record<string, any>;
10
10
  columnHeaders?: Record<string, string>;
11
11
  columnWidths?: Record<string, string>;
12
+ emptyStateText?: string;
13
+ emptyFilterStateText?: string;
12
14
  };
13
15
  type __VLS_ModelProps = {
14
16
  'selectedRows'?: any[];
@@ -19,6 +19,10 @@
19
19
  th.actions-cell(v-if="rowActions && rowActions.length > 0") Actions
20
20
 
21
21
  tbody
22
+ tr.empty-row(v-if="!dataProvider.loading.value && (!dataProvider.pageData.value || dataProvider.pageData.value.length === 0)")
23
+ td.empty-state(:colspan="(visibleFields || dataProvider.fields || []).length + (bulkActions && bulkActions.length > 0 ? 1 : 0) + (rowActions && rowActions.length > 0 ? 1 : 0)")
24
+ span(v-if="dataProvider.filter.value?.active") {{ emptyFilterStateText || 'no result found for filter' }}
25
+ span(v-else) {{ emptyStateText || 'no result' }}
22
26
  tr(v-for="(row, index) in dataProvider.pageData.value" :key="index" :class="{ 'selected': selectedRows.includes(row) }")
23
27
  td.check-cell(v-if="bulkActions && bulkActions.length > 0")
24
28
  KCheckbox(:value="row" v-model="selectedRows")
@@ -51,7 +55,9 @@ const props = defineProps({
51
55
  cellSlots: { type: Object, required: false },
52
56
  headerSlots: { type: Object, required: false },
53
57
  columnHeaders: { type: Object, required: false },
54
- columnWidths: { type: Object, required: false }
58
+ columnWidths: { type: Object, required: false },
59
+ emptyStateText: { type: String, required: false },
60
+ emptyFilterStateText: { type: String, required: false }
55
61
  });
56
62
  const getCellSlot = (fieldName) => {
57
63
  const slotName = "cell-" + fieldName;
@@ -152,6 +158,11 @@ const getColumnStyle = (field) => {
152
158
  .modern-datatable table tbody tr td.actions-cell {
153
159
  text-align: right;
154
160
  }
161
+ .modern-datatable table tbody tr td.empty-state {
162
+ text-align: center;
163
+ padding: var(--gap-xl, 24px);
164
+ color: var(--font-color-secondary, #666);
165
+ }
155
166
  .modern-datatable table tbody tr:last-child td {
156
167
  border-bottom: none;
157
168
  }
@@ -9,6 +9,8 @@ type __VLS_Props = {
9
9
  headerSlots?: Record<string, any>;
10
10
  columnHeaders?: Record<string, string>;
11
11
  columnWidths?: Record<string, string>;
12
+ emptyStateText?: string;
13
+ emptyFilterStateText?: string;
12
14
  };
13
15
  type __VLS_ModelProps = {
14
16
  'selectedRows'?: any[];
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  showClearIcon: boolean;
4
4
  clear: () => void;
5
5
  placeholder: string;
6
+ type: string;
6
7
  };
7
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
9
  "update:text": (value: string) => any;
@@ -1,16 +1,18 @@
1
1
  <template lang="pug">
2
2
  .KTextbox.modern-textbox
3
- input(type="text" v-model="text" :placeholder="placeholder")
3
+ input(:type="props.type" v-model="text" :placeholder="placeholder")
4
4
  .clear-button(v-if="showClearIcon" @click="clear")
5
5
  KIcon(iconname="close" width="16" height="16")
6
6
  </template>
7
7
 
8
8
  <script setup>
9
+ import { computed } from "vue";
9
10
  const props = defineProps({
10
11
  text: { type: String, required: true },
11
12
  showClearIcon: { type: Boolean, required: true },
12
13
  clear: { type: Function, required: true },
13
- placeholder: { type: String, required: true }
14
+ placeholder: { type: String, required: true },
15
+ type: { type: String, required: true }
14
16
  });
15
17
  const emit = defineEmits(["update:text"]);
16
18
  const text = computed({
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  showClearIcon: boolean;
4
4
  clear: () => void;
5
5
  placeholder: string;
6
+ type: string;
6
7
  };
7
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
9
  "update:text": (value: string) => any;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ import { registerPresetComponents } from "#imports";
3
+ export default defineNuxtPlugin(() => {
4
+ const loaders = {
5
+ "./components/KBulkActions/KBulkActions.vue": () => import("./components/KBulkActions/KBulkActions.vue"),
6
+ "./components/KButton/KButton.vue": () => import("./components/KButton/KButton.vue"),
7
+ "./components/KCheckbox/KCheckbox.vue": () => import("./components/KCheckbox/KCheckbox.vue"),
8
+ "./components/KDatatable/KDatatable.vue": () => import("./components/KDatatable/KDatatable.vue"),
9
+ "./components/KMaskTextbox/KMaskTextbox.vue": () => import("./components/KMaskTextbox/KMaskTextbox.vue"),
10
+ "./components/KPagination/KPagination.vue": () => import("./components/KPagination/KPagination.vue"),
11
+ "./components/KRangeSlider/KRangeSlider.vue": () => import("./components/KRangeSlider/KRangeSlider.vue"),
12
+ "./components/KSlider/KSlider.vue": () => import("./components/KSlider/KSlider.vue"),
13
+ "./components/KTextarea/KTextarea.vue": () => import("./components/KTextarea/KTextarea.vue"),
14
+ "./components/KTextbox/KTextbox.vue": () => import("./components/KTextbox/KTextbox.vue")
15
+ };
16
+ if (typeof registerPresetComponents === "function") {
17
+ registerPresetComponents("modern", loaders);
18
+ } else {
19
+ console.warn("Katlux preset-modern: registerPresetComponents not found in imports. Ensure @katlux/toolkit is installed and loaded.");
20
+ }
21
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/preset-modern",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.61",
4
4
  "description": "Modern default design preset and styling variables for Katlux components",
5
5
  "author": "Katlux",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@katlux/toolkit": "*",
24
- "@nuxt/kit": "^3.20.1"
24
+ "@nuxt/kit": "^3.12.0"
25
25
  },
26
26
  "files": [
27
27
  "dist"