@opendesign-plus/components 0.0.1-rc.24 → 0.0.1-rc.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus/components",
3
- "version": "0.0.1-rc.24",
3
+ "version": "0.0.1-rc.25",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -32,8 +32,8 @@
32
32
  "dayjs": "^1.11.13",
33
33
  "video.js": "^8.23.7",
34
34
  "vue-dompurify-html": "^3.1.2",
35
- "@opendesign-plus/composables": "0.0.1-rc.8",
36
- "@opendesign-plus/styles": "0.0.1-rc.2"
35
+ "@opendesign-plus/styles": "0.0.1-rc.2",
36
+ "@opendesign-plus/composables": "0.0.1-rc.8"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@vitejs/plugin-vue": "^5.1.0",
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
- import { Component, computed } from 'vue';
3
- import { OIcon, OSwitch } from '@opensig/opendesign';
2
+ import { computed } from 'vue';
3
+ import { OIcon, OSwitch, OIconSun, OIconMoon } from '@opensig/opendesign';
4
4
  import { useScreen } from '@opendesign-plus/composables';
5
5
 
6
6
  import IconSun from '~icons/components/icon-sun.svg';
@@ -11,8 +11,7 @@ export interface OThemeSwitcherPropsT {
11
11
  type?: 'auto' | 'common' | 'mobile';
12
12
  lightValue?: string;
13
13
  darkValue?: string;
14
- lightIcon?: Component;
15
- darkIcon?: Component;
14
+ disabled?: boolean;
16
15
  }
17
16
 
18
17
  export interface OThemeSwitcherEmitsT {
@@ -25,8 +24,7 @@ const props = withDefaults(defineProps<OThemeSwitcherPropsT>(), {
25
24
  type: 'auto',
26
25
  lightValue: 'light',
27
26
  darkValue: 'dark',
28
- lightIcon: IconSun,
29
- darkIcon: IconMoon,
27
+ disabled: false,
30
28
  });
31
29
 
32
30
  const emit = defineEmits<OThemeSwitcherEmitsT>();
@@ -37,7 +35,7 @@ const switchVal = computed({
37
35
  get() {
38
36
  return props.theme;
39
37
  },
40
- set(val) {
38
+ set(val: string) {
41
39
  emit('update:theme', val);
42
40
  emit('change', val);
43
41
  },
@@ -48,13 +46,17 @@ const isCommon = computed(() => {
48
46
  });
49
47
 
50
48
  const toggleTheme = () => {
49
+ if (props.disabled) {
50
+ return;
51
+ }
52
+
51
53
  switchVal.value = switchVal.value === props.lightValue ? props.darkValue : props.lightValue;
52
54
  };
53
55
  </script>
54
56
 
55
57
  <template>
56
58
  <div class="o-theme-switcher">
57
- <div v-if="isCommon" class="o-theme-switcher-common" @click="toggleTheme">
59
+ <div v-if="isCommon" class="o-theme-switcher-common" :class="{ disabled }" @click="toggleTheme">
58
60
  <OIcon class="o-theme-icon">
59
61
  <IconMoon v-if="switchVal === lightValue" />
60
62
  <IconSun v-else />
@@ -62,16 +64,18 @@ const toggleTheme = () => {
62
64
  </div>
63
65
 
64
66
  <div v-else class="o-theme-switcher-mobile">
65
- <OSwitch v-model="switchVal" class="o-theme-switch" :checked-value="darkValue" :unchecked-value="lightValue">
66
- <template #on>
67
- <OIcon class="o-theme-icon">
68
- <IconSun />
69
- </OIcon>
67
+ <OSwitch v-model="switchVal" class="o-theme-switch" :checked-value="lightValue" :unchecked-value="darkValue" :disabled="disabled">
68
+ <template #inactive>
69
+ <OIconMoon />
70
+ </template>
71
+ <template #active>
72
+ <OIconSun />
70
73
  </template>
71
74
  <template #off>
72
- <OIcon class="o-theme-icon">
73
- <IconMoon />
74
- </OIcon>
75
+ <OIconSun />
76
+ </template>
77
+ <template #on>
78
+ <OIconMoon />
75
79
  </template>
76
80
  </OSwitch>
77
81
  </div>
@@ -80,29 +84,49 @@ const toggleTheme = () => {
80
84
 
81
85
  <style lang="scss" scoped>
82
86
  .o-theme-switcher-common {
83
- cursor: pointer;
84
- width: 20px;
85
- height: 20px;
86
87
  display: flex;
87
88
  align-items: center;
89
+ width: var(--o-icon_size-m);
90
+ height: var(--o-icon_size-m);
91
+ font-size: var(--o-icon_size-m);
92
+
93
+ @include respond-to('pad_h') {
94
+ width: var(--o-icon_size-s);
95
+ height: var(--o-icon_size-s);
96
+ font-size: var(--o-icon_size-s);
97
+ }
98
+ }
99
+
100
+ .o-theme-switcher-common:not(.disabled) {
101
+ cursor: pointer;
88
102
 
89
103
  .o-theme-icon {
90
- font-size: 24px;
91
- color: var(--o-color-info1);
104
+ color: var(--o-color-info2);
92
105
 
93
106
  @include hover {
94
- color: var(--o-color-primary1);
107
+ color: var(--o-color-primary2);
108
+ background-color: var(--o-color-control2-light);
109
+ border-radius: var(--o-radius-xs);
110
+ }
111
+
112
+ &:active {
113
+ color: var(--o-color-primary3);
95
114
  }
96
115
  }
97
116
  }
98
117
 
118
+ .o-theme-switcher-common.disabled {
119
+ cursor: not-allowed;
120
+
121
+ .o-theme-icon {
122
+ color: var(--o-color-info4);
123
+ }
124
+ }
125
+
99
126
  .o-theme-switcher-mobile {
100
127
  .o-theme-switch {
101
- background-color: var(--o-color-control1-light);
102
-
103
- .o-theme-icon {
104
- color: var(--o-color-white);
105
- }
128
+ --switch-handler-color: var(--o-color-white);
129
+ --switch-color: var(--o-color-info4);
106
130
  }
107
131
  }
108
132
  </style>
@@ -24,11 +24,11 @@ const OMeetingPlayback = Object.assign(_OMeetingPlayback, {
24
24
 
25
25
  const OMeetingSigCalendar = Object.assign(_OMeetingSigCalendar, {
26
26
  install(app: App) {
27
- app.component('OMeetingSigCalendar', _OMeetingMyCalendar);
27
+ app.component('OMeetingSigCalendar', _OMeetingSigCalendar);
28
28
  },
29
29
  });
30
30
 
31
- const OMeetingMyCalendar = Object.assign(_OMeetingSigCalendar, {
31
+ const OMeetingMyCalendar = Object.assign(_OMeetingMyCalendar, {
32
32
  install(app: App) {
33
33
  app.component('OMeetingMyCalendar', _OMeetingMyCalendar);
34
34
  },