vueless 0.0.51 → 0.0.52

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.
Files changed (33) hide show
  1. package/adatper.locale/locales/en.js +2 -0
  2. package/index.js +9 -0
  3. package/package.json +4 -6
  4. package/service.ui/index.js +1 -0
  5. package/ui.button/composables/attrs.composable.js +9 -2
  6. package/ui.button-link/composables/attrs.composable.js +23 -3
  7. package/ui.button-toggle/configs/default.config.js +1 -0
  8. package/ui.container-modal-confirm/composable/attrs.composable.js +55 -5
  9. package/ui.form-calendar/configs/default.config.js +21 -21
  10. package/ui.form-color-picker/composables/attrs.composable.js +2 -9
  11. package/ui.form-date-picker/configs/default.config.js +1 -1
  12. package/ui.form-date-picker-range/configs/default.config.js +16 -16
  13. package/ui.form-input/configs/default.config.js +2 -2
  14. package/ui.form-radio-card/composables/attrs.composable.js +2 -2
  15. package/ui.form-select/configs/default.config.js +2 -2
  16. package/ui.form-textarea/configs/default.config.js +1 -1
  17. package/ui.loader-rendering/composables/useLoaderRendering.js +19 -0
  18. package/ui.loader-rendering/index.vue +15 -16
  19. package/ui.navigation-pagination/configs/default.config.js +2 -2
  20. package/ui.notify/Docs.mdx +84 -0
  21. package/ui.notify/composables/attrs.composable.js +30 -0
  22. package/ui.notify/configs/default.config.js +47 -0
  23. package/ui.notify/constants/index.js +19 -0
  24. package/ui.notify/index.stories.js +77 -0
  25. package/ui.notify/index.vue +196 -214
  26. package/ui.notify/services/index.js +65 -63
  27. package/ui.other-loader-top/composables/useLoaderTop.js +57 -0
  28. package/ui.other-loader-top/index.vue +12 -13
  29. package/ui.text-alert/composables/attrs.composable.js +1 -1
  30. package/web-types.json +21 -3
  31. package/ui.loader-rendering/store/index.js +0 -17
  32. package/ui.notify/index.sto_ries.js +0 -102
  33. package/ui.other-loader-top/store/index.js +0 -59
@@ -8,6 +8,7 @@ import calendarConfig from "../../ui.form-calendar/configs/default.config";
8
8
  import datepickerConfig from "../../ui.form-date-picker/configs/default.config";
9
9
  import datepickerRangeConfig from "../../ui.form-date-picker-range/configs/default.config";
10
10
  import dataListConfig from "../../ui.data-list/configs/default.config";
11
+ import notifyDefaultConfig from "../../ui.notify/configs/default.config";
11
12
 
