@hina-ui/vue 1.0.0 → 1.1.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 (70) hide show
  1. package/dist/index.js +299 -84
  2. package/dist/index.js.map +1 -1
  3. package/dist/types/components/checkbox/Checkbox.vue.d.ts +2 -0
  4. package/dist/types/components/checkbox/Checkbox.vue.d.ts.map +1 -1
  5. package/dist/types/components/checkbox/checkbox.variants.d.ts +75 -2
  6. package/dist/types/components/checkbox/checkbox.variants.d.ts.map +1 -1
  7. package/dist/types/components/checkbox-group/CheckboxGroup.vue.d.ts +2 -0
  8. package/dist/types/components/checkbox-group/CheckboxGroup.vue.d.ts.map +1 -1
  9. package/dist/types/components/checkbox-group/checkbox-group.variants.d.ts +34 -0
  10. package/dist/types/components/checkbox-group/checkbox-group.variants.d.ts.map +1 -1
  11. package/dist/types/components/combobox/Combobox.vue.d.ts.map +1 -1
  12. package/dist/types/components/date-picker/DatePicker.vue.d.ts.map +1 -1
  13. package/dist/types/components/date-range-picker/DateRangePicker.vue.d.ts.map +1 -1
  14. package/dist/types/components/date-time-picker/DateTimePicker.vue.d.ts.map +1 -1
  15. package/dist/types/components/form-field/FormField.vue.d.ts +7 -4
  16. package/dist/types/components/form-field/FormField.vue.d.ts.map +1 -1
  17. package/dist/types/components/form-field/form-field.variants.d.ts +73 -1
  18. package/dist/types/components/form-field/form-field.variants.d.ts.map +1 -1
  19. package/dist/types/components/form-field/types.d.ts +6 -0
  20. package/dist/types/components/form-field/types.d.ts.map +1 -0
  21. package/dist/types/components/form-layout/FormLayout.vue.d.ts +2 -1
  22. package/dist/types/components/form-layout/FormLayout.vue.d.ts.map +1 -1
  23. package/dist/types/components/form-layout/context.d.ts +7 -0
  24. package/dist/types/components/form-layout/context.d.ts.map +1 -0
  25. package/dist/types/components/input/InputBase.vue.d.ts.map +1 -1
  26. package/dist/types/components/input/input.variants.d.ts +1 -1
  27. package/dist/types/components/input/input.variants.d.ts.map +1 -1
  28. package/dist/types/components/input-group/InputGroup.vue.d.ts.map +1 -1
  29. package/dist/types/components/multi-combobox/MultiCombobox.vue.d.ts.map +1 -1
  30. package/dist/types/components/multi-select/MultiSelect.vue.d.ts.map +1 -1
  31. package/dist/types/components/number-input/NumberInput.vue.d.ts.map +1 -1
  32. package/dist/types/components/radio-group/RadioGroup.vue.d.ts +2 -0
  33. package/dist/types/components/radio-group/RadioGroup.vue.d.ts.map +1 -1
  34. package/dist/types/components/select/Select.vue.d.ts.map +1 -1
  35. package/dist/types/components/switch/Switch.vue.d.ts +3 -0
  36. package/dist/types/components/switch/Switch.vue.d.ts.map +1 -1
  37. package/dist/types/components/tags-input/TagsInput.vue.d.ts.map +1 -1
  38. package/dist/types/components/textarea/Textarea.vue.d.ts.map +1 -1
  39. package/dist/types/components/tree-select/TreeSelect.vue.d.ts.map +1 -1
  40. package/dist/types/index.d.ts +1 -0
  41. package/dist/types/index.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/src/components/checkbox/Checkbox.vue +25 -4
  44. package/src/components/checkbox/checkbox.variants.ts +34 -3
  45. package/src/components/checkbox-group/CheckboxGroup.vue +11 -2
  46. package/src/components/checkbox-group/checkbox-group.variants.ts +9 -0
  47. package/src/components/combobox/Combobox.vue +1 -0
  48. package/src/components/date-picker/DatePicker.vue +1 -0
  49. package/src/components/date-range-picker/DateRangePicker.vue +1 -0
  50. package/src/components/date-time-picker/DateTimePicker.vue +1 -0
  51. package/src/components/form-field/FormField.vue +82 -37
  52. package/src/components/form-field/form-field.variants.ts +39 -0
  53. package/src/components/form-field/types.ts +5 -0
  54. package/src/components/form-layout/FormLayout.vue +13 -7
  55. package/src/components/form-layout/context.ts +19 -0
  56. package/src/components/input/InputBase.vue +1 -0
  57. package/src/components/input/input.variants.ts +7 -3
  58. package/src/components/input-group/InputGroup.vue +5 -1
  59. package/src/components/multi-combobox/MultiCombobox.vue +1 -0
  60. package/src/components/multi-select/MultiSelect.vue +1 -0
  61. package/src/components/number-input/NumberInput.vue +1 -0
  62. package/src/components/radio-group/RadioGroup.vue +26 -5
  63. package/src/components/select/Select.vue +1 -0
  64. package/src/components/switch/Switch.vue +26 -4
  65. package/src/components/tags-input/TagsInput.vue +1 -0
  66. package/src/components/textarea/Textarea.vue +1 -0
  67. package/src/components/textarea/textarea.variants.ts +1 -1
  68. package/src/components/tree-select/TreeSelect.vue +1 -0
  69. package/src/index.ts +1 -0
  70. package/src/styles/interaction.css +2 -2
