@bethinkpl/design-system 14.1.1 → 14.1.2

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/docs/project.json CHANGED
@@ -1 +1 @@
1
- {"generatedAt":1678262897887,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"metaFramework":{"name":"vue-cli","packageName":"@vue/cli-service","version":"4.5.13"},"packageManager":{"type":"yarn","version":"1.22.19"},"storybookVersion":"6.5.13","language":"typescript","storybookPackages":{"@storybook/vue":{"version":"6.5.13"},"eslint-plugin-storybook":{"version":"0.6.6"}},"framework":{"name":"vue"},"addons":{"@storybook/addon-docs":{"version":"6.5.13"},"@storybook/addon-controls":{"version":"6.5.13"},"@storybook/addon-storysource":{"version":"6.5.13"},"@storybook/addon-viewport":{"version":"6.5.13"},"storybook-addon-designs":{"version":"6.3.1"}}}
1
+ {"generatedAt":1678350376732,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"metaFramework":{"name":"vue-cli","packageName":"@vue/cli-service","version":"4.5.13"},"packageManager":{"type":"yarn","version":"1.22.19"},"storybookVersion":"6.5.13","language":"typescript","storybookPackages":{"@storybook/vue":{"version":"6.5.13"},"eslint-plugin-storybook":{"version":"0.6.6"}},"framework":{"name":"vue"},"addons":{"@storybook/addon-docs":{"version":"6.5.13"},"@storybook/addon-controls":{"version":"6.5.13"},"@storybook/addon-storysource":{"version":"6.5.13"},"@storybook/addon-viewport":{"version":"6.5.13"},"storybook-addon-designs":{"version":"6.3.1"}}}
@@ -8,3 +8,8 @@ export const DROPDOWN_RADIUSES = {
8
8
  BOTTOM: 'bottom',
9
9
  BOTH: 'both',
10
10
  } as const;
11
+
12
+ export const DROPDOWN_PLACEMENTS = {
13
+ BOTTOM_START: 'bottom-start',
14
+ BOTTOM_END: 'bottom-end',
15
+ } as const;
@@ -1,5 +1,9 @@
1
1
  import Dropdown from './Dropdown.vue';
2
- import { DROPDOWN_RADIUSES, DROPDOWN_TRIGGER_ACTIONS } from './Dropdown.consts';
2
+ import {
3
+ DROPDOWN_PLACEMENTS,
4
+ DROPDOWN_RADIUSES,
5
+ DROPDOWN_TRIGGER_ACTIONS,
6
+ } from './Dropdown.consts';
3
7
  import SelectList from '../SelectList/SelectList.vue';
4
8
 
5
9
  import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue';
