@vizejs/ui 0.709.0 → 0.711.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 (107) hide show
  1. package/README.md +163 -19
  2. package/dist/accordion.d.mts +1 -1
  3. package/dist/action-sheet.d.mts +1 -1
  4. package/dist/alert-dialog.d.mts +1 -1
  5. package/dist/{announcer-DVvPXOat.d.mts → announcer-B8tTsf_z.d.mts} +6 -6
  6. package/dist/announcer.d.mts +1 -1
  7. package/dist/autocomplete.d.mts +1 -1
  8. package/dist/avatar.d.mts +1 -1
  9. package/dist/badge.d.mts +1 -1
  10. package/dist/banner.d.mts +1 -1
  11. package/dist/block-ui.d.mts +1 -1
  12. package/dist/blockquote.d.mts +1 -1
  13. package/dist/{breadcrumb-aITc0VLc.d.mts → breadcrumb-SsZSEerN.d.mts} +1 -1
  14. package/dist/breadcrumb.d.mts +1 -1
  15. package/dist/{button-VVxUavbS.mjs → button-Cc-XkuJl.mjs} +25 -4
  16. package/dist/button.d.mts +2 -2
  17. package/dist/button.mjs +1 -1
  18. package/dist/calendar.d.mts +1 -1
  19. package/dist/callout.d.mts +1 -1
  20. package/dist/card.d.mts +1 -1
  21. package/dist/{cascader-Cjq1lBSV.d.mts → cascader-Dpu7w4FI.d.mts} +2 -2
  22. package/dist/cascader.d.mts +1 -1
  23. package/dist/catalog.d.mts +9 -5
  24. package/dist/catalog.mjs +16 -11
  25. package/dist/chart.d.mts +1 -1
  26. package/dist/checkbox.d.mts +1 -1
  27. package/dist/code.d.mts +1 -1
  28. package/dist/collapsible.d.mts +1 -1
  29. package/dist/color-picker.d.mts +1 -1
  30. package/dist/combobox.d.mts +1 -1
  31. package/dist/command-palette.d.mts +1 -1
  32. package/dist/component-button.css +1 -1
  33. package/dist/confirm.d.mts +1 -1
  34. package/dist/context-menu.d.mts +1 -1
  35. package/dist/copy-button.d.mts +1 -1
  36. package/dist/date-range-picker.d.mts +1 -1
  37. package/dist/dialog.d.mts +1 -1
  38. package/dist/direction.d.mts +1 -1
  39. package/dist/drawer.d.mts +1 -1
  40. package/dist/dropdown-menu.d.mts +1 -1
  41. package/dist/duration-field.d.mts +1 -1
  42. package/dist/empty-state.d.mts +1 -1
  43. package/dist/{field-B2btyUqL.d.mts → field-CVbrh-Mx.d.mts} +1 -1
  44. package/dist/field.d.mts +1 -1
  45. package/dist/fieldset.d.mts +1 -1
  46. package/dist/file-upload.d.mts +1 -1
  47. package/dist/floating-action-button.d.mts +1 -1
  48. package/dist/focus-visible.d.mts +1 -1
  49. package/dist/{form-wizard-D_B-Cydo.d.mts → form-wizard-mErOrBg3.d.mts} +2 -2
  50. package/dist/form-wizard.d.mts +1 -1
  51. package/dist/fullscreen-button.d.mts +1 -1
  52. package/dist/heading.d.mts +1 -1
  53. package/dist/hover-card.d.mts +1 -1
  54. package/dist/icon-button.d.mts +1 -1
  55. package/dist/icon.d.mts +1 -1
  56. package/dist/{button-DuC3YHRk.d.mts → index-BpOePbCq.d.mts} +41 -12
  57. package/dist/index.d.mts +8 -8
  58. package/dist/index.mjs +1 -1
  59. package/dist/kbd.d.mts +1 -1
  60. package/dist/landmark.d.mts +1 -1
  61. package/dist/list.d.mts +1 -1
  62. package/dist/listbox.d.mts +1 -1
  63. package/dist/locale.d.mts +1 -1
  64. package/dist/media-preferences.d.mts +1 -1
  65. package/dist/menu.d.mts +1 -1
  66. package/dist/menubar.d.mts +1 -1
  67. package/dist/month-picker.d.mts +1 -1
  68. package/dist/native-select.d.mts +1 -1
  69. package/dist/navigation-rail.d.mts +1 -1
  70. package/dist/notification-center.d.mts +1 -1
  71. package/dist/pager.d.mts +1 -1
  72. package/dist/pagination.d.mts +1 -1
  73. package/dist/popconfirm.d.mts +1 -1
  74. package/dist/popover.d.mts +1 -1
  75. package/dist/print-button.d.mts +1 -1
  76. package/dist/progress-bar.d.mts +1 -1
  77. package/dist/radio-group.d.mts +1 -1
  78. package/dist/resolver.d.mts +1 -1
  79. package/dist/resolver.mjs +104 -104
  80. package/dist/scroll-area.d.mts +1 -1
  81. package/dist/select.d.mts +1 -1
  82. package/dist/share-button.d.mts +1 -1
  83. package/dist/sidebar.d.mts +1 -1
  84. package/dist/split-button.d.mts +1 -1
  85. package/dist/splitter.d.mts +1 -1
  86. package/dist/status-light.d.mts +1 -1
  87. package/dist/stepper.d.mts +1 -1
  88. package/dist/surface.d.mts +1 -1
  89. package/dist/switch.d.mts +1 -1
  90. package/dist/tabs.d.mts +1 -1
  91. package/dist/tags-input.d.mts +1 -1
  92. package/dist/text.d.mts +1 -1
  93. package/dist/toggle.d.mts +1 -1
  94. package/dist/tooltip.d.mts +1 -1
  95. package/dist/tour.d.mts +1 -1
  96. package/dist/tree.d.mts +1 -1
  97. package/dist/week-picker.d.mts +1 -1
  98. package/package.json +2 -2
  99. package/registry/files/{families/actions → components}/button/button.vue +12 -44
  100. package/registry/files/{families/actions/button/examples/button-basic.vue → components/button/examples/basic.vue} +3 -3
  101. package/registry/files/components/button/index.ts +11 -0
  102. package/registry/files/components/button/styles.css +272 -0
  103. package/registry/files/components/button/types.ts +76 -0
  104. package/registry/registry.json +26 -20
  105. package/registry/files/families/actions/button/button-visual.css +0 -119
  106. package/registry/files/families/actions/button/button.ts +0 -4
  107. /package/registry/files/{families/actions/button/button-keyboard.ts → components/button/keyboard.ts} +0 -0
