@dolanske/vui 1.2.1 → 1.4.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 (115) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +4 -27
  3. package/package.json +2 -2
  4. package/src/App.vue +8 -0
  5. package/src/components/Accordion/Accordion.vue +10 -3
  6. package/src/components/Accordion/accordion.scss +18 -3
  7. package/src/components/Button/Button.vue +5 -4
  8. package/src/components/Button/button.scss +9 -1
  9. package/src/components/ButtonGroup/button-group.scss +2 -2
  10. package/src/components/Calendar/calendar.scss +5 -0
  11. package/src/components/Card/Card.vue +1 -1
  12. package/src/components/CopyClipboard/CopyClipboard.vue +10 -3
  13. package/src/components/CopyClipboard/copy-clipboard.scss +1 -1
  14. package/src/components/Dropdown/Dropdown.vue +1 -15
  15. package/src/components/Dropdown/dropdown-item.scss +1 -1
  16. package/src/components/Dropdown/dropdown.scss +2 -2
  17. package/src/components/Grid/Grid.vue +3 -0
  18. package/src/components/Input/Counter.vue +1 -1
  19. package/src/components/Input/Password.vue +1 -1
  20. package/src/components/Input/input.scss +3 -3
  21. package/src/components/OTP/otp.scss +3 -3
  22. package/src/components/Pagination/Pagination.vue +25 -10
  23. package/src/components/Popout/Popout.vue +30 -9
  24. package/src/components/Popout/popout.scss +2 -1
  25. package/src/components/Progress/progress.scss +1 -1
  26. package/src/components/Select/Select.vue +2 -0
  27. package/src/components/Select/select.scss +1 -1
  28. package/src/components/Sidebar/sidebar.scss +1 -1
  29. package/src/components/Table/Head.vue +23 -16
  30. package/src/components/Table/table.scss +9 -8
  31. package/src/components/Tabs/Tabs.vue +1 -1
  32. package/src/components/Tabs/tabs.scss +2 -2
  33. package/src/components/Tooltip/Tooltip.vue +9 -17
  34. package/src/components/Tooltip/tooltip.scss +1 -4
  35. package/src/examples/ExampleAccordions.vue +17 -4
  36. package/src/examples/ExampleCopyClipboard.vue +2 -2
  37. package/src/examples/ExamplePalette.vue +6 -0
  38. package/src/examples/ExamplePopouts.vue +1 -1
  39. package/src/examples/ExampleTables.vue +164 -0
  40. package/src/examples/ExampleTabs.vue +3 -2
  41. package/src/internal/Backdrop/backdrop.scss +2 -2
  42. package/src/shared/helpers.ts +7 -0
  43. package/src/style/animation.scss +33 -5
  44. package/src/style/core.scss +24 -10
  45. package/src/style/fonts.scss +73 -0
  46. package/src/style/layout.scss +8 -39
  47. package/src/style/theme.scss +1 -1
  48. package/src/style/tooltip.scss +4 -4
  49. package/src/style/typography.scss +45 -25
  50. package/src/vite-env.d.ts +1 -1
  51. package/dist/components/Accordion/Accordion.vue.d.ts +0 -47
  52. package/dist/components/Accordion/AccordionGroup.vue.d.ts +0 -21
  53. package/dist/components/Alert/Alert.vue.d.ts +0 -36
  54. package/dist/components/Avatar/Avatar.vue.d.ts +0 -25
  55. package/dist/components/Badge/Badge.vue.d.ts +0 -22
  56. package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +0 -22
  57. package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +0 -18
  58. package/dist/components/Button/Button.vue.d.ts +0 -32
  59. package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +0 -22
  60. package/dist/components/Calendar/Calendar.vue.d.ts +0 -27
  61. package/dist/components/Card/Card.vue.d.ts +0 -26
  62. package/dist/components/Checkbox/Checkbox.vue.d.ts +0 -33
  63. package/dist/components/CopyClipboard/CopyClipboard.vue.d.ts +0 -41
  64. package/dist/components/Divider/Divider.vue.d.ts +0 -23
  65. package/dist/components/Drawer/Drawer.vue.d.ts +0 -53
  66. package/dist/components/Dropdown/Dropdown.vue.d.ts +0 -183
  67. package/dist/components/Dropdown/DropdownItem.vue.d.ts +0 -23
  68. package/dist/components/Dropdown/DropdownTitle.vue.d.ts +0 -21
  69. package/dist/components/Flex/Flex.vue.d.ts +0 -41
  70. package/dist/components/Grid/Grid.vue.d.ts +0 -34
  71. package/dist/components/Input/Color.vue.d.ts +0 -11
  72. package/dist/components/Input/Counter.vue.d.ts +0 -19
  73. package/dist/components/Input/Dropzone.vue.d.ts +0 -193
  74. package/dist/components/Input/File.vue.d.ts +0 -8
  75. package/dist/components/Input/Input.vue.d.ts +0 -56
  76. package/dist/components/Input/Password.vue.d.ts +0 -6
  77. package/dist/components/Input/Textarea.vue.d.ts +0 -31
  78. package/dist/components/Kbd/Kbd.vue.d.ts +0 -23
  79. package/dist/components/Kbd/KbdGroup.vue.d.ts +0 -19
  80. package/dist/components/Modal/Confirm.vue.d.ts +0 -43
  81. package/dist/components/Modal/Modal.vue.d.ts +0 -58
  82. package/dist/components/OTP/OTP.vue.d.ts +0 -44
  83. package/dist/components/OTP/OTPItem.vue.d.ts +0 -5
  84. package/dist/components/Pagination/Pagination.vue.d.ts +0 -46
  85. package/dist/components/Pagination/pagination.d.ts +0 -12
  86. package/dist/components/Popout/Popout.vue.d.ts +0 -42
  87. package/dist/components/Progress/Progress.vue.d.ts +0 -33
  88. package/dist/components/Radio/Radio.vue.d.ts +0 -29
  89. package/dist/components/Radio/RadioGroup.vue.d.ts +0 -27
  90. package/dist/components/Select/Select.vue.d.ts +0 -35
  91. package/dist/components/Sheet/Sheet.vue.d.ts +0 -47
  92. package/dist/components/Sidebar/Sidebar.vue.d.ts +0 -70
  93. package/dist/components/Skeleton/Skeleton.vue.d.ts +0 -8
  94. package/dist/components/Spinner/Spinner.vue.d.ts +0 -6
  95. package/dist/components/Switch/Switch.vue.d.ts +0 -28
  96. package/dist/components/Table/Cell.vue.d.ts +0 -22
  97. package/dist/components/Table/Head.vue.d.ts +0 -30
  98. package/dist/components/Table/Root.vue.d.ts +0 -41
  99. package/dist/components/Table/SelectAll.vue.d.ts +0 -2
  100. package/dist/components/Table/SelectRow.vue.d.ts +0 -6
  101. package/dist/components/Table/index.d.ts +0 -6
  102. package/dist/components/Table/table.d.ts +0 -68
  103. package/dist/components/Tabs/Tab.vue.d.ts +0 -22
  104. package/dist/components/Tabs/Tabs.vue.d.ts +0 -34
  105. package/dist/components/Toast/Toasts.vue.d.ts +0 -2
  106. package/dist/components/Toast/toast.d.ts +0 -287
  107. package/dist/components/Tooltip/Tooltip.vue.d.ts +0 -33
  108. package/dist/index.d.ts +0 -56
  109. package/dist/internal/Backdrop/Backdrop.vue.d.ts +0 -21
  110. package/dist/shared/helpers.d.ts +0 -32
  111. package/dist/shared/slots.d.ts +0 -20
  112. package/dist/shared/theme.d.ts +0 -3
  113. package/dist/shared/types.d.ts +0 -24
  114. package/dist/vui.css +0 -1
  115. package/dist/vui.js +0 -16166