@@ -13,8 +17,10 @@ export default {
13
17
  const StoryTemplate: StoryFn<typeof Dropdown> = (argTypes) => ({
14
18
  components: { Dropdown, SelectList, SelectListItem },
15
19
  props: Object.keys(argTypes),
16
- template: `<div style="position: relative">
17
- <dropdown :trigger-action="triggerAction" :force-show="forceShow" :same-width="sameWidth" :radius="radius">
20
+ template: `
21
+ <div style="position: relative">
22
+ <dropdown :trigger-action="triggerAction" :force-show="forceShow" :same-width="sameWidth" :radius="radius"
23
+ :placement="placement">
18
24
  <template #reference><span>Dropdown entry point</span></template>
19
25
  <template #default="{ close }">
20
26
  <select-list>
@@ -23,7 +29,7 @@ const StoryTemplate: StoryFn<typeof Dropdown> = (argTypes) => ({
23
29
  </select-list>
24
30
  </template>
25
31
  </dropdown>
26
- </div>`,
32
+ </div>`,
27
33
  });
28
34
 
29
35
  export const Interactive = StoryTemplate.bind({});
@@ -44,6 +50,10 @@ const argTypes = {
44
50
  control: { type: 'select', options: Object.values(DROPDOWN_RADIUSES) },
45
51
  defaultValue: DROPDOWN_RADIUSES.BOTH,
46
52
  },
53
+ placement: {
54
+ control: { type: 'select', options: Object.values(DROPDOWN_PLACEMENTS) },
55
+ defaultValue: DROPDOWN_PLACEMENTS.BOTTOM_START,
56
+ },
47
57
  } as ArgTypes;
48
58
 
49
59
  Interactive.argTypes = argTypes;
@@ -68,7 +68,11 @@
68
68
  <script lang="ts">
69
69
  import VuePopper from 'vue-popperjs';
70
70
  import 'vue-popperjs/dist/vue-popper.css';
71
- import { DROPDOWN_RADIUSES, DROPDOWN_TRIGGER_ACTIONS } from './Dropdown.consts';
71
+ import {
72
+ DROPDOWN_PLACEMENTS,
73
+ DROPDOWN_RADIUSES,
74
+ DROPDOWN_TRIGGER_ACTIONS,
75
+ } from './Dropdown.consts';
72
76
 
73
77
  export default {
74
78
  name: 'Dropdown',
@@ -102,6 +106,13 @@ export default {
102
106
  return Object.values(DROPDOWN_RADIUSES).includes(radius);
103
107
  },
104
108
  },
109
+ placement: {
110
+ type: String,
111
+ default: DROPDOWN_PLACEMENTS.BOTTOM_START,
112
+ validate(placement) {
113
+ return Object.values(DROPDOWN_PLACEMENTS).includes(placement);
114
+ },
115
+ },
105
116
  },
106
117
  data() {
107
118
  return {
@@ -113,7 +124,7 @@ export default {
113
124
  options() {
114
125
  return {
115
126
  modifiers: { preventOverflow: { padding: 0 } },
116
- placement: 'bottom-start',
127
+ placement: this.placement,
117
128
  ...(this.sameWidth && {
118
129
  // See https://github.com/floating-ui/floating-ui/issues/794
119
130
  // We can't use onCreate because vue-popper overrides it.
@@ -135,6 +146,9 @@ export default {
135
146
  boundariesSelector() {
136
147
  this.updateKey();
137
148
  },
149
+ placement() {
150
+ this.updateKey();
151
+ },
138
152
  },
139
153
  methods: {
140
154
  close() {
@@ -61,12 +61,20 @@
61
61
  />
62
62
  </template>
63
63
  <template v-if="$scopedSlots.dropdown">
64
- <ds-dropdown boundaries-selector="body">
64
+ <ds-dropdown
65
+ boundaries-selector="body"
66
+ :placement="DROPDOWN_PLACEMENTS.BOTTOM_END"
67
+ @show="isDropdownOpen = true"
68
+ @hide="isDropdownOpen = false"
69
+ >
65
70
  <template #reference>
66
71
  <icon-button
67
72
  :icon="ICONS.FA_ELLIPSIS_VERTICAL"
68
73
  :size="ICON_BUTTON_SIZES.MEDIUM"
69
74
  :color="ICON_BUTTON_COLORS.NEUTRAL"
75
+ :state="
76
+ isDropdownOpen ? ICON_BUTTON_STATES.HOVERED : ICON_BUTTON_STATES.DEFAULT
77
+ "
70
78
  />
71
79
  </template>
72
80
  <template #default="{ close }">
@@ -255,8 +263,8 @@
255
263
  <script lang="ts">
256
264
  import IconButton from '../Buttons/IconButton/IconButton.vue';
257
265
  import DsDivider, { DIVIDER_PROMINENCES } from '../Divider';
258
- import DsDropdown from '../Dropdown';
259
- import { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES } from '../Buttons/IconButton';
266
+ import DsDropdown, { DROPDOWN_PLACEMENTS } from '../Dropdown';
267
+ import { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES, ICON_BUTTON_STATES } from '../Buttons/IconButton';
260
268
  import { ICONS } from '../Icons/Icon';
261
269
  import { OVERLAY_HEADER_BORDER_COLORS } from './OverlayHeader.consts';
262
270
 
@@ -290,9 +298,12 @@ export default {
290
298
  return {
291
299
  ICON_BUTTON_SIZES: Object.freeze(ICON_BUTTON_SIZES),
292
300
  ICON_BUTTON_COLORS: Object.freeze(ICON_BUTTON_COLORS),
301
+ ICON_BUTTON_STATES: Object.freeze(ICON_BUTTON_STATES),
293
302
  ICONS: Object.freeze(ICONS),
294
303
  DIVIDER_PROMINENCES: Object.freeze(DIVIDER_PROMINENCES),
295
304
  OVERLAY_HEADER_BORDER_COLORS: Object.freeze(OVERLAY_HEADER_BORDER_COLORS),
305
+ DROPDOWN_PLACEMENTS: Object.freeze(DROPDOWN_PLACEMENTS),
306
+ isDropdownOpen: false,
296
307
  };
297
308
  },
298
309
  methods: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bethinkpl/design-system",
3
- "version": "14.1.1",
3
+ "version": "14.1.2",
4
4
  "description": "Bethink universe design-system",
5
5
  "repository": "git@github.com:bethinkpl/design-system.git",
6
6
  "author": "nerdy@bethink.pl",