package/dist/tabs.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { Ab as TabsTriggerState, Cb as TabsListSlotState, Db as TabsState, Eb as TabsSlotState, Ob as TabsTriggerExpose, Sb as TabsListExpose, Tb as TabsRootExpose, _b as TabsActivationMode, bb as TabsContentState, gb as _default, hb as _default$1, jb as TabsValue, kb as TabsTriggerSlotState, mb as _default$2, pb as _default$3, vb as TabsContentExpose, wb as TabsOrientation, xb as TabsDirection, yb as TabsContentSlotState } from "./announcer-DVvPXOat.mjs";
1
+ import { Ab as TabsTriggerState, Cb as TabsListSlotState, Db as TabsState, Eb as TabsSlotState, Ob as TabsTriggerExpose, Sb as TabsListExpose, Tb as TabsRootExpose, _b as TabsActivationMode, bb as TabsContentState, gb as _default, hb as _default$1, jb as TabsValue, kb as TabsTriggerSlotState, mb as _default$2, pb as _default$3, vb as TabsContentExpose, wb as TabsOrientation, xb as TabsDirection, yb as TabsContentSlotState } from "./announcer-B8tTsf_z.mjs";
2
2
  export { _default as Tabs, _default as TabsRoot, type TabsActivationMode, _default$1 as TabsContent, type TabsContentExpose, type TabsContentSlotState, type TabsContentState, type TabsDirection, _default$2 as TabsList, type TabsListExpose, type TabsListSlotState, type TabsOrientation, type TabsRootExpose, type TabsSlotState, type TabsState, _default$3 as TabsTrigger, type TabsTriggerExpose, type TabsTriggerSlotState, type TabsTriggerState, type TabsValue };
@@ -1,2 +1,2 @@
1
- import { Ar as resolveTagEquality, Br as TagsInputBy, Fr as _default$2, Gr as TagsInputItemExpose, Hr as TagsInputInputExpose, Ir as _default$1, Jr as TagsInputRemoveSource, Kr as TagsInputItemSlotState, Lr as _default, Mr as splitTrailingTagText, Nr as _default$4, Or as containsTagDelimiter, Pr as _default$3, Qr as TagsInputValidator, Rr as TagsInputAddSource, Ur as TagsInputInvalidEvent, Vr as TagsInputDirection, Wr as TagsInputInvalidReason, Xr as TagsInputSlotState, Yr as TagsInputRootExpose, Zr as TagsInputState, jr as splitTagText, kr as evaluateTag, qr as TagsInputItemState, zr as TagsInputAriaInvalid } from "./announcer-DVvPXOat.mjs";
1
+ import { Ar as resolveTagEquality, Br as TagsInputBy, Fr as _default$2, Gr as TagsInputItemExpose, Hr as TagsInputInputExpose, Ir as _default$1, Jr as TagsInputRemoveSource, Kr as TagsInputItemSlotState, Lr as _default, Mr as splitTrailingTagText, Nr as _default$4, Or as containsTagDelimiter, Pr as _default$3, Qr as TagsInputValidator, Rr as TagsInputAddSource, Ur as TagsInputInvalidEvent, Vr as TagsInputDirection, Wr as TagsInputInvalidReason, Xr as TagsInputSlotState, Yr as TagsInputRootExpose, Zr as TagsInputState, jr as splitTagText, kr as evaluateTag, qr as TagsInputItemState, zr as TagsInputAriaInvalid } from "./announcer-B8tTsf_z.mjs";
2
2
  export { _default as TagsInput, _default as TagsInputRoot, type TagsInputAddSource, type TagsInputAriaInvalid, type TagsInputBy, type TagsInputDirection, _default$1 as TagsInputInput, type TagsInputInputExpose, type TagsInputInvalidEvent, type TagsInputInvalidReason, _default$2 as TagsInputItem, _default$3 as TagsInputItemDelete, type TagsInputItemExpose, type TagsInputItemSlotState, type TagsInputItemState, _default$4 as TagsInputItemText, type TagsInputRemoveSource, type TagsInputRootExpose, type TagsInputSlotState, type TagsInputState, type TagsInputValidator, containsTagDelimiter, evaluateTag, resolveTagEquality, splitTagText, splitTrailingTagText };
package/dist/text.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $r as _default, ai as TextWeight, ei as TextElement, ii as TextTone, ni as TextSize, ri as TextSlotState, ti as TextExpose } from "./announcer-DVvPXOat.mjs";
1
+ import { $r as _default, ai as TextWeight, ei as TextElement, ii as TextTone, ni as TextSize, ri as TextSlotState, ti as TextExpose } from "./announcer-B8tTsf_z.mjs";
2
2
  export { _default as Text, type TextElement, type TextExpose, type TextSize, type TextSlotState, type TextTone, type TextWeight };
