@lovince/ui-vue 0.1.0 → 0.2.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 (78) hide show
  1. package/README.md +246 -28
  2. package/dist/components/{combobox.d.ts → choice/combobox.d.ts} +10 -27
  3. package/dist/components/{command.d.ts → choice/command.d.ts} +7 -19
  4. package/dist/components/{emoji-picker.d.ts → choice/emoji-picker.d.ts} +9 -9
  5. package/dist/components/{radio-group.d.ts → choice/radio-group.d.ts} +3 -3
  6. package/dist/components/choice/rating.d.ts +143 -0
  7. package/dist/components/choice/segmented-control.d.ts +26 -0
  8. package/dist/components/{select.d.ts → choice/select.d.ts} +11 -20
  9. package/dist/components/{toggle-group.d.ts → choice/toggle-group.d.ts} +3 -9
  10. package/dist/components/{toggles.d.ts → choice/toggles.d.ts} +4 -4
  11. package/dist/components/{accordion.d.ts → disclosure/accordion.d.ts} +5 -13
  12. package/dist/components/{disclosure.d.ts → disclosure/disclosure.d.ts} +3 -10
  13. package/dist/components/{tabs.d.ts → disclosure/tabs.d.ts} +4 -6
  14. package/dist/components/display/avatar-group.d.ts +61 -0
  15. package/dist/components/{avatar.d.ts → display/avatar.d.ts} +3 -6
  16. package/dist/components/display/feedback.d.ts +623 -0
  17. package/dist/components/display/image.d.ts +95 -0
  18. package/dist/components/display/meter.d.ts +165 -0
  19. package/dist/components/{progress.d.ts → display/progress.d.ts} +2 -6
  20. package/dist/components/display/stat.d.ts +102 -0
  21. package/dist/components/display/table.d.ts +130 -0
  22. package/dist/components/display/timeline.d.ts +181 -0
  23. package/dist/components/forms/color-picker.d.ts +187 -0
  24. package/dist/components/forms/date-picker.d.ts +257 -0
  25. package/dist/components/forms/editable.d.ts +243 -0
  26. package/dist/components/forms/file-upload.d.ts +203 -0
  27. package/dist/components/forms/forms.d.ts +290 -0
  28. package/dist/components/forms/phone-input.d.ts +189 -0
  29. package/dist/components/forms/signature-pad.d.ts +122 -0
  30. package/dist/components/forms/tags-input.d.ts +209 -0
  31. package/dist/components/forms/text-inputs.d.ts +270 -0
  32. package/dist/components/forms/time-field.d.ts +165 -0
  33. package/dist/components/{calendar.d.ts → inputs/calendar.d.ts} +8 -19
  34. package/dist/components/{number-field.d.ts → inputs/number-field.d.ts} +4 -15
  35. package/dist/components/{pin-input.d.ts → inputs/pin-input.d.ts} +2 -12
  36. package/dist/components/{slider.d.ts → inputs/slider.d.ts} +4 -14
  37. package/dist/components/{carousel.d.ts → layout/carousel.d.ts} +50 -20
  38. package/dist/components/layout/marquee.d.ts +104 -0
  39. package/dist/components/layout/primitives.d.ts +242 -0
  40. package/dist/components/layout/scroll-area.d.ts +160 -0
  41. package/dist/components/{sortable.d.ts → layout/sortable.d.ts} +3 -12
  42. package/dist/components/{splitter.d.ts → layout/splitter.d.ts} +3 -11
  43. package/dist/components/{tree.d.ts → layout/tree.d.ts} +3 -9
  44. package/dist/components/layout/virtual-list.d.ts +68 -0
  45. package/dist/components/navigation/breadcrumb.d.ts +114 -0
  46. package/dist/components/navigation/pagination.d.ts +221 -0
  47. package/dist/components/navigation/sidebar.d.ts +258 -0
  48. package/dist/components/{dialog.d.ts → navigation/stepper.d.ts} +142 -114
  49. package/dist/components/navigation/table-of-contents.d.ts +60 -0
  50. package/dist/components/navigation/toolbar.d.ts +179 -0
  51. package/dist/components/{menu.d.ts → overlays/dialog.d.ts} +222 -224
  52. package/dist/components/overlays/menu.d.ts +901 -0
  53. package/dist/components/overlays/menubar.d.ts +106 -0
  54. package/dist/components/{navigation-menu.d.ts → overlays/navigation-menu.d.ts} +6 -19
  55. package/dist/components/{popover.d.ts → overlays/popover.d.ts} +6 -9
  56. package/dist/components/overlays/sheet.d.ts +77 -0
  57. package/dist/components/{toast.d.ts → overlays/toast.d.ts} +6 -14
  58. package/dist/components/{tooltip.d.ts → overlays/tooltip.d.ts} +8 -8
  59. package/dist/components/primitives/button.d.ts +102 -0
  60. package/dist/components/primitives/icon.d.ts +79 -0
  61. package/dist/components/primitives/primitives.d.ts +300 -0
  62. package/dist/composables/data-table.d.ts +0 -2
  63. package/dist/composables/observers.d.ts +0 -9
  64. package/dist/composables/presence.d.ts +0 -5
  65. package/dist/icon.d.ts +2 -0
  66. package/dist/icon.js +76 -0
  67. package/dist/index.d.ts +61 -28
  68. package/dist/index.js +4936 -991
  69. package/dist/shared/dismiss.d.ts +0 -8
  70. package/dist/shared/element.d.ts +0 -2
  71. package/dist/shared/floating-props.d.ts +0 -1
  72. package/dist/shared/list.d.ts +0 -7
  73. package/dist/shared/machine.d.ts +0 -17
  74. package/dist/shared/parts.d.ts +1 -2
  75. package/dist/shared/portal.d.ts +1 -10
  76. package/dist/shared/primitive.d.ts +2 -10
  77. package/dist/shared/roving.d.ts +14 -0
  78. package/package.json +16 -3
