@kazee-ds/vue 0.11.0 → 0.12.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.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @kazee-ds/vue
2
2
 
3
- Prepared **0.11.0** adds the `enclosed` Tabs variant (folder tabs) and keeps a nested Tabs independent of its ancestor's variant. Use React **0.11.0** or Vue **0.11.0** with styles **0.12.0**. These versions are unpublished; see [release status](https://gitlab.com/kazee.indonesia/kazee-design-system/-/blob/main/docs/versions.md).
3
+ Prepared **0.12.0** adds `popoverAlign`/`popoverProps`/`popoverWidth` to position and size Select/Combobox/DateRangePicker/temporal picker popovers, and fixes several RTL popover-alignment bugs. Use React **0.12.0** or Vue **0.12.0** with styles **0.13.0**. These versions are unpublished; see [release status](https://gitlab.com/kazee.indonesia/kazee-design-system/-/blob/main/docs/versions.md).
4
4
 
5
- The prepared styles **0.12.0** bundle tokens **0.8.0**, which add the `cool-gray-300` palette color (`#B0B3C4`), and style the `enclosed` Tabs variant. Tabs root modifiers are scoped with CSS `@scope`, so nested Tabs keep their own variant (Chrome/Edge 118, Safari 17.4, Firefox 146). Published styles **0.11.0** / tokens **0.7.0** added the AA `--ds-color-text-secondary` text role, which remains unchanged.
5
+ The prepared styles **0.13.0** fix the Tabs `pill`/`secondary` active-indicator color, center `enclosed` Tabs actions/extras on the tab labels, and keep a selected chip `ToggleButton` readable on hover/press; it bundles tokens **0.8.0** unchanged. Published styles **0.11.0** / tokens **0.7.0** added the AA `--ds-color-text-secondary` text role, which remains unchanged.
6
6
  Accessible Kazee Vue components, including Toast, built on Reka UI and native controls. Requires Vue 3.4+ and ESM.
7
7
 
8
8
  Version **0.10.0** adds Combobox sizing, focus/search and nonempty-selection policies, full-control popovers, and compact and compound Dialog header/footer dividers and builds on controlled selectable Card actions, Avatar/AvatarGroup, expanded Badge, sized/icon Switch, interactive/compact Card, dense controls, input clearing and composable date/time families with native Vue models and slots. Existing compact APIs remain supported. Verify registry availability before installing; use matching local packed artifacts for checkout testing. See [component expansion](https://gitlab.com/kazee.indonesia/kazee-design-system/-/blob/main/docs/component-expansion.md) and [release status](https://gitlab.com/kazee.indonesia/kazee-design-system/-/blob/main/docs/versions.md).
@@ -15,7 +15,7 @@ Version 0.5.3 ignores Toast shortcut events with missing or non-string keys. Nor
15
15
  After the prepared versions are published and verified, public npm installation requires no read token or login. Until then use matching local packed artifacts. Preserve the application's package manager and lockfile.
16
16
 
17
17
  ```sh
18
- npm install --save-exact @kazee-ds/vue@0.11.0 @kazee-ds/styles@0.12.0
18
+ npm install --save-exact @kazee-ds/vue@0.12.0 @kazee-ds/styles@0.13.0
19
19
  ```
20
20
 
21
21
  ## Use
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Fragment, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useSlots, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
1
+ import { Fragment, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useSlots, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
2
2
  import * as Reka from "reka-ui";
3
3
  import { CheckboxIndicator, CheckboxRoot as CheckboxRoot$1, ComboboxAnchor, ComboboxCancel, ComboboxContent, ComboboxInput, ComboboxItem as ComboboxItem$1, ComboboxPortal as ComboboxPortal$1, ComboboxRoot, ComboboxTrigger as ComboboxTrigger$1, ComboboxViewport, DateFieldInput, DateFieldRoot, DialogClose, DialogContent as DialogContent$1, DialogDescription as DialogDescription$1, DialogOverlay, DialogPortal as DialogPortal$1, DialogRoot as DialogRoot$1, DialogTitle as DialogTitle$1, DialogTrigger as DialogTrigger$1, DropdownMenuCheckboxItem as DropdownMenuCheckboxItem$1, DropdownMenuContent as DropdownMenuContent$1, DropdownMenuGroup, DropdownMenuItem as DropdownMenuItem$1, DropdownMenuLabel, DropdownMenuPortal as DropdownMenuPortal$1, DropdownMenuRadioGroup as DropdownMenuRadioGroup$1, DropdownMenuRadioItem as DropdownMenuRadioItem$1, DropdownMenuRoot as DropdownMenuRoot$1, DropdownMenuSeparator as DropdownMenuSeparator$1, DropdownMenuSub as DropdownMenuSub$1, DropdownMenuSubContent as DropdownMenuSubContent$1, DropdownMenuSubTrigger as DropdownMenuSubTrigger$1, DropdownMenuTrigger as DropdownMenuTrigger$1, Label, ListboxContent as ListboxContent$1, ListboxGroup, ListboxItem as ListboxItem$1, ListboxItemIndicator as ListboxItemIndicator$1, ListboxRoot as ListboxRoot$1, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput as NumberFieldInput$1, NumberFieldRoot as NumberFieldRoot$1, PopoverClose, PopoverContent as PopoverContent$1, PopoverPortal as PopoverPortal$1, PopoverRoot as PopoverRoot$1, PopoverTrigger as PopoverTrigger$1, Primitive, RadioGroupItem as RadioGroupItem$1, RadioGroupRoot as RadioGroupRoot$1, RangeCalendarCell, RangeCalendarCellTrigger, RangeCalendarGrid, RangeCalendarGridBody, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarNext, RangeCalendarPrev, RangeCalendarRoot, SelectContent, SelectGroup, SelectItem as SelectItem$1, SelectItemIndicator as SelectItemIndicator$1, SelectItemText as SelectItemText$1, SelectPortal, SelectRoot, SelectTrigger, SelectValue, SelectViewport, SwitchRoot, TabsContent, TabsList as TabsList$1, TabsRoot, TabsTrigger, TimeFieldInput, TimeFieldRoot, ToastAction, ToastClose, ToastDescription as ToastDescription$1, ToastProvider, ToastRoot as ToastRoot$1, ToastTitle as ToastTitle$1, ToastViewport as ToastViewport$1, Toggle, ToggleGroupItem as ToggleGroupItem$1, ToggleGroupRoot as ToggleGroupRoot$1, TooltipContent as TooltipContent$1, TooltipPortal as TooltipPortal$1, TooltipProvider as TooltipProvider$1, TooltipRoot as TooltipRoot$1, TooltipTrigger as TooltipTrigger$1, injectComboboxRootContext, injectSelectRootContext, useForwardExpose, useForwardProps, useId as useId$1 } from "reka-ui";
4
4
  import { CalendarDate, endOfMonth, getLocalTimeZone, now, parseAbsolute, parseDate, parseDateTime, parseTime, parseZonedDateTime, startOfMonth, startOfWeek, toCalendarDateTime, toZoned, today } from "@internationalized/date";
@@ -2609,6 +2609,21 @@ function filterOptions(options, query) {
2609
2609
  return options.filter((o) => fold(`${o.label} ${o.description ?? ""}`).includes(search));
2610
2610
  }
2611
2611
  //#endregion
2612
+ //#region src/popover-position.ts
2613
+ /** Merge defaults, the alignment shortcut and the passthrough, ignoring undefined passthrough keys. */
2614
+ function popoverPosition({ popoverAlign, popoverProps }, defaults = {}) {
2615
+ const result = {
2616
+ side: "bottom",
2617
+ ...defaults,
2618
+ align: popoverAlign ?? defaults.align ?? "start"
2619
+ };
2620
+ for (const [key, value] of Object.entries(popoverProps ?? {})) if (value !== void 0) result[key] = value;
2621
+ return result;
2622
+ }
2623
+ function popoverWidthClass(width) {
2624
+ return `select__popover--${width}-width`;
2625
+ }
2626
+ //#endregion
2612
2627
  //#region src/Select.vue?vue&type=script&setup=true&lang.ts
2613
2628
  var _hoisted_1$39 = ["data-multiple", "dir"];
2614
2629
  var _hoisted_2$27 = ["for"];
@@ -2634,6 +2649,9 @@ var Select_default = /* @__PURE__ */ defineComponent({
2634
2649
  label: {},
2635
2650
  options: {},
2636
2651
  maxHeight: { default: void 0 },
2652
+ popoverAlign: { default: void 0 },
2653
+ popoverWidth: { default: "content" },
2654
+ popoverProps: { default: void 0 },
2637
2655
  size: { default: "md" },
2638
2656
  variant: { default: "primary" },
2639
2657
  hideLabel: { type: Boolean },
@@ -2781,16 +2799,16 @@ var Select_default = /* @__PURE__ */ defineComponent({
2781
2799
  disabled: __props.disabled || ids.value.length === 0,
2782
2800
  onClick: clear
2783
2801
  }, [createVNode(CloseIcon_default, { class: normalizeClass(unref(partClasses)("selection__close-icon", _ctx.$props.classNames?.closeIcon)) }, null, 8, ["class"])], 10, _hoisted_4$15)) : createCommentVNode("", true)], 10, _hoisted_3$21), createVNode(unref(SelectPortal), null, {
2784
- default: withCtx(() => [createVNode(SelectionPopoverContent_default, {
2785
- style: normalizeStyle({ "--selection-max-height": __props.maxHeight && Number.isFinite(__props.maxHeight) && __props.maxHeight > 0 ? `${__props.maxHeight}px` : void 0 }),
2786
- class: normalizeClass(unref(partClasses)("select__popover", _ctx.$props.classNames?.popover)),
2787
- position: "popper",
2788
- "side-offset": 4,
2802
+ default: withCtx(() => [createVNode(SelectionPopoverContent_default, mergeProps({
2803
+ style: { "--selection-max-height": __props.maxHeight && Number.isFinite(__props.maxHeight) && __props.maxHeight > 0 ? `${__props.maxHeight}px` : void 0 },
2804
+ class: unref(partClasses)(["select__popover", unref(popoverWidthClass)(__props.popoverWidth)], _ctx.$props.classNames?.popover),
2805
+ position: "popper"
2806
+ }, unref(popoverPosition)(_ctx.$props, { sideOffset: 4 }), {
2789
2807
  onEscapeKeyDown: _cache[0] || (_cache[0] = (event) => {
2790
2808
  if (!event.isComposing) event.stopPropagation();
2791
2809
  }),
2792
2810
  onCloseAutoFocus: afterClose
2793
- }, {
2811
+ }), {
2794
2812
  default: withCtx(() => [createVNode(unref(SelectViewport), { class: normalizeClass(unref(partClasses)("select__list", _ctx.$props.classNames?.list)) }, {
2795
2813
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
2796
2814
  return openBlock(), createBlock(unref(SelectItem$1), {
@@ -2818,7 +2836,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
2818
2836
  _: 3
2819
2837
  }, 8, ["class"])]),
2820
2838
  _: 3
2821
- }, 8, ["style", "class"])]),
2839
+ }, 16, ["style", "class"])]),
2822
2840
  _: 3
2823
2841
  })]),
2824
2842
  _: 3
@@ -6991,6 +7009,9 @@ var Combobox_default = /* @__PURE__ */ defineComponent({
6991
7009
  default: true
6992
7010
  },
6993
7011
  maxHeight: { default: void 0 },
7012
+ popoverAlign: { default: void 0 },
7013
+ popoverWidth: { default: "trigger" },
7014
+ popoverProps: { default: void 0 },
6994
7015
  menuTrigger: { default: "input" },
6995
7016
  selectOnFocus: { type: Boolean },
6996
7017
  disallowEmptySelection: { type: Boolean },
@@ -7209,15 +7230,14 @@ var Combobox_default = /* @__PURE__ */ defineComponent({
7209
7230
  "data-invalid",
7210
7231
  "data-disabled"
7211
7232
  ]), createVNode(unref(ComboboxPortal$1), null, {
7212
- default: withCtx(() => [createVNode(unref(ComboboxContent), {
7213
- class: normalizeClass(unref(partClasses)("select__popover combobox__popover", _ctx.$props.classNames?.popover)),
7214
- style: normalizeStyle(popoverStyle.value),
7233
+ default: withCtx(() => [createVNode(unref(ComboboxContent), mergeProps({
7234
+ class: unref(partClasses)(["select__popover combobox__popover", unref(popoverWidthClass)(__props.popoverWidth)], _ctx.$props.classNames?.popover),
7235
+ style: popoverStyle.value,
7215
7236
  position: "popper",
7216
- "side-offset": 4,
7217
- onEscapeKeyDown: _cache[5] || (_cache[5] = (event) => {
7218
- if (!event.isComposing) event.stopPropagation();
7219
- })
7220
- }, {
7237
+ dir: __props.dir
7238
+ }, unref(popoverPosition)(_ctx.$props, { sideOffset: 4 }), { onEscapeKeyDown: _cache[5] || (_cache[5] = (event) => {
7239
+ if (!event.isComposing) event.stopPropagation();
7240
+ }) }), {
7221
7241
  default: withCtx(() => [createVNode(unref(ComboboxViewport), { class: normalizeClass(unref(partClasses)("select__list", _ctx.$props.classNames?.list)) }, {
7222
7242
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(filtered.value, (option) => {
7223
7243
  return openBlock(), createBlock(unref(ComboboxItem$1), {
@@ -7246,7 +7266,11 @@ var Combobox_default = /* @__PURE__ */ defineComponent({
7246
7266
  _: 3
7247
7267
  }, 8, ["class"])]),
7248
7268
  _: 3
7249
- }, 8, ["class", "style"])]),
7269
+ }, 16, [
7270
+ "class",
7271
+ "style",
7272
+ "dir"
7273
+ ])]),
7250
7274
  _: 3
7251
7275
  })]),
7252
7276
  _: 3
@@ -8100,7 +8124,9 @@ var DateRangePicker_default = /* @__PURE__ */ defineComponent({
8100
8124
  isDateUnavailable: {
8101
8125
  type: Function,
8102
8126
  default: void 0
8103
- }
8127
+ },
8128
+ popoverAlign: {},
8129
+ popoverProps: {}
8104
8130
  },
8105
8131
  emits: [
8106
8132
  "update:modelValue",
@@ -8286,13 +8312,13 @@ var DateRangePicker_default = /* @__PURE__ */ defineComponent({
8286
8312
  default: withCtx(() => [isDialog.value ? (openBlock(), createBlock(unref(DialogOverlay), {
8287
8313
  key: 0,
8288
8314
  class: "temporal-picker__overlay"
8289
- })) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent(overlay.value.Content), {
8315
+ })) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent(overlay.value.Content), mergeProps({
8290
8316
  "as-child": "",
8291
- side: "bottom",
8292
- align: "start",
8293
- "side-offset": 8,
8294
- "collision-padding": 16
8295
- }, {
8317
+ dir: __props.dir
8318
+ }, unref(popoverPosition)(_ctx.$props, {
8319
+ sideOffset: 8,
8320
+ collisionPadding: 16
8321
+ })), {
8296
8322
  default: withCtx(() => [createElementVNode("div", {
8297
8323
  class: normalizeClass(unref(partClasses)([
8298
8324
  "date-range__panel",
@@ -8329,7 +8355,7 @@ var DateRangePicker_default = /* @__PURE__ */ defineComponent({
8329
8355
  "required"
8330
8356
  ])], 10, _hoisted_6$4)]),
8331
8357
  _: 1
8332
- }))]),
8358
+ }, 16, ["dir"]))]),
8333
8359
  _: 1
8334
8360
  }))]),