package/dist/toggle.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { Ap as _default, Mp as ToggleSlotState, jp as ToggleExpose } from "./announcer-DVvPXOat.mjs";
1
+ import { Ap as _default, Mp as ToggleSlotState, jp as ToggleExpose } from "./announcer-B8tTsf_z.mjs";
2
2
  export { _default as Toggle, type ToggleExpose, type ToggleSlotState };
@@ -1,2 +1,2 @@
1
- import { Bf as TooltipContentExpose, Gf as TooltipPositionerStrategy, Hf as TooltipDismissEvent, Jf as TooltipState, Kf as TooltipRootExpose, Lf as _default$2, Rf as _default$1, Uf as TooltipEscapeKeyDownEvent, Vf as TooltipContentSlotState, Wf as TooltipPlacement, Xf as TooltipViewport, Yf as TooltipTriggerExpose, qf as TooltipSlotState, zf as _default } from "./announcer-DVvPXOat.mjs";
1
+ import { Bf as TooltipContentExpose, Gf as TooltipPositionerStrategy, Hf as TooltipDismissEvent, Jf as TooltipState, Kf as TooltipRootExpose, Lf as _default$2, Rf as _default$1, Uf as TooltipEscapeKeyDownEvent, Vf as TooltipContentSlotState, Wf as TooltipPlacement, Xf as TooltipViewport, Yf as TooltipTriggerExpose, qf as TooltipSlotState, zf as _default } from "./announcer-B8tTsf_z.mjs";
2
2
  export { _default as Tooltip, _default as TooltipRoot, _default$1 as TooltipContent, type TooltipContentExpose, type TooltipContentSlotState, type TooltipDismissEvent, type TooltipEscapeKeyDownEvent, type TooltipPlacement, type TooltipPositionerStrategy, type TooltipRootExpose, type TooltipSlotState, type TooltipState, _default$2 as TooltipTrigger, type TooltipTriggerExpose, type TooltipViewport };
package/dist/tour.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $c as _default$5, Al as TourStepValue, Cl as TourSlotState, Dl as TourState, El as TourSpotlightSlotState, Jc as _default$10, Kc as padTourRect, Ml as TourTargetState, Ol as TourStepDefinition, Qc as _default$6, Sl as TourRootExpose, Tl as TourSpotlightRect, Xc as _default$8, Yc as _default$9, Zc as _default$7, _l as TourHookResult, al as TourAfterLeave, bl as TourNavigationDirection, cl as TourBeforeEnter, dl as TourContentExpose, el as _default$4, fl as TourContentPlacement, gl as TourDismissReason, hl as TourDirection, il as _default, jl as TourTarget, kl as TourStepSlotState, ll as TourBeforeEnterContext, ml as TourControlSlotState, nl as _default$2, ol as TourAfterLeaveContext, pl as TourContentSlotState, qc as resolveTourTarget, rl as _default$1, sl as TourArrowSlotState, tl as _default$3, ul as TourCloseReason, vl as TourMessages, wl as TourSpotlightExpose, xl as TourProgressSlotState, yl as TourMissingTargetBehavior } from "./announcer-DVvPXOat.mjs";
1
+ import { $c as _default$5, Al as TourStepValue, Cl as TourSlotState, Dl as TourState, El as TourSpotlightSlotState, Jc as _default$10, Kc as padTourRect, Ml as TourTargetState, Ol as TourStepDefinition, Qc as _default$6, Sl as TourRootExpose, Tl as TourSpotlightRect, Xc as _default$8, Yc as _default$9, Zc as _default$7, _l as TourHookResult, al as TourAfterLeave, bl as TourNavigationDirection, cl as TourBeforeEnter, dl as TourContentExpose, el as _default$4, fl as TourContentPlacement, gl as TourDismissReason, hl as TourDirection, il as _default, jl as TourTarget, kl as TourStepSlotState, ll as TourBeforeEnterContext, ml as TourControlSlotState, nl as _default$2, ol as TourAfterLeaveContext, pl as TourContentSlotState, qc as resolveTourTarget, rl as _default$1, sl as TourArrowSlotState, tl as _default$3, ul as TourCloseReason, vl as TourMessages, wl as TourSpotlightExpose, xl as TourProgressSlotState, yl as TourMissingTargetBehavior } from "./announcer-B8tTsf_z.mjs";
2
2
  export { _default as Tour, _default as TourRoot, type TourAfterLeave, type TourAfterLeaveContext, _default$1 as TourArrow, type TourArrowSlotState, type TourBeforeEnter, type TourBeforeEnterContext, _default$2 as TourClose, type TourCloseReason, _default$3 as TourContent, type TourContentExpose, type TourContentPlacement, type TourContentSlotState, type TourControlSlotState, _default$4 as TourDescription, type TourDirection, type TourDismissReason, type TourHookResult, type TourMessages, type TourMissingTargetBehavior, type TourNavigationDirection, _default$5 as TourNext, _default$6 as TourPrev, _default$7 as TourProgress, type TourProgressSlotState, type TourRootExpose, type TourSlotState, _default$8 as TourSpotlight, type TourSpotlightExpose, type TourSpotlightRect, type TourSpotlightSlotState, type TourState, _default$9 as TourStep, type TourStepDefinition, type TourStepSlotState, type TourStepValue, type TourTarget, type TourTargetState, _default$10 as TourTitle, padTourRect, resolveTourTarget };