@@ -1,17 +1,9 @@
1
1
  import { DismissReason, EffectEvent, EventObject } from '@lovince/ui-headless';
2
2
  type Listener = (reason: DismissReason, native: Event) => void;
3
3
  export type DismissRelay = {
4
- /** For `useMachine`'s `beforeSend`: lets a consumer cancel a dismissal before the machine sees it. */
5
4
  readonly filter: (event: EventObject | EffectEvent) => boolean;
6
- /** The content part registers how it reports dismissals (its emits). */
7
5
  readonly listen: (listener: Listener) => void;
8
6
  };
9
- /**
10
- * Consumers hear about a dismissal first — `escapeKeyDown`,
11
- * `pointerDownOutside`, `focusOutside` — and may cancel it with
12
- * `preventDefault()`. An Escape that does dismiss is marked handled, so
13
- * nothing beneath the layer reacts to it too.
14
- */
15
7
  export declare const createDismissRelay: () => DismissRelay;
16
8
  export declare const dismissEmit: (reason: DismissReason) => "escapeKeyDown" | "pointerDownOutside" | "focusOutside";
17
9
  export {};
@@ -1,6 +1,4 @@
1
1
  import { ComponentPublicInstance, Ref } from 'vue';
2
2
  export type ElementRef = Ref<HTMLElement | ComponentPublicInstance | null | undefined>;
3
- /** The DOM element behind a template ref, whether it points at an element or a component. */
4
3
  export declare const toElement: (target: ElementRef | HTMLElement | null | undefined) => HTMLElement | null;
5
- /** Calls `onChange` with the element's real id whenever it differs from the expected one. */
6
4
  export declare const useIdWatch: (target: ElementRef | (() => HTMLElement | null), expected: () => string, onChange: (id: string) => void) => void;
@@ -1,6 +1,5 @@
1
1
  import { PropType } from 'vue';
2
2
  import { Align, Side } from '@lovince/ui-headless';
