@soft-stech/bootsman-ui-shadcn 1.4.19 → 1.4.21

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 (33) hide show
  1. package/dist/BuiAdvancedAccordionTrigger.vue_vue_type_script_setup_true_lang-CGtIg8gS.js +73 -0
  2. package/dist/{BuiScrollArea.vue_vue_type_script_setup_true_lang-DWubHfUF.js → BuiScrollArea.vue_vue_type_script_setup_true_lang-D-nqw_Ka.js} +1 -1
  3. package/dist/{BuiScrollBar.vue_vue_type_script_setup_true_lang-DjO8ARLW.js → BuiScrollBar.vue_vue_type_script_setup_true_lang-DNZ_v7U0.js} +1 -1
  4. package/dist/{BuiTable.vue_vue_type_script_setup_true_lang-CKRiQHpD.js → BuiTable.vue_vue_type_script_setup_true_lang-D8Tseif4.js} +3 -3
  5. package/dist/BuiTableHead.vue_vue_type_script_setup_true_lang-BDSRArVd.js +38 -0
  6. package/dist/BuiTableHeader.vue_vue_type_script_setup_true_lang-B2getNR7.js +26 -0
  7. package/dist/assets/main.css +1 -1
  8. package/dist/components/ui/accordion/BuiAdvancedAccordionTrigger.js +4 -0
  9. package/dist/components/ui/accordion/BuiAdvancedAccordionTrigger.vue.d.ts +35 -0
  10. package/dist/components/ui/accordion/index.d.ts +1 -0
  11. package/dist/components/ui/accordion/index.js +5 -3
  12. package/dist/components/ui/scroll-area/BuiScrollArea.js +1 -1
  13. package/dist/components/ui/scroll-area/BuiScrollBar.js +1 -1
  14. package/dist/components/ui/scroll-area/index.js +2 -2
  15. package/dist/components/ui/table/BuiDataTable.vue.d.ts +1 -0
  16. package/dist/components/ui/table/BuiTable.js +1 -1
  17. package/dist/components/ui/table/BuiTableHead.js +1 -1
  18. package/dist/components/ui/table/BuiTableHead.vue.d.ts +3 -0
  19. package/dist/components/ui/table/BuiTableHeader.js +1 -1
  20. package/dist/components/ui/table/BuiTableHeader.vue.d.ts +2 -0
  21. package/dist/components/ui/table/index.js +81 -77
  22. package/dist/index.js +379 -377
  23. package/package.json +1 -1
  24. package/src/components/stories/BuiAccordion.story.vue +54 -0
  25. package/src/components/ui/accordion/BuiAdvancedAccordionTrigger.vue +71 -0
  26. package/src/components/ui/accordion/index.ts +1 -0
  27. package/src/components/ui/scroll-area/BuiScrollBar.vue +13 -9
  28. package/src/components/ui/table/BuiDataTable.vue +3 -1
  29. package/src/components/ui/table/BuiTable.vue +1 -1
  30. package/src/components/ui/table/BuiTableHead.vue +18 -3
  31. package/src/components/ui/table/BuiTableHeader.vue +9 -3
  32. package/dist/BuiTableHead.vue_vue_type_script_setup_true_lang-uE4Py8ky.js +0 -26
  33. package/dist/BuiTableHeader.vue_vue_type_script_setup_true_lang-BcnB4-3x.js +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soft-stech/bootsman-ui-shadcn",
3
- "version": "1.4.19",
3
+ "version": "1.4.21",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -4,6 +4,7 @@ import BuiAccordionContent from '@/components/ui/accordion/BuiAccordionContent.v
4
4
  import BuiAccordionItem from '@/components/ui/accordion/BuiAccordionItem.vue'
5
5
  import BuiAccordionTrigger from '@/components/ui/accordion/BuiAccordionTrigger.vue'
6
6
  import BuiButton from '@/components/ui/button/BuiButton.vue'
7
+ import BuiAdvancedAccordionTrigger from '@/components/ui/accordion/BuiAdvancedAccordionTrigger.vue'
7
8
  </script>
8
9
 
9
10
  <template>
@@ -57,5 +58,58 @@ import BuiButton from '@/components/ui/button/BuiButton.vue'
57
58
  </BuiAccordionItem>
58
59
  </BuiAccordion>
59
60
  </Variant>
