@dskripchenko/ui 1.4.0 → 1.5.1

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/README.md CHANGED
@@ -81,7 +81,7 @@ Switch theme by attribute on `<html>`:
81
81
 
82
82
  A short selection — the full catalog is in [Storybook](https://dskripchenko.github.io/ui/).
83
83
 
84
- **Forms & input:** Button, Input, Textarea, NumberInput, Checkbox, Radio, Switch, Label, FormField, Select, Combobox, TagsInput, DatePicker, DateRangePicker, TimePicker, ColorPicker, Slider, Rating, FileUpload, Mention, TreeSelect, Cascader
84
+ **Forms & input:** Button, Input, Textarea, NumberInput, Checkbox, CheckboxGroup, Radio, Switch, Label, FormField, Select, Combobox, TagsInput, DatePicker, DateRangePicker, TimePicker, ColorPicker, Slider, Rating, FileUpload, Mention, TreeSelect, Cascader
85
85
 
86
86
  **Feedback:** Spinner, Skeleton, Badge, Alert, Progress, Toast, Tour
87
87
 
@@ -21,8 +21,8 @@ declare const __VLS_component: import('vue').DefineComponent<UidBackTopProps, {}
21
21
  onClick?: (() => any) | undefined;
22
22
  }>, {
23
23
  target: string | HTMLElement | (() => HTMLElement | null);
24
- visibleAfter: number;
25
24
  smooth: boolean;
25
+ visibleAfter: number;
26
26
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
28
  export default _default;
@@ -1,5 +1,12 @@
1
1
  export interface UidBreadcrumbItemProps {
2
2
  href?: string;
3
+ /** Router location. Rendered through the app's globally registered RouterLink; without one it falls back to `href` (or a string `to`). */
4
+ to?: string | Record<string, unknown>;
5
+ /**
6
+ * Marks the crumb as the current page (`aria-current="page"`, current styling, no link).
7
+ * When omitted, only the last crumb of the list is treated as current.
8
+ * Set `false` to keep the last crumb a regular one.
9
+ */
3
10
  current?: boolean;
4
11
  }
5
12
  declare function __VLS_template(): {
@@ -9,14 +16,23 @@ declare function __VLS_template(): {
9
16
  }> & {
10
17
  default(): unknown;
11
18
  };
12
- refs: {};
19
+ refs: {
20
+ itemRef: HTMLLIElement;
21
+ };
13
22
  rootEl: HTMLLIElement;
14
23
  };
15
24
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: import('vue').DefineComponent<UidBreadcrumbItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UidBreadcrumbItemProps> & Readonly<{}>, {
25
+ declare const __VLS_component: import('vue').DefineComponent<UidBreadcrumbItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
26
+ click: (event: MouseEvent) => any;
27
+ }, string, import('vue').PublicProps, Readonly<UidBreadcrumbItemProps> & Readonly<{
28
+ onClick?: ((event: MouseEvent) => any) | undefined;
29
+ }>, {
17
30
  href: string;
31
+ to: string | Record<string, unknown>;
18
32
  current: boolean;
19
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLIElement>;
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
34
+ itemRef: HTMLLIElement;
35
+ }, HTMLLIElement>;
20
36
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
37
  export default _default;
22
38
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -0,0 +1,6 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ export interface BreadcrumbContext {
3
+ /** Bumped after every UidBreadcrumb update so items can re-check whether they are last. */
4
+ tick: Ref<number>;
5
+ }
6
+ export declare const BREADCRUMB_KEY: InjectionKey<BreadcrumbContext>;
@@ -0,0 +1,36 @@
1
+ export type CheckboxGroupValue = string | number;
2
+ export interface CheckboxGroupOption {
3
+ value: CheckboxGroupValue;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface UidCheckboxGroupProps {
8
+ options: CheckboxGroupOption[];
9
+ name?: string;
10
+ label?: string;
11
+ hint?: string;
12
+ error?: string;
13
+ required?: boolean;
14
+ disabled?: boolean;
15
+ direction?: 'horizontal' | 'vertical';
16
+ }
17
+ type __VLS_Props = UidCheckboxGroupProps;
18
+ type __VLS_PublicProps = {
19
+ modelValue?: CheckboxGroupValue[];
20
+ } & __VLS_Props;
21
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ "update:modelValue": (value: CheckboxGroupValue[]) => any;
23
+ change: (value: CheckboxGroupValue[]) => any;
24
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
25
+ "onUpdate:modelValue"?: ((value: CheckboxGroupValue[]) => any) | undefined;
26
+ onChange?: ((value: CheckboxGroupValue[]) => any) | undefined;
27
+ }>, {
28
+ label: string;
29
+ required: boolean;
30
+ disabled: boolean;
31
+ hint: string;
32
+ error: string;
33
+ name: string;
34
+ direction: "horizontal" | "vertical";
35
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
36
+ export default _default;
@@ -1,2 +1,4 @@
1
1
  export { default as UidCheckbox } from './UidCheckbox.vue';
2
2
  export type { UidCheckboxProps } from './UidCheckbox.vue';
3
+ export { default as UidCheckboxGroup } from './UidCheckboxGroup.vue';
4
+ export type { UidCheckboxGroupProps, CheckboxGroupOption, CheckboxGroupValue, } from './UidCheckboxGroup.vue';
@@ -23,9 +23,9 @@ declare const __VLS_component: import('vue').DefineComponent<UidCodeProps, {}, {
23
23
  code: string;
24
24
  inline: boolean;
25
25
  copy: boolean;
26
+ wrap: boolean;
26
27
  language: string;
27
28
  lineNumbers: boolean;
28
- wrap: boolean;
29
29
  maxHeight: string;
30
30
  highlight: boolean;
31
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -20,9 +20,9 @@ declare function __VLS_template(): {
20
20
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
21
  declare const __VLS_component: import('vue').DefineComponent<UidGridProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UidGridProps> & Readonly<{}>, {
22
22
  as: string;
23
+ justify: "start" | "center" | "end" | "stretch";
23
24
  gap: string;
24
25
  align: "start" | "center" | "end" | "stretch";
25
- justify: "start" | "center" | "end" | "stretch";
26
26
  cols: number | string;
27
27
  rowGap: string;
28
28
  colGap: string;
@@ -1,5 +1,6 @@
1
1
  import { Component } from 'vue';
2
2
  export interface UidMenuItemProps {
3
+ /** Icon component (e.g. from lucide-vue-next) rendered before the label. */
3
4
  icon?: Component;
4
5
  disabled?: boolean;
5
6
  variant?: 'default' | 'danger';
@@ -4,6 +4,7 @@ export interface SelectOption {
4
4
  disabled?: boolean;
5
5
  group?: string;
6
6
  }
7
+ export type SelectValue = string | number;
7
8
  export interface UidSelectProps {
8
9
  options: SelectOption[];
9
10
  placeholder?: string;
@@ -11,22 +12,31 @@ export interface UidSelectProps {
11
12
  searchable?: boolean;
12
13
  clearable?: boolean;
13
14
  size?: 'sm' | 'md' | 'lg';
15
+ /**
16
+ * Multi-value mode: v-model is an array, the selected options are shown as
17
+ * removable chips, and picking an option toggles it without closing the dropdown.
18
+ */
19
+ multiple?: boolean;
20
+ /** Multiple mode: show at most this many chips and collapse the rest into "+N". */
21
+ maxTagCount?: number;
14
22
  }
15
23
  type __VLS_Props = UidSelectProps;
16
24
  type __VLS_PublicProps = {
17
- modelValue?: string | number | null;
25
+ modelValue?: SelectValue | SelectValue[] | null;
18
26
  } & __VLS_Props;
19
27
  declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
20
- "update:modelValue": (value: string | number | null) => any;
21
- change: (value: string | number | null) => any;
28
+ "update:modelValue": (value: SelectValue | SelectValue[] | null) => any;
29
+ change: (value: SelectValue | SelectValue[] | null) => any;
22
30
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
- "onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
24
- onChange?: ((value: string | number | null) => any) | undefined;
31
+ "onUpdate:modelValue"?: ((value: SelectValue | SelectValue[] | null) => any) | undefined;
32
+ onChange?: ((value: SelectValue | SelectValue[] | null) => any) | undefined;
25
33
  }>, {
26
34
  size: "sm" | "md" | "lg";
27
35
  disabled: boolean;
36
+ multiple: boolean;
28
37
  searchable: boolean;
29
38
  clearable: boolean;
39
+ maxTagCount: number;
30
40
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
31
41
  containerRef: HTMLDivElement;
32
42
  triggerRef: HTMLDivElement;
@@ -1,2 +1,2 @@
1
1
  export { default as UidSelect } from './UidSelect.vue';
2
- export type { UidSelectProps, SelectOption } from './UidSelect.vue';
2
+ export type { UidSelectProps, SelectOption, SelectValue } from './UidSelect.vue';
@@ -12,6 +12,13 @@ export interface UidSliderProps {
12
12
  showValue?: boolean;
13
13
  formatValue?: (val: number) => string;
14
14
  marks?: UidSliderMarks;
15
+ /**
16
+ * Accessible name for the slider handle, independent of the visible `label`
17
+ * (e.g. when the visible caption lives elsewhere or is not descriptive enough).
18
+ */
19
+ ariaLabel?: string;
20
+ /** Id(s) of the element(s) that label the slider handle. Takes precedence over `ariaLabel`/`label`. */
21
+ ariaLabelledby?: string;
15
22
  }
16
23
  type __VLS_Props = UidSliderProps;
17
24
  type __VLS_PublicProps = {
@@ -30,5 +37,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
30
37
  step: number;
31
38
  formatValue: (val: number) => string;
32
39
  marks: UidSliderMarks;
40
+ ariaLabel: string;
41
+ ariaLabelledby: string;
33
42
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
34
43
  export default _default;
@@ -23,9 +23,9 @@ declare const __VLS_component: import('vue').DefineComponent<UidStackProps, {},
23
23
  direction: "row" | "column" | "row-reverse" | "column-reverse";
24
24
  as: string;
25
25
  wrap: boolean;
26
+ justify: "start" | "center" | "end" | "between" | "around" | "evenly";
26
27
  gap: string;
27
28
  align: "start" | "center" | "end" | "stretch" | "baseline";
28
- justify: "start" | "center" | "end" | "between" | "around" | "evenly";
29
29
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
31
  export default _default;
@@ -4,6 +4,11 @@ export interface UidTableColumn {
4
4
  sortable?: boolean;
5
5
  align?: 'left' | 'center' | 'right';
6
6
  width?: string;
7
+ /**
8
+ * Pin the column to the left or right edge while the table scrolls horizontally.
9
+ * Put left-fixed columns first and right-fixed columns last.
10
+ */
11
+ fixed?: 'left' | 'right';
7
12
  }
8
13
  export type SortDirection = 'asc' | 'desc' | null;
9
14
  export interface UidTableProps {
@@ -29,7 +34,10 @@ declare function __VLS_template(): {
29
34
  }> & {
30
35
  [key: string]: (row?: Record<string, unknown>) => unknown;
31
36
  };
32
- refs: {};
37
+ refs: {
38
+ scrollRef: HTMLDivElement;
39
+ headRowRef: HTMLTableRowElement;
40
+ };
33
41
  rootEl: HTMLDivElement;
34
42
  };
35
43
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -53,7 +61,10 @@ declare const __VLS_component: import('vue').DefineComponent<UidTableProps, {},
53
61
  selectable: boolean;
54
62
  selection: Set<string | number>;
55
63
  rowKey: string | ((row: Record<string, unknown>) => string | number);
56
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
64
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
65
+ scrollRef: HTMLDivElement;
66
+ headRowRef: HTMLTableRowElement;
67
+ }, HTMLDivElement>;
57
68
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
58
69
  export default _default;
59
70
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -33,11 +33,11 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
33
33
  disabled: boolean;
34
34
  multiple: boolean;
35
35
  clearable: boolean;
36
+ maxTagCount: number;
36
37
  checkable: boolean;
37
38
  checkStrictly: boolean;
38
39
  defaultExpandAll: boolean;
39
40
  showGuides: boolean;
40
- maxTagCount: number;
41
41
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
42
42
  containerRef: HTMLDivElement;
43
43
  triggerRef: HTMLDivElement;
@@ -0,0 +1,18 @@
1
+ import { Component, ComputedRef } from 'vue';
2
+ export type RouterLocation = string | Record<string, unknown>;
3
+ export interface UseRouterLinkSource {
4
+ href?: string;
5
+ to?: RouterLocation;
6
+ }
7
+ export interface UseRouterLink {
8
+ /** The app's globally registered `RouterLink`, or `null` when `to` is unset or vue-router is not installed. */
9
+ routerLink: ComputedRef<Component | null>;
10
+ /** Plain `href` for the `<a>` fallback: explicit `href`, else a string `to`. */
11
+ fallbackHref: ComputedRef<string | undefined>;
12
+ }
13
+ /**
14
+ * Resolves `to` against a globally registered RouterLink without warning or rendering a
15
+ * broken `<routerlink>` element when vue-router is absent; callers fall back to `<a href>`.
16
+ * Must be called during component setup.
17
+ */
18
+ export declare function useRouterLink(source: UseRouterLinkSource): UseRouterLink;