package/dist/tree.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { At as TreeItemState, Bt as TreeSlotState, Ct as TreeCheckPropagation, Dt as TreeFlatNode, Et as TreeDropPosition, Ft as TreeReorderController, Ht as TreeVirtualizer, It as TreeReorderItemRegistration, Lt as TreeReorderOptions, Mt as TreeLoadContext, Nt as TreeLoadState, Ot as TreeItemExpose, Pt as TreeMoveEvent, Rt as TreeRootExpose, St as _default, Tt as TreeDirection, Ut as TreeVirtualizerOptions, Vt as TreeState, Wt as TreeVirtualizerSource, _t as useTreeVirtualizer, bt as _default$2, dt as TreeIndexEntry, ft as deriveTreeCheckedStates, gt as toggleTreeChecked, ht as normalizeTreeChecked, jt as TreeKey, kt as TreeItemSlotState, lt as TreeIndex, mt as indexTree, pt as flattenVisibleTree, ut as TreeIndexAccessors, vt as useTreeReorder, wt as TreeCheckedState, xt as _default$1, yt as _default$3, zt as TreeSelectionMode } from "./announcer-DVvPXOat.mjs";
1
+ import { At as TreeItemState, Bt as TreeSlotState, Ct as TreeCheckPropagation, Dt as TreeFlatNode, Et as TreeDropPosition, Ft as TreeReorderController, Ht as TreeVirtualizer, It as TreeReorderItemRegistration, Lt as TreeReorderOptions, Mt as TreeLoadContext, Nt as TreeLoadState, Ot as TreeItemExpose, Pt as TreeMoveEvent, Rt as TreeRootExpose, St as _default, Tt as TreeDirection, Ut as TreeVirtualizerOptions, Vt as TreeState, Wt as TreeVirtualizerSource, _t as useTreeVirtualizer, bt as _default$2, dt as TreeIndexEntry, ft as deriveTreeCheckedStates, gt as toggleTreeChecked, ht as normalizeTreeChecked, jt as TreeKey, kt as TreeItemSlotState, lt as TreeIndex, mt as indexTree, pt as flattenVisibleTree, ut as TreeIndexAccessors, vt as useTreeReorder, wt as TreeCheckedState, xt as _default$1, yt as _default$3, zt as TreeSelectionMode } from "./announcer-B8tTsf_z.mjs";
2
2
  export { _default as Tree, _default as TreeRoot, type TreeCheckPropagation, type TreeCheckedState, type TreeDirection, type TreeDropPosition, type TreeFlatNode, type TreeIndex, type TreeIndexAccessors, type TreeIndexEntry, _default$1 as TreeItem, _default$2 as TreeItemCheckbox, type TreeItemExpose, type TreeItemSlotState, type TreeItemState, _default$3 as TreeItemToggle, type TreeKey, type TreeLoadContext, type TreeLoadState, type TreeMoveEvent, type TreeReorderController, type TreeReorderItemRegistration, type TreeReorderOptions, type TreeRootExpose, type TreeSelectionMode, type TreeSlotState, type TreeState, type TreeVirtualizer, type TreeVirtualizerOptions, type TreeVirtualizerSource, deriveTreeCheckedStates, flattenVisibleTree, indexTree, normalizeTreeChecked, toggleTreeChecked, useTreeReorder, useTreeVirtualizer };
@@ -1,4 +1,4 @@
1
1
  import { S as formatIsoDate, i as IsoWeek, r as DateRange, s as PlainDate, z as parseIsoDate } from "./plain-date-By3bTWQG.mjs";
2
- import { Bb as weekOf, Rb as WeekPickerRootExpose, Vb as _default, zb as WeekSelection } from "./announcer-DVvPXOat.mjs";
2
+ import { Bb as weekOf, Rb as WeekPickerRootExpose, Vb as _default, zb as WeekSelection } from "./announcer-B8tTsf_z.mjs";
3
3
  import { a as _default$2, i as _default$3, n as _default$5, o as _default$1, r as _default$4, t as _default$6 } from "./calendar-year-select.vue-BohqVCaU.mjs";
4
4
  export { type DateRange, type IsoWeek, type PlainDate, _default as WeekPicker, _default as WeekPickerRoot, _default$1 as WeekPickerGrid, _default$2 as WeekPickerHeading, _default$3 as WeekPickerMonthSelect, _default$4 as WeekPickerNext, _default$5 as WeekPickerPrev, type WeekPickerRootExpose, _default$6 as WeekPickerYearSelect, type WeekSelection, formatIsoDate, parseIsoDate, weekOf };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/ui",
3
- "version": "0.709.0",
3
+ "version": "0.711.0",
4
4
  "description": "Accessible, headless, Native CSS-first UI primitives",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -1170,7 +1170,7 @@
1170
1170
  "@tsdown/css": "0.22.14",
1171
1171
  "@types/node": "25.9.2",
1172
1172
  "@vitejs/plugin-vue": "6.0.7",
1173
- "@vizejs/native": "0.709.0",
1173
+ "@vizejs/native": "0.711.0",
1174
1174
  "@vue/compiler-sfc": "3.5.35",
1175
1175
  "@vue/test-utils": "2.4.10",
1176
1176
  "happy-dom": "21.0.4",
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, useTemplateRef } from "vue";
3
3
 
4
- import { getButtonKeyboardAction } from "./button-keyboard.ts";
5
- import type { ButtonKeyboardPhase } from "./button-keyboard.ts";
6
- import type { PrimitiveAs, PrimitiveElement } from "../../foundations/primitive/primitive.ts";
4
+ import { getButtonKeyboardAction } from "./keyboard.ts";
5
+ import type { ButtonKeyboardPhase } from "./keyboard.ts";
6
+ import type { ButtonProps, ButtonSlotProps } from "./types.ts";
7
+ import type { PrimitiveElement } from "../../families/foundations/primitive/primitive.ts";
7
8
 