61
+ <Variant title="AdvancedTrigger">
62
+ <BuiAccordion type="single" collapsible class="flex flex-col gap-4 px-2">
63
+ <BuiAccordionItem value="item-1" class="border-orange-400">
64
+ <BuiAdvancedAccordionTrigger
65
+ border-color-class="border-orange-400"
66
+ bg-color-class="bg-orange-400/[0.16]"
67
+ description-color-class="text-orange-400"
68
+ icon-bg-class="bg-orange-400"
69
+ >
70
+ Member Roles
71
+
72
+ <template #description>
73
+ Control who has access to the cluster and what permission they have to change it
74
+ </template>
75
+ </BuiAdvancedAccordionTrigger>
76
+
77
+ <BuiAccordionContent>
78
+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus a voluptatem, ipsa autem
79
+ aspernatur beatae fugiat deleniti laborum dolorem obcaecati necessitatibus harum dolore
80
+ error! Perferendis nostrum eius eligendi dolorum reprehenderit?
81
+ </BuiAccordionContent>
82
+ </BuiAccordionItem>
83
+ <BuiAccordionItem value="item-2" class="border-orange-400" :disabled="true">
84
+ <BuiAdvancedAccordionTrigger
85
+ border-color-class="border-orange-400"
86
+ bg-color-class="bg-orange-400/[0.16]"
87
+ description-color-class="text-orange-400"
88
+ icon-bg-class="bg-orange-400"
89
+ :is-disabled-as-normal="true"
90
+ :is-icon-hidden="true"
91
+ >
92
+ Member Roles
93
+
94
+ <template #description>
95
+ Control who has access to the cluster and what permission they have to change it
96
+ </template>
97
+ <template #actions>
98
+ <BuiButton
99
+ variant="outline"
100
+ class="border-orange-400 text-orange-400"
101
+ @click="
102
+ () => {
103
+ console.log('click')
104
+ }
105
+ "
106
+ >
107
+ LOG: click
108
+ </BuiButton>
109
+ </template>
110
+ </BuiAdvancedAccordionTrigger>
111
+ </BuiAccordionItem>
112
+ </BuiAccordion>
113
+ </Variant>
60
114
  </Story>
61
115
  </template>
@@ -0,0 +1,71 @@
1
+ <script setup lang="ts">
2
+ // TODO see https://github.com/shadcn-ui/ui/pull/232 when completed
3
+
4
+ import { cn } from '@/lib/utils'
5
+ import { ChevronDown } from 'lucide-vue-next'
6
+ import { AccordionHeader, AccordionTrigger, type AccordionTriggerProps } from 'radix-vue'
7
+
8
+ const props = defineProps<
9
+ AccordionTriggerProps & {
10
+ class?: string
11
+ borderColorClass?: string
12
+ bgColorClass?: string
13
+ iconBgClass?: string
14
+ descriptionColorClass?: string
15
+ isIconHidden?: boolean
16
+ isDisabledAsNormal?: boolean
17
+ }
18
+ >()
19
+ </script>
20
+
21
+ <template>
22
+ <AccordionHeader
23
+ :class="
24
+ cn(
25
+ 'flex flex-col p-2 data-[state=closed]:rounded-sm data-[state=open]:rounded-t-sm data-[state=open]:border-b',
26
+ props.borderColorClass ? props.borderColorClass : 'border-border',
27
+ props.bgColorClass ? props.bgColorClass : 'bg-primary/[0.16]'
28
+ )
29
+ "
30
+ as="div"
31
+ >
32
+ <div class="flex justify-between gap-2">
33
+ <AccordionTrigger
34
+ v-bind="props"
35
+ :class="
36
+ cn(
37
+ 'flex flex-1 items-center gap-2 rounded align-middle text-base font-semibold leading-6 ring-offset-background transition-all hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none [&[data-state=open]>svg]:rotate-180',
38
+ props.class,
39
+ props.isDisabledAsNormal ? 'disabled:opacity-100' : 'disabled:opacity-30'
40
+ )
41
+ "
42
+ >
43
+ <ChevronDown
44
+ :class="
45
+ cn(
46
+ 'h-4 w-4 shrink-0 rounded-sm text-primary-foreground transition-transform duration-200',
47
+ props.iconBgClass
48
+ ? `${props.iconBgClass} dark:${props.iconBgClass}`
49
+ : 'bg-primary/[0.56] dark:bg-primary/[1]',
50
+ props.isIconHidden ? 'invisible' : 'visible'
51
+ )
52
+ "
53
+ />
54
+ <slot />
55
+ </AccordionTrigger>
56
+ <slot name="actions" />
57
+ </div>
58
+
59
+ <p
60
+ v-if="$slots.description"
61
+ :class="
62
+ cn(
63
+ 'mx-6 mt-2 align-middle text-xs font-normal leading-4',
64
+ props.descriptionColorClass ? props.descriptionColorClass : ''
65
+ )
66
+ "
67
+ >
68
+ <slot name="description" />
69
+ </p>
70
+ </AccordionHeader>
71
+ </template>
@@ -2,3 +2,4 @@ export { default as BuiAccordion } from './BuiAccordion.vue'
2
2
  export { default as BuiAccordionContent } from './BuiAccordionContent.vue'