8335
8361
  _: 1
@@ -8634,7 +8660,9 @@ var TemporalField_default = /* @__PURE__ */ defineComponent({
8634
8660
  secondStep: {},
8635
8661
  granularity: { default: "minute" },
8636
8662
  timeZone: { default: "UTC" },
8637
- disambiguation: {}
8663
+ disambiguation: {},
8664
+ popoverAlign: {},
8665
+ popoverProps: {}
8638
8666
  },
8639
8667
  emits: [
8640
8668
  "update:modelValue",
@@ -9092,6 +9120,8 @@ var TimeControls_default = /* @__PURE__ */ defineComponent({
9092
9120
  granularity: { default: "minute" },
9093
9121
  timeZone: {},
9094
9122
  disambiguation: {},
9123
+ popoverAlign: {},
9124
+ popoverProps: {},
9095
9125
  presentation: { default: "list" }
9096
9126
  },
9097
9127
  emits: ["update:modelValue", "change"],
@@ -9446,24 +9476,51 @@ var TemporalPickerContent = /* @__PURE__ */ defineComponent({
9446
9476
  return () => h("div", attrs, slots.default?.() ?? h(TemporalPanel_default));
9447
9477
  }
9448
9478
  });
9479
+ var positionKeys = [
9480
+ "side",
9481
+ "align",
9482
+ "sideOffset",
9483
+ "alignOffset",
9484
+ "avoidCollisions",
9485
+ "collisionPadding"
9486
+ ];
9487
+ /** Position attributes set on this part win over the picker's `popoverAlign` / `popoverProps`. */
9449
9488
  var TemporalPickerPopover = /* @__PURE__ */ defineComponent({
9450
9489
  name: "TemporalPickerPopover",
9451
9490
  setup(_, { attrs, slots }) {
9452
9491
  const c = useTemporal();
9453
- return () => h(c.isDialog.value ? Reka.DialogPortal : Reka.PopoverPortal, {}, () => [c.isDialog.value ? h(Reka.DialogOverlay, { class: "temporal-picker__overlay" }) : null, h(c.isDialog.value ? Reka.DialogContent : Reka.PopoverContent, {
9454
- ...attrs,
9455
- side: "bottom",
9456
- align: "start",
9457
- sideOffset: 8,
9458
- collisionPadding: 16,
9459
- class: [
9460
- "date-range__panel",
9461
- "temporal-picker__panel",
9462
- c.isDialog.value ? "temporal-picker__modal" : null,
9463
- attrs.class
9464
- ],
9465
- "aria-labelledby": `${c.id}-label`
9466
- }, () => [c.isDialog.value ? h(Reka.DialogTitle, { class: "temporal__sr-only" }, () => c.options.label) : null, slots.default?.() ?? h(TemporalPanel_default)])]);
9492
+ return () => {
9493
+ const own = {};
9494
+ const rest = {};
9495
+ for (const [key, value] of Object.entries(attrs)) {
9496
+ const name = key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
9497
+ if (positionKeys.includes(name)) own[name] = value;
9498
+ else rest[key] = value;
9499
+ }
9500
+ const position = c.isDialog.value ? {} : popoverPosition({
9501
+ popoverAlign: c.options.popoverAlign,
9502
+ popoverProps: {
9503
+ ...c.options.popoverProps,
9504
+ ...own
9505
+ }
9506
+ }, {
9507
+ sideOffset: 8,
9508
+ collisionPadding: 16
9509
+ });
9510
+ const direction = c.isDialog.value || !c.options.dir ? {} : { dir: c.options.dir };
9511
+ return h(c.isDialog.value ? Reka.DialogPortal : Reka.PopoverPortal, {}, () => [c.isDialog.value ? h(Reka.DialogOverlay, { class: "temporal-picker__overlay" }) : null, h(c.isDialog.value ? Reka.DialogContent : Reka.PopoverContent, {
9512
+ ...rest,
9513
+ ...position,
9514
+ ...direction,
9515
+ class: [
9516
+ "date-range__panel",
9517
+ "temporal-picker__panel",
9518
+ c.isDialog.value ? "temporal-picker__modal" : null,
9519
+ attrs.class
9520
+ ],
9521
+ "aria-labelledby": `${c.id}-label`
9522
+ }, () => [c.isDialog.value ? h(Reka.DialogTitle, { class: "temporal__sr-only" }, () => c.options.label) : null, slots.default?.() ?? h(TemporalPanel_default)])]);
9523
+ };
9467
9524
  }
9468
9525
  });
9469
9526
  function action(kind) {
@@ -9530,7 +9587,10 @@ var TemporalPicker_default = /* @__PURE__ */ defineComponent({
9530
9587
  name: {},
9531
9588
  description: {},
9532
9589
  errorMessage: {},
9533
- open: { type: Boolean },
9590
+ open: {
9591
+ type: Boolean,
9592
+ default: void 0
9593
+ },
9534
9594
  defaultOpen: {
9535
9595
  type: Boolean,
9536
9596
  default: false
@@ -9563,6 +9623,8 @@ var TemporalPicker_default = /* @__PURE__ */ defineComponent({
9563
9623
  granularity: {},
9564
9624
  timeZone: { default: "UTC" },
9565
9625
  disambiguation: {},
9626
+ popoverAlign: {},
9627
+ popoverProps: {},
9566
9628
  kind: { default: "date" },
9567
9629
  range: {
9568
9630
  type: Boolean,
@@ -9838,6 +9900,8 @@ var TemporalRangeField_default = /* @__PURE__ */ defineComponent({
9838
9900
  granularity: {},
9839
9901
  timeZone: {},
9840
9902
  disambiguation: {},
9903
+ popoverAlign: {},
9904
+ popoverProps: {},
9841
9905
  kind: { default: "date" },
9842
9906
  modelValue: { default: void 0 },
9843
9907
  defaultValue: { default: null }