8
9
  const {
9
10
  as = "button",
@@ -11,42 +12,10 @@ const {
11
12
  type = "button",
12
13
  disabled = false,
13
14
  loading = false,
14
- } = defineProps<{
15
- /**
16
- * Native element, custom element, or component to render.
17
- *
18
- * @default "button"
19
- */
20
- readonly as?: PrimitiveAs;
21
-
22
- /**
23
- * Whether the rendered target already implements native button semantics.
24
- *
25
- * @default true when `as` is "button"; otherwise false
26
- */
27
- readonly native?: boolean;
28
-
29
- /**
30
- * Native button submission behavior.
31
- *
32
- * @default "button"
33
- */
34
- readonly type?: "button" | "reset" | "submit";
35
-
36
- /**
37
- * Remove the control from activation and sequential keyboard focus.
38
- *
39
- * @default false
40
- */
41
- readonly disabled?: boolean;
42
-
43
- /**
44
- * Announce in-progress work and prevent repeated activation while preserving focus.
45
- *
46
- * @default false
47
- */
48
- readonly loading?: boolean;
49
- }>();
15
+ variant = "solid",
16
+ tone = "accent",
17
+ size = "md",
18
+ } = defineProps<ButtonProps>();
50
19
 
51
20
  const emit = defineEmits<{
52
21
  /**
@@ -59,11 +28,7 @@ const emit = defineEmits<{
59
28
 
60
29
  defineSlots<{
61
30
  /** Renders the button contents with current availability state. */
62
- default(props: {
63
- readonly disabled: boolean;
64
- readonly loading: boolean;
65
- readonly unavailable: boolean;
66
- }): unknown;
31
+ default(props: ButtonSlotProps): unknown;
67
32
  }>();
68
33
 
69
34
  const element = useTemplateRef<PrimitiveElement>("element");
@@ -136,6 +101,9 @@ defineExpose({ element, focus });
136
101
  :aria-busy="loading ? 'true' : undefined"
137
102
  data-vize-ui="button"
138
103
  :data-state="disabled ? 'disabled' : loading ? 'loading' : 'idle'"
104
+ :data-variant="variant"
105
+ :data-tone="tone"
106
+ :data-size="size"
139
107
  @click="onClick"
140
108
  @keydown="onKeydown"
141
109
  @keyup="onKeyup"
@@ -2,7 +2,7 @@
2
2
  <script setup lang="ts">
3
3
  import { ref } from "vue";
4
4
 
5
- import { Button } from "../button.ts";
5
+ import { Button } from "../index.ts";
6
6
 
7
7
  const saves = ref(0);
8
8
  </script>
@@ -10,10 +10,10 @@ const saves = ref(0);
10
10
  <template>
11
11
  <div>
12
12
  <Button type="button" @press="() => (saves += 1)">Save draft</Button>
13
- <Button v-slot="{ loading }" type="button" loading>
13
+ <Button v-slot="{ loading }" type="button" variant="outline" tone="neutral" loading>
14
14
  {{ loading ? "Uploading…" : "Upload" }}
15
15
  </Button>
16
- <Button type="button" disabled>Publish</Button>
16
+ <Button type="button" variant="quiet" tone="danger" disabled>Publish</Button>
17
17
  <output>Saved {{ saves }} times</output>
18
18
  </div>
19
19
  </template>
