@tb-dev/vue 0.3.15 → 0.3.16

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.
@@ -1,5 +1,5 @@
1
- import { VNode } from 'vue';
2
1
  import { SidebarProps } from './types';
2
+ import { VNode } from 'vue';
3
3
  declare function __VLS_template(): {
4
4
  attrs: Partial<{}>;
5
5
  slots: Readonly<{
@@ -1,3 +1,9 @@
1
+ import { SidebarProps as Props } from '../__base/sidebar';
1
2
  export interface SidebarProps {
3
+ collapsible?: Props['collapsible'];
2
4
  defaultOpen?: boolean;
5
+ side?: Props['side'];
6
+ variant?: Props['variant'];
7
+ width?: string | number;
8
+ widthMobile?: string | number;
3
9
  }
package/dist/index.js CHANGED
@@ -4957,13 +4957,32 @@ const sidebarMenuButtonVariants = cva(
4957
4957
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
4958
4958
  __name: "Sidebar",
4959
4959
  props: {
4960
- defaultOpen: { type: Boolean }
4960
+ collapsible: {},
4961
+ defaultOpen: { type: Boolean },
4962
+ side: {},
4963
+ variant: {},
4964
+ width: {},
4965
+ widthMobile: {}
4961
4966
  },
4962
4967
  setup(__props) {
4968
+ const props = __props;
4969
+ const sidebarStyle = computed(() => {
4970
+ const style = {};
4971
+ if (props.width) style["--sidebar-width"] = toPixel(props.width);
4972
+ if (props.widthMobile) style["--sidebar-width-mobile"] = toPixel(props.widthMobile);
4973
+ return style;
4974
+ });
4963
4975
  return (_ctx, _cache) => {
4964
- return openBlock(), createBlock(unref(_sfc_main$t), { "default-open": _ctx.defaultOpen }, {
4976
+ return openBlock(), createBlock(unref(_sfc_main$t), {
4977
+ "default-open": _ctx.defaultOpen,
4978
+ style: normalizeStyle(sidebarStyle.value)
4979
+ }, {
4965
4980
  default: withCtx(() => [
4966
- createVNode(unref(_sfc_main$R), null, {
4981
+ createVNode(unref(_sfc_main$R), {
4982
+ collapsible: _ctx.collapsible,
4983
+ side: _ctx.side,
4984
+ variant: _ctx.variant
4985
+ }, {
4967
4986
  default: withCtx(() => [
4968
4987
  _ctx.$slots.header ? (openBlock(), createBlock(unref(_sfc_main$K), { key: 0 }, {
4969
4988
  default: withCtx(() => [
@@ -4985,7 +5004,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4985
5004
  })) : createCommentVNode("", true)
4986
5005
  ]),
4987
5006
  _: 3
4988
- }),
5007
+ }, 8, ["collapsible", "side", "variant"]),
4989
5008
  _ctx.$slots.inset ? (openBlock(), createBlock(unref(_sfc_main$J), { key: 0 }, {
4990
5009
  default: withCtx(() => [
4991
5010
  renderSlot(_ctx.$slots, "inset")
@@ -4994,7 +5013,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4994
5013
  })) : renderSlot(_ctx.$slots, "default", { key: 1 })
4995
5014
  ]),
4996
5015
  _: 3
4997
- }, 8, ["default-open"]);
5016
+ }, 8, ["default-open", "style"]);
4998
5017
  };
4999
5018
  }
5000
5019
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tb-dev/vue",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "Vue utilities",
5
5
  "license": "MIT",
6
6
  "type": "module",