@onereach/ui-components 2.62.7-beta.1922.0 → 2.62.7-beta.1928.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/{OrSegmentedControls-cd8b1cd3.js → OrSegmentedControl-58b5db14.js} +18 -17
- package/dist/v2/components/index.d.ts +1 -1
- package/dist/v2/components/{or-segmented-controls-v3/OrSegmentedControls.stories3.d.ts → or-segmented-control-v3/OrSegmentedControl.stories3.d.ts} +0 -0
- package/dist/{v3/components/or-segmented-controls-v3/OrSegmentedControls.vue.d.ts → v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts} +16 -16
- package/dist/{v3/components/or-segmented-controls-v3/components/or-segmented-controls-item/OrSegmentedControlsItem.vue.d.ts → v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts} +5 -5
- 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 +1 -1
- package/dist/v2/index2.js +1 -1
- package/dist/v2/index63.js +1 -1
- package/dist/v3/{OrSegmentedControls-e4522910.js → OrSegmentedControl-e45af169.js} +22 -22
- package/dist/v3/components/index.d.ts +1 -1
- package/dist/v3/components/{or-segmented-controls-v3/OrSegmentedControls.stories3.d.ts → or-segmented-control-v3/OrSegmentedControl.stories3.d.ts} +0 -0
- package/dist/{v2/components/or-segmented-controls-v3/OrSegmentedControls.vue.d.ts → v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts} +16 -16
- package/dist/{v2/components/or-segmented-controls-v3/components/or-segmented-controls-item/OrSegmentedControlsItem.vue.d.ts → v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts} +5 -5
- 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 +1 -1
- package/dist/v3/index2.js +1 -1
- package/dist/v3/index63.js +1 -1
- package/package.json +1 -1
- package/src/components/index.ts +1 -1
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
- 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-controls-v3/OrSegmentedControls.stories3.ts → or-segmented-control-v3/OrSegmentedControl.stories3.ts} +14 -14
- package/src/components/{or-segmented-controls-v3/OrSegmentedControls.vue → or-segmented-control-v3/OrSegmentedControl.vue} +16 -16
- package/src/components/{or-segmented-controls-v3/components/or-segmented-controls-item/OrSegmentedControlsItem.vue → or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue} +7 -7
- package/src/components/{or-segmented-controls-v3/components/or-segmented-controls-item → or-segmented-control-v3/components/or-segmented-control-item}/styles.ts +3 -3
- 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-controls-v3 → or-segmented-control-v3}/styles.ts +3 -3
- package/src/components/or-segmented-control-v3/types.ts +4 -0
- package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
- package/dist/v2/components/or-segmented-controls-v3/components/or-segmented-controls-item/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-controls-v3/index.d.ts +0 -3
- package/dist/v2/components/or-segmented-controls-v3/props.d.ts +0 -4
- package/dist/v2/components/or-segmented-controls-v3/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-controls-v3/types.d.ts +0 -4
- package/dist/v3/components/or-segmented-controls-v3/components/or-segmented-controls-item/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-controls-v3/index.d.ts +0 -3
- package/dist/v3/components/or-segmented-controls-v3/props.d.ts +0 -4
- package/dist/v3/components/or-segmented-controls-v3/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-controls-v3/types.d.ts +0 -4
- package/src/components/or-segmented-controls-v3/OrSegmentedControls.docs.mdx +0 -7
- package/src/components/or-segmented-controls-v3/index.ts +0 -3
- package/src/components/or-segmented-controls-v3/props.ts +0 -4
- package/src/components/or-segmented-controls-v3/types.ts +0 -4
|
@@ -3,7 +3,7 @@ import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const SegmentedControlItemRoot = [
|
|
7
7
|
// Layout
|
|
8
8
|
'flex', 'items-center', 'justify-center',
|
|
9
9
|
// Shape
|
|
@@ -16,7 +16,7 @@ const SegmentedControlsItemRoot = [
|
|
|
16
16
|
'selected:theme-background-default', 'dark:selected:theme-background-default-dark',
|
|
17
17
|
// Theme (selected, enabled)
|
|
18
18
|
'selected:enabled:shadow-card', 'dark:selected:enabled:shadow-card-dark'];
|
|
19
|
-
const
|
|
19
|
+
const SegmentedControlItemRootSizes = {
|
|
20
20
|
'm': [
|
|
21
21
|
// Box
|
|
22
22
|
'h-[44px] md:h-[36px]',
|
|
@@ -34,7 +34,7 @@ const SegmentedControlsItemRootSizes = {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
var script$1 = defineComponent({
|
|
37
|
-
name: '
|
|
37
|
+
name: 'OrSegmentedControlItem',
|
|
38
38
|
inheritAttrs: false,
|
|
39
39
|
props: {
|
|
40
40
|
size: {
|
|
@@ -55,7 +55,7 @@ var script$1 = defineComponent({
|
|
|
55
55
|
const root = ref();
|
|
56
56
|
// Styles
|
|
57
57
|
const classAttribute = useClassAttribute();
|
|
58
|
-
const rootStyles = computed(() => ['or-segmented-
|
|
58
|
+
const rootStyles = computed(() => ['or-segmented-control-item', ...SegmentedControlItemRoot, ...SegmentedControlItemRootSizes[props.size], classAttribute.value]);
|
|
59
59
|
return {
|
|
60
60
|
root,
|
|
61
61
|
rootStyles
|
|
@@ -103,13 +103,13 @@ const __vue_component__$1 = /*#__PURE__*/normalizeComponent({
|
|
|
103
103
|
staticRenderFns: __vue_staticRenderFns__$1
|
|
104
104
|
}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
|
|
105
105
|
|
|
106
|
-
var
|
|
107
|
-
(function (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
})(
|
|
106
|
+
var SegmentedControlSize;
|
|
107
|
+
(function (SegmentedControlSize) {
|
|
108
|
+
SegmentedControlSize["M"] = "m";
|
|
109
|
+
SegmentedControlSize["S"] = "s";
|
|
110
|
+
})(SegmentedControlSize || (SegmentedControlSize = {}));
|
|
111
111
|
|
|
112
|
-
const
|
|
112
|
+
const SegmentedControlRoot = [
|
|
113
113
|
// Layout
|
|
114
114
|
'grid', 'grid-flow-col', 'auto-cols-fr',
|
|
115
115
|
// Shape
|
|
@@ -118,15 +118,15 @@ const SegmentedControlsRoot = [
|
|
|
118
118
|
'px-[2px]', 'py-[2px]',
|
|
119
119
|
// Theme
|
|
120
120
|
'theme-background-surface-variant', 'dark:theme-background-surface-variant-dark'];
|
|
121
|
-
const
|
|
121
|
+
const SegmentedControlRootSizes = {
|
|
122
122
|
'm': [],
|
|
123
123
|
's': []
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
var script = defineComponent({
|
|
127
|
-
name: '
|
|
127
|
+
name: 'OrSegmentedControl',
|
|
128
128
|
components: {
|
|
129
|
-
|
|
129
|
+
OrSegmentedControlItem: __vue_component__$1
|
|
130
130
|
},
|
|
131
131
|
inheritAttrs: false,
|
|
132
132
|
props: {
|
|
@@ -144,7 +144,7 @@ var script = defineComponent({
|
|
|
144
144
|
},
|
|
145
145
|
size: {
|
|
146
146
|
type: String,
|
|
147
|
-
default:
|
|
147
|
+
default: SegmentedControlSize.M
|
|
148
148
|
},
|
|
149
149
|
disabled: {
|
|
150
150
|
type: Boolean,
|
|
@@ -158,7 +158,7 @@ var script = defineComponent({
|
|
|
158
158
|
const root = ref();
|
|
159
159
|
// Styles
|
|
160
160
|
const classAttribute = useClassAttribute();
|
|
161
|
-
const rootStyles = computed(() => ['or-segmented-
|
|
161
|
+
const rootStyles = computed(() => ['or-segmented-control', ...SegmentedControlRoot, ...SegmentedControlRootSizes[props.size], classAttribute.value]);
|
|
162
162
|
// State
|
|
163
163
|
const proxyModelValue = computed({
|
|
164
164
|
get: () => {
|
|
@@ -191,7 +191,7 @@ var __vue_render__ = function () {
|
|
|
191
191
|
ref: "root",
|
|
192
192
|
class: _vm.rootStyles
|
|
193
193
|
}, 'div', _vm.$attrs, false), _vm._l(_vm.options, function (option) {
|
|
194
|
-
return _c('
|
|
194
|
+
return _c('OrSegmentedControlItem', {
|
|
195
195
|
key: option.value,
|
|
196
196
|
attrs: {
|
|
197
197
|
"size": _vm.size,
|
|
@@ -200,6 +200,7 @@ var __vue_render__ = function () {
|
|
|
200
200
|
},
|
|
201
201
|
on: {
|
|
202
202
|
"click": function ($event) {
|
|
203
|
+
$event.stopPropagation();
|
|
203
204
|
_vm.proxyModelValue = option.value;
|
|
204
205
|
}
|
|
205
206
|
}
|
|
@@ -227,4 +228,4 @@ const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
|
227
228
|
staticRenderFns: __vue_staticRenderFns__
|
|
228
229
|
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
229
230
|
|
|
230
|
-
export {
|
|
231
|
+
export { SegmentedControlSize as S, __vue_component__ as _ };
|
|
@@ -58,7 +58,7 @@ export * from './or-radio';
|
|
|
58
58
|
export * from './or-radio-group';
|
|
59
59
|
export * from './or-radio-v3';
|
|
60
60
|
export * from './or-search-v3';
|
|
61
|
-
export * from './or-segmented-
|
|
61
|
+
export * from './or-segmented-control-v3';
|
|
62
62
|
export * from './or-select';
|
|
63
63
|
export * from './or-select-v3';
|
|
64
64
|
export * from './or-sidebar';
|
|
File without changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SegmentedControlSize } from './props';
|
|
3
|
+
import { SegmentedControlOption } from './types';
|
|
4
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
5
5
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
6
6
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
7
7
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
8
8
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
9
9
|
options: {
|
|
10
|
-
type: PropType<
|
|
11
|
-
default:
|
|
10
|
+
type: PropType<SegmentedControlOption[]>;
|
|
11
|
+
default: SegmentedControlOption[];
|
|
12
12
|
};
|
|
13
13
|
modelValue: {
|
|
14
14
|
type: StringConstructor;
|
|
@@ -19,8 +19,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
19
19
|
default: undefined;
|
|
20
20
|
};
|
|
21
21
|
size: {
|
|
22
|
-
type: PropType<
|
|
23
|
-
default:
|
|
22
|
+
type: PropType<SegmentedControlSize>;
|
|
23
|
+
default: SegmentedControlSize;
|
|
24
24
|
};
|
|
25
25
|
disabled: {
|
|
26
26
|
type: BooleanConstructor;
|
|
@@ -28,8 +28,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
28
28
|
};
|
|
29
29
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
30
30
|
options: {
|
|
31
|
-
type: PropType<
|
|
32
|
-
default:
|
|
31
|
+
type: PropType<SegmentedControlOption[]>;
|
|
32
|
+
default: SegmentedControlOption[];
|
|
33
33
|
};
|
|
34
34
|
modelValue: {
|
|
35
35
|
type: StringConstructor;
|
|
@@ -40,18 +40,18 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
40
40
|
default: undefined;
|
|
41
41
|
};
|
|
42
42
|
size: {
|
|
43
|
-
type: PropType<
|
|
44
|
-
default:
|
|
43
|
+
type: PropType<SegmentedControlSize>;
|
|
44
|
+
default: SegmentedControlSize;
|
|
45
45
|
};
|
|
46
46
|
disabled: {
|
|
47
47
|
type: BooleanConstructor;
|
|
48
48
|
default: boolean;
|
|
49
49
|
};
|
|
50
50
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
51
|
-
options:
|
|
51
|
+
options: SegmentedControlOption[];
|
|
52
52
|
modelValue: string;
|
|
53
53
|
value: string;
|
|
54
|
-
size:
|
|
54
|
+
size: SegmentedControlSize;
|
|
55
55
|
disabled: boolean;
|
|
56
56
|
} & {} & {
|
|
57
57
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
@@ -60,18 +60,18 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
60
60
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
61
61
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
62
62
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
63
|
-
options:
|
|
63
|
+
options: SegmentedControlOption[];
|
|
64
64
|
modelValue: string;
|
|
65
65
|
value: string;
|
|
66
|
-
size:
|
|
66
|
+
size: SegmentedControlSize;
|
|
67
67
|
disabled: boolean;
|
|
68
68
|
} & {} & {
|
|
69
69
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
70
70
|
}, {
|
|
71
|
-
options:
|
|
71
|
+
options: SegmentedControlOption[];
|
|
72
72
|
modelValue: string;
|
|
73
73
|
value: string;
|
|
74
|
-
size:
|
|
74
|
+
size: SegmentedControlSize;
|
|
75
75
|
disabled: boolean;
|
|
76
76
|
}, true>);
|
|
77
77
|
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
2
|
+
import { SegmentedControlSize } from '../../props';
|
|
3
3
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
4
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
5
5
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
6
6
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
7
7
|
size: {
|
|
8
|
-
type: PropType<
|
|
8
|
+
type: PropType<SegmentedControlSize>;
|
|
9
9
|
required: true;
|
|
10
10
|
};
|
|
11
11
|
selected: {
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
18
18
|
};
|
|
19
19
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
20
20
|
size: {
|
|
21
|
-
type: PropType<
|
|
21
|
+
type: PropType<SegmentedControlSize>;
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
24
24
|
selected: {
|
|
@@ -30,14 +30,14 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
30
30
|
default: boolean;
|
|
31
31
|
};
|
|
32
32
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
33
|
-
size:
|
|
33
|
+
size: SegmentedControlSize;
|
|
34
34
|
selected: boolean;
|
|
35
35
|
disabled: boolean;
|
|
36
36
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
37
37
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
38
38
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
39
39
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
40
|
-
size:
|
|
40
|
+
size: SegmentedControlSize;
|
|
41
41
|
selected: boolean;
|
|
42
42
|
disabled: boolean;
|
|
43
43
|
} & {}, {
|
package/dist/v2/index.js
CHANGED
|
@@ -63,7 +63,7 @@ export { _ as OrRadio } from './OrRadio-514e8de8.js';
|
|
|
63
63
|
export { _ as OrRadioGroup } from './OrRadioGroup-11424644.js';
|
|
64
64
|
export { _ as OrRadioV3 } from './OrRadio-4ba56887.js';
|
|
65
65
|
export { _ as OrSearchV3 } from './OrSearch-978a3a6e.js';
|
|
66
|
-
export { _ as
|
|
66
|
+
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-58b5db14.js';
|
|
67
67
|
export { _ as OrSelect } from './OrSelect-ea27a70e.js';
|
|
68
68
|
export { _ as OrSelectV3 } from './OrSelect-c6d0a69e.js';
|
|
69
69
|
export { _ as OrSidebar, O as OrSidebarSide } from './OrSidebar-feacf13a.js';
|
package/dist/v2/index2.js
CHANGED
|
@@ -63,7 +63,7 @@ export { _ as OrRadio } from './OrRadio-514e8de8.js';
|
|
|
63
63
|
export { _ as OrRadioGroup } from './OrRadioGroup-11424644.js';
|
|
64
64
|
export { _ as OrRadioV3 } from './OrRadio-4ba56887.js';
|
|
65
65
|
export { _ as OrSearchV3 } from './OrSearch-978a3a6e.js';
|
|
66
|
-
export { _ as
|
|
66
|
+
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-58b5db14.js';
|
|
67
67
|
export { _ as OrSelect } from './OrSelect-ea27a70e.js';
|
|
68
68
|
export { _ as OrSelectV3 } from './OrSelect-c6d0a69e.js';
|
|
69
69
|
export { _ as OrSidebar, O as OrSidebarSide } from './OrSidebar-feacf13a.js';
|
package/dist/v2/index63.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { _ as
|
|
1
|
+
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-58b5db14.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import './useClassAttribute-47fdb016.js';
|
|
4
4
|
import '@vueuse/core';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
2
|
import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
|
-
import { openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot, normalizeClass, resolveComponent, Fragment, renderList, createBlock, withCtx, createTextVNode, toDisplayString } from 'vue';
|
|
4
|
+
import { openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot, normalizeClass, resolveComponent, Fragment, renderList, createBlock, withModifiers, withCtx, createTextVNode, toDisplayString } from 'vue';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const SegmentedControlItemRoot = [
|
|
7
7
|
// Layout
|
|
8
8
|
'flex', 'items-center', 'justify-center',
|
|
9
9
|
// Shape
|
|
@@ -16,7 +16,7 @@ const SegmentedControlsItemRoot = [
|
|
|
16
16
|
'selected:theme-background-default', 'dark:selected:theme-background-default-dark',
|
|
17
17
|
// Theme (selected, enabled)
|
|
18
18
|
'selected:enabled:shadow-card', 'dark:selected:enabled:shadow-card-dark'];
|
|
19
|
-
const
|
|
19
|
+
const SegmentedControlItemRootSizes = {
|
|
20
20
|
'm': [
|
|
21
21
|
// Box
|
|
22
22
|
'h-[44px] md:h-[36px]',
|
|
@@ -34,7 +34,7 @@ const SegmentedControlsItemRootSizes = {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
var script$1 = defineComponent({
|
|
37
|
-
name: '
|
|
37
|
+
name: 'OrSegmentedControlItem',
|
|
38
38
|
inheritAttrs: false,
|
|
39
39
|
props: {
|
|
40
40
|
size: {
|
|
@@ -55,7 +55,7 @@ var script$1 = defineComponent({
|
|
|
55
55
|
const root = ref();
|
|
56
56
|
// Styles
|
|
57
57
|
const classAttribute = useClassAttribute();
|
|
58
|
-
const rootStyles = computed(() => ['or-segmented-
|
|
58
|
+
const rootStyles = computed(() => ['or-segmented-control-item', ...SegmentedControlItemRoot, ...SegmentedControlItemRootSizes[props.size], classAttribute.value]);
|
|
59
59
|
return {
|
|
60
60
|
root,
|
|
61
61
|
rootStyles
|
|
@@ -78,15 +78,15 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
script$1.render = render$1;
|
|
81
|
-
script$1.__file = "src/components/or-segmented-
|
|
81
|
+
script$1.__file = "src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue";
|
|
82
82
|
|
|
83
|
-
var
|
|
84
|
-
(function (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
})(
|
|
83
|
+
var SegmentedControlSize;
|
|
84
|
+
(function (SegmentedControlSize) {
|
|
85
|
+
SegmentedControlSize["M"] = "m";
|
|
86
|
+
SegmentedControlSize["S"] = "s";
|
|
87
|
+
})(SegmentedControlSize || (SegmentedControlSize = {}));
|
|
88
88
|
|
|
89
|
-
const
|
|
89
|
+
const SegmentedControlRoot = [
|
|
90
90
|
// Layout
|
|
91
91
|
'grid', 'grid-flow-col', 'auto-cols-fr',
|
|
92
92
|
// Shape
|
|
@@ -95,15 +95,15 @@ const SegmentedControlsRoot = [
|
|
|
95
95
|
'px-[2px]', 'py-[2px]',
|
|
96
96
|
// Theme
|
|
97
97
|
'theme-background-surface-variant', 'dark:theme-background-surface-variant-dark'];
|
|
98
|
-
const
|
|
98
|
+
const SegmentedControlRootSizes = {
|
|
99
99
|
'm': [],
|
|
100
100
|
's': []
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
var script = defineComponent({
|
|
104
|
-
name: '
|
|
104
|
+
name: 'OrSegmentedControl',
|
|
105
105
|
components: {
|
|
106
|
-
|
|
106
|
+
OrSegmentedControlItem: script$1
|
|
107
107
|
},
|
|
108
108
|
inheritAttrs: false,
|
|
109
109
|
props: {
|
|
@@ -121,7 +121,7 @@ var script = defineComponent({
|
|
|
121
121
|
},
|
|
122
122
|
size: {
|
|
123
123
|
type: String,
|
|
124
|
-
default:
|
|
124
|
+
default: SegmentedControlSize.M
|
|
125
125
|
},
|
|
126
126
|
disabled: {
|
|
127
127
|
type: Boolean,
|
|
@@ -135,7 +135,7 @@ var script = defineComponent({
|
|
|
135
135
|
const root = ref();
|
|
136
136
|
// Styles
|
|
137
137
|
const classAttribute = useClassAttribute();
|
|
138
|
-
const rootStyles = computed(() => ['or-segmented-
|
|
138
|
+
const rootStyles = computed(() => ['or-segmented-control', ...SegmentedControlRoot, ...SegmentedControlRootSizes[props.size], classAttribute.value]);
|
|
139
139
|
// State
|
|
140
140
|
const proxyModelValue = computed({
|
|
141
141
|
get: () => {
|
|
@@ -157,18 +157,18 @@ var script = defineComponent({
|
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
160
|
-
const
|
|
160
|
+
const _component_OrSegmentedControlItem = resolveComponent("OrSegmentedControlItem");
|
|
161
161
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
162
162
|
ref: "root"
|
|
163
163
|
}, _ctx.$attrs, {
|
|
164
164
|
class: _ctx.rootStyles
|
|
165
165
|
}), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, option => {
|
|
166
|
-
return openBlock(), createBlock(
|
|
166
|
+
return openBlock(), createBlock(_component_OrSegmentedControlItem, {
|
|
167
167
|
key: option.value,
|
|
168
168
|
size: _ctx.size,
|
|
169
169
|
selected: option.value === _ctx.proxyModelValue,
|
|
170
170
|
disabled: _ctx.disabled,
|
|
171
|
-
onClick: $event => _ctx.proxyModelValue = option.value
|
|
171
|
+
onClick: withModifiers($event => _ctx.proxyModelValue = option.value, ["stop"])
|
|
172
172
|
}, {
|
|
173
173
|
default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
|
|
174
174
|
|
|
@@ -178,6 +178,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
script.render = render;
|
|
181
|
-
script.__file = "src/components/or-segmented-
|
|
181
|
+
script.__file = "src/components/or-segmented-control-v3/OrSegmentedControl.vue";
|
|
182
182
|
|
|
183
|
-
export {
|
|
183
|
+
export { SegmentedControlSize as S, script as s };
|
|
@@ -58,7 +58,7 @@ export * from './or-radio';
|
|
|
58
58
|
export * from './or-radio-group';
|
|
59
59
|
export * from './or-radio-v3';
|
|
60
60
|
export * from './or-search-v3';
|
|
61
|
-
export * from './or-segmented-
|
|
61
|
+
export * from './or-segmented-control-v3';
|
|
62
62
|
export * from './or-select';
|
|
63
63
|
export * from './or-select-v3';
|
|
64
64
|
export * from './or-sidebar';
|
|
File without changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SegmentedControlSize } from './props';
|
|
3
|
+
import { SegmentedControlOption } from './types';
|
|
4
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
5
5
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
6
6
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
7
7
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
8
8
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
9
9
|
options: {
|
|
10
|
-
type: PropType<
|
|
11
|
-
default:
|
|
10
|
+
type: PropType<SegmentedControlOption[]>;
|
|
11
|
+
default: SegmentedControlOption[];
|
|
12
12
|
};
|
|
13
13
|
modelValue: {
|
|
14
14
|
type: StringConstructor;
|
|
@@ -19,8 +19,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
19
19
|
default: undefined;
|
|
20
20
|
};
|
|
21
21
|
size: {
|
|
22
|
-
type: PropType<
|
|
23
|
-
default:
|
|
22
|
+
type: PropType<SegmentedControlSize>;
|
|
23
|
+
default: SegmentedControlSize;
|
|
24
24
|
};
|
|
25
25
|
disabled: {
|
|
26
26
|
type: BooleanConstructor;
|
|
@@ -28,8 +28,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
28
28
|
};
|
|
29
29
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
30
30
|
options: {
|
|
31
|
-
type: PropType<
|
|
32
|
-
default:
|
|
31
|
+
type: PropType<SegmentedControlOption[]>;
|
|
32
|
+
default: SegmentedControlOption[];
|
|
33
33
|
};
|
|
34
34
|
modelValue: {
|
|
35
35
|
type: StringConstructor;
|
|
@@ -40,18 +40,18 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
40
40
|
default: undefined;
|
|
41
41
|
};
|
|
42
42
|
size: {
|
|
43
|
-
type: PropType<
|
|
44
|
-
default:
|
|
43
|
+
type: PropType<SegmentedControlSize>;
|
|
44
|
+
default: SegmentedControlSize;
|
|
45
45
|
};
|
|
46
46
|
disabled: {
|
|
47
47
|
type: BooleanConstructor;
|
|
48
48
|
default: boolean;
|
|
49
49
|
};
|
|
50
50
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
51
|
-
options:
|
|
51
|
+
options: SegmentedControlOption[];
|
|
52
52
|
modelValue: string;
|
|
53
53
|
value: string;
|
|
54
|
-
size:
|
|
54
|
+
size: SegmentedControlSize;
|
|
55
55
|
disabled: boolean;
|
|
56
56
|
} & {} & {
|
|
57
57
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
@@ -60,18 +60,18 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
60
60
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
61
61
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
62
62
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
63
|
-
options:
|
|
63
|
+
options: SegmentedControlOption[];
|
|
64
64
|
modelValue: string;
|
|
65
65
|
value: string;
|
|
66
|
-
size:
|
|
66
|
+
size: SegmentedControlSize;
|
|
67
67
|
disabled: boolean;
|
|
68
68
|
} & {} & {
|
|
69
69
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
70
70
|
}, {
|
|
71
|
-
options:
|
|
71
|
+
options: SegmentedControlOption[];
|
|
72
72
|
modelValue: string;
|
|
73
73
|
value: string;
|
|
74
|
-
size:
|
|
74
|
+
size: SegmentedControlSize;
|
|
75
75
|
disabled: boolean;
|
|
76
76
|
}, true>);
|
|
77
77
|
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import {
|
|
2
|
+
import { SegmentedControlSize } from '../../props';
|
|
3
3
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
4
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
5
5
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
6
6
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
7
7
|
size: {
|
|
8
|
-
type: PropType<
|
|
8
|
+
type: PropType<SegmentedControlSize>;
|
|
9
9
|
required: true;
|
|
10
10
|
};
|
|
11
11
|
selected: {
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
18
18
|
};
|
|
19
19
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
20
20
|
size: {
|
|
21
|
-
type: PropType<
|
|
21
|
+
type: PropType<SegmentedControlSize>;
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
24
24
|
selected: {
|
|
@@ -30,14 +30,14 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
30
30
|
default: boolean;
|
|
31
31
|
};
|
|
32
32
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
33
|
-
size:
|
|
33
|
+
size: SegmentedControlSize;
|
|
34
34
|
selected: boolean;
|
|
35
35
|
disabled: boolean;
|
|
36
36
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
37
37
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
38
38
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
39
39
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
40
|
-
size:
|
|
40
|
+
size: SegmentedControlSize;
|
|
41
41
|
selected: boolean;
|
|
42
42
|
disabled: boolean;
|
|
43
43
|
} & {}, {
|
package/dist/v3/index.js
CHANGED
|
@@ -58,7 +58,7 @@ export { s as OrRadio } from './OrRadio-c3ab11f2.js';
|
|
|
58
58
|
export { s as OrRadioGroup } from './OrRadioGroup-00785e41.js';
|
|
59
59
|
export { s as OrRadioV3 } from './OrRadio-0c1883f2.js';
|
|
60
60
|
export { s as OrSearchV3 } from './OrSearch-375eab55.js';
|
|
61
|
-
export { s as
|
|
61
|
+
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-e45af169.js';
|
|
62
62
|
export { s as OrSelect } from './OrSelect-056731af.js';
|
|
63
63
|
export { s as OrSelectV3 } from './OrSelect-52cfb10d.js';
|
|
64
64
|
export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-375c85a3.js';
|
package/dist/v3/index2.js
CHANGED
|
@@ -58,7 +58,7 @@ export { s as OrRadio } from './OrRadio-c3ab11f2.js';
|
|
|
58
58
|
export { s as OrRadioGroup } from './OrRadioGroup-00785e41.js';
|
|
59
59
|
export { s as OrRadioV3 } from './OrRadio-0c1883f2.js';
|
|
60
60
|
export { s as OrSearchV3 } from './OrSearch-375eab55.js';
|
|
61
|
-
export { s as
|
|
61
|
+
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-e45af169.js';
|
|
62
62
|
export { s as OrSelect } from './OrSelect-056731af.js';
|
|
63
63
|
export { s as OrSelectV3 } from './OrSelect-52cfb10d.js';
|
|
64
64
|
export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-375c85a3.js';
|
package/dist/v3/index63.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { s as
|
|
1
|
+
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-e45af169.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import './useClassAttribute-47fdb016.js';
|
|
4
4
|
import '@vueuse/core';
|
package/package.json
CHANGED
package/src/components/index.ts
CHANGED
|
@@ -58,7 +58,7 @@ export * from './or-radio';
|
|
|
58
58
|
export * from './or-radio-group';
|
|
59
59
|
export * from './or-radio-v3';
|
|
60
60
|
export * from './or-search-v3';
|
|
61
|
-
export * from './or-segmented-
|
|
61
|
+
export * from './or-segmented-control-v3';
|
|
62
62
|
export * from './or-select';
|
|
63
63
|
export * from './or-select-v3';
|
|
64
64
|
export * from './or-sidebar';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
3
|
import { ref, watch } from 'vue-demi';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import OrSegmentedControlDocs from './OrSegmentedControl.docs.mdx';
|
|
5
|
+
import OrSegmentedControl from './OrSegmentedControl.vue';
|
|
6
|
+
import { SegmentedControlSize } from './props';
|
|
7
|
+
import { SegmentedControlOption } from './types';
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
|
-
title: 'Components/Forms/Segmented
|
|
11
|
-
component:
|
|
10
|
+
title: 'Components/Forms/Segmented Control',
|
|
11
|
+
component: OrSegmentedControl,
|
|
12
12
|
|
|
13
13
|
argTypes: {
|
|
14
14
|
// Props
|
|
@@ -21,12 +21,12 @@ export default {
|
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
value: { // TODO: Remove Vue 2 fallback
|
|
24
|
-
|
|
24
|
+
table: { disable: true },
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
size: {
|
|
28
28
|
control: { type: 'select' },
|
|
29
|
-
options: Object.values(
|
|
29
|
+
options: Object.values(SegmentedControlSize),
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
disabled: {
|
|
@@ -55,7 +55,7 @@ export default {
|
|
|
55
55
|
layout: 'centered',
|
|
56
56
|
|
|
57
57
|
docs: {
|
|
58
|
-
page:
|
|
58
|
+
page: OrSegmentedControlDocs,
|
|
59
59
|
},
|
|
60
60
|
|
|
61
61
|
design: {
|
|
@@ -63,11 +63,11 @@ export default {
|
|
|
63
63
|
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=410%3A2097&t=7N93DAotOYMOX2kx-1',
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
-
} as Meta<typeof
|
|
66
|
+
} as Meta<typeof OrSegmentedControl>;
|
|
67
67
|
|
|
68
|
-
const Template: StoryFn<typeof
|
|
68
|
+
const Template: StoryFn<typeof OrSegmentedControl> = (args) => ({
|
|
69
69
|
components: {
|
|
70
|
-
|
|
70
|
+
OrSegmentedControl,
|
|
71
71
|
},
|
|
72
72
|
|
|
73
73
|
setup() {
|
|
@@ -90,7 +90,7 @@ const Template: StoryFn<typeof OrSegmentedControls> = (args) => ({
|
|
|
90
90
|
},
|
|
91
91
|
|
|
92
92
|
template: `
|
|
93
|
-
<
|
|
93
|
+
<OrSegmentedControl
|
|
94
94
|
v-model="model"
|
|
95
95
|
v-bind="args"
|
|
96
96
|
@update:modelValue="onUpdateModelValue"
|
|
@@ -105,7 +105,7 @@ export const Base = Template.bind({});
|
|
|
105
105
|
|
|
106
106
|
Base.args = {
|
|
107
107
|
// Props
|
|
108
|
-
options: Array.from<string,
|
|
108
|
+
options: Array.from<string, SegmentedControlOption>([
|
|
109
109
|
'Alfa',
|
|
110
110
|
'Bravo',
|
|
111
111
|
'Charlie',
|
|
@@ -4,40 +4,40 @@
|
|
|
4
4
|
v-bind="$attrs"
|
|
5
5
|
:class="rootStyles"
|
|
6
6
|
>
|
|
7
|
-
<
|
|
7
|
+
<OrSegmentedControlItem
|
|
8
8
|
v-for="option in options"
|
|
9
9
|
:key="option.value"
|
|
10
10
|
:size="size"
|
|
11
11
|
:selected="option.value === proxyModelValue"
|
|
12
12
|
:disabled="disabled"
|
|
13
|
-
@click="proxyModelValue = option.value"
|
|
13
|
+
@click.stop="proxyModelValue = option.value"
|
|
14
14
|
>
|
|
15
15
|
{{ option.label }}
|
|
16
|
-
</
|
|
16
|
+
</OrSegmentedControlItem>
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script lang="ts">
|
|
21
21
|
import { computed, defineComponent, PropType, ref } from 'vue-demi';
|
|
22
22
|
import { useClassAttribute } from '../../hooks';
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
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
27
|
|
|
28
28
|
export default defineComponent({
|
|
29
|
-
name: '
|
|
29
|
+
name: 'OrSegmentedControl',
|
|
30
30
|
|
|
31
31
|
components: {
|
|
32
|
-
|
|
32
|
+
OrSegmentedControlItem,
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
inheritAttrs: false,
|
|
36
36
|
|
|
37
37
|
props: {
|
|
38
38
|
options: {
|
|
39
|
-
type: Array as PropType<
|
|
40
|
-
default: [] as
|
|
39
|
+
type: Array as PropType<SegmentedControlOption[]>,
|
|
40
|
+
default: [] as SegmentedControlOption[],
|
|
41
41
|
},
|
|
42
42
|
|
|
43
43
|
modelValue: {
|
|
@@ -51,8 +51,8 @@ export default defineComponent({
|
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
size: {
|
|
54
|
-
type: String as PropType<
|
|
55
|
-
default:
|
|
54
|
+
type: String as PropType<SegmentedControlSize>,
|
|
55
|
+
default: SegmentedControlSize.M,
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
disabled: {
|
|
@@ -81,9 +81,9 @@ export default defineComponent({
|
|
|
81
81
|
const classAttribute = useClassAttribute();
|
|
82
82
|
|
|
83
83
|
const rootStyles = computed(() => [
|
|
84
|
-
'or-segmented-
|
|
85
|
-
...
|
|
86
|
-
...
|
|
84
|
+
'or-segmented-control',
|
|
85
|
+
...SegmentedControlRoot,
|
|
86
|
+
...SegmentedControlRootSizes[props.size],
|
|
87
87
|
classAttribute.value,
|
|
88
88
|
]);
|
|
89
89
|
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
<script lang="ts">
|
|
16
16
|
import { computed, defineComponent, PropType, ref } from 'vue-demi';
|
|
17
17
|
import { useClassAttribute } from '../../../../hooks';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { SegmentedControlSize } from '../../props';
|
|
19
|
+
import { SegmentedControlItemRoot, SegmentedControlItemRootSizes } from './styles';
|
|
20
20
|
|
|
21
21
|
export default defineComponent({
|
|
22
|
-
name: '
|
|
22
|
+
name: 'OrSegmentedControlItem',
|
|
23
23
|
|
|
24
24
|
inheritAttrs: false,
|
|
25
25
|
|
|
26
26
|
props: {
|
|
27
27
|
size: {
|
|
28
|
-
type: String as PropType<
|
|
28
|
+
type: String as PropType<SegmentedControlSize>,
|
|
29
29
|
required: true,
|
|
30
30
|
},
|
|
31
31
|
|
|
@@ -48,9 +48,9 @@ export default defineComponent({
|
|
|
48
48
|
const classAttribute = useClassAttribute();
|
|
49
49
|
|
|
50
50
|
const rootStyles = computed(() => [
|
|
51
|
-
'or-segmented-
|
|
52
|
-
...
|
|
53
|
-
...
|
|
51
|
+
'or-segmented-control-item',
|
|
52
|
+
...SegmentedControlItemRoot,
|
|
53
|
+
...SegmentedControlItemRootSizes[props.size],
|
|
54
54
|
classAttribute.value,
|
|
55
55
|
]);
|
|
56
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SegmentedControlSize } from '../../props';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const SegmentedControlItemRoot: string[] = [
|
|
4
4
|
// Layout
|
|
5
5
|
'flex',
|
|
6
6
|
'items-center',
|
|
@@ -25,7 +25,7 @@ export const SegmentedControlsItemRoot: string[] = [
|
|
|
25
25
|
'dark:selected:enabled:shadow-card-dark',
|
|
26
26
|
];
|
|
27
27
|
|
|
28
|
-
export const
|
|
28
|
+
export const SegmentedControlItemRootSizes: Record<SegmentedControlSize, string[]> = {
|
|
29
29
|
'm': [
|
|
30
30
|
// Box
|
|
31
31
|
'h-[44px] md:h-[36px]',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SegmentedControlSize } from './props';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const SegmentedControlRoot: string[] = [
|
|
4
4
|
// Layout
|
|
5
5
|
'grid',
|
|
6
6
|
'grid-flow-col',
|
|
@@ -18,7 +18,7 @@ export const SegmentedControlsRoot: string[] = [
|
|
|
18
18
|
'dark:theme-background-surface-variant-dark',
|
|
19
19
|
];
|
|
20
20
|
|
|
21
|
-
export const
|
|
21
|
+
export const SegmentedControlRootSizes: Record<SegmentedControlSize, string[]> = {
|
|
22
22
|
'm': [],
|
|
23
23
|
's': [],
|
|
24
24
|
};
|