@quidgest/ui 0.14.2 → 0.14.4

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/ui.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quidgest UI v0.14.2
2
+ * Quidgest UI v0.14.4
3
3
  * (c) 2024 Quidgest - Consultores de Gestão, S.A.
4
4
  * Released under the MIT License.
5
5
  */
@@ -497,6 +497,103 @@ $button-text-on-plain: var(--q-theme-on-background);
497
497
  }
498
498
  }
499
499
  }
500
+ .q-checkbox {
501
+ $this: &;
502
+ --box-size: 1.15rem;
503
+ --icon-color: var(--q-theme-on-primary);
504
+ --icon-opacity: 0;
505
+ display: flex;
506
+ align-items: center;
507
+ gap: 0.5rem;
508
+ width: fit-content;
509
+ color: var(--q-theme-neutral-dark);
510
+ cursor: pointer;
511
+ &__input {
512
+ display: flex;
513
+ align-items: center;
514
+ justify-content: center;
515
+ width: var(--box-size);
516
+ height: var(--box-size);
517
+ border: 1px solid $border;
518
+ border-radius: $border-radius;
519
+ padding: 0;
520
+ transition:
521
+ background 0.2s,
522
+ border-color 0.2s,
523
+ box-shadow 0.2s;
524
+ background-color: transparent;
525
+ flex-shrink: 0;
526
+ cursor: inherit;
527
+ &:hover:not(:disabled) {
528
+ border-color: var(--active-color);
529
+ }
530
+ &:focus:not(:disabled) {
531
+ outline: 0;
532
+ }
533
+ &:focus-visible:not(:disabled) {
534
+ outline: $outline;
535
+ }
536
+ &-icon.q-icon {
537
+ color: var(--icon-color);
538
+ pointer-events: none;
539
+ user-select: none;
540
+ transition: transform 0.2s ease;
541
+ opacity: var(--icon-opacity);
542
+ }
543
+ }
544
+ &__native-input {
545
+ transform: translateX(-100%);
546
+ position: absolute;
547
+ pointer-events: none;
548
+ opacity: 0;
549
+ margin: 0;
550
+ }
551
+
552
+ &--small {
553
+ --box-size: 0.95rem;
554
+ }
555
+ &--large {
556
+ --box-size: 1.3rem;
557
+ }
558
+
559
+ @mixin color-variant($color) {
560
+ &--#{$color} {
561
+ --active-color: var(--q-theme-#{$color});
562
+ --icon-color: var(--q-theme-on-#{$color});
563
+ }
564
+ }
565
+ @each $color in (primary, info, success, warning, danger) {
566
+ @include color-variant($color);
567
+ }
568
+
569
+ &--checked,
570
+ &--indeterminate {
571
+ --icon-opacity: 1;
572
+ #{$this}__input {
573
+ background-color: var(--active-color);
574
+ border-color: var(--active-color);
575
+ }
576
+ }
577
+ &--disabled {
578
+ opacity: 0.6;
579
+ cursor: not-allowed;
580
+ }
581
+ &--readonly {
582
+ --active-color: var(--q-theme-neutral-light);
583
+ cursor: default;
584
+ &:not(#{$this}--checked):not(#{$this}--indeterminate) {
585
+ #{$this}__input {
586
+ background-color: rgb(var(--q-theme-neutral-light-rgb) / 0.25);
587
+ }
588
+ }
589
+ }
590
+ }
591
+ @media (prefers-reduced-motion: reduce) {
592
+ .q-checkbox__input,
593
+ .q-checkbox__input .q-icon {
594
+ transition: none;
595
+ }
596
+ }
500
597
  .q-combobox {
501
598
  $this: &;
502
599
  &:not(#{$this}--disabled) {
@@ -0,0 +1,20 @@
1
+ import { QCheckboxProps, DEFAULT_ICONS } from './types';
2
+ declare let __VLS_typeProps: QCheckboxProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: boolean;
5
+ } & typeof __VLS_typeProps;
6
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update:modelValue": (modelValue: boolean) => any;
8
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
9
+ "onUpdate:modelValue"?: ((modelValue: boolean) => any) | undefined;
10
+ }>, {
11
+ size: "regular" | "small" | "large";
12
+ class: string | unknown[];
13
+ label: string;
14
+ color: string;
15
+ icons: typeof DEFAULT_ICONS;
16
+ id: string;
17
+ labelPlacement: string;
18
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
+ export default _default;
20
+ //# sourceMappingURL=QCheckbox.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/QCheckbox.vue"],"names":[],"mappings":"AAyFC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAIxC,QAAA,IAAI,eAAe,EAAG,cAAc,CAAC;AAmDrC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,eAAe,CAAC;;;;;;;;;;;;;;AA2E3B,wBAQG"}
@@ -0,0 +1,105 @@
1
+ import { defineComponent as k, mergeModels as f, useModel as y, computed as v, openBlock as l, createElementBlock as t, Fragment as x, createElementVNode as a, normalizeClass as _, toDisplayString as s, createCommentVNode as n, unref as u, withModifiers as d, withKeys as m, createBlock as g, mergeProps as q } from "vue";
2
+ import { QIcon as B } from "../QIcon/index.js";
3
+ import { useId as C } from "../../composables/uid.js";
4
+ import { DEFAULT_ICONS as V } from "./types.js";
5
+ const w = { key: 0 }, M = ["id", "aria-checked", "disabled", "onKeydown"], P = { key: 1 }, z = ["checked", "disabled"], D = /* @__PURE__ */ k({
6
+ __name: "QCheckbox",
7
+ props: /* @__PURE__ */ f({
8
+ id: { default: void 0 },
9
+ label: { default: "" },
10
+ labelPlacement: { default: "right" },
11
+ disabled: { type: Boolean },
12
+ readonly: { type: Boolean },
13
+ indeterminate: { type: Boolean },
14
+ color: { default: "primary" },
15
+ size: { default: "regular" },
16
+ class: { default: void 0 },
17
+ icons: { default: () => V }
18
+ }, {
19
+ modelValue: { type: Boolean },
20
+ modelModifiers: {}
21
+ }),
22
+ emits: ["update:modelValue"],
23
+ setup(i) {
24
+ const e = i, o = y(i, "modelValue"), b = C(e.id), p = v(() => [
25
+ "q-checkbox",
26
+ `q-checkbox--${e.size}`,
27
+ `q-checkbox--${e.color}`,
28
+ {
29
+ "q-checkbox--readonly": e.readonly,
30
+ "q-checkbox--disabled": e.disabled,
31
+ "q-checkbox--checked": o.value,
32
+ "q-checkbox--indeterminate": e.indeterminate
33
+ },
34
+ e.class
35
+ ]);
36
+ function c() {
37
+ !e.disabled && !e.readonly && (o.value = !o.value);
38
+ }
39
+ return (h, r) => (l(), t(
40
+ x,
41
+ null,
42
+ [
43
+ a(
44
+ "label",
45
+ {
46
+ class: _(p.value)
47
+ },
48
+ [
49
+ e.labelPlacement !== "right" ? (l(), t(
50
+ "span",
51
+ w,
52
+ s(e.label),
53
+ 1
54
+ /* TEXT */
55
+ )) : n("v-if", !0),
56
+ a("button", {
57
+ id: u(b),
58
+ role: "checkbox",
59
+ type: "button",
60
+ "aria-checked": e.indeterminate ? "mixed" : o.value,
61
+ disabled: e.disabled || e.readonly,
62
+ class: "q-checkbox__input",
63
+ onClick: d(c, ["prevent"]),
64
+ onKeydown: [
65
+ m(d(c, ["prevent"]), ["space"]),
66
+ r[0] || (r[0] = m(d(() => {
67
+ }, ["prevent"]), ["enter"]))
68
+ ]
69
+ }, [
70
+ o.value || h.indeterminate ? (l(), g(
71
+ u(B),
72
+ q({ key: 0 }, o.value ? e.icons.checked : e.icons.indeterminate, { class: "q-checkbox__input-icon" }),
73
+ null,
74
+ 16
75
+ /* FULL_PROPS */
76
+ )) : n("v-if", !0)
77
+ ], 40, M),
78
+ e.labelPlacement === "right" ? (l(), t(
79
+ "span",
80
+ P,
81
+ s(e.label),
82
+ 1
83
+ /* TEXT */
84
+ )) : n("v-if", !0)
85
+ ],
86
+ 2
87
+ /* CLASS */
88
+ ),
89
+ a("input", {
90
+ type: "checkbox",
91
+ tabindex: "-1",
92
+ "aria-hidden": "true",
93
+ class: "q-checkbox__native-input",
94
+ checked: !!o.value,
95
+ disabled: e.disabled || e.readonly
96
+ }, null, 8, z)
97
+ ],
98
+ 64
99
+ /* STABLE_FRAGMENT */
100
+ ));
101
+ }
102
+ });
103
+ export {
104
+ D as default
105
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./QCheckbox.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { default as _QCheckbox } from './QCheckbox';
2
+ declare const QCheckbox: typeof _QCheckbox;
3
+ export { QCheckbox };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/index.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,iBAAiB,CAAA;AAKxC,QAAA,MAAM,SAAS,EAAkC,OAAO,UAAU,CAAA;AAGlE,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import o from "./QCheckbox.vue.js";
2
+ import { setupPropsProxy as r } from "../../utils/setupPropsProxy.js";
3
+ const t = r(o);
4
+ export {
5
+ t as QCheckbox
6
+ };
@@ -0,0 +1,47 @@
1
+ import { Icon } from '../QIcon';
2
+ export type QCheckboxProps = {
3
+ /**
4
+ * The field unique identifier.
5
+ */
6
+ id?: string;
7
+ /**
8
+ * The text content of the checkbox.
9
+ */
10
+ label?: string;
11
+ /**
12
+ * The placement of the label shown.
13
+ */
14
+ labelPlacement?: string;
15
+ /**
16
+ * If true, the checkbox is disabled and cannot be interacted with.
17
+ */
18
+ disabled?: boolean;
19
+ /**
20
+ * If set to true, the checkbox is read-only.
21
+ */
22
+ readonly?: boolean;
23
+ /**
24
+ * If set to true, the checkbox appears in an indeterminate state
25
+ */
26
+ indeterminate?: boolean;
27
+ /**
28
+ * Applies specified color to the control
29
+ */
30
+ color?: string;
31
+ /**
32
+ * The size of the checkbox, either 'regular', 'small' or 'large.
33
+ */
34
+ size?: 'regular' | 'small' | 'large';
35
+ /**
36
+ * Custom set of classes to apply to the component.
37
+ */
38
+ class?: string | unknown[];
39
+ /**
40
+ * Custom icon configurations.
41
+ */
42
+ icons?: typeof DEFAULT_ICONS;
43
+ };
44
+ type IconKeys = 'checked' | 'indeterminate';
45
+ export declare const DEFAULT_ICONS: Record<IconKeys, Icon>;
46
+ export {};
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QCheckbox/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAE9C,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAED,KAAK,QAAQ,GAAG,SAAS,GAAG,eAAe,CAAA;AAG3C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAOhD,CAAA"}
@@ -0,0 +1,11 @@
1
+ const c = {
2
+ checked: {
3
+ icon: "check"
4
+ },
5
+ indeterminate: {
6
+ icon: "minus"
7
+ }
8
+ };
9
+ export {
10
+ c as DEFAULT_ICONS
11
+ };
@@ -495,12 +495,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
495
495
  class: string | unknown[];
496
496
  label: string;
497
497
  icons: typeof DEFAULT_ICONS;
498
+ id: string;
498
499
  groups: (import('../QList').QListItemGroupProps & {
499
500
  id: string;
500
501
  })[];
501
502
  itemValue: string;
502
503
  itemLabel: string;
503
- id: string;
504
504
  placeholder: string;
505
505
  selectionMode: "manual" | "automatic";
506
506
  filterMode: "builtin" | "manual";
@@ -204,12 +204,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
204
204
  class: string | unknown[];
205
205
  label: string;
206
206
  icons: typeof DEFAULT_ICONS;
207
+ id: string;
207
208
  groups: (import('../QList').QListItemGroupProps & {
208
209
  id: string;
209
210
  })[];
210
211
  itemValue: string;
211
212
  itemLabel: string;
212
- id: string;
213
213
  emptyValue: Primitive;
214
214
  texts: typeof DEFAULT_TEXTS;
215
215
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -2,6 +2,7 @@ export * from './QBadge';
2
2
  export * from './QButton';
3
3
  export * from './QButtonGroup';
4
4
  export * from './QButtonToggle';
5
+ export * from './QCheckbox';
5
6
  export * from './QCombobox';
6
7
  export * from './QDialog';
7
8
  export * from './QField';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
@@ -2,49 +2,51 @@ import { QBadge as e } from "./QBadge/index.js";
2
2
  import { QButton as p } from "./QButton/index.js";
3
3
  import { QButtonGroup as m } from "./QButtonGroup/index.js";
4
4
  import { QButtonToggle as f } from "./QButtonToggle/index.js";
5
- import { QCombobox as n } from "./QCombobox/index.js";
6
- import { QDialog as l } from "./QDialog/index.js";
7
- import { QField as I } from "./QField/index.js";
8
- import { QIcon as d, QIconFont as s, QIconImg as P, QIconSvg as g } from "./QIcon/index.js";
9
- import { QInputGroup as y } from "./QInputGroup/index.js";
10
- import { QLineLoader as B } from "./QLineLoader/index.js";
11
- import { QList as S, QListItem as T, QListItemGroup as F } from "./QList/index.js";
12
- import { QOverlay as h } from "./QOverlay/index.js";
13
- import { QPopover as w } from "./QPopover/index.js";
14
- import { QPropertyList as D, QPropertyListGroup as O, QPropertyListPanel as R, QPropertyListRow as j } from "./QPropertyList/index.js";
15
- import { QSelect as z } from "./QSelect/index.js";
16
- import { QSkeletonLoader as E } from "./QSkeletonLoader/index.js";
17
- import { QSpinnerLoader as J } from "./QSpinnerLoader/index.js";
18
- import { QTextField as M } from "./QTextField/index.js";
19
- import { QThemeProvider as U } from "./QThemeProvider/index.js";
20
- import { QTooltip as W } from "./QTooltip/index.js";
5
+ import { QCheckbox as n } from "./QCheckbox/index.js";
6
+ import { QCombobox as l } from "./QCombobox/index.js";
7
+ import { QDialog as I } from "./QDialog/index.js";
8
+ import { QField as d } from "./QField/index.js";
9
+ import { QIcon as P, QIconFont as c, QIconImg as g, QIconSvg as y } from "./QIcon/index.js";
10
+ import { QInputGroup as B } from "./QInputGroup/index.js";
11
+ import { QLineLoader as S } from "./QLineLoader/index.js";
12
+ import { QList as b, QListItem as F, QListItemGroup as h } from "./QList/index.js";
13
+ import { QOverlay as C } from "./QOverlay/index.js";
14
+ import { QPopover as D } from "./QPopover/index.js";
15
+ import { QPropertyList as R, QPropertyListGroup as j, QPropertyListPanel as q, QPropertyListRow as z } from "./QPropertyList/index.js";
16
+ import { QSelect as E } from "./QSelect/index.js";
17
+ import { QSkeletonLoader as J } from "./QSkeletonLoader/index.js";
18
+ import { QSpinnerLoader as M } from "./QSpinnerLoader/index.js";
19
+ import { QTextField as U } from "./QTextField/index.js";
20
+ import { QThemeProvider as W } from "./QThemeProvider/index.js";
21
+ import { QTooltip as Y } from "./QTooltip/index.js";
21
22
  export {
22
23
  e as QBadge,
23
24
  p as QButton,
24
25
  m as QButtonGroup,
25
26
  f as QButtonToggle,
26
- n as QCombobox,
27
- l as QDialog,
28
- I as QField,
29
- d as QIcon,
30
- s as QIconFont,
31
- P as QIconImg,
32
- g as QIconSvg,
33
- y as QInputGroup,
34
- B as QLineLoader,
35
- S as QList,
36
- T as QListItem,
37
- F as QListItemGroup,
38
- h as QOverlay,
39
- w as QPopover,
40
- D as QPropertyList,
41
- O as QPropertyListGroup,
42
- R as QPropertyListPanel,
43
- j as QPropertyListRow,
44
- z as QSelect,
45
- E as QSkeletonLoader,
46
- J as QSpinnerLoader,
47
- M as QTextField,
48
- U as QThemeProvider,
49
- W as QTooltip
27
+ n as QCheckbox,
28
+ l as QCombobox,
29
+ I as QDialog,
30
+ d as QField,
31
+ P as QIcon,
32
+ c as QIconFont,
33
+ g as QIconImg,
34
+ y as QIconSvg,
35
+ B as QInputGroup,
36
+ S as QLineLoader,
37
+ b as QList,
38
+ F as QListItem,
39
+ h as QListItemGroup,
40
+ C as QOverlay,
41
+ D as QPopover,
42
+ R as QPropertyList,
43
+ j as QPropertyListGroup,
44
+ q as QPropertyListPanel,
45
+ z as QPropertyListRow,
46
+ E as QSelect,
47
+ J as QSkeletonLoader,
48
+ M as QSpinnerLoader,
49
+ U as QTextField,
50
+ W as QThemeProvider,
51
+ Y as QTooltip
50
52
  };
package/esm/index.d.ts CHANGED
@@ -11,6 +11,7 @@ declare module '@vue/runtime-core' {
11
11
  QButton: typeof import('@quidgest/ui/components')['QButton']
12
12
  QButtonGroup: typeof import('@quidgest/ui/components')['QButtonGroup']
13
13
  QButtonToggle: typeof import('@quidgest/ui/components')['QButtonToggle']
14
+ QCheckbox: typeof import('@quidgest/ui/components')['QCheckbox']
14
15
  QCombobox: typeof import('@quidgest/ui/components')['QCombobox']
15
16
  QDialog: typeof import('@quidgest/ui/components')['QDialog']
16
17
  QField: typeof import('@quidgest/ui/components')['QField']
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/ui",
3
3
  "description": "Quidgest's UI framework",
4
- "version": "0.14.2",
4
+ "version": "0.14.4",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",