3
- /** Placement props every floating part takes; the content syncs them into its machine. */
4
3
  export declare const floatingProps: {
5
4
  readonly side: {
6
5
  readonly type: PropType<Side>;
@@ -1,16 +1,9 @@
1
1
  import { ListEnv } from '@lovince/ui-headless';
2
2
  import { ElementRef } from './element';
3
3
  export type ListBinding = ListEnv & {
4
- /** Spread onto each item so it is found in DOM order. */
5
4
  readonly itemAttrs: Readonly<Record<string, string>>;
6
- /** Items call this as they mount and unmount, so connect re-reads the list. */
7
5
  readonly track: () => void;
8
6
  };
9
- /**
10
- * The list environment a connect function needs, read from the DOM. A DOM
11
- * query is not reactive, so items announce themselves and a version counter
12
- * makes every reader recompute — the default tab stop appears once items exist.
13
- */
14
7
  export declare const useListEnv: (container: ElementRef, options?: {
15
8
  readonly includeHidden?: boolean;
16
9
  readonly label?: "text" | "tree";
@@ -4,34 +4,17 @@ export type Controlled<C> = {
4
4
  readonly [K in keyof C]?: () => C[K] | undefined;
5
5
  };
6
6
  export type UseMachineOptions<S extends string, C, E extends EventObject> = {
7
- /** Controlled context: a getter per field, `undefined` meaning the machine owns it. */
8
7
  readonly controlled?: Controlled<C>;
9
- /** Reacts to accepted changes — typically emitting `update:*`. */
10
8
  readonly onChange?: (next: Snapshot<S, C>, previous: Snapshot<S, C>) => void;
11
- /** Runs before any event reaches the machine, effects' included; return false to drop it (a cancelled dismissal). */
12
9
  readonly beforeSend?: (event: E | EffectEvent) => boolean;
13
10
  };
14
11
  export type MachineBinding<S extends string, C, E extends EventObject> = {
15
12
  readonly snapshot: ShallowRef<Snapshot<S, C>>;
16
13
  readonly send: (event: E | EffectEvent) => void;
17
14
  readonly sync: (partial: Partial<C>) => void;
18
- /** Call when a part that an effect needs has mounted. */
19
15
  readonly refresh: () => void;
20
- /** The page's facts for `connect` — measured by the DOM layer, never by the adapter. */
21
16
  readonly query: DomQuery;
22
17
  readonly service: Service<S, C, E>;
23
18
  };
24
- /**
25
- * Runs an engine machine inside a component. The machine decides; this only
26
- * subscribes, feeds controlled props in, and plugs in the DOM layer's effect
27
- * handlers. Effects start on mount, so a server render runs none.
28
- */
29
19
  export declare const useMachine: <S extends string, C, E extends EventObject>(machine: Machine<S, C, E>, context: NoInfer<C>, options?: UseMachineOptions<S, C, E>) => MachineBinding<S, C, E>;
30
- /**
31
- * Engine part props in Vue's terms. Handlers are named like DOM events in the
32
- * engine (`onKeyDown`) and Vue wants them lower-cased after `on`
33
- * (`onKeydown`), or it listens for `key-down`. `false` is dropped, since Vue
34
- * would render `disabled="false"` on a non-button, which still disables it.
35
- * The engine's `type: 'button'` applies only when the part renders a button.
36
- */
37
20
  export declare const normalizeProps: (props: PartProps, as?: string | Component) => Record<string, unknown>;
@@ -1,8 +1,7 @@
1
1
  import { InjectionKey } from 'vue';
2
2
  import { ariaChecked, openState, CheckedState } from '@lovince/ui-headless';
3
- /** Injects a compound component's context, failing loudly when a part is used outside its root. */
4
3
  export declare const useContext: <T>(key: InjectionKey<T>, part: string, root: string) => T;
5
- export { Portal } from './portal';
4
+ export { LvPortal } from './portal';
6
5
  export { ariaChecked, openState, type CheckedState };
7
6
  export declare const checkedState: (checked: CheckedState) => "checked" | "unchecked" | "indeterminate";
8
7
  export declare const dataFlag: (on: boolean) => "" | undefined;
@@ -1,17 +1,9 @@
1
1
  import { PropType } from 'vue';
2
- /**
3
- * Teleports its content, but only once mounted. A server render never emits
4
- * content for a `body` target, so hydrating a Teleport there finds no anchors
5
- * and Vue removes the siblings it mistakes for teleported nodes — the whole
6
- * app root included. Rendering nothing until mounted keeps server and client
7
- * in agreement; overlays are closed on first render, so nothing is lost.
8
- */
9
- export declare const Portal: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ export declare const LvPortal: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
10
3
  to: {
11
4
  type: PropType<string | HTMLElement>;
12
5
  default: string;
13
6
  };
14
- /** Render in place instead of teleporting. */
15
7
  disabled: {
16
8
  type: BooleanConstructor;
17
9
  default: boolean;
@@ -23,7 +15,6 @@ export declare const Portal: import('vue').DefineComponent<import('vue').Extract
23
15
  type: PropType<string | HTMLElement>;
24
16
  default: string;
25
17
  };
26
- /** Render in place instead of teleporting. */
27
18
  disabled: {
28
19
  type: BooleanConstructor;
29
20
  default: boolean;
@@ -1,11 +1,5 @@
1
1
  import { Component, PropType, VNode } from 'vue';
2
- /**
3
- * Renders its single child with this component's attributes merged in:
4
- * classes and styles concatenate, handlers chain, and for any other attribute
5
- * the child's own value wins, because it is what the consumer wrote. This is
6
- * what `asChild` means — behaviour attaches to your element, not a wrapper.
7
- */
8
- export declare const Slot: import('vue').DefineComponent<{}, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
2
+ export declare const LvSlot: import('vue').DefineComponent<{}, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
9
3
  [key: string]: any;
10
4
  }> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
11
5
  export declare const primitiveProps: {
@@ -28,8 +22,7 @@ export declare const buttonPrimitiveProps: {
28
22
  readonly default: false;
29
23
  };
30
24
  };
31
- /** A polymorphic element: `as` swaps the tag or component, `asChild` renders the child instead. */
32
- export declare const Primitive: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
25
+ export declare const LvPrimitive: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
33
26
  readonly as: {
34
27
  readonly type: PropType<string | Component>;
35
28
  readonly default: "div";
@@ -53,5 +46,4 @@ export declare const Primitive: import('vue').DefineComponent<import('vue').Extr
53
46
  readonly as: string | Component;
54
47
  readonly asChild: boolean;
55
48
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
56
- /** `type="button"` only when the part really renders a button, so a form never submits by accident. */
57
49
  export declare const buttonType: (as: string | Component) => "button" | undefined;
@@ -0,0 +1,14 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { Direction, Orientation, RovingApi } from '@lovince/ui-headless';
3
+ import { ListBinding } from './list';
4
+ export type RovingBinding = {
5
+ readonly api: ComputedRef<RovingApi>;
6
+ readonly list: ListBinding;
7
+ readonly root: Ref<null>;
8
+ };
9
+ export declare const useRoving: (options: {
10
+ readonly orientation: () => Orientation;
11
+ readonly dir: () => Direction;
12
+ readonly loop: () => boolean;
13
+ readonly disabled: () => boolean;
14
+ }) => RovingBinding;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovince/ui-vue",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Accessible headless Vue 3 components for Lovince UI — Disclosure, Checkbox, Tabs and Dialog, unstyled.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -54,6 +54,10 @@
54
54
  "types": "./dist/index.d.ts",
55
55
  "import": "./dist/index.js"
56
56
  },
57
+ "./icon": {
58
+ "types": "./dist/icon.d.ts",
59
+ "import": "./dist/icon.js"
60
+ },
57
61
  "./package.json": "./package.json"
58
62
  },
59
63
  "scripts": {
@@ -61,10 +65,19 @@
61
65
  "typecheck": "vue-tsc --noEmit"
62
66
  },
63
67
  "dependencies": {
64
- "@lovince/ui-headless": "^0.1.0",
65
- "@lovince/ui-dom": "^0.1.0"
68
+ "@lovince/ui-headless": "^0.2.0",
69
+ "@lovince/ui-dom": "^0.2.0"
66
70
  },
67
71
  "peerDependencies": {
72
+ "@lovince/icons": "^1.3.1",
68
73
  "vue": "^3.5.0"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "@lovince/icons": {
77
+ "optional": true
78
+ }
79
+ },
80
+ "devDependencies": {
81
+ "@lovince/icons": "^1.4.0"
69
82
  }
70
83
  }