12
13
  export default {
13
14
  USelect: selectConfig.i18n,
@@ -20,4 +21,5 @@ export default {
20
21
  UDatePicker: datepickerConfig.i18n,
21
22
  UDatePickerRange: datepickerRangeConfig.i18n,
22
23
  UDataList: dataListConfig.i18n,
24
+ UNotify: notifyDefaultConfig.i18n,
23
25
  };
package/index.js CHANGED
@@ -2,6 +2,15 @@ import { createLocale, LocaleSymbol } from "./composable.locale";
2
2
 
3
3
  export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n";
4
4
  export { default as defaultEnLocale } from "./adatper.locale/locales/en";
5
+ export {
6
+ notify,
7
+ notifySuccess,
8
+ notifyWarning,
9
+ notifyError,
10
+ clearAllNotifications,
11
+ setDelayedNotify,
12
+ getDelayedNotify,
13
+ } from "./ui.notify/services";
5
14
 
6
15
  export function createVueless(options = {}) {
7
16
  const locale = createLocale(options.locale);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -11,8 +11,8 @@
11
11
  "access": "public"
12
12
  },
13
13
  "scripts": {
14
- "lint": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore src/ .storybook/ tests/",
15
- "lint:fix": "eslint --ext .vue,.js,.ts --fix --ignore-path .eslintignore src/ .storybook/ tests/",
14
+ "lint": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore src/ .storybook/",
15
+ "lint:fix": "eslint --ext .vue,.js,.ts --fix --ignore-path .eslintignore src/ .storybook/",
16
16
  "lint:ci": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore --max-warnings=0",
17
17
  "release:patch": "release-it patch --ci --npm.publish",
18
18
  "release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
@@ -24,7 +24,6 @@
24
24
  "package:prepare": "node src/gen.web-types && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE web-types.json README.md dist/ && rm -rf dist/assets && node dist.prepare"
25
25
  },
26
26
  "dependencies": {
27
- "@kyvg/vue3-notification": "^3.2.1",
28
27
  "@material-symbols/svg-500": "^0.17.3",
29
28
  "@tailwindcss/forms": "^0.5.7",
30
29
  "@uppy/core": "^3.10.1",
@@ -35,8 +34,7 @@
35
34
  "tailwind-merge": "^2.3.0",
36
35
  "tailwindcss": "^3.4.3",
37
36
  "vue-tippy": "^6.0.0-beta.0",
38
- "vuedraggable": "^4.1.0",
39
- "vuex": "^4.1.0"
37
+ "vuedraggable": "^4.1.0"
40
38
  },
41
39
  "devDependencies": {
42
40
  "@release-it/bumper": "^6.0.1",
@@ -102,6 +102,7 @@ export default class UIServiceDefault {
102
102
  return color.length === 6 || color.length === 3 ? `${r}, ${g}, ${b}` : "";
103
103
  }
104
104
 
105
+ // TODO: This should be rewrote to support all set of brand colors (not only one).
105
106
  setBrandColor(brandColor) {
106
107
  function getBrandColor(color, grayColor, brandColors) {
107
108
  if (color === "grayscale") {
@@ -6,7 +6,7 @@ import defaultConfig from "../configs/default.config";
6
6
 
7
7
  export function useAttrs(props) {
8
8
  const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
9
- const { button } = config.value;
9
+ const { button, text } = config.value;
10
10
 
11
11
  const cvaButton = cva({
12
12
  base: button.base,
@@ -14,6 +14,12 @@ export function useAttrs(props) {
14
14
  compoundVariants: button.compoundVariants,
15
15
  });
16
16
 
17
+ const cvaText = cva({
18
+ base: text.base,
19
+ variants: text.variants,
20
+ compoundVariants: text.compoundVariants,
21
+ });
22
+
17
23
  const buttonClasses = computed(() =>
18
24
  setColor(
19
25
  cvaButton({
@@ -31,8 +37,9 @@ export function useAttrs(props) {
31
37
  ),
32
38
  );
33
39
 
40
+ const textClasses = computed(() => setColor(cvaText({ color: props.color }), props.color));
34
41
  const buttonAttrs = getAttrs("button", { classes: buttonClasses });
35
- const textAttrs = getAttrs("text");
42
+ const textAttrs = getAttrs("text", { classes: textClasses });
36
43
 
37
44
  return {
38
45
  textAttrs,
@@ -9,7 +9,7 @@ export function useAttrs(props) {
9
9
  const slots = useSlots();
10
10
 
11
11
  const { config, getAttrs, hasSlotContent, setColor } = useUI(defaultConfig, () => props.config);
12
- const { wrapper, link, text } = config.value;
12
+ const { wrapper, link, text, rightSlot, leftSlot } = config.value;
13
13
 
14
14
  const cvaWrapper = cva({
15
15
  base: wrapper.base,
@@ -29,6 +29,18 @@ export function useAttrs(props) {
29
29
  compoundVariants: text.compoundVariants,
30
30
  });
31
31
 
32
+ const cvaRightSlot = cva({
33
+ base: rightSlot.base,
34
+ variants: rightSlot.variants,
35
+ compoundVariants: rightSlot.compoundVariants,
36
+ });
37
+
38
+ const cvaLeftSlot = cva({
39
+ base: leftSlot.base,
40
+ variants: leftSlot.variants,
41
+ compoundVariants: leftSlot.compoundVariants,
42
+ });
43
+
32
44
  const wrapperClasses = computed(() =>
33
45
  setColor(
34
46
  cvaWrapper({
@@ -56,6 +68,14 @@ export function useAttrs(props) {
56
68
 
57
69
  const textClasses = computed(() => setColor(cvaText({ color: props.color }), props.color));
58
70
 
71
+ const rightSlotClasses = computed(() =>
72
+ setColor(cvaRightSlot({ color: props.color }), props.color),
73
+ );
74
+
75
+ const leftSlotClasses = computed(() =>
76
+ setColor(cvaLeftSlot({ color: props.color }), props.color),
77
+ );
78
+
59
79
  const wrapperAttrsRaw = getAttrs("wrapper", { classes: wrapperClasses });
60
80
 
61
81
  const wrapperAttrs = computed(() => {
@@ -83,8 +103,8 @@ export function useAttrs(props) {
83
103
  };
84
104
  });
85
105
 
86
- const rightSlotAttrs = getAttrs("rightSlot");
87
- const leftSlotAttrs = getAttrs("leftSlot");
106
+ const rightSlotAttrs = getAttrs("rightSlot", { classes: rightSlotClasses });
107
+ const leftSlotAttrs = getAttrs("leftSlot", { classes: leftSlotClasses });
88
108
  const textAttrs = getAttrs("text", { classes: textClasses });
89
109
 
90
110
  return {
@@ -4,6 +4,7 @@ export default /*tw*/ {
4
4
  [&>*:first-child]:rounded-l-lg [&>*:first-child]:rounded-r-none [&>*:first-child]:overflow-hidden
5
5
  [&>*:last-child]:rounded-r-lg [&>*:last-child]:rounded-l-none [&>*:last-child]:overflow-hidden
6
6
  `,
7
+ toggleItem: "",
7
8
  defaultVariants: {
8
9
  size: "md",
9
10
  block: false,
@@ -1,13 +1,63 @@
1
1
  import useUI from "../../composable.ui";
2
2
  import defaultConfig from "../configs/default.config";
3
+ import { cva } from "../../service.ui/index.js";
4
+ import { computed } from "vue";
3
5
 
4
6
  export function useAttrs(props) {
5
- const { config, getAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
7
+ const { config, getAttrs, hasSlotContent, setColor } = useUI(defaultConfig, () => props.config);
8
+ const { modal, footerLeftFallback, confirmButton, cancelButton } = config.value;
6
9
 
7
- const modalAttrs = getAttrs("modal", { isComponent: true });
8
- const footerLeftFallbackAttrs = getAttrs("footerLeftFallback");
9
- const confirmButtonAttrs = getAttrs("confirmButton", { isComponent: true });
10
- const cancelButtonAttrs = getAttrs("cancelButton", { isComponent: true });
10
+ const cvaModal = cva({
11
+ base: modal.base,
12
+ variants: modal.variants,
13
+ compoundVariants: modal.compoundVariants,
14
+ });
15
+
16
+ const cvaFooterLeftFallback = cva({
17
+ base: footerLeftFallback.base,
18
+ variants: footerLeftFallback.variants,
19
+ compoundVariants: footerLeftFallback.compoundVariants,
20
+ });
21
+
22
+ const cvaConfirmButton = cva({
23
+ base: confirmButton.base,
24
+ variants: confirmButton.variants,
25
+ compoundVariants: confirmButton.compoundVariants,
26
+ });
27
+
28
+ const cvaCancelButton = cva({
29
+ base: cancelButton.base,
30
+ variants: cancelButton.variants,
31
+ compoundVariants: cancelButton.compoundVariants,
32
+ });
33
+
34
+ const modalClasses = computed(() => setColor(cvaModal({ color: props.color }), props.color));
35
+
36
+ const footerLeftFallbackClasses = computed(() =>
37
+ setColor(cvaFooterLeftFallback({ color: props.color }), props.color),
38
+ );
39
+
40
+ const confirmButtonClasses = computed(() => cvaConfirmButton({ color: props.color }));
41
+
42
+ const cancelButtonClasses = computed(() => cvaCancelButton({ color: props.color }));
43
+
44
+ const modalAttrsRaw = getAttrs("modal", { isComponent: true, classes: modalClasses });
45
+ const footerLeftFallbackAttrs = getAttrs("footerLeftFallback", {
46
+ classes: footerLeftFallbackClasses,
47
+ });
48
+ const confirmButtonAttrs = getAttrs("confirmButton", {
49
+ isComponent: true,
50
+ classes: confirmButtonClasses,
51
+ });
52
+ const cancelButtonAttrs = getAttrs("cancelButton", {
53
+ isComponent: true,
54
+ classes: cancelButtonClasses,
55
+ });
56
+
57
+ const modalAttrs = computed(() => ({
58
+ ...modalAttrsRaw.value,
59
+ class: setColor(modalAttrsRaw.value.class, props.color),
60
+ }));
11
61
 
12
62
  return {
13
63
  config,
@@ -1,9 +1,9 @@
1
1
  export default /*tw*/ {
2
- wrapper: "w-fit overflow-hidden rounded-lg border focus:outline-none border-gray-300 bg-white px-1 pb-4 shadow",
2
+ wrapper: "w-fit overflow-hidden rounded-lg border focus:outline-none border-brand-300 bg-white px-1 pb-4 shadow",
3
3
  navigation: "flex items-center justify-between px-3 pt-2",
4
4
  navigationSwitchViewButton: "",
5
5
  dayViewSwitchLabel: "flex gap-1",
6
- dayViewSwitchLabelMonth: "text-gray-900",
6
+ dayViewSwitchLabelMonth: "text-brand-900",
7
7
  dayViewSwitchLabelIcon: "",
8
8
  dayViewSwitchLabelIconName: "keyboard_arrow_right",
9
9
  nextPrevWrapper: {
@@ -21,35 +21,35 @@ export default /*tw*/ {
21
21
  prevIconName: "keyboard_arrow_left",
22
22
  dayViewWrapper: "w-64 px-3 pt-2",
23
23
  weekDaysWrapper: "grid grid-cols-7",
24
- weekDay: "flex size-8 items-center justify-center text-xs uppercase text-gray-500",
24
+ weekDay: "flex size-8 items-center justify-center text-xs uppercase text-brand-500",
25
25
  daysWrapper: "grid grid-cols-7",
26
- day: "mx-auto size-8 rounded-lg text-sm hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed",
27
- activeDay: "bg-gray-100 hover:bg-gray-100",
28
- inRangeFirstDay: "rounded-none rounded-l-lg bg-gray-200 text-gray-900 hover:bg-gray-200",
29
- inRangeLastDay: "rounded-none rounded-r-lg bg-gray-200 text-gray-900 hover:bg-gray-200",
30
- inRangeDay: "bg-gray-100 text-gray-900 hover:!bg-gray-200 rounded-none",
31
- selectedDay: "bg-gray-900 text-white hover:bg-gray-900",
32
- currentDay: "hover:bg-gray-100 border-2 border-gray-900",
33
- anotherMonthDay: "hover:bg-gray-100 text-gray-400",
26
+ day: "mx-auto size-8 rounded-lg text-sm hover:bg-brand-100 disabled:opacity-50 disabled:cursor-not-allowed",
27
+ activeDay: "bg-brand-100 hover:bg-brand-100",
28
+ inRangeFirstDay: "rounded-none rounded-l-lg bg-brand-200 text-brand-900 hover:bg-brand-200",
29
+ inRangeLastDay: "rounded-none rounded-r-lg bg-brand-200 text-brand-900 hover:bg-brand-200",
30
+ inRangeDay: "bg-brand-100 text-brand-900 hover:!bg-brand-200 rounded-none",
31
+ selectedDay: "bg-brand-900 text-white hover:bg-brand-900",
32
+ currentDay: "hover:bg-brand-100 border-2 border-brand-900",
33
+ anotherMonthDay: "hover:bg-brand-100 text-brand-400",
34
34
  monthViewWrapper: "grid w-64 grid-cols-4 items-center justify-center px-3 pt-2",
35
35
  month: `
36
- mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-gray-100
36
+ mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-brand-100
37
37
  disabled:opacity-50 disabled:cursor-not-allowed
38
38
  `,
39
- selectedMonth: "bg-gray-900 hover:bg-gray-900 text-white",
40
- activeMonth: "bg-gray-100",
39
+ selectedMonth: "bg-brand-900 hover:bg-brand-900 text-white",
40
+ activeMonth: "bg-brand-100",
41
41
  yearViewWrapper: "grid w-64 grid-cols-4 items-center justify-center px-3 pt-2",
42
42
  year: `
43
- mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-gray-100
43
+ mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-brand-100
44
44
  disabled:opacity-50 disabled:cursor-not-allowed
45
45
  `,
46
- selectedYear: "bg-gray-900 hover:bg-gray-900 text-white",
47
- activeYear: "bg-gray-100",
46
+ selectedYear: "bg-brand-900 hover:bg-brand-900 text-white",
47
+ activeYear: "bg-brand-100",
48
48
  timepickerWrapper: `
49
- mx-2 -mb-1 mt-2 flex items-center justify-between gap-2 border-t border-gray-200 pl-2 pr-1 pt-3 text-sm
49
+ mx-2 -mb-1 mt-2 flex items-center justify-between gap-2 border-t border-brand-200 pl-2 pr-1 pt-3 text-sm
50
50
  `,
51
51
  timepickerLabel: "w-full",
52
- timepickerInputWrapper: "flex items-center gap-px rounded-lg border border-gray-300",
52
+ timepickerInputWrapper: "flex items-center gap-px rounded-lg border border-brand-300",
53
53
  timepickerLeftInput: `
54
54
  w-11 rounded-l-lg border-none px-2.5 py-1.5 text-center text-sm focus:border-none focus:outline-none
55
55
  `,
@@ -57,8 +57,8 @@ export default /*tw*/ {
57
57
  w-11 rounded-r-lg border-none px-2.5 py-1.5 text-center text-sm focus:border-none focus:outline-none
58
58
  `,
59
59
  submitButton: `
60
- rounded-lg border-none bg-gray-900/10 px-2.5 py-1.5 text-sm font-normal text-gray-900 outline-none
61
- focus:ring-0 hover:bg-gray-900/10
60
+ rounded-lg border-none bg-brand-900/10 px-2.5 py-1.5 text-sm font-normal text-brand-900 outline-none
61
+ focus:ring-0 hover:bg-brand-900/10
62
62
  `,
63
63
  i18n: {
64
64
  weekdays: {
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export function useAttrs(props) {
8
- const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
8
+ const { config, getAttrs } = useUI(defaultConfig, () => props.config);
9
9
  const { radio } = config.value;
10
10
 
11
11
  const cvaRadio = cva({
@@ -14,14 +14,7 @@ export function useAttrs(props) {
14
14
  compoundVariants: radio.compoundVariants,
15
15
  });
16
16
 
17
- const radioClasses = computed(() =>
18
- setColor(
19
- cvaRadio({
20
- color: props.color,
21
- }),
22
- props.color,
23
- ),
24
- );
17
+ const radioClasses = computed(() => cvaRadio({ color: props.color }));
25
18
 
26
19
  const wrapperAttrs = getAttrs("wrapper");
27
20
  const listAttrs = getAttrs("listAttrs");
@@ -2,7 +2,7 @@ export default /*tw*/ {
2
2
  input: "",
3
3
  inputActive: {
4
4
  block: {
5
- base: "ring-4 ring-gray-600/[.15] border-gray-500 hover:border-gray-500",
5
+ base: "ring-4 ring-brand-600/[.15] border-brand-500 hover:border-brand-500",
6
6
  },
7
7
  },
8
8
  calendar: "absolute z-40 mt-2",
@@ -2,23 +2,23 @@ export default /*tw*/ {
2
2
  input: "",
3
3
  inputActive: {
4
4
  block: {
5
- base: "ring-4 ring-gray-600/[.15] border-gray-500 hover:border-gray-500",
5
+ base: "ring-4 ring-brand-600/[.15] border-brand-500 hover:border-brand-500",
6
6
  },
7
7
  },
8
- buttonWrapper: "flex h-full rounded-lg focus-within:ring-4 focus-within:ring-gray-600/[.15] max-md:justify-between",
8
+ buttonWrapper: "flex h-full rounded-lg focus-within:ring-4 focus-within:ring-brand-600/[.15] max-md:justify-between",
9
9
  button: `
10
10
  shrink-0 grow rounded-none border-0 bg-zinc-100 py-2 text-base font-medium text-gray-900 shadow-none
11
- hover:bg-zinc-200 hover:ring-gray-600/[.15] focus:border-0 focus:bg-zinc-200 focus:ring-0 focus:ring-gray-600/[.15]
12
- active:bg-zinc-200 disabled:cursor-not-allowed
11
+ hover:bg-zinc-200 hover:ring-brand-600/[.15] focus:border-0 focus:bg-zinc-200 focus:ring-0 focus:ring-brand-600/[.15]
12
+ active:bg-zinc-200 disabled:cursor-not-allowed
13
13
  `,
14
- buttonActive: "border-0 hover:bg-zinc-200 ring-0 ring-gray-600/[.15] bg-zinc-200",
15
- buttonWrapperActive: "ring-4 ring-gray-600/[.15]",
14
+ buttonActive: "border-0 hover:bg-zinc-200 ring-0 ring-brand-600/[.15] bg-zinc-200",
15
+ buttonWrapperActive: "ring-4 ring-brand-600/[.15]",
16
16
  shiftRangeButton: `
17
17
  focus:bg-bg-zinc-200 flex items-center border-0 bg-zinc-100 py-[0.71875rem] shadow-none
18
- hover:bg-zinc-200 hover:ring-gray-600/[.15] focus:border-0 focus:ring-0 focus:ring-gray-600/[.15] active:bg-zinc-200
18
+ hover:bg-zinc-200 hover:ring-brand-600/[.15] focus:border-0 focus:ring-0 focus:ring-brand-600/[.15] active:bg-zinc-200
19
19
  disabled:cursor-not-allowed last:rounded-l-none last:rounded-r-lg first:rounded-l-lg first:rounded-r-none
20
20
  `,
21
- menu: "absolute z-40 mt-2 w-80 overflow-hidden rounded-lg border border-gray-300 bg-white p-2 shadow focus:outline-none",
21
+ menu: "absolute z-40 mt-2 w-80 overflow-hidden rounded-lg border border-brand-300 bg-white p-2 shadow focus:outline-none",
22
22
  menuTransition: {
23
23
  enterFromClass: "opacity-0 scale-95",
24
24
  enterActiveClass: "transition transform ease-out duration-100",
@@ -30,8 +30,8 @@ export default /*tw*/ {
30
30
  periodsRow: "mb-1 flex min-w-64 gap-1",
31
31
  periodButton: `
32
32
  flex h-[3.125rem] w-full cursor-pointer flex-col items-center justify-center rounded-lg bg-zinc-100
33
- px-1.5 py-2.5 text-center text-xs font-medium text-gray-900 hover:bg-gray-200
34
- [&_span]:block [&_span]:font-normal [&_span]:text-gray-500
33
+ px-1.5 py-2.5 text-center text-xs font-medium text-brand-900 hover:bg-brand-200
34
+ [&_span]:block [&_span]:font-normal [&_span]:text-brand-500
35
35
  `,
36
36
  periodButtonActive: "bg-zinc-200",
37
37
  rangeSwitchWrapper: "mb-2.5 mt-4 flex items-center justify-between py-2",
@@ -46,7 +46,7 @@ export default /*tw*/ {
46
46
  periodDateYearList: "grid grid-cols-3 grid-rows-1 gap-0.5",
47
47
  periodDateQuarterList: "",
48
48
  periodDate: `
49
- cursor-pointer block w-full rounded-lg py-3 text-center text-sm font-medium text-gray-900 hover:rounded-lg hover:bg-gray-50
49
+ cursor-pointer block w-full rounded-lg py-3 text-center text-sm font-medium text-gray-900 hover:rounded-lg hover:bg-brand-50
50
50
  disabled:opacity-50 disabled:cursor-not-allowed
51
51
  `,
52
52
  periodDateActive: "bg-zinc-100",
@@ -58,7 +58,7 @@ export default /*tw*/ {
58
58
  description: "hidden",
59
59
  },
60
60
  input: {
61
- base: "text-sm border-gray-100 px-4 py-2.5",
61
+ base: "text-sm border-brand-100 px-4 py-2.5",
62
62
  variants: {
63
63
  size: {
64
64
  md: "pt-2.5 pb-2.5",
@@ -72,7 +72,7 @@ export default /*tw*/ {
72
72
  dayViewWrapper: "p-0 w-full",
73
73
  monthViewWrapper: "p-0 w-full",
74
74
  yearViewWrapper: "p-0 w-full",
75
- dayViewSwitchLabel: "font-medium text-gray-900",
75
+ dayViewSwitchLabel: "font-medium text-brand-900",
76
76
  nextPrevButton: "p-0 py-2 hover:bg-transparent",
77
77
  navigation: "px-0 w-full",
78
78
  nextIcon: {
@@ -88,12 +88,12 @@ export default /*tw*/ {
88
88
  },
89
89
  },
90
90
  day: "font-medium w-full h-10 text-sm mb-0.5",
91
- currentDay: "text-white bg-gray-900 hover:bg-gray-900 hover:text-white",
91
+ currentDay: "text-white bg-brand-900 hover:bg-brand-900 hover:text-white",
92
92
  weekDay: "text-sm size-10",
93
93
  month: "font-medium",
94
- selectedMonth: "bg-zinc-100 text-gray-900 hover:text-white",
94
+ selectedMonth: "bg-zinc-100 text-brand-900 hover:text-white",
95
95
  year: "font-medium",
96
- selectedYear: "bg-zinc-100 text-gray-900 hover:text-white",
96
+ selectedYear: "bg-zinc-100 text-brand-900 hover:text-white",
97
97
  },
98
98
  i18n: {
99
99
  lastThirtyDays: "Last 30 days <span> and 2 next two weeks </span>",
@@ -10,8 +10,8 @@ export default /*tw*/ {
10
10
  base: `
11
11
  rounded-lg border border-solid border-gray-300 bg-white !opacity-100 relative flex
12
12
  transition duration-100 ease-in-out
13
- hover:border-gray-400 hover:focus-within:border-gray-500
14
- focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-600/[.15]
13
+ hover:border-gray-400 hover:focus-within:border-brand-500
14
+ focus-within:border-brand-500 focus-within:ring-4 focus-within:ring-brand-600/[.15]
15
15
  `,
16
16
  variants: {
17
17
  disabled: {
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export function useAttrs(props) {
8
- const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
8
+ const { config, getAttrs } = useUI(defaultConfig, () => props.config);
9
9
  const { radio } = config.value;
10
10
 
11
11
  const cvaRadio = cva({
@@ -14,7 +14,7 @@ export function useAttrs(props) {
14
14
  compoundVariants: radio.compoundVariants,
15
15
  });
16
16
 
17
- const radioClasses = computed(() => setColor(cvaRadio({ color: props.color }), props.color));
17
+ const radioClasses = computed(() => cvaRadio({ color: props.color }));
18
18
 
19
19
  const wrapperAttrsRaw = getAttrs("wrapper");
20
20
  const itemsAttrs = getAttrs("items");
@@ -4,8 +4,8 @@ export default /*tw*/ {
4
4
  base: `
5
5
  pb-2 pt-2 flex flex-row-reverse justify-between w-full min-h-full box-border relative
6
6
  rounded-lg border border-gray-300 bg-white
7
- hover:border-gray-400 hover:transition hover:duration-100 hover:ease-in-out hover:focus-within:border-gray-500
8
- focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-600/[.15] focus-within:outline-none
7
+ hover:border-gray-400 hover:transition hover:duration-100 hover:ease-in-out hover:focus-within:border-brand-500
8
+ focus-within:border-brand-500 focus-within:ring-4 focus-within:ring-brand-600/[.15] focus-within:outline-none
9
9
  `,
10
10
  variants: {
11
11
  error: {
@@ -21,7 +21,7 @@ export default /*tw*/ {
21
21
  true: "cursor-not-allowed border-none focus-within:ring-0 bg-gray-100",
22
22
  },
23
23
  readonly: {
24
- true: "ring-0 border-gray-300 focus-within:ring-0 focus-within:border-gray-300",
24
+ true: "ring-0 border-gray-300 focus-within:ring-0 focus-within:border-brand-300",
25
25
  },
26
26
  size: {
27
27
  sm: "pb-2 pr-4 pt-6",
@@ -0,0 +1,19 @@
1
+ import { readonly, ref } from "vue";
2
+
3
+ const isRenderingPage = ref(true);
4
+
5
+ function setRenderingStarted() {
6
+ isRenderingPage.value = true;
7
+ }
8
+
9
+ function setRenderingFinished() {
10
+ isRenderingPage.value = false;
11
+ }
12
+
13
+ export default function useLoaderRendering() {
14
+ return {
15
+ isRenderingPage: readonly(isRenderingPage),
16
+ setRenderingStarted,
17
+ setRenderingFinished,
18
+ };
19
+ }
@@ -9,27 +9,26 @@
9
9
  </transition>
10
10
  </template>
11
11
 
12
- <script>
13
- import { mapState } from "vuex";
12
+ <script setup>
13
+ import { computed } from "vue";
14
14
 
15
- export default {
16
- name: "ULoaderRendering",
15
+ import useLoaderRendering from "./composables/useLoaderRendering";
17
16
 
18
- props: {
19
- loading: {
20
- type: Boolean,
21
- default: false,
22
- },
17
+ /* Should be a string for correct web-types gen */
18
+ defineOptions({ name: "ULoaderRendering", inheritAttrs: false });
19
+
20
+ const props = defineProps({
21
+ loading: {
22
+ type: Boolean,
23
+ default: false,
23
24
  },
25
+ });
24
26
 
25
- computed: {
26
- ...mapState("loader", ["isRenderingPage"]),
27
+ const { isRenderingPage } = useLoaderRendering();
27
28
 
28
- showLoader() {
29
- return this.loading || this.isRenderingPage;
30
- },
31
- },
32
- };
29
+ const showLoader = computed(() => {
30
+ return props.loading || isRenderingPage.value;
31
+ });
33
32
  </script>
34
33
 
35
34
  <style lang="postcss" scoped>
@@ -5,8 +5,8 @@ export default /*tw*/ {
5
5
  navigationButton: "size-full rounded font-normal disabled:hover:bg-transparent",
6
6
  pageButton: "size-full rounded font-normal disabled:hover:bg-transparent",
7
7
  pageButtonActive: `
8
- rounded !bg-gray-900/15
9
- hover:!text-gray-900 !hover:bg-gray-900/15 disabled:hover:bg-gray-900/15
8
+ rounded !bg-brand-900/15
9
+ hover:!text-brand-900 !hover:bg-brand-900/15 disabled:hover:bg-brand-900/15
10
10
  focus:outline-none
11
11
  `,
12
12
  defaultVariants: {
@@ -0,0 +1,84 @@
1
+ import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source, Markdown } from "@storybook/blocks";
2
+ import { getSource } from "../service.storybook";
3
+
4
+ import * as stories from "./index.stories";
5
+ import defaultConfig from "./configs/default.config?raw"
6
+
7
+ <Meta of={stories} />
8
+ <Title of={stories} />
9
+ <Subtitle of={stories} />
10
+ <Description of={stories} />
11
+ <Primary of={stories} />
12
+ <Controls of={stories.Default} />
13
+ <Stories of={stories} />
14
+
15
+ ## **Default config**
16
+ <Source code={getSource(defaultConfig)} language="jsx" dark />
17
+
18
+ ## Trigger notifications
19
+ You can trigger notification using *notify* method. Use *notifySuccess, notifyWarning, notifyError* methods to trigger notification of specific type.
20
+
21
+ <Source code={`
22
+ import {
23
+ notify,
24
+ notifySuccess,
25
+ notifyWarning,
26
+ notifyError,
27
+ } from "vueless";
28
+
29
+ notify({
30
+ type: "success" // success, warning, error
31
+ title: "" // Some label
32
+ text: "" // Some text content
33
+ duration: 1000 // Duration in milliseconds
34
+ delayDuplicates: false // Delay notifications with same text
35
+ });
36
+
37
+ const durationInMilliseconds = 1000;
38
+
39
+ notifySuccess("Some success text", durationInMilliseconds);
40
+ notifyWarning("Some warning text", durationInMilliseconds);
41
+ notifyError("Some error text", durationInMilliseconds);
42
+ `} language="jsx" dark />
43
+
44
+ ## Clear active notifications
45
+ Use *clearAllNotifications* method to clear all active notifications.
46
+
47
+ <Source code={`
48
+ import { clearAllNotifications, notifySuccess } from "vueless";
49
+
50
+ const durationInMilliseconds = 1000;
51
+ notifySuccess("Some success text", durationInMilliseconds);
52
+
53
+ clearAllNotifications();
54
+ `} language="jsx" dark />
55
+
56
+ ## Trigger notifications
57
+ You can create delayed notification which you can trigger any time later.
58
+
59
+ <Source code={`
60
+ import { setDelayedNotify, getDelayedNotify } from "vueless";
61
+
62
+ setDelayedNotify({
63
+ type: "success" // success, warning, error
64
+ title: "" // Some label
65
+ text: "" // Some text content
66
+ duration: 1000 // Duration in milliseconds
67
+ delayDuplicates: false // Delay notifications with same text
68
+ });
69
+
70
+ setTimeout(getDelayedNotify, 10_000);
71
+ `} language="jsx" dark />
72
+
73
+ ## Place notification relatively to navigation elements
74
+ Provide *positionClasses* key for UNotify config to take navigation elements offset into account.
75
+ By default, it will be looking for UNotifyPage and UNotifyAside classes.
76
+
77
+ <Source code={`
78
+ const notifyConfig = {
79
+ positionClasses: {
80
+ page: "UNotifyPage",
81
+ aside: "UNotifyAside",
82
+ },
83
+ }
84
+ `} language="jsx" dark />