@onereach/ui-components 2.63.0-beta.1896.0 → 2.63.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.
- package/dist/v2/{OrConfirm-8d149ece.js → OrConfirm-24e2a1a2.js} +1 -1
- package/dist/v2/{OrIconButton-5883eba0.js → OrIconButton-2088a37f.js} +1 -1
- package/dist/v2/{OrInlineInput-16a343c1.js → OrInlineInput-f00cba5e.js} +6 -5
- package/dist/v2/{OrInlineTextarea-f154bdf5.js → OrInlineTextarea-75de33d0.js} +6 -5
- package/dist/v2/{OrInput-4a50fe57.js → OrInput-24028f23.js} +7 -5
- package/dist/v2/{OrModal-64c5ae2e.js → OrModal-a1452b11.js} +1 -1
- package/dist/v2/{OrNotification-9c164908.js → OrNotification-ac420f39.js} +1 -1
- package/dist/v2/{OrSearch-a247f072.js → OrSearch-978a3a6e.js} +1 -1
- package/dist/v2/OrSegmentedControl-17df63b8.js +236 -0
- package/dist/v2/{OrSelect-bb223cce.js → OrSelect-c6d0a69e.js} +13 -33
- package/dist/v2/{OrTabs-b4a9740b.js → OrTabs-f2a60b41.js} +1 -1
- package/dist/v2/{OrTag-ab03c4f7.js → OrTag-1ced4e58.js} +1 -1
- package/dist/v2/{OrTooltip-caeac590.js → OrTooltip-afe7030b.js} +33 -3
- package/dist/v2/components/index.d.ts +1 -0
- package/dist/v2/components/{or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts → or-segmented-control-v3/OrSegmentedControl.stories3.d.ts} +1 -1
- package/dist/v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
- package/dist/v2/components/or-segmented-control-v3/index.d.ts +3 -0
- package/dist/v2/components/or-segmented-control-v3/props.d.ts +4 -0
- package/dist/v2/components/or-segmented-control-v3/styles.d.ts +3 -0
- package/dist/v2/components/or-segmented-control-v3/types.d.ts +4 -0
- package/dist/v2/components/or-select-v3/OrSelect.vue.d.ts +2 -2
- package/dist/v2/components/or-tooltip-v3/styles.d.ts +2 -0
- package/dist/v2/directives/index.d.ts +2 -0
- package/dist/v2/dropdown-open-0d314aa4.js +28 -0
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/index.js +15 -13
- package/dist/v2/index2.js +15 -13
- package/dist/v2/index20.js +4 -4
- package/dist/v2/index31.js +2 -2
- package/dist/v2/index34.js +3 -3
- package/dist/v2/index36.js +3 -3
- package/dist/v2/index38.js +3 -3
- package/dist/v2/index50.js +3 -3
- package/dist/v2/index52.js +3 -3
- package/dist/v2/index62.js +12 -306
- package/dist/v2/index63.js +2 -19
- package/dist/v2/index65.js +6 -5
- package/dist/v2/index78.js +1 -1
- package/dist/v2/index80.js +3 -3
- package/dist/v2/index88.js +3 -3
- package/dist/v2/index91.js +1 -1
- package/dist/v2/index92.js +1 -6
- package/dist/v2/index93.js +5 -1
- package/dist/v2/index94.js +3 -0
- package/dist/v2/{types-fb93ea4e.js → types-89aad7fb.js} +1 -1
- package/dist/v3/{OrConfirm-456ddee1.js → OrConfirm-371630a4.js} +1 -1
- package/dist/v3/{OrIconButton-b8066b5d.js → OrIconButton-5fb3a9aa.js} +1 -1
- package/dist/v3/{OrInlineInput-280768ba.js → OrInlineInput-bac4abdd.js} +4 -3
- package/dist/v3/{OrInlineTextarea-0f63f344.js → OrInlineTextarea-d1ec1bba.js} +4 -3
- package/dist/v3/{OrInput-3eef7945.js → OrInput-256d2530.js} +6 -3
- package/dist/v3/{OrModal-f67d37d3.js → OrModal-3a43b7e7.js} +1 -1
- package/dist/v3/{OrNotification-fefa1cb4.js → OrNotification-433d16f7.js} +1 -1
- package/dist/v3/{OrSearch-15a70678.js → OrSearch-375eab55.js} +1 -1
- package/dist/v3/OrSegmentedControl-2bbc0f22.js +184 -0
- package/dist/v3/{OrSelect-63ada65d.js → OrSelect-52cfb10d.js} +12 -32
- package/dist/v3/{OrTabs-194ca950.js → OrTabs-ac0be933.js} +1 -1
- package/dist/v3/{OrTag-144b4ab8.js → OrTag-deaff080.js} +1 -1
- package/dist/v3/{OrTooltip-30e05f9e.js → OrTooltip-36c6728c.js} +33 -3
- package/dist/v3/components/index.d.ts +1 -0
- package/dist/v3/components/{or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts → or-segmented-control-v3/OrSegmentedControl.stories3.d.ts} +1 -1
- package/dist/v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
- package/dist/v3/components/or-segmented-control-v3/index.d.ts +3 -0
- package/dist/v3/components/or-segmented-control-v3/props.d.ts +4 -0
- package/dist/v3/components/or-segmented-control-v3/styles.d.ts +3 -0
- package/dist/v3/components/or-segmented-control-v3/types.d.ts +4 -0
- package/dist/v3/components/or-select-v3/OrSelect.vue.d.ts +2 -2
- package/dist/v3/components/or-tooltip-v3/styles.d.ts +2 -0
- package/dist/v3/directives/index.d.ts +2 -0
- package/dist/v3/dropdown-open-0d314aa4.js +28 -0
- package/dist/v3/index.d.ts +1 -0
- package/dist/v3/index.js +15 -13
- package/dist/v3/index2.js +15 -13
- package/dist/v3/index20.js +4 -4
- package/dist/v3/index31.js +2 -2
- package/dist/v3/index34.js +3 -3
- package/dist/v3/index36.js +3 -3
- package/dist/v3/index38.js +3 -3
- package/dist/v3/index50.js +3 -3
- package/dist/v3/index52.js +3 -3
- package/dist/v3/index62.js +12 -280
- package/dist/v3/index63.js +2 -18
- package/dist/v3/index65.js +6 -5
- package/dist/v3/index78.js +1 -1
- package/dist/v3/index80.js +3 -3
- package/dist/v3/index88.js +3 -3
- package/dist/v3/index91.js +1 -1
- package/dist/v3/index92.js +1 -6
- package/dist/v3/index93.js +5 -1
- package/dist/v3/index94.js +3 -0
- package/dist/v3/{types-a2a8f948.js → types-d5d4ab32.js} +1 -1
- package/package.json +4 -9
- package/src/components/index.ts +1 -0
- package/src/components/or-avatar-v3/OrAvatar.docs.mdx +4 -0
- package/src/components/or-bottom-sheet-v3/OrBottomSheet.docs.mdx +4 -0
- package/src/components/or-button-v3/OrButton.docs.mdx +4 -0
- package/src/components/or-card-v3/OrCard.docs.mdx +4 -0
- package/src/components/or-checkbox-v3/OrCheckbox.docs.mdx +4 -0
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
- package/src/components/or-confirm-v3/OrConfirm.docs.mdx +4 -0
- package/src/components/or-error-tag-v3/OrErrorTag.docs.mdx +5 -0
- package/src/components/or-error-v3/OrError.docs.mdx +4 -0
- package/src/components/or-expansion-panel-v3/OrExpansionPanel.docs.mdx +4 -0
- package/src/components/or-fab-v3/OrFab.docs.mdx +4 -0
- package/src/components/or-hint-v3/OrHint.docs.mdx +4 -0
- package/src/components/or-icon-button-v3/OrIconButton.docs.mdx +4 -0
- package/src/components/or-icon-v3/OrIcon.docs.mdx +4 -0
- package/src/components/or-inline-input-v3/OrInlineInput.docs.mdx +4 -0
- package/src/components/or-inline-input-v3/OrInlineInput.vue +2 -2
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.docs.mdx +4 -0
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +2 -2
- package/src/components/or-input-v3/OrInput.docs.mdx +4 -0
- package/src/components/or-input-v3/OrInput.vue +21 -19
- package/src/components/or-label-v3/OrLabel.docs.mdx +4 -0
- package/src/components/or-link-v3/OrLink.docs.mdx +4 -0
- package/src/components/or-loader-v3/OrLoader.docs.mdx +4 -0
- package/src/components/or-menu-item-v3/OrMenuItem.docs.mdx +4 -0
- package/src/components/or-menu-v3/OrMenu.docs.mdx +4 -0
- package/src/components/or-modal-v3/OrModal.docs.mdx +4 -0
- package/src/components/or-notification-v3/OrNotification.docs.mdx +4 -0
- package/src/components/or-overlay-v3/OrOverlay.docs.mdx +4 -0
- package/src/components/or-popover-v3/OrPopover.docs.mdx +4 -0
- package/src/components/or-progress-v3/OrProgress.docs.mdx +4 -0
- package/src/components/or-radio-v3/OrRadio.docs.mdx +4 -0
- package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
- package/src/components/or-search-v3/OrSearch.docs.mdx +4 -0
- package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +7 -0
- package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +106 -0
- package/src/components/or-segmented-control-v3/OrSegmentedControl.vue +107 -0
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue +64 -0
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts +50 -0
- package/src/components/or-segmented-control-v3/index.ts +3 -0
- package/src/components/or-segmented-control-v3/props.ts +4 -0
- package/src/components/or-segmented-control-v3/styles.ts +24 -0
- package/src/components/or-segmented-control-v3/types.ts +4 -0
- package/src/components/or-select-v3/OrSelect.docs.mdx +4 -0
- package/src/components/or-select-v3/OrSelect.vue +9 -6
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +4 -0
- package/src/components/or-skeleton-v3/OrSkeleton.docs.mdx +8 -0
- package/src/components/or-switch-v3/OrSwitch.docs.mdx +4 -0
- package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
- package/src/components/or-tab-v3/OrTab.docs.mdx +4 -0
- package/src/components/or-tabs-v3/OrTabs.docs.mdx +4 -0
- package/src/components/or-tabs-v3/OrTabs.stories3.ts +9 -4
- package/src/components/or-tabs-v3/OrTabs.vue +1 -1
- package/src/components/or-tag-v3/OrTag.docs.mdx +4 -0
- package/src/components/or-teleport-v3/OrTeleport.docs.mdx +4 -0
- package/src/components/or-text-v3/OrText.docs.mdx +4 -0
- package/src/components/or-textarea-v3/OrTextarea.docs.mdx +4 -0
- package/src/components/or-tooltip-v3/OrTooltip.docs.mdx +3 -0
- package/src/components/or-tooltip-v3/OrTooltip.vue +3 -2
- package/src/components/or-tooltip-v3/styles.ts +55 -0
- package/src/directives/index.ts +2 -0
- package/src/hooks/useClassAttribute.ts +1 -1
- package/src/index.ts +1 -0
- package/dist/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -111
- package/dist/v2/components/or-rich-text-editor-v3/index.d.ts +0 -1
- package/dist/v2/components/or-rich-text-editor-v3/styles.d.ts +0 -7
- package/dist/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -111
- package/dist/v3/components/or-rich-text-editor-v3/index.d.ts +0 -1
- package/dist/v3/components/or-rich-text-editor-v3/styles.d.ts +0 -7
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.docs.mdx +0 -16
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +0 -57
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +0 -295
- package/src/components/or-rich-text-editor-v3/index.ts +0 -1
- package/src/components/or-rich-text-editor-v3/styles.ts +0 -71
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="root"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:class="rootStyles"
|
|
6
|
+
>
|
|
7
|
+
<OrSegmentedControlItem
|
|
8
|
+
v-for="option in options"
|
|
9
|
+
:key="option.value"
|
|
10
|
+
:size="size"
|
|
11
|
+
:selected="option.value === proxyModelValue"
|
|
12
|
+
:disabled="disabled"
|
|
13
|
+
@click.stop="proxyModelValue = option.value"
|
|
14
|
+
>
|
|
15
|
+
{{ option.label }}
|
|
16
|
+
</OrSegmentedControlItem>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { computed, defineComponent, PropType, ref } from 'vue-demi';
|
|
22
|
+
import { useClassAttribute } from '../../hooks';
|
|
23
|
+
import OrSegmentedControlItem from './components/or-segmented-control-item/OrSegmentedControlItem.vue';
|
|
24
|
+
import { SegmentedControlSize } from './props';
|
|
25
|
+
import { SegmentedControlRoot, SegmentedControlRootSizes } from './styles';
|
|
26
|
+
import { SegmentedControlOption } from './types';
|
|
27
|
+
|
|
28
|
+
export default defineComponent({
|
|
29
|
+
name: 'OrSegmentedControl',
|
|
30
|
+
|
|
31
|
+
components: {
|
|
32
|
+
OrSegmentedControlItem,
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
inheritAttrs: false,
|
|
36
|
+
|
|
37
|
+
props: {
|
|
38
|
+
options: {
|
|
39
|
+
type: Array as PropType<SegmentedControlOption[]>,
|
|
40
|
+
default: [] as SegmentedControlOption[],
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: undefined,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
value: { // TODO: Remove Vue 2 fallback
|
|
49
|
+
type: String,
|
|
50
|
+
default: undefined,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
size: {
|
|
54
|
+
type: String as PropType<SegmentedControlSize>,
|
|
55
|
+
default: SegmentedControlSize.M,
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
disabled: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
emits: [
|
|
65
|
+
'update:modelValue',
|
|
66
|
+
|
|
67
|
+
'input',
|
|
68
|
+
],
|
|
69
|
+
|
|
70
|
+
expose: [
|
|
71
|
+
'root',
|
|
72
|
+
],
|
|
73
|
+
|
|
74
|
+
setup(props, context) {
|
|
75
|
+
// Refs
|
|
76
|
+
const root = ref<HTMLElement>();
|
|
77
|
+
|
|
78
|
+
// Styles
|
|
79
|
+
const classAttribute = useClassAttribute();
|
|
80
|
+
|
|
81
|
+
const rootStyles = computed(() => [
|
|
82
|
+
'or-segmented-control',
|
|
83
|
+
...SegmentedControlRoot,
|
|
84
|
+
...SegmentedControlRootSizes[props.size],
|
|
85
|
+
classAttribute.value,
|
|
86
|
+
]);
|
|
87
|
+
|
|
88
|
+
// State
|
|
89
|
+
const proxyModelValue = computed({
|
|
90
|
+
get: () => {
|
|
91
|
+
return props.modelValue ?? props.value; // TODO: Remove Vue 2 fallback
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
set: (value) => {
|
|
95
|
+
context.emit('input', value);
|
|
96
|
+
context.emit('update:modelValue', value);
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
root,
|
|
102
|
+
rootStyles,
|
|
103
|
+
proxyModelValue,
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="root"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:class="rootStyles"
|
|
6
|
+
:selected="selected ? '' : null"
|
|
7
|
+
:disabled="disabled ? '' : null"
|
|
8
|
+
@click="$emit('click', $event)"
|
|
9
|
+
>
|
|
10
|
+
<div :class="['truncate']">
|
|
11
|
+
<slot />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import { computed, defineComponent, PropType, ref } from 'vue-demi';
|
|
18
|
+
import { useClassAttribute } from '../../../../hooks';
|
|
19
|
+
import { SegmentedControlSize } from '../../props';
|
|
20
|
+
import { SegmentedControlItemRoot, SegmentedControlItemRootSizes } from './styles';
|
|
21
|
+
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
name: 'OrSegmentedControlItem',
|
|
24
|
+
|
|
25
|
+
inheritAttrs: false,
|
|
26
|
+
|
|
27
|
+
props: {
|
|
28
|
+
size: {
|
|
29
|
+
type: String as PropType<SegmentedControlSize>,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
selected: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
disabled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
setup(props) {
|
|
45
|
+
// Refs
|
|
46
|
+
const root = ref<HTMLElement>();
|
|
47
|
+
|
|
48
|
+
// Styles
|
|
49
|
+
const classAttribute = useClassAttribute();
|
|
50
|
+
|
|
51
|
+
const rootStyles = computed(() => [
|
|
52
|
+
'or-segmented-control-item',
|
|
53
|
+
...SegmentedControlItemRoot,
|
|
54
|
+
...SegmentedControlItemRootSizes[props.size],
|
|
55
|
+
classAttribute.value,
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
root,
|
|
60
|
+
rootStyles,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SegmentedControlSize } from '../../props';
|
|
2
|
+
|
|
3
|
+
export const SegmentedControlItemRoot: string[] = [
|
|
4
|
+
// Layout
|
|
5
|
+
'flex',
|
|
6
|
+
'items-center',
|
|
7
|
+
'justify-center',
|
|
8
|
+
|
|
9
|
+
// Shape
|
|
10
|
+
'rounded-md',
|
|
11
|
+
|
|
12
|
+
// Interactivity
|
|
13
|
+
'interactivity-auto',
|
|
14
|
+
|
|
15
|
+
// Theme
|
|
16
|
+
'theme-foreground-default',
|
|
17
|
+
'dark:theme-foreground-default-dark',
|
|
18
|
+
|
|
19
|
+
// Theme (selected)
|
|
20
|
+
'selected:theme-background-default',
|
|
21
|
+
'dark:selected:theme-background-default-dark',
|
|
22
|
+
|
|
23
|
+
// Theme (selected, enabled)
|
|
24
|
+
'selected:enabled:shadow-card',
|
|
25
|
+
'dark:selected:enabled:shadow-card-dark',
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
export const SegmentedControlItemRootSizes: Record<SegmentedControlSize, string[]> = {
|
|
29
|
+
'm': [
|
|
30
|
+
// Box
|
|
31
|
+
'h-[44px] md:h-[36px]',
|
|
32
|
+
|
|
33
|
+
// Spacing
|
|
34
|
+
'px-sm+ md:px-sm+',
|
|
35
|
+
|
|
36
|
+
// Typography
|
|
37
|
+
'typography-body-2-regular',
|
|
38
|
+
],
|
|
39
|
+
|
|
40
|
+
's': [
|
|
41
|
+
// Box
|
|
42
|
+
'h-[36px] md:h-[32px]',
|
|
43
|
+
|
|
44
|
+
// Spacing
|
|
45
|
+
'px-sm+ md:px-sm',
|
|
46
|
+
|
|
47
|
+
// Typography
|
|
48
|
+
'typography-caption-regular',
|
|
49
|
+
],
|
|
50
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SegmentedControlSize } from './props';
|
|
2
|
+
|
|
3
|
+
export const SegmentedControlRoot: string[] = [
|
|
4
|
+
// Layout
|
|
5
|
+
'grid',
|
|
6
|
+
'grid-flow-col',
|
|
7
|
+
'auto-cols-fr',
|
|
8
|
+
|
|
9
|
+
// Shape
|
|
10
|
+
'rounded-md',
|
|
11
|
+
|
|
12
|
+
// Spacing
|
|
13
|
+
'px-[2px]',
|
|
14
|
+
'py-[2px]',
|
|
15
|
+
|
|
16
|
+
// Theme
|
|
17
|
+
'theme-background-surface-variant',
|
|
18
|
+
'dark:theme-background-surface-variant-dark',
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export const SegmentedControlRootSizes: Record<SegmentedControlSize, string[]> = {
|
|
22
|
+
'm': [],
|
|
23
|
+
's': [],
|
|
24
|
+
};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<OrInputBox
|
|
23
23
|
ref="inputBox"
|
|
24
|
-
v-dropdown-open="
|
|
24
|
+
v-dropdown-open="toggle"
|
|
25
25
|
v-dropdown-close="close"
|
|
26
26
|
:class="[popoverState === 'open' && 'rounded-b-0']"
|
|
27
27
|
:size="size"
|
|
@@ -208,8 +208,7 @@
|
|
|
208
208
|
|
|
209
209
|
<script lang="ts">
|
|
210
210
|
import { computed, defineComponent, getCurrentInstance, onMounted, PropType, ref, watch } from 'vue-demi';
|
|
211
|
-
import { DropdownClose } from '../../directives
|
|
212
|
-
import { DropdownOpen } from '../../directives/dropdown-open';
|
|
211
|
+
import { DropdownClose, DropdownOpen } from '../../directives';
|
|
213
212
|
import { useClassAttribute, useOverflow } from '../../hooks';
|
|
214
213
|
import { OrCheckboxV3 as OrCheckbox } from '../or-checkbox-v3';
|
|
215
214
|
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
@@ -465,12 +464,16 @@ export default defineComponent({
|
|
|
465
464
|
});
|
|
466
465
|
|
|
467
466
|
// Methods
|
|
468
|
-
function
|
|
467
|
+
function toggle(): void {
|
|
469
468
|
if (!readonly.value && !props.disabled) {
|
|
470
469
|
const popoverInstance = popover.value;
|
|
471
470
|
|
|
472
471
|
if (popoverInstance) {
|
|
473
|
-
(
|
|
472
|
+
if (popoverState.value === 'open') {
|
|
473
|
+
(popoverInstance.close as () => void)();
|
|
474
|
+
} else {
|
|
475
|
+
(popoverInstance.open as () => void)();
|
|
476
|
+
}
|
|
474
477
|
}
|
|
475
478
|
}
|
|
476
479
|
}
|
|
@@ -515,7 +518,7 @@ export default defineComponent({
|
|
|
515
518
|
internalSearchOptions,
|
|
516
519
|
resolvedSearchOptions,
|
|
517
520
|
groupedOptions,
|
|
518
|
-
|
|
521
|
+
toggle,
|
|
519
522
|
close,
|
|
520
523
|
deselect,
|
|
521
524
|
innerItems,
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { DocsPage } from '@storybook/addon-docs';
|
|
2
2
|
|
|
3
|
+
```ts
|
|
4
|
+
import {
|
|
5
|
+
OrSkeletonCircleV3 as OrSkeletonCircle,
|
|
6
|
+
OrSkeletonRectV3 as OrSkeletonRect,
|
|
7
|
+
OrSkeletonTextV3 as OrSkeletonText,
|
|
8
|
+
} from '@onereach/ui-components';
|
|
9
|
+
```
|
|
10
|
+
|
|
3
11
|
<DocsPage />
|
|
4
12
|
|
|
5
13
|
## Migration Guide from V1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
-
import { ref } from 'vue-demi';
|
|
3
|
+
import { ref, watch } from 'vue-demi';
|
|
4
4
|
import OrTabsDocs from './OrTabs.docs.mdx';
|
|
5
5
|
import OrTabs from './OrTabs.vue';
|
|
6
6
|
import { TabsVariant } from './props';
|
|
@@ -63,11 +63,16 @@ const Template: StoryFn<typeof OrTabs> = (args) => ({
|
|
|
63
63
|
|
|
64
64
|
setup() {
|
|
65
65
|
// State
|
|
66
|
-
const
|
|
66
|
+
const model = ref<string>();
|
|
67
|
+
|
|
68
|
+
// Effects
|
|
69
|
+
watch(model, (value) => {
|
|
70
|
+
console.debug(value);
|
|
71
|
+
});
|
|
67
72
|
|
|
68
73
|
return {
|
|
69
74
|
args,
|
|
70
|
-
|
|
75
|
+
model,
|
|
71
76
|
onUpdateModelValue: action('update:modelValue'),
|
|
72
77
|
onInput: action('input'),
|
|
73
78
|
};
|
|
@@ -75,7 +80,7 @@ const Template: StoryFn<typeof OrTabs> = (args) => ({
|
|
|
75
80
|
|
|
76
81
|
template: `
|
|
77
82
|
<OrTabs
|
|
78
|
-
v-model="
|
|
83
|
+
v-model="model"
|
|
79
84
|
v-bind="args"
|
|
80
85
|
@update:modelValue="onUpdateModelValue"
|
|
81
86
|
@input="onInput"
|
|
@@ -30,7 +30,7 @@ import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
|
|
|
30
30
|
import { useClassAttribute } from '../../hooks';
|
|
31
31
|
import { OrPopoverV3 as OrPopover } from '../or-popover-v3';
|
|
32
32
|
import { TooltipPlacement } from './props';
|
|
33
|
-
import { TooltipBody, TooltipRoot } from './styles';
|
|
33
|
+
import { TooltipBody, TooltipBodyPlacements, TooltipRoot } from './styles';
|
|
34
34
|
|
|
35
35
|
export default defineComponent({
|
|
36
36
|
name: 'OrTooltip',
|
|
@@ -63,7 +63,7 @@ export default defineComponent({
|
|
|
63
63
|
'close',
|
|
64
64
|
],
|
|
65
65
|
|
|
66
|
-
setup() {
|
|
66
|
+
setup(props) {
|
|
67
67
|
// Refs
|
|
68
68
|
const root = ref<HTMLElement>();
|
|
69
69
|
|
|
@@ -81,6 +81,7 @@ export default defineComponent({
|
|
|
81
81
|
|
|
82
82
|
const bodyStyles = computed(() => [
|
|
83
83
|
...TooltipBody,
|
|
84
|
+
...TooltipBodyPlacements[props.placement],
|
|
84
85
|
]);
|
|
85
86
|
|
|
86
87
|
// Methods
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TooltipPlacement } from './props';
|
|
2
|
+
|
|
1
3
|
export const TooltipRoot: string[] = [
|
|
2
4
|
// Layout
|
|
3
5
|
'inline-block',
|
|
@@ -9,6 +11,9 @@ export const TooltipBody: string[] = [
|
|
|
9
11
|
'rounded-sm',
|
|
10
12
|
|
|
11
13
|
// Sizing
|
|
14
|
+
'mx-sm',
|
|
15
|
+
'my-sm',
|
|
16
|
+
|
|
12
17
|
'px-sm',
|
|
13
18
|
'py-xs',
|
|
14
19
|
|
|
@@ -22,3 +27,53 @@ export const TooltipBody: string[] = [
|
|
|
22
27
|
'text-inverse-on-surface',
|
|
23
28
|
'dark:text-inverse-on-surface-dark',
|
|
24
29
|
];
|
|
30
|
+
|
|
31
|
+
export const TooltipBodyPlacements: Record<TooltipPlacement, string[]> = {
|
|
32
|
+
'top': [],
|
|
33
|
+
|
|
34
|
+
'top-start': [
|
|
35
|
+
// Sizing
|
|
36
|
+
'ml-none',
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
'top-end': [
|
|
40
|
+
// Sizing
|
|
41
|
+
'mr-none',
|
|
42
|
+
],
|
|
43
|
+
|
|
44
|
+
'bottom': [],
|
|
45
|
+
|
|
46
|
+
'bottom-start': [
|
|
47
|
+
// Sizing
|
|
48
|
+
'ml-none',
|
|
49
|
+
],
|
|
50
|
+
|
|
51
|
+
'bottom-end': [
|
|
52
|
+
// Sizing
|
|
53
|
+
'mr-none',
|
|
54
|
+
],
|
|
55
|
+
|
|
56
|
+
'left': [],
|
|
57
|
+
|
|
58
|
+
'left-start': [
|
|
59
|
+
// Sizing
|
|
60
|
+
'mt-none',
|
|
61
|
+
],
|
|
62
|
+
|
|
63
|
+
'left-end': [
|
|
64
|
+
// Sizing
|
|
65
|
+
'mb-none',
|
|
66
|
+
],
|
|
67
|
+
|
|
68
|
+
'right': [],
|
|
69
|
+
|
|
70
|
+
'right-start': [
|
|
71
|
+
// Sizing
|
|
72
|
+
'mt-none',
|
|
73
|
+
],
|
|
74
|
+
|
|
75
|
+
'right-end': [
|
|
76
|
+
// Sizing
|
|
77
|
+
'mb-none',
|
|
78
|
+
],
|
|
79
|
+
};
|
|
@@ -8,7 +8,7 @@ export function useClassAttribute(): UseClassAttributeReturn {
|
|
|
8
8
|
|
|
9
9
|
// Functions
|
|
10
10
|
function composeClass(): UnwrapRef<UseClassAttributeReturn> {
|
|
11
|
-
const { staticClass = '', class: classProperty } = (currentInstance?.vnode as VNode).data ?? {};
|
|
11
|
+
const { staticClass = '', class: classProperty } = (currentInstance?.vnode as unknown as VNode).data ?? {};
|
|
12
12
|
|
|
13
13
|
if (!classProperty) {
|
|
14
14
|
return staticClass || undefined;
|
package/src/index.ts
CHANGED