@@ -0,0 +1,11 @@
1
+ export * from "./keyboard.ts";
2
+ export type {
3
+ ButtonProps,
4
+ ButtonSize,
5
+ ButtonSlotProps,
6
+ ButtonTone,
7
+ ButtonVariant,
8
+ } from "./types.ts";
9
+
10
+ /** Accessible, unstyled button with polymorphic rendering. */
11
+ export { default as Button } from "./button.vue";
@@ -0,0 +1,272 @@
1
+ /*
2
+ * Button visuals are optional. Behavior lives in button.vue; this file only
3
+ * consumes its typed data attributes and the public theme token contract.
4
+ */
5
+ @layer vize.preset {
6
+ /* Component-level design decisions. Presets override only these hooks. */
7
+ :where([data-vize-ui="button"]) {
8
+ --vize-ui-button-fill: var(--vize-ui-color-accent);
9
+ --vize-ui-button-ink: var(--vize-ui-color-accent-contrast);
10
+ --vize-ui-button-radius: var(--vize-ui-radius-md);
11
+ --vize-ui-button-shadow: var(--vize-ui-elevation-raised);
12
+ --vize-ui-button-shadow-hover: var(--vize-ui-elevation-overlay);
13
+ --vize-ui-button-hover-strength: 90%;
14
+ --vize-ui-button-tint-strength: 10%;
15
+ --vize-ui-button-hover-lift: -1px;
16
+ --vize-ui-button-press-depth: 1px;
17
+ --vize-ui-button-press-scale: 0.985;
18
+
19
+ appearance: none;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ gap: var(--vize-ui-space-sm);
24
+ min-block-size: var(--vize-ui-size-control-md);
25
+ padding-inline: var(--vize-ui-space-lg);
26
+ border: var(--vize-ui-border-width-thin) solid var(--vize-ui-button-fill);
27
+ border-radius: var(--vize-ui-button-radius);
28
+ background: var(--vize-ui-button-fill);
29
+ color: var(--vize-ui-button-ink);
30
+ box-shadow: var(--vize-ui-button-shadow);
31
+ font-family: var(--vize-ui-type-family-sans);
32
+ font-size: var(--vize-ui-type-size-sm);
33
+ font-weight: var(--vize-ui-type-weight-medium);
34
+ line-height: var(--vize-ui-type-leading-tight);
35
+ text-align: center;
36
+ text-decoration: none;
37
+ white-space: nowrap;
38
+ cursor: pointer;
39
+ touch-action: manipulation;
40
+ transform-origin: center;
41
+ transition:
42
+ background-color var(--vize-ui-motion-duration-fast, 120ms)
43
+ var(--vize-ui-motion-ease-standard, ease-out),
44
+ border-color var(--vize-ui-motion-duration-fast, 120ms)
45
+ var(--vize-ui-motion-ease-standard, ease-out),
46
+ color var(--vize-ui-motion-duration-fast, 120ms) var(--vize-ui-motion-ease-standard, ease-out),
47
+ box-shadow var(--vize-ui-motion-duration-fast, 120ms)
48
+ var(--vize-ui-motion-ease-standard, ease-out),
49
+ scale var(--vize-ui-motion-duration-fast, 120ms) var(--vize-ui-motion-ease-standard, ease-out),
50
+ translate var(--vize-ui-motion-duration-fast, 120ms)
51
+ var(--vize-ui-motion-ease-standard, ease-out);
52
+
53
+ /* Semantic tones keep behavior and authored labels palette-independent. */
54
+ &:where([data-tone="neutral"]) {
55
+ --vize-ui-button-fill: var(--vize-ui-color-neutral);
56
+ --vize-ui-button-ink: var(--vize-ui-color-neutral-contrast);
57
+ }
58
+
59
+ &:where([data-tone="danger"]) {
60
+ --vize-ui-button-fill: var(--vize-ui-color-danger);
61
+ --vize-ui-button-ink: var(--vize-ui-color-danger-contrast);
62
+ }
63
+
64
+ /* Variants share tone, focus, sizing, and interaction behavior. */
65
+ &:where([data-variant="outline"]) {
66
+ border-color: color-mix(
67
+ in oklab,
68
+ var(--vize-ui-button-fill) 72%,
69
+ var(--vize-ui-color-border)
70
+ );
71
+ background: transparent;
72
+ color: var(--vize-ui-button-fill);
73
+ box-shadow: none;
74
+ }
75
+
76
+ &:where([data-variant="quiet"]) {
77
+ border-color: transparent;
78
+ background: transparent;
79
+ color: var(--vize-ui-button-fill);
80
+ box-shadow: none;
81
+ }
82
+
83
+ /* Size is a typed API. Pointer policy may increase the physical target. */
84
+ &:where([data-size="sm"]) {
85
+ min-block-size: var(--vize-ui-size-control-sm);
86
+ padding-inline: var(--vize-ui-space-md);
87
+ font-size: var(--vize-ui-type-size-xs);
88
+ }
89
+
90
+ &:where([data-size="lg"]) {
91
+ min-block-size: var(--vize-ui-size-control-lg);
92
+ padding-inline: var(--vize-ui-space-xl);
93
+ font-size: var(--vize-ui-type-size-md);
94
+ }
95
+
96
+ &:where(:focus-visible) {
97
+ outline: var(--vize-ui-focus-ring-width) solid var(--vize-ui-focus-ring-color);
98
+ outline-offset: var(--vize-ui-focus-ring-offset);
99
+ }
100
+
101
+ &:where([data-state="idle"]):active {
102
+ scale: var(--vize-ui-button-press-scale);
103
+ translate: 0 var(--vize-ui-button-press-depth);
104
+ box-shadow: none;
105
+ transition-duration: var(--vize-ui-motion-duration-instant, 0ms);
106
+ }
107
+
108
+ &:where([data-state="disabled"], [data-state="loading"]) {
109
+ opacity: var(--vize-ui-opacity-disabled);
110
+ cursor: default;
111
+ box-shadow: none;
112
+ }
113
+
114
+ &:where([data-state="loading"]) {
115
+ cursor: progress;
116
+
117
+ &::before {
118
+ box-sizing: border-box;
119
+ inline-size: 0.875em;
120
+ block-size: 0.875em;
121
+ border: 0.125em solid currentColor;
122
+ border-inline-end-color: transparent;
123
+ border-radius: 50%;
124
+ content: "";
125
+ animation: button-progress 720ms linear infinite;
126
+ }
127
+ }
128
+
129
+ /* Hover motion only runs on available controls and devices that hover. */
130
+ @media (hover: hover) {
131
+ &:where([data-state="idle"]) {
132
+ &:hover {
133
+ background: color-mix(
134
+ in oklab,
135
+ var(--vize-ui-button-fill) var(--vize-ui-button-hover-strength),
136
+ var(--vize-ui-color-text)
137
+ );
138
+ box-shadow: var(--vize-ui-button-shadow-hover);
139
+ translate: 0 var(--vize-ui-button-hover-lift);
140
+ }
141
+
142
+ &:where([data-variant="outline"], [data-variant="quiet"]) {
143
+ &:hover {
144
+ background: color-mix(
145
+ in oklab,
146
+ var(--vize-ui-button-fill) var(--vize-ui-button-tint-strength),
147
+ transparent
148
+ );
149
+ color: var(--vize-ui-color-text);
150
+ }
151
+ }
152
+ }
153
+ }
154
+
155
+ /* Touch targets remain at least 44 CSS pixels regardless of visual size. */
156
+ @media (any-pointer: coarse) {
157
+ min-block-size: max(var(--vize-ui-size-control-md), 2.75rem);
158
+ }
159
+ }
160
+
161
+ /* Preset voices change geometry, typography, depth, and motion—not just hue. */
162
+ :where([data-vize-theme~="paper"], :host([data-vize-theme~="paper"])) {
163
+ :where([data-vize-ui="button"]) {
164
+ --vize-ui-button-radius: 0.1875rem;
165
+ --vize-ui-button-shadow: none;
166
+ --vize-ui-button-shadow-hover: 0 2px 0 -1px var(--vize-ui-color-border);
167
+ --vize-ui-button-hover-lift: 0px;
168
+ --vize-ui-button-press-scale: 1;
169
+
170
+ font-weight: var(--vize-ui-type-weight-bold);
171
+ letter-spacing: 0.025em;
172
+ }
173
+ }
174
+
175
+ :where([data-vize-theme~="signal"], :host([data-vize-theme~="signal"])) {
176
+ :where([data-vize-ui="button"]) {
177
+ --vize-ui-button-radius: 0.125rem;
178
+ --vize-ui-button-shadow: none;
179
+ --vize-ui-button-shadow-hover: none;
180
+ --vize-ui-button-hover-strength: 86%;
181
+ --vize-ui-button-hover-lift: 0px;
182
+ --vize-ui-button-press-depth: 0px;
183
+
184
+ min-block-size: var(--vize-ui-size-control-sm);
185
+ padding-inline: var(--vize-ui-space-md);
186
+ font-family: var(--vize-ui-type-family-mono);
187
+ letter-spacing: 0.01em;
188
+ }
189
+ }
190
+
191
+ :where([data-vize-theme~="midnight"], :host([data-vize-theme~="midnight"])) {
192
+ :where([data-vize-ui="button"]) {
193
+ --vize-ui-button-radius: 0.625rem;
194
+ --vize-ui-button-shadow:
195
+ 0 1px 0 oklch(0.98 0.02 265 / 0.12) inset, 0 8px 24px oklch(0.04 0.03 270 / 0.28);
196
+ --vize-ui-button-shadow-hover:
197
+ 0 1px 0 oklch(0.98 0.02 265 / 0.16) inset, 0 12px 30px oklch(0.04 0.03 270 / 0.38);
198
+ }
199
+ }
200
+
201
+ :where([data-vize-theme~="play"], :host([data-vize-theme~="play"])) {
202
+ :where([data-vize-ui="button"]) {
203
+ --vize-ui-button-radius: var(--vize-ui-radius-full);
204
+ --vize-ui-button-shadow:
205
+ 0 2px 0 oklch(1 0 0 / 0.2) inset, 0 5px 0 -2px var(--vize-ui-color-border),
206
+ 0 10px 24px oklch(0.35 0.12 330 / 0.13);
207
+ --vize-ui-button-shadow-hover:
208
+ 0 2px 0 oklch(1 0 0 / 0.24) inset, 0 6px 0 -2px var(--vize-ui-color-border),
209
+ 0 14px 30px oklch(0.35 0.12 330 / 0.17);
210
+ --vize-ui-button-hover-strength: 94%;
211
+ --vize-ui-button-hover-lift: -2px;
212
+ --vize-ui-button-press-depth: 2px;
213
+ --vize-ui-button-press-scale: 0.975;
214
+
215
+ font-weight: var(--vize-ui-type-weight-bold);
216
+ }
217
+ }
218
+
219
+ :where([data-vize-theme~="high-contrast"], :host([data-vize-theme~="high-contrast"])) {
220
+ :where([data-vize-ui="button"]) {
221
+ --vize-ui-button-radius: 0;
222
+ --vize-ui-button-shadow: none;
223
+ --vize-ui-button-shadow-hover: none;
224
+ --vize-ui-button-hover-lift: 0px;
225
+ --vize-ui-button-press-depth: 0px;
226
+ --vize-ui-button-press-scale: 1;
227
+
228
+ font-weight: var(--vize-ui-type-weight-bold);
229
+ }
230
+ }
231
+
232
+ @keyframes button-progress {
233
+ to {
234
+ rotate: 1turn;
235
+ }
236
+ }
237
+ }
238
+
239
+ @layer vize.policy {
240
+ :where([data-vize-ui="button"]) {
241
+ @media (prefers-reduced-motion: reduce) {
242
+ scale: none;
243
+ translate: none;
244
+ transition-duration: 0ms;
245
+
246
+ &:where([data-state="loading"])::before {
247
+ animation: none;
248
+ }
249
+ }
250
+
251
+ @media (forced-colors: active) {
252
+ border-color: ButtonBorder;
253
+ background: ButtonFace;
254
+ color: ButtonText;
255
+ box-shadow: none;
256
+
257
+ &:where([data-variant="solid"]) {
258
+ background: Highlight;
259
+ color: HighlightText;
260
+ }
261
+
262
+ &:focus-visible {
263
+ outline-color: Highlight;
264
+ }
265
+
266
+ &:where([data-state="disabled"], [data-state="loading"]) {
267
+ color: GrayText;
268
+ opacity: 1;
269
+ }
270
+ }
271
+ }
272
+ }
@@ -0,0 +1,76 @@
1
+ import type { PrimitiveAs } from "../../families/foundations/primitive/primitive.ts";
2
+
3
+ /** Visual treatment exposed as a stable styling hook. */
4
+ export type ButtonVariant = "solid" | "outline" | "quiet";
5
+
6
+ /** Semantic emphasis used by optional visual presets. */
7
+ export type ButtonTone = "accent" | "neutral" | "danger";
8
+
9
+ /** Density-independent control size. */
10
+ export type ButtonSize = "sm" | "md" | "lg";
11
+
12
+ /** Public props shared by the SFC, source registry, and consumer type tests. */
13
+ export interface ButtonProps {
14
+ /**
15
+ * Native element, custom element, or component to render.
16
+ *
17
+ * @default "button"
18
+ */
19
+ readonly as?: PrimitiveAs;
20
+
21
+ /**
22
+ * Whether the rendered target already implements native button semantics.
23
+ *
24
+ * @default true when `as` is "button"; otherwise false
25
+ */
26
+ readonly native?: boolean;
27
+
28
+ /**
29
+ * Native button submission behavior.
30
+ *
31
+ * @default "button"
32
+ */
33
+ readonly type?: "button" | "reset" | "submit";
34
+
35
+ /**
36
+ * Remove the control from activation and sequential keyboard focus.
37
+ *
38
+ * @default false
39
+ */
40
+ readonly disabled?: boolean;
41
+
42
+ /**
43
+ * Announce in-progress work and prevent repeated activation while preserving focus.
44
+ *
45
+ * @default false
46
+ */
47
+ readonly loading?: boolean;
48
+
49
+ /**
50
+ * Stable styling hook for filled, bordered, or low-emphasis actions.
51
+ *
52
+ * @default "solid"
53
+ */
54
+ readonly variant?: ButtonVariant;
55
+
56
+ /**
57
+ * Semantic styling hook. It never changes button behavior or accessible semantics.
58
+ *
59
+ * @default "accent"
60
+ */
61
+ readonly tone?: ButtonTone;
62
+
63
+ /**
64
+ * Stable sizing hook. Coarse pointers retain the accessible minimum target size.
65
+ *
66
+ * @default "md"
67
+ */
68
+ readonly size?: ButtonSize;
69
+ }
70
+
71
+ /** State passed to the default slot. */
72
+ export interface ButtonSlotProps {
73
+ readonly disabled: boolean;
74
+ readonly loading: boolean;
75
+ readonly unavailable: boolean;
76
+ }
@@ -3,7 +3,7 @@
3
3
  "registryKind": "vize-lib",
