@webx-ui/core 0.2.0 → 0.3.0

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 (89) hide show
  1. package/dist/components/Action/Action.d.ts +35 -0
  2. package/dist/components/Action/index.d.ts +2 -0
  3. package/dist/components/Action/types.d.ts +37 -0
  4. package/dist/components/Actions/Actions.d.ts +45 -0
  5. package/dist/components/Actions/index.d.ts +2 -0
  6. package/dist/components/Actions/types.d.ts +20 -0
  7. package/dist/components/Autocomplete/Autocomplete.d.ts +60 -0
  8. package/dist/components/Autocomplete/index.d.ts +2 -0
  9. package/dist/components/Autocomplete/types.d.ts +58 -0
  10. package/dist/components/Badge/Badge.d.ts +31 -0
  11. package/dist/components/Badge/index.d.ts +2 -0
  12. package/dist/components/Badge/types.d.ts +21 -0
  13. package/dist/components/Button/Button.d.ts +5 -5
  14. package/dist/components/Button/types.d.ts +3 -2
  15. package/dist/components/ButtonGroup/ButtonGroup.d.ts +26 -0
  16. package/dist/components/ButtonGroup/index.d.ts +2 -0
  17. package/dist/components/ButtonGroup/types.d.ts +20 -0
  18. package/dist/components/Cascader/Cascader.d.ts +62 -0
  19. package/dist/components/Cascader/index.d.ts +2 -0
  20. package/dist/components/Cascader/types.d.ts +55 -0
  21. package/dist/components/Checkbox/Checkbox.d.ts +3 -3
  22. package/dist/components/ColorPicker/ColorPicker.d.ts +5 -5
  23. package/dist/components/Countdown/Countdown.d.ts +42 -0
  24. package/dist/components/Countdown/format.d.ts +12 -0
  25. package/dist/components/Countdown/index.d.ts +3 -0
  26. package/dist/components/Countdown/types.d.ts +27 -0
  27. package/dist/components/DatePicker/DatePicker.d.ts +12 -12
  28. package/dist/components/DateRangePicker/DateRangePicker.d.ts +11 -11
  29. package/dist/components/DateTimePicker/DateTimePicker.d.ts +5 -5
  30. package/dist/components/Dropdown/Dropdown.d.ts +46 -0
  31. package/dist/components/Dropdown/index.d.ts +2 -0
  32. package/dist/components/Dropdown/types.d.ts +28 -0
  33. package/dist/components/DropdownItem/DropdownItem.d.ts +32 -0
  34. package/dist/components/DropdownItem/index.d.ts +2 -0
  35. package/dist/components/DropdownItem/types.d.ts +20 -0
  36. package/dist/components/EntityCard/EntityCard.d.ts +40 -0
  37. package/dist/components/EntityCard/index.d.ts +2 -0
  38. package/dist/components/EntityCard/types.d.ts +37 -0
  39. package/dist/components/FormItem/FormItem.d.ts +2 -2
  40. package/dist/components/Heading/Heading.d.ts +24 -0
  41. package/dist/components/Heading/index.d.ts +2 -0
  42. package/dist/components/Heading/types.d.ts +16 -0
  43. package/dist/components/Icon/Icon.d.ts +8 -0
  44. package/dist/components/Icon/icons.d.ts +85 -0
  45. package/dist/components/Icon/index.d.ts +4 -0
  46. package/dist/components/Icon/types.d.ts +25 -0
  47. package/dist/components/Indicator/Indicator.d.ts +29 -0
  48. package/dist/components/Indicator/index.d.ts +2 -0
  49. package/dist/components/Indicator/types.d.ts +21 -0
  50. package/dist/components/Input/Input.d.ts +6 -6
  51. package/dist/components/InputNumber/InputNumber.d.ts +3 -3
  52. package/dist/components/Link/Link.d.ts +34 -0
  53. package/dist/components/Link/index.d.ts +2 -0
  54. package/dist/components/Link/types.d.ts +26 -0
  55. package/dist/components/Prose/Prose.d.ts +22 -0
  56. package/dist/components/Prose/index.d.ts +2 -0
  57. package/dist/components/Prose/types.d.ts +13 -0
  58. package/dist/components/Radio/Radio.d.ts +2 -2
  59. package/dist/components/Rate/Rate.d.ts +2 -2
  60. package/dist/components/RichText/RichText.d.ts +4 -4
  61. package/dist/components/RichText/ToolbarButton.d.ts +1 -1
  62. package/dist/components/Select/Select.d.ts +10 -10
  63. package/dist/components/Slider/Slider.d.ts +1 -1
  64. package/dist/components/Statistic/Statistic.d.ts +34 -0
  65. package/dist/components/Statistic/index.d.ts +2 -0
  66. package/dist/components/Statistic/types.d.ts +24 -0
  67. package/dist/components/Switch/Switch.d.ts +2 -2
  68. package/dist/components/Table/Table.d.ts +1 -1
  69. package/dist/components/TagsInput/TagsInput.d.ts +4 -4
  70. package/dist/components/Text/Text.d.ts +27 -0
  71. package/dist/components/Text/index.d.ts +2 -0
  72. package/dist/components/Text/types.d.ts +21 -0
  73. package/dist/components/Textarea/Textarea.d.ts +3 -3
  74. package/dist/components/TimePicker/TimePicker.d.ts +5 -5
  75. package/dist/components/Timeline/Timeline.d.ts +20 -0
  76. package/dist/components/Timeline/index.d.ts +2 -0
  77. package/dist/components/Timeline/types.d.ts +6 -0
  78. package/dist/components/TimelineItem/TimelineItem.d.ts +29 -0
  79. package/dist/components/TimelineItem/index.d.ts +2 -0
  80. package/dist/components/TimelineItem/types.d.ts +21 -0
  81. package/dist/components/index.d.ts +19 -0
  82. package/dist/composables/useActions.d.ts +8 -0
  83. package/dist/composables/useButtonGroup.d.ts +15 -0
  84. package/dist/composables/useDropdown.d.ts +9 -0
  85. package/dist/composables/useTimeline.d.ts +8 -0
  86. package/dist/index.js +3226 -1602
  87. package/dist/index.js.map +1 -1
  88. package/dist/style.css +1 -1
  89. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ import { StatisticSize } from '../Statistic/types';
