@globalbrain/sefirot 3.27.2 → 3.28.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.
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div class="SControlActionBar">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <style scoped lang="postcss">
8
+ .SControlActionBar {
9
+ display: flex;
10
+ align-items: center;
11
+ }
12
+ </style>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import { useControlSize } from '../composables/Control'
3
+ import SButton from './SButton.vue'
4
+
5
+ defineProps<{
6
+ as?: string
7
+ icon?: any
8
+ }>()
9
+
10
+ defineEmits<{
11
+ (e: 'click'): void
12
+ }>()
13
+
14
+ const size = useControlSize()
15
+ </script>
16
+
17
+ <template>
18
+ <div class="SControlActionBarButton">
19
+ <SButton
20
+ :tag="as"
21
+ type="text"
22
+ mode="mute"
23
+ :size="size"
24
+ :icon="icon"
25
+ block
26
+ @click="$emit('click')"
27
+ />
28
+ </div>
29
+ </template>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import IconX from '@iconify-icons/ph/x-bold'
3
+ import SControlActionBarButton from './SControlActionBarButton.vue'
4
+
5
+ defineProps<{
6
+ as?: string
7
+ }>()
8
+
9
+ defineEmits<{
10
+ (e: 'click'): void
11
+ }>()
12
+ </script>
13
+
14
+ <template>
15
+ <div class="SControlActionBarClose">
16
+ <SControlActionBarButton
17
+ :as="as"
18
+ :icon="IconX"
19
+ @click="$emit('click')"
20
+ />
21
+ </div>
22
+ </template>
@@ -0,0 +1,38 @@
1
+ <script setup lang="ts">
2
+ import IconArrowsInLineVertical from '@iconify-icons/ph/arrows-in-line-vertical-bold'
3
+ import IconArrowsOutLineVertical from '@iconify-icons/ph/arrows-out-line-vertical-bold'
4
+ import { computed, shallowRef } from 'vue'
5
+ import { useCardState } from '../composables/Card'
6
+ import SControlActionBarButton from './SControlActionBarButton.vue'
7
+
8
+ const props = defineProps<{
9
+ as?: string
10
+ collapsed?: boolean
11
+ }>()
12
+
13
+ defineEmits<{
14
+ (e: 'click'): void
15
+ }>()
16
+
17
+ const { isCollapsed, setCollapse, toggleCollapse } = useCardState()
18
+
19
+ setCollapse(props.collapsed)
20
+
21
+ const el = shallowRef<HTMLElement | null>(null)
22
+
23
+ const icon = computed(() => {
24
+ return isCollapsed.value
25
+ ? IconArrowsOutLineVertical
26
+ : IconArrowsInLineVertical
27
+ })
28
+ </script>
29
+
30
+ <template>
31
+ <div class="SControlActionBarCollapse" ref="el">
32
+ <SControlActionBarButton
33
+ :as="as"
34
+ :icon="icon"
35
+ @click="toggleCollapse"
36
+ />
37
+ </div>
38
+ </template>
@@ -35,4 +35,9 @@ defineProps<{
35
35
  gap: 8px;
36
36
  height: 24px;
37
37
  }
38
+
39
+ .name {
40
+ line-height: 24px;
41
+ font-size: 14px;
42
+ }
38
43
  </style>
@@ -6,6 +6,8 @@ import SDescEmpty from './SDescEmpty.vue'
6
6
 
7
7
  const props = defineProps<{
8
8
  value?: number | null
9
+ leadUnit?: string
10
+ trailUnit?: string
9
11
  separator?: boolean
10
12
  }>()
11
13
 
@@ -26,21 +28,45 @@ const _value = computed(() => {
26
28
 
27
29
  <template>
28
30
  <div v-if="_value" class="SDescNumber">
31
+ <div v-if="leadUnit" class="lead-unit">
32
+ {{ leadUnit }}
33
+ </div>
29
34
  <div class="value">
30
35
  {{ _value }}
31
36
  </div>
37
+ <div v-if="trailUnit" class="trail-unit">
38
+ {{ trailUnit }}
39
+ </div>
32
40
  </div>
33
41
  <SDescEmpty v-else />
34
42
  </template>
35
43
 
36
44
  <style scoped lang="postcss">
37
- .value {
45
+ .SDescNumber {
46
+ display: flex;
47
+ align-items: center;
48
+ gap: 4px;
49
+ }
50
+
51
+ .value,
52
+ .lead-unit,
53
+ .trail-unit {
38
54
  line-height: 24px;
39
55
  font-size: 14px;
40
56
  font-weight: 400;
57
+ }
58
+
59
+ .value {
60
+ flex-grow: 1;
41
61
  font-feature-settings: "tnum";
42
62
  white-space: nowrap;
43
63
  overflow: hidden;
44
64
  text-overflow: ellipsis;
45
65
  }
66
+
67
+ .lead-unit,
68
+ .trail-unit {
69
+ flex-shrink: 0;
70
+ color: var(--c-text-2);
71
+ }
46
72
  </style>
@@ -1,5 +1,9 @@
1
1
  import { type App } from 'vue'
2
2
  import SControl from '../components/SControl.vue'
3
+ import SControlActionBar from '../components/SControlActionBar.vue'
4
+ import SControlActionBarButton from '../components/SControlActionBarButton.vue'
5
+ import SControlActionBarClose from '../components/SControlActionBarClose.vue'
6
+ import SControlActionBarCollapse from '../components/SControlActionBarCollapse.vue'
3
7
  import SControlActionMenu from '../components/SControlActionMenu.vue'
4
8
  import SControlButton from '../components/SControlButton.vue'
5
9
  import SControlCenter from '../components/SControlCenter.vue'
@@ -11,6 +15,10 @@ import SControlText from '../components/SControlText.vue'
11
15
 
12
16
  export function mixin(app: App): void {
13
17
  app.component('SControl', SControl)
18
+ app.component('SControlActionBar', SControlActionBar)
19
+ app.component('SControlActionBarButton', SControlActionBarButton)
20
+ app.component('SControlActionBarClose', SControlActionBarClose)
21
+ app.component('SControlActionBarCollapse', SControlActionBarCollapse)
14
22
  app.component('SControlActionMenu', SControlActionMenu)
15
23
  app.component('SControlButton', SControlButton)
16
24
  app.component('SControlCenter', SControlCenter)
@@ -24,6 +32,9 @@ export function mixin(app: App): void {
24
32
  declare module 'vue' {
25
33
  export interface GlobalComponents {
26
34
  SControl: typeof SControl
35
+ SControlActionBar: typeof SControlActionBar
36
+ SControlActionBarButton: typeof SControlActionBarButton
37
+ SControlActionBarClose: typeof SControlActionBarClose
27
38
  SControlActionMenu: typeof SControlActionMenu
28
39
  SControlButton: typeof SControlButton
29
40
  SControlCenter: typeof SControlCenter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "3.27.2",
3
+ "version": "3.28.0",
4
4
  "packageManager": "pnpm@8.14.3",
5
5
  "description": "Vue Components for Global Brain Design System.",
6
6
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",