4
4
  "package": {
5
5
  "name": "@vizejs/ui",
6
- "version": "0.709.0"
6
+ "version": "0.711.0"
7
7
  },
8
8
  "kind": "ui",
9
9
  "filesDirectory": "files",
@@ -1352,31 +1352,37 @@
1352
1352
  "button primitive"
1353
1353
  ],
1354
1354
  "packageSubpath": "./button",
1355
- "entry": "families/actions/button/button.ts",
1355
+ "entry": "components/button/index.ts",
1356
1356
  "files": [
1357
1357
  {
1358
- "path": "families/actions/button/button-keyboard.ts",
1358
+ "path": "components/button/button.vue",
1359
+ "role": "component",
1360
+ "sha256": "45f91a1f553f16d66d0f7ac480c8d35e8ed25ea2c90b4f684b25f666d43edbb2",
1361
+ "size": 3161
1362
+ },
1363
+ {
1364
+ "path": "components/button/index.ts",
1365
+ "role": "entry",
1366
+ "sha256": "b12f5a8e75f095fd285947a2e2473a78c6ac3ed3847c2d5c07df8c14b6eafacb",
1367
+ "size": 259
1368
+ },
1369
+ {
1370
+ "path": "components/button/keyboard.ts",
1359
1371
  "role": "module",
1360
1372
  "sha256": "a34ca324cbec6eef9401862e9b044f0bc316f9dbbdefa10bbc7762710467f010",
1361
1373
  "size": 776
1362
1374
  },
1363
1375
  {
1364
- "path": "families/actions/button/button-visual.css",
1376
+ "path": "components/button/styles.css",
1365
1377
  "role": "style",
1366
- "sha256": "c7d0f30fba93f9bb6ba389064454c74180ee08c83865511874e6dd2497213c1b",
1367
- "size": 4318
1378
+ "sha256": "3089213cd36aaaccc105012225d924bd55ae573511275739227fd96b468b9c90",
1379
+ "size": 9184
1368
1380
  },
1369
1381
  {
1370
- "path": "families/actions/button/button.ts",
1371
- "role": "entry",
1372
- "sha256": "8d9b61f6bb96b4464a2c2d455ec602e55e7379ed278ce034229dc1d561601e2e",
1373
- "size": 152
1374
- },
1375
- {
1376
- "path": "families/actions/button/button.vue",
1377
- "role": "component",
1378
- "sha256": "23b6474ed4106bfb9e4a55ccd1507286c978df263f419798b40810062ef628df",
1379
- "size": 3805
1382
+ "path": "components/button/types.ts",
1383
+ "role": "module",
1384
+ "sha256": "69ada94e51e789bc85aef31efc7b63f9dede53ca32d6a5a173b51e51b6a49675",
1385
+ "size": 1887
1380
1386
  }
1381
1387
  ],
1382
1388
  "registryDependencies": [
@@ -1389,14 +1395,14 @@
1389
1395
  "kind": "peer"
1390
1396
  }
1391
1397
  ],
1392
- "contentHash": "f9271cb234fdb4da7e7624bd8bb590096bacd7ab141e27fff9092ce2a0cf66ab",
1398
+ "contentHash": "efd360b11fbb19091c30e4557ecf332f6252154aaaad07da74b11b88dd04b6dc",
1393
1399
  "examples": [
1394
1400
  {
1395
- "path": "families/actions/button/examples/button-basic.vue",
1401
+ "path": "components/button/examples/basic.vue",
1396
1402
  "title": "Basic",
1397
1403
  "description": "Native buttons showing press handling, a loading state, and a disabled action.",
1398
- "sha256": "a0a9193b2b7c3b3e4c0f2d6109bebf0dbcd7ac729f971afac53635292eb91eee",
1399
- "size": 543
1404
+ "sha256": "fef1a53e81fe1bf96307dbf810427882ee896a501568d4a2e8a794b478439379",
1405
+ "size": 605
1400
1406
  }
1401
1407
  ]
1402
1408
  },