3
3
  export { default as BuiAccordionItem } from './BuiAccordionItem.vue'
4
4
  export { default as BuiAccordionTrigger } from './BuiAccordionTrigger.vue'
5
+ export { default as BuiAdvancedAccordionTrigger } from './BuiAdvancedAccordionTrigger.vue'
@@ -3,9 +3,12 @@ import { type HTMLAttributes, computed } from 'vue'
3
3
  import { ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb } from 'radix-vue'
4
4
  import { cn } from '@/lib/utils'
5
5
 
6
- const props = withDefaults(defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes['class'] }>(), {
7
- orientation: 'vertical',
8
- })
6
+ const props = withDefaults(
7
+ defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes['class'] }>(),
8
+ {
9
+ orientation: 'vertical'
10
+ }
11
+ )
9
12
 
10
13
  const delegatedProps = computed(() => {
11
14
  const { class: _, ...delegated } = props
@@ -18,12 +21,13 @@ const delegatedProps = computed(() => {
18
21
  <ScrollAreaScrollbar
19
22
  v-bind="delegatedProps"
20
23
  :class="
21
- cn('flex touch-none select-none transition-colors',
22
- orientation === 'vertical'
23
- && 'h-full w-2.5 border-l border-l-transparent p-px',
24
- orientation === 'horizontal'
25
- && 'h-2.5 flex-col border-t border-t-transparent p-px',
26
- props.class)"
24
+ cn(
25
+ 'z-[2] flex touch-none select-none transition-colors',
26
+ orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-px',
27
+ orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-px',
28
+ props.class
29
+ )
30
+ "
27
31
  >
28
32
  <ScrollAreaThumb class="relative flex-1 rounded-full bg-border" />
29
33
  </ScrollAreaScrollbar>
@@ -49,6 +49,7 @@ const props = withDefaults(
49
49
  groupLabels?: { [key in keyof TData]?: string[] }
50
50
  getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string
51
51
  renderSubComponent?: (row: Row<TData>) => (() => any) | undefined
52
+ freezeHeader?: boolean
52
53
  }>(),
53
54
  { pageSize: 10, showPagination: true, manualPagination: true, manualSorting: true, totalItems: 0 }
54
55
  )
@@ -156,12 +157,13 @@ function getGroupLabel(index: number) {
156
157
  <slot name="caption" :table="table" />
157
158
  </div>
158
159
  <BuiTable>
159
- <BuiTableHeader>
160
+ <BuiTableHeader :freeze-header="props.freezeHeader">
160
161
  <BuiTableRow v-for="headerGroup in table.getHeaderGroups()" :key="headerGroup.id">
161
162
  <BuiTableHead
162
163
  v-for="header in headerGroup.headers"
163
164
  :key="header.id"
164
165
  :style="{ ...getPinningStyle(header.column) }"
166
+ :freeze-header="props.freezeHeader"
165
167
  >
166
168
  <FlexRender
167
169
  v-if="!header.isPlaceholder"
@@ -6,7 +6,7 @@ const props = defineProps<{ class?: string }>()
6
6
  </script>
7
7
 
8
8
  <template>
9
- <BuiScrollArea class="w-full overflow-auto rounded border border-border/[0.16]">
9
+ <BuiScrollArea class="w-full grow overflow-auto rounded border border-border/[0.16]">
10
10
  <table :class="cn('w-full caption-top text-sm', props.class)">
11
11
  <slot />
12
12
  </table>
@@ -1,19 +1,34 @@
1
1
  <script setup lang="ts">
2
2
  import { cn } from '@/lib/utils'
3
3
 
4
- const props = defineProps<{ class?: string }>()
4
+ const props = defineProps<{
5
+ class?: string
6
+ freezeHeader?: boolean
7
+ }>()
5
8
  </script>
6
9
 
7
10
  <template>
8
11
  <th
9
12
  :class="
10
13
  cn(
11
- 'h-10 bg-foreground/[0.04] text-left align-middle text-foreground [&:has([role=checkbox])]:pr-0 ',
12
- props.class
14
+ 'h-10 text-left align-middle text-foreground [&:has([role=checkbox])]:pr-0 ',
15
+ props.class,
16
+ props.freezeHeader ? 'bg-background p-0' : 'bg-foreground/[0.04]'
13
17
  )
14
18
  "
15
19
  >
16
20
  <div
21
+ v-if="props.freezeHeader"
22
+ class="flex h-full items-center border-b border-border/[0.16] bg-foreground/[0.04]"
23
+ >
24
+ <div
25
+ class="flex h-8 w-full items-center whitespace-nowrap border-r border-border/[0.16] px-3 text-sm font-semibold"
26
+ >
27
+ <slot />
28
+ </div>
29
+ </div>
30
+ <div
31
+ v-else
17
32
  class="flex h-8 items-center whitespace-nowrap border-r border-border/[0.16] px-3 py-1 text-sm font-semibold"
18
33
  >
19
34
  <slot />
@@ -1,15 +1,21 @@
1
1
  <script setup lang="ts">
2
2
  import { cn } from '@/lib/utils'
3
3
 
4
- const props = defineProps<{ class?: string }>()
4
+ const props = defineProps<{
5
+ class?: string
6
+ freezeHeader?: boolean
7
+ }>()
5
8
  </script>
6
9
 
7
10
  <template>
8
11
  <thead
9
12
  :class="
10
13
  cn(
11
- '[&_th:first-child>div]:pl-6 [&_th:last-child>div]:border-0 [&_th:last-child>div]:pr-6 [&_tr]:border-b [&_tr]:border-border/[0.16]',
12
- props.class
14
+ '[&_tr]:border-border/[0.16]',
15
+ props.class,
16
+ props.freezeHeader
17
+ ? 'sticky top-0 z-[1] [&_th:first-child>div>div]:pl-6 [&_th:last-child>div>div]:border-r-0 [&_th:last-child>div>div]:pr-6 [&_tr:last-child]:border-b-0'
18
+ : '[&_th:first-child>div]:pl-6 [&_th:last-child>div]:border-0 [&_th:last-child>div]:pr-6 [&_tr]:border-b'
13
19
  )
14
20
  "
15
21
  >
@@ -1,26 +0,0 @@
1
- import { defineComponent as t, openBlock as s, createElementBlock as n, normalizeClass as a, unref as l, createElementVNode as c, renderSlot as d } from "vue";
2
- import { g as p } from "./utils-CwP7Up6y.js";
3
- const m = { class: "flex h-8 items-center whitespace-nowrap border-r border-border/[0.16] px-3 py-1 text-sm font-semibold" }, u = /* @__PURE__ */ t({
4
- __name: "BuiTableHead",
5
- props: {
6
- class: {}
7
- },
8
- setup(e) {
9
- const o = e;
10
- return (r, i) => (s(), n("th", {
11
- class: a(
12
- l(p)(
13
- "h-10 bg-foreground/[0.04] text-left align-middle text-foreground [&:has([role=checkbox])]:pr-0 ",
14
- o.class
15
- )
16
- )
17
- }, [
18
- c("div", m, [
19
- d(r.$slots, "default")
20
- ])
21
- ], 2));
22
- }
23
- });
24
- export {
25
- u as _
26
- };
@@ -1,24 +0,0 @@
1
- import { defineComponent as o, openBlock as s, createElementBlock as l, normalizeClass as a, unref as c, renderSlot as d } from "vue";
2
- import { g as n } from "./utils-CwP7Up6y.js";
3
- const m = /* @__PURE__ */ o({
4
- __name: "BuiTableHeader",
5
- props: {
6
- class: {}
7
- },
8
- setup(r) {
9
- const e = r;
10
- return (t, i) => (s(), l("thead", {
11
- class: a(
12
- c(n)(
13
- "[&_th:first-child>div]:pl-6 [&_th:last-child>div]:border-0 [&_th:last-child>div]:pr-6 [&_tr]:border-b [&_tr]:border-border/[0.16]",
14
- e.class
15
- )
16
- )
17
- }, [
18
- d(t.$slots, "default")
19
- ], 2));
20
- }
21
- });
22
- export {
23
- m as _
24
- };