2
+ import { TextAlign, TextTone } from '../Text/types';
3
+ /** When the countdown reaches zero: a timestamp, a `Date`, or anything `Date` parses. */
4
+ export type CountdownTarget = number | string | Date;
5
+ export interface CountdownProps {
6
+ /** The moment being counted down to. */
7
+ value: CountdownTarget;
8
+ /**
9
+ * Pattern built from `DD`, `HH`, `mm`, `ss` and `SSS`. Only the tokens present are
10
+ * filled, so `mm:ss` counts the whole span in minutes rather than dropping the hours.
11
+ */
12
+ format?: string;
13
+ /** How often the display is refreshed, in milliseconds. */
14
+ interval?: number;
15
+ title?: string;
16
+ prefix?: string;
17
+ suffix?: string;
18
+ size?: StatisticSize;
19
+ tone?: TextTone;
20
+ align?: TextAlign;
21
+ }
22
+ export interface CountdownEmits {
23
+ /** Milliseconds left, on every tick. */
24
+ change: [remaining: number];
25
+ /** Fired once, when the target time is reached. */
26
+ finish: [];
27
+ }
@@ -11,31 +11,31 @@ declare function __VLS_template(): {
11
11
  };
12
12
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
13
  declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ close: () => any;
15
+ clear: () => any;
16
+ open: () => any;
14
17
  change: (value: DatePickerModelValue) => any;
15
18
  "update:modelValue": (value: DatePickerModelValue) => any;
16
- open: () => any;
17
- clear: () => any;
18
- close: () => any;
19
19
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onClose?: (() => any) | undefined;
21
+ onClear?: (() => any) | undefined;
22
+ onOpen?: (() => any) | undefined;
20
23
  onChange?: ((value: DatePickerModelValue) => any) | undefined;
21
24
  "onUpdate:modelValue"?: ((value: DatePickerModelValue) => any) | undefined;