package/dist/index.js CHANGED
@@ -5361,7 +5361,7 @@ function focusFieldFrom(root, target) {
5361
5361
  //#endregion
5362
5362
  //#region src/components/input/input.variants.ts
5363
5363
  var inputHost = tv({
5364
- base: ["hn-field text-fg flex w-full min-w-0 cursor-text items-stretch overflow-hidden rounded-md border font-medium", "has-disabled:cursor-not-allowed has-disabled:opacity-50"],
5364
+ base: ["group/hn-field hn-field text-fg flex w-full min-w-0 cursor-text items-stretch overflow-hidden rounded-md border font-medium", "data-disabled:cursor-not-allowed data-disabled:opacity-50"],
5365
5365
  variants: {
5366
5366
  variant: {
5367
5367
  primary: "border-line [--hn-field-bg:var(--hn-surface)] [--hn-field-shadow:var(--hn-shadow-sm)]",
@@ -5393,7 +5393,11 @@ var inputAction = tv({ base: [
5393
5393
  ] });
5394
5394
  var inputIndicator = tv({ base: "cursor-pointer outline-none" });
5395
5395
  var inputActionSlot = tv({ base: "flex shrink-0 items-stretch self-stretch" });
5396
- var inputEmbedded = tv({ base: "flex min-w-0 flex-1 items-stretch" });
5396
+ var inputEmbedded = tv({ base: [
5397
+ "group/hn-field flex min-w-0 flex-1 items-stretch",
5398
+ "data-disabled:cursor-not-allowed data-disabled:opacity-50",
5399
+ "group-data-disabled/hn-field:data-disabled:opacity-100"
5400
+ ] });
5397
5401
  //#endregion
5398
5402
  //#region src/components/input/InputAction.vue
5399
5403
  var InputAction_default = /* @__PURE__ */ defineComponent({
@@ -5471,7 +5475,11 @@ function injectInputGroup() {
5471
5475
  }
5472
5476
  //#endregion
5473
5477
  //#region src/components/input/InputBase.vue?vue&type=script&setup=true&lang.ts
5474
- var _hoisted_1$75 = ["data-invalid", "aria-busy"];
5478
+ var _hoisted_1$75 = [
5479
+ "data-invalid",
5480
+ "data-disabled",
5481
+ "aria-busy"
5482
+ ];
5475
5483
  var _hoisted_2$36 = [
5476
5484
  "id",
5477
5485
  "disabled",
@@ -5527,6 +5535,7 @@ var InputBase_default = /* @__PURE__ */ defineComponent({
5527
5535
  return openBlock(), createElementBlock("div", {
5528
5536
  "data-hn-input": "",
5529
5537
  "data-invalid": unref(invalid) ? "" : void 0,
5538
+ "data-disabled": unref(disabled) ? "" : void 0,
5530
5539
  "aria-busy": props.loading || void 0,
5531
5540
  class: normalizeClass(unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
5532
5541
  variant: props.variant,
@@ -5718,7 +5727,7 @@ function caretTop(node, at = node.selectionEnd) {
5718
5727
  //#endregion
5719
5728
  //#region src/components/textarea/textarea.variants.ts
5720
5729
  var textarea = tv({
5721
- base: ["hn-field text-fg flex w-full min-w-0 cursor-text flex-col overflow-hidden rounded-md border font-medium", "has-disabled:cursor-not-allowed has-disabled:opacity-50"],
5730
+ base: ["hn-field text-fg flex w-full min-w-0 cursor-text flex-col overflow-hidden rounded-md border font-medium", "data-disabled:cursor-not-allowed data-disabled:opacity-50"],
5722
5731
  variants: {
5723
5732
  variant: {
5724
5733
  primary: "border-line [--hn-field-bg:var(--hn-surface)] [--hn-field-shadow:var(--hn-shadow-sm)]",
@@ -5752,7 +5761,7 @@ var textareaField = tv({ base: [
5752
5761
  ] });
5753
5762
  //#endregion
5754
5763
  //#region src/components/textarea/Textarea.vue?vue&type=script&setup=true&lang.ts
5755
- var _hoisted_1$74 = ["data-invalid"];
5764
+ var _hoisted_1$74 = ["data-invalid", "data-disabled"];
5756
5765
  var _hoisted_2$35 = [
5757
5766
  "id",
5758
5767
  "rows",
@@ -5828,6 +5837,7 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
5828
5837
  return openBlock(), createElementBlock("div", {
5829
5838
  "data-hn-textarea": "",
5830
5839
  "data-invalid": unref(invalid) ? "" : void 0,
5840
+ "data-disabled": unref(disabled) ? "" : void 0,
5831
5841
  style: normalizeStyle({
5832
5842
  "--hn-textarea-rows": bounds.value.min,
5833
5843
  "--hn-textarea-max-rows": bounds.value.max
@@ -5938,6 +5948,7 @@ var NumberInput_default = /* @__PURE__ */ defineComponent({
5938
5948
  disabled: unref(disabled),
5939
5949
  "data-hn-number-input": "",
5940
5950
  "data-invalid": unref(invalid) ? "" : void 0,
5951
+ "data-disabled": unref(disabled) ? "" : void 0,
5941
5952
  class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
5942
5953
  variant: props.variant,
5943
5954
  size: props.size
@@ -5974,6 +5985,7 @@ var NumberInput_default = /* @__PURE__ */ defineComponent({
5974
5985
  "locale",
5975
5986
  "disabled",
5976
5987
  "data-invalid",
5988
+ "data-disabled",
5977
5989
  "class"
5978
5990
  ]);
5979
5991
  };
@@ -6120,7 +6132,7 @@ var inputGroup = tv({ base: [
6120
6132
  var inputGroupAddon = tv({ base: "text-muted flex shrink-0 items-center gap-2 px-[var(--hn-input-px)] whitespace-nowrap [&>svg]:size-[var(--hn-input-icon)]" });
6121
6133
  //#endregion
6122
6134
  //#region src/components/input-group/InputGroup.vue?vue&type=script&setup=true&lang.ts
6123
- var _hoisted_1$72 = ["data-invalid"];
6135
+ var _hoisted_1$72 = ["data-invalid", "data-disabled"];
6124
6136
  //#endregion
6125
6137
  //#region src/components/input-group/InputGroup.vue
6126
6138
  var InputGroup_default = /* @__PURE__ */ defineComponent({
@@ -6135,15 +6147,17 @@ var InputGroup_default = /* @__PURE__ */ defineComponent({
6135
6147
  },
6136
6148
  setup(__props) {
6137
6149
  const props = __props;
6150
+ const { disabled } = useFieldControl({ disabled: () => props.disabled });
6138
6151
  provideInputGroup({
6139
6152
  size: computed(() => props.size),
6140
- disabled: computed(() => !!props.disabled),
6153
+ disabled,
6141
6154
  invalid: computed(() => !!props.invalid)
6142
6155
  });
6143
6156
  return (_ctx, _cache) => {
6144
6157
  return openBlock(), createElementBlock("div", {
6145
6158
  "data-hn-input-group": "",
6146
6159
  "data-invalid": props.invalid ? "" : void 0,
6160
+ "data-disabled": unref(disabled) ? "" : void 0,
6147
6161
  class: normalizeClass(unref(cn)(unref(inputHost)({
6148
6162
  variant: props.variant,
6149
6163
  size: props.size
@@ -6318,7 +6332,7 @@ var _hoisted_3$18 = {
6318
6332
  var _hoisted_4$13 = { class: "flex size-4 shrink-0 items-center justify-center" };
6319
6333
  var _hoisted_5$9 = { class: "min-w-0 flex-1" };
6320
6334
  var _hoisted_6$7 = { class: "block truncate" };
6321
- var _hoisted_7$5 = {
6335
+ var _hoisted_7$6 = {
6322
6336
  key: 0,
6323
6337
  class: "text-muted block truncate text-xs"
6324
6338
  };
@@ -6391,7 +6405,7 @@ var SelectList_default = /* @__PURE__ */ defineComponent({
6391
6405
  class: normalizeClass(unref(selectItem)())
6392
6406
  }, {
6393
6407
  default: withCtx(() => [createVNode(unref(SelectItemText), { "as-child": "" }, {
6394
- default: withCtx(() => [createElementVNode("span", _hoisted_5$9, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$7, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(item.description), 1)) : createCommentVNode("", true)])])]),
6408
+ default: withCtx(() => [createElementVNode("span", _hoisted_5$9, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$7, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$6, toDisplayString(item.description), 1)) : createCommentVNode("", true)])])]),
6395
6409
  _: 2
6396
6410
  }, 1024), createElementVNode("span", _hoisted_8$2, [createVNode(unref(SelectItemIndicator), null, {
6397
6411
  default: withCtx(() => [createVNode(unref(Check))]),
@@ -6479,6 +6493,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
6479
6493
  onKeydown: _cache[0] || (_cache[0] = ($event) => keyboard.value = true),
6480
6494
  onPointerdown: _cache[1] || (_cache[1] = ($event) => keyboard.value = false),
6481
6495
  "data-invalid": unref(invalid) ? "" : void 0,
6496
+ "data-disabled": unref(disabled) ? "" : void 0,
6482
6497
  "aria-invalid": unref(invalid) || void 0,
6483
6498
  class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
6484
6499
  variant: props.variant,
@@ -6491,6 +6506,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
6491
6506
  "id",
6492
6507
  "aria-describedby",
6493
6508
  "data-invalid",
6509
+ "data-disabled",
6494
6510
  "aria-invalid",
6495
6511
  "class"
6496
6512
  ]), createVNode(SelectList_default, {
@@ -6618,6 +6634,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
6618
6634
  tabindex: unref(disabled) ? -1 : 0,
6619
6635
  "aria-disabled": unref(disabled) || void 0,
6620
6636
  "data-invalid": unref(invalid) ? "" : void 0,
6637
+ "data-disabled": unref(disabled) ? "" : void 0,
6621
6638
  "aria-invalid": unref(invalid) || void 0,
6622
6639
  class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
6623
6640
  variant: props.variant,
@@ -6681,6 +6698,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
6681
6698
  "tabindex",
6682
6699
  "aria-disabled",
6683
6700
  "data-invalid",
6701
+ "data-disabled",
6684
6702
  "aria-invalid",
6685
6703
  "class"
6686
6704
  ]),
@@ -6739,7 +6757,7 @@ var _hoisted_3$16 = {
6739
6757
  var _hoisted_4$11 = { class: "flex size-4 shrink-0 items-center justify-center" };
6740
6758
  var _hoisted_5$8 = { class: "min-w-0 flex-1" };
6741
6759
  var _hoisted_6$6 = { class: "block truncate" };
6742
- var _hoisted_7$4 = {
6760
+ var _hoisted_7$5 = {
6743
6761
  key: 0,
6744
6762
  class: "text-muted block truncate text-xs"
6745
6763
  };
@@ -6808,7 +6826,7 @@ var ComboboxList_default = /* @__PURE__ */ defineComponent({
6808
6826
  disabled: item.disabled,
6809
6827
  class: normalizeClass(unref(selectItem)())
6810
6828
  }, {
6811
- default: withCtx(() => [createElementVNode("span", _hoisted_5$8, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$6, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString(item.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_8$1, [createVNode(unref(ComboboxItemIndicator), null, {
6829
+ default: withCtx(() => [createElementVNode("span", _hoisted_5$8, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$6, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(item.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_8$1, [createVNode(unref(ComboboxItemIndicator), null, {
6812
6830
  default: withCtx(() => [createVNode(unref(Check))]),
6813
6831
  _: 1
6814
6832
  })])]),
@@ -6836,7 +6854,7 @@ var ComboboxList_default = /* @__PURE__ */ defineComponent({
6836
6854
  });
6837
6855
  //#endregion
6838
6856
  //#region src/components/combobox/Combobox.vue?vue&type=script&setup=true&lang.ts
6839
- var _hoisted_1$67 = ["data-invalid"];
6857
+ var _hoisted_1$67 = ["data-invalid", "data-disabled"];
6840
6858
  //#endregion
6841
6859
  //#region src/components/combobox/Combobox.vue
6842
6860
  var Combobox_default = /* @__PURE__ */ defineComponent({
@@ -6914,6 +6932,7 @@ var Combobox_default = /* @__PURE__ */ defineComponent({
6914
6932
  default: withCtx(() => [createElementVNode("div", {
6915
6933
  "data-hn-combobox": "",
6916
6934
  "data-invalid": unref(invalid) ? "" : void 0,
6935
+ "data-disabled": unref(disabled) ? "" : void 0,
6917
6936
  class: normalizeClass(unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
6918
6937
  variant: props.variant,
6919
6938
  size: props.size
@@ -7441,7 +7460,7 @@ var _hoisted_3$14 = {
7441
7460
  var _hoisted_4$9 = { class: "flex size-4 shrink-0 items-center justify-center" };
7442
7461
  var _hoisted_5$6 = { class: "min-w-0 flex-1" };
7443
7462
  var _hoisted_6$5 = { class: "block truncate" };
7444
- var _hoisted_7$3 = {
7463
+ var _hoisted_7$4 = {
7445
7464
  key: 0,
7446
7465
  class: "text-muted block truncate text-xs"
7447
7466
  };
@@ -7515,7 +7534,7 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
7515
7534
  disabled: item.disabled,
7516
7535
  class: normalizeClass(unref(selectItem)())
7517
7536
  }, {
7518
- default: withCtx(() => [createElementVNode("span", _hoisted_5$6, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$5, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$3, toDisplayString(item.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_8, [createVNode(unref(ListboxItemIndicator), null, {
7537
+ default: withCtx(() => [createElementVNode("span", _hoisted_5$6, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$5, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString(item.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_8, [createVNode(unref(ListboxItemIndicator), null, {
7519
7538
  default: withCtx(() => [createVNode(unref(Check))]),
7520
7539
  _: 1
7521
7540
  })])]),
@@ -7592,7 +7611,7 @@ var _hoisted_6$4 = {
7592
7611
  key: 0,
7593
7612
  class: "text-muted block truncate text-xs"
7594
7613
  };
7595
- var _hoisted_7$2 = { class: "flex size-4 shrink-0 items-center justify-center" };
7614
+ var _hoisted_7$3 = { class: "flex size-4 shrink-0 items-center justify-center" };
7596
7615
  //#endregion
7597
7616
  //#region src/components/tree-select/TreeSelect.vue
7598
7617
  var TreeSelect_default = /* @__PURE__ */ defineComponent({
@@ -7661,6 +7680,7 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
7661
7680
  disabled: unref(disabled),
7662
7681
  "data-placeholder": selected.value ? void 0 : "",
7663
7682
  "data-invalid": unref(invalid) ? "" : void 0,
7683
+ "data-disabled": unref(disabled) ? "" : void 0,
7664
7684
  "aria-invalid": unref(invalid) || void 0,
7665
7685
  class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
7666
7686
  variant: props.variant,
@@ -7676,6 +7696,7 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
7676
7696
  "disabled",
7677
7697
  "data-placeholder",
7678
7698
  "data-invalid",
7699
+ "data-disabled",
7679
7700
  "aria-invalid",
7680
7701
  "class"
7681
7702
  ]), createVNode(unref(PopoverPortal), null, {
@@ -7719,7 +7740,7 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
7719
7740
  open: isExpanded
7720
7741
  }, null, 8, ["open"])], 10, _hoisted_2$29)) : (openBlock(), createElementBlock("span", _hoisted_3$13)),
7721
7742
  createElementVNode("span", _hoisted_4$8, [renderSlot(_ctx.$slots, "node", { node: item.value }, () => [createElementVNode("span", _hoisted_5$5, toDisplayString(item.value.label), 1), item.value.description ? (openBlock(), createElementBlock("span", _hoisted_6$4, toDisplayString(item.value.description), 1)) : createCommentVNode("", true)])]),
7722
- createElementVNode("span", _hoisted_7$2, [isSelected ? (openBlock(), createBlock(unref(Check), { key: 0 })) : createCommentVNode("", true)])
7743
+ createElementVNode("span", _hoisted_7$3, [isSelected ? (openBlock(), createBlock(unref(Check), { key: 0 })) : createCommentVNode("", true)])
7723
7744
  ]),
7724
7745
  _: 2
7725
7746
  }, 1040, [
@@ -7756,13 +7777,33 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
7756
7777
  //#endregion
7757
7778
  //#region src/components/checkbox/checkbox.variants.ts
7758
7779
  var checkbox = tv({
7759
- base: ["text-fg grid w-fit max-w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[var(--hn-field-gap)] select-none", "data-disabled:cursor-not-allowed data-disabled:opacity-50"],
7760
- variants: { size: {
7761
- sm: "text-sm",
7762
- md: "text-base",
7763
- lg: "text-md"
7780
+ base: ["text-fg grid w-fit max-w-full cursor-pointer items-center gap-x-[var(--hn-field-gap)] select-none", "data-disabled:cursor-not-allowed data-disabled:opacity-50"],
7781
+ variants: {
7782
+ controlPlacement: {
7783
+ start: "grid-cols-[auto_minmax(0,1fr)]",
7784
+ end: "grid-cols-[minmax(0,1fr)_auto]"
7785
+ },
7786
+ block: { true: "w-full" },
7787
+ bare: { true: "gap-x-0" },
7788
+ size: {
7789
+ sm: "text-sm",
7790
+ md: "text-base",
7791
+ lg: "text-md"
7792
+ }
7793
+ },
7794
+ defaultVariants: {
7795
+ size: "md",
7796
+ controlPlacement: "start",
7797
+ block: false
7798
+ }
7799
+ });
7800
+ var checkboxControl = tv({
7801
+ base: "row-start-1",
7802
+ variants: { controlPlacement: {
7803
+ start: "col-start-1 justify-self-start",
7804
+ end: "col-start-2 justify-self-end"
7764
7805
  } },
7765
- defaultVariants: { size: "md" }
7806
+ defaultVariants: { controlPlacement: "start" }
7766
7807
  });
7767
7808
  var checkboxBox = tv({
7768
7809
  base: [
@@ -7791,16 +7832,32 @@ var checkboxBox = tv({
7791
7832
  size: "md"
7792
7833
  }
7793
7834
  });
7794
- var checkboxTitle = tv({ base: "flex min-h-[1lh] min-w-0 items-center" });
7835
+ var checkboxTitle = tv({
7836
+ base: "row-start-1 flex min-h-[1lh] min-w-0 items-center",
7837
+ variants: { controlPlacement: {
7838
+ start: "col-start-2",
7839
+ end: "col-start-1"
7840
+ } },
7841
+ defaultVariants: { controlPlacement: "start" }
7842
+ });
7795
7843
  var checkboxTitleText = tv({ base: "block [text-box:trim-both_cap_alphabetic]" });
7796
7844
  var checkboxDescription = tv({
7797
- base: "text-muted col-start-2 block",
7798
- variants: { size: {
7799
- sm: "text-xs",
7800
- md: "text-sm",
7801
- lg: "text-base"
7802
- } },
7803
- defaultVariants: { size: "md" }
7845
+ base: "text-muted row-start-2 block",
7846
+ variants: {
7847
+ controlPlacement: {
7848
+ start: "col-start-2",
7849
+ end: "col-start-1"
7850
+ },
7851
+ size: {
7852
+ sm: "text-xs",
7853
+ md: "text-sm",
7854
+ lg: "text-base"
7855
+ }
7856
+ },
7857
+ defaultVariants: {
7858
+ size: "md",
7859
+ controlPlacement: "start"
7860
+ }
7804
7861
  });
7805
7862
  //#endregion
7806
7863
  //#region src/components/checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
@@ -7814,6 +7871,8 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
7814
7871
  props: /*@__PURE__*/ mergeModels({
7815
7872
  size: {},
7816
7873
  description: {},
7874
+ controlPlacement: {},
7875
+ block: { type: Boolean },
7817
7876
  disabled: { type: Boolean },
7818
7877
  invalid: { type: Boolean },
7819
7878
  class: {}
@@ -7838,7 +7897,12 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
7838
7897
  "data-hn-checkbox": "",
7839
7898
  "data-hn-state-group": "",
7840
7899
  "data-disabled": unref(disabled) ? "" : void 0,
7841
- class: normalizeClass(unref(cn)(unref(checkbox)({ size: props.size }), props.class))
7900
+ class: normalizeClass(unref(cn)(unref(checkbox)({
7901
+ size: props.size,
7902
+ controlPlacement: props.controlPlacement,
7903
+ block: props.block,
7904
+ bare: !unref(slots).default && !props.description
7905
+ }), props.class))
7842
7906
  }, [
7843
7907
  createVNode(unref(CheckboxRoot), mergeProps(_ctx.$attrs, {
7844
7908
  modelValue: model.value,
@@ -7848,7 +7912,7 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
7848
7912
  "aria-invalid": unref(invalid) || void 0,
7849
7913
  "aria-describedby": unref(describedBy),
7850
7914
  "data-invalid": unref(invalid) ? "" : void 0,
7851
- class: unref(checkboxBox)({ size: props.size })
7915
+ class: unref(cn)(unref(checkboxBox)({ size: props.size }), unref(checkboxControl)({ controlPlacement: props.controlPlacement }))
7852
7916
  }), {
7853
7917
  default: withCtx(({ state }) => [createVNode(Transition, {
7854
7918
  "enter-active-class": "hn-transition-press",
@@ -7885,11 +7949,14 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
7885
7949
  ]),
7886
7950
  unref(slots).default ? (openBlock(), createElementBlock("span", {
7887
7951
  key: 0,
7888
- class: normalizeClass(unref(checkboxTitle)())
7952
+ class: normalizeClass(unref(checkboxTitle)({ controlPlacement: props.controlPlacement }))
7889
7953
  }, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "default")], 2)], 2)) : createCommentVNode("", true),
7890
7954
  props.description ? (openBlock(), createElementBlock("span", {
7891
7955
  key: 1,
7892
- class: normalizeClass(unref(checkboxDescription)({ size: props.size }))
7956
+ class: normalizeClass(unref(checkboxDescription)({
7957
+ size: props.size,
7958
+ controlPlacement: props.controlPlacement
7959
+ }))
7893
7960
  }, toDisplayString(props.description), 3)) : createCommentVNode("", true)
7894
7961
  ], 10, _hoisted_1$63);
7895
7962
  };
@@ -7899,12 +7966,29 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
7899
7966
  //#region src/components/checkbox-group/checkbox-group.variants.ts
7900
7967
  var checkboxGroup = tv({
7901
7968
  base: "flex min-w-0",
7902
- variants: { orientation: {
7903
- vertical: "flex-col gap-2",
7904
- horizontal: "flex-row flex-wrap gap-x-[var(--hn-inline-gap)] gap-y-2"
7905
- } },
7969
+ variants: {
7970
+ block: { true: "w-full" },
7971
+ orientation: {
7972
+ vertical: "flex-col gap-2",
7973
+ horizontal: "flex-row flex-wrap gap-x-[var(--hn-inline-gap)] gap-y-2"
7974
+ }
7975
+ },
7906
7976
  defaultVariants: { orientation: "vertical" }
7907
7977
  });
7978
+ var checkboxGroupItem = tv({
7979
+ variants: {
7980
+ orientation: {
7981
+ vertical: "",
7982
+ horizontal: ""
7983
+ },
7984
+ block: { true: "" }
7985
+ },
7986
+ compoundVariants: [{
7987
+ orientation: "horizontal",
7988
+ block: true,
7989
+ class: "flex-1"
7990
+ }]
7991
+ });
7908
7992
  //#endregion
7909
7993
  //#region src/components/checkbox-group/CheckboxGroup.vue
7910
7994
  var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
@@ -7914,6 +7998,8 @@ var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
7914
7998
  options: {},
7915
7999
  orientation: {},
7916
8000
  size: {},
8001
+ controlPlacement: {},
8002
+ block: { type: Boolean },
7917
8003
  disabled: { type: Boolean },
7918
8004
  invalid: { type: Boolean },
7919
8005
  class: {}
@@ -7943,13 +8029,22 @@ var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
7943
8029
  "data-hn-checkbox-group": "",
7944
8030
  "data-orientation": props.orientation ?? "vertical",
7945
8031
  "data-disabled": unref(disabled) ? "" : void 0,
7946
- class: normalizeClass(unref(cn)(unref(checkboxGroup)({ orientation: props.orientation }), props.class))
8032
+ class: normalizeClass(unref(cn)(unref(checkboxGroup)({
8033
+ orientation: props.orientation,
8034
+ block: props.block
8035
+ }), props.class))
7947
8036
  }, {
7948
8037
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (option) => {
7949
8038
  return openBlock(), createBlock(Checkbox_default, {
7950
8039
  key: option.value,
7951
8040
  value: option.value,
7952
8041
  size: props.size,
8042
+ "control-placement": props.controlPlacement,
8043
+ block: props.block,
8044
+ class: normalizeClass(unref(checkboxGroupItem)({
8045
+ orientation: props.orientation,
8046
+ block: props.block
8047
+ })),
7953
8048
  disabled: unref(disabled) || option.disabled,
7954
8049
  invalid: unref(invalid),
7955
8050
  description: option.description
@@ -7959,6 +8054,9 @@ var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
7959
8054
  }, 1032, [
7960
8055
  "value",
7961
8056
  "size",
8057
+ "control-placement",
8058
+ "block",
8059
+ "class",
7962
8060
  "disabled",
7963
8061
  "invalid",
7964
8062
  "description"
@@ -7993,6 +8091,8 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
7993
8091
  options: {},
7994
8092
  orientation: {},
7995
8093
  size: {},
8094
+ controlPlacement: {},
8095
+ block: { type: Boolean },
7996
8096
  disabled: { type: Boolean },
7997
8097
  invalid: { type: Boolean },
7998
8098
  class: {}
@@ -8017,7 +8117,10 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
8017
8117
  "aria-describedby": unref(describedBy),
8018
8118
  "aria-invalid": unref(invalid) || void 0,
8019
8119
  "data-hn-radio-group": "",
8020
- class: normalizeClass(unref(cn)(unref(checkboxGroup)({ orientation: props.orientation }), props.class))
8120
+ class: normalizeClass(unref(cn)(unref(checkboxGroup)({
8121
+ orientation: props.orientation,
8122
+ block: props.block
8123
+ }), props.class))
8021
8124
  }, {
8022
8125
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (option) => {
8023
8126
  return openBlock(), createElementBlock("label", {
@@ -8025,17 +8128,24 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
8025
8128
  "data-hn-radio": "",
8026
8129
  "data-hn-state-group": "",
8027
8130
  "data-disabled": unref(disabled) || option.disabled ? "" : void 0,
8028
- class: normalizeClass(unref(checkbox)({ size: props.size }))
8131
+ class: normalizeClass(unref(cn)(unref(checkbox)({
8132
+ size: props.size,
8133
+ controlPlacement: props.controlPlacement,
8134
+ block: props.block
8135
+ }), unref(checkboxGroupItem)({
8136
+ orientation: props.orientation,
8137
+ block: props.block
8138
+ })))
8029
8139
  }, [
8030
8140
  createVNode(unref(RadioGroupItem), {
8031
8141
  value: option.value,
8032
8142
  disabled: option.disabled,
8033
8143
  "aria-invalid": unref(invalid) || void 0,
8034
8144
  "data-invalid": unref(invalid) ? "" : void 0,
8035
- class: normalizeClass(unref(checkboxBox)({
8145
+ class: normalizeClass(unref(cn)(unref(checkboxBox)({
8036
8146
  shape: "round",
8037
8147
  size: props.size
8038
- }))
8148
+ }), unref(checkboxControl)({ controlPlacement: props.controlPlacement })))
8039
8149
  }, {
8040
8150
  default: withCtx(({ checked }) => [createVNode(Transition, {
8041
8151
  "enter-active-class": "hn-transition-press",
@@ -8057,10 +8167,13 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
8057
8167
  "data-invalid",
8058
8168
  "class"
8059
8169
  ]),
8060
- createElementVNode("span", { class: normalizeClass(unref(checkboxTitle)()) }, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.label), 1)])], 2)], 2),
8170
+ createElementVNode("span", { class: normalizeClass(unref(checkboxTitle)({ controlPlacement: props.controlPlacement })) }, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.label), 1)])], 2)], 2),
8061
8171
  option.description ? (openBlock(), createElementBlock("span", {
8062
8172
  key: 0,
8063
- class: normalizeClass(unref(checkboxDescription)({ size: props.size }))
8173
+ class: normalizeClass(unref(checkboxDescription)({
8174
+ size: props.size,
8175
+ controlPlacement: props.controlPlacement
8176
+ }))
8064
8177
  }, toDisplayString(option.description), 3)) : createCommentVNode("", true)
8065
8178
  ], 10, _hoisted_1$62);
8066
8179
  }), 128))]),
@@ -8113,6 +8226,8 @@ var Switch_default = /* @__PURE__ */ defineComponent({
8113
8226
  props: /*@__PURE__*/ mergeModels({
8114
8227
  size: {},
8115
8228
  description: {},
8229
+ controlPlacement: {},
8230
+ block: { type: Boolean },
8116
8231
  disabled: { type: Boolean },
8117
8232
  invalid: { type: Boolean },
8118
8233
  class: {}
@@ -8137,7 +8252,12 @@ var Switch_default = /* @__PURE__ */ defineComponent({
8137
8252
  "data-hn-switch": "",
8138
8253
  "data-hn-state-group": "",
8139
8254
  "data-disabled": unref(disabled) ? "" : void 0,
8140
- class: normalizeClass(unref(cn)(unref(checkbox)({ size: props.size }), props.class))
8255
+ class: normalizeClass(unref(cn)(unref(checkbox)({
8256
+ size: props.size,
8257
+ controlPlacement: props.controlPlacement,
8258
+ block: props.block,
8259
+ bare: !unref(slots).default && !props.description
8260
+ }), props.class))
8141
8261
  }, [
8142
8262
  createVNode(unref(SwitchRoot), mergeProps(_ctx.$attrs, {
8143
8263
  modelValue: model.value,
@@ -8148,7 +8268,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
8148
8268
  "aria-describedby": unref(describedBy),
8149
8269
  "data-invalid": unref(invalid) ? "" : void 0,
8150
8270
  "data-hn-on": model.value ? "" : void 0,
8151
- class: unref(switchTrack)({ size: props.size })
8271
+ class: unref(cn)(unref(switchTrack)({ size: props.size }), unref(checkboxControl)({ controlPlacement: props.controlPlacement }))
8152
8272
  }), {
8153
8273
  default: withCtx(() => [createElementVNode("span", {
8154
8274
  "data-hn-thumb": "",
@@ -8168,11 +8288,14 @@ var Switch_default = /* @__PURE__ */ defineComponent({
8168
8288
  ]),
8169
8289
  unref(slots).default ? (openBlock(), createElementBlock("span", {
8170
8290
  key: 0,
8171
- class: normalizeClass(unref(checkboxTitle)())
8291
+ class: normalizeClass(unref(checkboxTitle)({ controlPlacement: props.controlPlacement }))
8172
8292
  }, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "default")], 2)], 2)) : createCommentVNode("", true),
8173
8293
  props.description ? (openBlock(), createElementBlock("span", {
8174
8294
  key: 1,
8175
- class: normalizeClass(unref(checkboxDescription)({ size: props.size }))
8295
+ class: normalizeClass(unref(checkboxDescription)({
8296
+ size: props.size,
8297
+ controlPlacement: props.controlPlacement
8298
+ }))
8176
8299
  }, toDisplayString(props.description), 3)) : createCommentVNode("", true)
8177
8300
  ], 10, _hoisted_1$61);
8178
8301
  };
@@ -8777,7 +8900,7 @@ var TagsInputChip_default = /* @__PURE__ */ defineComponent({
8777
8900
  });
8778
8901
  //#endregion
8779
8902
  //#region src/components/tags-input/TagsInput.vue?vue&type=script&setup=true&lang.ts
8780
- var _hoisted_1$56 = ["data-invalid"];
8903
+ var _hoisted_1$56 = ["data-invalid", "data-disabled"];
8781
8904
  //#endregion
8782
8905
  //#region src/components/tags-input/TagsInput.vue
8783
8906
  var TagsInput_default = /* @__PURE__ */ defineComponent({
@@ -8844,6 +8967,7 @@ var TagsInput_default = /* @__PURE__ */ defineComponent({
8844
8967
  return openBlock(), createElementBlock("div", {
8845
8968
  "data-hn-tags-input": "",
8846
8969
  "data-invalid": unref(invalid) ? "" : void 0,
8970
+ "data-disabled": unref(disabled) ? "" : void 0,
8847
8971
  onClick: _cache[2] || (_cache[2] = ($event) => unref(focusFieldFrom)($event.currentTarget, $event.target)),
8848
8972
  class: normalizeClass(unref(cn)(unref(inputHost)({
8849
8973
  variant: props.variant,
@@ -8940,7 +9064,11 @@ var multiComboboxHost = tv({
8940
9064
  var multiComboboxEnd = tv({ base: "absolute inset-y-0 end-0 flex items-stretch" });
8941
9065
  //#endregion
8942
9066
  //#region src/components/multi-combobox/MultiCombobox.vue?vue&type=script&setup=true&lang.ts
8943
- var _hoisted_1$55 = ["data-invalid", "aria-busy"];
9067
+ var _hoisted_1$55 = [
9068
+ "data-invalid",
9069
+ "data-disabled",
9070
+ "aria-busy"
9071
+ ];
8944
9072
  var _hoisted_2$27 = { class: "min-w-0 truncate" };
8945
9073
  //#endregion
8946
9074
  //#region src/components/multi-combobox/MultiCombobox.vue
@@ -9042,6 +9170,7 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
9042
9170
  default: withCtx(() => [createElementVNode("div", {
9043
9171
  "data-hn-multi-combobox": "",
9044
9172
  "data-invalid": unref(invalid) ? "" : void 0,
9173
+ "data-disabled": unref(disabled) ? "" : void 0,
9045
9174
  "aria-busy": props.loading || void 0,
9046
9175
  class: normalizeClass(unref(cn)(unref(inputHost)({
9047
9176
  variant: props.variant,
@@ -9998,7 +10127,7 @@ var InputGroupScope_default = /* @__PURE__ */ defineComponent({
9998
10127
  var datePickerContent = tv({ base: "hn-anim-pop z-(--hn-z-overlay) p-2 shadow-md outline-none" });
9999
10128
  //#endregion
10000
10129
  //#region src/components/date-picker/DatePicker.vue?vue&type=script&setup=true&lang.ts
10001
- var _hoisted_1$53 = ["data-invalid"];
10130
+ var _hoisted_1$53 = ["data-invalid", "data-disabled"];
10002
10131
  //#endregion
10003
10132
  //#region src/components/date-picker/DatePicker.vue
10004
10133
  var DatePicker_default = /* @__PURE__ */ defineComponent({
@@ -10068,6 +10197,7 @@ var DatePicker_default = /* @__PURE__ */ defineComponent({
10068
10197
  ref: host,
10069
10198
  "data-hn-date-picker": "",
10070
10199
  "data-invalid": unref(invalid) ? "" : void 0,
10200
+ "data-disabled": unref(disabled) ? "" : void 0,
10071
10201
  class: normalizeClass(unref(cn)(unref(outer) ? unref(inputEmbedded)() : unref(inputHost)({
10072
10202
  variant: props.variant,
10073
10203
  size: props.size
@@ -10596,7 +10726,7 @@ var RangeCalendar_default = /* @__PURE__ */ defineComponent({
10596
10726
  });
10597
10727
  //#endregion
10598
10728
  //#region src/components/date-range-picker/DateRangePicker.vue?vue&type=script&setup=true&lang.ts
10599
- var _hoisted_1$51 = ["data-invalid"];
10729
+ var _hoisted_1$51 = ["data-invalid", "data-disabled"];
10600
10730
  //#endregion
10601
10731
  //#region src/components/date-range-picker/DateRangePicker.vue
10602
10732
  var DateRangePicker_default = /* @__PURE__ */ defineComponent({
@@ -10667,6 +10797,7 @@ var DateRangePicker_default = /* @__PURE__ */ defineComponent({
10667
10797
  ref: host,
10668
10798
  "data-hn-date-range-picker": "",
10669
10799
  "data-invalid": unref(invalid) ? "" : void 0,
10800
+ "data-disabled": unref(disabled) ? "" : void 0,
10670
10801
  class: normalizeClass(unref(cn)(unref(outer) ? unref(inputEmbedded)() : unref(inputHost)({
10671
10802
  variant: props.variant,
10672
10803
  size: props.size
@@ -10939,7 +11070,7 @@ var TimeField_default = /* @__PURE__ */ defineComponent({
10939
11070
  var dateTimePickerFooter = tv({ base: "mt-2 flex items-center justify-between gap-2" });
10940
11071
  //#endregion
10941
11072
  //#region src/components/date-time-picker/DateTimePicker.vue?vue&type=script&setup=true&lang.ts
10942
- var _hoisted_1$49 = ["data-invalid"];
11073
+ var _hoisted_1$49 = ["data-invalid", "data-disabled"];
10943
11074
  //#endregion
10944
11075
  //#region src/components/date-time-picker/DateTimePicker.vue
10945
11076
  var DateTimePicker_default = /* @__PURE__ */ defineComponent({
@@ -11021,6 +11152,7 @@ var DateTimePicker_default = /* @__PURE__ */ defineComponent({
11021
11152
  ref: host,
11022
11153
  "data-hn-date-time-picker": "",
11023
11154
  "data-invalid": unref(invalid) ? "" : void 0,
11155
+ "data-disabled": unref(disabled) ? "" : void 0,
11024
11156
  class: normalizeClass(unref(cn)(unref(outer) ? unref(inputEmbedded)() : unref(inputHost)({
11025
11157
  variant: props.variant,
11026
11158
  size: props.size
@@ -14343,33 +14475,86 @@ var Form_default = /* @__PURE__ */ defineComponent({
14343
14475
  }
14344
14476
  });
14345
14477
  //#endregion
14478
+ //#region src/components/form-layout/context.ts
14479
+ var FORM_LAYOUT_KEY = Symbol("hn-form-layout");
14480
+ function useFormFieldLayout(props) {
14481
+ const parent = inject(FORM_LAYOUT_KEY, null);
14482
+ return computed(() => ({
14483
+ orientation: props.orientation ?? parent?.value.orientation ?? "vertical",
14484
+ descriptionPlacement: props.descriptionPlacement ?? parent?.value.descriptionPlacement ?? "control",
14485
+ labelWidth: props.labelWidth ?? parent?.value.labelWidth ?? "10rem"
14486
+ }));
14487
+ }
14488
+ function provideFormLayout(layout) {
14489
+ provide(FORM_LAYOUT_KEY, layout);
14490
+ }
14491
+ //#endregion
14346
14492
  //#region src/components/form-field/form-field.variants.ts
14347
- var formFieldRoot = tv({ base: "flex min-w-0 flex-col gap-1.5" });
14493
+ var formFieldRoot = tv({
14494
+ base: "min-w-0",
14495
+ variants: { orientation: {
14496
+ vertical: "",
14497
+ horizontal: "",
14498
+ responsive: "@container/hn-form-field"
14499
+ } }
14500
+ });
14501
+ var formFieldLayout = tv({
14502
+ base: "grid min-w-0 grid-cols-1 items-start gap-x-6 gap-y-1.5",
14503
+ variants: { orientation: {
14504
+ vertical: "",
14505
+ horizontal: "grid-cols-[var(--hn-form-label-width)_minmax(0,1fr)]",
14506
+ responsive: "@min-[32rem]/hn-form-field:grid-cols-[var(--hn-form-label-width)_minmax(0,1fr)]"
14507
+ } }
14508
+ });
14509
+ var formFieldContent = tv({ base: "flex min-w-0 flex-col gap-1.5" });
14510
+ var formFieldControl = tv({
14511
+ base: "min-w-0",
14512
+ variants: { orientation: {
14513
+ vertical: "",
14514
+ horizontal: "grid min-h-[var(--hn-control-h-md)] items-center",
14515
+ responsive: "@min-[32rem]/hn-form-field:grid @min-[32rem]/hn-form-field:min-h-[var(--hn-control-h-md)] @min-[32rem]/hn-form-field:items-center"
14516
+ } }
14517
+ });
14348
14518
  var formFieldLabel = tv({
14349
14519
  base: "text-fg inline-flex items-center gap-1 text-sm font-medium",
14350
- variants: { disabled: { true: "text-disabled" } }
14520
+ variants: {
14521
+ orientation: {
14522
+ vertical: "",
14523
+ horizontal: "min-h-[var(--hn-control-h-md)]",
14524
+ responsive: "@min-[32rem]/hn-form-field:min-h-[var(--hn-control-h-md)]"
14525
+ },
14526
+ disabled: { true: "text-disabled" }
14527
+ }
14351
14528
  });
14352
14529
  var formFieldMark = tv({ base: "text-danger-text" });
14353
14530
  var formFieldDescription = tv({ base: "text-muted text-sm" });
14354
14531
  var formFieldMessage = tv({ base: "text-danger-text text-sm" });
14355
14532
  //#endregion
14356
14533
  //#region src/components/form-field/FormField.vue?vue&type=script&setup=true&lang.ts
14357
- var _hoisted_1$26 = ["data-invalid", "data-disabled"];
14534
+ var _hoisted_1$26 = [
14535
+ "data-invalid",
14536
+ "data-disabled",
14537
+ "data-orientation"
14538
+ ];
14358
14539
  var _hoisted_2$15 = ["id", "for"];
14359
14540
  var _hoisted_3$7 = ["id"];
14360
- var _hoisted_4$5 = {
14541
+ var _hoisted_4$5 = ["id"];
14542
+ var _hoisted_5$3 = {
14361
14543
  key: 0,
14362
14544
  "data-hn-form-field-message": "",
14363
14545
  class: "hn-collapse [--hn-collapse-out:var(--hn-duration-fast)]"
14364
14546
  };
14365
- var _hoisted_5$3 = { class: "hn-collapse-body" };
14366
- var _hoisted_6$2 = ["id"];
14547
+ var _hoisted_6$2 = { class: "hn-collapse-body" };
14548
+ var _hoisted_7$2 = ["id"];
14367
14549
  //#endregion
14368
14550
  //#region src/components/form-field/FormField.vue
14369
14551
  var FormField_default = /* @__PURE__ */ defineComponent({
14370
14552
  name: "HnFormField",
14371
14553
  __name: "FormField",
14372
14554
  props: {
14555
+ orientation: {},
14556
+ descriptionPlacement: {},
14557
+ labelWidth: {},
14373
14558
  name: {},
14374
14559
  label: {},
14375
14560
  description: {},
@@ -14380,6 +14565,7 @@ var FormField_default = /* @__PURE__ */ defineComponent({
14380
14565
  },
14381
14566
  setup(__props) {
14382
14567
  const props = __props;
14568
+ const layout = useFormFieldLayout(props);
14383
14569
  const slots = useSlots();
14384
14570
  const t = useUiLocale();
14385
14571
  const form = injectForm();
@@ -14394,6 +14580,10 @@ var FormField_default = /* @__PURE__ */ defineComponent({
14394
14580
  const invalid = computed(() => !!message.value);
14395
14581
  const disabled = computed(() => !!props.disabled || !!form?.disabled.value);
14396
14582
  const described = computed(() => !!props.description || !!slots.description);
14583
+ const headed = computed(() => !!props.label || !!slots.label);
14584
+ const descriptionWithLabel = computed(() => described.value && layout.value.descriptionPlacement === "label");
14585
+ const contentOrientation = computed(() => headed.value || descriptionWithLabel.value ? layout.value.orientation : "vertical");
14586
+ const layoutStyle = computed(() => ({ "--hn-form-label-width": typeof layout.value.labelWidth === "number" ? `${layout.value.labelWidth}px` : layout.value.labelWidth }));
14397
14587
  const describedBy = computed(() => {
14398
14588
  const ids = [];
14399
14589
  if (described.value) ids.push(descriptionId);
@@ -14419,46 +14609,67 @@ var FormField_default = /* @__PURE__ */ defineComponent({
14419
14609
  "data-hn-form-field": "",
14420
14610
  "data-invalid": invalid.value ? "" : void 0,
14421
14611
  "data-disabled": disabled.value ? "" : void 0,
14422
- class: normalizeClass(unref(cn)(unref(formFieldRoot)(), props.class)),
14612
+ "data-orientation": unref(layout).orientation,
14613
+ class: normalizeClass(unref(cn)(unref(formFieldRoot)({ orientation: unref(layout).orientation }), props.class)),
14614
+ style: normalizeStyle(layoutStyle.value),
14423
14615
  onFocusout: onFocusOut
14616
+ }, [createElementVNode("div", {
14617
+ "data-hn-form-field-layout": "",
14618
+ class: normalizeClass(unref(formFieldLayout)({ orientation: contentOrientation.value }))
14619
+ }, [headed.value || descriptionWithLabel.value ? (openBlock(), createElementBlock("div", {
14620
+ key: 0,
14621
+ "data-hn-form-field-header": "",
14622
+ class: normalizeClass(unref(formFieldContent)())
14623
+ }, [headed.value ? (openBlock(), createElementBlock("label", {
14624
+ key: 0,
14625
+ id: unref(labelId),
14626
+ for: controlId.value,
14627
+ class: normalizeClass(unref(formFieldLabel)({
14628
+ disabled: disabled.value,
14629
+ orientation: contentOrientation.value
14630
+ }))
14424
14631
  }, [
14425
- props.label || unref(slots).label ? (openBlock(), createElementBlock("label", {
14632
+ renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(props.label), 1)]),
14633
+ props.required ? (openBlock(), createElementBlock("span", {
14634
+ key: 0,
14635
+ class: normalizeClass(unref(formFieldMark)()),
14636
+ "aria-hidden": "true"
14637
+ }, "*", 2)) : createCommentVNode("", true),
14638
+ props.required ? (openBlock(), createBlock(VisuallyHidden_default, { key: 1 }, {
14639
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t).form.required), 1)]),
14640
+ _: 1
14641
+ })) : createCommentVNode("", true)
14642
+ ], 10, _hoisted_2$15)) : createCommentVNode("", true), descriptionWithLabel.value ? (openBlock(), createElementBlock("p", {
14643
+ key: 1,
14644
+ id: unref(descriptionId),
14645
+ class: normalizeClass(unref(formFieldDescription)())
14646
+ }, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10, _hoisted_3$7)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true), createElementVNode("div", {
14647
+ "data-hn-form-field-body": "",
14648
+ class: normalizeClass(unref(formFieldContent)())
14649
+ }, [
14650
+ createElementVNode("div", {
14651
+ "data-hn-form-field-control": "",
14652
+ class: normalizeClass(unref(formFieldControl)({ orientation: contentOrientation.value }))
14653
+ }, [renderSlot(_ctx.$slots, "default")], 2),
14654
+ described.value && !descriptionWithLabel.value ? (openBlock(), createElementBlock("p", {
14426
14655
  key: 0,
14427
- id: unref(labelId),
14428
- for: controlId.value,
14429
- class: normalizeClass(unref(formFieldLabel)({ disabled: disabled.value }))
14430
- }, [
14431
- renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(props.label), 1)]),
14432
- props.required ? (openBlock(), createElementBlock("span", {
14433
- key: 0,
14434
- class: normalizeClass(unref(formFieldMark)()),
14435
- "aria-hidden": "true"
14436
- }, "*", 2)) : createCommentVNode("", true),
14437
- props.required ? (openBlock(), createBlock(VisuallyHidden_default, { key: 1 }, {
14438
- default: withCtx(() => [createTextVNode(toDisplayString(unref(t).form.required), 1)]),
14439
- _: 1
14440
- })) : createCommentVNode("", true)
14441
- ], 10, _hoisted_2$15)) : createCommentVNode("", true),
14442
- renderSlot(_ctx.$slots, "default"),
14443
- described.value ? (openBlock(), createElementBlock("p", {
14444
- key: 1,
14445
14656
  id: unref(descriptionId),
14446
14657
  class: normalizeClass(unref(formFieldDescription)())
14447
- }, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10, _hoisted_3$7)) : createCommentVNode("", true),
14658
+ }, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10, _hoisted_4$5)) : createCommentVNode("", true),
14448
14659
  createVNode(Transition, mergeProps({
14449
14660
  "enter-from-class": "hn-collapse-closed",
14450
14661
  "enter-to-class": "hn-collapse-open",
14451
14662
  "leave-from-class": "hn-collapse-open",
14452
14663
  "leave-to-class": "hn-collapse-closed"
14453
14664
  }, toHandlers(unref(hooks))), {
14454
- default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div", _hoisted_4$5, [createElementVNode("div", _hoisted_5$3, [createElementVNode("p", {
14665
+ default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div", _hoisted_5$3, [createElementVNode("div", _hoisted_6$2, [createElementVNode("p", {
14455
14666
  id: unref(messageId),
14456
14667
  class: normalizeClass(unref(formFieldMessage)()),
14457
14668
  "aria-live": "polite"
14458
- }, toDisplayString(message.value), 11, _hoisted_6$2)])])) : createCommentVNode("", true)]),
14669
+ }, toDisplayString(message.value), 11, _hoisted_7$2)])])) : createCommentVNode("", true)]),
14459
14670
  _: 1
14460
14671
  }, 16)
14461
- ], 42, _hoisted_1$26);
14672
+ ], 2)], 2)], 46, _hoisted_1$26);
14462
14673
  };
14463
14674
  }
14464
14675
  });
@@ -14490,6 +14701,9 @@ var FormLayout_default = /* @__PURE__ */ defineComponent({
14490
14701
  name: "HnFormLayout",
14491
14702
  __name: "FormLayout",
14492
14703
  props: {
14704
+ orientation: {},
14705
+ descriptionPlacement: {},
14706
+ labelWidth: {},
14493
14707
  legend: {},
14494
14708
  description: {},
14495
14709
  columns: { default: 1 },
@@ -14498,6 +14712,7 @@ var FormLayout_default = /* @__PURE__ */ defineComponent({
14498
14712
  },
14499
14713
  setup(__props) {
14500
14714
  const props = __props;
14715
+ provideFormLayout(useFormFieldLayout(props));
14501
14716
  const slots = useSlots();
14502
14717
  const form = injectForm();
14503
14718
  const descriptionId = useId();