@vinicunca/taman-ui 0.1.0 → 0.1.1

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,6 +1,6 @@
1
1
  # @vinicunca/taman-ui
2
2
 
3
- Unstyled Vue components for Taman on [pohon-ui](https://vinicunca.dev/pohon):
3
+ Unstyled Vue components for Taman on [pohon-ui](https://pohon.vinicunca.dev):
4
4
  base components, dialogs and drawers, layout, menu, tabs and forms. Styling is
5
5
  the consumer's job, the way shadcn works: the package ships no CSS, theme or
6
6
  preset. ESM only; built for Vite.
@@ -52,7 +52,7 @@ components; without it they render with none of their own utilities.
52
52
  Pick one:
53
53
 
54
54
  - **pohon's default look** — leave pohon's `theme.unstyled` at its default
55
- and follow pohon's [installation guide](https://vinicunca.dev/pohon/getting-started/installation/vue).
55
+ and follow pohon's [installation guide](https://pohon.vinicunca.dev/docs/getting-started/installation/vue).
56
56
  - **Your own design** — set `theme: { unstyled: true }` and pass your own
57
57
  `ui` config to `vitePohon`. Taman's admin template (planned) ships its
58
58
  design this way.
@@ -133,7 +133,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
133
133
  hasCollapsibleFields.value ? (openBlock(), createElementBlock("button", {
134
134
  key: 3,
135
135
  type: "button",
136
- class: "form-collapse-trigger text-sm color-primary cursor-pointer inline-flex gap-1 items-center",
136
+ class: "form-collapse-trigger text-sm color-primary inline-flex gap-1 cursor-pointer items-center",
137
137
  "aria-controls": props.gridId,
138
138
  "aria-expanded": !collapsed.value,
139
139
  onClick: _cache[0] || (_cache[0] = ($event) => collapsed.value = !collapsed.value)
@@ -5,13 +5,30 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
5
5
  __name: "taman-core-button-fixed",
6
6
  props: {
7
7
  "expandOnHover": { type: Boolean },
8
- "expandOnHoverModifiers": {}
8
+ "expandOnHoverModifiers": {},
9
+ "expandOnHovering": { type: Boolean },
10
+ "expandOnHoveringModifiers": {},
11
+ "collapse": { type: Boolean },
12
+ "collapseModifiers": {},
13
+ "extraVisible": { type: Boolean },
14
+ "extraVisibleModifiers": {}
9
15
  },
10
- emits: ["update:expandOnHover"],
16
+ emits: [
17
+ "update:expandOnHover",
18
+ "update:expandOnHovering",
19
+ "update:collapse",
20
+ "update:extraVisible"
21
+ ],
11
22
  setup(__props) {
12
23
  const expandOnHover = useModel(__props, "expandOnHover");
24
+ const expandOnHovering = useModel(__props, "expandOnHovering");
25
+ const collapse = useModel(__props, "collapse");
26
+ const extraVisible = useModel(__props, "extraVisible");
13
27
  function toggleFixed() {
14
28
  expandOnHover.value = !expandOnHover.value;
29
+ collapse.value = false;
30
+ extraVisible.value = true;
31
+ if (!expandOnHover.value) expandOnHovering.value = true;
15
32
  }
16
33
  return (_ctx, _cache) => {
17
34
  return openBlock(), createBlock(PButton, {
@@ -115,9 +115,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
115
115
  });
116
116
  const extraStyle = computed(() => {
117
117
  const { extraWidth, show, width, zIndex } = props;
118
+ const shouldShow = (extraVisible.value || expandOnHover.value || expandOnHovering.value) && show && !collapse.value;
118
119
  return {
119
120
  left: `${width}px`,
120
- width: extraVisible.value && show ? `${extraWidth}px` : 0,
121
+ width: shouldShow ? `${extraWidth}px` : 0,
121
122
  zIndex
122
123
  };
123
124
  });
@@ -161,7 +162,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
161
162
  });
162
163
  function getMenuWidthValue(isHiddenDom) {
163
164
  const { collapseWidth, extraWidth, mixedWidth, fixedExtra, isSidebarMixed, width } = props;
164
- let widthValue = width === 0 ? "0px" : `${width + (isSidebarMixed && fixedExtra && extraVisible.value ? extraWidth : 0)}px`;
165
+ const showExtra = isSidebarMixed && !collapse.value && (fixedExtra || expandOnHovering.value) && (extraVisible.value || expandOnHover.value);
166
+ let widthValue = width === 0 ? "0px" : `${width + (showExtra ? extraWidth : 0)}px`;
165
167
  if (isHiddenDom && expandOnHovering.value && !expandOnHover.value) widthValue = isSidebarMixed ? `${mixedWidth}px` : `${collapseWidth}px`;
166
168
  return widthValue;
167
169
  }
@@ -183,9 +185,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
183
185
  function handleMouseenter(event) {
184
186
  if (props.isMobile) return;
185
187
  if (event?.offsetX < 10) return;
186
- if (expandOnHover.value) return;
188
+ if (expandOnHover.value) {
189
+ if (props.isSidebarMixed) extraVisible.value = true;
190
+ return;
191
+ }
187
192
  if (!expandOnHovering.value) collapse.value = false;
188
- if (props.isSidebarMixed) isLocked.value = true;
193
+ if (props.isSidebarMixed) {
194
+ isLocked.value = true;
195
+ extraVisible.value = true;
196
+ }
189
197
  expandOnHovering.value = true;
190
198
  }
191
199
  function handleMouseleave() {
@@ -249,9 +257,20 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
249
257
  }, [
250
258
  !collapse.value && !__props.isSidebarMixed && __props.showFixedButton ? (openBlock(), createBlock(_sfc_main$3, {
251
259
  key: 0,
260
+ collapse: collapse.value,
261
+ "onUpdate:collapse": _cache[0] || (_cache[0] = ($event) => collapse.value = $event),
252
262
  "expand-on-hover": expandOnHover.value,
253
- "onUpdate:expandOnHover": _cache[0] || (_cache[0] = ($event) => expandOnHover.value = $event)
254
- }, null, 8, ["expand-on-hover"])) : createCommentVNode("v-if", true),
263
+ "onUpdate:expandOnHover": _cache[1] || (_cache[1] = ($event) => expandOnHover.value = $event),
264
+ "expand-on-hovering": expandOnHovering.value,
265
+ "onUpdate:expandOnHovering": _cache[2] || (_cache[2] = ($event) => expandOnHovering.value = $event),
266
+ "extra-visible": extraVisible.value,
267
+ "onUpdate:extraVisible": _cache[3] || (_cache[3] = ($event) => extraVisible.value = $event)
268
+ }, null, 8, [
269
+ "collapse",
270
+ "expand-on-hover",
271
+ "expand-on-hovering",
272
+ "extra-visible"
273
+ ])) : createCommentVNode("v-if", true),
255
274
  unref(slots).logo ? (openBlock(), createElementBlock("div", {
256
275
  key: 1,
257
276
  style: normalizeStyle(headerStyle.value)
@@ -268,7 +287,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
268
287
  __props.showCollapseButton && !__props.isSidebarMixed ? (openBlock(), createBlock(_sfc_main$2, {
269
288
  key: 2,
270
289
  collapsed: collapse.value,
271
- "onUpdate:collapsed": _cache[1] || (_cache[1] = ($event) => collapse.value = $event)
290
+ "onUpdate:collapsed": _cache[4] || (_cache[4] = ($event) => collapse.value = $event)
272
291
  }, null, 8, ["collapsed"])) : createCommentVNode("v-if", true)
273
292
  ], 6),
274
293
  __props.isSidebarMixed ? (openBlock(), createElementBlock("div", {
@@ -279,13 +298,24 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
279
298
  __props.isSidebarMixed && expandOnHover.value ? (openBlock(), createBlock(_sfc_main$2, {
280
299
  key: 0,
281
300
  collapsed: extraCollapse.value,
282
- "onUpdate:collapsed": _cache[2] || (_cache[2] = ($event) => extraCollapse.value = $event)
301
+ "onUpdate:collapsed": _cache[5] || (_cache[5] = ($event) => extraCollapse.value = $event)
283
302
  }, null, 8, ["collapsed"])) : createCommentVNode("v-if", true),
284
303
  !extraCollapse.value ? (openBlock(), createBlock(_sfc_main$3, {
285
304
  key: 1,
305
+ collapse: collapse.value,
306
+ "onUpdate:collapse": _cache[6] || (_cache[6] = ($event) => collapse.value = $event),
286
307
  "expand-on-hover": expandOnHover.value,
287
- "onUpdate:expandOnHover": _cache[3] || (_cache[3] = ($event) => expandOnHover.value = $event)
288
- }, null, 8, ["expand-on-hover"])) : createCommentVNode("v-if", true),
308
+ "onUpdate:expandOnHover": _cache[7] || (_cache[7] = ($event) => expandOnHover.value = $event),
309
+ "expand-on-hovering": expandOnHovering.value,
310
+ "onUpdate:expandOnHovering": _cache[8] || (_cache[8] = ($event) => expandOnHovering.value = $event),
311
+ "extra-visible": extraVisible.value,
312
+ "onUpdate:extraVisible": _cache[9] || (_cache[9] = ($event) => extraVisible.value = $event)
313
+ }, null, 8, [
314
+ "collapse",
315
+ "expand-on-hover",
316
+ "expand-on-hovering",
317
+ "extra-visible"
318
+ ])) : createCommentVNode("v-if", true),
289
319
  !extraCollapse.value ? (openBlock(), createElementBlock("div", {
290
320
  key: 2,
291
321
  style: normalizeStyle(extraTitleStyle.value),
@@ -4,12 +4,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
4
4
  name: "CollapseTransition",
5
5
  __name: "collapse-transition",
6
6
  setup(__props) {
7
- const reset = (el) => {
7
+ function reset(el) {
8
8
  el.style.maxHeight = "";
9
9
  el.style.overflow = el.dataset.oldOverflow;
10
10
  el.style.paddingTop = el.dataset.oldPaddingTop;
11
11
  el.style.paddingBottom = el.dataset.oldPaddingBottom;
12
- };
12
+ }
13
13
  const on = {
14
14
  afterEnter(el) {
15
15
  el.style.maxHeight = "";
@@ -39,7 +39,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
39
39
  "dot-style": badgeStyle.value
40
40
  }, null, 8, ["dot-class", "dot-style"])) : (openBlock(), createElementBlock("div", {
41
41
  key: 1,
42
- class: normalizeClass([badgeClass.value, "text-primary-foreground text-[10px] px-1.5 py-0.5 rounded-xl flex-center"]),
42
+ class: normalizeClass([badgeClass.value, "text-[10px] text-primary-foreground px-1.5 py-0.5 rounded-xl flex-center"]),
43
43
  style: normalizeStyle(badgeStyle.value)
44
44
  }, toDisplayString(__props.badge), 7))], 2)) : createCommentVNode("v-if", true);
45
45
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/taman-ui",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "description": "Unstyled Taman Vue components on pohon-ui: base components, popups, layout, menu, tabs and forms.",
6
6
  "license": "MIT",
7
7
  "repository": {