22
- onOpen?: (() => any) | undefined;
23
- onClear?: (() => any) | undefined;
24
- onClose?: (() => any) | undefined;
25
25
  }>, {
26
26
  name: string;
27
- type: import('./types').DatePickerType;
28
27
  size: import('../..').ControlSize;
28
+ type: import('./types').DatePickerType;
29
29
  disabled: boolean;
30
- id: string;
30
+ teleport: boolean | string;
31
+ placeholder: string;
31
32
  ariaLabel: string;
32
33
  clearable: boolean;
33
- placeholder: string;
34
- teleport: boolean | string;
35
- readonly: boolean;
36
34
  status: import('../..').ControlStatus;
37
- valueFormat: string;
35
+ id: string;
36
+ readonly: boolean;
38
37
  format: string;
38
+ valueFormat: string;
39
39
  minDate: string | Date;
40
40
  maxDate: string | Date;
41
41
  seconds: boolean;
@@ -11,30 +11,30 @@ declare function __VLS_template(): {
11
11
  };
12
12
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
13
  declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ close: () => any;
15
+ clear: () => any;
16
+ open: () => any;
14
17
  change: (value: DateRangePickerModelValue) => any;
15
18
  "update:modelValue": (value: DateRangePickerModelValue) => any;
16
- open: () => any;
17
- clear: () => any;
18
- close: () => any;
19
19
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onClose?: (() => any) | undefined;
21
+ onClear?: (() => any) | undefined;
22
+ onOpen?: (() => any) | undefined;
20
23
  onChange?: ((value: DateRangePickerModelValue) => any) | undefined;
21
24
  "onUpdate:modelValue"?: ((value: DateRangePickerModelValue) => any) | undefined;
22
- onOpen?: (() => any) | undefined;
23
- onClear?: (() => any) | undefined;
24
- onClose?: (() => any) | undefined;
25
25
  }>, {
26
26
  name: string;
27
27
  size: import('../..').ControlSize;
28
28
  disabled: boolean;
29
- id: string;
29
+ teleport: boolean;
30
+ placeholder: string;
30
31
  ariaLabel: string;
31
32
  clearable: boolean;
32
- placeholder: string;
33
- teleport: boolean;
34
- readonly: boolean;
35
33
  status: import('../..').ControlStatus;
36
- valueFormat: string;
34
+ id: string;
35
+ readonly: boolean;
37
36
  format: string;
37
+ valueFormat: string;
38
38
  minDate: string | Date;
39
39
  maxDate: string | Date;
40
40
  weekStart: number;
@@ -25,15 +25,15 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
25
25
  name: string;
26
26
  size: import('../..').ControlSize;
27
27
  disabled: boolean;
28
- id: string;
28
+ teleport: boolean | string;
29
+ placeholder: string;
29
30
  ariaLabel: string;
30
31
  clearable: boolean;
31
- placeholder: string;
32
- teleport: boolean | string;
33
- readonly: boolean;
34
32
  status: import('../..').ControlStatus;
35
- valueFormat: string;
33
+ id: string;
34
+ readonly: boolean;
36
35
  format: string;
36
+ valueFormat: string;
37
37
  minDate: string | Date;
38
38
  maxDate: string | Date;
39
39
  seconds: boolean;
@@ -0,0 +1,46 @@
1
+ import { DropdownProps } from './types';
2
+ type __VLS_Props = DropdownProps;
3
+ declare function close(): void;
4
+ type __VLS_PublicProps = {
5
+ 'open'?: boolean;
6
+ } & __VLS_Props;
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ trigger?(_: {
11
+ open: boolean;
12
+ }): any;
13
+ default?(_: {
14
+ close: typeof close;
15
+ }): any;
16
+ };
17
+ refs: {};
18
+ rootEl: any;
19
+ };
20
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ close: () => any;
23
+ open: () => any;
24
+ "update:open": (value: boolean) => any;
25
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
26
+ onClose?: (() => any) | undefined;
27
+ onOpen?: (() => any) | undefined;
28
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
29
+ }>, {
30
+ disabled: boolean;
31
+ side: import('./types').DropdownSide;
32
+ align: import('./types').DropdownAlign;
33
+ offset: number;
34
+ alignOffset: number;
35
+ closeOnClick: boolean;
36
+ matchTriggerWidth: boolean;
37
+ teleport: boolean;
38
+ modal: boolean;
39
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
40
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
41
+ export default _default;
42
+ type __VLS_WithTemplateSlots<T, S> = T & {
43
+ new (): {
44
+ $slots: S;
45
+ };
46
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxDropdown } from './Dropdown';
2
+ export type * from './types';
@@ -0,0 +1,28 @@
1
+ export type DropdownSide = 'top' | 'right' | 'bottom' | 'left';
2
+ export type DropdownAlign = 'start' | 'center' | 'end';
3
+ export interface DropdownProps {
4
+ /** Which side of the trigger the panel opens on. */
5
+ side?: DropdownSide;
6
+ /** How the panel lines up with the trigger along that side. */
7
+ align?: DropdownAlign;
8
+ /** Gap between the trigger and the panel, in pixels. */
9
+ offset?: number;
10
+ /** Shift along the trigger's edge, in pixels. */
11
+ alignOffset?: number;
12
+ /**
13
+ * Closes the panel when something inside it is clicked — menu behaviour. Turn it
14
+ * off for a panel of filters or checkboxes the user works in before leaving.
15
+ */
16
+ closeOnClick?: boolean;
17
+ /** Makes the panel at least as wide as the trigger. */
18
+ matchTriggerWidth?: boolean;
19
+ /** Render the panel in a portal so it escapes `overflow: hidden`. */
20
+ teleport?: boolean;
21
+ /** Blocks the rest of the page while the panel is open. */
22
+ modal?: boolean;
23
+ disabled?: boolean;
24
+ }
25
+ export interface DropdownEmits {
26
+ open: [];
27
+ close: [];
28
+ }
@@ -0,0 +1,32 @@
1
+ import { DropdownItemProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ before?(_: {}): any;
6
+ default?(_: {}): any;
7
+ after?(_: {}): any;
8
+ };
9
+ refs: {};
10
+ rootEl: any;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<DropdownItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ click: (event: MouseEvent) => any;
15
+ }, string, import('vue').PublicProps, Readonly<DropdownItemProps> & Readonly<{
16
+ onClick?: ((event: MouseEvent) => any) | undefined;
17
+ }>, {
18
+ icon: import('..').IconName;
19
+ tone: import('./types').DropdownItemTone;
20
+ href: string;
21
+ target: string;
22
+ as: string | import('vue').Component;
23
+ disabled: boolean;
24
+ active: boolean;
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
26
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
27
+ export default _default;
28
+ type __VLS_WithTemplateSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxDropdownItem } from './DropdownItem';
2
+ export type * from './types';
@@ -0,0 +1,20 @@
1
+ import { Component } from 'vue';
2
+ import { IconName } from '../Icon/types';
3
+ export type DropdownItemTone = 'default' | 'primary' | 'danger' | 'success' | 'warning';
4
+ export interface DropdownItemProps {
5
+ /** Icon before the label. */
6
+ icon?: IconName;
7
+ /** Renders an `<a>` instead of a `<button>`. */
8
+ href?: string;
9
+ target?: string;
10
+ /** Renders through another component — `RouterLink`, say, with `to` in the attrs. */
11
+ as?: string | Component;
12
+ /** Colour role. `danger` for the destructive row at the bottom of a menu. */
13
+ tone?: DropdownItemTone;
14
+ /** Marks the row as the current one. */
15
+ active?: boolean;
16
+ disabled?: boolean;
17
+ }
18
+ export interface DropdownItemEmits {
19
+ click: [event: MouseEvent];
20
+ }
@@ -0,0 +1,40 @@
1
+ import { EntityCardProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ media?(_: {}): any;
6
+ title?(_: {}): any;
7
+ subtitle?(_: {}): any;
8
+ meta?(_: {}): any;
9
+ default?(_: {}): any;
10
+ actions?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: HTMLDivElement;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<EntityCardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ click: (event: MouseEvent) => any;
18
+ }, string, import('vue').PublicProps, Readonly<EntityCardProps> & Readonly<{
19
+ onClick?: ((event: MouseEvent) => any) | undefined;
20
+ }>, {
21
+ image: string;
22
+ size: import('./types').EntityCardSize;
23
+ meta: import('./types').EntityCardMeta[];
24
+ title: string;
25
+ href: string;
26
+ variant: import('./types').EntityCardVariant;
27
+ bordered: boolean;
28
+ subtitle: string;
29
+ imageAlt: string;
30
+ shape: import('./types').EntityCardShape;
31
+ imageSize: number | string;
32
+ selected: boolean;
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
34
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
35
+ export default _default;
36
+ type __VLS_WithTemplateSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxEntityCard } from './EntityCard';
2
+ export type * from './types';
@@ -0,0 +1,37 @@
1
+ export type EntityCardSize = 'sm' | 'md' | 'lg';
2
+ export type EntityCardVariant = 'card' | 'plain';
3
+ export type EntityCardShape = 'rounded' | 'square' | 'circle';
4
+ /** One fact under the title: "Sections: News", "Updated 12.03", a status. */
5
+ export interface EntityCardMeta {
6
+ /** Prefix shown in muted text — the field name. */
7
+ label?: string;
8
+ /** The value itself. Leave empty to show the label alone, as an empty field reads. */
9
+ text?: string;
10
+ }
11
+ export interface EntityCardProps {
12
+ /** Name of the entity — the line that identifies the row. */
13
+ title?: string;
14
+ /** Turns the title into a link. */
15
+ href?: string;
16
+ /** Second line, between the title and the meta row. */
17
+ subtitle?: string;
18
+ /** Thumbnail, avatar, cover — anything small and square. */
19
+ image?: string;
20
+ imageAlt?: string;
21
+ /** Shape of the thumbnail. Use `circle` for people, `rounded` for content. */
22
+ shape?: EntityCardShape;
23
+ /** Thumbnail size. A number is pixels; a string is used as a CSS length. */
24
+ imageSize?: number | string;
25
+ /** Facts under the title. Use the `meta` slot when a fact needs markup. */
26
+ meta?: EntityCardMeta[];
27
+ size?: EntityCardSize;
28
+ /** `card` sits on its own surface; `plain` drops the background for use inside one. */
29
+ variant?: EntityCardVariant;
30
+ bordered?: boolean;
31
+ /** Highlights the card as the current one — a picked item in a list. */
32
+ selected?: boolean;
33
+ }
34
+ export interface EntityCardEmits {
35
+ /** The card body was clicked — the row, not the buttons in `#actions`. */
36
+ click: [event: MouseEvent];
37
+ }
@@ -16,10 +16,10 @@ declare const __VLS_component: import('vue').DefineComponent<FormItemProps, {
16
16
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FormItemProps> & Readonly<{}>, {
17
17
  name: string;
18
18
  size: ControlSize;
19
- disabled: boolean;
20
19
  label: string;
21
- error: string | string[];
22
20
  required: boolean;
21
+ disabled: boolean;
22
+ error: string | string[];
23
23
  labelWidth: string;
24
24
  help: string;
25
25
  reserveErrorSpace: boolean;
@@ -0,0 +1,24 @@
1
+ import { HeadingLevel, HeadingProps, HeadingSize } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: any;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<HeadingProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<HeadingProps> & Readonly<{}>, {
12
+ size: HeadingSize;
13
+ tone: import('..').TextTone;
14
+ align: import('..').TextAlign;
15
+ level: HeadingLevel;
16
+ truncate: boolean;
17
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
19
+ export default _default;
20
+ type __VLS_WithTemplateSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxHeading } from './Heading';
2
+ export type * from './types';
@@ -0,0 +1,16 @@
1
+ import { TextAlign, TextTone } from '../Text/types';
2
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
3
+ export type HeadingSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
4
+ export interface HeadingProps {
5
+ /** Which `<h*>` to render. Keep it truthful to the document outline. */
6
+ level?: HeadingLevel;
7
+ /**
8
+ * Visual size, when it should differ from the level — an `h3` that has to look
9
+ * like a page title, or an `h1` that must stay small in a drawer.
10
+ */
11
+ size?: HeadingSize;
12
+ tone?: TextTone;
13
+ align?: TextAlign;
14
+ /** Cuts the heading off with an ellipsis after one line. */
15
+ truncate?: boolean;
16
+ }
@@ -0,0 +1,8 @@
1
+ import { IconProps } from './types';
2
+ declare const _default: import('vue').DefineComponent<IconProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IconProps> & Readonly<{}>, {
3
+ size: import('./types').IconSize | number | string;
4
+ strokeWidth: number | string;
5
+ spin: boolean;
6
+ label: string;
7
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The built-in icon set.
3
+ *
4
+ * Every entry is the *inside* of a 24×24 `<svg>` drawn in `currentColor` with a
5
+ * stroke — the wrapper in `Icon.vue` supplies the viewBox, the stroke width and the
6
+ * colour, so an icon inherits the text it sits next to. Shapes that read better
7
+ * filled (dots, pips) set `fill="currentColor" stroke="none"` themselves.
8
+ */
9
+ export declare const builtinIcons: {
10
+ readonly check: "<path d=\"m5 13 4.5 4.5L19 7\"/>";
11
+ readonly 'check-circle': "<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"m8.2 12.2 2.6 2.6 5-5.2\"/>";
12
+ readonly close: "<path d=\"M18 6 6 18M6 6l12 12\"/>";
13
+ readonly 'close-circle': "<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"m9 9 6 6m0-6-6 6\"/>";
14
+ readonly plus: "<path d=\"M12 5v14M5 12h14\"/>";
15
+ readonly minus: "<path d=\"M5 12h14\"/>";
16
+ readonly edit: "<path d=\"M4 20h4L19.5 8.5a2.83 2.83 0 0 0-4-4L4 16v4Z\"/><path d=\"m14.5 5.5 4 4\"/>";
17
+ readonly trash: "<path d=\"M4 7h16M10 7V5.5A1.5 1.5 0 0 1 11.5 4h1A1.5 1.5 0 0 1 14 5.5V7M6.5 7l.8 11.6a2 2 0 0 0 2 1.9h5.4a2 2 0 0 0 2-1.9L17.5 7\"/><path d=\"M10 11v5.5M14 11v5.5\"/>";
18
+ readonly copy: "<rect x=\"8.5\" y=\"8.5\" width=\"11\" height=\"11\" rx=\"2.2\"/><path d=\"M15.5 8.5v-2a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h2\"/>";
19
+ readonly search: "<circle cx=\"11\" cy=\"11\" r=\"6.5\"/><path d=\"m16 16 4.5 4.5\"/>";
20
+ readonly filter: "<path d=\"M4 5.5h16l-6.2 7.2v5.1l-3.6 2v-7.1z\"/>";
21
+ readonly refresh: "<path d=\"M4 12a8 8 0 0 1 13.7-5.6L20 8.5\"/><path d=\"M20 4.5v4h-4\"/><path d=\"M20 12a8 8 0 0 1-13.7 5.6L4 15.5\"/><path d=\"M4 19.5v-4h4\"/>";
22
+ readonly upload: "<path d=\"M12 16V4m0 0-4.5 4.5M12 4l4.5 4.5\"/><path d=\"M4 15v3.5A1.5 1.5 0 0 0 5.5 20h13a1.5 1.5 0 0 0 1.5-1.5V15\"/>";
23
+ readonly download: "<path d=\"M12 4v12m0 0-4.5-4.5M12 16l4.5-4.5\"/><path d=\"M4 15v3.5A1.5 1.5 0 0 0 5.5 20h13a1.5 1.5 0 0 0 1.5-1.5V15\"/>";
24
+ readonly logout: "<path d=\"M14 6V5a1.5 1.5 0 0 0-1.5-1.5h-6A1.5 1.5 0 0 0 5 5v14a1.5 1.5 0 0 0 1.5 1.5h6A1.5 1.5 0 0 0 14 19v-1\"/><path d=\"M10 12h10m0 0-3-3m3 3-3 3\"/>";
25
+ readonly 'chevron-down': "<path d=\"m6 9.5 6 6 6-6\"/>";
26
+ readonly 'chevron-up': "<path d=\"m6 14.5 6-6 6 6\"/>";
27
+ readonly 'chevron-left': "<path d=\"m14.5 6-6 6 6 6\"/>";
28
+ readonly 'chevron-right': "<path d=\"m9.5 6 6 6-6 6\"/>";
29
+ readonly 'arrow-up': "<path d=\"M12 20V4m0 0 6 6m-6-6-6 6\"/>";
30
+ readonly 'arrow-down': "<path d=\"M12 4v16m0 0 6-6m-6 6-6-6\"/>";
31
+ readonly 'arrow-left': "<path d=\"M20 12H4m0 0 6-6m-6 6 6 6\"/>";
32
+ readonly 'arrow-right': "<path d=\"M4 12h16m0 0-6-6m6 6-6 6\"/>";
33
+ readonly menu: "<path d=\"M4 7h16M4 12h16M4 17h16\"/>";
34
+ readonly 'more-horizontal': "<circle cx=\"5.5\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"18.5\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/>";
35
+ readonly 'more-vertical': "<circle cx=\"12\" cy=\"5.5\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12\" cy=\"18.5\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/>";
36
+ readonly drag: "<circle cx=\"9\" cy=\"6\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"15\" cy=\"6\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"9\" cy=\"12\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"15\" cy=\"12\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"9\" cy=\"18\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"15\" cy=\"18\" r=\"1.5\" fill=\"currentColor\" stroke=\"none\"/>";
37
+ readonly user: "<circle cx=\"12\" cy=\"8\" r=\"3.75\"/><path d=\"M4.5 20a7.5 7.5 0 0 1 15 0\"/>";
38
+ readonly users: "<circle cx=\"9.5\" cy=\"8.5\" r=\"3.4\"/><path d=\"M2.5 20a7 7 0 0 1 14 0\"/><path d=\"M16 5.5a3.4 3.4 0 0 1 0 6.6M17.5 14.2A6.3 6.3 0 0 1 21.5 20\"/>";
39
+ readonly settings: "<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M12 4v2.5M12 17.5V20M4 12h2.5M17.5 12H20M6.34 6.34l1.77 1.77M15.89 15.89l1.77 1.77M17.66 6.34l-1.77 1.77M6.34 17.66l1.77-1.77\"/>";
40
+ readonly sliders: "<path d=\"M4 7h9M17 7h3M4 17h3M11 17h9\"/><circle cx=\"15\" cy=\"7\" r=\"2\"/><circle cx=\"9\" cy=\"17\" r=\"2\"/>";
41
+ readonly home: "<path d=\"M4 10.5 12 4l8 6.5V19a1.5 1.5 0 0 1-1.5 1.5H15V14H9v6.5H5.5A1.5 1.5 0 0 1 4 19Z\"/>";
42
+ readonly file: "<path d=\"M13.5 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9zm0 0V9H19\"/>";
43
+ readonly folder: "<path d=\"M3.5 7a2 2 0 0 1 2-2h3.2a2 2 0 0 1 1.5.7l1.3 1.5h7a2 2 0 0 1 2 2v8.3a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z\"/>";
44
+ readonly image: "<rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"2.5\"/><circle cx=\"8.75\" cy=\"9.75\" r=\"1.75\"/><path d=\"m4 17 4.5-4.2a2 2 0 0 1 2.7 0l3 2.8 1.6-1.5a2 2 0 0 1 2.7 0L20 16\"/>";
45
+ readonly calendar: "<rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"15\" rx=\"2.5\"/><path d=\"M3.5 10h17M8 3.5V7M16 3.5V7\"/>";
46
+ readonly clock: "<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 7.5V12l3 2\"/>";
47
+ readonly mail: "<rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2.5\"/><path d=\"m4 7.5 6.9 5a2 2 0 0 0 2.2 0l6.9-5\"/>";
48
+ readonly phone: "<path d=\"M7 3.5 9.5 4l1.2 3.4-1.9 1.6a11 11 0 0 0 5.2 5.2l1.6-1.9 3.4 1.2.5 2.5a2 2 0 0 1-2 2.3A15.5 15.5 0 0 1 4.7 5.5a2 2 0 0 1 2.3-2Z\"/>";
49
+ readonly bell: "<path d=\"M7 10a5 5 0 0 1 10 0c0 4 1.5 5.5 1.5 5.5h-13S7 14 7 10Z\"/><path d=\"M10.2 18.5a2 2 0 0 0 3.6 0\"/>";
50
+ readonly cart: "<path d=\"M3 4.5h2.2l2.3 10.2a1.6 1.6 0 0 0 1.6 1.3h7.4a1.6 1.6 0 0 0 1.6-1.2L20 8H6\"/><circle cx=\"10\" cy=\"19.5\" r=\"1.5\"/><circle cx=\"17\" cy=\"19.5\" r=\"1.5\"/>";
51
+ readonly tag: "<path d=\"M4 11.2V5.5A1.5 1.5 0 0 1 5.5 4h5.7a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8l-5.2 5.2a2 2 0 0 1-2.8 0l-7-7a2 2 0 0 1-.6-1.4Z\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/>";
52
+ readonly link: "<path d=\"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7L11.5 7\"/><path d=\"M14 10a4 4 0 0 0-5.7 0l-3 3A4 4 0 0 0 11 18.7L12.5 17\"/>";
53
+ readonly 'external-link': "<path d=\"M13.5 4.5H20V11\"/><path d=\"m11 13 9-8.5\"/><path d=\"M19 14.5v4a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 18.5v-11A1.5 1.5 0 0 1 6.5 6h4\"/>";
54
+ readonly lock: "<rect x=\"4.5\" y=\"10\" width=\"15\" height=\"10\" rx=\"2.5\"/><path d=\"M8 10V7.8a4 4 0 0 1 8 0V10\"/>";
55
+ readonly unlock: "<rect x=\"4.5\" y=\"10\" width=\"15\" height=\"10\" rx=\"2.5\"/><path d=\"M8 10V7.8a4 4 0 0 1 7.6-1.8\"/>";
56
+ readonly grid: "<rect x=\"4\" y=\"4\" width=\"7\" height=\"7\" rx=\"1.8\"/><rect x=\"13\" y=\"4\" width=\"7\" height=\"7\" rx=\"1.8\"/><rect x=\"4\" y=\"13\" width=\"7\" height=\"7\" rx=\"1.8\"/><rect x=\"13\" y=\"13\" width=\"7\" height=\"7\" rx=\"1.8\"/>";
57
+ readonly list: "<path d=\"M9 6h11M9 12h11M9 18h11\"/><circle cx=\"5\" cy=\"6\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"5\" cy=\"12\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"5\" cy=\"18\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/>";
58
+ readonly eye: "<path d=\"M2.5 12S6.8 5.5 12 5.5 21.5 12 21.5 12 17.2 18.5 12 18.5 2.5 12 2.5 12Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.75\"/>";
59
+ readonly 'eye-off': "<path d=\"M10.2 6a9.9 9.9 0 0 1 1.8-.2c5.2 0 9.5 6.2 9.5 6.2a18 18 0 0 1-3.3 3.8M6.6 7.9A17.8 17.8 0 0 0 2.5 12s4.3 6.5 9.5 6.5a9.4 9.4 0 0 0 3.3-.6\"/><path d=\"m4 4 16 16\"/>";
60
+ readonly star: "<path d=\"m12 4 2.5 5.1 5.6.8-4 4 .9 5.6-5-2.7-5 2.7.9-5.6-4-4 5.6-.8z\"/>";
61
+ readonly heart: "<path d=\"M12 19.5S4 15 4 9.8A4.3 4.3 0 0 1 12 7.4 4.3 4.3 0 0 1 20 9.8c0 5.2-8 9.7-8 9.7Z\"/>";
62
+ readonly sun: "<circle cx=\"12\" cy=\"12\" r=\"4\"/><path d=\"M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M18.4 5.6 17 7M7 17l-1.4 1.4\"/>";
63
+ readonly moon: "<path d=\"M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5Z\"/>";
64
+ readonly info: "<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 11v5\"/><circle cx=\"12\" cy=\"7.75\" r=\"1.05\" fill=\"currentColor\" stroke=\"none\"/>";
65
+ readonly warning: "<path d=\"M10.3 4.9a2 2 0 0 1 3.4 0l7 12.1a2 2 0 0 1-1.7 3H5a2 2 0 0 1-1.7-3z\"/><path d=\"M12 9.5v4\"/><circle cx=\"12\" cy=\"16.6\" r=\"1.05\" fill=\"currentColor\" stroke=\"none\"/>";
66
+ readonly question: "<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M9.6 9.4a2.5 2.5 0 0 1 4.9.6c0 1.7-2.5 2-2.5 3.5\"/><circle cx=\"12\" cy=\"16.6\" r=\"1.05\" fill=\"currentColor\" stroke=\"none\"/>";
67
+ readonly loader: "<path d=\"M12 3.5v4M12 16.5v4M3.5 12h4M16.5 12h4M6 6l2.8 2.8M15.2 15.2 18 18M18 6l-2.8 2.8M8.8 15.2 6 18\"/>";
68
+ };
69
+ /** Every name the library ships with. */
70
+ export type BuiltinIconName = keyof typeof builtinIcons;
71
+ /**
72
+ * Adds icons to the set, so `<wx-icon name="my-logo" />` works anywhere in the app.
73
+ *
74
+ * ```ts
75
+ * registerIcons({ 'my-logo': '<path d="M4 4h16v16H4z" />' })
76
+ * ```
77
+ *
78
+ * The markup is injected as-is, so register only icons you author or control —
79
+ * never a string that arrived from a user or an API.
80
+ */
81
+ export declare function registerIcons(icons: Record<string, string>): void;
82
+ /** The markup of an icon, or `undefined` when nothing is registered under that name. */
83
+ export declare function resolveIcon(name: string): string | undefined;
84
+ /** Names currently available, built-in plus registered — handy for a docs gallery. */
85
+ export declare function iconNames(): string[];
@@ -0,0 +1,4 @@
1
+ export { default as WxIcon } from './Icon';
2
+ export { builtinIcons, registerIcons, resolveIcon, iconNames } from './icons';
3
+ export type { BuiltinIconName } from './icons';
4
+ export type * from './types';
@@ -0,0 +1,25 @@
1
+ import { BuiltinIconName } from './icons';
2
+ /**
3
+ * A built-in name, or any string once `registerIcons` has added your own — the
4
+ * `(string & {})` arm keeps autocompletion for the built-ins while accepting the rest.
5
+ */
6
+ export type IconName = BuiltinIconName | (string & {});
7
+ export type IconSize = 'sm' | 'md' | 'lg';
8
+ export interface IconProps {
9
+ /** Name in the icon set. Unknown names render nothing. */
10
+ name: IconName;
11
+ /**
12
+ * Box size. A keyword follows the text scale; a number is pixels; any other string
13
+ * is used as a CSS length. Defaults to `1em`, so an icon matches its surrounding text.
14
+ */
15
+ size?: IconSize | number | string;
16
+ /** Stroke width in the 24×24 grid. */
17
+ strokeWidth?: number | string;
18
+ /** Spins the icon — for `loader` and `refresh` while something is in flight. */
19
+ spin?: boolean;
20
+ /**
21
+ * Accessible name. Without it the icon is `aria-hidden`, which is what you want
22
+ * whenever there is a visible label beside it.
23
+ */
24
+ label?: string;
25
+ }
@@ -0,0 +1,29 @@
1
+ import { IndicatorProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ mark?(_: {}): any;
7
+ };
8
+ refs: {};
9
+ rootEl: HTMLSpanElement;
10
+ };
11
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
+ declare const __VLS_component: import('vue').DefineComponent<IndicatorProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IndicatorProps> & Readonly<{}>, {
13
+ label: string;
14
+ type: import('./types').IndicatorType;
15
+ hidden: boolean;
16
+ offset: [number, number];
17
+ value: number | string;
18
+ dot: boolean;
19
+ max: number;
20
+ showZero: boolean;
21
+ placement: import('./types').IndicatorPlacement;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
23
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
24
+ export default _default;
25
+ type __VLS_WithTemplateSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxIndicator } from './Indicator';
2
+ export type * from './types';
@@ -0,0 +1,21 @@
1
+ export type IndicatorType = 'danger' | 'primary' | 'success' | 'warning' | 'info' | 'neutral';
2
+ export type IndicatorPlacement = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
3
+ export interface IndicatorProps {
4
+ /** The count (or any short text) to show. Numbers above `max` become `99+`. */
5
+ value?: number | string;
6
+ /** Largest number shown in full. Only applies to numeric values. */
7
+ max?: number;
8
+ /** Draws a plain dot instead of a number — "something happened here". */
9
+ dot?: boolean;
10
+ /** Keeps the mark visible at 0; by default a zero count hides it. */
11
+ showZero?: boolean;
12
+ /** Corner the mark sits in, relative to the wrapped element. */
13
+ placement?: IndicatorPlacement;
14
+ /** Nudge in pixels: `[x, y]`, positive values move right and down. */
15
+ offset?: [number, number];
16
+ type?: IndicatorType;
17
+ /** Hides the mark without unmounting what it wraps. */
18
+ hidden?: boolean;
19
+ /** Accessible text for the mark — e.g. `2 items in cart`. */
20
+ label?: string;
21
+ }