@onereach/ui-components 2.62.7 → 2.62.8-beta.1934.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/{OrInlineInput-8455f9da.js → OrInlineInput-f00cba5e.js} +5 -4
- package/dist/v2/{OrInlineTextarea-1127e512.js → OrInlineTextarea-75de33d0.js} +5 -4
- package/dist/v2/OrSegmentedControl-17df63b8.js +236 -0
- package/dist/v2/{OrTabs-b4a9740b.js → OrTabs-f2a60b41.js} +1 -1
- package/dist/v2/components/index.d.ts +1 -0
- package/dist/v2/components/or-segmented-control-v3/OrSegmentedControl.stories3.d.ts +12 -0
- 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/index.js +4 -3
- package/dist/v2/index2.js +4 -3
- package/dist/v2/index34.js +1 -1
- package/dist/v2/index36.js +1 -1
- package/dist/v2/index63.js +2 -16
- package/dist/v2/index64.js +15 -24
- package/dist/v2/index65.js +26 -4
- package/dist/v2/index66.js +2 -1
- package/dist/v2/index67.js +3 -4
- package/dist/v2/index68.js +3 -4
- package/dist/v2/index69.js +3 -10
- package/dist/v2/index70.js +3 -6
- package/dist/v2/index71.js +13 -2
- package/dist/v2/index72.js +4 -6
- package/dist/v2/index73.js +6 -4
- package/dist/v2/index74.js +2 -1
- package/dist/v2/index75.js +3 -3
- package/dist/v2/index76.js +3 -4
- package/dist/v2/index77.js +4 -15
- package/dist/v2/index78.js +14 -11
- package/dist/v2/index79.js +11 -13
- package/dist/v2/index80.js +14 -2
- package/dist/v2/index81.js +2 -2
- package/dist/v2/index82.js +2 -3
- package/dist/v2/index83.js +1 -6
- package/dist/v2/index84.js +7 -20
- package/dist/v2/index85.js +12 -9
- package/dist/v2/index86.js +18 -1
- package/dist/v2/index87.js +2 -18
- package/dist/v2/index88.js +18 -2
- package/dist/v2/index89.js +2 -10
- package/dist/v2/index90.js +9 -11
- package/dist/v2/index91.js +12 -1
- package/dist/v2/index92.js +1 -6
- package/dist/v2/index93.js +5 -1
- package/dist/v2/index94.js +3 -0
- package/dist/v3/{OrInlineInput-a080b0a3.js → OrInlineInput-bac4abdd.js} +3 -2
- package/dist/v3/{OrInlineTextarea-08767485.js → OrInlineTextarea-d1ec1bba.js} +3 -2
- package/dist/v3/OrSegmentedControl-2bbc0f22.js +184 -0
- package/dist/v3/{OrTabs-194ca950.js → OrTabs-ac0be933.js} +1 -1
- package/dist/v3/components/index.d.ts +1 -0
- package/dist/v3/components/or-segmented-control-v3/OrSegmentedControl.stories3.d.ts +12 -0
- 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/index.js +4 -3
- package/dist/v3/index2.js +4 -3
- package/dist/v3/index34.js +1 -1
- package/dist/v3/index36.js +1 -1
- package/dist/v3/index63.js +2 -15
- package/dist/v3/index64.js +13 -22
- package/dist/v3/index65.js +24 -3
- package/dist/v3/index66.js +2 -1
- package/dist/v3/index67.js +3 -4
- package/dist/v3/index68.js +3 -4
- package/dist/v3/index69.js +3 -9
- package/dist/v3/index70.js +3 -4
- package/dist/v3/index71.js +10 -2
- package/dist/v3/index72.js +3 -5
- package/dist/v3/index73.js +5 -3
- package/dist/v3/index74.js +2 -1
- package/dist/v3/index75.js +3 -3
- package/dist/v3/index76.js +3 -4
- package/dist/v3/index77.js +4 -14
- package/dist/v3/index78.js +13 -10
- package/dist/v3/index79.js +10 -12
- package/dist/v3/index80.js +13 -1
- package/dist/v3/index81.js +1 -1
- package/dist/v3/index82.js +1 -3
- package/dist/v3/index83.js +1 -6
- package/dist/v3/index84.js +6 -16
- package/dist/v3/index85.js +12 -9
- package/dist/v3/index86.js +15 -1
- package/dist/v3/index87.js +2 -17
- package/dist/v3/index88.js +17 -2
- package/dist/v3/index89.js +2 -8
- package/dist/v3/index90.js +6 -9
- package/dist/v3/index91.js +11 -1
- package/dist/v3/index92.js +1 -6
- package/dist/v3/index93.js +5 -1
- package/dist/v3/index94.js +3 -0
- package/package.json +2 -3
- package/src/components/index.ts +1 -0
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
- package/src/components/or-inline-input-v3/OrInlineInput.vue +2 -2
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +2 -2
- package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
- 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-switch-v3/OrSwitch.stories3.ts +1 -1
- package/src/components/or-tabs-v3/OrTabs.stories3.ts +9 -4
- package/src/components/or-tabs-v3/OrTabs.vue +1 -1
- package/src/hooks/useClassAttribute.ts +1 -1
|
@@ -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
|
+
};
|
|
@@ -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"
|
|
@@ -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;
|