@@ -72,7 +72,7 @@ select {
72
72
  border-radius: var(--border-radius-s);
73
73
  padding-inline: var(--space-xs);
74
74
  transition: var(--transition-fast);
75
- z-index: 1;
75
+ z-index: var(--z-default);
76
76
  font-size: var(--font-size-m);
77
77
  color: var(--color-text);
78
78
 
@@ -28,7 +28,7 @@
28
28
  width: 224px;
29
29
  position: absolute;
30
30
  top: 0;
31
- z-index: 50;
31
+ z-index: var(--z-nav);
32
32
  background-color: var(--color-bg);
33
33
  border-right: 1px solid var(--color-border);
34
34
  transition: var(--transition-slow);
@@ -2,6 +2,7 @@
2
2
  import type { Header } from './table'
3
3
  import { computed } from 'vue'
4
4
  import Button from '../Button/Button.vue'
5
+ import Tooltip from '../Tooltip/Tooltip.vue'
5
6
 
6
7
  interface Props {
7
8
  /**
@@ -23,16 +24,16 @@ const sortStateBind = computed(() => {
23
24
  return
24
25
  switch (props.header.sortKey) {
25
26
  case 'asc': return {
26
- 'icon': 'ph:sort-ascending',
27
- 'data-title-top': 'Ascending',
27
+ icon: 'ph:sort-ascending',
28
+ tooltipText: 'Ascending',
28
29
  }
29
30
  case 'desc': return {
30
- 'icon': 'ph:sort-descending',
31
- 'data-title-top': 'Descending',
31
+ icon: 'ph:sort-descending',
32
+ tooltipText: 'Descending',
32
33
  }
33
34
  default: return {
34
- 'icon': 'ph:arrows-down-up',
35
- 'data-title-top': 'Sort column',
35
+ icon: 'ph:arrows-down-up',
36
+ tooltipText: 'Sort column',
36
37
  }
37
38
  }
38
39
  })
@@ -44,16 +45,22 @@ const sortStateBind = computed(() => {
44
45
  <slot>
45
46
  {{ props.header?.label }}
46
47
  </slot>
47
- <Button
48
- v-if="props.sort && props.header"
49
- class="vui-table-sort-button"
50
- v-bind="sortStateBind"
51
- size="s"
52
- :plain="!!!props.header.sortKey"
53
- square
54
- variant="gray"
55
- @click="props.header.sortToggle"
56
- />
48
+ <template v-if="props.sort && props.header">
49
+ <Tooltip placement="top">
50
+ <Button
51
+ :icon="sortStateBind?.icon"
52
+ class="vui-table-sort-button"
53
+ size="s"
54
+ :plain="!!!props.header.sortKey"
55
+ square
56
+ variant="gray"
57
+ @click="props.header.sortToggle"
58
+ />
59
+ <template #tooltip>
60
+ {{ sortStateBind?.tooltipText }}
61
+ </template>
62
+ </Tooltip>
63
+ </template>
57
64
  </div>
58
65
  </th>
59
66
  </template>
@@ -1,3 +1,10 @@
1
+ .vui-table-overflow {
2
+ display: block;
3
+ max-width: 100%;
4
+ overflow-x: auto;
5
+ overflow-y: visible;
6
+ }
7
+
1
8
  .vui-table-container {
2
9
  display: block;
3
10
  width: 100%;
@@ -68,12 +75,11 @@
68
75
 
69
76
  th,
70
77
  td {
71
- font-size: var(--font-size-m);
72
78
  border: none;
73
79
  border-left: none !important;
74
80
  transition: var(--transition-fast);
75
81
  position: relative;
76
- z-index: 1;
82
+ z-index: var(--z-default);
77
83
 
78
84
  // Fixed width, only houses a checkbox component
79
85
  &.vui-table-interactive-cell {
@@ -109,7 +115,7 @@
109
115
  display: flex;
110
116
  align-items: center;
111
117
  justify-content: center;
112
- z-index: 2;
118
+ z-index: var(--z-active);
113
119
  position: absolute;
114
120
  inset: 0;
115
121
  padding: var(--space-xs);
@@ -139,11 +145,6 @@
139
145
  .vui-table-pagination-wrap {
140
146
  padding: var(--space-xs) var(--space-m);
141
147
  border-top: 1px solid var(--color-border);
142
-
143
- p {
144
- font-size: var(--font-size-s);
145
- color: var(--color-text-lighter);
146
- }
147
148
  }
148
149
  }
149
150
 
@@ -84,7 +84,7 @@ enforceSlotType(flattened, 'Tab')
84
84
  </template>
85
85
 
86
86
  <Transition name="fade" appear>
87
- <div ref="underline" class="vui-tab-underline" />
87
+ <div v-if="active" ref="underline" class="vui-tab-underline" />
88
88
  </Transition>
89
89
  </div>
90
90
  </template>
@@ -9,7 +9,7 @@
9
9
  &.vui-tabs-variant-filled {
10
10
  background-color: var(--color-bg-raised);
11
11
  border-bottom: none;
12
- z-index: 1;
12
+ z-index: var(--z-default);
13
13
  border-radius: var(--border-radius-m);
14
14
  padding-inline: 4px;
15
15
 
@@ -18,7 +18,7 @@
18
18
  background-color: var(--color-bg-lowered);
19
19
  top: 3px;
20
20
  bottom: 3px;
21
- z-index: -1;
21
+ z-index: var(--z-behind);
22
22
  border-radius: var(--border-radius-m);
23
23
  }
24
24
  }
@@ -1,6 +1,6 @@
1
1
  <script setup lang='ts'>
2
2
  import type { Placement } from '../../shared/types'
3
- import { ref, useId, useTemplateRef, watch } from 'vue'
3
+ import { computed, ref, useId, useTemplateRef, watch } from 'vue'
4
4
  import Popout from '../Popout/Popout.vue'
5
5
  import './tooltip.scss'
6
6
 
@@ -52,35 +52,27 @@ watch(hoverAnchor, (isHovering) => {
52
52
  })
53
53
 
54
54
  const id = useId()
55
+ const anchor = computed(() => popoutAnchorRef.value?.children[0] as HTMLElement | null)
55
56
  </script>
56
57
 
57
58
  <template>
58
59
  <div
59
60
  ref="popoutAnchor"
60
- :style="{
61
- width: 'fit-content',
62
- }"
61
+ class="popout-anchor"
63
62
  :aria-describedby="id"
64
63
  @mouseenter="hoverAnchor = true"
65
64
  @mouseleave="hoverAnchor = false"
66
65
  >
67
66
  <slot />
68
67
  </div>
69
- <!-- <Transition name="tooltip"> -->
70
- <Popout v-if="showTooltip" :id :anchor="popoutAnchorRef" class="vui-tooltip" :placement>
68
+ <Popout :id :visible="showTooltip" :anchor class="vui-tooltip" :placement>
71
69
  <slot name="tooltip" />
72
70
  </Popout>
73
- <!-- </Transition> -->
74
71
  </template>
75
72
 
76
- <!-- <style scoped>
77
- .tooltip-enter-active,
78
- .tooltip-leave-active {
79
- transition: var(--transition-fast);
73
+ <style scoped lang="scss">
74
+ .popout-anchor {
75
+ display: contents;
76
+ width: fit-content;
80
77
  }
81
-
82
- .tooltip-enter-from,
83
- .tooltip-leave-to {
84
- opacity: 0;
85
- }
86
- </style> -->
78
+ </style>
@@ -1,8 +1,5 @@
1
1
  .vui-tooltip {
2
- padding: var(--space-s);
2
+ padding: var(--space-xs) var(--space-s);
3
3
  max-width: 512px;
4
4
  background-color: var(--color-bg-raised);
5
5
  }
6
-
7
- // :root.light {
8
- // }
@@ -19,7 +19,7 @@ const dynamicAccordions = ref([
19
19
 
20
20
  <Grid :columns="2" gap="xl">
21
21
  <div>
22
- <strong class="block mb-s">Base</strong>
22
+ <strong class="block mb-s text-semibold">Base</strong>
23
23
  <Accordion label="Open details" class="mb-xl">
24
24
  <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Excepturi nostrum aspernatur nam earum vitae deleniti, odio atque esse sequi, in harum! Sint dolorum quis excepturi odio eum aspernatur aliquid harum.</p>
25
25
  </Accordion>
@@ -29,7 +29,7 @@ const dynamicAccordions = ref([
29
29
 
30
30
  <div class="mb-xl" />
31
31
 
32
- <strong class="block mb-s">Group</strong>
32
+ <strong class="block mb-s text-semibold">Group</strong>
33
33
  <AccordionGroup>
34
34
  <Accordion v-for="item in dynamicAccordions" :key="item" :label="item">
35
35
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
@@ -37,20 +37,33 @@ const dynamicAccordions = ref([
37
37
  </AccordionGroup>
38
38
  </div>
39
39
  <div>
40
- <strong class="block mb-s">Card</strong>
40
+ <strong class="block mb-s text-semibold">Card</strong>
41
41
  <Accordion label="Open details" card>
42
42
  <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Excepturi nostrum aspernatur nam earum vitae deleniti, odio atque esse sequi, in harum! Sint dolorum quis excepturi odio eum aspernatur aliquid harum.</p>
43
43
  </Accordion>
44
44
 
45
45
  <div class="mb-xl" />
46
46
 
47
- <strong class="block mb-s">Card group</strong>
47
+ <strong class="block mb-s text-semibold">Card group</strong>
48
48
  <AccordionGroup single>
49
49
  <Accordion v-for="item in dynamicAccordions" :key="item" :label="item" card class="mb-xs">
50
50
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum aliquam ad dicta nesciunt exercitationem? Quas vitae suscipit aliquam numquam incidunt corporis ullam, nihil dolores perferendis ipsa velit tempora accusantium cupiditate.
51
51
  </Accordion>
52
52
  </AccordionGroup>
53
53
  </div>
54
+
55
+ <div>
56
+ <strong class="block mb-s text-semibold">Unstyled</strong>
57
+ <p class="mb-m">
58
+ In some cases, we need a fully custom animated component which hides content.
59
+ </p>
60
+ <Accordion class="mb-xl" unstyled>
61
+ <template #header>
62
+ <p>Open details</p>
63
+ </template>
64
+ <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Excepturi nostrum aspernatur nam earum vitae deleniti, odio atque esse sequi, in harum! Sint dolorum quis excepturi odio eum aspernatur aliquid harum.</p>
65
+ </Accordion>
66
+ </div>
54
67
  </Grid>
55
68
  </div>
56
69
  </template>
@@ -28,9 +28,9 @@ import Flex from '../components/Flex/Flex.vue'
28
28
  </td>
29
29
  </tr>
30
30
  <tr>
31
- <th>Custom confirm popup</th>
31
+ <th>Custom confirm popup & positioned at the right</th>
32
32
  <td>
33
- <CopyClipboard text="Copy me!" confirm>
33
+ <CopyClipboard text="Copy me!" confirm confirm-placement="right">
34
34
  <Button>Copy me!</Button>
35
35
  <template #confirm>
36
36
  <Flex column gap="s" y-center>
@@ -75,6 +75,9 @@ import ExampleColor from './shared/ExampleColor.vue'
75
75
  <ExampleColor name="Accent" color="--light-color-accent" />
76
76
  <ExampleColor name="Bg Accent Lowered" color="--light-color-bg-accent-lowered" />
77
77
  <ExampleColor name="Bg Accent Raised" color="--light-color-bg-accent-raised" />
78
+ <!-- <div class="padder" />
79
+ <div class="w-50 block my-m mx-auto" style="height:64px;box-shadow:var(--light-box-shadow)" />
80
+ <div class="w-50 block my-m mx-auto" style="height:64px;box-shadow:var(--light-box-shadow-strong)" /> -->
78
81
  </Flex>
79
82
 
80
83
  <Flex class="theme-wrap dark" gap="xxs" column>
@@ -124,6 +127,9 @@ import ExampleColor from './shared/ExampleColor.vue'
124
127
  <ExampleColor name="Accent" color="--dark-color-accent" />
125
128
  <ExampleColor name="Bg Accent Lowered" color="--dark-color-bg-accent-lowered" />
126
129
  <ExampleColor name="Bg Accent Raised" color="--dark-color-bg-accent-raised" />
130
+ <!-- <div class="padder" />
131
+ <div class="w-50 block my-m mx-auto" style="height:64px;box-shadow:var(--dark-box-shadow)" />
132
+ <div class="w-50 block my-m mx-auto" style="height:64px;box-shadow:var(--dark-box-shadow-strong)" /> -->
127
133
  </Flex>
128
134
  </Grid>
129
135
  </div>
@@ -26,7 +26,7 @@ const open = ref(false)
26
26
  This popout has offset of <code>32</code> and its placement is <code>bottom-start</code>. It also has an attached event to <code>clickOutside</code> which is fired when user clicks outside of the popout. In that case, we manually close it.
27
27
  </p>
28
28
  </Flex>
29
- <Popout v-if="open" :anchor="anchRef" class="test-popout" :offset="32" placement="bottom-start" @click-outside="open = false">
29
+ <Popout :visible="open" :anchor="anchRef" class="test-popout" :offset="32" placement="bottom-start" @click-outside="open = false">
30
30
  <h3>Popout content</h3>
31
31
  <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dolorem facere eligendi ex, alias itaque molestiae, vero animi, vitae vel fuga corporis aut consectetur temporibus ipsum placeat dolores perferendis. Deleniti, et!</p>
32
32
  </Popout>
@@ -6,6 +6,7 @@ import { paginate } from '../components/Pagination/pagination'
6
6
  import Pagination from '../components/Pagination/Pagination.vue'
7
7
  import * as Table from '../components/Table/index'
8
8
  import { defineTable } from '../components/Table/table'
9
+ import Tooltip from '../components/Tooltip/Tooltip.vue'
9
10
 
10
11
  interface Item {
11
12
  'ID Nation': string
@@ -191,5 +192,168 @@ const exampleToRender = computed(() => testData.slice(paginationExample.value.st
191
192
  <Divider :size="40" class="w-40" />
192
193
 
193
194
  <p>The <code>defineTable</code> hook can also be used with other UI components. Not just tables. That's why all the table interactivity is not within the component, but in a hook. It's very flexible and allows custom functionality.</p>
195
+
196
+ <Divider :size="40" />
197
+
198
+ <h5 class="mb-s">
199
+ Responsitivity
200
+ </h5>
201
+
202
+ <p class="mb-m">
203
+ Table can be made responsible if they overflow their width and are wrapped in a <code>.vui-table-container</code> element.
204
+ </p>
205
+
206
+ <div class="container container-m">
207
+ <div class="vui-table-overflow">
208
+ <table>
209
+ <thead>
210
+ <tr>
211
+ <th>
212
+ <Tooltip placement="top">
213
+ ID
214
+ <template #tooltip>
215
+ <p>ID</p>
216
+ </template>
217
+ </Tooltip>
218
+ </th>
219
+ <th>
220
+ <Tooltip placement="top">
221
+ Name
222
+ <template #tooltip>
223
+ <p>Name</p>
224
+ </template>
225
+ </Tooltip>
226
+ </th>
227
+ <th>
228
+ <Tooltip placement="top">
229
+ Email
230
+ <template #tooltip>
231
+ <p>Email</p>
232
+ </template>
233
+ </Tooltip>
234
+ </th>
235
+ <th>
236
+ <Tooltip placement="top">
237
+ Phone
238
+ <template #tooltip>
239
+ <p>Phone</p>
240
+ </template>
241
+ </Tooltip>
242
+ </th>
243
+ <th>
244
+ <Tooltip placement="top">
245
+ Address
246
+ <template #tooltip>
247
+ <p>Address</p>
248
+ </template>
249
+ </Tooltip>
250
+ </th>
251
+ <th>
252
+ <Tooltip placement="top">
253
+ City
254
+ <template #tooltip>
255
+ <p>City</p>
256
+ </template>
257
+ </Tooltip>
258
+ </th>
259
+ <th>
260
+ <Tooltip placement="top">
261
+ State
262
+ <template #tooltip>
263
+ <p>State</p>
264
+ </template>
265
+ </Tooltip>
266
+ </th>
267
+ <th>
268
+ <Tooltip placement="top">
269
+ Zip
270
+ <template #tooltip>
271
+ <p>Zip</p>
272
+ </template>
273
+ </Tooltip>
274
+ </th>
275
+ <th>
276
+ <Tooltip placement="top">
277
+ Country
278
+ <template #tooltip>
279
+ <p>Country</p>
280
+ </template>
281
+ </Tooltip>
282
+ </th>
283
+ <th>
284
+ <Tooltip placement="top">
285
+ Status
286
+ <template #tooltip>
287
+ <p>Status</p>
288
+ </template>
289
+ </Tooltip>
290
+ </th>
291
+ </tr>
292
+ </thead>
293
+ <tbody>
294
+ <tr>
295
+ <td>001</td>
296
+ <td>John Doe</td>
297
+ <td>john.doe@example.com</td>
298
+ <td>(555) 123-4567</td>
299
+ <td>123 Main St</td>
300
+ <td>New York</td>
301
+ <td>NY</td>
302
+ <td>10001</td>
303
+ <td>USA</td>
304
+ <td>Active</td>
305
+ </tr>
306
+ <tr>
307
+ <td>002</td>
308
+ <td>Jane Smith</td>
309
+ <td>jane.smith@example.com</td>
310
+ <td>(555) 987-6543</td>
311
+ <td>456 Oak Ave</td>
312
+ <td>Los Angeles</td>
313
+ <td>CA</td>
314
+ <td>90001</td>
315
+ <td>USA</td>
316
+ <td>Inactive</td>
317
+ </tr>
318
+ <tr>
319
+ <td>003</td>
320
+ <td>Robert Johnson</td>
321
+ <td>robert.j@example.com</td>
322
+ <td>(555) 456-7890</td>
323
+ <td>789 Pine Blvd</td>
324
+ <td>Chicago</td>
325
+ <td>IL</td>
326
+ <td>60601</td>
327
+ <td>USA</td>
328
+ <td>Active</td>
329
+ </tr>
330
+ <tr>
331
+ <td>004</td>
332
+ <td>Emily Davis</td>
333
+ <td>emily.d@example.com</td>
334
+ <td>(555) 234-5678</td>
335
+ <td>321 Cedar Ln</td>
336
+ <td>Houston</td>
337
+ <td>TX</td>
338
+ <td>77001</td>
339
+ <td>USA</td>
340
+ <td>Pending</td>
341
+ </tr>
342
+ <tr>
343
+ <td>005</td>
344
+ <td>Michael Wilson</td>
345
+ <td>michael.w@example.com</td>
346
+ <td>(555) 876-5432</td>
347
+ <td>654 Maple Dr</td>
348
+ <td>Miami</td>
349
+ <td>FL</td>
350
+ <td>33101</td>
351
+ <td>USA</td>
352
+ <td>Active</td>
353
+ </tr>
354
+ </tbody>
355
+ </table>
356
+ </div>
357
+ </div>
194
358
  </div>
195
359
  </template>
@@ -8,6 +8,7 @@ import Tabs from '../components/Tabs/Tabs.vue'
8
8
  // import Flex from '../components/Flex/Flex.vue'
9
9
 
10
10
  const activeTab = ref('Home')
11
+ const noActiveNow = ref('')
11
12
 
12
13
  // Dynamic test
13
14
  const dynamicTabs = ref(['First', 'Second', 'Third'])
@@ -22,9 +23,9 @@ const activeDynamic = ref(dynamicTabs.value[0])
22
23
  <table>
23
24
  <tbody>
24
25
  <tr>
25
- <th>Base</th>
26
+ <th>Base + nothing active at first</th>
26
27
  <td>
27
- <Tabs v-model="activeTab">
28
+ <Tabs v-model="noActiveNow">
28
29
  <Tab value="Home" />
29
30
  <Tab value="About" />
30
31
  <Tab value="You" />
@@ -3,7 +3,7 @@
3
3
  }
4
4
 
5
5
  .vui-backdrop {
6
- z-index: 1000;
6
+ z-index: var(--z-overlay);
7
7
  position: fixed;
8
8
  display: block;
9
9
  width: 100dvw;
@@ -16,7 +16,7 @@
16
16
  &:after {
17
17
  content: '';
18
18
  position: fixed;
19
- z-index: -1;
19
+ z-index: var(--z-behind);
20
20
  inset: 0;
21
21
  background-color: var(--color-bg-lowered);
22
22
  opacity: 0.75;
@@ -1,3 +1,5 @@
1
+ import type { Placement } from '@floating-ui/vue'
2
+
1
3
  export function createArray(length: number, startOffset: number = 0): number[] {
2
4
  return Array
3
5
  .from({ length })
@@ -115,3 +117,8 @@ export function isObjectInSet(set: Set<any>, obj: any): boolean {
115
117
 
116
118
  return false
117
119
  }
120
+
121
+ export function getPlacementAnimationName(position: Placement): string {
122
+ const suffix = position.includes('-') ? position.split('-')[0] : position
123
+ return `fade-${suffix}`
124
+ }
@@ -1,6 +1,6 @@
1
1
  .fade-enter-active,
2
2
  .fade-leave-active {
3
- transition: var(--transition);
3
+ transition: opacity 0.15s cubic-bezier(0.65, 0, 0.35, 1);
4
4
  will-change: opacity;
5
5
  }
6
6
 
@@ -9,14 +9,42 @@
9
9
  opacity: 0;
10
10
  }
11
11
 
12
- .fade-up-enter-active,
13
- .fade-up-leave-active {
12
+ // Positioned fade-ins
13
+
14
+ // Defaults
15
+ .fade-top-enter-active,
16
+ .fade-top-leave-active,
17
+ .fade-bottom-enter-active,
18
+ .fade-bottom-leave-active,
19
+ .fade-right-enter-active,
20
+ .fade-right-leave-active,
21
+ .fade-left-enter-active,
22
+ .fade-left-leave-active {
14
23
  transition: var(--transition);
15
24
  transition-property: transform, opacity;
16
25
  }
17
26
 
18
- .fade-up-enter-from,
19
- .fade-up-leave-to {
27
+ // Specifics
28
+ .fade-top-enter-from,
29
+ .fade-top-leave-to {
30
+ opacity: 0;
31
+ transform: translateY(8px);
32
+ }
33
+
34
+ .fade-bottom-enter-from,
35
+ .fade-bottom-leave-to {
20
36
  opacity: 0;
21
37
  transform: translateY(8px);
22
38
  }
39
+
40
+ .fade-right-enter-from,
41
+ .fade-right-leave-to {
42
+ opacity: 0;
43
+ transform: translateX(8px);
44
+ }
45
+
46
+ .fade-left-enter-from,
47
+ .fade-left-leave-to {
48
+ opacity: 0;
49
+ transform: translateX(-8px);
50
+ }
@@ -5,6 +5,7 @@
5
5
  // To overwrite any of these styles, simply create a style file and import it
6
6
  // after this one
7
7
  @use './reset.scss';
8
+ @use './fonts.scss';
8
9
  @use './theme.scss';
9
10
 
10
11
  :root {
@@ -25,7 +26,6 @@
25
26
  --font-size-xxs: 1rem;
26
27
  --font-size-xs: 1.15rem;
27
28
  --font-size-s: 1.3rem;
28
- --font-size-m: 1.45rem;
29
29
  --font-size-m: 1.5rem;
30
30
  --font-size-l: 1.8rem;
31
31
  --font-size-xl: 2rem;
@@ -42,23 +42,37 @@
42
42
  --space-xxl: 48px;
43
43
  --space-xxxl: 64px;
44
44
 
45
- --transition-fast: 0.075s all ease-in-out;
46
- --transition: 0.15s all cubic-bezier(0.65, 0, 0.35, 1);
47
- --transition-slow: 0.3s all cubic-bezier(0.65, 0, 0.35, 1);
45
+ --transition-fast: 0.055s all ease-in-out;
46
+ --transition: 0.1s all cubic-bezier(0.65, 0, 0.35, 1);
47
+ --transition-slow: 0.25s all cubic-bezier(0.65, 0, 0.35, 1);
48
48
 
49
- --global-font: Inter, sans-serif;
50
- --global-font-mono: 'Geist Mono', 'Courier New', Courier, monospace;
49
+ --global-font: 'Inter', sans-serif;
50
+ --global-font-mono: 'Geist Mono', 'Courier New', 'Courier', monospace;
51
51
 
52
- --font-weight-thin: 200;
53
- --font-weight-light: 300;
52
+ --font-weight: 300;
54
53
  --font-weight: 400;
55
54
  --font-weight-medium: 500;
56
55
  --font-weight-semibold: 600;
57
56
  --font-weight-bold: 700;
58
- --font-weight-extrabold: 700;
57
+ --font-weight-extrabold: 800;
59
58
  --font-weight-black: 900;
60
59
 
61
- --interactive-el-height: 34px;
60
+ --line-height-tight: 1.125em;
61
+ --line-height-title: 1.25em;
62
+ --line-height-base: 1.4em;
63
+
64
+ --z-behind: -1;
65
+ --z-default: 1;
66
+ --z-active: 50;
67
+ --z-mask: 75;
68
+ --z-sticky: 100;
69
+ --z-nav: 200;
70
+ --z-overlay: 300;
71
+ --z-popout: 400;
72
+ --z-toast: 500;
73
+ --z-modal: 600;
74
+
75
+ --interactive-el-height: 36px;
62
76
  }
63
77
 
64
78
  // Disable motion for users who have requested it